summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2012-12-04 20:34:51 -0500
committerKohei Yoshida <kohei.yoshida@gmail.com>2012-12-04 20:35:16 -0500
commit8f4fd2c34fbe9501c12a35eb4b392ea93524b9bb (patch)
tree3d1f84e7d6eb10deaa95d6812773ee07aefc1b80 /sc
parentd3f629a1df701e29a03b4809984ef14e4db5ff71 (diff)
Actually let's use the internal API directly here.
Change-Id: I1690723b11db2d6f1f5101913ab68596a44c467e
Diffstat (limited to 'sc')
-rw-r--r--sc/inc/document.hxx6
-rw-r--r--sc/source/filter/oox/workbookfragment.cxx34
2 files changed, 17 insertions, 23 deletions
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 79869300ae05..d38142cbab63 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 896f64834552..3c696b677bab 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 --------------------------------------------------------------------