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

Szymon Kłos eszkadev at gmail.com
Sun Apr 9 12:05:37 UTC 2017


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

New commits:
commit 678dfeefa1daf3b6b28e8a0721069c294a53dfd0
Author: Szymon Kłos <eszkadev at gmail.com>
Date:   Sun Apr 9 11:31:47 2017 +0200

    Notebookbar: warn if priority is set for unsupported item
    
    Change-Id: I9d8e5aa64f7330f55b703b9ef0aaa5fec6ad611d
    Reviewed-on: https://gerrit.libreoffice.org/36314
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Szymon Kłos <eszkadev at gmail.com>

diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index 859d80340a84..2fb3299d2a05 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -2906,9 +2906,19 @@ VclPtr<vcl::Window> VclBuilder::handleObject(vcl::Window *pParent, xmlreader::Xm
                 int nPriority = 0;
                 std::vector<vcl::EnumContext::Context> aContext = handleStyle(reader, nPriority);
                 if (nPriority != 0)
-                    dynamic_cast<vcl::IPrioritable*>(pCurrentChild.get())->SetPriority(nPriority);
+                {
+                    vcl::IPrioritable* pPrioritable = dynamic_cast<vcl::IPrioritable*>(pCurrentChild.get());
+                    SAL_WARN_IF(!pPrioritable, "vcl", "priority set for not supported item");
+                    if (pPrioritable)
+                        pPrioritable->SetPriority(nPriority);
+                }
                 if (aContext.size() != 0)
-                    dynamic_cast<vcl::IContext*>(pCurrentChild.get())->SetContext(aContext);
+                {
+                    vcl::IContext* pContextControl = dynamic_cast<vcl::IContext*>(pCurrentChild.get());
+                    SAL_WARN_IF(!pContextControl, "vcl", "context set for not supported item");
+                    if (pContextControl)
+                        pContextControl->SetContext(aContext);
+                }
             }
             else
             {


More information about the Libreoffice-commits mailing list