[Libreoffice-commits] .: 5 commits - sc/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Jan 4 11:11:14 PST 2013


 sc/source/core/data/cell.cxx            |    5 -----
 sc/source/filter/oox/formulabuffer.cxx  |   15 ++++++++-------
 sc/source/filter/oox/workbookhelper.cxx |    6 +++---
 sc/source/filter/xml/xmlcelli.cxx       |    6 +++---
 4 files changed, 14 insertions(+), 18 deletions(-)

New commits:
commit d7524b9e8bff832b305ca9ec735664607c50224f
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Fri Jan 4 20:06:07 2013 +0100

    don't forget the dependency tree during OOXML import, fdo#58863
    
    Change-Id: I8863faddd1bca0b55764d09c4ef9f959264b53ae

diff --git a/sc/source/filter/oox/formulabuffer.cxx b/sc/source/filter/oox/formulabuffer.cxx
index 720f2af..b04c9d2 100644
--- a/sc/source/filter/oox/formulabuffer.cxx
+++ b/sc/source/filter/oox/formulabuffer.cxx
@@ -122,7 +122,8 @@ void FormulaBuffer::applyCellFormula( ScDocument& rDoc, const ApiTokenSequence&
     ScAddress aCellPos;
     ScUnoConversion::FillScAddress( aCellPos, rAddress );
     ScTokenConversion::ConvertToTokenArray( rDoc, aTokenArray, rTokens );
-    ScBaseCell* pNewCell = new ScFormulaCell( &rDoc, aCellPos, &aTokenArray );
+    ScFormulaCell* pNewCell = new ScFormulaCell( &rDoc, aCellPos, &aTokenArray );
+    pNewCell->StartListeningTo( &rDoc );
     rDoc.PutCell( aCellPos, pNewCell, sal_True );
 }
 
commit 63b5af3d1f355a5f9649302058b32124ab262a20
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Fri Jan 4 20:04:54 2013 +0100

    don't forget the dependency tree during formula import
    
    Change-Id: I0a9137e4f72477c0cffde6056d8952aa08e13f35

diff --git a/sc/source/filter/xml/xmlcelli.cxx b/sc/source/filter/xml/xmlcelli.cxx
index 58919b0..2369dce 100644
--- a/sc/source/filter/xml/xmlcelli.cxx
+++ b/sc/source/filter/xml/xmlcelli.cxx
@@ -1025,16 +1025,16 @@ void ScXMLTableRowCellContext::PutFormulaCell( const ScAddress& rCellPos )
         if ( aText[0] == '=' && aText.getLength() > 1 )
         {
             // temporary formula string as string tokens
-            ScTokenArray* pCode = new ScTokenArray;
+            boost::scoped_ptr<ScTokenArray> pCode(new ScTokenArray);
             pCode->AddStringXML( aText );
             if( (eGrammar == formula::FormulaGrammar::GRAM_EXTERNAL) && !aFormulaNmsp.isEmpty() )
                 pCode->AddStringXML( aFormulaNmsp );
 
             pDoc->IncXMLImportedFormulaCount( aText.getLength() );
-            pNewCell = new ScFormulaCell( pDoc, rCellPos, pCode, eGrammar, MM_NONE );
-            delete pCode;
+            pNewCell = new ScFormulaCell( pDoc, rCellPos, pCode.get(), eGrammar, MM_NONE );
 
             ScFormulaCell* pFCell = static_cast<ScFormulaCell*>(pNewCell);
+            pFCell->StartListeningTo(pDoc);
             SetFormulaCell(pFCell);
         }
         else if ( aText[0] == '\'' && aText.getLength() > 1 )
commit 86024f7ff841e016c4b4616802eaadc744a5b8bf
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Fri Jan 4 19:46:43 2013 +0100

    remove unnecessary german comment
    
    Change-Id: I954015fb76089ae7d83344e8d99f6bc04587016f

