summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2016-12-19 11:01:37 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2016-12-20 06:08:30 +0000
commited2b8ca92ae00ab96b0ea2b1c3fc9be4622b61ff (patch)
tree5fe7754d4aa1e93c6aa186ff74e6f96aaecdcd74 /sfx2
parent9eb4b14ffa57cd7bbdf0fc43096f5f1e65c8e388 (diff)
convert SFX_EVENT constants to scoped enum
SFX_EVENT_CLOSEAPP and SFX_EVENT_TOGGLEFULLSCREENMODE are never generated, so remove them and delete the code that receives them Change-Id: I2d003ba73fff0b02120ba29ff58e1d2399dedf00 Reviewed-on: https://gerrit.libreoffice.org/32168 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/appl/app.cxx4
-rw-r--r--sfx2/source/appl/sfxpicklist.cxx15
-rw-r--r--sfx2/source/doc/objembed.cxx2
-rw-r--r--sfx2/source/doc/objmisc.cxx14
-rw-r--r--sfx2/source/doc/objstor.cxx8
-rw-r--r--sfx2/source/doc/objxtor.cxx10
-rw-r--r--sfx2/source/doc/sfxbasemodel.cxx28
-rw-r--r--sfx2/source/inc/objshimp.hxx2
-rw-r--r--sfx2/source/view/frame.cxx2
-rw-r--r--sfx2/source/view/sfxbasecontroller.cxx6
-rw-r--r--sfx2/source/view/viewfrm.cxx16
-rw-r--r--sfx2/source/view/viewprn.cxx2
-rw-r--r--sfx2/source/view/viewsh.cxx33
13 files changed, 64 insertions, 78 deletions
diff --git a/sfx2/source/appl/app.cxx b/sfx2/source/appl/app.cxx
index 5675d3667486..a573fcc084a6 100644
--- a/sfx2/source/appl/app.cxx
+++ b/sfx2/source/appl/app.cxx
@@ -320,7 +320,7 @@ void SfxApplication::SetViewFrame_Impl( SfxViewFrame *pFrame )
if ( pOldFrame )
{
if ( bTaskActivate )
- NotifyEvent( SfxViewEventHint( SFX_EVENT_DEACTIVATEDOC, GlobalEventConfig::GetEventName(GlobalEventId::DEACTIVATEDOC), pOldFrame->GetObjectShell(), pOldFrame->GetFrame().GetController() ) );
+ NotifyEvent( SfxViewEventHint( SfxEventHintId::DeactivateDoc, GlobalEventConfig::GetEventName(GlobalEventId::DEACTIVATEDOC), pOldFrame->GetObjectShell(), pOldFrame->GetFrame().GetController() ) );
pOldFrame->DoDeactivate( bTaskActivate, pFrame );
if( pOldFrame->GetProgress() )
@@ -335,7 +335,7 @@ void SfxApplication::SetViewFrame_Impl( SfxViewFrame *pFrame )
if ( bTaskActivate && pFrame->GetObjectShell() )
{
pFrame->GetObjectShell()->PostActivateEvent_Impl( pFrame );
- NotifyEvent(SfxViewEventHint(SFX_EVENT_ACTIVATEDOC, GlobalEventConfig::GetEventName(GlobalEventId::ACTIVATEDOC), pFrame->GetObjectShell(), pFrame->GetFrame().GetController() ) );
+ NotifyEvent(SfxViewEventHint(SfxEventHintId::ActivateDoc, GlobalEventConfig::GetEventName(GlobalEventId::ACTIVATEDOC), pFrame->GetObjectShell(), pFrame->GetFrame().GetController() ) );
}
SfxProgress *pProgress = pFrame->GetProgress();
diff --git a/sfx2/source/appl/sfxpicklist.cxx b/sfx2/source/appl/sfxpicklist.cxx
index 771205a5354c..38754445e180 100644
--- a/sfx2/source/appl/sfxpicklist.cxx
+++ b/sfx2/source/appl/sfxpicklist.cxx
@@ -203,7 +203,7 @@ void SfxPickList::Notify( SfxBroadcaster&, const SfxHint& rHint )
switch ( pEventHint->GetEventId() )
{
- case SFX_EVENT_CREATEDOC:
+ case SfxEventHintId::CreateDoc:
{
bool bAllowModif = pDocSh->IsEnableSetModified();
if ( bAllowModif )
@@ -223,17 +223,17 @@ void SfxPickList::Notify( SfxBroadcaster&, const SfxHint& rHint )
}
break;
- case SFX_EVENT_OPENDOC:
- case SFX_EVENT_SAVEDOCDONE:
- case SFX_EVENT_SAVEASDOCDONE:
- case SFX_EVENT_SAVETODOCDONE:
- case SFX_EVENT_CLOSEDOC:
+ case SfxEventHintId::OpenDoc:
+ case SfxEventHintId::SaveDocDone:
+ case SfxEventHintId::SaveAsDocDone:
+ case SfxEventHintId::SaveToDocDone:
+ case SfxEventHintId::CloseDoc:
{
AddDocumentToPickList(pDocSh);
}
break;
- case SFX_EVENT_SAVEASDOC:
+ case SfxEventHintId::SaveAsDoc:
{
SfxMedium *pMedium = pDocSh->GetMedium();
if (!pMedium)
@@ -250,6 +250,7 @@ void SfxPickList::Notify( SfxBroadcaster&, const SfxHint& rHint )
}
}
break;
+ default: break;
}
}
}
diff --git a/sfx2/source/doc/objembed.cxx b/sfx2/source/doc/objembed.cxx
index e190f3a05760..ab90ef7fc015 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();
- SfxGetpApp()->NotifyEvent(SfxEventHint( SFX_EVENT_VISAREACHANGED, GlobalEventConfig::GetEventName(GlobalEventId::VISAREACHANGED), this));
+ SfxGetpApp()->NotifyEvent(SfxEventHint( SfxEventHintId::VisAreaChanged, GlobalEventConfig::GetEventName(GlobalEventId::VISAREACHANGED), this));
}
}
}
diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index d546333bcf35..4cc03cc6d228 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -336,7 +336,7 @@ void SfxObjectShell::ModifyChanged()
Invalidate( SID_MACRO_SIGNATURE );
Broadcast( SfxHint( SfxHintId::TitleChanged ) ); // xmlsec05, signed state might change in title...
- SfxGetpApp()->NotifyEvent( SfxEventHint( SFX_EVENT_MODIFYCHANGED, GlobalEventConfig::GetEventName(GlobalEventId::MODIFYCHANGED), this ) );
+ SfxGetpApp()->NotifyEvent( SfxEventHint( SfxEventHintId::ModifyChanged, GlobalEventConfig::GetEventName(GlobalEventId::MODIFYCHANGED), this ) );
}
@@ -955,18 +955,18 @@ void SfxObjectShell::PostActivateEvent_Impl( SfxViewFrame* pFrame )
const SfxBoolItem* pHiddenItem = SfxItemSet::GetItem<SfxBoolItem>(pMedium->GetItemSet(), SID_HIDDEN, false);
if ( !pHiddenItem || !pHiddenItem->GetValue() )
{
- sal_uInt16 nId = pImpl->nEventId;
- pImpl->nEventId = 0;
- if ( nId == SFX_EVENT_OPENDOC )
+ SfxEventHintId nId = pImpl->nEventId;
+ pImpl->nEventId = SfxEventHintId::NONE;
+ if ( nId == SfxEventHintId::OpenDoc )
pSfxApp->NotifyEvent(SfxViewEventHint( nId, GlobalEventConfig::GetEventName(GlobalEventId::OPENDOC), this, pFrame->GetFrame().GetController() ), false);
- else if (nId == SFX_EVENT_CREATEDOC )
+ else if (nId == SfxEventHintId::CreateDoc )
pSfxApp->NotifyEvent(SfxViewEventHint( nId, GlobalEventConfig::GetEventName(GlobalEventId::CREATEDOC), this, pFrame->GetFrame().GetController() ), false);
}
}
}
-void SfxObjectShell::SetActivateEvent_Impl(sal_uInt16 nId )
+void SfxObjectShell::SetActivateEvent_Impl(SfxEventHintId nId )
{
if ( GetFactory().GetFlags() & SfxObjectShellFlags::HASOPENDOC )
pImpl->nEventId = nId;
@@ -1206,7 +1206,7 @@ void SfxObjectShell::FinishedLoading( SfxLoadedFlags nFlags )
// Title is not available until loading has finished
Broadcast( SfxHint( SfxHintId::TitleChanged ) );
- if ( pImpl->nEventId )
+ if ( pImpl->nEventId != SfxEventHintId::NONE )
PostActivateEvent_Impl(SfxViewFrame::GetFirst(this));
}
}
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index 490d85d04b50..6208765c6c4f 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -630,12 +630,12 @@ bool SfxObjectShell::DoLoad( SfxMedium *pMed )
bool bOk = false;
std::shared_ptr<const SfxFilter> pFilter = pMed->GetFilter();
SfxItemSet* pSet = pMedium->GetItemSet();
- if( !pImpl->nEventId )
+ if( pImpl->nEventId == SfxEventHintId::NONE )
{
const SfxBoolItem* pTemplateItem = SfxItemSet::GetItem<SfxBoolItem>(pSet, SID_TEMPLATE, false);
SetActivateEvent_Impl(
( pTemplateItem && pTemplateItem->GetValue() )
- ? SFX_EVENT_CREATEDOC : SFX_EVENT_OPENDOC );
+ ? SfxEventHintId::CreateDoc : SfxEventHintId::OpenDoc );
}
const SfxStringItem* pBaseItem = SfxItemSet::GetItem<SfxStringItem>(pSet, SID_BASEURL, false);
@@ -3065,7 +3065,7 @@ uno::Reference< embed::XStorage > SfxObjectShell::GetStorage()
SetupStorage( pImpl->m_xDocStorage, SOFFICE_FILEFORMAT_CURRENT, false );
pImpl->m_bCreateTempStor = false;
if (!utl::ConfigManager::IsAvoidConfig())
- SfxGetpApp()->NotifyEvent( SfxEventHint( SFX_EVENT_STORAGECHANGED, GlobalEventConfig::GetEventName(GlobalEventId::STORAGECHANGED), this ) );
+ SfxGetpApp()->NotifyEvent( SfxEventHint( SfxEventHintId::StorageChanged, GlobalEventConfig::GetEventName(GlobalEventId::STORAGECHANGED), this ) );
}
catch( uno::Exception& )
{
@@ -3214,7 +3214,7 @@ bool SfxObjectShell::SaveCompleted( const uno::Reference< embed::XStorage >& xSt
if ( bSendNotification )
{
- SfxGetpApp()->NotifyEvent( SfxEventHint( SFX_EVENT_STORAGECHANGED, GlobalEventConfig::GetEventName(GlobalEventId::STORAGECHANGED), this ) );
+ SfxGetpApp()->NotifyEvent( SfxEventHint( SfxEventHintId::StorageChanged, GlobalEventConfig::GetEventName(GlobalEventId::STORAGECHANGED), this ) );
}
return bResult;
diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx
index c5bafe78702c..61db73a28999 100644
--- a/sfx2/source/doc/objxtor.cxx
+++ b/sfx2/source/doc/objxtor.cxx
@@ -241,7 +241,7 @@ SfxObjectShell_Impl::SfxObjectShell_Impl( SfxObjectShell& _rDocShell )
,m_bAllowShareControlFileClean( true )
,m_bConfigOptionsChecked( false )
,lErr(ERRCODE_NONE)
- ,nEventId ( 0)
+ ,nEventId ( SfxEventHintId::NONE )
,pReloadTimer ( nullptr)
,nLoadedFlags ( SfxLoadedFlags::ALL )
,nFlagsInProgress( SfxLoadedFlags::NONE )
@@ -567,7 +567,7 @@ bool SfxObjectShell::PrepareClose
}
SfxApplication *pSfxApp = SfxGetpApp();
- pSfxApp->NotifyEvent( SfxEventHint(SFX_EVENT_PREPARECLOSEDOC, GlobalEventConfig::GetEventName(GlobalEventId::PREPARECLOSEDOC), this) );
+ pSfxApp->NotifyEvent( SfxEventHint(SfxEventHintId::PrepareCloseDoc, GlobalEventConfig::GetEventName(GlobalEventId::PREPARECLOSEDOC), this) );
if( GetCreateMode() == SfxObjectCreateMode::EMBEDDED )
{
@@ -1106,12 +1106,12 @@ void SfxObjectShell::SetInitialized_Impl( const bool i_fromInitNew )
return;
if ( i_fromInitNew )
{
- SetActivateEvent_Impl( SFX_EVENT_CREATEDOC );
- SfxGetpApp()->NotifyEvent( SfxEventHint( SFX_EVENT_DOCCREATED, GlobalEventConfig::GetEventName(GlobalEventId::DOCCREATED), this ) );
+ SetActivateEvent_Impl( SfxEventHintId::CreateDoc );
+ SfxGetpApp()->NotifyEvent( SfxEventHint( SfxEventHintId::DocCreated, GlobalEventConfig::GetEventName(GlobalEventId::DOCCREATED), this ) );
}
else
{
- SfxGetpApp()->NotifyEvent( SfxEventHint( SFX_EVENT_LOADFINISHED, GlobalEventConfig::GetEventName(GlobalEventId::LOADFINISHED), this ) );
+ SfxGetpApp()->NotifyEvent( SfxEventHint( SfxEventHintId::LoadFinished, GlobalEventConfig::GetEventName(GlobalEventId::LOADFINISHED), this ) );
}
}
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index 2570e16fb763..fc19db8f9098 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -1539,7 +1539,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(GlobalEventId::SAVEDOC), m_pData->m_pObjectShell.get() ) );
+ SfxGetpApp()->NotifyEvent( SfxEventHint( SfxEventHintId::SaveDoc, GlobalEventConfig::GetEventName(GlobalEventId::SAVEDOC), m_pData->m_pObjectShell.get() ) );
bool bRet = false;
@@ -1580,7 +1580,7 @@ void SAL_CALL SfxBaseModel::storeSelf( const Sequence< beans::PropertyValue >
m_pData->m_pObjectShell->AddLog( OSL_LOG_PREFIX "successful saving." );
m_pData->m_aPreusedFilterName = GetMediumFilterName_Impl();
- SfxGetpApp()->NotifyEvent( SfxEventHint( SFX_EVENT_SAVEDOCDONE, GlobalEventConfig::GetEventName(GlobalEventId::SAVEDOCDONE), m_pData->m_pObjectShell.get() ) );
+ SfxGetpApp()->NotifyEvent( SfxEventHint( SfxEventHintId::SaveDocDone, GlobalEventConfig::GetEventName(GlobalEventId::SAVEDOCDONE), m_pData->m_pObjectShell.get() ) );
}
else
{
@@ -1588,7 +1588,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(GlobalEventId::SAVEDOCFAILED), m_pData->m_pObjectShell.get() ) );
+ SfxGetpApp()->NotifyEvent( SfxEventHint( SfxEventHintId::SaveDocFailed, GlobalEventConfig::GetEventName(GlobalEventId::SAVEDOCFAILED), m_pData->m_pObjectShell.get() ) );
throw task::ErrorCodeIOException(
"SfxBaseModel::storeSelf: 0x" + OUString::number(nErrCode, 16),
@@ -2725,7 +2725,7 @@ void SfxBaseModel::Notify( SfxBroadcaster& rBC ,
switch ( pNamedHint->GetEventId() )
{
- case SFX_EVENT_STORAGECHANGED:
+ case SfxEventHintId::StorageChanged:
{
if ( m_pData->m_xUIConfigurationManager.is()
&& m_pData->m_pObjectShell->GetCreateMode() != SfxObjectCreateMode::EMBEDDED )
@@ -2752,7 +2752,7 @@ void SfxBaseModel::Notify( SfxBroadcaster& rBC ,
}
break;
- case SFX_EVENT_LOADFINISHED:
+ case SfxEventHintId::LoadFinished:
{
impl_getPrintHelper();
ListenForStorage_Impl( m_pData->m_pObjectShell->GetStorage() );
@@ -2760,7 +2760,7 @@ void SfxBaseModel::Notify( SfxBroadcaster& rBC ,
}
break;
- case SFX_EVENT_SAVEASDOCDONE:
+ case SfxEventHintId::SaveAsDocDone:
{
m_pData->m_sURL = m_pData->m_pObjectShell->GetMedium()->GetName();
@@ -2773,21 +2773,21 @@ void SfxBaseModel::Notify( SfxBroadcaster& rBC ,
}
break;
- case SFX_EVENT_DOCCREATED:
+ case SfxEventHintId::DocCreated:
{
impl_getPrintHelper();
m_pData->m_bModifiedSinceLastSave = false;
}
break;
- case SFX_EVENT_MODIFYCHANGED:
+ case SfxEventHintId::ModifyChanged:
{
m_pData->m_bModifiedSinceLastSave = isModified();
}
break;
+ default: break;
}
-
const SfxViewEventHint* pViewHint = dynamic_cast<const SfxViewEventHint*>(&rHint);
postEvent_Impl( pNamedHint->GetEventName(), pViewHint ? pViewHint->GetController() : Reference< frame::XController2 >() );
}
@@ -2972,7 +2972,7 @@ void SfxBaseModel::impl_store( const OUString& sURL
if ( !bSaved && m_pData->m_pObjectShell.Is() )
{
- SfxGetpApp()->NotifyEvent( SfxEventHint( bSaveTo ? SFX_EVENT_SAVETODOC : SFX_EVENT_SAVEASDOC, GlobalEventConfig::GetEventName( bSaveTo ? GlobalEventId::SAVETODOC : GlobalEventId::SAVEASDOC ),
+ SfxGetpApp()->NotifyEvent( SfxEventHint( bSaveTo ? SfxEventHintId::SaveToDoc : SfxEventHintId::SaveAsDoc, GlobalEventConfig::GetEventName( bSaveTo ? GlobalEventId::SAVETODOC : GlobalEventId::SAVEASDOC ),
m_pData->m_pObjectShell.get() ) );
std::unique_ptr<SfxAllItemSet> pItemSet(new SfxAllItemSet(SfxGetpApp()->GetPool()));
@@ -3072,14 +3072,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(GlobalEventId::SAVEASDOCDONE), m_pData->m_pObjectShell.get() ) );
+ SfxGetpApp()->NotifyEvent( SfxEventHint( SfxEventHintId::SaveAsDocDone, GlobalEventConfig::GetEventName(GlobalEventId::SAVEASDOCDONE), m_pData->m_pObjectShell.get() ) );
}
else
{
m_pData->m_pObjectShell->SetModifyPasswordHash( nOldModifyPasswordHash );
m_pData->m_pObjectShell->SetModifyPasswordInfo( aOldModifyPasswordInfo );
- SfxGetpApp()->NotifyEvent( SfxEventHint( SFX_EVENT_SAVETODOCDONE, GlobalEventConfig::GetEventName(GlobalEventId::SAVETODOCDONE), m_pData->m_pObjectShell.get() ) );
+ SfxGetpApp()->NotifyEvent( SfxEventHint( SfxEventHintId::SaveToDocDone, GlobalEventConfig::GetEventName(GlobalEventId::SAVETODOCDONE), m_pData->m_pObjectShell.get() ) );
}
}
else
@@ -3092,7 +3092,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 ? GlobalEventId::SAVETODOCFAILED : GlobalEventId::SAVEASDOCFAILED),
+ SfxGetpApp()->NotifyEvent( SfxEventHint( bSaveTo ? SfxEventHintId::SaveToDocFailed : SfxEventHintId::SaveAsDocFailed, GlobalEventConfig::GetEventName( bSaveTo ? GlobalEventId::SAVETODOCFAILED : GlobalEventId::SAVEASDOCFAILED),
m_pData->m_pObjectShell.get() ) );
throw task::ErrorCodeIOException(
@@ -3696,7 +3696,7 @@ void SAL_CALL SfxBaseModel::loadFromStorage( const Reference< embed::XStorage >&
const SfxBoolItem* pTemplateItem = aSet.GetItem<SfxBoolItem>(SID_TEMPLATE, false);
bool bTemplate = pTemplateItem && pTemplateItem->GetValue();
- m_pData->m_pObjectShell->SetActivateEvent_Impl( bTemplate ? SFX_EVENT_CREATEDOC : SFX_EVENT_OPENDOC );
+ m_pData->m_pObjectShell->SetActivateEvent_Impl( bTemplate ? SfxEventHintId::CreateDoc : SfxEventHintId::OpenDoc );
m_pData->m_pObjectShell->Get_Impl()->bOwnsStorage = false;
// load document
diff --git a/sfx2/source/inc/objshimp.hxx b/sfx2/source/inc/objshimp.hxx
index bbcf19f572b5..9a3b5c167681 100644
--- a/sfx2/source/inc/objshimp.hxx
+++ b/sfx2/source/inc/objshimp.hxx
@@ -100,7 +100,7 @@ struct SfxObjectShell_Impl : public ::sfx2::IMacroDocumentAccess
IndexBitSet aBitSet;
sal_uInt32 lErr;
- sal_uInt16 nEventId; // If Open/Create as to be sent
+ SfxEventHintId nEventId; // If Open/Create as to be sent
// before Activate
AutoReloadTimer_Impl *pReloadTimer;
SfxLoadedFlags nLoadedFlags;
diff --git a/sfx2/source/view/frame.cxx b/sfx2/source/view/frame.cxx
index 75d4a4348915..117cc7ac6dcd 100644
--- a/sfx2/source/view/frame.cxx
+++ b/sfx2/source/view/frame.cxx
@@ -200,7 +200,7 @@ bool SfxFrame::PrepareClose_Impl( bool bUI )
bOther = ( &pFrame->GetFrame() != this );
}
- SfxGetpApp()->NotifyEvent( SfxViewEventHint(SFX_EVENT_PREPARECLOSEVIEW, GlobalEventConfig::GetEventName( GlobalEventId::PREPARECLOSEVIEW ), pCur, GetController() ) );
+ SfxGetpApp()->NotifyEvent( SfxViewEventHint(SfxEventHintId::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 fc67319dca73..e732d27eccf4 100644
--- a/sfx2/source/view/sfxbasecontroller.cxx
+++ b/sfx2/source/view/sfxbasecontroller.cxx
@@ -572,7 +572,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( GlobalEventId::VIEWCREATED ), m_pData->m_pViewShell->GetObjectShell(), Reference< frame::XController2 >( this ) );
+ SfxViewEventHint aHint( SfxEventHintId::ViewCreated, GlobalEventConfig::GetEventName( GlobalEventId::VIEWCREATED ), m_pData->m_pViewShell->GetObjectShell(), Reference< frame::XController2 >( this ) );
SfxGetpApp()->NotifyEvent( aHint );
}
}
@@ -1001,9 +1001,9 @@ void SAL_CALL SfxBaseController::dispose() throw( RuntimeException, std::excepti
pView = SfxViewFrame::GetNext( *pView, pDoc );
}
- SfxGetpApp()->NotifyEvent( SfxViewEventHint(SFX_EVENT_CLOSEVIEW, GlobalEventConfig::GetEventName( GlobalEventId::CLOSEVIEW ), pDoc, Reference< frame::XController2 >( this ) ) );
+ SfxGetpApp()->NotifyEvent( SfxViewEventHint(SfxEventHintId::CloseView, GlobalEventConfig::GetEventName( GlobalEventId::CLOSEVIEW ), pDoc, Reference< frame::XController2 >( this ) ) );
if ( !pView )
- SfxGetpApp()->NotifyEvent( SfxEventHint(SFX_EVENT_CLOSEDOC, GlobalEventConfig::GetEventName( GlobalEventId::CLOSEDOC ), pDoc) );
+ SfxGetpApp()->NotifyEvent( SfxEventHint(SfxEventHintId::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 6e11dfdf55fc..c0e4c13f94bb 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -786,7 +786,7 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq )
}
// Propagate document closure.
- SfxGetpApp()->NotifyEvent( SfxEventHint( SFX_EVENT_CLOSEDOC, GlobalEventConfig::GetEventName( GlobalEventId::CLOSEDOC ), xOldObj ) );
+ SfxGetpApp()->NotifyEvent( SfxEventHint( SfxEventHintId::CloseDoc, GlobalEventConfig::GetEventName( GlobalEventId::CLOSEDOC ), xOldObj ) );
}
// Record as done
@@ -1160,7 +1160,7 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
// is not read only, and the loading is finished.
switch ( pEventHint->GetEventId() )
{
- case SFX_EVENT_MODIFYCHANGED:
+ case SfxEventHintId::ModifyChanged:
{
SfxBindings& rBind = GetBindings();
rBind.Invalidate( SID_DOC_MODIFIED );
@@ -1169,8 +1169,8 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
break;
}
- case SFX_EVENT_OPENDOC:
- case SFX_EVENT_CREATEDOC:
+ case SfxEventHintId::OpenDoc:
+ case SfxEventHintId::CreateDoc:
{
if ( !m_xObjSh.Is() )
break;
@@ -1232,13 +1232,7 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
break;
}
-
- case SFX_EVENT_TOGGLEFULLSCREENMODE:
- {
- if ( GetFrame().OwnsBindings_Impl() )
- GetBindings().GetDispatcher_Impl()->Update_Impl( true );
- break;
- }
+ default: break;
}
}
else
diff --git a/sfx2/source/view/viewprn.cxx b/sfx2/source/view/viewprn.cxx
index e62577b81975..f9d6c9a99044 100644
--- a/sfx2/source/view/viewprn.cxx
+++ b/sfx2/source/view/viewprn.cxx
@@ -308,7 +308,7 @@ void SfxPrinterController::jobStarted()
xDocProps->setPrintDate( now.GetUNODateTime() );
- SfxGetpApp()->NotifyEvent( SfxEventHint(SFX_EVENT_PRINTDOC, GlobalEventConfig::GetEventName( GlobalEventId::PRINTDOC ), mpObjectShell ) );
+ SfxGetpApp()->NotifyEvent( SfxEventHint(SfxEventHintId::PrintDoc, GlobalEventConfig::GetEventName( GlobalEventId::PRINTDOC ), mpObjectShell ) );
uno::Sequence < beans::PropertyValue > aOpts;
aOpts = getJobProperties( aOpts );
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index 766e67f81207..91e1c284f3b7 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -1405,34 +1405,25 @@ void SfxViewShell::Notify( SfxBroadcaster& rBC,
const SfxHint& rHint )
{
const SfxEventHint* pEventHint = dynamic_cast<const SfxEventHint*>(&rHint);
- if ( pEventHint )
+ if ( pEventHint && pEventHint->GetEventId() == SfxEventHintId::LoadFinished )
{
- switch ( pEventHint->GetEventId() )
+ if ( GetController().is() )
{
- case SFX_EVENT_LOADFINISHED:
+ // avoid access to dangling ViewShells
+ SfxViewFrameArr_Impl &rFrames = SfxGetpApp()->GetViewFrames_Impl();
+ for (SfxViewFrame* frame : rFrames)
{
- if ( GetController().is() )
+ if ( frame == GetViewFrame() && &rBC == GetObjectShell() )
{
- // avoid access to dangling ViewShells
- SfxViewFrameArr_Impl &rFrames = SfxGetpApp()->GetViewFrames_Impl();
- for (SfxViewFrame* frame : rFrames)
+ SfxItemSet* pSet = GetObjectShell()->GetMedium()->GetItemSet();
+ const SfxUnoAnyItem* pItem = SfxItemSet::GetItem<SfxUnoAnyItem>(pSet, SID_VIEW_DATA, false);
+ if ( pItem )
{
- if ( frame == GetViewFrame() && &rBC == GetObjectShell() )
- {
- SfxItemSet* pSet = GetObjectShell()->GetMedium()->GetItemSet();
- const SfxUnoAnyItem* pItem = SfxItemSet::GetItem<SfxUnoAnyItem>(pSet, SID_VIEW_DATA, false);
- if ( pItem )
- {
- pImpl->m_pController->restoreViewData( pItem->GetValue() );
- pSet->ClearItem( SID_VIEW_DATA );
- }
-
- break;
- }
+ pImpl->m_pController->restoreViewData( pItem->GetValue() );
+ pSet->ClearItem( SID_VIEW_DATA );
}
+ break;
}
-
- break;
}
}
}