diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2016-11-15 16:47:02 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2016-11-15 16:47:02 +0100 |
commit | 40c44ed643acde1d3b9ab0177a09bdb8b3083dea (patch) | |
tree | 0eb0cc0d2cb10a3772d53208347290e9ef1dfa7b /sd/qa/unit | |
parent | d436065bc1c68fc2d90e73253d8c00503c72dfd0 (diff) |
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/qa/unit')
-rw-r--r-- | sd/qa/unit/dialogs-test.cxx | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sd/qa/unit/dialogs-test.cxx b/sd/qa/unit/dialogs-test.cxx index d5e6cadbf2ea..37104a4ba1dd 100644 --- a/sd/qa/unit/dialogs-test.cxx +++ b/sd/qa/unit/dialogs-test.cxx @@ -363,13 +363,13 @@ VclPtr<VclAbstractDialog> SdDialogsTest::createDialogByID(sal_uInt32 nID) CPPUNIT_ASSERT(pDrawDoc); SfxItemSet aNewAttr(pDrawDoc->GetItemPool(), ATTR_LAYER_START, ATTR_LAYER_END); const OUString aLayerName = SD_RESSTR(STR_LAYER); // + OUString::number(2); - aNewAttr.Put(SdAttrLayerName(aLayerName)); - aNewAttr.Put(SdAttrLayerTitle()); - aNewAttr.Put(SdAttrLayerDesc()); - aNewAttr.Put(SdAttrLayerVisible()); - aNewAttr.Put(SdAttrLayerPrintable()); - aNewAttr.Put(SdAttrLayerLocked()); - aNewAttr.Put(SdAttrLayerThisPage()); + aNewAttr.Put(makeSdAttrLayerName(aLayerName)); + aNewAttr.Put(makeSdAttrLayerTitle()); + aNewAttr.Put(makeSdAttrLayerDesc()); + aNewAttr.Put(makeSdAttrLayerVisible()); + aNewAttr.Put(makeSdAttrLayerPrintable()); + aNewAttr.Put(makeSdAttrLayerLocked()); + aNewAttr.Put(makeSdAttrLayerThisPage()); pRetval = getSdAbstractDialogFactory()->CreateSdInsertLayerDlg( getViewShell()->GetActiveWindow(), aNewAttr, |