[Libreoffice-commits] .: Branch 'feature/cmclayouttrans' - vcl/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Wed Sep 19 02:14:32 PDT 2012
vcl/source/window/builder.cxx | 23 ++++++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)
New commits:
commit 324f939c6f2a9222ae5b6d7bf5410868a4841077
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Sep 19 10:14:00 2012 +0100
import inconsistent-state GtkCheckButtons as TriStateBoxs
Change-Id: If7fbe960bf5af31b51a7e454b8131c31b232a79b
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index 2d2405d..631b67e 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -214,6 +214,18 @@ namespace
return bVertical;
}
+ bool extractInconsistent(VclBuilder::stringmap &rMap)
+ {
+ bool bInconsistent = false;
+ VclBuilder::stringmap::iterator aFind = rMap.find(rtl::OString(RTL_CONSTASCII_STRINGPARAM("inconsistent")));
+ if (aFind != rMap.end())
+ {
+ bInconsistent = toBool(aFind->second);
+ rMap.erase(aFind);
+ }
+ return bInconsistent;
+ }
+
Window * extractStockAndBuildButton(Window *pParent, VclBuilder::stringmap &rMap)
{
WinBits nBits = WB_CENTER|WB_VCENTER|WB_3DLOOK;
@@ -436,7 +448,16 @@ Window *VclBuilder::makeObject(Window *pParent, const rtl::OString &name, const
pWindow = new RadioButton(pParent, WB_CENTER|WB_VCENTER|WB_3DLOOK);
}
else if (name.equalsL(RTL_CONSTASCII_STRINGPARAM("GtkCheckButton")))
- pWindow = new CheckBox(pParent, WB_CENTER|WB_VCENTER|WB_3DLOOK);
+ {
+ //maybe always import as TriStateBox and enable/disable tristate
+ bool bIsTriState = extractInconsistent(rMap);
+ CheckBox *pCheckBox = bIsTriState ?
+ new TriStateBox(pParent, WB_CENTER|WB_VCENTER|WB_3DLOOK) :
+ new CheckBox(pParent, WB_CENTER|WB_VCENTER|WB_3DLOOK);
+ if (bIsTriState)
+ pCheckBox->SetState(STATE_DONTKNOW);
+ pWindow = pCheckBox;
+ }
else if (name.equalsL(RTL_CONSTASCII_STRINGPARAM("GtkSpinButton")))
{
extractAdjustment(id, rMap);
More information about the Libreoffice-commits
mailing list