Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index


Hi,

It would be great if somebody could review+push the attached patch to
3.4 branch(s). This is _not_ a problem in master.
Without this patch shared formula(s) would not be imported correctly in
builds from 3.4 branches.

Thanks to Markus (moggi) for debugging this to quite some level (and
also for fixing one part of the problem (defined name ranges) - that fix
is already reviewed+pushed).

Thanks & Regards,
Muthu Subramanian
diff --git a/oox/source/xls/sheetdatacontext.cxx b/oox/source/xls/sheetdatacontext.cxx
index 2f0be89..d203b88 100644
--- a/oox/source/xls/sheetdatacontext.cxx
+++ b/oox/source/xls/sheetdatacontext.cxx
@@ -227,9 +227,6 @@ void SheetDataContext::onCharacters( const OUString& rChars )
                         {
                             if( rChars.getLength() > 0 )
                                 getSharedFormulas().importSharedFmla( rChars, 
maCurrCell.maFormulaRef, maCurrCell.mnSharedId, maCurrCell.maAddress );
-                            Reference< XFormulaTokens > xTokens( maCurrCell.mxCell, 
UNO_QUERY_THROW );
-                            ExtCellFormulaContext aContext( *this, xTokens, maCurrCell.maAddress );
-                            getSharedFormulas().setSharedFormulaCell( aContext, 
maCurrCell.mnSharedId );
                         }
                     break;
 
@@ -279,6 +276,12 @@ void SheetDataContext::onEndElement()
                 maCurrCell.mnCellType = XML_TOKEN_INVALID;
             }
         }
+        if( maCurrCell.mnSharedId >= 0 )
+        {
+            Reference< XFormulaTokens > xTokens( maCurrCell.mxCell, UNO_QUERY_THROW );
+            ExtCellFormulaContext aContext( *this, xTokens, maCurrCell.maAddress );
+            getSharedFormulas().setSharedFormulaCell( aContext, maCurrCell.mnSharedId );
+        }
 
         // store the cell formatting data
         setCellFormat( maCurrCell );

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.