diff options
-rw-r--r-- | sc/source/filter/excel/xestring.cxx | 3 | ||||
-rw-r--r-- | sc/source/filter/excel/xetable.cxx | 17 |
2 files changed, 12 insertions, 8 deletions
diff --git a/sc/source/filter/excel/xestring.cxx b/sc/source/filter/excel/xestring.cxx index 4bb74066a25e..1a420b2c61d5 100644 --- a/sc/source/filter/excel/xestring.cxx +++ b/sc/source/filter/excel/xestring.cxx @@ -428,10 +428,9 @@ void XclExpString::WriteXml( XclExpXmlStream& rStrm ) const const XclExpFont* pFont = NULL; for ( ; aIt != aEnd; ++aIt ) { - // pFont getting first then pass it to run otherwise pFont is NULL. - pFont = rFonts.GetFont( aIt->mnFontIdx ); nStart = lcl_WriteRun( rStrm, GetUnicodeBuffer(), nStart, aIt->mnChar-nStart, pFont ); + pFont = rFonts.GetFont( aIt->mnFontIdx ); } lcl_WriteRun( rStrm, GetUnicodeBuffer(), nStart, GetUnicodeBuffer().size() - nStart, pFont ); diff --git a/sc/source/filter/excel/xetable.cxx b/sc/source/filter/excel/xetable.cxx index 2aa170e4d5a5..e8e4d0000269 100644 --- a/sc/source/filter/excel/xetable.cxx +++ b/sc/source/filter/excel/xetable.cxx @@ -723,13 +723,18 @@ void XclExpLabelCell::Init( const XclExpRoot& rRoot, mxText = xText; mnSstIndex = 0; - // create the cell format - sal_uInt16 nXclFont = mxText->RemoveLeadingFont(); - if( GetXFId() == EXC_XFID_NOTFOUND ) + const XclFormatRunVec& rFormats = mxText->GetFormats(); + // Create the cell format and remove formatting of the leading run + // if the entire string is equally formatted + if( rFormats.size() == 1 ) { - OSL_ENSURE( nXclFont != EXC_FONT_NOTFOUND, "XclExpLabelCell::Init - leading font not found" ); - bool bForceLineBreak = mxText->IsWrapped(); - SetXFId( rRoot.GetXFBuffer().InsertWithFont( pPattern, ApiScriptType::WEAK, nXclFont, bForceLineBreak ) ); + sal_uInt16 nXclFont = mxText->RemoveLeadingFont(); + if( GetXFId() == EXC_XFID_NOTFOUND ) + { + OSL_ENSURE( nXclFont != EXC_FONT_NOTFOUND, "XclExpLabelCell::Init - leading font not found" ); + bool bForceLineBreak = mxText->IsWrapped(); + SetXFId( rRoot.GetXFBuffer().InsertWithFont( pPattern, ApiScriptType::WEAK, nXclFont, bForceLineBreak ) ); + } } // get auto-wrap attribute from cell format |