diff options
author | Takeshi Abe <tabe@fixedpoint.jp> | 2015-04-17 11:56:07 +0900 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-04-20 10:29:48 +0000 |
commit | f6a4f11afb7c4dcd72b52892f2e449478a3d7017 (patch) | |
tree | eaa2498cb4c3e007402f18acbfe97a6c7b7b8380 /starmath/inc/smmod.hxx | |
parent | f6644e9a446773a5cb4f528d891a44a76c561dec (diff) |
Make use of std::unique_ptr<> to simplify ctor and dtor
This also renames member variables with the m prefix, drops
a couple of private functions which were called only for
lazy construction, and stops persisting in futile const-ness.
Change-Id: Ia4d1aded294f6b22a25a7cf40eb37418d45c9f0b
Reviewed-on: https://gerrit.libreoffice.org/15359
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'starmath/inc/smmod.hxx')
-rw-r--r-- | starmath/inc/smmod.hxx | 32 |
1 files changed, 10 insertions, 22 deletions
diff --git a/starmath/inc/smmod.hxx b/starmath/inc/smmod.hxx index 7d26cd9d8425..e324fe8fb15f 100644 --- a/starmath/inc/smmod.hxx +++ b/starmath/inc/smmod.hxx @@ -31,6 +31,7 @@ #include "starmath.hrc" #include <unotools/options.hxx> +#include <memory> class SfxObjectFactory; class SmConfig; @@ -86,14 +87,11 @@ public: class SmModule : public SfxModule, utl::ConfigurationListener { - svtools::ColorConfig *pColorConfig; - SmConfig *pConfig; - SmLocalizedSymbolData *pLocSymbolData; - SvtSysLocale *pSysLocale; - VirtualDevice *pVirtualDev; - - void _CreateSysLocale() const; - void _CreateVirtualDev() const; + std::unique_ptr<svtools::ColorConfig> mpColorConfig; + std::unique_ptr<SmConfig> mpConfig; + std::unique_ptr<SmLocalizedSymbolData> mpLocSymbolData; + std::unique_ptr<SvtSysLocale> mpSysLocale; + std::unique_ptr<VirtualDevice> mpVirtualDev; void ApplyColorConfigValues( const svtools::ColorConfig &rColorCfg ); @@ -116,23 +114,13 @@ public: SmConfig * GetConfig(); SmSymbolManager & GetSymbolManager(); - SmLocalizedSymbolData & GetLocSymbolData() const; + SmLocalizedSymbolData & GetLocSymbolData(); void GetState(SfxItemSet&); - const SvtSysLocale& GetSysLocale() const - { - if( !pSysLocale ) - _CreateSysLocale(); - return *pSysLocale; - } - - VirtualDevice & GetDefaultVirtualDev() - { - if (!pVirtualDev) - _CreateVirtualDev(); - return *pVirtualDev; - } + const SvtSysLocale& GetSysLocale(); + + VirtualDevice & GetDefaultVirtualDev(); //virtual methods for options dialog virtual SfxItemSet* CreateItemSet( sal_uInt16 nId ) SAL_OVERRIDE; |