summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@collabora.co.uk>2014-04-06 14:38:55 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2014-04-06 16:27:37 +0200
commit74116032d3ebab422ba8508f42198d101822024f (patch)
tree46916c18f8b6f558299a03556198db922e3c9c24 /sc
parent29eaf927d7ddede41889b70c25a991382bd5c05a (diff)
import alignment dxf record, related fdo#76209
Thanks to Morten Welinder for pointing to the missing piece. Change-Id: Ib527eb4f7d90fa1abc13446ac61631cf1a6a6e67
Diffstat (limited to 'sc')
-rw-r--r--sc/source/filter/excel/xicontent.cxx12
-rw-r--r--sc/source/filter/excel/xistyle.cxx11
-rw-r--r--sc/source/filter/inc/xistyle.hxx2
-rw-r--r--sc/source/filter/inc/xlcontent.hxx1
4 files changed, 26 insertions, 0 deletions
diff --git a/sc/source/filter/excel/xicontent.cxx b/sc/source/filter/excel/xicontent.cxx
index bb5ec446abc0..5c04f8ae3d82 100644
--- a/sc/source/filter/excel/xicontent.cxx
+++ b/sc/source/filter/excel/xicontent.cxx
@@ -566,6 +566,18 @@ void XclImpCondFormat::ReadCF( XclImpStream& rStrm )
aFont.FillToItemSet( rStyleItemSet, EXC_FONTITEM_CELL );
}
+ // alignment
+ if( get_flag( nFlags, EXC_CF_BLOCK_ALIGNMENT ) )
+ {
+ XclImpCellAlign aAlign;
+ sal_uInt16 nAlign(0);
+ sal_uInt16 nAlignMisc(0);
+ rStrm >> nAlign >> nAlignMisc;
+ aAlign.FillFromCF( nAlign, nAlignMisc );
+ aAlign.FillToItemSet( rStyleItemSet, NULL );
+ rStrm.Ignore(4);
+ }
+
// *** border block ***
if( ::get_flag( nFlags, EXC_CF_BLOCK_BORDER ) )
diff --git a/sc/source/filter/excel/xistyle.cxx b/sc/source/filter/excel/xistyle.cxx
index 132a0d3404e5..4ed6ca4d9f8e 100644
--- a/sc/source/filter/excel/xistyle.cxx
+++ b/sc/source/filter/excel/xistyle.cxx
@@ -758,6 +758,17 @@ void XclImpCellAlign::FillFromXF8( sal_uInt16 nAlign, sal_uInt16 nMiscAttrib )
mnTextDir = ::extract_value< sal_uInt8 >( nMiscAttrib, 6, 2 ); // new in BIFF8
}
+void XclImpCellAlign::FillFromCF( sal_uInt16 nAlign, sal_uInt16 nMiscAttrib )
+{
+ mnHorAlign = extract_value< sal_uInt8 >( nAlign, 0, 3 );
+ mbLineBreak = get_flag< sal_uInt8 >( nAlign, EXC_XF_LINEBREAK );
+ mnVerAlign = ::extract_value< sal_uInt8 >( nAlign, 4, 3 );
+ mnRotation = ::extract_value< sal_uInt8 >( nAlign, 8, 8 );
+ mnIndent = ::extract_value< sal_uInt8 >( nMiscAttrib, 0, 4 );
+ mbShrink = ::get_flag( nMiscAttrib, EXC_XF8_SHRINK );
+ mnTextDir = ::extract_value< sal_uInt8 >( nMiscAttrib, 6, 2 );
+}
+
void XclImpCellAlign::FillToItemSet( SfxItemSet& rItemSet, const XclImpFont* pFont, bool bSkipPoolDefs ) const
{
// horizontal alignment
diff --git a/sc/source/filter/inc/xistyle.hxx b/sc/source/filter/inc/xistyle.hxx
index 205d7f3a152a..9271d5f230c1 100644
--- a/sc/source/filter/inc/xistyle.hxx
+++ b/sc/source/filter/inc/xistyle.hxx
@@ -274,6 +274,8 @@ struct XclImpCellAlign : public XclCellAlign
void FillFromXF5( sal_uInt16 nAlign );
/** Fills this struct with BIFF8 XF record data. */
void FillFromXF8( sal_uInt16 nAlign, sal_uInt16 nMiscAttrib );
+ /** Fills this struct with CF record data. */
+ void FillFromCF( sal_uInt16 nAlign, sal_uInt16 nMiscAttrib );
/** Inserts items representing this alignment style into the item set.
@param bSkipPoolDefs true = Do not put items equal to pool default; false = Put all items. */
diff --git a/sc/source/filter/inc/xlcontent.hxx b/sc/source/filter/inc/xlcontent.hxx
index 9d00dcb776ad..416923f49eb3 100644
--- a/sc/source/filter/inc/xlcontent.hxx
+++ b/sc/source/filter/inc/xlcontent.hxx
@@ -81,6 +81,7 @@ const sal_uInt32 EXC_CF_AREA_BGCOLOR = 0x00040000; /// Background color
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_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?