From a4a2cfa1bf746a4c1d379757c99d35ef5ac42cd3 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Sun, 15 Sep 2024 19:06:40 +0200 Subject: [PATCH] use more concrete UNO types in reportdesign Change-Id: I688cbfe44cebd95e2321d3b75a2ee397cc4aa4f8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173410 Tested-by: Jenkins Reviewed-by: Noel Grandin --- .../source/core/api/ReportDefinition.cxx | 19 ++++++++++--------- reportdesign/source/core/inc/Group.hxx | 4 +++- .../source/ui/inc/DataProviderHandler.hxx | 7 +++---- .../source/ui/inc/ReportController.hxx | 3 ++- 4 files changed, 18 insertions(+), 15 deletions(-) diff --git a/reportdesign/source/core/api/ReportDefinition.cxx b/reportdesign/source/core/api/ReportDefinition.cxx index 81f71af56127..0c5c5d91bca5 100644 --- a/reportdesign/source/core/api/ReportDefinition.cxx +++ b/reportdesign/source/core/api/ReportDefinition.cxx @@ -450,6 +450,8 @@ uno::Sequence< uno::Any > SAL_CALL OStyle::getPropertyDefaults( const uno::Seque return aRet; } +namespace { class OStylesHelper; } + struct OReportDefinitionImpl { uno::WeakReference< uno::XInterface > m_xParent; @@ -461,7 +463,7 @@ struct OReportDefinitionImpl ::std::vector< uno::Reference< frame::XController> > m_aControllers; uno::Sequence< beans::PropertyValue > m_aArgs; - uno::Reference< report::XGroups > m_xGroups; + rtl::Reference< OGroups > m_xGroups; uno::Reference< report::XSection> m_xReportHeader; uno::Reference< report::XSection> m_xReportFooter; uno::Reference< report::XSection> m_xPageHeader; @@ -470,7 +472,7 @@ struct OReportDefinitionImpl uno::Reference< embed::XStorage > m_xStorage; uno::Reference< frame::XController > m_xCurrentController; uno::Reference< container::XIndexAccess > m_xViewData; - uno::Reference< container::XNameAccess > m_xStyles; + rtl::Reference< OStylesHelper > m_xStyles; uno::Reference< container::XNameAccess> m_xXMLNamespaceMap; uno::Reference< container::XNameAccess> m_xGradientTable; uno::Reference< container::XNameAccess> m_xHatchTable; @@ -478,12 +480,12 @@ struct OReportDefinitionImpl uno::Reference< container::XNameAccess> m_xTransparencyGradientTable; uno::Reference< container::XNameAccess> m_xDashTable; uno::Reference< container::XNameAccess> m_xMarkerTable; - uno::Reference< report::XFunctions > m_xFunctions; + rtl::Reference< OFunctions > m_xFunctions; uno::Reference< ui::XUIConfigurationManager2> m_xUIConfigurationManager; uno::Reference< util::XNumberFormatsSupplier> m_xNumberFormatsSupplier; uno::Reference< sdbc::XConnection> m_xActiveConnection; - uno::Reference< frame::XTitle > m_xTitleHelper; - uno::Reference< frame::XUntitledNumbers > m_xNumberedControllers; + rtl::Reference< ::framework::TitleHelper > m_xTitleHelper; + rtl::Reference< ::comphelper::NumberedCollection > m_xNumberedControllers; uno::Reference< document::XDocumentProperties > m_xDocumentProperties; std::shared_ptr< ::comphelper::EmbeddedObjectContainer> @@ -2359,20 +2361,19 @@ uno::Reference< container::XNameAccess > SAL_CALL OReportDefinition::getStyleFam if ( !m_pImpl->m_xStyles.is() ) { m_pImpl->m_xStyles = new OStylesHelper(); - uno::Reference< container::XNameContainer> xStyles(m_pImpl->m_xStyles,uno::UNO_QUERY); uno::Reference< container::XNameContainer> xPageStyles = new OStylesHelper(cppu::UnoType::get()); - xStyles->insertByName(u"PageStyles"_ustr,uno::Any(xPageStyles)); + m_pImpl->m_xStyles->insertByName(u"PageStyles"_ustr,uno::Any(xPageStyles)); uno::Reference< style::XStyle> xPageStyle(createInstance(u"com.sun.star.style.PageStyle"_ustr),uno::UNO_QUERY); xPageStyles->insertByName(xPageStyle->getName(),uno::Any(xPageStyle)); uno::Reference< container::XNameContainer> xFrameStyles = new OStylesHelper(cppu::UnoType::get()); - xStyles->insertByName(u"FrameStyles"_ustr,uno::Any(xFrameStyles)); + m_pImpl->m_xStyles->insertByName(u"FrameStyles"_ustr,uno::Any(xFrameStyles)); uno::Reference< style::XStyle> xFrameStyle(createInstance(u"com.sun.star.style.FrameStyle"_ustr),uno::UNO_QUERY); xFrameStyles->insertByName(xFrameStyle->getName(),uno::Any(xFrameStyle)); uno::Reference< container::XNameContainer> xGraphicStyles = new OStylesHelper(cppu::UnoType::get()); - xStyles->insertByName(u"graphics"_ustr,uno::Any(xGraphicStyles)); + m_pImpl->m_xStyles->insertByName(u"graphics"_ustr,uno::Any(xGraphicStyles)); uno::Reference< style::XStyle> xGraphicStyle(createInstance(u"com.sun.star.style.GraphicStyle"_ustr),uno::UNO_QUERY); xGraphicStyles->insertByName(xGraphicStyle->getName(),uno::Any(xGraphicStyle)); } diff --git a/reportdesign/source/core/inc/Group.hxx b/reportdesign/source/core/inc/Group.hxx index a30debf41d49..681e24a0f459 100644 --- a/reportdesign/source/core/inc/Group.hxx +++ b/reportdesign/source/core/inc/Group.hxx @@ -27,9 +27,11 @@ #include #include #include +#include namespace reportdesign { + class OFunctions; typedef ::cppu::WeakComponentImplHelper< css::report::XGroup , css::lang::XServiceInfo> GroupBase; typedef ::cppu::PropertySetMixin< css::report::XGroup> GroupPropertySet; @@ -46,7 +48,7 @@ namespace reportdesign css::uno::WeakReference< css::report::XGroups > m_xParent; css::uno::Reference< css::report::XSection> m_xHeader; css::uno::Reference< css::report::XSection> m_xFooter; - css::uno::Reference< css::report::XFunctions > m_xFunctions; + rtl::Reference< OFunctions > m_xFunctions; ::rptshared::GroupProperties m_aProps; private: diff --git a/reportdesign/source/ui/inc/DataProviderHandler.hxx b/reportdesign/source/ui/inc/DataProviderHandler.hxx index 1af9a1ed2181..ed2489bd15f3 100644 --- a/reportdesign/source/ui/inc/DataProviderHandler.hxx +++ b/reportdesign/source/ui/inc/DataProviderHandler.hxx @@ -32,12 +32,11 @@ #include #include #include - +#include namespace rptui { - - + class OPropertyMediator; class OPropertyInfoService; typedef ::cppu::WeakComponentImplHelper< css::inspection::XPropertyHandler @@ -101,7 +100,7 @@ namespace rptui css::uno::Reference< css::uno::XInterface > m_xFormComponent; /// inspectee css::uno::Reference< css::report::XReportComponent > m_xReportComponent; /// inspectee css::uno::Reference< css::chart2::XChartDocument> m_xChartModel; - css::uno::Reference< css::beans::XPropertyChangeListener > m_xMasterDetails; + rtl::Reference< OPropertyMediator > m_xMasterDetails; /// type converter, needed on various occasions css::uno::Reference< css::script::XTypeConverter > m_xTypeConverter; }; diff --git a/reportdesign/source/ui/inc/ReportController.hxx b/reportdesign/source/ui/inc/ReportController.hxx index fe73fe278242..c7ae40f047e4 100644 --- a/reportdesign/source/ui/inc/ReportController.hxx +++ b/reportdesign/source/ui/inc/ReportController.hxx @@ -61,6 +61,7 @@ namespace rptui class OSectionView; class OAddFieldWindow; class OSectionWindow; + class OPropertyMediator; typedef ::dbaui::DBSubComponentController OReportController_BASE; typedef ::cppu::ImplHelper5 < css::container::XContainerListener @@ -94,7 +95,7 @@ namespace rptui css::uno::Reference< css::report::XReportEngine > m_xReportEngine; css::uno::Reference< css::frame::XDesktop2 > m_xFrameLoader; css::uno::Reference< css::sdbc::XRowSet > m_xRowSet; - css::uno::Reference< css::beans::XPropertyChangeListener > m_xRowSetMediator; + rtl::Reference< OPropertyMediator > m_xRowSetMediator; css::uno::Reference< css::util::XNumberFormatter > m_xFormatter; // a number formatter working with the report's NumberFormatsSupplier mutable css::uno::Reference< css::lang::XComponent > m_xHoldAlive; mutable css::uno::Reference< css::container::XNameAccess > m_xColumns;