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 | |
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')
-rw-r--r-- | sfx2/source/appl/sfxpicklist.cxx | 2 | ||||
-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 | ||||
-rw-r--r-- | sfx2/source/view/sfxbasecontroller.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/view/viewfrm.cxx | 10 | ||||
-rw-r--r-- | sfx2/source/view/viewfrm2.cxx | 2 |
10 files changed, 35 insertions, 35 deletions
diff --git a/sfx2/source/appl/sfxpicklist.cxx b/sfx2/source/appl/sfxpicklist.cxx index 1e6550b1abb2..4ef292182a1b 100644 --- a/sfx2/source/appl/sfxpicklist.cxx +++ b/sfx2/source/appl/sfxpicklist.cxx @@ -167,7 +167,7 @@ void SfxPickList::AddDocumentToPickList( SfxObjectShell* pDocSh ) // Unnamed Documents and embedded-Documents not in Picklist if ( !pDocSh->HasName() || - SFX_CREATE_MODE_STANDARD != pDocSh->GetCreateMode() ) + SfxObjectCreateMode::STANDARD != pDocSh->GetCreateMode() ) return; // Help not in History 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(); diff --git a/sfx2/source/view/sfxbasecontroller.cxx b/sfx2/source/view/sfxbasecontroller.cxx index 9f160d7615e9..e9fc0af43150 100644 --- a/sfx2/source/view/sfxbasecontroller.cxx +++ b/sfx2/source/view/sfxbasecontroller.cxx @@ -1241,7 +1241,7 @@ void SfxBaseController::ConnectSfxFrame_Impl( const ConnectSfxFrame i_eConnect ) if ( i_eConnect == E_CONNECT ) { if ( ( m_pData->m_pViewShell->GetObjectShell() != NULL ) - && ( m_pData->m_pViewShell->GetObjectShell()->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED ) + && ( m_pData->m_pViewShell->GetObjectShell()->GetCreateMode() == SfxObjectCreateMode::EMBEDDED ) ) { SfxViewFrame* pViewFrm = m_pData->m_pViewShell->GetViewFrame(); diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index 434b387dc50e..c2d63d9cb88a 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -721,7 +721,7 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) pMedium->CloseAndRelease(); } - xNewObj = SfxObjectShell::CreateObject( pFilter->GetServiceName(), SFX_CREATE_MODE_STANDARD ); + xNewObj = SfxObjectShell::CreateObject( pFilter->GetServiceName(), SfxObjectCreateMode::STANDARD ); if ( xOldObj->IsModifyPasswordEntered() ) xNewObj->SetModifyPasswordEntered(); @@ -863,7 +863,7 @@ void SfxViewFrame::StateReload_Impl( SfxItemSet& rSet ) if ( !pSh || !pSh->HasName() || !( pSh->Get_Impl()->nLoadedFlags & SFX_LOADED_MAINDOCUMENT ) || - ( pSh->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED && + ( pSh->GetCreateMode() == SfxObjectCreateMode::EMBEDDED && ( !(pVSh = pSh->GetViewShell()) || !(pFSh = pVSh->GetFormShell()) || !pFSh->IsDesignMode()))) @@ -883,7 +883,7 @@ void SfxViewFrame::StateReload_Impl( SfxItemSet& rSet ) { SfxFrame* pFrame = &GetTopFrame(); - if ( !pSh || !pSh->CanReload_Impl() || pSh->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED ) + if ( !pSh || !pSh->CanReload_Impl() || pSh->GetCreateMode() == SfxObjectCreateMode::EMBEDDED ) rSet.DisableItem(nWhich); else { @@ -1092,7 +1092,7 @@ void SfxViewFrame::ReleaseObjectShell_Impl() Notify( *xObjSh, SfxSimpleHint(SFX_HINT_TITLECHANGED) ); Notify( *xObjSh, SfxSimpleHint(SFX_HINT_DOCCHANGED) ); - if ( 1 == xObjSh->GetOwnerLockCount() && pImp->bObjLocked && xObjSh->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED ) + if ( 1 == xObjSh->GetOwnerLockCount() && pImp->bObjLocked && xObjSh->GetCreateMode() == SfxObjectCreateMode::EMBEDDED ) xObjSh->DoClose(); SfxObjectShellRef xDyingObjSh = xObjSh; xObjSh.Clear(); @@ -1348,7 +1348,7 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint ) const SfxViewShell *pVSh; const SfxShell *pFSh; if ( !xObjSh->IsReadOnly() || - ( xObjSh->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED && + ( xObjSh->GetCreateMode() == SfxObjectCreateMode::EMBEDDED && (pVSh = xObjSh->GetViewShell()) && (pFSh = pVSh->GetFormShell()) && !pFSh->IsDesignMode())) diff --git a/sfx2/source/view/viewfrm2.cxx b/sfx2/source/view/viewfrm2.cxx index ff8f3e9f2698..8c2ba6e7f9ff 100644 --- a/sfx2/source/view/viewfrm2.cxx +++ b/sfx2/source/view/viewfrm2.cxx @@ -380,7 +380,7 @@ void SfxViewFrame::INetState_Impl( SfxItemSet &rItemSet ) // Add/SaveToBookmark at BASIC-IDE, QUERY-EDITOR etc. disable SfxObjectShell *pDocSh = GetObjectShell(); bool bPseudo = pDocSh && !( pDocSh->GetFactory().GetFlags() & SFXOBJECTSHELL_HASOPENDOC ); - bool bEmbedded = pDocSh && pDocSh->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED; + bool bEmbedded = pDocSh && pDocSh->GetCreateMode() == SfxObjectCreateMode::EMBEDDED; if ( !pDocSh || bPseudo || bEmbedded || !pDocSh->HasName() ) rItemSet.DisableItem( SID_CREATELINK ); } |