diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-11-24 11:26:19 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-11-24 11:27:51 +0200 |
commit | 04a84913ead2f82510d91eea2bb8526274feeeae (patch) | |
tree | a123ff892b74a778c6ae61de2e5caa2ee916416f /include | |
parent | a250292c5eb7e4cdb2aa83bc08ae6c86c3ca65a1 (diff) |
use o3tl::typed_flags in ConfigurationListener::ConfigurationChanged
Change-Id: I0ad7c02953aa53168dc242f1f374ab871728c84e
Diffstat (limited to 'include')
-rw-r--r-- | include/svl/hint.hxx | 1 | ||||
-rw-r--r-- | include/svx/svdpntv.hxx | 2 | ||||
-rw-r--r-- | include/svx/svdview.hxx | 2 | ||||
-rw-r--r-- | include/unotools/options.hxx | 24 | ||||
-rw-r--r-- | include/unotools/syslocaleoptions.hxx | 10 | ||||
-rw-r--r-- | include/vcl/settings.hxx | 3 |
6 files changed, 25 insertions, 17 deletions
diff --git a/include/svl/hint.hxx b/include/svl/hint.hxx index 8de965d73af5..a31cea4e6a47 100644 --- a/include/svl/hint.hxx +++ b/include/svl/hint.hxx @@ -35,7 +35,6 @@ // unused, formerly SFX_HINT_SAVECOMPLETED // unused, formerly SFX_HINT_RELEASEREF #define SFX_HINT_COLORS_CHANGED 0x00001000 -#define SFX_HINT_CTL_SETTINGS_CHANGED 0x00002000 #define SFX_HINT_ACCESSIBILITY_CHANGED 0x00004000 // unused, formerly SFX_HINT_VIEWCREATED #define SFX_HINT_USER00 0x00010000 diff --git a/include/svx/svdpntv.hxx b/include/svx/svdpntv.hxx index 6188c7b1e474..dcf686230561 100644 --- a/include/svx/svdpntv.hxx +++ b/include/svx/svdpntv.hxx @@ -210,7 +210,7 @@ protected: // Interface to SdrPaintWindow void RemovePaintWindow(SdrPaintWindow& rOld); - void ConfigurationChanged( ::utl::ConfigurationBroadcaster*, sal_uInt32 ) override; + void ConfigurationChanged( ::utl::ConfigurationBroadcaster*, ConfigurationHints ) override; public: sal_uInt32 PaintWindowCount() const { return maPaintWindows.size(); } diff --git a/include/svx/svdview.hxx b/include/svx/svdview.hxx index 4c2152832487..a1611574bf04 100644 --- a/include/svx/svdview.hxx +++ b/include/svx/svdview.hxx @@ -200,7 +200,7 @@ public: virtual bool MouseMove(const MouseEvent& rMEvt, vcl::Window* pWin) override; virtual bool Command(const CommandEvent& rCEvt, vcl::Window* pWin) override; - virtual void ConfigurationChanged( utl::ConfigurationBroadcaster*, sal_uInt32 ) override; + virtual void ConfigurationChanged( utl::ConfigurationBroadcaster*, ConfigurationHints ) override; bool SetAttributes(const SfxItemSet& rSet, bool bReplaceAll=false) { return SdrCreateView::SetAttributes(rSet,bReplaceAll); } bool SetStyleSheet(SfxStyleSheet* pStyleSheet, bool bDontRemoveHardAttr) { return SdrCreateView::SetStyleSheet(pStyleSheet,bDontRemoveHardAttr); } diff --git a/include/unotools/options.hxx b/include/unotools/options.hxx index 5b11373d2f3d..552eb5106a61 100644 --- a/include/unotools/options.hxx +++ b/include/unotools/options.hxx @@ -22,8 +22,24 @@ #include <sal/config.h> #include <unotools/unotoolsdllapi.h> +#include <o3tl/typed_flags_set.hxx> #include <vector> +// bits for broadcasting hints of changes in ConfigurationListener::ConfigurationChanged, may be combined +enum class ConfigurationHints { + NONE = 0x0000, + Locale = 0x0001, + Currency = 0x0002, + UiLocale = 0x0004, + DecSep = 0x0008, + DatePatterns = 0x0010, + IgnoreLang = 0x0020, + CtlSettingsChanged = 0x2000, +}; +namespace o3tl { + template<> struct typed_flags<ConfigurationHints> : is_typed_flags<ConfigurationHints, 0x203f> {}; +} + /* The class utl::detail::Options provides a kind of multiplexer. It implements a ConfigurationListener that is usually registered at a ConfigItem class. At the same time it implements a ConfigurationBroadcaster @@ -43,7 +59,7 @@ namespace utl { public: virtual ~ConfigurationListener(); - virtual void ConfigurationChanged( ConfigurationBroadcaster* p, sal_uInt32 nHint ) = 0; + virtual void ConfigurationChanged( ConfigurationBroadcaster* p, ConfigurationHints nHint ) = 0; }; typedef ::std::vector< ConfigurationListener* > IMPL_ConfigurationListenerList; @@ -52,14 +68,14 @@ namespace utl { { IMPL_ConfigurationListenerList* mpList; sal_Int32 m_nBroadcastBlocked; // broadcast only if this is 0 - sal_uInt32 m_nBlockedHint; + ConfigurationHints m_nBlockedHint; public: void AddListener( utl::ConfigurationListener* pListener ); void RemoveListener( utl::ConfigurationListener* pListener ); // notify listeners; nHint is an implementation detail of the particular class deriving from ConfigurationBroadcaster - void NotifyListeners( sal_uInt32 nHint ); + void NotifyListeners( ConfigurationHints nHint ); ConfigurationBroadcaster(); virtual ~ConfigurationBroadcaster(); virtual void BlockBroadcasts( bool bBlock ); @@ -85,7 +101,7 @@ private: void operator =(Options &) = delete; protected: - virtual void ConfigurationChanged( ::utl::ConfigurationBroadcaster* p, sal_uInt32 nHint ) override; + virtual void ConfigurationChanged( ::utl::ConfigurationBroadcaster* p, ConfigurationHints nHint ) override; }; } } diff --git a/include/unotools/syslocaleoptions.hxx b/include/unotools/syslocaleoptions.hxx index f5cb835b2617..d37fab8a3f9d 100644 --- a/include/unotools/syslocaleoptions.hxx +++ b/include/unotools/syslocaleoptions.hxx @@ -29,14 +29,6 @@ #include <i18nlangtag/languagetag.hxx> #include <unotools/options.hxx> -// bits for broadcasting hints of changes in a SfxSimpleHint, may be combined -const sal_uInt32 SYSLOCALEOPTIONS_HINT_LOCALE = 0x00000001; -const sal_uInt32 SYSLOCALEOPTIONS_HINT_CURRENCY = 0x00000002; -const sal_uInt32 SYSLOCALEOPTIONS_HINT_UILOCALE = 0x00000004; -const sal_uInt32 SYSLOCALEOPTIONS_HINT_DECSEP = 0x00000008; -const sal_uInt32 SYSLOCALEOPTIONS_HINT_DATEPATTERNS = 0x00000010; -const sal_uInt32 SYSLOCALEOPTIONS_HINT_IGNORELANG = 0x00000020; - class SvtSysLocaleOptions_Impl; class SvtListener; namespace osl { class Mutex; } @@ -46,7 +38,7 @@ class SAL_WARN_UNUSED UNOTOOLS_DLLPUBLIC SvtSysLocaleOptions : public utl::detai std::shared_ptr<SvtSysLocaleOptions_Impl> pImpl; UNOTOOLS_DLLPRIVATE static ::osl::Mutex& GetMutex(); - virtual void ConfigurationChanged( utl::ConfigurationBroadcaster* p, sal_uInt32 nHint ) override; + virtual void ConfigurationChanged( utl::ConfigurationBroadcaster* p, ConfigurationHints nHint ) override; public: diff --git a/include/vcl/settings.hxx b/include/vcl/settings.hxx index e8b7c0a6f28a..343559d7e080 100644 --- a/include/vcl/settings.hxx +++ b/include/vcl/settings.hxx @@ -45,6 +45,7 @@ struct ImplMiscData; struct ImplHelpData; struct ImplStyleData; struct ImplAllSettingsData; +enum class ConfigurationHints; namespace vcl { class I18nHelper; @@ -701,7 +702,7 @@ public: bool operator ==( const AllSettings& rSet ) const; bool operator !=( const AllSettings& rSet ) const; - static void LocaleSettingsChanged( sal_uInt32 nHint ); + static void LocaleSettingsChanged( ConfigurationHints nHint ); SvtSysLocale& GetSysLocale(); }; |