diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-08-20 11:15:58 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-09-28 08:48:37 +0100 |
commit | 455ca9208630c2398c1c503ff833ddf3fc71cb90 (patch) | |
tree | 9b14284dc9798911e4846c7516878bd23ec3b43c /sw | |
parent | 98283a67ec892ab31ddae04f0c2ef7aa5a0e962e (diff) |
add support for custom property for custom widget
Change-Id: I166522cb801282ce7b887b694e9ab25c84bd7759
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/ui/inc/numberingtypelistbox.hxx | 4 | ||||
-rw-r--r-- | sw/source/ui/misc/numberingtypelistbox.cxx | 12 |
2 files changed, 13 insertions, 3 deletions
diff --git a/sw/source/ui/inc/numberingtypelistbox.hxx b/sw/source/ui/inc/numberingtypelistbox.hxx index 43a20f62374b..15fdb8979d69 100644 --- a/sw/source/ui/inc/numberingtypelistbox.hxx +++ b/sw/source/ui/inc/numberingtypelistbox.hxx @@ -37,9 +37,11 @@ class SW_DLLPUBLIC SwNumberingTypeListBox : public ListBox public: SwNumberingTypeListBox( Window* pWin, const ResId& rResId, sal_uInt16 nTypeFlags = INSERT_NUM_TYPE_PAGE_STYLE_NUMBERING|INSERT_NUM_TYPE_NO_NUMBERING|INSERT_NUM_EXTENDED_TYPES ); - SwNumberingTypeListBox( Window* pWin, WinBits nStyle = WB_BORDER, sal_uInt16 nTypeFlags = INSERT_NUM_TYPE_PAGE_STYLE_NUMBERING|INSERT_NUM_TYPE_NO_NUMBERING|INSERT_NUM_EXTENDED_TYPES ); + SwNumberingTypeListBox( Window* pWin, WinBits nStyle = WB_BORDER ); ~SwNumberingTypeListBox(); + virtual bool set_property(const rtl::OString &rKey, const rtl::OString &rValue); + void Reload(sal_uInt16 nTypeFlags); sal_Int16 GetSelectedNumberingType(); diff --git a/sw/source/ui/misc/numberingtypelistbox.cxx b/sw/source/ui/misc/numberingtypelistbox.cxx index 82d81b814499..1fa26fc2547e 100644 --- a/sw/source/ui/misc/numberingtypelistbox.cxx +++ b/sw/source/ui/misc/numberingtypelistbox.cxx @@ -58,7 +58,7 @@ SwNumberingTypeListBox::SwNumberingTypeListBox( Window* pWin, const ResId& rResI Reload(nTypeFlags); } -SwNumberingTypeListBox::SwNumberingTypeListBox( Window* pWin, WinBits nStyle, sal_uInt16 nTypeFlags ) : +SwNumberingTypeListBox::SwNumberingTypeListBox( Window* pWin, WinBits nStyle ) : ListBox(pWin, nStyle), pImpl(new SwNumberingTypeListBox_Impl) { @@ -66,7 +66,15 @@ SwNumberingTypeListBox::SwNumberingTypeListBox( Window* pWin, WinBits nStyle, sa uno::Reference<text::XDefaultNumberingProvider> xDefNum = text::DefaultNumberingProvider::create(xContext); pImpl->xInfo = uno::Reference<text::XNumberingTypeInfo>(xDefNum, uno::UNO_QUERY); - Reload(nTypeFlags); +} + +bool SwNumberingTypeListBox::set_property(const rtl::OString &rKey, const rtl::OString &rValue) +{ + if (rKey.equalsL(RTL_CONSTASCII_STRINGPARAM("type"))) + Reload(rValue.toInt32()); + else + return ListBox::set_property(rKey, rValue); + return true; } extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeSwNumberingTypeListBox(Window *pParent) |