summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@gmail.com>2013-03-13 15:05:26 -0400
committerKohei Yoshida <kohei.yoshida@gmail.com>2013-03-14 15:35:50 -0400
commitfd5f562ebc014ccf366bdf2e447e49b033e5e4d6 (patch)
tree824c002c0e6fe3b346322b392f5cf00fc8116a5c /sc
parent9a1524d6d62d6ef264e78977aab6bc8a385980c5 (diff)
Move progress bar handling to the scope object too.
Change-Id: Iff93958c5025e000f7e39eb71e3f91ff41db911a
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/data/documen8.cxx29
1 files changed, 19 insertions, 10 deletions
diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx
index 5c4c6f69189b..e6d1e38ddb64 100644
--- a/sc/source/core/data/documen8.cxx
+++ b/sc/source/core/data/documen8.cxx
@@ -454,13 +454,15 @@ class IdleCalcTextWidthScope
MapMode maOldMapMode;
sal_uLong mnStartTime;
bool mbNeedMore;
+ bool mbProgress;
public:
IdleCalcTextWidthScope(ScDocument& rDoc, ScAddress& rCalcPos) :
mrDoc(rDoc),
mrCalcPos(rCalcPos),
mnStartTime(Time::GetSystemTicks()),
- mbNeedMore(false)
+ mbNeedMore(false),
+ mbProgress(false)
{
mrDoc.EnableIdle(false);
@@ -478,6 +480,9 @@ public:
if (pDev)
pDev->SetMapMode(maOldMapMode);
+ if (mbProgress)
+ ScProgress::DeleteInterpretProgress();
+
ScStyleSheetPool* pStylePool = mrDoc.GetStyleSheetPool();
pStylePool->SetSearchMask(meOldFamily, mnOldSearchMask);
mrDoc.EnableIdle(true);
@@ -501,6 +506,14 @@ public:
bool getNeedMore() const { return mbNeedMore; }
sal_uLong getStartTime() const { return mnStartTime; }
+
+ void createProgressBar()
+ {
+ ScProgress::CreateInterpretProgress(&mrDoc, false);
+ mbProgress = true;
+ }
+
+ bool hasProgressBar() const { return mbProgress; }
};
}
@@ -542,8 +555,7 @@ bool ScDocument::IdleCalcTextWidth() // true = demnaechst wieder vers
OSL_ENSURE( pStyle, "Missing StyleSheet :-/" );
- bool bProgress = false;
- if ( pStyle && 0 == getScaleValue(*pStyle, ATTR_PAGE_SCALETOPAGES))
+ if (pStyle && 0 == getScaleValue(*pStyle, ATTR_PAGE_SCALETOPAGES))
{
sal_uInt16 nRestart = 0;
sal_uInt16 nCount = 0;
@@ -579,11 +591,11 @@ bool ScDocument::IdleCalcTextWidth() // true = demnaechst wieder vers
nPPTX = aPix1000.X() / 1000.0;
nPPTY = aPix1000.Y() / 1000.0;
}
- if ( !bProgress && pCell->GetCellType() == CELLTYPE_FORMULA
- && ((ScFormulaCell*)pCell)->GetDirty() )
+
+ if (!aScope.hasProgressBar() && pCell->GetCellType() == CELLTYPE_FORMULA
+ && ((ScFormulaCell*)pCell)->GetDirty())
{
- ScProgress::CreateInterpretProgress( this, false );
- bProgress = true;
+ aScope.createProgressBar();
}
sal_uInt16 nNewWidth = (sal_uInt16)GetNeededSize(
@@ -669,9 +681,6 @@ bool ScDocument::IdleCalcTextWidth() // true = demnaechst wieder vers
else
aScope.incTab(); // Move to the next sheet as the current one has scale-to-pages set.
- if ( bProgress )
- ScProgress::DeleteInterpretProgress();
-
delete pColIter;
return aScope.getNeedMore();