From 69d508e3e2e5e879188399f859638d77bf159c0d Mon Sep 17 00:00:00 2001 From: Nick Burch Date: Sat, 12 Jul 2008 17:21:54 +0000 Subject: Support for cloning one extended format record onto another, plus tests git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@676203 13f79535-47bb-0310-9956-ffa450edef68 --- .../poi/hssf/record/ExtendedFormatRecord.java | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/java') diff --git a/src/java/org/apache/poi/hssf/record/ExtendedFormatRecord.java b/src/java/org/apache/poi/hssf/record/ExtendedFormatRecord.java index c668d5f876..ae98387671 100644 --- a/src/java/org/apache/poi/hssf/record/ExtendedFormatRecord.java +++ b/src/java/org/apache/poi/hssf/record/ExtendedFormatRecord.java @@ -1814,6 +1814,27 @@ public class ExtendedFormatRecord { return sid; } + + /** + * Clones all the style information from another + * ExtendedFormatRecord, onto this one. This + * will then hold all the same style options. + * + * If The source ExtendedFormatRecord comes from + * a different Workbook, you will need to sort + * out the font and format indicies yourself! + */ + public void cloneStyleFrom(ExtendedFormatRecord source) { + field_1_font_index = source.field_1_font_index; + field_2_format_index = source.field_2_format_index; + field_3_cell_options = source.field_3_cell_options; + field_4_alignment_options = source.field_4_alignment_options; + field_5_indention_options = source.field_5_indention_options; + field_6_border_options = source.field_6_border_options; + field_7_palette_options = source.field_7_palette_options; + field_8_adtl_palette_options = source.field_8_adtl_palette_options; + field_9_fill_palette_options = source.field_9_fill_palette_options; + } public int hashCode() { final int prime = 31; -- cgit v1.2.3