diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-01-12 12:03:59 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-01-13 12:34:03 +0000 |
commit | ce4193e3398e30c25ec28310a8034b4ca5513d7a (patch) | |
tree | 1d7c840d7a09b4db9d6d10a05aef4019cd968426 | |
parent | 25d5e2041fb13aee61acb6ced579e884ce9a21b5 (diff) |
XUnoTunnel->dynamic_cast in SvxUnoNumberingRules
Change-Id: I492a951f1d686e1507232e6688c2dc75e8a41cc6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145463
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | editeng/source/uno/unonrule.cxx | 8 | ||||
-rw-r--r-- | include/editeng/unonrule.hxx | 10 |
2 files changed, 6 insertions, 12 deletions
diff --git a/editeng/source/uno/unonrule.cxx b/editeng/source/uno/unonrule.cxx index 5bd84cc10b42..04403cf19a69 100644 --- a/editeng/source/uno/unonrule.cxx +++ b/editeng/source/uno/unonrule.cxx @@ -89,8 +89,6 @@ static unsigned short ConvertUnoAdjust( SvxAdjust eAdjust ) return aSvxToUnoAdjust[eAdjust]; } -UNO3_GETIMPLEMENTATION_IMPL( SvxUnoNumberingRules ); - SvxUnoNumberingRules::SvxUnoNumberingRules(SvxNumRule aRule) : maRule(std::move( aRule )) { @@ -474,7 +472,7 @@ void SvxUnoNumberingRules::setNumberingRuleByIndex(const Sequence<beans::Propert const SvxNumRule& SvxGetNumRule( Reference< XIndexReplace > const & xRule ) { - SvxUnoNumberingRules* pRule = comphelper::getFromUnoTunnel<SvxUnoNumberingRules>( xRule ); + SvxUnoNumberingRules* pRule = dynamic_cast<SvxUnoNumberingRules*>( xRule.get() ); if( pRule == nullptr ) throw IllegalArgumentException(); @@ -510,10 +508,10 @@ sal_Int16 SvxUnoNumberingRules::Compare( const Any& Any1, const Any& Any2 ) if( x1.get() == x2.get() ) return 0; - SvxUnoNumberingRules* pRule1 = comphelper::getFromUnoTunnel<SvxUnoNumberingRules>( x1 ); + SvxUnoNumberingRules* pRule1 = dynamic_cast<SvxUnoNumberingRules*>( x1.get() ); if( !pRule1 ) return -1; - SvxUnoNumberingRules* pRule2 = comphelper::getFromUnoTunnel<SvxUnoNumberingRules>( x2 ); + SvxUnoNumberingRules* pRule2 = dynamic_cast<SvxUnoNumberingRules*>( x2.get() ); if( !pRule2 ) return -1; diff --git a/include/editeng/unonrule.hxx b/include/editeng/unonrule.hxx index d0e89ffdc33b..3e793877907d 100644 --- a/include/editeng/unonrule.hxx +++ b/include/editeng/unonrule.hxx @@ -23,12 +23,10 @@ #include <com/sun/star/container/XIndexReplace.hpp> #include <com/sun/star/ucb/XAnyCompare.hpp> #include <editeng/editengdllapi.h> -#include <cppuhelper/implbase5.hxx> -#include <com/sun/star/lang/XUnoTunnel.hpp> +#include <cppuhelper/implbase4.hxx> #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/util/XCloneable.hpp> #include <editeng/numitem.hxx> -#include <comphelper/servicehelper.hxx> namespace com::sun::star::beans { struct PropertyValue; } @@ -38,8 +36,8 @@ css::uno::Reference< css::container::XIndexReplace > SvxCreateNumRule(); const SvxNumRule& SvxGetNumRule( css::uno::Reference< css::container::XIndexReplace > const & xRule ); EDITENG_DLLPUBLIC css::uno::Reference< css::ucb::XAnyCompare > SvxCreateNumRuleCompare() noexcept; -class SvxUnoNumberingRules final : public ::cppu::WeakAggImplHelper5< css::container::XIndexReplace, css::ucb::XAnyCompare, - css::lang::XUnoTunnel, css::util::XCloneable, css::lang::XServiceInfo > +class SvxUnoNumberingRules final : public ::cppu::WeakAggImplHelper4< css::container::XIndexReplace, css::ucb::XAnyCompare, + css::util::XCloneable, css::lang::XServiceInfo > { private: SvxNumRule maRule; @@ -47,8 +45,6 @@ public: SvxUnoNumberingRules(SvxNumRule aRule); virtual ~SvxUnoNumberingRules() noexcept override; - UNO3_GETIMPLEMENTATION_DECL( SvxUnoNumberingRules ) - //XIndexReplace virtual void SAL_CALL replaceByIndex( sal_Int32 Index, const css::uno::Any& Element ) override; |