summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@collabora.co.uk>2014-04-06 14:49:33 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2014-04-06 16:27:38 +0200
commitac6773e1e3e1382990c0f1942001b8b07cdc4682 (patch)
tree0ca8e5b0d534f7912357aef64d633919ac21402c
parent7cc6de1cc2cfb466131072c2a1cd99c4a6279ebc (diff)
import dxf number format record, related fdo#76209
Thanks to Morten Welinder for pointing to the missing pieces. Change-Id: I5eb447161ac5d79257a64acaa01e56374ba81587
-rw-r--r--sc/source/filter/excel/xicontent.cxx14
-rw-r--r--sc/source/filter/excel/xistyle.cxx19
-rw-r--r--sc/source/filter/inc/xistyle.hxx4
-rw-r--r--sc/source/filter/inc/xlcontent.hxx2
4 files changed, 37 insertions, 2 deletions
diff --git a/sc/source/filter/excel/xicontent.cxx b/sc/source/filter/excel/xicontent.cxx
index 5c04f8ae3d82..4016929e94dd 100644
--- a/sc/source/filter/excel/xicontent.cxx
+++ b/sc/source/filter/excel/xicontent.cxx
@@ -514,9 +514,9 @@ void XclImpCondFormat::ReadCF( XclImpStream& rStrm )
sal_uInt8 nType(0), nOperator(0);
sal_uInt16 nFmlaSize1(0), nFmlaSize2(0);
sal_uInt32 nFlags(0);
+ sal_uInt16 nFlagsExtended(0);
- rStrm >> nType >> nOperator >> nFmlaSize1 >> nFmlaSize2 >> nFlags;
- rStrm.Ignore( 2 );
+ rStrm >> nType >> nOperator >> nFmlaSize1 >> nFmlaSize2 >> nFlags >> nFlagsExtended;
// *** mode and comparison operator ***
@@ -557,6 +557,16 @@ void XclImpCondFormat::ReadCF( XclImpStream& rStrm )
const XclImpPalette& rPalette = GetPalette();
+ // number format
+
+ if( get_flag( nFlags, EXC_CF_BLOCK_NUMFMT ) )
+ {
+ XclImpNumFmtBuffer& rNumFmtBuffer = GetRoot().GetNumFmtBuffer();
+ bool bIFmt = get_flag( nFlags, EXC_CF_IFMT_USER );
+ sal_uInt16 nFormat = rNumFmtBuffer.ReadCFFormat( rStrm, bIFmt );
+ rNumFmtBuffer.FillToItemSet( rStyleItemSet, nFormat );
+ }
+
// *** font block ***
if( ::get_flag( nFlags, EXC_CF_BLOCK_FONT ) )
diff --git a/sc/source/filter/excel/xistyle.cxx b/sc/source/filter/excel/xistyle.cxx
index 4ed6ca4d9f8e..55549cbc9fd8 100644
--- a/sc/source/filter/excel/xistyle.cxx
+++ b/sc/source/filter/excel/xistyle.cxx
@@ -650,6 +650,25 @@ void XclImpNumFmtBuffer::ReadFormat( XclImpStream& rStrm )
}
}
+sal_uInt16 XclImpNumFmtBuffer::ReadCFFormat( XclImpStream& rStrm, bool bIFmt )
+{
+ // internal number format ?
+ if(bIFmt)
+ {
+ rStrm.Ignore(1);
+ sal_uInt8 nIndex;
+ rStrm >> nIndex;
+ return nIndex;
+ }
+ else
+ {
+ OUString aFormat = rStrm.ReadUniString();
+ InsertFormat( mnNextXclIdx, aFormat );
+ ++mnNextXclIdx;
+ return mnNextXclIdx - 1;
+ }
+}
+
void XclImpNumFmtBuffer::CreateScFormats()
{
OSL_ENSURE( maIndexMap.empty(), "XclImpNumFmtBuffer::CreateScFormats - already created" );
diff --git a/sc/source/filter/inc/xistyle.hxx b/sc/source/filter/inc/xistyle.hxx
index 9271d5f230c1..015263d331cb 100644
--- a/sc/source/filter/inc/xistyle.hxx
+++ b/sc/source/filter/inc/xistyle.hxx
@@ -216,6 +216,10 @@ public:
/** Reads a FORMAT record. */
void ReadFormat( XclImpStream& rStrm );
+
+ /** Read NumFmt from conditional format record */
+ sal_uInt16 ReadCFFormat( XclImpStream& rStrm, bool bIFmt );
+
/** Creates the number formats in the Calc document. */
void CreateScFormats();
diff --git a/sc/source/filter/inc/xlcontent.hxx b/sc/source/filter/inc/xlcontent.hxx
index 416923f49eb3..3e0fefc6c5f7 100644
--- a/sc/source/filter/inc/xlcontent.hxx
+++ b/sc/source/filter/inc/xlcontent.hxx
@@ -80,10 +80,12 @@ const sal_uInt32 EXC_CF_AREA_FGCOLOR = 0x00020000; /// Foreground color
const sal_uInt32 EXC_CF_AREA_BGCOLOR = 0x00040000; /// Background color modified?
const sal_uInt32 EXC_CF_AREA_ALL = 0x00070000; /// Any area attribute modified?
const sal_uInt32 EXC_CF_ALLDEFAULT = 0x003FFFFF; /// Default flags.
+const sal_uInt32 EXC_CF_BLOCK_NUMFMT = 0x02000000; /// Font block present?
const sal_uInt32 EXC_CF_BLOCK_FONT = 0x04000000; /// Font block present?
const sal_uInt32 EXC_CF_BLOCK_ALIGNMENT = 0x08000000; /// Alignment block present?
const sal_uInt32 EXC_CF_BLOCK_BORDER = 0x10000000; /// Border block present?
const sal_uInt32 EXC_CF_BLOCK_AREA = 0x20000000; /// Pattern block present?
+const sal_uInt32 EXC_CF_IFMT_USER = 0x1; /// NumberFormat String or Id?
const sal_uInt32 EXC_CF_FONT_STYLE = 0x00000002; /// Font posture or weight modified?
const sal_uInt32 EXC_CF_FONT_STRIKEOUT = 0x00000080; /// Font cancellation modified?