From 63ef3cf5bfa8b58e5ac9a645aea2f043599dc6d4 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Mon, 23 Jan 2023 19:16:22 +0100 Subject: Use ImplInheritanceHelper in OAccessibleTextHelper (Explicitly deleting the special member functions is needed to avoid MSVC > include\cppuhelper/implbase.hxx(152): error C2280: 'comphelper::OAccessibleExtendedComponentHelper::OAccessibleExtendedComponentHelper(comphelper::OAccessibleExtendedComponentHelper &&)': attempting to reference a deleted function > include\comphelper/accessiblecomponenthelper.hxx(220): note: see declaration of 'comphelper::OAccessibleExtendedComponentHelper::OAccessibleExtendedComponentHelper' > include\comphelper/accessiblecomponenthelper.hxx(220): note: 'comphelper::OAccessibleExtendedComponentHelper::OAccessibleExtendedComponentHelper(comphelper::OAccessibleExtendedComponentHelper &&)': function was explicitly deleted > include\comphelper/accessibletexthelper.hxx(133): note: see reference to function template instantiation 'cppu::ImplInheritanceHelper::ImplInheritanceHelper>(cppu::ImplInheritanceHelper &&)' being compiled > include\comphelper/accessibletexthelper.hxx(133): note: see reference to function template instantiation 'cppu::ImplInheritanceHelper::ImplInheritanceHelper>(cppu::ImplInheritanceHelper &&)' being compiled ) Change-Id: I00377be4a5fb44b2ef2b5001823ca0d89ead026b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146109 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- .../inc/standard/vclxaccessibletextcomponent.hxx | 1 + comphelper/source/misc/accessibletexthelper.cxx | 12 ----------- include/comphelper/accessibletexthelper.hxx | 24 ++++++++++------------ 3 files changed, 12 insertions(+), 25 deletions(-) diff --git a/accessibility/inc/standard/vclxaccessibletextcomponent.hxx b/accessibility/inc/standard/vclxaccessibletextcomponent.hxx index 205af38d5660..7bc47ac79679 100644 --- a/accessibility/inc/standard/vclxaccessibletextcomponent.hxx +++ b/accessibility/inc/standard/vclxaccessibletextcomponent.hxx @@ -22,6 +22,7 @@ #include #include #include +#include diff --git a/comphelper/source/misc/accessibletexthelper.cxx b/comphelper/source/misc/accessibletexthelper.cxx index cc7fa4cd3d15..da39ac1ce252 100644 --- a/comphelper/source/misc/accessibletexthelper.cxx +++ b/comphelper/source/misc/accessibletexthelper.cxx @@ -732,18 +732,6 @@ namespace comphelper } - // XInterface - - - IMPLEMENT_FORWARD_XINTERFACE2( OAccessibleTextHelper, OAccessibleExtendedComponentHelper, OAccessibleTextHelper_Base ) - - - // XTypeProvider - - - IMPLEMENT_FORWARD_XTYPEPROVIDER2( OAccessibleTextHelper, OAccessibleExtendedComponentHelper, OAccessibleTextHelper_Base ) - - // XAccessibleText diff --git a/include/comphelper/accessibletexthelper.hxx b/include/comphelper/accessibletexthelper.hxx index 607004aee30f..30730469be91 100644 --- a/include/comphelper/accessibletexthelper.hxx +++ b/include/comphelper/accessibletexthelper.hxx @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include namespace com::sun::star::i18n { class XBreakIterator; } @@ -111,26 +111,24 @@ namespace comphelper // OAccessibleTextHelper - typedef ::cppu::ImplHelper1 < css::accessibility::XAccessibleText - > OAccessibleTextHelper_Base; - /** a helper class for implementing an AccessibleExtendedComponent which at the same time supports an XAccessibleText interface */ - class COMPHELPER_DLLPUBLIC OAccessibleTextHelper : public OAccessibleExtendedComponentHelper, - public OCommonAccessibleText, - public OAccessibleTextHelper_Base + class COMPHELPER_DLLPUBLIC OAccessibleTextHelper : public cppu::ImplInheritanceHelper< + OAccessibleExtendedComponentHelper, + css::accessibility::XAccessibleText>, + public OCommonAccessibleText { + private: + OAccessibleTextHelper(OAccessibleTextHelper const &) = delete; + OAccessibleTextHelper(OAccessibleTextHelper &&) = delete; + void operator =(OAccessibleTextHelper const &) = delete; + void operator =(OAccessibleTextHelper &&) = delete; + protected: OAccessibleTextHelper(); public: - // XInterface - DECLARE_XINTERFACE( ) - - // XTypeProvider - DECLARE_XTYPEPROVIDER( ) - // XAccessibleText virtual OUString SAL_CALL getSelectedText() override; virtual sal_Int32 SAL_CALL getSelectionStart() override; -- cgit