diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-07-03 11:39:16 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-07-03 12:46:31 +0100 |
commit | 30db63e8a3f8806a1b00e14cd70bc75f3e66211e (patch) | |
tree | 293736b67eed0717c0204c87b4e88814ec87fc44 /svtools/source | |
parent | f19cc396580726f9fa1c75a2b6346e2a4827acc2 (diff) |
arrange a way to describe non-dropdown MetricBoxes
i.e. use a VclComboBoxNumeric which now has an
adjustment option and a dropdown option (defaulting to true).
Rework existing glade widget placeholders to be children of that widget
placeholder.
Centralize the dropdown bit tweaking logic.
Change-Id: Ib6dc4d19b367986e9d6a2fc2bead51e198892893
Diffstat (limited to 'svtools/source')
-rw-r--r-- | svtools/source/control/ctrlbox.cxx | 25 |
1 files changed, 5 insertions, 20 deletions
diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx index 4d28a77a3113..d1599fae1aa3 100644 --- a/svtools/source/control/ctrlbox.cxx +++ b/svtools/source/control/ctrlbox.cxx @@ -114,24 +114,9 @@ ColorListBox::ColorListBox( Window* pParent, const ResId& rResId ) : SetEdgeBlending(true); } -namespace -{ - bool extractDropdown(VclBuilder::stringmap &rMap) - { - bool bDropdown = true; - VclBuilder::stringmap::iterator aFind = rMap.find(OString(RTL_CONSTASCII_STRINGPARAM("dropdown"))); - if (aFind != rMap.end()) - { - bDropdown = toBool(aFind->second); - rMap.erase(aFind); - } - return bDropdown; - } -} - extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeColorListBox(Window *pParent, VclBuilder::stringmap &rMap) { - bool bDropdown = extractDropdown(rMap); + bool bDropdown = VclBuilder::extractDropdown(rMap); WinBits nWinBits = WB_LEFT|WB_VCENTER|WB_3DLOOK|WB_TABSTOP; if (bDropdown) nWinBits |= WB_DROPDOWN; @@ -797,7 +782,7 @@ LineListBox::LineListBox( Window* pParent, WinBits nWinStyle ) : extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeLineListBox(Window *pParent, VclBuilder::stringmap &rMap) { - bool bDropdown = extractDropdown(rMap); + bool bDropdown = VclBuilder::extractDropdown(rMap); WinBits nWinBits = WB_LEFT|WB_VCENTER|WB_3DLOOK|WB_TABSTOP; if (bDropdown) nWinBits |= WB_DROPDOWN; @@ -1073,7 +1058,7 @@ FontNameBox::FontNameBox( Window* pParent, const ResId& rResId ) : extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeFontNameBox(Window *pParent, VclBuilder::stringmap &rMap) { - bool bDropdown = extractDropdown(rMap); + bool bDropdown = VclBuilder::extractDropdown(rMap); WinBits nWinBits = WB_LEFT|WB_VCENTER|WB_3DLOOK|WB_TABSTOP; if (bDropdown) nWinBits |= WB_DROPDOWN; @@ -1461,7 +1446,7 @@ FontStyleBox::FontStyleBox( Window* pParent, WinBits nBits ) : extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeFontStyleBox(Window *pParent, VclBuilder::stringmap &rMap) { - bool bDropdown = extractDropdown(rMap); + bool bDropdown = VclBuilder::extractDropdown(rMap); WinBits nWinBits = WB_LEFT|WB_VCENTER|WB_3DLOOK|WB_TABSTOP; if (bDropdown) nWinBits |= WB_DROPDOWN; @@ -1681,7 +1666,7 @@ FontSizeBox::FontSizeBox( Window* pParent, const ResId& rResId ) : extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeFontSizeBox(Window *pParent, VclBuilder::stringmap &rMap) { - bool bDropdown = extractDropdown(rMap); + bool bDropdown = VclBuilder::extractDropdown(rMap); WinBits nWinBits = WB_LEFT|WB_VCENTER|WB_3DLOOK|WB_TABSTOP; if (bDropdown) nWinBits |= WB_DROPDOWN; |