summaryrefslogtreecommitdiff
path: root/sd/source/ui/dlg
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/source/ui/dlg
parentd436065bc1c68fc2d90e73253d8c00503c72dfd0 (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/source/ui/dlg')
-rw-r--r--sd/source/ui/dlg/layeroptionsdlg.cxx24
1 files changed, 12 insertions, 12 deletions
diff --git a/sd/source/ui/dlg/layeroptionsdlg.cxx b/sd/source/ui/dlg/layeroptionsdlg.cxx
index a1e5d7f1a03b..636a3a2c059d 100644
--- a/sd/source/ui/dlg/layeroptionsdlg.cxx
+++ b/sd/source/ui/dlg/layeroptionsdlg.cxx
@@ -39,13 +39,13 @@ SdInsertLayerDlg::SdInsertLayerDlg( vcl::Window* pWindow, const SfxItemSet& rInA
get(m_pCbxPrintable, "printable");
get(m_pCbxLocked, "locked");
- m_pEdtName->SetText( static_cast<const SdAttrLayerName&>( mrOutAttrs.Get( ATTR_LAYER_NAME ) ).GetValue() );
- m_pEdtTitle->SetText( static_cast<const SdAttrLayerTitle&>( mrOutAttrs.Get( ATTR_LAYER_TITLE ) ).GetValue() );
- m_pEdtDesc->SetText( static_cast<const SdAttrLayerDesc&>( mrOutAttrs.Get( ATTR_LAYER_DESC ) ).GetValue() );
+ m_pEdtName->SetText( static_cast<const SfxStringItem&>( mrOutAttrs.Get( ATTR_LAYER_NAME ) ).GetValue() );
+ m_pEdtTitle->SetText( static_cast<const SfxStringItem&>( mrOutAttrs.Get( ATTR_LAYER_TITLE ) ).GetValue() );
+ m_pEdtDesc->SetText( static_cast<const SfxStringItem&>( mrOutAttrs.Get( ATTR_LAYER_DESC ) ).GetValue() );
m_pEdtDesc->set_height_request(4 * m_pEdtDesc->GetTextHeight());
- m_pCbxVisible->Check( static_cast<const SdAttrLayerVisible&>( mrOutAttrs.Get( ATTR_LAYER_VISIBLE ) ).GetValue() );
- m_pCbxPrintable->Check( static_cast<const SdAttrLayerPrintable&>( mrOutAttrs.Get( ATTR_LAYER_PRINTABLE ) ).GetValue() );
- m_pCbxLocked->Check( static_cast<const SdAttrLayerLocked&>( mrOutAttrs.Get( ATTR_LAYER_LOCKED ) ).GetValue() );
+ m_pCbxVisible->Check( static_cast<const SfxBoolItem&>( mrOutAttrs.Get( ATTR_LAYER_VISIBLE ) ).GetValue() );
+ m_pCbxPrintable->Check( static_cast<const SfxBoolItem&>( mrOutAttrs.Get( ATTR_LAYER_PRINTABLE ) ).GetValue() );
+ m_pCbxLocked->Check( static_cast<const SfxBoolItem&>( mrOutAttrs.Get( ATTR_LAYER_LOCKED ) ).GetValue() );
get<VclContainer>("nameframe")->Enable(bDeletable);
}
@@ -68,12 +68,12 @@ void SdInsertLayerDlg::dispose()
void SdInsertLayerDlg::GetAttr( SfxItemSet& rAttrs )
{
- rAttrs.Put( SdAttrLayerName( m_pEdtName->GetText() ) );
- rAttrs.Put( SdAttrLayerTitle( m_pEdtTitle->GetText() ) );
- rAttrs.Put( SdAttrLayerDesc( m_pEdtDesc->GetText() ) );
- rAttrs.Put( SdAttrLayerVisible( m_pCbxVisible->IsChecked() ) );
- rAttrs.Put( SdAttrLayerPrintable( m_pCbxPrintable->IsChecked() ) );
- rAttrs.Put( SdAttrLayerLocked( m_pCbxLocked->IsChecked() ) );
+ rAttrs.Put( makeSdAttrLayerName( m_pEdtName->GetText() ) );
+ rAttrs.Put( makeSdAttrLayerTitle( m_pEdtTitle->GetText() ) );
+ rAttrs.Put( makeSdAttrLayerDesc( m_pEdtDesc->GetText() ) );
+ rAttrs.Put( makeSdAttrLayerVisible( m_pCbxVisible->IsChecked() ) );
+ rAttrs.Put( makeSdAttrLayerPrintable( m_pCbxPrintable->IsChecked() ) );
+ rAttrs.Put( makeSdAttrLayerLocked( m_pCbxLocked->IsChecked() ) );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */