[Libreoffice-commits] core.git: sc/source

Clarence Guo clarence_guo at apache.org
Mon May 26 08:29:40 PDT 2014


 sc/source/filter/inc/richstring.hxx |    1 +
 sc/source/filter/oox/richstring.cxx |    8 +++++++-
 2 files changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 8a93ce4c402fc164a86b04973cac924d318b6525
Author: Clarence Guo <clarence_guo at apache.org>
Date:   Mon May 26 03:03:05 2014 +0000

    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

diff --git a/sc/source/filter/inc/richstring.hxx b/sc/source/filter/inc/richstring.hxx
index d26ce76..645a335 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 646ee82..894974f 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 )


More information about the Libreoffice-commits mailing list