Fix some toolkit UnoControlBase derivates' queryAggregation

The base UnoControl uses WeakAggImplHelper9, so (for better or worse) derives
from XAggregation, but UnoGridControl, UnoRoadmapControl, and UnoTreeControl all
failed to properly implement the XAggregation protocol.

Change-Id: Ia1676782e616216f645dc86ba978c2f5887dc508
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145767
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
This commit is contained in:
Stephan Bergmann 2023-01-19 09:42:08 +01:00
parent ede696562a
commit 579d144290
4 changed files with 15 additions and 6 deletions

View file

@ -168,7 +168,9 @@ namespace toolkit
// XTypeProvider
DECLARE_XTYPEPROVIDER( )
DECLARE_XINTERFACE()
DECLARE_UNO3_AGG_DEFAULTS(UnoRoadmapControl, UnoControlRoadmap_Base)
css::uno::Any SAL_CALL queryAggregation(css::uno::Type const & aType) override;
// css::lang::XServiceInfo
OUString SAL_CALL getImplementationName() override;

View file

@ -25,7 +25,7 @@
#include <toolkit/controls/unocontrolbase.hxx>
#include <toolkit/controls/unocontrolmodel.hxx>
#include <cppuhelper/implbase.hxx>
#include <cppuhelper/implbase2.hxx>
#include <toolkit/helper/listenermultiplexer.hxx>
#include <memory>
@ -78,7 +78,7 @@ public:
// = UnoGridControl
typedef ::cppu::ImplInheritanceHelper < UnoControlBase
typedef ::cppu::AggImplInheritanceHelper2 < UnoControlBase
, css::awt::grid::XGridControl
, css::awt::grid::XGridRowSelection
> UnoGridControl_Base;

View file

@ -362,7 +362,14 @@ static void lcl_throwIndexOutOfBoundsException( )
}
IMPLEMENT_FORWARD_XTYPEPROVIDER2( UnoRoadmapControl, UnoControlRoadmap_Base, UnoControlRoadmap_IBase )
IMPLEMENT_FORWARD_XINTERFACE2( UnoRoadmapControl, UnoControlRoadmap_Base, UnoControlRoadmap_IBase )
css::uno::Any UnoRoadmapControl::queryAggregation(css::uno::Type const & aType) {
auto ret = UnoControlRoadmap_Base::queryAggregation(aType);
if (!ret.hasValue()) {
ret = UnoControlRoadmap_IBase::queryInterface(aType);
}
return ret;
}
sal_Bool SAL_CALL UnoRoadmapControl::setModel(const Reference< XControlModel >& _rModel)

View file

@ -27,7 +27,7 @@
#include <toolkit/controls/unocontrolbase.hxx>
#include <toolkit/helper/property.hxx>
#include <osl/diagnose.h>
#include <cppuhelper/implbase.hxx>
#include <cppuhelper/implbase1.hxx>
#include <helper/unopropertyarrayhelper.hxx>
@ -120,7 +120,7 @@ Reference< XPropertySetInfo > UnoTreeModel::getPropertySetInfo( )
namespace {
typedef ::cppu::ImplInheritanceHelper< UnoControlBase, css::awt::tree::XTreeControl > UnoTreeControl_Base;
typedef ::cppu::AggImplInheritanceHelper1< UnoControlBase, css::awt::tree::XTreeControl > UnoTreeControl_Base;
class UnoTreeControl : public UnoTreeControl_Base
{
public: