summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClarence Guo <clarence_guo@apache.org>2014-05-26 03:03:05 +0000
committerCaolán McNamara <caolanm@redhat.com>2014-05-26 16:28:46 +0100
commit8a93ce4c402fc164a86b04973cac924d318b6525 (patch)
tree29e097ddad4ea30c769f0393ab86745eb0ea1ddb
parentc5abfa5fdf4163d1eb7226642960b957655bdb0e (diff)
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 d39da40700ceab57e9f80bd9851598e1d455f121) Conflicts: sc/source/filter/oox/richstring.cxx Change-Id: I3ae08d59050ce84fb6ca0f2a82acdd27e71ba52b
-rw-r--r--sc/source/filter/inc/richstring.hxx1
-rw-r--r--sc/source/filter/oox/richstring.cxx8
2 files changed, 8 insertions, 1 deletions
diff --git a/sc/source/filter/inc/richstring.hxx b/sc/source/filter/inc/richstring.hxx
index d26ce765c8ee..645a3354b2d4 100644
--- a/sc/source/filter/inc/richstring.hxx
+++ b/sc/source/filter/inc/richstring.hxx
@@ -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;
diff --git a/sc/source/filter/oox/richstring.cxx b/sc/source/filter/oox/richstring.cxx
index 646ee821af4c..894974fdb84d 100644
--- a/sc/source/filter/oox/richstring.cxx
+++ b/sc/source/filter/oox/richstring.cxx
@@ -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 )