diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-03-13 13:55:13 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-03-14 15:35:49 -0400 |
commit | d6c7fd2fcc5c9287e1d22d23c6291004f2dec297 (patch) | |
tree | b3264f6d81178282e11c4e3317daa123fd93270a | |
parent | 51c449bc8765756c23054e9a1a8172603987024b (diff) |
Reverse the logic of enable / disable idle flag...
so that true -> enabled and false -> disabled. This is much easier
for human brain to process.
Change-Id: I51059ee9090610ad8455a072b165860527cd9d50
-rw-r--r-- | sc/inc/document.hxx | 6 | ||||
-rw-r--r-- | sc/inc/progress.hxx | 2 | ||||
-rw-r--r-- | sc/source/core/data/documen2.cxx | 2 | ||||
-rw-r--r-- | sc/source/core/data/documen3.cxx | 6 | ||||
-rw-r--r-- | sc/source/core/data/documen7.cxx | 6 | ||||
-rw-r--r-- | sc/source/core/data/documen8.cxx | 9 | ||||
-rw-r--r-- | sc/source/core/tool/interpr2.cxx | 6 | ||||
-rw-r--r-- | sc/source/core/tool/progress.cxx | 8 | ||||
-rw-r--r-- | sc/source/filter/xml/xmlexprt.cxx | 6 | ||||
-rw-r--r-- | sc/source/ui/docshell/docsh.cxx | 16 | ||||
-rw-r--r-- | sc/source/ui/inc/docsh.hxx | 2 | ||||
-rw-r--r-- | sc/source/ui/inc/spelldialog.hxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/output.cxx | 6 | ||||
-rw-r--r-- | sc/source/ui/view/output2.cxx | 6 | ||||
-rw-r--r-- | sc/source/ui/view/spelldialog.cxx | 10 | ||||
-rw-r--r-- | sc/source/ui/view/viewfun4.cxx | 6 |
16 files changed, 50 insertions, 49 deletions
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index 67be28a9be18..8c3fac273d6d 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -356,7 +356,7 @@ private: bool bCalcingAfterLoad; // in CalcAfterLoad TRUE // don't construct/destruct listeners temporarily bool bNoListening; - bool bIdleDisabled; + bool mbIdleEnabled; bool bInLinkUpdate; // TableLink or AreaLink bool bChartListenerCollectionNeedsUpdate; // are/were there RC_FORCED formula cells in the document (if set once to TRUE then set forever) @@ -1538,8 +1538,8 @@ public: void RepaintRange( const ScRange& rRange ); void RepaintRange( const ScRangeList& rRange ); - bool IsIdleDisabled() const { return bIdleDisabled; } - void DisableIdle(bool bDo) { bIdleDisabled = bDo; } + bool IsIdleEnabled() const { return mbIdleEnabled; } + void EnableIdle(bool bDo) { mbIdleEnabled = bDo; } bool IsDetectiveDirty() const { return bDetectiveDirty; } void SetDetectiveDirty(bool bSet) { bDetectiveDirty = bSet; } diff --git a/sc/inc/progress.hxx b/sc/inc/progress.hxx index 0607c054dd42..52c1fe22ddf8 100644 --- a/sc/inc/progress.hxx +++ b/sc/inc/progress.hxx @@ -48,7 +48,7 @@ private: static sal_uLong nInterpretProgress; static sal_Bool bAllowInterpretProgress; static ScDocument* pInterpretDoc; - static sal_Bool bIdleWasDisabled; + static bool bIdleWasEnabled; SfxProgress* pProgress; diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx index 10428e849dcd..1d159dbafacf 100644 --- a/sc/source/core/data/documen2.cxx +++ b/sc/source/core/data/documen2.cxx @@ -181,7 +181,7 @@ ScDocument::ScDocument( ScDocumentMode eMode, bXMLFromWrapper( false ), bCalcingAfterLoad( false ), bNoListening( false ), - bIdleDisabled( false ), + mbIdleEnabled(true), bInLinkUpdate( false ), bChartListenerCollectionNeedsUpdate( false ), bHasForcedFormulas( false ), diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx index 5fa9f7a181d3..55e01eb1813c 100644 --- a/sc/source/core/data/documen3.cxx +++ b/sc/source/core/data/documen3.cxx @@ -1340,10 +1340,10 @@ void ScDocument::Sort(SCTAB nTab, const ScSortParam& rSortParam, bool bKeepQuery { if ( ValidTab(nTab) && nTab < static_cast<SCTAB>(maTabs.size()) && maTabs[nTab] ) { - bool bOldDisableIdle = IsIdleDisabled(); - DisableIdle( true ); + bool bOldEnableIdle = IsIdleEnabled(); + EnableIdle(false); maTabs[nTab]->Sort(rSortParam, bKeepQuery, pProgress); - DisableIdle( bOldDisableIdle ); + EnableIdle(bOldEnableIdle); } } diff --git a/sc/source/core/data/documen7.cxx b/sc/source/core/data/documen7.cxx index 5a8bed3ed0f1..56eb56514181 100644 --- a/sc/source/core/data/documen7.cxx +++ b/sc/source/core/data/documen7.cxx @@ -280,8 +280,8 @@ void ScDocument::CalcFormulaTree( bool bOnlyForced, bool bProgressBar, bool bSet bCalculatingFormulaTree = true; SetForcedFormulaPending( false ); - bool bOldIdleDisabled = IsIdleDisabled(); - DisableIdle( true ); + bool bOldIdleEnabled = IsIdleEnabled(); + EnableIdle(false); bool bOldAutoCalc = GetAutoCalc(); //! _nicht_ SetAutoCalc( true ) weil das evtl. CalcFormulaTree( true ) //! aufruft, wenn vorher disabled war und bHasForcedFormulas gesetzt ist @@ -373,7 +373,7 @@ void ScDocument::CalcFormulaTree( bool bOnlyForced, bool bProgressBar, bool bSet ScProgress::DeleteInterpretProgress(); } bAutoCalc = bOldAutoCalc; - DisableIdle( bOldIdleDisabled ); + EnableIdle(bOldIdleEnabled); bCalculatingFormulaTree = false; } diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx index 896848c0cb6e..4592d13db174 100644 --- a/sc/source/core/data/documen8.cxx +++ b/sc/source/core/data/documen8.cxx @@ -446,9 +446,10 @@ void ScDocument::InvalidateTextWidth( const ScAddress* pAdrFrom, const ScAddress bool ScDocument::IdleCalcTextWidth() // true = demnaechst wieder versuchen { // #i75610# if a printer hasn't been set or created yet, don't create one for this - if ( bIdleDisabled || IsInLinkUpdate() || GetPrinter(false) == NULL ) + if (!mbIdleEnabled || IsInLinkUpdate() || GetPrinter(false) == NULL) return false; - bIdleDisabled = true; + + mbIdleEnabled = false; const sal_uLong nStart = Time::GetSystemTicks(); OutputDevice* pDev = NULL; @@ -623,7 +624,7 @@ bool ScDocument::IdleCalcTextWidth() // true = demnaechst wieder vers aCurTextWidthCalcPos.SetCol( (SCCOL)nCol ); pStylePool->SetSearchMask( eOldFam, nOldMask ); - bIdleDisabled = false; + mbIdleEnabled = true; return bNeedMore; } @@ -819,7 +820,7 @@ bool ScDocument::OnlineSpellInRange( const ScRange& rSpellRange, ScAddress& rSpe bool ScDocument::ContinueOnlineSpelling() { - if ( bIdleDisabled || !pDocOptions->IsAutoSpell() || (pShell && pShell->IsReadOnly()) ) + if (!mbIdleEnabled || !pDocOptions->IsAutoSpell() || (pShell && pShell->IsReadOnly())) return false; // #i48433# set bInsertingFromOtherDoc flag so there are no broadcasts when PutCell is called diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx index 85d599c65d15..39e780faba42 100644 --- a/sc/source/core/tool/interpr2.cxx +++ b/sc/source/core/tool/interpr2.cxx @@ -2277,8 +2277,8 @@ void ScInterpreter::ScDde() // solange der Link nicht ausgewertet ist, Idle abklemmen // (um zirkulaere Referenzen zu vermeiden) - bool bOldDis = pDok->IsIdleDisabled(); - pDok->DisableIdle( true ); + bool bOldEnabled = pDok->IsIdleEnabled(); + pDok->EnableIdle(false); // Link-Objekt holen / anlegen @@ -2337,7 +2337,7 @@ void ScInterpreter::ScDde() else PushNA(); - pDok->DisableIdle( bOldDis ); + pDok->EnableIdle(bOldEnabled); pLinkMgr->CloseCachedComps(); } } diff --git a/sc/source/core/tool/progress.cxx b/sc/source/core/tool/progress.cxx index 0c4361621447..808572790130 100644 --- a/sc/source/core/tool/progress.cxx +++ b/sc/source/core/tool/progress.cxx @@ -44,7 +44,7 @@ ScProgress* ScProgress::pOldInterpretProgress = NULL; sal_uLong ScProgress::nInterpretProgress = 0; sal_Bool ScProgress::bAllowInterpretProgress = sal_True; ScDocument* ScProgress::pInterpretDoc; -sal_Bool ScProgress::bIdleWasDisabled = false; +bool ScProgress::bIdleWasEnabled = false; static sal_Bool lcl_IsHiddenDocument( SfxObjectShell* pObjSh ) @@ -145,8 +145,8 @@ void ScProgress::CreateInterpretProgress( ScDocument* pDoc, sal_Bool bWait ) else if ( pDoc->GetAutoCalc() ) { nInterpretProgress = 1; - bIdleWasDisabled = pDoc->IsIdleDisabled(); - pDoc->DisableIdle( sal_True ); + bIdleWasEnabled = pDoc->IsIdleEnabled(); + pDoc->EnableIdle(false); // Interpreter may be called in many circumstances, also if another // progress bar is active, for example while adapting row heights. // Keep the dummy interpret progress. @@ -180,7 +180,7 @@ void ScProgress::DeleteInterpretProgress() delete pTmpProgress; } if ( pInterpretDoc ) - pInterpretDoc->DisableIdle( bIdleWasDisabled ); + pInterpretDoc->EnableIdle(bIdleWasEnabled); } --nInterpretProgress; } diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx index 7d7be795696d..175a6c6af5c5 100644 --- a/sc/source/filter/xml/xmlexprt.cxx +++ b/sc/source/filter/xml/xmlexprt.cxx @@ -4694,10 +4694,10 @@ sal_Bool SAL_CALL ScXMLExport::filter( const ::com::sun::star::uno::Sequence< :: { SolarMutexGuard aGuard; if (pDoc) - pDoc->DisableIdle(true); + pDoc->EnableIdle(false); bool bReturn(SvXMLExport::filter(aDescriptor)); if (pDoc) - pDoc->DisableIdle(false); + pDoc->EnableIdle(true); return bReturn; } @@ -4706,7 +4706,7 @@ void SAL_CALL ScXMLExport::cancel() { SolarMutexGuard aGuard; if (pDoc) - pDoc->DisableIdle(false); + pDoc->EnableIdle(true); SvXMLExport::cancel(); } diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx index a9707de00786..c56d0100fc23 100644 --- a/sc/source/ui/docshell/docsh.cxx +++ b/sc/source/ui/docshell/docsh.cxx @@ -250,7 +250,7 @@ sal_uInt16 ScDocShell::GetHiddenInformationState( sal_uInt16 nStates ) void ScDocShell::BeforeXMLLoading() { - aDocument.DisableIdle( sal_True ); + aDocument.EnableIdle(false); // prevent unnecessary broadcasts and updates OSL_ENSURE(pModificator == NULL, "The Modificator should not exist"); @@ -367,7 +367,7 @@ void ScDocShell::AfterXMLLoading(sal_Bool bRet) OSL_FAIL("The Modificator should exist"); } - aDocument.DisableIdle( false ); + aDocument.EnableIdle(true); } namespace { @@ -479,7 +479,7 @@ sal_Bool ScDocShell::SaveXML( SfxMedium* pSaveMedium, const ::com::sun::star::un { RTL_LOGFILE_CONTEXT_AUTHOR ( aLog, "sc", "sb99857", "ScDocShell::SaveXML" ); - aDocument.DisableIdle( sal_True ); + aDocument.EnableIdle(false); ScXMLImportWrapper aImport( aDocument, pSaveMedium, xStor ); sal_Bool bRet(false); @@ -488,7 +488,7 @@ sal_Bool ScDocShell::SaveXML( SfxMedium* pSaveMedium, const ::com::sun::star::un else bRet = aImport.Export(sal_True); - aDocument.DisableIdle( false ); + aDocument.EnableIdle(true); return bRet; } @@ -2443,7 +2443,7 @@ sal_uInt16 ScDocShell::PrepareClose( sal_Bool bUI, sal_Bool bForBrowsing ) sal_uInt16 nRet = SfxObjectShell::PrepareClose( bUI, bForBrowsing ); if (nRet == sal_True) // sal_True = schliessen - aDocument.DisableIdle(sal_True); // nicht mehr drin rumpfuschen !!! + aDocument.EnableIdle(false); // nicht mehr drin rumpfuschen !!! return nRet; } @@ -2976,9 +2976,9 @@ ScDocShellModificator::ScDocShellModificator( ScDocShell& rDS ) { ScDocument* pDoc = rDocShell.GetDocument(); bAutoCalcShellDisabled = pDoc->IsAutoCalcShellDisabled(); - bIdleDisabled = pDoc->IsIdleDisabled(); + bIdleEnabled = pDoc->IsIdleEnabled(); pDoc->SetAutoCalcShellDisabled( sal_True ); - pDoc->DisableIdle( sal_True ); + pDoc->EnableIdle(false); } @@ -2988,7 +2988,7 @@ ScDocShellModificator::~ScDocShellModificator() pDoc->SetAutoCalcShellDisabled( bAutoCalcShellDisabled ); if ( !bAutoCalcShellDisabled && rDocShell.IsDocumentModifiedPending() ) rDocShell.SetDocumentModified(); // last one shuts off the lights - pDoc->DisableIdle( bIdleDisabled ); + pDoc->EnableIdle(bIdleEnabled); } diff --git a/sc/source/ui/inc/docsh.hxx b/sc/source/ui/inc/docsh.hxx index ade8dfb64a01..010ea826c362 100644 --- a/sc/source/ui/inc/docsh.hxx +++ b/sc/source/ui/inc/docsh.hxx @@ -454,7 +454,7 @@ class SC_DLLPUBLIC ScDocShellModificator ScDocShell& rDocShell; ScRefreshTimerProtector aProtector; sal_Bool bAutoCalcShellDisabled; - sal_Bool bIdleDisabled; + bool bIdleEnabled; // not implemented ScDocShellModificator( const ScDocShellModificator& ); diff --git a/sc/source/ui/inc/spelldialog.hxx b/sc/source/ui/inc/spelldialog.hxx index b0bf42f554aa..4eaf6566f877 100644 --- a/sc/source/ui/inc/spelldialog.hxx +++ b/sc/source/ui/inc/spelldialog.hxx @@ -89,7 +89,7 @@ private: ScDocShell* mpDocShell; ScDocument* mpDoc; bool mbNeedNextObj; - bool mbOldIdleDisabled; + bool mbOldIdleEnabled; }; // ============================================================================ diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx index c8018cf2131c..18325cd14b93 100644 --- a/sc/source/ui/view/output.cxx +++ b/sc/source/ui/view/output.cxx @@ -1949,8 +1949,8 @@ void ScOutputData::FindChanged() SCCOL nX; SCSIZE nArrY; - bool bWasIdleDisabled = mpDoc->IsIdleDisabled(); - mpDoc->DisableIdle(true); + bool bWasIdleEnabled = mpDoc->IsIdleEnabled(); + mpDoc->EnableIdle(false); for (nArrY=0; nArrY<nArrCount; nArrY++) pRowInfo[nArrY].bChanged = false; @@ -1997,7 +1997,7 @@ void ScOutputData::FindChanged() } if ( bProgress ) ScProgress::DeleteInterpretProgress(); - mpDoc->DisableIdle( bWasIdleDisabled ); + mpDoc->EnableIdle(bWasIdleEnabled); } void ScOutputData::DrawRefMark( SCCOL nRefStartX, SCROW nRefStartY, diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx index 0158f17885d2..6caa4e26202f 100644 --- a/sc/source/ui/view/output2.cxx +++ b/sc/source/ui/view/output2.cxx @@ -1413,8 +1413,8 @@ void ScOutputData::DrawStrings( sal_Bool bPixelToLogic ) vcl::PDFExtOutDevData* pPDFData = PTR_CAST( vcl::PDFExtOutDevData, mpDev->GetExtOutDevData() ); - sal_Bool bWasIdleDisabled = mpDoc->IsIdleDisabled(); - mpDoc->DisableIdle( true ); + bool bWasIdleEnabled = mpDoc->IsIdleEnabled(); + mpDoc->EnableIdle(false); ScDrawStringsVars aVars( this, bPixelToLogic ); @@ -2015,7 +2015,7 @@ void ScOutputData::DrawStrings( sal_Bool bPixelToLogic ) } if ( bProgress ) ScProgress::DeleteInterpretProgress(); - mpDoc->DisableIdle( bWasIdleDisabled ); + mpDoc->EnableIdle(bWasIdleEnabled); } // ------------------------------------------------------------------------------- diff --git a/sc/source/ui/view/spelldialog.cxx b/sc/source/ui/view/spelldialog.cxx index 8b24d51e30da..1839f2666a4a 100644 --- a/sc/source/ui/view/spelldialog.cxx +++ b/sc/source/ui/view/spelldialog.cxx @@ -47,7 +47,7 @@ ScSpellDialogChildWindow::ScSpellDialogChildWindow( Window* pParentP, sal_uInt16 mpDocShell( 0 ), mpDoc( 0 ), mbNeedNextObj( false ), - mbOldIdleDisabled( false ) + mbOldIdleEnabled(true) { Init(); } @@ -141,7 +141,7 @@ void ScSpellDialogChildWindow::Reset() mpViewShell->KillEditView( sal_True ); mpDocShell->PostPaintGridAll(); mpViewShell->UpdateInputHandler(); - mpDoc->DisableIdle( mbOldIdleDisabled ); + mpDoc->EnableIdle(mbOldIdleEnabled); } mxEngine.reset(); mxUndoDoc.reset(); @@ -153,7 +153,7 @@ void ScSpellDialogChildWindow::Reset() mpDocShell = 0; mpDoc = 0; mbNeedNextObj = false; - mbOldIdleDisabled = false; + mbOldIdleEnabled = true; } void ScSpellDialogChildWindow::Init() @@ -214,8 +214,8 @@ void ScSpellDialogChildWindow::Init() OSL_FAIL( "ScSpellDialogChildWindow::Init - unknown selection type" ); } - mbOldIdleDisabled = mpDoc->IsIdleDisabled(); - mpDoc->DisableIdle( true ); // stop online spelling + mbOldIdleEnabled = mpDoc->IsIdleEnabled(); + mpDoc->EnableIdle(false); // stop online spelling // *** create Undo/Redo documents *** ------------------------------------- diff --git a/sc/source/ui/view/viewfun4.cxx b/sc/source/ui/view/viewfun4.cxx index 0b3158c6d291..cd48942494d2 100644 --- a/sc/source/ui/view/viewfun4.cxx +++ b/sc/source/ui/view/viewfun4.cxx @@ -511,8 +511,8 @@ void ScViewFunc::DoSheetConversion( const ScConversionParam& rConvParam, sal_Boo // ab hier kein return mehr - sal_Bool bOldDis = pDoc->IsIdleDisabled(); - pDoc->DisableIdle( true ); // stop online spelling + bool bOldEnabled = pDoc->IsIdleEnabled(); + pDoc->EnableIdle(false); // stop online spelling // *** create and init the edit engine *** -------------------------------- @@ -579,7 +579,7 @@ void ScViewFunc::DoSheetConversion( const ScConversionParam& rConvParam, sal_Boo delete pEngine; pDocSh->PostPaintGridAll(); rViewData.GetViewShell()->UpdateInputHandler(); - pDoc->DisableIdle(bOldDis); + pDoc->EnableIdle(bOldEnabled); } // Pasten von FORMAT_FILE-Items |