diff options
-rw-r--r-- | sfx2/inc/sfx2/docfac.hxx | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/sfx2/inc/sfx2/docfac.hxx b/sfx2/inc/sfx2/docfac.hxx index 8f5cf0b055..fb89ea4cdb 100644 --- a/sfx2/inc/sfx2/docfac.hxx +++ b/sfx2/inc/sfx2/docfac.hxx @@ -122,20 +122,16 @@ private: //========================================================================= #define SFX_DECL_OBJECTFACTORY() \ -private: \ - static SfxObjectFactory* pObjectFactory; \ public: \ static SfxObjectFactory& Factory(); \ virtual SfxObjectFactory& GetFactory() const { return Factory(); } #define SFX_IMPL_OBJECTFACTORY(ClassName,GlobName,Flags,ShortName) \ - SfxObjectFactory* ClassName::pObjectFactory = 0; \ - SfxObjectFactory& ClassName::Factory() \ - { if (!pObjectFactory) \ - pObjectFactory = \ - new SfxObjectFactory( GlobName, Flags, ShortName ); \ - return *pObjectFactory; \ - } + SfxObjectFactory& ClassName::Factory() \ + { \ + static SfxObjectFactory aObjectFactory(GlobName, Flags, ShortName); \ + return aObjectFactory; \ + } #endif // #ifndef _SFX_OBJFAC_HXX /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |