incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m..@apache.org
Subject svn commit: r1172134 - in /incubator/ooo/trunk/main/oox: inc/oox/xls/richstring.hxx source/xls/commentsbuffer.cxx source/xls/richstring.cxx source/xls/worksheethelper.cxx
Date Sat, 17 Sep 2011 22:44:14 GMT
Author: mst
Date: Sat Sep 17 22:44:14 2011
New Revision: 1172134

URL: http://svn.apache.org/viewvc?rev=1172134&view=rev
Log:
calc69: #i117836# repair import of multiline cells and cells with leading font escapement

# HG changeset patch
# User Daniel Rentz [dr] <daniel.rentz@oracle.com>
# Date 1302706976 -7200
# Node ID 054b0a0a1d969e305d6f4d3b9264c81ae8773333
# Parent  12fa3ee3d107fb6bbb980de805e20c6c3ca2408a

Modified:
    incubator/ooo/trunk/main/oox/inc/oox/xls/richstring.hxx
    incubator/ooo/trunk/main/oox/source/xls/commentsbuffer.cxx
    incubator/ooo/trunk/main/oox/source/xls/richstring.cxx
    incubator/ooo/trunk/main/oox/source/xls/worksheethelper.cxx

Modified: incubator/ooo/trunk/main/oox/inc/oox/xls/richstring.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/oox/inc/oox/xls/richstring.hxx?rev=1172134&r1=1172133&r2=1172134&view=diff
==============================================================================
--- incubator/ooo/trunk/main/oox/inc/oox/xls/richstring.hxx (original)
+++ incubator/ooo/trunk/main/oox/inc/oox/xls/richstring.hxx Sat Sep 17 22:44:14 2011
@@ -271,6 +271,7 @@ public:
             formatting for the first text portion, e.g. font escapement. */
     void                convert(
                             const ::com::sun::star::uno::Reference< ::com::sun::star::text::XText
>& rxText,
+                            bool bReplaceOld,
                             const Font* pFirstPortionFont = 0 ) const;
 
 private:

Modified: incubator/ooo/trunk/main/oox/source/xls/commentsbuffer.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/oox/source/xls/commentsbuffer.cxx?rev=1172134&r1=1172133&r2=1172134&view=diff
==============================================================================
--- incubator/ooo/trunk/main/oox/source/xls/commentsbuffer.cxx (original)
+++ incubator/ooo/trunk/main/oox/source/xls/commentsbuffer.cxx Sat Sep 17 22:44:14 2011
@@ -170,7 +170,7 @@ void Comment::finalizeImport()
         // insert text and convert text formatting
         maModel.mxText->finalizeImport();
         Reference< XText > xAnnoText( xAnnoShape, UNO_QUERY_THROW );
-        maModel.mxText->convert( xAnnoText );
+        maModel.mxText->convert( xAnnoText, true );
     }
     catch( Exception& )
     {

Modified: incubator/ooo/trunk/main/oox/source/xls/richstring.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/oox/source/xls/richstring.cxx?rev=1172134&r1=1172133&r2=1172134&view=diff
==============================================================================
--- incubator/ooo/trunk/main/oox/source/xls/richstring.cxx (original)
+++ incubator/ooo/trunk/main/oox/source/xls/richstring.cxx Sat Sep 17 22:44:14 2011
@@ -108,10 +108,10 @@ void RichStringPortion::convert( const R
             PropertySet aPropSet( xRange );
             mxFont->writeToPropertySet( aPropSet, FONT_PROPTYPE_TEXT );
         }
-
-        /*  Some font attributes cannot be set to cell formattiing in Calc but
-            require to use rich formatting, e.g. font escapement. */
-        if( lclNeedsRichTextFormat( pFont ) )
+        /*  Some font attributes cannot be set to cell formatting in Calc but
+            require to use rich formatting, e.g. font escapement. But do not
+            use the passed font if this portion has its own font. */
+        else if( lclNeedsRichTextFormat( pFont ) )
         {
             PropertySet aPropSet( xRange );
             pFont->writeToPropertySet( aPropSet, FONT_PROPTYPE_TEXT );
@@ -522,19 +522,18 @@ bool RichString::extractPlainString( OUS
     if( (maTextPortions.size() == 1) && !maTextPortions.front()->hasFont() &&
!lclNeedsRichTextFormat( pFirstPortionFont ) )
     {
         orString = maTextPortions.front()->getText();
-        return true;
+        return orString.indexOf( '\x0A' ) < 0;
     }
     return false;
 }
 
-void RichString::convert( const Reference< XText >& rxText, const Font* pFirstPortionFont
) const
+void RichString::convert( const Reference< XText >& rxText, bool bReplaceOld, const
Font* pFirstPortionFont ) const
 {
-    bool bReplace = true;
     for( PortionVector::const_iterator aIt = maTextPortions.begin(), aEnd = maTextPortions.end();
aIt != aEnd; ++aIt )
     {
-        (*aIt)->convert( rxText, pFirstPortionFont, bReplace );
+        (*aIt)->convert( rxText, pFirstPortionFont, bReplaceOld );
         pFirstPortionFont = 0;  // use passed font for first portion only
-        bReplace = false;       // do not replace first portion text with following portions
+        bReplaceOld = false;    // do not replace first portion text with following portions
     }
 }
 

Modified: incubator/ooo/trunk/main/oox/source/xls/worksheethelper.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/oox/source/xls/worksheethelper.cxx?rev=1172134&r1=1172133&r2=1172134&view=diff
==============================================================================
--- incubator/ooo/trunk/main/oox/source/xls/worksheethelper.cxx (original)
+++ incubator/ooo/trunk/main/oox/source/xls/worksheethelper.cxx Sat Sep 17 22:44:14 2011
@@ -1667,7 +1667,10 @@ void WorksheetHelper::putRichString( con
 {
     Reference< XText > xText( getCell( rAddress ), UNO_QUERY );
     OSL_ENSURE( xText.is(), "WorksheetHelper::putRichString - missing text interface" );
-    rString.convert( xText, pFirstPortionFont );
+    /*  Passing false will always append the portions to the XText. This is
+        essential for special rich formatting attributes at the leading text
+        portion supported by edit cells only, e.g. font escapement. */
+    rString.convert( xText, false, pFirstPortionFont );
 }
 
 void WorksheetHelper::putFormulaTokens( const CellAddress& rAddress, const ApiTokenSequence&
rTokens ) const



Mime
View raw message