diff --git a/sc/source/core/data/cell.cxx b/sc/source/core/data/cell.cxx
index bbf8976..3718976 100644
--- a/sc/source/core/data/cell.cxx
+++ b/sc/source/core/data/cell.cxx
@@ -1826,11 +1826,6 @@ void ScFormulaCell::SetDirty( bool bDirtyFlag )
             SetDirtyVar();
         else
         {
-            // Mehrfach-FormulaTracking in Load und in CompileAll
-            // nach CopyScenario und CopyBlockFromClip vermeiden.
-            // Wenn unbedingtes FormulaTracking noetig, vor SetDirty bDirty=false
-            // setzen, z.B. in CompileTokenArray
-
             // Multiple Formulas avoid tracking in Load and Copy compileAll
             // by Scenario and Copy Block From Clip.
             // If unconditional required Formula tracking is set before SetDirty
commit 9358e8f4622dd287daf9aa9a9f2bb6f7468122f8
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Fri Jan 4 18:38:10 2013 +0100

    correct indentation
    
    Change-Id: I9b57ac13a8d508c260666535ee60783dee889508

diff --git a/sc/source/filter/oox/formulabuffer.cxx b/sc/source/filter/oox/formulabuffer.cxx
index 70efcaf..720f2af 100644
--- a/sc/source/filter/oox/formulabuffer.cxx
+++ b/sc/source/filter/oox/formulabuffer.cxx
@@ -118,12 +118,12 @@ void FormulaBuffer::finalizeImport()
 
 void FormulaBuffer::applyCellFormula( ScDocument& rDoc, const ApiTokenSequence& rTokens, const ::com::sun::star::table::CellAddress& rAddress )
 {
-        ScTokenArray aTokenArray;
-        ScAddress aCellPos;
-        ScUnoConversion::FillScAddress( aCellPos, rAddress );
-        ScTokenConversion::ConvertToTokenArray( rDoc, aTokenArray, rTokens );
-        ScBaseCell* pNewCell = new ScFormulaCell( &rDoc, aCellPos, &aTokenArray );
-        rDoc.PutCell( aCellPos, pNewCell, sal_True );
+    ScTokenArray aTokenArray;
+    ScAddress aCellPos;
+    ScUnoConversion::FillScAddress( aCellPos, rAddress );
+    ScTokenConversion::ConvertToTokenArray( rDoc, aTokenArray, rTokens );
+    ScBaseCell* pNewCell = new ScFormulaCell( &rDoc, aCellPos, &aTokenArray );
+    rDoc.PutCell( aCellPos, pNewCell, sal_True );
 }
 
 void FormulaBuffer::applyCellFormulas( const std::vector< TokenAddressItem >& rVector )
@@ -170,7 +170,7 @@ void FormulaBuffer::applyArrayFormulas( const std::vector< TokenRangeAddressItem
 
 void FormulaBuffer::createSharedFormulaMapEntry( const ::com::sun::star::table::CellAddress& rAddress, sal_Int32 nSharedId, const rtl::OUString& rTokens )
 {
-     std::vector<SharedFormulaEntry>& rSharedFormulas = sharedFormulas[ rAddress.Sheet ];
+    std::vector<SharedFormulaEntry>& rSharedFormulas = sharedFormulas[ rAddress.Sheet ];
     SharedFormulaEntry aEntry( rAddress, rTokens, nSharedId );
     rSharedFormulas.push_back( aEntry );
 }
diff --git a/sc/source/filter/oox/workbookhelper.cxx b/sc/source/filter/oox/workbookhelper.cxx
index 40896b9..53d4ade 100644
--- a/sc/source/filter/oox/workbookhelper.cxx
+++ b/sc/source/filter/oox/workbookhelper.cxx
@@ -409,7 +409,6 @@ ScRangeData* WorkbookGlobals::createNamedRangeObject( OUString& orName, const Se
     return pScRangeData;
 }
 
-
 ScRangeData* WorkbookGlobals::createLocalNamedRangeObject( OUString& orName, const Sequence< FormulaToken >&  rTokens, sal_Int32 nIndex, sal_Int32 nNameFlags, sal_Int32 nTab ) const
 {
     // create the name and insert it into the Calc document
commit dfcfb0d91d23a4d1669157464bd563037766f6ec
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Fri Jan 4 18:28:50 2013 +0100

    put the function in the anonymous namespace
    
    Change-Id: I8ee07fb9d6d9144ec981c2fabc17b4005ecc87bb

diff --git a/sc/source/filter/oox/workbookhelper.cxx b/sc/source/filter/oox/workbookhelper.cxx
index c3c2fbb..40896b9 100644
--- a/sc/source/filter/oox/workbookhelper.cxx
+++ b/sc/source/filter/oox/workbookhelper.cxx
@@ -357,6 +357,9 @@ Reference< XStyle > WorkbookGlobals::getStyleObject( const OUString& rStyleName,
     OSL_ENSURE( xStyle.is(), "WorkbookGlobals::getStyleObject - cannot access style object" );
     return xStyle;
 }
+
+namespace {
+
 ScRangeData* lcl_addNewByNameAndTokens( ScDocument& rDoc, ScRangeName* pNames, const OUString& rName, const Sequence<FormulaToken>& rTokens, sal_Int16 nIndex, sal_Int32 nUnoType )
 {
     bool bDone = false;
@@ -378,8 +381,6 @@ ScRangeData* lcl_addNewByNameAndTokens( ScDocument& rDoc, ScRangeName* pNames, c
     return pNew;
 }
 
-namespace {
-
 rtl::OUString findUnusedName( const ScRangeName* pRangeName, const rtl::OUString& rSuggestedName )
 {
     rtl::OUString aNewName = rSuggestedName;


More information about the Libreoffice-commits mailing list