summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorDaniel Bankston <daniel.e.bankston@gmail.com>2012-07-06 02:04:28 -0500
committerKohei Yoshida <kohei.yoshida@gmail.com>2012-07-11 20:37:40 -0400
commitadaf0d9bf6b5f44c3e32c41fdaac4254a4a24263 (patch)
treeeb034ecdcb37f14348f83f9a4639fa6907b18dd9 /sc
parentf107e3a5f7cc19957435f1e90617105509394b4d (diff)
Use bool instead of sal_uInt16 for HardCalcState
Change-Id: Ia855780c28dc05e1606e8118fabd2a86bfcc5fa2
Diffstat (limited to 'sc')
-rw-r--r--sc/inc/document.hxx6
-rw-r--r--sc/source/core/data/bcaslot.cxx4
-rw-r--r--sc/source/core/data/documen2.cxx2
-rw-r--r--sc/source/core/data/documen7.cxx8
-rw-r--r--sc/source/ui/docshell/docsh.cxx6
-rw-r--r--sc/source/ui/docshell/docsh4.cxx2
6 files changed, 13 insertions, 15 deletions
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 72d5168bbc32..6d4a02ef3b0b 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -340,7 +340,7 @@ private:
sal_uInt16 nSrcVer; // file version (load/save)
SCROW nSrcMaxRow; // number of lines to load/save
sal_uInt16 nFormulaTrackCount;
- sal_uInt16 nHardRecalcState; // 0: soft, 1: hard-warn, 2: hard
+ bool bHardRecalcState; // false: soft, true: hard
SCTAB nVisibleTab; // for OLE etc.
ScLkUpdMode eLinkMode;
@@ -1668,8 +1668,8 @@ public:
sal_uInt16 GetFormulaTrackCount() const { return nFormulaTrackCount; }
bool IsInFormulaTree( ScFormulaCell* pCell ) const;
bool IsInFormulaTrack( ScFormulaCell* pCell ) const;
- sal_uInt16 GetHardRecalcState() { return nHardRecalcState; }
- void SetHardRecalcState( sal_uInt16 nVal ) { nHardRecalcState = nVal; }
+ bool GetHardRecalcState() { return bHardRecalcState; }
+ void SetHardRecalcState( bool bVal ) { bHardRecalcState = bVal; }
void StartAllListeners();
const ScFormulaCell* GetFormulaTree() const { return pFormulaTree; }
bool HasForcedFormulas() const { return bHasForcedFormulas; }
diff --git a/sc/source/core/data/bcaslot.cxx b/sc/source/core/data/bcaslot.cxx
index 2d99ff4089b8..b30a21e3cdc3 100644
--- a/sc/source/core/data/bcaslot.cxx
+++ b/sc/source/core/data/bcaslot.cxx
@@ -151,8 +151,6 @@ bool ScBroadcastAreaSlot::CheckHardRecalcStateCondition() const
{ // this is more hypothetical now, check existed for old SV_PTRARR_SORT
if ( !pDoc->GetHardRecalcState() )
{
- pDoc->SetHardRecalcState( 1 );
-
SfxObjectShell* pShell = pDoc->GetDocumentShell();
OSL_ENSURE( pShell, "Missing DocShell :-/" );
@@ -160,7 +158,7 @@ bool ScBroadcastAreaSlot::CheckHardRecalcStateCondition() const
pShell->SetError( SCWARN_CORE_HARD_RECALC, ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OSL_LOG_PREFIX ) ) );
pDoc->SetAutoCalc( false );
- pDoc->SetHardRecalcState( 2 );
+ pDoc->SetHardRecalcState( true );
}
return true;
}
diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx
index 241985935641..6b3aa3cf287b 100644
--- a/sc/source/core/data/documen2.cxx
+++ b/sc/source/core/data/documen2.cxx
@@ -173,7 +173,7 @@ ScDocument::ScDocument( ScDocumentMode eMode,
nSrcVer( SC_CURRENT_VERSION ),
nSrcMaxRow( MAXROW ),
nFormulaTrackCount(0),
- nHardRecalcState(0),
+ bHardRecalcState(false),
nVisibleTab( 0 ),
eLinkMode(LM_UNKNOWN),
bAutoCalc( eMode == SCDOCMODE_DOCUMENT ),
diff --git a/sc/source/core/data/documen7.cxx b/sc/source/core/data/documen7.cxx
index 818aa22af297..71bf25bf6b7d 100644
--- a/sc/source/core/data/documen7.cxx
+++ b/sc/source/core/data/documen7.cxx
@@ -87,7 +87,7 @@ void ScDocument::Broadcast( const ScHint& rHint )
{
if ( !pBASM )
return ; // Clipboard or Undo
- if ( !nHardRecalcState )
+ if ( !bHardRecalcState )
{
ScBulkBroadcast aBulkBroadcast( pBASM); // scoped bulk broadcast
bool bIsBroadcasted = false;
@@ -130,7 +130,7 @@ void ScDocument::AreaBroadcast( const ScHint& rHint )
{
if ( !pBASM )
return ; // Clipboard or Undo
- if ( !nHardRecalcState )
+ if ( !bHardRecalcState )
{
ScBulkBroadcast aBulkBroadcast( pBASM); // scoped bulk broadcast
if ( pBASM->AreaBroadcast( rHint ) )
@@ -153,7 +153,7 @@ void ScDocument::AreaBroadcastInRange( const ScRange& rRange, const ScHint& rHin
{
if ( !pBASM )
return ; // Clipboard or Undo
- if ( !nHardRecalcState )
+ if ( !bHardRecalcState )
{
ScBulkBroadcast aBulkBroadcast( pBASM); // scoped bulk broadcast
if ( pBASM->AreaBroadcastInRange( rRange, rHint ) )
@@ -295,7 +295,7 @@ void ScDocument::CalcFormulaTree( bool bOnlyForced, bool bNoProgress )
//! _nicht_ SetAutoCalc( true ) weil das evtl. CalcFormulaTree( true )
//! aufruft, wenn vorher disabled war und bHasForcedFormulas gesetzt ist
bAutoCalc = true;
- if ( nHardRecalcState )
+ if ( bHardRecalcState )
CalcAll();
else
{
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index d60491976826..9e769de2ff66 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -365,12 +365,12 @@ void ScDocShell::AfterXMLLoading(sal_Bool bRet)
if (pModificator)
{
- sal_uInt16 nRecalcState = aDocument.GetHardRecalcState();
+ bool bRecalcState = aDocument.GetHardRecalcState();
//temporarily set hard-recalc to prevent calling ScFormulaCell::Notify()
//which will set the cells dirty.
- aDocument.SetHardRecalcState(2);
+ aDocument.SetHardRecalcState(true);
delete pModificator;
- aDocument.SetHardRecalcState(nRecalcState);
+ aDocument.SetHardRecalcState(bRecalcState);
pModificator = NULL;
}
else
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index 3680178ccf65..babda0da8c49 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -1786,7 +1786,7 @@ void ScDocShell::GetState( SfxItemSet &rSet )
switch (nWhich)
{
case FID_AUTO_CALC:
- if ( (sal_Bool) aDocument.GetHardRecalcState() )
+ if ( aDocument.GetHardRecalcState() )
rSet.DisableItem( nWhich );
else
rSet.Put( SfxBoolItem( nWhich, aDocument.GetAutoCalc() ) );