diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2022-12-15 20:45:53 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2022-12-16 20:17:17 +0000 |
commit | f1b7a69b280aefe2f1b3b0f32193494fd765f2bd (patch) | |
tree | 431f5ca3f31439b56bbac7b53b2d69f2ee6a218c /svx | |
parent | 32ba2102526a663440957a16e0ebee89bea9f603 (diff) |
loplugin:unocast (SvxLineStyleToolBoxControl)
(See the upcoming commit introducing that loplugin:unocast on why such
dynamic_casts from UNO types are dangerous.)
Change-Id: I13f71f717a8661e0889ab7acf6fe7c7ebbe3dbe6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144332
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/sidebar/line/LinePropertyPanelBase.cxx | 3 | ||||
-rw-r--r-- | svx/source/tbxctrls/linectrl.cxx | 13 |
2 files changed, 14 insertions, 2 deletions
diff --git a/svx/source/sidebar/line/LinePropertyPanelBase.cxx b/svx/source/sidebar/line/LinePropertyPanelBase.cxx index 454e16a335f8..d04b16103e6b 100644 --- a/svx/source/sidebar/line/LinePropertyPanelBase.cxx +++ b/svx/source/sidebar/line/LinePropertyPanelBase.cxx @@ -18,6 +18,7 @@ */ #include <memory> +#include <comphelper/servicehelper.hxx> #include <svx/sidebar/LinePropertyPanelBase.hxx> #include <sfx2/weldutils.hxx> #include <svx/linectrl.hxx> @@ -57,7 +58,7 @@ namespace SvxLineStyleToolBoxControl* getLineStyleToolBoxControl(const ToolbarUnoDispatcher& rToolBoxColor) { css::uno::Reference<css::frame::XToolbarController> xController = rToolBoxColor.GetControllerForCommand(".uno:XLineStyle"); - SvxLineStyleToolBoxControl* pToolBoxLineStyleControl = dynamic_cast<SvxLineStyleToolBoxControl*>(xController.get()); + SvxLineStyleToolBoxControl* pToolBoxLineStyleControl = comphelper::getFromUnoTunnel<SvxLineStyleToolBoxControl>(xController); return pToolBoxLineStyleControl; } } diff --git a/svx/source/tbxctrls/linectrl.cxx b/svx/source/tbxctrls/linectrl.cxx index 81f064fc78f4..b75fee2d88b0 100644 --- a/svx/source/tbxctrls/linectrl.cxx +++ b/svx/source/tbxctrls/linectrl.cxx @@ -48,6 +48,7 @@ #include <comphelper/lok.hxx> #include <comphelper/propertyvalue.hxx> +#include <comphelper/servicehelper.hxx> using namespace ::com::sun::star::uno; using namespace ::com::sun::star::beans; @@ -60,7 +61,7 @@ using namespace ::com::sun::star; #define MAX_LINES 12 SvxLineStyleToolBoxControl::SvxLineStyleToolBoxControl( const css::uno::Reference<css::uno::XComponentContext>& rContext ) - : svt::PopupWindowController( rContext, nullptr, OUString() ) + : ImplInheritanceHelper( rContext, nullptr, OUString() ) { addStatusListener(".uno:LineDash"); } @@ -217,6 +218,16 @@ css::uno::Sequence<OUString> SvxLineStyleToolBoxControl::getSupportedServiceName return { "com.sun.star.frame.ToolbarController" }; } +sal_Int64 SvxLineStyleToolBoxControl::getSomething(css::uno::Sequence<sal_Int8> const & aIdentifier) +{ + return comphelper::getSomethingImpl(aIdentifier, this); +} + +css::uno::Sequence<sal_Int8> const & SvxLineStyleToolBoxControl::getUnoTunnelId() { + static comphelper::UnoIdInit const id; + return id.getSeq(); +} + extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * com_sun_star_comp_svx_LineStyleToolBoxControl_get_implementation( css::uno::XComponentContext* rContext, |