[Libreoffice-commits] core.git: vcl/source

Jan Holesovsky kendy at collabora.com
Fri Feb 7 05:25:29 PST 2014


 vcl/source/window/builder.cxx |   14 ++++++++++++++
 1 file changed, 14 insertions(+)

New commits:
commit 6cc8693cb28ab7e2a7d6fa474e25c6b6bff36ff5
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Fri Feb 7 14:24:19 2014 +0100

    vclbuilder: Honor the "visible" flag of toolbar items.
    
    Change-Id: Iaf58462cbc700b48f693ca60c0a4242a73b290eb

diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index de88c5b..fd3e6a4 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -724,6 +724,17 @@ namespace
         return sActionName;
     }
 
+    bool extractVisible(VclBuilder::stringmap &rMap)
+    {
+        OString sActionName;
+        VclBuilder::stringmap::iterator aFind = rMap.find(OString("visible"));
+        if (aFind != rMap.end())
+        {
+            return toBool(aFind->second);
+        }
+        return false;
+    }
+
     Size extractSizeRequest(VclBuilder::stringmap &rMap)
     {
         OString sWidthRequest("0");
@@ -1512,6 +1523,9 @@ Window *VclBuilder::makeObject(Window *pParent, const OString &name, const OStri
             if (!sIconName.isEmpty())
                 pToolBox->SetItemImage(nItemId, FixedImage::loadThemeImage(sIconName));
 
+            if (!extractVisible(rMap))
+                pToolBox->HideItem(nItemId);
+
             return NULL; // no widget to be created
         }
     }


More information about the Libreoffice-commits mailing list