Kaydet (Commit) 8a93ce4c authored tarafından Clarence Guo's avatar Clarence Guo Kaydeden (comit) Caolán McNamara

Resolves: #i124928# rich text portion could be converted several times...

each time when it is converted, the string will be set once, but in the
setString logic, the text is inserted instead of set

Repeated conversion is unnecessary, add a flag to avoid repeated conversion

(cherry picked from commit d39da407)

Conflicts:
	sc/source/filter/oox/richstring.cxx

Change-Id: I3ae08d59050ce84fb6ca0f2a82acdd27e71ba52b
üst c5abfa5f
......@@ -80,6 +80,7 @@ private:
OUString maText; /// Portion text.
FontRef mxFont; /// Embedded portion font, may be empty.
sal_Int32 mnFontId; /// Link to global font list.
bool mbConverted; /// Without repeatly convert
};
typedef ::boost::shared_ptr< RichStringPortion > RichStringPortionRef;
......
......@@ -48,7 +48,8 @@ inline bool lclNeedsRichTextFormat( const Font* pFont )
RichStringPortion::RichStringPortion( const WorkbookHelper& rHelper ) :
WorkbookHelper( rHelper ),
mnFontId( -1 )
mnFontId( -1 ),
mbConverted( false )
{
}
......@@ -78,6 +79,9 @@ void RichStringPortion::finalizeImport()
void RichStringPortion::convert( const Reference< XText >& rxText, const Font* pFont, bool bReplace )
{
if ( mbConverted )
return;
Reference< XTextRange > xRange;
if( bReplace )
xRange.set( rxText, UNO_QUERY );
......@@ -103,6 +107,8 @@ void RichStringPortion::convert( const Reference< XText >& rxText, const Font* p
pFont->writeToPropertySet( aPropSet, FONT_PROPTYPE_TEXT );
}
}
mbConverted = true;
}
void RichStringPortion::convert( ScEditEngineDefaulter& rEE, ESelection& rSelection, const Font* pFont )
......
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