diff options
author | Noel Power <noel.power@suse.com> | 2013-06-05 16:15:53 +0100 |
---|---|---|
committer | Noel Power <noel.power@suse.com> | 2013-06-07 11:32:10 +0100 |
commit | 6d7dcfe75823e5c7e4b35ba9a05e76749546fe3c (patch) | |
tree | 8206763689e35ccf2c1b9274fb30c6c35da2c712 /sc/source | |
parent | ca2be674b105b384208373be8c485b0201134bb0 (diff) |
another attempt at followon patch for fdo#38385 attempt to detect rtl
First attempt confused things ( and was error prone ) by introducing
maStart and maEnd BorderLine members to BorderLine model. Better to
just leave maLeft & maRight and attempt to swap if RTL.
Of course tbh this is somewhat of an optimistic attempt to swap start and end borders
if needed. I am not at all sure though that I am dectecting the RTL-ness
of a cell in the correct way. There are some comments in the code in any case
that reflect my uncertainty ( hopefully they will be of use if/when some tweak
is needed )
Change-Id: Ie953d73067630f0041fa037c6120cdbda683e796
(cherry picked from commit 7ef1a64bdb8f9afaeb93e7a88219650381e0d323)
Diffstat (limited to 'sc/source')
-rw-r--r-- | sc/source/filter/inc/stylesbuffer.hxx | 2 | ||||
-rw-r--r-- | sc/source/filter/oox/stylesbuffer.cxx | 23 |
2 files changed, 21 insertions, 4 deletions
diff --git a/sc/source/filter/inc/stylesbuffer.hxx b/sc/source/filter/inc/stylesbuffer.hxx index 16d577999d3f..cbedfb3a2464 100644 --- a/sc/source/filter/inc/stylesbuffer.hxx +++ b/sc/source/filter/inc/stylesbuffer.hxx @@ -513,7 +513,7 @@ public: void importDxfBorder( sal_Int32 nElement, SequenceInputStream& rStrm ); /** Final processing after import of all style settings. */ - void finalizeImport(); + void finalizeImport( bool bRTL ); /** Returns the border model structure. */ inline const BorderModel& getModel() const { return maModel; } diff --git a/sc/source/filter/oox/stylesbuffer.cxx b/sc/source/filter/oox/stylesbuffer.cxx index 9f0c9db8e2ad..827828d1f2d3 100644 --- a/sc/source/filter/oox/stylesbuffer.cxx +++ b/sc/source/filter/oox/stylesbuffer.cxx @@ -1701,8 +1701,14 @@ void Border::importDxfBorder( sal_Int32 nElement, SequenceInputStream& rStrm ) } } -void Border::finalizeImport() +void Border::finalizeImport( bool bRTL ) { + if ( bRTL ) + { + BorderLineModel aTmp = maModel.maLeft; + maModel.maLeft = maModel.maRight; + maModel.maRight = aTmp; + } maApiData.mbBorderUsed = maModel.maLeft.mbUsed || maModel.maRight.mbUsed || maModel.maTop.mbUsed || maModel.maBottom.mbUsed; maApiData.mbDiagUsed = maModel.maDiagonal.mbUsed; @@ -2576,13 +2582,22 @@ void Dxf::finalizeImport() { if( mxFont.get() ) mxFont->finalizeImport(); + bool bRTL = false; // number format already finalized by the number formats buffer if( mxAlignment.get() ) + { mxAlignment->finalizeImport(); + // how do we detect RTL when text dir is OOX_XF_CONTEXT? ( seems you + // would need access to the cell content, which we don't here ) + if ( mxAlignment->getModel().mnTextDir == OOX_XF_TEXTDIR_RTL ) + bRTL = true; + } if( mxProtection.get() ) mxProtection->finalizeImport(); if( mxBorder.get() ) - mxBorder->finalizeImport(); + { + mxBorder->finalizeImport( bRTL ); + } if( mxFill.get() ) mxFill->finalizeImport(); } @@ -3114,7 +3129,9 @@ void StylesBuffer::finalizeImport() // number formats maNumFmts.finalizeImport(); // borders and fills - maBorders.forEachMem( &Border::finalizeImport ); + // is there a document wide RTL setting that we + // would/could need to pass to finalizeImport here ? + maBorders.forEachMem( &Border::finalizeImport, false ); maFills.forEachMem( &Fill::finalizeImport ); // style XFs and cell XFs maStyleXfs.forEachMem( &Xf::finalizeImport ); |