summaryrefslogtreecommitdiff
path: root/starmath
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2022-12-13 09:30:25 +0100
committerStephan Bergmann <sbergman@redhat.com>2022-12-20 08:34:38 +0000
commitfeba0ddb1521d1142560fe54b7d7696ee910237f (patch)
treeb13dbee741b4a4708b74613be33feda3d1a75c30 /starmath
parentf6b4c3fb68f9b36e1e64fc4a4c680ab1bb7fb013 (diff)
loplugin:unocast (weld::TransportAsXWindow)
(See the upcoming commit introducing that loplugin:unocast on why such dynamic_casts from UNO types are dangerous.) On macOS, where we implicitly use -fvisibility-inlines-hidden-static-local-var since <https://github.com/llvm/llvm-project/commit/d46f2c51e4c849683434bb5a0fb6164957474b8f> "Make -fvisibility-inlines-hidden apply to static local variables in inline functions on Darwin", the static id local var in weld::TransportAsXWindow::getUnoTunnelId cannot be in an inline function implicitly hidden via -fvisibility-inlines-hidden. Explicitly marking the function as VCL_DLLPUBLIC would help, but would in turn cause MSVC error 2487 ("member of a dll interface class may not be declared with dll interface"). So just make the function non-inline in a new vcl/source/window/weldutils.cxx (which would arguably be the best approach for the whole class, anyway). Change-Id: Ib5615f6aae19346ea05b8b85ff77c0e5ea860994 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144331 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'starmath')
-rw-r--r--starmath/source/SmPanelFactory.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/starmath/source/SmPanelFactory.cxx b/starmath/source/SmPanelFactory.cxx
index df35dcadffbc..682e13295092 100644
--- a/starmath/source/SmPanelFactory.cxx
+++ b/starmath/source/SmPanelFactory.cxx
@@ -26,6 +26,7 @@
#include <cppuhelper/exc_hlp.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <comphelper/namedvaluecollection.hxx>
+#include <comphelper/servicehelper.hxx>
#include <sfx2/sidebar/SidebarPanelBase.hxx>
#include <vcl/weldutils.hxx>
@@ -69,7 +70,7 @@ css::uno::Reference<css::ui::XUIElement> SAL_CALL SmPanelFactory::createUIElemen
SfxBindings* pBindings = reinterpret_cast<SfxBindings*>(nBindingsValue);
weld::Widget* pParent(nullptr);
- if (auto pTunnel = dynamic_cast<weld::TransportAsXWindow*>(xParentWindow.get()))
+ if (auto pTunnel = comphelper::getFromUnoTunnel<weld::TransportAsXWindow>(xParentWindow))
pParent = pTunnel->getWidget();
if (!pParent)