summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2016-10-14 11:32:17 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2016-10-14 12:53:01 +0200
commit11570275c601496bd709da1454cd8ffde50823e7 (patch)
tree0a7791e601f07437feb1d04f3c8aaca1771de687 /sfx2
parenta1b7231a33322bbbb8352e2cd6aeff3b473b01d4 (diff)
convert LOCK_UI constants to scoped enum
Change-Id: Ie8a8702124ba86feda17c4371e66c3997ba3557c
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/doc/docfile.cxx22
1 files changed, 9 insertions, 13 deletions
diff --git a/sfx2/source/doc/docfile.cxx b/sfx2/source/doc/docfile.cxx
index b8efb549e253..e93e95407773 100644
--- a/sfx2/source/doc/docfile.cxx
+++ b/sfx2/source/doc/docfile.cxx
@@ -134,10 +134,6 @@ namespace {
#if HAVE_FEATURE_MULTIUSER_ENVIRONMENT
-static const sal_Int8 LOCK_UI_NOLOCK = 0;
-static const sal_Int8 LOCK_UI_SUCCEEDED = 1;
-static const sal_Int8 LOCK_UI_TRY = 2;
-
bool IsSystemFileLockingUsed()
{
#if HAVE_FEATURE_MACOSX_SANDBOX
@@ -838,9 +834,9 @@ void SfxMedium::SetEncryptionDataToStorage_Impl()
// not for some URL scheme belongs in UCB, not here.
-sal_Int8 SfxMedium::ShowLockedDocumentDialog( const LockFileEntry& aData, bool bIsLoading, bool bOwnLock )
+SfxMedium::ShowLockResult SfxMedium::ShowLockedDocumentDialog( const LockFileEntry& aData, bool bIsLoading, bool bOwnLock )
{
- sal_Int8 nResult = LOCK_UI_NOLOCK;
+ ShowLockResult nResult = ShowLockResult::NoLock;
if( aData[LockFileComponent::OOOUSERNAME] == aData[LockFileComponent::SYSUSERNAME] ||
aData[LockFileComponent::OOOUSERNAME].isEmpty() ||
@@ -907,7 +903,7 @@ sal_Int8 SfxMedium::ShowLockedDocumentDialog( const LockFileEntry& aData, bool b
GetItemSet()->Put( SfxBoolItem( SID_TEMPLATE, true ) );
}
else if ( bOwnLock )
- nResult = LOCK_UI_SUCCEEDED;
+ nResult = ShowLockResult::Succeeded;
}
else // if ( XSelected == aContinuations[1] )
{
@@ -919,7 +915,7 @@ sal_Int8 SfxMedium::ShowLockedDocumentDialog( const LockFileEntry& aData, bool b
if ( bIsLoading )
GetItemSet()->Put( SfxBoolItem( SID_DOC_READONLY, true ) );
else
- nResult = LOCK_UI_TRY;
+ nResult = ShowLockResult::Try;
}
}
else
@@ -983,7 +979,7 @@ void SfxMedium::LockOrigFileOnDemand( bool bLoading, bool bNoUI )
if ( !bResult && !IsReadOnly() )
{
- sal_Int8 bUIStatus = LOCK_UI_NOLOCK;
+ ShowLockResult bUIStatus = ShowLockResult::NoLock;
do
{
if( !bResult )
@@ -1053,7 +1049,7 @@ void SfxMedium::LockOrigFileOnDemand( bool bLoading, bool bNoUI )
catch( uno::Exception& )
{}
}
- } while( !bResult && bUIStatus == LOCK_UI_TRY );
+ } while( !bResult && bUIStatus == ShowLockResult::Try );
}
pImpl->m_bLocked = bResult;
@@ -1161,7 +1157,7 @@ void SfxMedium::LockOrigFileOnDemand( bool bLoading, bool bNoUI )
}
}
- sal_Int8 bUIStatus = LOCK_UI_NOLOCK;
+ ShowLockResult bUIStatus = ShowLockResult::NoLock;
// check whether system file locking has been used, the default value is false
bool bUseSystemLock = comphelper::isFileUrl( pImpl->m_aLogicName ) && IsSystemFileLockingUsed();
@@ -1267,7 +1263,7 @@ void SfxMedium::LockOrigFileOnDemand( bool bLoading, bool bNoUI )
if ( !bResult && !bNoUI )
{
bUIStatus = ShowLockedDocumentDialog( aData, bLoading, bOwnLock );
- if ( bUIStatus == LOCK_UI_SUCCEEDED )
+ if ( bUIStatus == ShowLockResult::Succeeded )
{
// take the ownership over the lock file
bResult = aLockFile.OverwriteOwnLockFile();
@@ -1280,7 +1276,7 @@ void SfxMedium::LockOrigFileOnDemand( bool bLoading, bool bNoUI )
catch( const uno::Exception& )
{
}
- } while( !bResult && bUIStatus == LOCK_UI_TRY );
+ } while( !bResult && bUIStatus == ShowLockResult::Try );
pImpl->m_bLocked = bResult;
}