summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-08-24 10:55:12 +0200
committerNoel Grandin <noel@peralex.com>2016-08-25 08:40:00 +0200
commit1332241a03500b09ab846a56e86a25e18b8230db (patch)
tree200631906c32c30866f05e1378e038cdd2ad601d
parent479aa67fd94d648cb5637773189bfb286ff78d5c (diff)
convert FmSearchProgress::State to scoped enum
Change-Id: I7ca1afedd6ca9b626c1e61322bffc66016ec7d58
-rw-r--r--cui/source/dialogs/cuifmsearch.cxx14
-rw-r--r--include/svx/fmsrcimp.hxx4
-rw-r--r--svx/source/form/fmsrcimp.cxx12
3 files changed, 15 insertions, 15 deletions
diff --git a/cui/source/dialogs/cuifmsearch.cxx b/cui/source/dialogs/cuifmsearch.cxx
index 9c8e72b3f477..5d77b83efd1e 100644
--- a/cui/source/dialogs/cuifmsearch.cxx
+++ b/cui/source/dialogs/cuifmsearch.cxx
@@ -701,7 +701,7 @@ IMPL_LINK_TYPED(FmSearchDialog, OnSearchProgress, const FmSearchProgress*, pProg
switch (pProgress->aSearchState)
{
- case FmSearchProgress::STATE_PROGRESS:
+ case FmSearchProgress::State::Progress:
if (pProgress->bOverflow)
{
OUString sHint( CUI_RES( m_pcbBackwards->IsChecked() ? RID_STR_OVERFLOW_BACKWARD : RID_STR_OVERFLOW_FORWARD ) );
@@ -713,7 +713,7 @@ IMPL_LINK_TYPED(FmSearchDialog, OnSearchProgress, const FmSearchProgress*, pProg
m_pftRecord->Invalidate();
break;
- case FmSearchProgress::STATE_PROGRESS_COUNTING:
+ case FmSearchProgress::State::ProgressCounting:
m_pftHint->SetText(CUI_RESSTR(RID_STR_SEARCH_COUNTING));
m_pftHint->Invalidate();
@@ -721,21 +721,21 @@ IMPL_LINK_TYPED(FmSearchDialog, OnSearchProgress, const FmSearchProgress*, pProg
m_pftRecord->Invalidate();
break;
- case FmSearchProgress::STATE_SUCCESSFULL:
+ case FmSearchProgress::State::Successful:
OnFound(pProgress->aBookmark, (sal_Int16)pProgress->nFieldIndex);
EnableSearchUI(true);
break;
- case FmSearchProgress::STATE_ERROR:
- case FmSearchProgress::STATE_NOTHINGFOUND:
+ case FmSearchProgress::State::Error:
+ case FmSearchProgress::State::NothingFound:
{
- sal_uInt16 nErrorId = (FmSearchProgress::STATE_ERROR == pProgress->aSearchState)
+ sal_uInt16 nErrorId = (FmSearchProgress::State::Error == pProgress->aSearchState)
? RID_STR_SEARCH_GENERAL_ERROR
: RID_STR_SEARCH_NORECORD;
ScopedVclPtrInstance<MessageDialog>(this, CUI_RES(nErrorId))->Execute();
SAL_FALLTHROUGH;
}
- case FmSearchProgress::STATE_CANCELED:
+ case FmSearchProgress::State::Canceled:
EnableSearchUI(true);
if (m_lnkCanceledNotFoundHdl.IsSet())
{
diff --git a/include/svx/fmsrcimp.hxx b/include/svx/fmsrcimp.hxx
index 842b0858dd4a..a29c7f76195b 100644
--- a/include/svx/fmsrcimp.hxx
+++ b/include/svx/fmsrcimp.hxx
@@ -61,10 +61,10 @@ public:
*/
struct FmSearchProgress
{
- enum STATE { STATE_PROGRESS, STATE_PROGRESS_COUNTING, STATE_CANCELED, STATE_SUCCESSFULL, STATE_NOTHINGFOUND, STATE_ERROR };
+ enum class State { Progress, ProgressCounting, Canceled, Successful, NothingFound, Error };
// (move to new record; progress during counting of records; cancelled; record found; nothing found;
// any non-processable error)
- STATE aSearchState;
+ State aSearchState;
// current record - always valid (e.g. of interest for continuing search in case of cancellation)
sal_uInt32 nCurrentRecord;
diff --git a/svx/source/form/fmsrcimp.cxx b/svx/source/form/fmsrcimp.cxx
index a088578d5576..2d442be42ed5 100644
--- a/svx/source/form/fmsrcimp.cxx
+++ b/svx/source/form/fmsrcimp.cxx
@@ -865,7 +865,7 @@ void FmSearchEngine::PropagateProgress(bool _bDontPropagateOverflow)
FmSearchProgress aProgress;
try
{
- aProgress.aSearchState = FmSearchProgress::STATE_PROGRESS;
+ aProgress.aSearchState = FmSearchProgress::State::Progress;
aProgress.nCurrentRecord = m_xSearchCursor.getRow() - 1;
if (m_bForward)
aProgress.bOverflow = !_bDontPropagateOverflow && m_xSearchCursor.isFirst();
@@ -994,19 +994,19 @@ IMPL_LINK_NOARG_TYPED(FmSearchEngine, OnSearchTerminated, FmSearchThread*, void)
switch (m_srResult)
{
case SearchResult::Error :
- aProgress.aSearchState = FmSearchProgress::STATE_ERROR;
+ aProgress.aSearchState = FmSearchProgress::State::Error;
break;
case SearchResult::Found :
- aProgress.aSearchState = FmSearchProgress::STATE_SUCCESSFULL;
+ aProgress.aSearchState = FmSearchProgress::State::Successful;
aProgress.aBookmark = m_aPreviousLocBookmark;
aProgress.nFieldIndex = m_iterPreviousLocField - m_arrUsedFields.begin();
break;
case SearchResult::NotFound :
- aProgress.aSearchState = FmSearchProgress::STATE_NOTHINGFOUND;
+ aProgress.aSearchState = FmSearchProgress::State::NothingFound;
aProgress.aBookmark = m_xSearchCursor.getBookmark();
break;
case SearchResult::Cancelled :
- aProgress.aSearchState = FmSearchProgress::STATE_CANCELED;
+ aProgress.aSearchState = FmSearchProgress::State::Canceled;
aProgress.aBookmark = m_xSearchCursor.getBookmark();
break;
}
@@ -1031,7 +1031,7 @@ IMPL_LINK_TYPED(FmSearchEngine, OnNewRecordCount, sal_Int32, theCounter, void)
FmSearchProgress aProgress;
aProgress.nCurrentRecord = theCounter;
- aProgress.aSearchState = FmSearchProgress::STATE_PROGRESS_COUNTING;
+ aProgress.aSearchState = FmSearchProgress::State::ProgressCounting;
m_aProgressHandler.Call(&aProgress);
}