Kaydet (Commit) 7bd5d9c8 authored tarafından Noel Grandin's avatar Noel Grandin

convert to EnumerationResult to scoped enum

and drop unused RUNNING constant

Change-Id: I498b8b47e172336775b38c953f867f2adc57603e
üst a42554c3
...@@ -144,6 +144,7 @@ for d in definitionSet: ...@@ -144,6 +144,7 @@ for d in definitionSet:
"sw/inc/toxe.hxx", # ToxAuthorityType (from UI) "sw/inc/toxe.hxx", # ToxAuthorityType (from UI)
"include/svx/sxekitm.hxx", # SdrEdgeKind (from UI) "include/svx/sxekitm.hxx", # SdrEdgeKind (from UI)
"include/svx/paraprev.hxx", # SvxPrevLineSpace (from UI) "include/svx/paraprev.hxx", # SvxPrevLineSpace (from UI)
"include/svx/ctredlin.hxx", # SvxRedlinDateMode (from UI)
# represents constants from an external API # represents constants from an external API
"opencl/inc/opencl_device_selection.h", "opencl/inc/opencl_device_selection.h",
"vcl/inc/sft.hxx", "vcl/inc/sft.hxx",
......
...@@ -135,7 +135,7 @@ namespace svt ...@@ -135,7 +135,7 @@ namespace svt
EnumerationResult FileViewContentEnumerator::enumerateFolderContent() EnumerationResult FileViewContentEnumerator::enumerateFolderContent()
{ {
EnumerationResult eResult = ERROR; EnumerationResult eResult = EnumerationResult::ERROR;
try try
{ {
...@@ -298,7 +298,7 @@ namespace svt ...@@ -298,7 +298,7 @@ namespace svt
bCancelled = m_bCancelled; bCancelled = m_bCancelled;
} }
} }
eResult = SUCCESS; eResult = EnumerationResult::SUCCESS;
} }
catch( CommandAbortedException& ) catch( CommandAbortedException& )
{ {
...@@ -324,12 +324,12 @@ namespace svt ...@@ -324,12 +324,12 @@ namespace svt
::osl::MutexGuard aGuard( m_aMutex ); ::osl::MutexGuard aGuard( m_aMutex );
pHandler = m_pResultHandler; pHandler = m_pResultHandler;
if ( m_bCancelled ) if ( m_bCancelled )
return ERROR; return EnumerationResult::ERROR;
} }
{ {
::osl::MutexGuard aGuard( m_rContentMutex ); ::osl::MutexGuard aGuard( m_rContentMutex );
if ( eResult != SUCCESS ) if ( eResult != EnumerationResult::SUCCESS )
// clear any "intermediate" and unfinished result // clear any "intermediate" and unfinished result
m_rContent.clear(); m_rContent.clear();
} }
......
...@@ -127,11 +127,10 @@ namespace svt ...@@ -127,11 +127,10 @@ namespace svt
//= EnumerationResult //= EnumerationResult
enum EnumerationResult enum class EnumerationResult
{ {
SUCCESS, /// the enumeration was successful SUCCESS, /// the enumeration was successful
ERROR, /// the enumeration was unsuccessful ERROR, /// the enumeration was unsuccessful
RUNNING /// the enumeration is still running, and the maximum wait time has passed
}; };
......
...@@ -1449,7 +1449,7 @@ const OUString* NameTranslator_Impl::GetTransTableFileName() const ...@@ -1449,7 +1449,7 @@ const OUString* NameTranslator_Impl::GetTransTableFileName() const
SvtFileView_Impl::SvtFileView_Impl( SvtFileView* pAntiImpl, Reference < XCommandEnvironment > const & xEnv, FileViewFlags nFlags, bool bOnlyFolder ) SvtFileView_Impl::SvtFileView_Impl( SvtFileView* pAntiImpl, Reference < XCommandEnvironment > const & xEnv, FileViewFlags nFlags, bool bOnlyFolder )
:mpAntiImpl ( pAntiImpl ) :mpAntiImpl ( pAntiImpl )
,m_eAsyncActionResult ( ::svt::ERROR ) ,m_eAsyncActionResult ( ::svt::EnumerationResult::ERROR )
,m_bRunningAsyncAction ( false ) ,m_bRunningAsyncAction ( false )
,m_bAsyncActionCancelled ( false ) ,m_bAsyncActionCancelled ( false )
,m_eViewMode ( eDetailedList ) ,m_eViewMode ( eDetailedList )
...@@ -1535,7 +1535,7 @@ FileViewResult SvtFileView_Impl::GetFolderContent_Impl( ...@@ -1535,7 +1535,7 @@ FileViewResult SvtFileView_Impl::GetFolderContent_Impl(
if ( !pAsyncDescriptor ) if ( !pAsyncDescriptor )
{ {
::svt::EnumerationResult eResult = m_xContentEnumerator->enumerateFolderContentSync( _rFolder, rBlackList ); ::svt::EnumerationResult eResult = m_xContentEnumerator->enumerateFolderContentSync( _rFolder, rBlackList );
if ( ::svt::SUCCESS == eResult ) if ( ::svt::EnumerationResult::SUCCESS == eResult )
{ {
implEnumerationSuccess(); implEnumerationSuccess();
m_xContentEnumerator.clear(); m_xContentEnumerator.clear();
...@@ -1547,7 +1547,7 @@ FileViewResult SvtFileView_Impl::GetFolderContent_Impl( ...@@ -1547,7 +1547,7 @@ FileViewResult SvtFileView_Impl::GetFolderContent_Impl(
m_bRunningAsyncAction = true; m_bRunningAsyncAction = true;
m_bAsyncActionCancelled = false; m_bAsyncActionCancelled = false;
m_eAsyncActionResult = ::svt::ERROR; m_eAsyncActionResult = ::svt::EnumerationResult::ERROR;
m_aAsyncActionFinished.reset(); m_aAsyncActionFinished.reset();
// don't (yet) set m_aCurrentAsyncActionHandler to pTimeout->aFinishHandler. // don't (yet) set m_aCurrentAsyncActionHandler to pTimeout->aFinishHandler.
...@@ -1606,14 +1606,11 @@ FileViewResult SvtFileView_Impl::GetFolderContent_Impl( ...@@ -1606,14 +1606,11 @@ FileViewResult SvtFileView_Impl::GetFolderContent_Impl(
m_bRunningAsyncAction = false; m_bRunningAsyncAction = false;
switch ( m_eAsyncActionResult ) switch ( m_eAsyncActionResult )
{ {
case ::svt::SUCCESS: case ::svt::EnumerationResult::SUCCESS:
return eSuccess; return eSuccess;
case ::svt::ERROR: case ::svt::EnumerationResult::ERROR:
return eFailure; return eFailure;
case ::svt::RUNNING:
return eStillRunning;
} }
SAL_WARN( "svtools.contnr", "SvtFileView_Impl::GetFolderContent_Impl: unreachable!" ); SAL_WARN( "svtools.contnr", "SvtFileView_Impl::GetFolderContent_Impl: unreachable!" );
...@@ -1849,7 +1846,7 @@ void SvtFileView_Impl::enumerationDone( ::svt::EnumerationResult eResult ) ...@@ -1849,7 +1846,7 @@ void SvtFileView_Impl::enumerationDone( ::svt::EnumerationResult eResult )
m_aAsyncActionFinished.set(); m_aAsyncActionFinished.set();
if ( svt::SUCCESS == eResult ) if ( svt::EnumerationResult::SUCCESS == eResult )
implEnumerationSuccess(); implEnumerationSuccess();
if ( m_aCurrentAsyncActionHandler.IsSet() ) if ( m_aCurrentAsyncActionHandler.IsSet() )
......
...@@ -62,7 +62,7 @@ void FolderTree::FillTreeEntry( SvTreeListEntry* pEntry ) ...@@ -62,7 +62,7 @@ void FolderTree::FillTreeEntry( SvTreeListEntry* pEntry )
EnumerationResult eResult = EnumerationResult eResult =
xContentEnumerator->enumerateFolderContentSync( aFolder, m_aBlackList ); xContentEnumerator->enumerateFolderContentSync( aFolder, m_aBlackList );
if ( SUCCESS == eResult ) if ( EnumerationResult::SUCCESS == eResult )
{ {
for(SortingData_Impl* i : aContent) for(SortingData_Impl* i : aContent)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment