Kaydet (Commit) 7ef1a64b authored tarafından Noel Power's avatar Noel Power

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
üst e8321a37
......@@ -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; }
......
......@@ -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;
......@@ -2579,13 +2585,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();
}
......@@ -3110,7 +3125,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 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment