Author: clarence_guo
Date: Mon May 26 03:03:05 2014
New Revision: 1597503
URL: http://svn.apache.org/r1597503
Log:
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
Modified:
openoffice/trunk/main/oox/inc/oox/xls/richstring.hxx
openoffice/trunk/main/oox/source/xls/richstring.cxx
Modified: openoffice/trunk/main/oox/inc/oox/xls/richstring.hxx
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/oox/inc/oox/xls/richstring.hxx?rev=1597503&r1=1597502&r2=1597503&view=diff
==============================================================================
--- openoffice/trunk/main/oox/inc/oox/xls/richstring.hxx (original)
+++ openoffice/trunk/main/oox/inc/oox/xls/richstring.hxx Mon May 26 03:03:05
2014
@@ -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;
Modified: openoffice/trunk/main/oox/source/xls/richstring.cxx
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/oox/source/xls/richstring.cxx?rev=1597503&r1=1597502&r2=1597503&view=diff
==============================================================================
--- openoffice/trunk/main/oox/source/xls/richstring.cxx (original)
+++ openoffice/trunk/main/oox/source/xls/richstring.cxx Mon May 26 03:03:05 2014
@@ -19,8 +19,6 @@
*
*************************************************************/
-
-
#include "oox/xls/richstring.hxx"
#include <com/sun/star/text/XText.hpp>
@@ -59,7 +57,8 @@ inline bool lclNeedsRichTextFormat( cons
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 R
pFont->writeToPropertySet( aPropSet, FONT_PROPTYPE_TEXT );
}
}
+
+ mbConverted = true;
}
// ----------------------------------------------------------------------------