This is an automated email from the ASF dual-hosted git repository.

damjan pushed a commit to branch AOO41X
in repository https://gitbox.apache.org/repos/asf/openoffice.git


The following commit(s) were added to refs/heads/AOO41X by this push:
     new 768bfd82c2 for #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
768bfd82c2 is described below

commit 768bfd82c2396d947d0a3b8ab5aa44cfe31f4111
Author: Clarence Guo <[email protected]>
AuthorDate: Mon May 26 03:03:05 2014 +0000

    for #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
    
    git-svn-id: https://svn.apache.org/repos/asf/openoffice/trunk@1597503 
13f79535-47bb-0310-9956-ffa450edef68
    (cherry picked from commit c0670b14b16dba0137a280c9aabcadc554988f08)
---
 main/oox/inc/oox/xls/richstring.hxx |  1 +
 main/oox/source/xls/richstring.cxx  | 10 +++++++---
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/main/oox/inc/oox/xls/richstring.hxx 
b/main/oox/inc/oox/xls/richstring.hxx
index f97ab6d1c7..3e8c46b8ba 100644
--- a/main/oox/inc/oox/xls/richstring.hxx
+++ b/main/oox/inc/oox/xls/richstring.hxx
@@ -78,6 +78,7 @@ private:
     ::rtl::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/main/oox/source/xls/richstring.cxx 
b/main/oox/source/xls/richstring.cxx
index 8c77746477..e0843350d4 100644
--- a/main/oox/source/xls/richstring.cxx
+++ b/main/oox/source/xls/richstring.cxx
@@ -19,8 +19,6 @@
  * 
  *************************************************************/
 
-
-
 #include "oox/xls/richstring.hxx"
 
 #include <com/sun/star/text/XText.hpp>
@@ -59,7 +57,8 @@ inline bool lclNeedsRichTextFormat( const Font* pFont )
 
 RichStringPortion::RichStringPortion( const WorkbookHelper& rHelper ) :
     WorkbookHelper( rHelper ),
-    mnFontId( -1 )
+    mnFontId( -1 ),
+    mbConverted( false )
 {
 }
 
@@ -89,6 +88,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 );
@@ -113,6 +115,8 @@ void RichStringPortion::convert( const Reference< XText >& 
rxText, const Font* p
             pFont->writeToPropertySet( aPropSet, FONT_PROPTYPE_TEXT );
         }
     }
+
+    mbConverted = true;
 }
 
 // ----------------------------------------------------------------------------

Reply via email to