diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2022-12-13 09:30:25 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2022-12-20 08:34:38 +0000 |
commit | feba0ddb1521d1142560fe54b7d7696ee910237f (patch) | |
tree | b13dbee741b4a4708b74613be33feda3d1a75c30 /framework | |
parent | f6b4c3fb68f9b36e1e64fc4a4c680ab1bb7fb013 (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 'framework')
-rw-r--r-- | framework/source/uielement/toolbarwrapper.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/framework/source/uielement/toolbarwrapper.cxx b/framework/source/uielement/toolbarwrapper.cxx index 8f3937ef094f..33bf896b6f5a 100644 --- a/framework/source/uielement/toolbarwrapper.cxx +++ b/framework/source/uielement/toolbarwrapper.cxx @@ -24,6 +24,7 @@ #include <com/sun/star/ui/UIElementType.hpp> #include <com/sun/star/lang/DisposedException.hpp> +#include <comphelper/servicehelper.hxx> #include <toolkit/helper/vclunohelper.hxx> #include <vcl/svapp.hxx> @@ -153,7 +154,7 @@ void SAL_CALL ToolBarWrapper::initialize( const Sequence< Any >& aArguments ) m_xToolBarManager = pToolBarManager; pToolBar->WillUsePopupMode( bPopupMode ); } - else if (weld::TransportAsXWindow* pTunnel = dynamic_cast<weld::TransportAsXWindow*>(xParentWindow.get())) + else if (weld::TransportAsXWindow* pTunnel = comphelper::getFromUnoTunnel<weld::TransportAsXWindow>(xParentWindow)) { m_xBuilder = Application::CreateBuilder(pTunnel->getWidget(), "svt/ui/managedtoolbar.ui"); m_xTopLevel = m_xBuilder->weld_container("toolbarcontainer"); |