summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2016-06-27 18:41:11 +0200
committerStephan Bergmann <sbergman@redhat.com>2016-06-27 18:41:11 +0200
commit694afdbaecfab1f98279fafd1483f3c2734ce788 (patch)
treef63c8ba2176de5c4a5ba1bf561d11241e569ac09
parentbf64e7d61596170ee9f9823d96a91fd3fbff91a8 (diff)
SfxProgress::SetState always returns true
Change-Id: Ib606b0391f814ea9ff4383397a40a8a692563fa3
-rw-r--r--include/sfx2/progress.hxx4
-rw-r--r--sc/inc/globstr.hrc1
-rw-r--r--sc/inc/progress.hxx28
-rw-r--r--sc/source/core/data/documen7.cxx2
-rw-r--r--sc/source/core/tool/progress.cxx3
-rw-r--r--sc/source/ui/docshell/dbdocimp.cxx7
-rw-r--r--sc/source/ui/docshell/docsh8.cxx6
-rw-r--r--sc/source/ui/src/globstr.src4
-rw-r--r--sfx2/source/bastyp/progress.cxx18
9 files changed, 16 insertions, 57 deletions
diff --git a/include/sfx2/progress.hxx b/include/sfx2/progress.hxx
index e487ef43171b..882d38d8d053 100644
--- a/include/sfx2/progress.hxx
+++ b/include/sfx2/progress.hxx
@@ -47,8 +47,8 @@ public:
bool bWait = true);
virtual ~SfxProgress();
- bool SetStateText( sal_uIntPtr nVal, const rtl::OUString &rVal );
- bool SetState( sal_uIntPtr nVal, sal_uIntPtr nNewRange = 0 );
+ void SetStateText( sal_uIntPtr nVal, const rtl::OUString &rVal );
+ void SetState( sal_uIntPtr nVal, sal_uIntPtr nNewRange = 0 );
sal_uIntPtr GetState() const { return nVal; }
void Resume();
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..." ;
diff --git a/sfx2/source/bastyp/progress.cxx b/sfx2/source/bastyp/progress.cxx
index 3524aea5249f..df5a8fea3247 100644
--- a/sfx2/source/bastyp/progress.cxx
+++ b/sfx2/source/bastyp/progress.cxx
@@ -208,7 +208,7 @@ void SfxProgress::Stop()
pImpl->Enable_Impl();
}
-bool SfxProgress::SetStateText
+void SfxProgress::SetStateText
(
sal_uLong nNewVal, /* New value for the progress-bar */
const OUString& rNewVal /* Status as Text */
@@ -216,10 +216,10 @@ bool SfxProgress::SetStateText
{
pImpl->aStateText = rNewVal;
- return SetState( nNewVal );
+ SetState( nNewVal );
}
-bool SfxProgress::SetState
+void SfxProgress::SetState
(
sal_uLong nNewVal, /* new value for the progress bar */
@@ -228,18 +228,10 @@ bool SfxProgress::SetState
/* [Description]
Setting the current status, after a time delay Reschedule is called.
-
- [Return value]
-
- bool TRUE
- Proceed with the action
-
- FALSE
- Cancel action
*/
{
- if( pImpl->pActiveProgress ) return true;
+ if( pImpl->pActiveProgress ) return;
nVal = nNewVal;
@@ -300,8 +292,6 @@ bool SfxProgress::SetState
{
pImpl->xStatusInd->setValue( nNewVal );
}
-
- return true;
}