diff options
author | Zolnai Tamás <zolnaitamas2000@gmail.com> | 2015-03-15 13:29:53 +0100 |
---|---|---|
committer | Zolnai Tamás <zolnaitamas2000@gmail.com> | 2015-03-17 00:10:01 +0100 |
commit | f7424ed710e54bb2437a28380b03ed7c26290edc (patch) | |
tree | ca44565d82433bf9c33fbeeeddce2bd5893c262c /sd/source/ui | |
parent | e3167924fd28c8b854f23139dbf49f53e6282ef7 (diff) |
SfxTabDialog: avoid changing const input parameter
* SfxTabDialog constructor has a const pointer parameter
pointing to the input set and also the corresponding member
is a const pointer which indicated that set is not changed by
the dialog, but this is not true, const is casted away and
the input set is changed.
* So use a copy of the input set instead, pointed by
a non-const member, so we can spare some const cast and
misunderstandings.
* GetRefreshedSet not behaves as a getter method, but changes
the input set instead, so redeclare it accordingly.
Change-Id: Ic63f9ae68c50e65d4498b20f597547c1c075b94e
Diffstat (limited to 'sd/source/ui')
-rw-r--r-- | sd/source/ui/dlg/tabtempl.cxx | 4 | ||||
-rw-r--r-- | sd/source/ui/inc/tabtempl.hxx | 2 |
2 files changed, 2 insertions, 4 deletions
diff --git a/sd/source/ui/dlg/tabtempl.cxx b/sd/source/ui/dlg/tabtempl.cxx index 2c875ef0a784..a213c380cd10 100644 --- a/sd/source/ui/dlg/tabtempl.cxx +++ b/sd/source/ui/dlg/tabtempl.cxx @@ -172,7 +172,7 @@ void SdTabTemplateDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) } } -const SfxItemSet* SdTabTemplateDlg::GetRefreshedSet() +void SdTabTemplateDlg::RefreshInputSet() { SfxItemSet* pRet = GetInputSetImpl(); @@ -183,8 +183,6 @@ const SfxItemSet* SdTabTemplateDlg::GetRefreshedSet() } else pRet = new SfxItemSet( GetStyleSheet().GetItemSet() ); - - return pRet; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sd/source/ui/inc/tabtempl.hxx b/sd/source/ui/inc/tabtempl.hxx index ed57b580b0b1..636ae6bcbe75 100644 --- a/sd/source/ui/inc/tabtempl.hxx +++ b/sd/source/ui/inc/tabtempl.hxx @@ -66,7 +66,7 @@ private: sal_uInt16 m_nAsianTypoId; virtual void PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) SAL_OVERRIDE; - virtual const SfxItemSet* GetRefreshedSet() SAL_OVERRIDE; + virtual void RefreshInputSet() SAL_OVERRIDE; public: SdTabTemplateDlg(vcl::Window* pParent, |