diff options
author | Noel Grandin <noel@peralex.com> | 2015-04-10 12:17:41 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-04-13 09:34:52 +0200 |
commit | ccfa9fa13db230cc66207bc42d528b773c4cf4f6 (patch) | |
tree | ec43614086a60bab2139f83e3b50260fff5216ce /sfx2/source/doc | |
parent | b2bae9b940fc34d2eecd7839e3cba1f41d111e87 (diff) |
convert SFX_LOADED_ to scoped enum
Change-Id: I065a07e1bb5f5a7f85429c919830b6b9605206ea
Diffstat (limited to 'sfx2/source/doc')
-rw-r--r-- | sfx2/source/doc/objcont.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/doc/objmisc.cxx | 30 | ||||
-rw-r--r-- | sfx2/source/doc/objserv.cxx | 10 | ||||
-rw-r--r-- | sfx2/source/doc/objstor.cxx | 14 | ||||
-rw-r--r-- | sfx2/source/doc/objxtor.cxx | 4 |
5 files changed, 30 insertions, 32 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 ) |