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:
"sw/inc/toxe.hxx", # ToxAuthorityType (from UI)
"include/svx/sxekitm.hxx", # SdrEdgeKind (from UI)
"include/svx/paraprev.hxx", # SvxPrevLineSpace (from UI)
"include/svx/ctredlin.hxx", # SvxRedlinDateMode (from UI)
# represents constants from an external API
"opencl/inc/opencl_device_selection.h",
"vcl/inc/sft.hxx",
......
......@@ -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();
}
......
......@@ -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
};
......
......@@ -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() )
......
......@@ -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)
{
......
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