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 );
_______________________________________________
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice

Reply via email to