diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-12-19 11:01:37 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-12-20 06:08:30 +0000 |
commit | ed2b8ca92ae00ab96b0ea2b1c3fc9be4622b61ff (patch) | |
tree | 5fe7754d4aa1e93c6aa186ff74e6f96aaecdcd74 /include | |
parent | tdf#103765: Round positions instead of truncating (diff) | |
download | core-ed2b8ca92ae00ab96b0ea2b1c3fc9be4622b61ff.tar.gz core-ed2b8ca92ae00ab96b0ea2b1c3fc9be4622b61ff.zip |
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 'include')
-rw-r--r-- | include/sfx2/event.hxx | 59 | ||||
-rw-r--r-- | include/sfx2/objsh.hxx | 3 | ||||
-rw-r--r-- | include/sfx2/sfx.hrc | 34 |
3 files changed, 50 insertions, 46 deletions
diff --git a/include/sfx2/event.hxx b/include/sfx2/event.hxx index 6137496183b6..f0fc85500c72 100644 --- a/include/sfx2/event.hxx +++ b/include/sfx2/event.hxx @@ -34,20 +34,55 @@ class SfxObjectShell; +enum class SfxEventHintId { + NONE = 0, + ActivateDoc, + CloseDoc, + CloseView, + CreateDoc, + DeactivateDoc, + DocCreated, + LoadFinished, + ModifyChanged, + OpenDoc, + PrepareCloseDoc, + PrepareCloseView, + PrintDoc, + SaveAsDoc, + SaveAsDocDone, + SaveAsDocFailed, + SaveDoc, + SaveDocDone, + SaveDocFailed, + SaveToDoc, + SaveToDocDone, + SaveToDocFailed, + StorageChanged, + ViewCreated, + VisAreaChanged, + // SW events + SwMailMerge, + SwMailMergeEnd, + SwEventPageCount, + SwEventFieldMerge, + SwEventFieldMergeFinished, + SwEventLayoutFinished, +}; + class SFX2_DLLPUBLIC SfxEventHint : public SfxHint { SfxObjectShell* pObjShell; - OUString aEventName; - sal_uInt16 nEventId; + OUString aEventName; + SfxEventHintId nEventId; public: - SfxEventHint( sal_uInt16 nId, const OUString& aName, SfxObjectShell *pObj ) + SfxEventHint( SfxEventHintId nId, const OUString& aName, SfxObjectShell *pObj ) : pObjShell(pObj), aEventName(aName), nEventId(nId) {} - sal_uInt16 GetEventId() const + SfxEventHintId GetEventId() const { return nEventId; } const OUString& GetEventName() const @@ -63,12 +98,12 @@ class SFX2_DLLPUBLIC SfxViewEventHint : public SfxEventHint css::uno::Reference< css::frame::XController2 > xViewController; public: - SfxViewEventHint( sal_uInt16 nId, const OUString& aName, SfxObjectShell *pObj, const css::uno::Reference< css::frame::XController >& xController ) + SfxViewEventHint( SfxEventHintId nId, const OUString& aName, SfxObjectShell *pObj, const css::uno::Reference< css::frame::XController >& xController ) : SfxEventHint( nId, aName, pObj ) , xViewController( xController, css::uno::UNO_QUERY ) {} - SfxViewEventHint( sal_uInt16 nId, const OUString& aName, SfxObjectShell *pObj, const css::uno::Reference< css::frame::XController2 >& xController ) + SfxViewEventHint( SfxEventHintId nId, const OUString& aName, SfxObjectShell *pObj, const css::uno::Reference< css::frame::XController2 >& xController ) : SfxEventHint( nId, aName, pObj ) , xViewController( xController ) {} @@ -85,22 +120,22 @@ class SfxPrintingHint : public SfxViewEventHint css::uno::Sequence < css::beans::PropertyValue > aOpts; public: SfxPrintingHint( - sal_Int32 nEvent, + sal_Int32 nState, const css::uno::Sequence < css::beans::PropertyValue >& rOpts, SfxObjectShell *pObj, const css::uno::Reference< css::frame::XController2 >& xController ) : SfxViewEventHint( - SFX_EVENT_PRINTDOC, + SfxEventHintId::PrintDoc, GlobalEventConfig::GetEventName( GlobalEventId::PRINTDOC ), pObj, xController ) - , mnPrintableState( nEvent ) + , mnPrintableState( nState ) , aOpts( rOpts ) {} - SfxPrintingHint( sal_Int32 nEvent ) - : SfxViewEventHint( SFX_EVENT_PRINTDOC, rtl::OUString(), nullptr, css::uno::Reference< css::frame::XController >() ) - , mnPrintableState( nEvent ) + SfxPrintingHint( sal_Int32 nState ) + : SfxViewEventHint( SfxEventHintId::PrintDoc, rtl::OUString(), nullptr, css::uno::Reference< css::frame::XController >() ) + , mnPrintableState( nState ) {} sal_Int32 GetWhich() const { return mnPrintableState; } diff --git a/include/sfx2/objsh.hxx b/include/sfx2/objsh.hxx index 84ff20818883..39ed879d9a69 100644 --- a/include/sfx2/objsh.hxx +++ b/include/sfx2/objsh.hxx @@ -82,6 +82,7 @@ class JobSetup; class Size; class Point; enum class SfxModelFlags; +enum class SfxEventHintId; // These values presumably must match exactly the corresponding // css::embed::Aspects ones (in offapi/com/sun/star/embed/Aspects.idl) @@ -691,7 +692,7 @@ public: SAL_DLLPRIVATE IndexBitSet& GetNoSet_Impl(); SAL_DLLPRIVATE void SetProgress_Impl( SfxProgress *pProgress ); SAL_DLLPRIVATE void PostActivateEvent_Impl( SfxViewFrame* ); - SAL_DLLPRIVATE void SetActivateEvent_Impl(sal_uInt16 ); + SAL_DLLPRIVATE void SetActivateEvent_Impl(SfxEventHintId ); SAL_DLLPRIVATE SfxObjectShell* GetParentShellByModel_Impl(); // configuration items diff --git a/include/sfx2/sfx.hrc b/include/sfx2/sfx.hrc index df385999e1a7..44bf0759a41b 100644 --- a/include/sfx2/sfx.hrc +++ b/include/sfx2/sfx.hrc @@ -35,39 +35,7 @@ // EVENT_APP_END 29999 // Warning: the following are simultaneously SID_ON_ ... -#define SFX_EVENT_CLOSEAPP (EVENT_SFX_START + 1) -#define SFX_EVENT_CREATEDOC (EVENT_SFX_START + 2) -#define SFX_EVENT_OPENDOC (EVENT_SFX_START + 3) -#define SFX_EVENT_CLOSEDOC (EVENT_SFX_START + 4) -#define SFX_EVENT_SAVEDOC (EVENT_SFX_START + 5) -#define SFX_EVENT_SAVEASDOC (EVENT_SFX_START + 6) -#define SFX_EVENT_ACTIVATEDOC (EVENT_SFX_START + 7) -#define SFX_EVENT_DEACTIVATEDOC (EVENT_SFX_START + 8) -#define SFX_EVENT_PRINTDOC (EVENT_SFX_START + 9) - -#define SFX_EVENT_LOADFINISHED (EVENT_SFX_START + 11) - -#define SFX_EVENT_MODIFYCHANGED (EVENT_SFX_START + 13) -#define SFX_EVENT_PREPARECLOSEDOC (EVENT_SFX_START + 14) -#define SFX_EVENT_TOGGLEFULLSCREENMODE (EVENT_SFX_START + 16) -#define SFX_EVENT_SAVEDOCDONE (EVENT_SFX_START + 17) -#define SFX_EVENT_SAVEASDOCDONE (EVENT_SFX_START + 18) - -#define SFX_EVENT_SAVETODOC (EVENT_SFX_START + 19) -#define SFX_EVENT_SAVETODOCDONE (EVENT_SFX_START + 20) - -#define SFX_EVENT_VIEWCREATED (EVENT_SFX_START + 21) -#define SFX_EVENT_PREPARECLOSEVIEW (EVENT_SFX_START + 22) -#define SFX_EVENT_CLOSEVIEW (EVENT_SFX_START + 23) - -#define SFX_EVENT_STORAGECHANGED (EVENT_SFX_START + 24) -#define SFX_EVENT_VISAREACHANGED (EVENT_SFX_START + 25) - -#define SFX_EVENT_DOCCREATED (EVENT_SFX_START + 26) - -#define SFX_EVENT_SAVEASDOCFAILED (EVENT_SFX_START + 27) -#define SFX_EVENT_SAVEDOCFAILED (EVENT_SFX_START + 28) -#define SFX_EVENT_SAVETODOCFAILED (EVENT_SFX_START + 29) + // Events for Controls etc. #define SFX_EVENT_MOUSEOVER_OBJECT ( EVENT_SFX_START + 100 ) |