diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2016-06-27 18:41:11 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2016-06-27 18:41:11 +0200 |
commit | 694afdbaecfab1f98279fafd1483f3c2734ce788 (patch) | |
tree | f63c8ba2176de5c4a5ba1bf561d11241e569ac09 /sc | |
parent | bf64e7d61596170ee9f9823d96a91fd3fbff91a8 (diff) |
SfxProgress::SetState always returns true
Change-Id: Ib606b0391f814ea9ff4383397a40a8a692563fa3
Diffstat (limited to 'sc')
-rw-r--r-- | sc/inc/globstr.hrc | 1 | ||||
-rw-r--r-- | sc/inc/progress.hxx | 28 | ||||
-rw-r--r-- | sc/source/core/data/documen7.cxx | 2 | ||||
-rw-r--r-- | sc/source/core/tool/progress.cxx | 3 | ||||
-rw-r--r-- | sc/source/ui/docshell/dbdocimp.cxx | 7 | ||||
-rw-r--r-- | sc/source/ui/docshell/docsh8.cxx | 6 | ||||
-rw-r--r-- | sc/source/ui/src/globstr.src | 4 |
7 files changed, 10 insertions, 41 deletions
diff --git a/sc/inc/globstr.hrc b/sc/inc/globstr.hrc index df4369f21838..4d8c80c3c00f 100644 --- a/sc/inc/globstr.hrc +++ b/sc/inc/globstr.hrc @@ -140,7 +140,6 @@ #define STR_UNKNOWN_FILTER 94 #define STR_DATABASE_NOTFOUND 95 -#define STR_DATABASE_ABORTED 96 #define STR_UNDO_PRINTRANGES 97 diff --git a/sc/inc/progress.hxx b/sc/inc/progress.hxx index 8d1f9c59ae72..249a4e9cff05 100644 --- a/sc/inc/progress.hxx +++ b/sc/inc/progress.hxx @@ -42,7 +42,6 @@ private: static SfxProgress* pGlobalProgress; static sal_uLong nGlobalRange; static sal_uLong nGlobalPercent; - static bool bGlobalNoUserBreak; static ScProgress* pInterpretProgress; static ScProgress* pOldInterpretProgress; static sal_uLong nInterpretProgress; @@ -63,7 +62,6 @@ private: } public: - static bool IsUserBreak() { return !bGlobalNoUserBreak; } static void CreateInterpretProgress( ScDocument* pDoc, bool bWait = true ); static ScProgress* GetInterpretProgress() { return pInterpretProgress; } @@ -80,47 +78,37 @@ public: ScProgress(); #endif - bool SetStateText( sal_uLong nVal, const OUString &rVal ) + void SetStateText( sal_uLong nVal, const OUString &rVal ) { if ( pProgress ) { CalcGlobalPercent( nVal ); - if ( !pProgress->SetStateText( nVal, rVal ) ) - bGlobalNoUserBreak = false; - return bGlobalNoUserBreak; + pProgress->SetStateText( nVal, rVal ); } - return true; } - bool SetState( sal_uLong nVal, sal_uLong nNewRange = 0 ) + void SetState( sal_uLong nVal, sal_uLong nNewRange = 0 ) { if ( pProgress ) { if ( nNewRange ) nGlobalRange = nNewRange; CalcGlobalPercent( nVal ); - if ( !pProgress->SetState( nVal, nNewRange ) ) - bGlobalNoUserBreak = false; - return bGlobalNoUserBreak; + pProgress->SetState( nVal, nNewRange ); } - return true; } - bool SetStateCountDown( sal_uLong nVal ) + void SetStateCountDown( sal_uLong nVal ) { if ( pProgress ) { CalcGlobalPercent( nGlobalRange - nVal ); - if ( !pProgress->SetState( nGlobalRange - nVal ) ) - bGlobalNoUserBreak = false; - return bGlobalNoUserBreak; + pProgress->SetState( nGlobalRange - nVal ); } - return true; } - bool SetStateOnPercent( sal_uLong nVal ) + void SetStateOnPercent( sal_uLong nVal ) { /// only if percentage increased if ( nGlobalRange && (nVal * 100 / nGlobalRange) > nGlobalPercent ) - return SetState( nVal ); - return true; + SetState( nVal ); } void SetStateCountDownOnPercent( sal_uLong nVal ) { /// only if percentage increased diff --git a/sc/source/core/data/documen7.cxx b/sc/source/core/data/documen7.cxx index 98025ec8a36f..7e86b37e5531 100644 --- a/sc/source/core/data/documen7.cxx +++ b/sc/source/core/data/documen7.cxx @@ -456,8 +456,6 @@ void ScDocument::CalcFormulaTree( bool bOnlyForced, bool bProgressBar, bool bSet else pCell = nullptr; } - if ( ScProgress::IsUserBreak() ) - pCell = nullptr; } if ( bProgress ) ScProgress::DeleteInterpretProgress(); diff --git a/sc/source/core/tool/progress.cxx b/sc/source/core/tool/progress.cxx index 70402381c844..b524eac51138 100644 --- a/sc/source/core/tool/progress.cxx +++ b/sc/source/core/tool/progress.cxx @@ -37,7 +37,6 @@ static ScProgress theDummyInterpretProgress; SfxProgress* ScProgress::pGlobalProgress = nullptr; sal_uLong ScProgress::nGlobalRange = 0; sal_uLong ScProgress::nGlobalPercent = 0; -bool ScProgress::bGlobalNoUserBreak = true; ScProgress* ScProgress::pInterpretProgress = &theDummyInterpretProgress; ScProgress* ScProgress::pOldInterpretProgress = nullptr; sal_uLong ScProgress::nInterpretProgress = 0; @@ -111,7 +110,6 @@ ScProgress::ScProgress(SfxObjectShell* pObjSh, const OUString& rText, pGlobalProgress = pProgress; nGlobalRange = nRange; nGlobalPercent = 0; - bGlobalNoUserBreak = true; } } @@ -130,7 +128,6 @@ ScProgress::~ScProgress() pGlobalProgress = nullptr; nGlobalRange = 0; nGlobalPercent = 0; - bGlobalNoUserBreak = true; } } diff --git a/sc/source/ui/docshell/dbdocimp.cxx b/sc/source/ui/docshell/dbdocimp.cxx index 8cba5795a60f..7d02ce3b3d24 100644 --- a/sc/source/ui/docshell/dbdocimp.cxx +++ b/sc/source/ui/docshell/dbdocimp.cxx @@ -346,12 +346,7 @@ bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam, aText += OUString::number( nInserted ); aText += aPict.getToken(1,'#'); - if (!aProgress.SetStateText( 0, aText )) // stopped by user? - { - bEnd = true; - bSuccess = false; - nErrStringId = STR_DATABASE_ABORTED; - } + aProgress.SetStateText( 0, aText ); } } else // past the end of the spreadsheet diff --git a/sc/source/ui/docshell/docsh8.cxx b/sc/source/ui/docshell/docsh8.cxx index 72a7d2f6338b..7fa8dc5cd18b 100644 --- a/sc/source/ui/docshell/docsh8.cxx +++ b/sc/source/ui/docshell/docsh8.cxx @@ -1013,11 +1013,7 @@ sal_uLong ScDocShell::DBaseExport( const OUString& rFullFileName, rtl_TextEncodi //! error handling and recovery of old //! ScDocShell::SbaSdbExport is still missing! - if ( !aProgress.SetStateOnPercent( nDocRow - nFirstRow ) ) - { // UserBreak - nErr = SCERR_EXPORT_DATA; - break; - } + aProgress.SetStateOnPercent( nDocRow - nFirstRow ); } comphelper::disposeComponent( xRowSet ); diff --git a/sc/source/ui/src/globstr.src b/sc/source/ui/src/globstr.src index 08e84c99f2e6..90576bfed1db 100644 --- a/sc/source/ui/src/globstr.src +++ b/sc/source/ui/src/globstr.src @@ -393,10 +393,6 @@ Resource RID_GLOBSTR { Text [ en-US ] = "The query '#' could not be opened." ; }; - String STR_DATABASE_ABORTED - { - Text [ en-US ] = "Database import terminated." ; - }; String STR_PROGRESS_IMPORT { Text [ en-US ] = "# records imported..." ; |