summaryrefslogtreecommitdiff
path: root/sfx2/source
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-04-10 12:17:41 +0200
committerNoel Grandin <noel@peralex.com>2015-04-13 09:34:52 +0200
commitccfa9fa13db230cc66207bc42d528b773c4cf4f6 (patch)
treeec43614086a60bab2139f83e3b50260fff5216ce /sfx2/source
parentb2bae9b940fc34d2eecd7839e3cba1f41d111e87 (diff)
convert SFX_LOADED_ to scoped enum
Change-Id: I065a07e1bb5f5a7f85429c919830b6b9605206ea
Diffstat (limited to 'sfx2/source')
-rw-r--r--sfx2/source/doc/objcont.cxx4
-rw-r--r--sfx2/source/doc/objmisc.cxx30
-rw-r--r--sfx2/source/doc/objserv.cxx10
-rw-r--r--sfx2/source/doc/objstor.cxx14
-rw-r--r--sfx2/source/doc/objxtor.cxx4
-rw-r--r--sfx2/source/inc/objshimp.hxx16
-rw-r--r--sfx2/source/view/frame.cxx2
-rw-r--r--sfx2/source/view/viewfrm.cxx4
8 files changed, 41 insertions, 43 deletions
diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx
index f9a25a3ccd3b..95fd6b83e1dc 100644
--- a/sfx2/source/doc/objcont.cxx
+++ b/sfx2/source/doc/objcont.cxx
@@ -599,7 +599,7 @@ sal_uInt32 SfxObjectShell::GetModifyPasswordHash() const
bool SfxObjectShell::SetModifyPasswordHash( sal_uInt32 nHash )
{
if ( ( !IsReadOnly() && !IsReadOnlyUI() )
- || !(pImp->nFlagsInProgress & SFX_LOADED_MAINDOCUMENT ) )
+ || !(pImp->nFlagsInProgress & SfxLoadedFlags::MAINDOCUMENT ) )
{
// the hash can be changed only in editable documents,
// or during loading of document
@@ -618,7 +618,7 @@ uno::Sequence< beans::PropertyValue > SfxObjectShell::GetModifyPasswordInfo() co
bool SfxObjectShell::SetModifyPasswordInfo( const uno::Sequence< beans::PropertyValue >& aInfo )
{
if ( ( !IsReadOnly() && !IsReadOnlyUI() )
- || !(pImp->nFlagsInProgress & SFX_LOADED_MAINDOCUMENT ) )
+ || !(pImp->nFlagsInProgress & SfxLoadedFlags::MAINDOCUMENT ) )
{
// the hash can be changed only in editable documents,
// or during loading of document
diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index 7d751182b365..f3ac27ce1752 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -1155,7 +1155,7 @@ void SfxObjectShell::SetAutoLoad(
bool SfxObjectShell::IsLoadingFinished() const
{
- return ( pImp->nLoadedFlags == SFX_LOADED_ALL );
+ return ( pImp->nLoadedFlags == SfxLoadedFlags::ALL );
}
void SfxObjectShell::InitOwnModel_Impl()
@@ -1194,14 +1194,14 @@ void SfxObjectShell::InitOwnModel_Impl()
}
}
-void SfxObjectShell::FinishedLoading( sal_uInt16 nFlags )
+void SfxObjectShell::FinishedLoading( SfxLoadedFlags nFlags )
{
bool bSetModifiedTRUE = false;
SFX_ITEMSET_ARG( pMedium->GetItemSet(), pSalvageItem, SfxStringItem, SID_DOC_SALVAGE, false );
- if( ( nFlags & SFX_LOADED_MAINDOCUMENT ) && !(pImp->nLoadedFlags & SFX_LOADED_MAINDOCUMENT )
- && !(pImp->nFlagsInProgress & SFX_LOADED_MAINDOCUMENT ))
+ if( ( nFlags & SfxLoadedFlags::MAINDOCUMENT ) && !(pImp->nLoadedFlags & SfxLoadedFlags::MAINDOCUMENT )
+ && !(pImp->nFlagsInProgress & SfxLoadedFlags::MAINDOCUMENT ))
{
- pImp->nFlagsInProgress |= SFX_LOADED_MAINDOCUMENT;
+ pImp->nFlagsInProgress |= SfxLoadedFlags::MAINDOCUMENT;
static_cast<SfxHeaderAttributes_Impl*>(GetHeaderAttributes())->SetAttributes();
pImp->bImportDone = true;
if( !IsAbortingImport() )
@@ -1225,13 +1225,13 @@ void SfxObjectShell::FinishedLoading( sal_uInt16 nFlags )
bHasName = true; // the document is loaded, so the name should already available
GetTitle( SFX_TITLE_DETECT );
InitOwnModel_Impl();
- pImp->nFlagsInProgress &= ~SFX_LOADED_MAINDOCUMENT;
+ pImp->nFlagsInProgress &= ~SfxLoadedFlags::MAINDOCUMENT;
}
- if( ( nFlags & SFX_LOADED_IMAGES ) && !(pImp->nLoadedFlags & SFX_LOADED_IMAGES )
- && !(pImp->nFlagsInProgress & SFX_LOADED_IMAGES ))
+ if( ( nFlags & SfxLoadedFlags::IMAGES ) && !(pImp->nLoadedFlags & SfxLoadedFlags::IMAGES )
+ && !(pImp->nFlagsInProgress & SfxLoadedFlags::IMAGES ))
{
- pImp->nFlagsInProgress |= SFX_LOADED_IMAGES;
+ pImp->nFlagsInProgress |= SfxLoadedFlags::IMAGES;
uno::Reference<document::XDocumentProperties> xDocProps(
getDocProperties());
OUString url(xDocProps->getAutoloadURL());
@@ -1241,12 +1241,12 @@ void SfxObjectShell::FinishedLoading( sal_uInt16 nFlags )
if( !bSetModifiedTRUE && IsEnableSetModified() )
SetModified( false );
Invalidate( SID_SAVEASDOC );
- pImp->nFlagsInProgress &= ~SFX_LOADED_IMAGES;
+ pImp->nFlagsInProgress &= ~SfxLoadedFlags::IMAGES;
}
pImp->nLoadedFlags |= nFlags;
- if ( !pImp->nFlagsInProgress )
+ if ( pImp->nFlagsInProgress == SfxLoadedFlags::NONE )
{
// in case of reentrance calls the first called FinishedLoading() call on the stack
// should do the notification, in result the notification is done when all the FinishedLoading() calls are finished
@@ -1256,7 +1256,7 @@ void SfxObjectShell::FinishedLoading( sal_uInt16 nFlags )
else
SetModified( false );
- if ( (pImp->nLoadedFlags & SFX_LOADED_MAINDOCUMENT ) && (pImp->nLoadedFlags & SFX_LOADED_IMAGES ) )
+ if ( (pImp->nLoadedFlags & SfxLoadedFlags::MAINDOCUMENT ) && (pImp->nLoadedFlags & SfxLoadedFlags::IMAGES ) )
{
SFX_ITEMSET_ARG( pMedium->GetItemSet(), pTemplateItem, SfxBoolItem, SID_TEMPLATE, false);
bool bTemplate = pTemplateItem && pTemplateItem->GetValue();
@@ -1402,7 +1402,7 @@ bool SfxObjectShell::IsLoading() const
Has FinishedLoading been called?
*/
{
- return !( pImp->nLoadedFlags & SFX_LOADED_MAINDOCUMENT );
+ return !( pImp->nLoadedFlags & SfxLoadedFlags::MAINDOCUMENT );
}
@@ -1414,11 +1414,11 @@ void SfxObjectShell::CancelTransfers()
by RegisterTransfer.
*/
{
- if( ( pImp->nLoadedFlags & SFX_LOADED_ALL ) != SFX_LOADED_ALL )
+ if( ( pImp->nLoadedFlags & SfxLoadedFlags::ALL ) != SfxLoadedFlags::ALL )
{
AbortImport();
if( IsLoading() )
- FinishedLoading( SFX_LOADED_ALL );
+ FinishedLoading( SfxLoadedFlags::ALL );
}
}
diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx
index 1a10c396a38a..8c4db55720cb 100644
--- a/sfx2/source/doc/objserv.cxx
+++ b/sfx2/source/doc/objserv.cxx
@@ -1050,7 +1050,7 @@ void SfxObjectShell::GetState_Impl(SfxItemSet &rSet)
case SID_SAVEASDOC:
{
- if( ( pImp->nLoadedFlags & SFX_LOADED_MAINDOCUMENT ) != SFX_LOADED_MAINDOCUMENT )
+ if( !( pImp->nLoadedFlags & SfxLoadedFlags::MAINDOCUMENT ) )
{
rSet.DisableItem( nWhich );
break;
@@ -1064,7 +1064,7 @@ void SfxObjectShell::GetState_Impl(SfxItemSet &rSet)
case SID_SAVEACOPY:
{
- if( ( pImp->nLoadedFlags & SFX_LOADED_MAINDOCUMENT ) != SFX_LOADED_MAINDOCUMENT )
+ if( !( pImp->nLoadedFlags & SfxLoadedFlags::MAINDOCUMENT ) )
{
rSet.DisableItem( nWhich );
break;
@@ -1234,13 +1234,11 @@ void SfxObjectShell::StateProps_Impl(SfxItemSet &rSet)
}
case SID_DOC_LOADING:
- rSet.Put( SfxBoolItem( nSID, SFX_LOADED_MAINDOCUMENT !=
- ( pImp->nLoadedFlags & SFX_LOADED_MAINDOCUMENT ) ) );
+ rSet.Put( SfxBoolItem( nSID, ! ( pImp->nLoadedFlags & SfxLoadedFlags::MAINDOCUMENT ) ) );
break;
case SID_IMG_LOADING:
- rSet.Put( SfxBoolItem( nSID, SFX_LOADED_IMAGES !=
- ( pImp->nLoadedFlags & SFX_LOADED_IMAGES ) ) );
+ rSet.Put( SfxBoolItem( nSID, ! ( pImp->nLoadedFlags & SfxLoadedFlags::IMAGES ) ) );
break;
}
}
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 32dcfef727a6..cfd7bfc31297 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -657,7 +657,7 @@ bool SfxObjectShell::DoLoad( SfxMedium *pMed )
}
pMed->GetItemSet()->Put( SfxStringItem( SID_DOC_BASEURL, aBaseURL ) );
- pImp->nLoadedFlags = 0;
+ pImp->nLoadedFlags = SfxLoadedFlags::NONE;
pImp->bModelInitialized = false;
//TODO/LATER: make a clear strategy how to handle "UsesStorage" etc.
@@ -718,7 +718,7 @@ bool SfxObjectShell::DoLoad( SfxMedium *pMed )
// Load
if ( !GetError() )
{
- pImp->nLoadedFlags = 0;
+ pImp->nLoadedFlags = SfxLoadedFlags::NONE;
pImp->bModelInitialized = false;
bOk = xStorage.is() && LoadOwnFormat( *pMed );
if ( bOk )
@@ -748,7 +748,7 @@ bool SfxObjectShell::DoLoad( SfxMedium *pMed )
if ( GetError() == ERRCODE_NONE )
{
- pImp->nLoadedFlags = 0;
+ pImp->nLoadedFlags = SfxLoadedFlags::NONE;
pImp->bModelInitialized = false;
if ( pMedium->GetFilter() && ( pMedium->GetFilter()->GetFilterFlags() & SfxFilterFlags::STARONEFILTER ) )
{
@@ -774,7 +774,7 @@ bool SfxObjectShell::DoLoad( SfxMedium *pMed )
{}
}
UpdateLinks();
- FinishedLoading( SFX_LOADED_ALL );
+ FinishedLoading( SfxLoadedFlags::ALL );
}
else
{
@@ -832,10 +832,10 @@ bool SfxObjectShell::DoLoad( SfxMedium *pMed )
}
// If not loaded asynchronously call FinishedLoading
- if ( !( pImp->nLoadedFlags & SFX_LOADED_MAINDOCUMENT ) &&
- ( !pMedium->GetFilter() || pMedium->GetFilter()->UsesStorage() )
+ if ( !( pImp->nLoadedFlags & SfxLoadedFlags::MAINDOCUMENT ) &&
+ ( !pMedium->GetFilter() || pMedium->GetFilter()->UsesStorage() )
)
- FinishedLoading( SFX_LOADED_MAINDOCUMENT );
+ FinishedLoading( SfxLoadedFlags::MAINDOCUMENT );
if( IsOwnStorageFormat_Impl(*pMed) && pMed->GetFilter() )
{
diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx
index 67504bcef382..611441161138 100644
--- a/sfx2/source/doc/objxtor.cxx
+++ b/sfx2/source/doc/objxtor.cxx
@@ -246,8 +246,8 @@ SfxObjectShell_Impl::SfxObjectShell_Impl( SfxObjectShell& _rDocShell )
,nEventId ( 0)
,pReloadTimer ( 0)
,pMarkData( 0 )
- ,nLoadedFlags ( SFX_LOADED_ALL )
- ,nFlagsInProgress( 0 )
+ ,nLoadedFlags ( SfxLoadedFlags::ALL )
+ ,nFlagsInProgress( SfxLoadedFlags::NONE )
,bModalMode( false )
,bRunningMacro( false )
,bReloadAvailable( false )
diff --git a/sfx2/source/inc/objshimp.hxx b/sfx2/source/inc/objshimp.hxx
index ff3f2b31f2e0..88678606daa1 100644
--- a/sfx2/source/inc/objshimp.hxx
+++ b/sfx2/source/inc/objshimp.hxx
@@ -95,31 +95,31 @@ struct SfxObjectShell_Impl : public ::sfx2::IMacroDocumentAccess
m_bConfigOptionsChecked:1; // whether or not the user options are checked after the Options dialog is closed.
IndexBitSet aBitSet;
- sal_uInt32 lErr;
+ sal_uInt32 lErr;
sal_uInt16 nEventId; // If Open/Create as to be sent
// before Activate
AutoReloadTimer_Impl *pReloadTimer;
MarkData_Impl* pMarkData;
- sal_uInt16 nLoadedFlags;
- sal_uInt16 nFlagsInProgress;
+ SfxLoadedFlags nLoadedFlags;
+ SfxLoadedFlags nFlagsInProgress;
bool bModalMode;
bool bRunningMacro;
bool bReloadAvailable;
- sal_uInt16 nAutoLoadLocks;
- SfxModule* pModule;
+ sal_uInt16 nAutoLoadLocks;
+ SfxModule* pModule;
SfxObjectShellFlags eFlags;
bool bReadOnlyUI;
tools::SvRef<SvRefBase> xHeaderAttributes;
::rtl::Reference< SfxBaseModel >
pBaseModel;
- sal_uInt16 nStyleFilter;
+ sal_uInt16 nStyleFilter;
bool bDisposing;
bool m_bEnableSetModified;
bool m_bIsModified;
- Rectangle m_aVisArea;
- MapUnit m_nMapUnit;
+ Rectangle m_aVisArea;
+ MapUnit m_nMapUnit;
bool m_bCreateTempStor;
::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage > m_xDocStorage;
diff --git a/sfx2/source/view/frame.cxx b/sfx2/source/view/frame.cxx
index 4b3696887b3e..82c03818579b 100644
--- a/sfx2/source/view/frame.cxx
+++ b/sfx2/source/view/frame.cxx
@@ -284,7 +284,7 @@ void SfxFrame::CancelTransfers( bool /*bCancelLoadEnv*/ )
{
pImp->bInCancelTransfers = true;
SfxObjectShell* pObj = GetCurrentDocument();
- if( pObj ) //&& !( pObj->Get_Impl()->nLoadedFlags & SFX_LOADED_ALL ))
+ if( pObj ) //&& !( pObj->Get_Impl()->nLoadedFlags & SfxLoadedFlags::ALL ))
{
SfxViewFrame* pFrm;
for( pFrm = SfxViewFrame::GetFirst( pObj );
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index c2d63d9cb88a..509fa7dac853 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -331,7 +331,7 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
// Due to Double occupancy in toolboxes (with or without Ctrl),
// it is also possible that the slot is enabled, but Ctrl-click
// despite this is not!
- if( !pSh || !pSh->HasName() || !(pSh->Get_Impl()->nLoadedFlags & SFX_LOADED_MAINDOCUMENT ))
+ if( !pSh || !pSh->HasName() || !(pSh->Get_Impl()->nLoadedFlags & SfxLoadedFlags::MAINDOCUMENT ))
break;
SfxMedium* pMed = pSh->GetMedium();
@@ -862,7 +862,7 @@ void SfxViewFrame::StateReload_Impl( SfxItemSet& rSet )
const SfxShell *pFSh;
if ( !pSh ||
!pSh->HasName() ||
- !( pSh->Get_Impl()->nLoadedFlags & SFX_LOADED_MAINDOCUMENT ) ||
+ !( pSh->Get_Impl()->nLoadedFlags & SfxLoadedFlags::MAINDOCUMENT ) ||
( pSh->GetCreateMode() == SfxObjectCreateMode::EMBEDDED &&
( !(pVSh = pSh->GetViewShell()) ||
!(pFSh = pVSh->GetFormShell()) ||