summaryrefslogtreecommitdiffstats
path: root/svtools
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-02-14 09:56:43 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-02-14 14:22:24 +0200
commit7bd5d9c81b30609d4d10dba091021352e94a7837 (patch)
tree55b9e4f715d0ea48a5a961ecd1d532021a026139 /svtools
parentremove unused Video from SgaObjKind enum (diff)
downloadcore-7bd5d9c81b30609d4d10dba091021352e94a7837.tar.gz
core-7bd5d9c81b30609d4d10dba091021352e94a7837.zip
convert to EnumerationResult to scoped enum
and drop unused RUNNING constant Change-Id: I498b8b47e172336775b38c953f867f2adc57603e
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/contnr/contentenumeration.cxx8
-rw-r--r--svtools/source/contnr/contentenumeration.hxx3
-rw-r--r--svtools/source/contnr/fileview.cxx15
-rw-r--r--svtools/source/contnr/foldertree.cxx2
4 files changed, 12 insertions, 16 deletions
diff --git a/svtools/source/contnr/contentenumeration.cxx b/svtools/source/contnr/contentenumeration.cxx
index fee02548db08..acc6cc4a019a 100644
--- a/svtools/source/contnr/contentenumeration.cxx
+++ b/svtools/source/contnr/contentenumeration.cxx
@@ -135,7 +135,7 @@ namespace svt
EnumerationResult FileViewContentEnumerator::enumerateFolderContent()
{
- EnumerationResult eResult = ERROR;
+ EnumerationResult eResult = EnumerationResult::ERROR;
try
{
@@ -298,7 +298,7 @@ namespace svt
bCancelled = m_bCancelled;
}
}
- eResult = SUCCESS;
+ eResult = EnumerationResult::SUCCESS;
}
catch( CommandAbortedException& )
{
@@ -324,12 +324,12 @@ namespace svt
::osl::MutexGuard aGuard( m_aMutex );
pHandler = m_pResultHandler;
if ( m_bCancelled )
- return ERROR;
+ return EnumerationResult::ERROR;
}
{
::osl::MutexGuard aGuard( m_rContentMutex );
- if ( eResult != SUCCESS )
+ if ( eResult != EnumerationResult::SUCCESS )
// clear any "intermediate" and unfinished result
m_rContent.clear();
}
diff --git a/svtools/source/contnr/contentenumeration.hxx b/svtools/source/contnr/contentenumeration.hxx
index 70bfef23b479..74beb8bd06a9 100644
--- a/svtools/source/contnr/contentenumeration.hxx
+++ b/svtools/source/contnr/contentenumeration.hxx
@@ -127,11 +127,10 @@ namespace svt
//= EnumerationResult
- enum EnumerationResult
+ enum class EnumerationResult
{
SUCCESS, /// the enumeration was successful
ERROR, /// the enumeration was unsuccessful
- RUNNING /// the enumeration is still running, and the maximum wait time has passed
};
diff --git a/svtools/source/contnr/fileview.cxx b/svtools/source/contnr/fileview.cxx
index f7fc478d7254..f18e73ff4cdf 100644
--- a/svtools/source/contnr/fileview.cxx
+++ b/svtools/source/contnr/fileview.cxx
@@ -1449,7 +1449,7 @@ const OUString* NameTranslator_Impl::GetTransTableFileName() const
SvtFileView_Impl::SvtFileView_Impl( SvtFileView* pAntiImpl, Reference < XCommandEnvironment > const & xEnv, FileViewFlags nFlags, bool bOnlyFolder )
:mpAntiImpl ( pAntiImpl )
- ,m_eAsyncActionResult ( ::svt::ERROR )
+ ,m_eAsyncActionResult ( ::svt::EnumerationResult::ERROR )
,m_bRunningAsyncAction ( false )
,m_bAsyncActionCancelled ( false )
,m_eViewMode ( eDetailedList )
@@ -1535,7 +1535,7 @@ FileViewResult SvtFileView_Impl::GetFolderContent_Impl(
if ( !pAsyncDescriptor )
{
::svt::EnumerationResult eResult = m_xContentEnumerator->enumerateFolderContentSync( _rFolder, rBlackList );
- if ( ::svt::SUCCESS == eResult )
+ if ( ::svt::EnumerationResult::SUCCESS == eResult )
{
implEnumerationSuccess();
m_xContentEnumerator.clear();
@@ -1547,7 +1547,7 @@ FileViewResult SvtFileView_Impl::GetFolderContent_Impl(
m_bRunningAsyncAction = true;
m_bAsyncActionCancelled = false;
- m_eAsyncActionResult = ::svt::ERROR;
+ m_eAsyncActionResult = ::svt::EnumerationResult::ERROR;
m_aAsyncActionFinished.reset();
// don't (yet) set m_aCurrentAsyncActionHandler to pTimeout->aFinishHandler.
@@ -1606,14 +1606,11 @@ FileViewResult SvtFileView_Impl::GetFolderContent_Impl(
m_bRunningAsyncAction = false;
switch ( m_eAsyncActionResult )
{
- case ::svt::SUCCESS:
+ case ::svt::EnumerationResult::SUCCESS:
return eSuccess;
- case ::svt::ERROR:
+ case ::svt::EnumerationResult::ERROR:
return eFailure;
-
- case ::svt::RUNNING:
- return eStillRunning;
}
SAL_WARN( "svtools.contnr", "SvtFileView_Impl::GetFolderContent_Impl: unreachable!" );
@@ -1849,7 +1846,7 @@ void SvtFileView_Impl::enumerationDone( ::svt::EnumerationResult eResult )
m_aAsyncActionFinished.set();
- if ( svt::SUCCESS == eResult )
+ if ( svt::EnumerationResult::SUCCESS == eResult )
implEnumerationSuccess();
if ( m_aCurrentAsyncActionHandler.IsSet() )
diff --git a/svtools/source/contnr/foldertree.cxx b/svtools/source/contnr/foldertree.cxx
index 2d6b8d1b8c58..0ea1a21ff10b 100644
--- a/svtools/source/contnr/foldertree.cxx
+++ b/svtools/source/contnr/foldertree.cxx
@@ -62,7 +62,7 @@ void FolderTree::FillTreeEntry( SvTreeListEntry* pEntry )
EnumerationResult eResult =
xContentEnumerator->enumerateFolderContentSync( aFolder, m_aBlackList );
- if ( SUCCESS == eResult )
+ if ( EnumerationResult::SUCCESS == eResult )
{
for(SortingData_Impl* i : aContent)
{