diff options
author | Noel Grandin <noel@peralex.com> | 2015-04-09 15:24:21 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-04-10 09:48:06 +0200 |
commit | 89dd3f80685c66883b6ed4efbf369f5aa2dc292e (patch) | |
tree | 6edf1a741d079c88799df9219270798affd2ffa5 /sfx2/source/doc | |
parent | 84482f5193ff0738563b6e91f66fc95fbc145de3 (diff) |
convert SfxObjectCreateMode to scoped enum
and fix some dodgy usage in /sc in the process
Change-Id: Ia2bee267df31aba431fc8cb81195bb83e5b64deb
Diffstat (limited to 'sfx2/source/doc')
-rw-r--r-- | sfx2/source/doc/objcont.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/doc/objembed.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/doc/objmisc.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/doc/objstor.cxx | 16 | ||||
-rw-r--r-- | sfx2/source/doc/objxtor.cxx | 16 | ||||
-rw-r--r-- | sfx2/source/doc/sfxbasemodel.cxx | 14 |
6 files changed, 27 insertions, 27 deletions
diff --git a/sfx2/source/doc/objcont.cxx b/sfx2/source/doc/objcont.cxx index 3f54b39f640f..f9a25a3ccd3b 100644 --- a/sfx2/source/doc/objcont.cxx +++ b/sfx2/source/doc/objcont.cxx @@ -482,7 +482,7 @@ void SfxObjectShell::UpdateFromTemplate_Impl( ) { // styles should be updated, create document in organizer mode to read in the styles //TODO: testen! - SfxObjectShellLock xTemplDoc = CreateObjectByFactoryName( GetFactory().GetFactoryName(), SFX_CREATE_MODE_ORGANIZER ); + SfxObjectShellLock xTemplDoc = CreateObjectByFactoryName( GetFactory().GetFactoryName(), SfxObjectCreateMode::ORGANIZER ); xTemplDoc->DoInitNew(0); // TODO/MBA: do we need a BaseURL? Then LoadFrom must be extended! diff --git a/sfx2/source/doc/objembed.cxx b/sfx2/source/doc/objembed.cxx index 8acc580b8bce..a5f90700340e 100644 --- a/sfx2/source/doc/objembed.cxx +++ b/sfx2/source/doc/objembed.cxx @@ -119,7 +119,7 @@ void SfxObjectShell::SetVisArea( const Rectangle & rVisArea ) if( pImp->m_aVisArea != rVisArea ) { pImp->m_aVisArea = rVisArea; - if ( GetCreateMode() == SFX_CREATE_MODE_EMBEDDED ) + if ( GetCreateMode() == SfxObjectCreateMode::EMBEDDED ) { if ( IsEnableSetModified() ) SetModified( true ); diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx index 19e74f38ef64..3b598e737a3a 100644 --- a/sfx2/source/doc/objmisc.cxx +++ b/sfx2/source/doc/objmisc.cxx @@ -1801,7 +1801,7 @@ void SfxObjectShell::SetCreateMode_Impl( SfxObjectCreateMode nMode ) bool SfxObjectShell::IsInPlaceActive() { - if ( eCreateMode != SFX_CREATE_MODE_EMBEDDED ) + if ( eCreateMode != SfxObjectCreateMode::EMBEDDED ) return false; SfxViewFrame* pFrame = SfxViewFrame::GetFirst( this ); @@ -1810,7 +1810,7 @@ bool SfxObjectShell::IsInPlaceActive() bool SfxObjectShell::IsUIActive() { - if ( eCreateMode != SFX_CREATE_MODE_EMBEDDED ) + if ( eCreateMode != SfxObjectCreateMode::EMBEDDED ) return false; SfxViewFrame* pFrame = SfxViewFrame::GetFirst( this ); diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index 91c385548117..32dcfef727a6 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -519,7 +519,7 @@ bool SfxObjectShell::DoInitNew( SfxMedium* pMed ) { // empty documents always get their macros from the user, so there is no reason to restrict access pImp->aMacroMode.allowMacroExecution(); - if ( SFX_CREATE_MODE_EMBEDDED == eCreateMode ) + if ( SfxObjectCreateMode::EMBEDDED == eCreateMode ) SetTitle(SfxResId(STR_NONAME).toString()); uno::Reference< frame::XModel > xModel ( GetModel(), uno::UNO_QUERY ); @@ -842,7 +842,7 @@ bool SfxObjectShell::DoLoad( SfxMedium *pMed ) } Broadcast( SfxSimpleHint(SFX_HINT_NAMECHANGED) ); - if ( SFX_CREATE_MODE_EMBEDDED != eCreateMode ) + if ( SfxObjectCreateMode::EMBEDDED != eCreateMode ) { SFX_ITEMSET_ARG( pMedium->GetItemSet(), pAsTempItem, SfxBoolItem, SID_TEMPLATE, false); SFX_ITEMSET_ARG( pMedium->GetItemSet(), pPreviewItem, SfxBoolItem, SID_PREVIEW, false); @@ -1196,7 +1196,7 @@ bool SfxObjectShell::SaveTo_Impl if( pMedSet ) { SFX_ITEMSET_ARG( pMedSet, pSaveToItem, SfxBoolItem, SID_SAVETO, false ); - bCopyTo = GetCreateMode() == SFX_CREATE_MODE_EMBEDDED || + bCopyTo = GetCreateMode() == SfxObjectCreateMode::EMBEDDED || (pSaveToItem && pSaveToItem->GetValue()); } @@ -1211,7 +1211,7 @@ bool SfxObjectShell::SaveTo_Impl if ( pMedium->DocNeedsFileDateCheck() ) rMedium.CheckFileDate( pMedium->GetInitFileDate( false ) ); - if ( bCopyTo && GetCreateMode() != SFX_CREATE_MODE_EMBEDDED ) + if ( bCopyTo && GetCreateMode() != SfxObjectCreateMode::EMBEDDED ) { // export to the same location is forbidden SetError( ERRCODE_IO_CANTWRITE, OUString( OSL_LOG_PREFIX ) ); @@ -1451,7 +1451,7 @@ bool SfxObjectShell::SaveTo_Impl //fdo#61320: only store thumbnail image if the corresponding option is enabled in the configuration if ( bOk && officecfg::Office::Common::Save::Document::GenerateThumbnail::get() - && GetCreateMode() != SFX_CREATE_MODE_EMBEDDED && !bPasswdProvided ) + && GetCreateMode() != SfxObjectCreateMode::EMBEDDED && !bPasswdProvided ) { // store the thumbnail representation image // the thumbnail is not stored in case of encrypted document @@ -2082,7 +2082,7 @@ bool SfxObjectShell::DoSaveCompleted( SfxMedium* pNewMed ) pNewMed->SetCachedSignatureState_Impl( SIGNATURESTATE_NOSIGNATURES ); // set the default value back // Set new title - if (!pNewMed->GetName().isEmpty() && SFX_CREATE_MODE_EMBEDDED != eCreateMode) + if (!pNewMed->GetName().isEmpty() && SfxObjectCreateMode::EMBEDDED != eCreateMode) InvalidateName(); SetModified(false); // reset only by set medium Broadcast( SfxSimpleHint(SFX_HINT_MODECHANGED) ); @@ -2818,7 +2818,7 @@ bool SfxObjectShell::PreDoSaveAs_Impl // check if a "SaveTo" is wanted, no "SaveAs" SFX_ITEMSET_ARG( pParams, pSaveToItem, SfxBoolItem, SID_SAVETO, false ); - bool bCopyTo = GetCreateMode() == SFX_CREATE_MODE_EMBEDDED || (pSaveToItem && pSaveToItem->GetValue()); + bool bCopyTo = GetCreateMode() == SfxObjectCreateMode::EMBEDDED || (pSaveToItem && pSaveToItem->GetValue()); // distinguish between "Save" and "SaveAs" pImp->bIsSaving = false; @@ -3155,7 +3155,7 @@ bool SfxObjectShell::SaveAsChildren( SfxMedium& rMedium ) if ( pImp->mpObjectContainer ) { bool bOasis = ( SotStorage::GetVersion( xStorage ) > SOFFICE_FILEFORMAT_60 ); - GetEmbeddedObjectContainer().StoreAsChildren(bOasis,SFX_CREATE_MODE_EMBEDDED == eCreateMode,xStorage); + GetEmbeddedObjectContainer().StoreAsChildren(bOasis,SfxObjectCreateMode::EMBEDDED == eCreateMode,xStorage); } if ( bResult ) diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx index 4b7d6dd6a47b..67405aca5d93 100644 --- a/sfx2/source/doc/objxtor.cxx +++ b/sfx2/source/doc/objxtor.cxx @@ -284,14 +284,14 @@ SfxObjectShell::SfxObjectShell( const sal_uInt64 i_nCreationFlags ) : pImp( new SfxObjectShell_Impl( *this ) ) , pMedium(0) , pStyleSheetPool(0) - , eCreateMode(SFX_CREATE_MODE_STANDARD) + , eCreateMode(SfxObjectCreateMode::STANDARD) , bHasName( false ) , bIsInGenerateThumbnail ( false ) { if (i_nCreationFlags & SFXMODEL_EMBEDDED_OBJECT) - eCreateMode = SFX_CREATE_MODE_EMBEDDED; + eCreateMode = SfxObjectCreateMode::EMBEDDED; else if (i_nCreationFlags & SFXMODEL_EXTERNAL_LINK) - eCreateMode = SFX_CREATE_MODE_INTERNAL; + eCreateMode = SfxObjectCreateMode::INTERNAL; const bool bScriptSupport = ( i_nCreationFlags & SFXMODEL_DISABLE_EMBEDDED_SCRIPTS ) == 0; if ( !bScriptSupport ) @@ -311,18 +311,18 @@ SfxObjectShell::SfxObjectShell SfxObjectCreateMode eMode /* Purpose, io which the SfxObjectShell is created: - SFX_CREATE_MODE_EMBEDDED (default) + SfxObjectCreateMode::EMBEDDED (default) as SO-Server from within another Document - SFX_CREATE_MODE_STANDARD, + SfxObjectCreateMode::STANDARD, as a normal Document open stand-alone - SFX_CREATE_MODE_PREVIEW + SfxObjectCreateMode::PREVIEW to enable a Preview, if possible are only little information is needed - SFX_CREATE_MODE_ORGANIZER + SfxObjectCreateMode::ORGANIZER to be displayed in the Organizer, here notning of the contents is used */ ) @@ -609,7 +609,7 @@ bool SfxObjectShell::PrepareClose SfxApplication *pSfxApp = SfxGetpApp(); pSfxApp->NotifyEvent( SfxEventHint(SFX_EVENT_PREPARECLOSEDOC, GlobalEventConfig::GetEventName(STR_EVENT_PREPARECLOSEDOC), this) ); - if( GetCreateMode() == SFX_CREATE_MODE_EMBEDDED ) + if( GetCreateMode() == SfxObjectCreateMode::EMBEDDED ) { pImp->bPreparedForClose = true; return true; diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index f16c5a603385..d3c4eb5c6c86 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -887,7 +887,7 @@ sal_Bool SAL_CALL SfxBaseModel::attachResource( const OUString& { bool bEmb(false); if ( ( rArgs[0].Value >>= bEmb ) && bEmb ) - m_pData->m_pObjectShell->SetCreateMode_Impl( SFX_CREATE_MODE_EMBEDDED ); + m_pData->m_pObjectShell->SetCreateMode_Impl( SfxObjectCreateMode::EMBEDDED ); } return sal_True; @@ -1581,7 +1581,7 @@ void SAL_CALL SfxBaseModel::storeSelf( const Sequence< beans::PropertyValue > bool bRet = false; // TODO/LATER: let the embedded case of saving be handled more careful - if ( m_pData->m_pObjectShell->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED ) + if ( m_pData->m_pObjectShell->GetCreateMode() == SfxObjectCreateMode::EMBEDDED ) { // If this is an embedded object that has no URL based location it should be stored to own storage. // An embedded object can have a location based on URL in case it is a link, then it should be @@ -1914,7 +1914,7 @@ void SAL_CALL SfxBaseModel::load( const Sequence< beans::PropertyValue >& seqA } // TODO/LATER: may be the mode should be retrieved from outside and the preused filter should not be set - if ( m_pData->m_pObjectShell->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED ) + if ( m_pData->m_pObjectShell->GetCreateMode() == SfxObjectCreateMode::EMBEDDED ) { SFX_ITEMSET_ARG( pMedium->GetItemSet(), pFilterItem, SfxStringItem, SID_FILTER_NAME, false ); if ( pFilterItem ) @@ -2761,7 +2761,7 @@ void SfxBaseModel::Notify( SfxBroadcaster& rBC , case SFX_EVENT_STORAGECHANGED: { if ( m_pData->m_xUIConfigurationManager.is() - && m_pData->m_pObjectShell->GetCreateMode() != SFX_CREATE_MODE_EMBEDDED ) + && m_pData->m_pObjectShell->GetCreateMode() != SfxObjectCreateMode::EMBEDDED ) { Reference< embed::XStorage > xConfigStorage; OUString aUIConfigFolderName( "Configurations2" ); @@ -3051,7 +3051,7 @@ void SfxBaseModel::impl_store( const OUString& sURL // DocumentProperties must be saved on "SaveTo", so it can be restored // after saving bool bCopyTo = bSaveTo || - m_pData->m_pObjectShell->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED; + m_pData->m_pObjectShell->GetCreateMode() == SfxObjectCreateMode::EMBEDDED; Reference<document::XDocumentProperties> xOldDocProps; if ( bCopyTo ) { @@ -3566,7 +3566,7 @@ Reference< ui::XUIConfigurationManager2 > SfxBaseModel::getUIConfigurationManage // embedded objects did not support local configuration data until OOo 3.0, so there's nothing to // migrate - if ( m_pData->m_pObjectShell->GetCreateMode() != SFX_CREATE_MODE_EMBEDDED ) + if ( m_pData->m_pObjectShell->GetCreateMode() != SfxObjectCreateMode::EMBEDDED ) { // Import old UI configuration from OOo 1.x Reference< embed::XStorage > xOOo1ConfigStorage; @@ -3642,7 +3642,7 @@ void SAL_CALL SfxBaseModel::setVisualAreaSize( sal_Int64 nAspect, const awt::Siz throw Exception(); // TODO: error handling SfxViewFrame* pViewFrm = SfxViewFrame::GetFirst( m_pData->m_pObjectShell, false ); - if ( pViewFrm && m_pData->m_pObjectShell->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED && !pViewFrm->GetFrame().IsInPlace() ) + if ( pViewFrm && m_pData->m_pObjectShell->GetCreateMode() == SfxObjectCreateMode::EMBEDDED && !pViewFrm->GetFrame().IsInPlace() ) { vcl::Window* pWindow = VCLUnoHelper::GetWindow( pViewFrm->GetFrame().GetFrameInterface()->getContainerWindow() ); Size aWinSize = pWindow->GetSizePixel(); |