[Libreoffice-commits] .: Branch 'libreoffice-4-0' - sc/inc sc/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Dec 4 17:35:51 PST 2012


 sc/inc/document.hxx                       |    6 ++---
 sc/source/filter/oox/workbookfragment.cxx |   34 ++++++++++++------------------
 2 files changed, 17 insertions(+), 23 deletions(-)

New commits:
commit 16f60be1d926369abac5d6bcb86d9dd1ba55e991
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date:   Tue Dec 4 20:34:51 2012 -0500

    Actually let's use the internal API directly here.
    
    Change-Id: I1690723b11db2d6f1f5101913ab68596a44c467e

diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 7986930..d38142c 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -1646,9 +1646,9 @@ public:
                                             SvtListener* pListener );
     void                PutInFormulaTree( ScFormulaCell* pCell );
     void                RemoveFromFormulaTree( ScFormulaCell* pCell );
-    void                CalcFormulaTree( bool bOnlyForced = false,
-                                         bool bNoProgressBar = false,
-                                         bool bDirtyFlag=true );
+    SC_DLLPUBLIC void CalcFormulaTree( bool bOnlyForced = false,
+                                       bool bNoProgressBar = false,
+                                       bool bDirtyFlag=true );
     void                ClearFormulaTree();
     void                AppendToFormulaTrack( ScFormulaCell* pCell );
     void                RemoveFromFormulaTrack( ScFormulaCell* pCell );
diff --git a/sc/source/filter/oox/workbookfragment.cxx b/sc/source/filter/oox/workbookfragment.cxx
index 896f648..3c696b6 100644
--- a/sc/source/filter/oox/workbookfragment.cxx
+++ b/sc/source/filter/oox/workbookfragment.cxx
@@ -20,7 +20,6 @@
 #include "workbookfragment.hxx"
 
 #include <com/sun/star/table/CellAddress.hpp>
-#include <com/sun/star/sheet/XCalculatable.hpp>
 #include "oox/core/filterbase.hxx"
 #include "oox/drawingml/themefragmenthandler.hxx"
 #include "oox/helper/attributelist.hxx"
@@ -316,28 +315,23 @@ void WorkbookFragment::finalizeImport()
     finalizeWorkbookImport();
 
     // Recalculate formula cells.
-    Reference< XCalculatable > xCalculatable( getDocument(), UNO_QUERY );
-    if( xCalculatable.is() )
+    bool bHardRecalc = false;
+    ScDocument& rDoc = getScDocument();
+    ScDocShell* pDocSh = static_cast<ScDocShell*>(rDoc.GetDocumentShell());
+    if (rDoc.IsUserInteractionEnabled())
     {
-        bool bHardRecalc = false;
-        ScDocument& rDoc = getScDocument();
-        if (rDoc.IsUserInteractionEnabled())
-        {
-            // Ask the user if full re-calculation is desired.
-            ScDocShell* pDocSh = static_cast<ScDocShell*>(rDoc.GetDocumentShell());
-
-            QueryBox aBox(
-                pDocSh->GetActiveDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES),
-                ScGlobal::GetRscString(STR_QUERY_FORMULA_RECALC_ONLOAD_XLS));
+        // Ask the user if full re-calculation is desired.
+        QueryBox aBox(
+            pDocSh->GetActiveDialogParent(), WinBits(WB_YES_NO | WB_DEF_YES),
+            ScGlobal::GetRscString(STR_QUERY_FORMULA_RECALC_ONLOAD_XLS));
 
-            bHardRecalc = aBox.Execute() == RET_YES;
-        }
-
-        if (bHardRecalc)
-            xCalculatable->calculateAll();
-        else
-            xCalculatable->calculate();
+        bHardRecalc = aBox.Execute() == RET_YES;
     }
+
+    if (bHardRecalc)
+        pDocSh->DoHardRecalc(false);
+    else
+        rDoc.CalcFormulaTree(false, false, false);
 }
 
 // private --------------------------------------------------------------------


More information about the Libreoffice-commits mailing list