diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-11-25 10:12:55 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-11-25 14:54:02 +0000 |
commit | 83078214196b071cf1d8e5796803b6ebc1bc9de4 (patch) | |
tree | dffa5b67e5ad6c95341c2f6b97dcc6f6de8c7155 /include | |
parent | f676e9a604bed14865e5c9a277fda0d7b564085d (diff) |
We now only need one bit of information here
whether there *is* an id, or whether there is not an id. An id of 0 seems to
be used as a flag that an interface is some sort of superclass which can be
subclassed by something else and have its toolbars etc reused.
Convert this to a bool so we don't need an a resource id for each one and just
drop the third arg for the normal "final" case and use a different define for
the inheritable case
Change-Id: I98380f03d73d57bf8cba02d339097e384518abaa
Diffstat (limited to 'include')
-rw-r--r-- | include/sfx2/objface.hxx | 6 | ||||
-rw-r--r-- | include/sfx2/shell.hxx | 12 |
2 files changed, 12 insertions, 6 deletions
diff --git a/include/sfx2/objface.hxx b/include/sfx2/objface.hxx index db88e6fd7d13..c4a4206f2c82 100644 --- a/include/sfx2/objface.hxx +++ b/include/sfx2/objface.hxx @@ -40,14 +40,14 @@ friend class SfxSlotPool; SfxSlot* pSlots; // SlotMap sal_uInt16 nCount; // number of slots in SlotMap SfxInterfaceId nClassId; // Id of interface - ResId aNameResId; // ResId of external interface name + bool bSuperClass; // Whether children inherit its toolbars etc SfxInterface_Impl* pImpData; SfxSlot* operator[]( sal_uInt16 nPos ) const; public: SfxInterface( const char *pClass, - const ResId& rResId, + bool bSuperClass, SfxInterfaceId nClassId, const SfxInterface* pGeno, SfxSlot &rMessages, sal_uInt16 nMsgCount ); @@ -62,7 +62,7 @@ public: const SfxSlot* GetSlot( const OUString& rCommand ) const; const char* GetClassName() const { return pName; } - bool HasName() const { return 0 != aNameResId.GetId(); } + bool UseAsSuperClass() const { return bSuperClass; } const SfxInterface* GetGenoType() const { return pGenoType; } diff --git a/include/sfx2/shell.hxx b/include/sfx2/shell.hxx index 6e4ef36e9daa..2baa19f13a44 100644 --- a/include/sfx2/shell.hxx +++ b/include/sfx2/shell.hxx @@ -570,16 +570,16 @@ inline void SfxShell::SetPool static void RegisterInterface(SfxModule* pMod=NULL); \ virtual SfxInterface* GetInterface() const SAL_OVERRIDE; -#define SFX_IMPL_INTERFACE(Class,SuperClass,NameResId) \ +#define SFX_TMPL_INTERFACE(Class,SuperClass,Abstract) \ \ SfxInterface* Class::pInterface = 0; \ - SfxInterface* Class::GetStaticInterface() \ + SfxInterface* Class::GetStaticInterface() \ { \ if ( !pInterface ) \ { \ pInterface = \ new SfxInterface( \ - #Class, NameResId, GetInterfaceId(), \ + #Class, Abstract, GetInterfaceId(), \ SuperClass::GetStaticInterface(), \ a##Class##Slots_Impl[0], \ (sal_uInt16) (sizeof(a##Class##Slots_Impl) / sizeof(SfxSlot) ) ); \ @@ -598,6 +598,12 @@ inline void SfxShell::SetPool GetStaticInterface()->Register(pMod); \ } +#define SFX_IMPL_INTERFACE(Class,SuperClass) \ +SFX_TMPL_INTERFACE(Class,SuperClass,false) \ + +#define SFX_IMPL_SUPERCLASS_INTERFACE(Class,SuperClass) \ +SFX_TMPL_INTERFACE(Class,SuperClass,true) \ + #define SFX_POSITION_MASK 0x000F #define SFX_VISIBILITY_MASK 0xFFF0 #define SFX_VISIBILITY_UNVISIBLE 0x0000 // Never visible |