summaryrefslogtreecommitdiffstats
path: root/sd/inc
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2016-11-15 16:47:02 +0100
committerStephan Bergmann <sbergman@redhat.com>2016-11-15 16:47:02 +0100
commit40c44ed643acde1d3b9ab0177a09bdb8b3083dea (patch)
tree0eb0cc0d2cb10a3772d53208347290e9ef1dfa7b /sd/inc
parenttdf#103725: Default to GDI even with the new layout engine (diff)
downloadcore-40c44ed643acde1d3b9ab0177a09bdb8b3083dea.tar.gz
core-40c44ed643acde1d3b9ab0177a09bdb8b3083dea.zip
Replace some trivial Sfx*Item derivations with make* functions
...as the trivial derivations (used to offer "convenience ctors") didn't override Clone(), so -fsanitize=vptr would cause warnings like > sd/source/ui/dlg/layeroptionsdlg.cxx:42:26: runtime error: downcast of address 0x603001dff830 which does not point to an object of type 'const SdAttrLayerName' > 0x603001dff830: note: object is of type 'SfxStringItem' > 61 05 80 1e 70 d6 f7 22 67 7f 00 00 01 00 00 00 4e 6e 00 be 60 f8 df 01 30 60 00 00 02 00 00 00 > ^~~~~~~~~~~~~~~~~~~~~~~ > vptr for 'SfxStringItem' > #0 0x7f66931db4b0 in SdInsertLayerDlg::SdInsertLayerDlg(vcl::Window*, SfxItemSet const&, bool, rtl::OUString const&) sd/source/ui/dlg/layeroptionsdlg.cxx:42:26 when doing "Insert - Layer..." in Draw. Change-Id: I54ade09027daecc8bbf6f4789a8b5318bbe8d22d
Diffstat (limited to 'sd/inc')
-rw-r--r--sd/inc/sdattr.hxx56
1 files changed, 21 insertions, 35 deletions
diff --git a/sd/inc/sdattr.hxx b/sd/inc/sdattr.hxx
index 710a072e6b5d..b91d85798dcf 100644
--- a/sd/inc/sdattr.hxx
+++ b/sd/inc/sdattr.hxx
@@ -32,54 +32,40 @@
#include "diadef.h"
// layer attributes
-class SdAttrLayerName : public SfxStringItem
+inline SfxStringItem makeSdAttrLayerName( const OUString& aStr )
{
-public:
- SdAttrLayerName( const OUString& aStr ) :
- SfxStringItem( ATTR_LAYER_NAME, aStr ) {}
-};
+ return SfxStringItem( ATTR_LAYER_NAME, aStr );
+}
-class SdAttrLayerTitle : public SfxStringItem
+inline SfxStringItem makeSdAttrLayerTitle( const OUString& aStr = OUString() )
{
-public:
- SdAttrLayerTitle() : SfxStringItem( ATTR_LAYER_TITLE, OUString()) {}
- SdAttrLayerTitle( const OUString& aStr ) : SfxStringItem( ATTR_LAYER_TITLE, aStr ) {}
-};
+ return SfxStringItem( ATTR_LAYER_TITLE, aStr );
+}
-class SdAttrLayerDesc : public SfxStringItem
+inline SfxStringItem makeSdAttrLayerDesc( const OUString& aStr = OUString() )
{
-public:
- SdAttrLayerDesc() : SfxStringItem( ATTR_LAYER_DESC, OUString()) {}
- SdAttrLayerDesc( const OUString& aStr ) : SfxStringItem( ATTR_LAYER_DESC, aStr ) {}
-};
+ return SfxStringItem( ATTR_LAYER_DESC, aStr );
+}
-class SdAttrLayerVisible : public SfxBoolItem
+inline SfxBoolItem makeSdAttrLayerVisible( bool bValue = true )
{
-public:
- SdAttrLayerVisible( bool bValue = true ) :
- SfxBoolItem( ATTR_LAYER_VISIBLE, bValue ) {}
-};
+ return SfxBoolItem( ATTR_LAYER_VISIBLE, bValue );
+}
-class SdAttrLayerPrintable : public SfxBoolItem
+inline SfxBoolItem makeSdAttrLayerPrintable( bool bValue = true )
{
-public:
- SdAttrLayerPrintable( bool bValue = true ) :
- SfxBoolItem( ATTR_LAYER_PRINTABLE, bValue ) {}
-};
+ return SfxBoolItem( ATTR_LAYER_PRINTABLE, bValue );
+}
-class SdAttrLayerLocked : public SfxBoolItem
+inline SfxBoolItem makeSdAttrLayerLocked( bool bValue = false )
{
-public:
- SdAttrLayerLocked( bool bValue = false ) :
- SfxBoolItem( ATTR_LAYER_LOCKED, bValue ) {}
-};
+ return SfxBoolItem( ATTR_LAYER_LOCKED, bValue );
+}
-class SdAttrLayerThisPage : public SfxBoolItem
+inline SfxBoolItem makeSdAttrLayerThisPage()
{
-public:
- SdAttrLayerThisPage( bool bValue = false ) :
- SfxBoolItem( ATTR_LAYER_THISPAGE, bValue ) {}
-};
+ return SfxBoolItem( ATTR_LAYER_THISPAGE, false );
+}
class DiaEffectItem : public SfxEnumItem
{