diff options
author | Noel Grandin <noel@peralex.com> | 2015-04-28 15:01:43 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-04-29 10:41:40 +0200 |
commit | 6bb742b9cbbdabbbd53dd9cdf6cb165e4b30bf86 (patch) | |
tree | e483f00c38dd38429e307a170f80d95dddf57d0e /sfx2 | |
parent | a9bfa6547ae2a4721363289f3816568e6a7e6a2d (diff) |
convert STR_EVENT constants to scoped enum
- also add needed infrastructure to o3tl::enumarray so we can use
std::find on it
- move the Impl inside the .cxx file, no need to expose it in the header
Change-Id: I7758a6175849f46723d97b1e657f846524c3b7cd
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/source/appl/app.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/doc/objembed.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/doc/objmisc.cxx | 6 | ||||
-rw-r--r-- | sfx2/source/doc/objstor.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/doc/objxtor.cxx | 6 | ||||
-rw-r--r-- | sfx2/source/doc/sfxbasemodel.cxx | 18 | ||||
-rw-r--r-- | sfx2/source/view/frame.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/view/sfxbasecontroller.cxx | 6 | ||||
-rw-r--r-- | sfx2/source/view/viewfrm.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/view/viewprn.cxx | 2 |
10 files changed, 26 insertions, 26 deletions
diff --git a/sfx2/source/appl/app.cxx b/sfx2/source/appl/app.cxx index ad88d7700901..290ded19f137 100644 --- a/sfx2/source/appl/app.cxx +++ b/sfx2/source/appl/app.cxx @@ -333,7 +333,7 @@ void SfxApplication::SetViewFrame_Impl( SfxViewFrame *pFrame ) if ( pOldContainerFrame ) { if ( bTaskActivate ) - NotifyEvent( SfxViewEventHint( SFX_EVENT_DEACTIVATEDOC, GlobalEventConfig::GetEventName(STR_EVENT_DEACTIVATEDOC), pOldContainerFrame->GetObjectShell(), pOldContainerFrame->GetFrame().GetController() ) ); + NotifyEvent( SfxViewEventHint( SFX_EVENT_DEACTIVATEDOC, GlobalEventConfig::GetEventName(GlobalEventId::DEACTIVATEDOC), pOldContainerFrame->GetObjectShell(), pOldContainerFrame->GetFrame().GetController() ) ); pOldContainerFrame->DoDeactivate( bTaskActivate, pFrame ); if( pOldContainerFrame->GetProgress() ) @@ -348,7 +348,7 @@ void SfxApplication::SetViewFrame_Impl( SfxViewFrame *pFrame ) if ( bTaskActivate && pNewContainerFrame->GetObjectShell() ) { pNewContainerFrame->GetObjectShell()->PostActivateEvent_Impl( pNewContainerFrame ); - NotifyEvent(SfxViewEventHint(SFX_EVENT_ACTIVATEDOC, GlobalEventConfig::GetEventName(STR_EVENT_ACTIVATEDOC), pNewContainerFrame->GetObjectShell(), pNewContainerFrame->GetFrame().GetController() ) ); + NotifyEvent(SfxViewEventHint(SFX_EVENT_ACTIVATEDOC, GlobalEventConfig::GetEventName(GlobalEventId::ACTIVATEDOC), pNewContainerFrame->GetObjectShell(), pNewContainerFrame->GetFrame().GetController() ) ); } SfxProgress *pProgress = pNewContainerFrame->GetProgress(); diff --git a/sfx2/source/doc/objembed.cxx b/sfx2/source/doc/objembed.cxx index a5f90700340e..1a04f9711ebe 100644 --- a/sfx2/source/doc/objembed.cxx +++ b/sfx2/source/doc/objembed.cxx @@ -124,7 +124,7 @@ void SfxObjectShell::SetVisArea( const Rectangle & rVisArea ) if ( IsEnableSetModified() ) SetModified( true ); - SfxGetpApp()->NotifyEvent(SfxEventHint( SFX_EVENT_VISAREACHANGED, GlobalEventConfig::GetEventName(STR_EVENT_VISAREACHANGED), this)); + SfxGetpApp()->NotifyEvent(SfxEventHint( SFX_EVENT_VISAREACHANGED, GlobalEventConfig::GetEventName(GlobalEventId::VISAREACHANGED), this)); } } } diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx index 98dbc7fee6c9..3aa652121d62 100644 --- a/sfx2/source/doc/objmisc.cxx +++ b/sfx2/source/doc/objmisc.cxx @@ -369,7 +369,7 @@ void SfxObjectShell::ModifyChanged() Invalidate( SID_MACRO_SIGNATURE ); Broadcast( SfxSimpleHint( SFX_HINT_TITLECHANGED ) ); // xmlsec05, signed state might change in title... - SfxGetpApp()->NotifyEvent( SfxEventHint( SFX_EVENT_MODIFYCHANGED, GlobalEventConfig::GetEventName(STR_EVENT_MODIFYCHANGED), this ) ); + SfxGetpApp()->NotifyEvent( SfxEventHint( SFX_EVENT_MODIFYCHANGED, GlobalEventConfig::GetEventName(GlobalEventId::MODIFYCHANGED), this ) ); } @@ -1030,9 +1030,9 @@ void SfxObjectShell::PostActivateEvent_Impl( SfxViewFrame* pFrame ) sal_uInt16 nId = pImp->nEventId; pImp->nEventId = 0; if ( nId == SFX_EVENT_OPENDOC ) - pSfxApp->NotifyEvent(SfxViewEventHint( nId, GlobalEventConfig::GetEventName(STR_EVENT_OPENDOC), this, pFrame->GetFrame().GetController() ), false); + pSfxApp->NotifyEvent(SfxViewEventHint( nId, GlobalEventConfig::GetEventName(GlobalEventId::OPENDOC), this, pFrame->GetFrame().GetController() ), false); else if (nId == SFX_EVENT_CREATEDOC ) - pSfxApp->NotifyEvent(SfxViewEventHint( nId, GlobalEventConfig::GetEventName(STR_EVENT_CREATEDOC), this, pFrame->GetFrame().GetController() ), false); + pSfxApp->NotifyEvent(SfxViewEventHint( nId, GlobalEventConfig::GetEventName(GlobalEventId::CREATEDOC), this, pFrame->GetFrame().GetController() ), false); } } } diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx index d181c628cf5d..afd3de2eb42d 100644 --- a/sfx2/source/doc/objstor.cxx +++ b/sfx2/source/doc/objstor.cxx @@ -3115,7 +3115,7 @@ uno::Reference< embed::XStorage > SfxObjectShell::GetStorage() SetupStorage( pImp->m_xDocStorage, SOFFICE_FILEFORMAT_CURRENT, false, false ); pImp->m_bCreateTempStor = false; - SfxGetpApp()->NotifyEvent( SfxEventHint( SFX_EVENT_STORAGECHANGED, GlobalEventConfig::GetEventName(STR_EVENT_STORAGECHANGED), this ) ); + SfxGetpApp()->NotifyEvent( SfxEventHint( SFX_EVENT_STORAGECHANGED, GlobalEventConfig::GetEventName(GlobalEventId::STORAGECHANGED), this ) ); } catch( uno::Exception& ) { @@ -3266,7 +3266,7 @@ bool SfxObjectShell::SaveCompleted( const uno::Reference< embed::XStorage >& xSt if ( bSendNotification ) { - SfxGetpApp()->NotifyEvent( SfxEventHint( SFX_EVENT_STORAGECHANGED, GlobalEventConfig::GetEventName(STR_EVENT_STORAGECHANGED), this ) ); + SfxGetpApp()->NotifyEvent( SfxEventHint( SFX_EVENT_STORAGECHANGED, GlobalEventConfig::GetEventName(GlobalEventId::STORAGECHANGED), this ) ); } return bResult; diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx index 4e562e54f56d..bfbe5d3e9e95 100644 --- a/sfx2/source/doc/objxtor.cxx +++ b/sfx2/source/doc/objxtor.cxx @@ -607,7 +607,7 @@ bool SfxObjectShell::PrepareClose } SfxApplication *pSfxApp = SfxGetpApp(); - pSfxApp->NotifyEvent( SfxEventHint(SFX_EVENT_PREPARECLOSEDOC, GlobalEventConfig::GetEventName(STR_EVENT_PREPARECLOSEDOC), this) ); + pSfxApp->NotifyEvent( SfxEventHint(SFX_EVENT_PREPARECLOSEDOC, GlobalEventConfig::GetEventName(GlobalEventId::PREPARECLOSEDOC), this) ); if( GetCreateMode() == SfxObjectCreateMode::EMBEDDED ) { @@ -1155,11 +1155,11 @@ void SfxObjectShell::SetInitialized_Impl( const bool i_fromInitNew ) if ( i_fromInitNew ) { SetActivateEvent_Impl( SFX_EVENT_CREATEDOC ); - SfxGetpApp()->NotifyEvent( SfxEventHint( SFX_EVENT_DOCCREATED, GlobalEventConfig::GetEventName(STR_EVENT_DOCCREATED), this ) ); + SfxGetpApp()->NotifyEvent( SfxEventHint( SFX_EVENT_DOCCREATED, GlobalEventConfig::GetEventName(GlobalEventId::DOCCREATED), this ) ); } else { - SfxGetpApp()->NotifyEvent( SfxEventHint( SFX_EVENT_LOADFINISHED, GlobalEventConfig::GetEventName(STR_EVENT_LOADFINISHED), this ) ); + SfxGetpApp()->NotifyEvent( SfxEventHint( SFX_EVENT_LOADFINISHED, GlobalEventConfig::GetEventName(GlobalEventId::LOADFINISHED), this ) ); } } diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index bc1f5e43f585..20f15ee6aec2 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -1576,7 +1576,7 @@ void SAL_CALL SfxBaseModel::storeSelf( const Sequence< beans::PropertyValue > SfxAllItemSet *pParams = new SfxAllItemSet( SfxGetpApp()->GetPool() ); TransformParameters( nSlotId, aArgs, *pParams ); - SfxGetpApp()->NotifyEvent( SfxEventHint( SFX_EVENT_SAVEDOC, GlobalEventConfig::GetEventName(STR_EVENT_SAVEDOC), m_pData->m_pObjectShell ) ); + SfxGetpApp()->NotifyEvent( SfxEventHint( SFX_EVENT_SAVEDOC, GlobalEventConfig::GetEventName(GlobalEventId::SAVEDOC), m_pData->m_pObjectShell ) ); bool bRet = false; @@ -1617,7 +1617,7 @@ void SAL_CALL SfxBaseModel::storeSelf( const Sequence< beans::PropertyValue > m_pData->m_pObjectShell->AddLog( OUString( OSL_LOG_PREFIX "successful saving." ) ); m_pData->m_aPreusedFilterName = GetMediumFilterName_Impl(); - SfxGetpApp()->NotifyEvent( SfxEventHint( SFX_EVENT_SAVEDOCDONE, GlobalEventConfig::GetEventName(STR_EVENT_SAVEDOCDONE), m_pData->m_pObjectShell ) ); + SfxGetpApp()->NotifyEvent( SfxEventHint( SFX_EVENT_SAVEDOCDONE, GlobalEventConfig::GetEventName(GlobalEventId::SAVEDOCDONE), m_pData->m_pObjectShell ) ); } else { @@ -1625,7 +1625,7 @@ void SAL_CALL SfxBaseModel::storeSelf( const Sequence< beans::PropertyValue > m_pData->m_pObjectShell->StoreLog(); // write the contents of the logger to the file - SfxGetpApp()->NotifyEvent( SfxEventHint( SFX_EVENT_SAVEDOCFAILED, GlobalEventConfig::GetEventName(STR_EVENT_SAVEDOCFAILED), m_pData->m_pObjectShell ) ); + SfxGetpApp()->NotifyEvent( SfxEventHint( SFX_EVENT_SAVEDOCFAILED, GlobalEventConfig::GetEventName(GlobalEventId::SAVEDOCFAILED), m_pData->m_pObjectShell ) ); throw task::ErrorCodeIOException( "SfxBaseModel::storeSelf: 0x" + OUString::number(nErrCode, 16), @@ -2831,11 +2831,11 @@ void SfxBaseModel::Notify( SfxBroadcaster& rBC , { OUString aTitle = m_pData->m_pObjectShell->GetTitle(); addTitle_Impl( m_pData->m_seqArguments, aTitle ); - postEvent_Impl( GlobalEventConfig::GetEventName( STR_EVENT_TITLECHANGED ) ); + postEvent_Impl( GlobalEventConfig::GetEventName( GlobalEventId::TITLECHANGED ) ); } if ( pSimpleHint->GetId() == SFX_HINT_MODECHANGED ) { - postEvent_Impl( GlobalEventConfig::GetEventName( STR_EVENT_MODECHANGED ) ); + postEvent_Impl( GlobalEventConfig::GetEventName( GlobalEventId::MODECHANGED ) ); } } } @@ -3008,7 +3008,7 @@ void SfxBaseModel::impl_store( const OUString& sURL if ( !bSaved && m_pData->m_pObjectShell ) { - SfxGetpApp()->NotifyEvent( SfxEventHint( bSaveTo ? SFX_EVENT_SAVETODOC : SFX_EVENT_SAVEASDOC, GlobalEventConfig::GetEventName( bSaveTo ? STR_EVENT_SAVETODOC : STR_EVENT_SAVEASDOC ), + SfxGetpApp()->NotifyEvent( SfxEventHint( bSaveTo ? SFX_EVENT_SAVETODOC : SFX_EVENT_SAVEASDOC, GlobalEventConfig::GetEventName( bSaveTo ? GlobalEventId::SAVETODOC : GlobalEventId::SAVEASDOC ), m_pData->m_pObjectShell ) ); SfxAllItemSet *aParams = new SfxAllItemSet( SfxGetpApp()->GetPool() ); @@ -3108,14 +3108,14 @@ void SfxBaseModel::impl_store( const OUString& sURL m_pData->m_aPreusedFilterName = GetMediumFilterName_Impl(); m_pData->m_pObjectShell->SetModifyPasswordEntered(); - SfxGetpApp()->NotifyEvent( SfxEventHint( SFX_EVENT_SAVEASDOCDONE, GlobalEventConfig::GetEventName(STR_EVENT_SAVEASDOCDONE), m_pData->m_pObjectShell ) ); + SfxGetpApp()->NotifyEvent( SfxEventHint( SFX_EVENT_SAVEASDOCDONE, GlobalEventConfig::GetEventName(GlobalEventId::SAVEASDOCDONE), m_pData->m_pObjectShell ) ); } else { m_pData->m_pObjectShell->SetModifyPasswordHash( nOldModifyPasswordHash ); m_pData->m_pObjectShell->SetModifyPasswordInfo( aOldModifyPasswordInfo ); - SfxGetpApp()->NotifyEvent( SfxEventHint( SFX_EVENT_SAVETODOCDONE, GlobalEventConfig::GetEventName(STR_EVENT_SAVETODOCDONE), m_pData->m_pObjectShell ) ); + SfxGetpApp()->NotifyEvent( SfxEventHint( SFX_EVENT_SAVETODOCDONE, GlobalEventConfig::GetEventName(GlobalEventId::SAVETODOCDONE), m_pData->m_pObjectShell ) ); } } else @@ -3128,7 +3128,7 @@ void SfxBaseModel::impl_store( const OUString& sURL m_pData->m_pObjectShell->SetModifyPasswordInfo( aOldModifyPasswordInfo ); - SfxGetpApp()->NotifyEvent( SfxEventHint( bSaveTo ? SFX_EVENT_SAVETODOCFAILED : SFX_EVENT_SAVEASDOCFAILED, GlobalEventConfig::GetEventName( bSaveTo ? STR_EVENT_SAVETODOCFAILED : STR_EVENT_SAVEASDOCFAILED), + SfxGetpApp()->NotifyEvent( SfxEventHint( bSaveTo ? SFX_EVENT_SAVETODOCFAILED : SFX_EVENT_SAVEASDOCFAILED, GlobalEventConfig::GetEventName( bSaveTo ? GlobalEventId::SAVETODOCFAILED : GlobalEventId::SAVEASDOCFAILED), m_pData->m_pObjectShell ) ); throw task::ErrorCodeIOException( diff --git a/sfx2/source/view/frame.cxx b/sfx2/source/view/frame.cxx index c830ff577a17..29fbf423c6f6 100644 --- a/sfx2/source/view/frame.cxx +++ b/sfx2/source/view/frame.cxx @@ -207,7 +207,7 @@ bool SfxFrame::PrepareClose_Impl( bool bUI ) bOther = ( &pFrame->GetFrame() != this ); } - SfxGetpApp()->NotifyEvent( SfxViewEventHint(SFX_EVENT_PREPARECLOSEVIEW, GlobalEventConfig::GetEventName( STR_EVENT_PREPARECLOSEVIEW ), pCur, GetController() ) ); + SfxGetpApp()->NotifyEvent( SfxViewEventHint(SFX_EVENT_PREPARECLOSEVIEW, GlobalEventConfig::GetEventName( GlobalEventId::PREPARECLOSEVIEW ), pCur, GetController() ) ); if ( bOther ) // if there are other views only the current view of this frame must be asked diff --git a/sfx2/source/view/sfxbasecontroller.cxx b/sfx2/source/view/sfxbasecontroller.cxx index 22d283b9553c..2bcac22259bb 100644 --- a/sfx2/source/view/sfxbasecontroller.cxx +++ b/sfx2/source/view/sfxbasecontroller.cxx @@ -571,7 +571,7 @@ void SAL_CALL SfxBaseController::attachFrame( const Reference< frame::XFrame >& ShowInfoBars( ); // attaching the frame to the controller is the last step in the creation of a new view, so notify this - SfxViewEventHint aHint( SFX_EVENT_VIEWCREATED, GlobalEventConfig::GetEventName( STR_EVENT_VIEWCREATED ), m_pData->m_pViewShell->GetObjectShell(), Reference< frame::XController2 >( this ) ); + SfxViewEventHint aHint( SFX_EVENT_VIEWCREATED, GlobalEventConfig::GetEventName( GlobalEventId::VIEWCREATED ), m_pData->m_pViewShell->GetObjectShell(), Reference< frame::XController2 >( this ) ); SfxGetpApp()->NotifyEvent( aHint ); } } @@ -1000,9 +1000,9 @@ void SAL_CALL SfxBaseController::dispose() throw( RuntimeException, std::excepti pView = SfxViewFrame::GetNext( *pView, pDoc ); } - SfxGetpApp()->NotifyEvent( SfxViewEventHint(SFX_EVENT_CLOSEVIEW, GlobalEventConfig::GetEventName( STR_EVENT_CLOSEVIEW ), pDoc, Reference< frame::XController2 >( this ) ) ); + SfxGetpApp()->NotifyEvent( SfxViewEventHint(SFX_EVENT_CLOSEVIEW, GlobalEventConfig::GetEventName( GlobalEventId::CLOSEVIEW ), pDoc, Reference< frame::XController2 >( this ) ) ); if ( !pView ) - SfxGetpApp()->NotifyEvent( SfxEventHint(SFX_EVENT_CLOSEDOC, GlobalEventConfig::GetEventName( STR_EVENT_CLOSEDOC ), pDoc) ); + SfxGetpApp()->NotifyEvent( SfxEventHint(SFX_EVENT_CLOSEDOC, GlobalEventConfig::GetEventName( GlobalEventId::CLOSEDOC ), pDoc) ); Reference< frame::XModel > xModel = pDoc->GetModel(); Reference < util::XCloseable > xCloseable( xModel, uno::UNO_QUERY ); diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index cfae5c1232e2..124a1f676897 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -822,7 +822,7 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) } // Propagate document closure. - SfxGetpApp()->NotifyEvent( SfxEventHint( SFX_EVENT_CLOSEDOC, GlobalEventConfig::GetEventName( STR_EVENT_CLOSEDOC ), xOldObj ) ); + SfxGetpApp()->NotifyEvent( SfxEventHint( SFX_EVENT_CLOSEDOC, GlobalEventConfig::GetEventName( GlobalEventId::CLOSEDOC ), xOldObj ) ); } // Record as done diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx index d478a4a847d2..1ffc411ffd89 100644 --- a/sfx2/source/view/viewprn.cxx +++ b/sfx2/source/view/viewprn.cxx @@ -316,7 +316,7 @@ void SfxPrinterController::jobStarted() xDocProps->setPrintDate( now.GetUNODateTime() ); - SfxGetpApp()->NotifyEvent( SfxEventHint(SFX_EVENT_PRINTDOC, GlobalEventConfig::GetEventName( STR_EVENT_PRINTDOC ), mpObjectShell ) ); + SfxGetpApp()->NotifyEvent( SfxEventHint(SFX_EVENT_PRINTDOC, GlobalEventConfig::GetEventName( GlobalEventId::PRINTDOC ), mpObjectShell ) ); uno::Sequence < beans::PropertyValue > aOpts; aOpts = getJobProperties( aOpts ); |