[Libreoffice-commits] .: Branch 'libreoffice-3-6' - sc/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Oct 1 03:54:13 PDT 2012


 sc/source/filter/oox/formulabuffer.cxx |   17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

New commits:
commit 1ba25c3ada91963f095c976764d68db039be0fd8
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Fri Sep 28 01:22:44 2012 +0200

    fix vell value import from ooxml with array formulas, fdo#54558
    
    Change-Id: I3a7e30940caaaa543a178bba3008db2c6056b4d3
    Signed-off-by: Noel Power <noel.power at suse.com>

diff --git a/sc/source/filter/oox/formulabuffer.cxx b/sc/source/filter/oox/formulabuffer.cxx
index a82e195..f2b89a8 100644
--- a/sc/source/filter/oox/formulabuffer.cxx
+++ b/sc/source/filter/oox/formulabuffer.cxx
@@ -112,23 +112,23 @@ void FormulaBuffer::finalizeImport()
             applyCellFormulas( cellIt->second );
         }
 
+        ArrayFormulaDataMap::iterator itArray = cellArrayFormulas.find( nTab );
+        if ( itArray != cellArrayFormulas.end() )
+        {
+            applyArrayFormulas( itArray->second );
+        }
+
         FormulaValueMap::iterator itValues = cellFormulaValues.find( nTab );
         if ( itValues != cellFormulaValues.end() )
         {
             std::vector< ValueAddressPair > & rVector = itValues->second;
             applyCellFormulaValues( rVector );
         }
-
-        ArrayFormulaDataMap::iterator itArray = cellArrayFormulas.find( nTab );
-
-        if ( itArray != cellArrayFormulas.end() )
-        {
-            applyArrayFormulas( itArray->second );
-        }
     }
     rDoc.SetAutoNameCache( NULL );
     xFormulaBar->setPosition( 1.0 );
 }
+
 void FormulaBuffer::applyCellFormula( ScDocument& rDoc, const ApiTokenSequence& rTokens, const ::com::sun::star::table::CellAddress& rAddress )
 {
         ScTokenArray aTokenArray;
@@ -158,7 +158,8 @@ void FormulaBuffer::applyCellFormulaValues( const std::vector< ValueAddressPair
         ScAddress aCellPos;
         ScUnoConversion::FillScAddress( aCellPos, it->first );
         ScBaseCell* pBaseCell = rDoc.GetCell( aCellPos );
-        if ( pBaseCell->GetCellType() == CELLTYPE_FORMULA )
+        SAL_WARN_IF( !pBaseCell, "sc", "why is the formula not imported? bug?");
+        if ( pBaseCell && pBaseCell->GetCellType() == CELLTYPE_FORMULA )
         {
             ScFormulaCell* pCell = static_cast< ScFormulaCell* >( pBaseCell );
             pCell->SetHybridDouble( it->second );


More information about the Libreoffice-commits mailing list