diff options
author | Szymon Kłos <eszkadev@gmail.com> | 2017-04-09 11:31:47 +0200 |
---|---|---|
committer | Szymon Kłos <eszkadev@gmail.com> | 2017-04-09 14:05:15 +0200 |
commit | 678dfeefa1daf3b6b28e8a0721069c294a53dfd0 (patch) | |
tree | 37b49866553c01452dcb83f1dc8fc1fba83c427c /vcl | |
parent | 82a25b754b0900d313ca24d9283ae6398dc66d18 (diff) |
Notebookbar: warn if priority is set for unsupported item
Change-Id: I9d8e5aa64f7330f55b703b9ef0aaa5fec6ad611d
Reviewed-on: https://gerrit.libreoffice.org/36314
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Szymon Kłos <eszkadev@gmail.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/window/builder.cxx | 14 |
1 files changed, 12 insertions, 2 deletions
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 { |