chart2/inc/ChartModel.hxx                                         |    3 +-
 chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx |    4 +--
 chart2/source/controller/inc/ChartDocumentWrapper.hxx             |    2 -
 chart2/source/inc/servicenames.hxx                                |    6 -----
 chart2/source/model/main/ChartModel.cxx                           |   11 
++--------
 5 files changed, 7 insertions(+), 19 deletions(-)

New commits:
commit b144cc2fe1d6fef2ac6ea99c5c17eef0b167e88a
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Sun Jun 15 20:13:52 2025 +0200
Commit:     Noel Grandin <noelgran...@gmail.com>
CommitDate: Tue Jun 17 09:58:22 2025 +0200

    use more concrete UNO class
    
    Change-Id: Id6616fac101cdcad0c7330b948e209c3905d993d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186590
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/chart2/inc/ChartModel.hxx b/chart2/inc/ChartModel.hxx
index 36972c4b1acc..eff3647a8640 100644
--- a/chart2/inc/ChartModel.hxx
+++ b/chart2/inc/ChartModel.hxx
@@ -85,6 +85,7 @@ class Title;
 class BaseCoordinateSystem;
 class DataSeries;
 class ChartType;
+namespace wrapper { class ChartDocumentWrapper; }
 
 namespace impl
 {
@@ -149,7 +150,7 @@ private:
     sal_uInt16                                         m_nControllerLockCount;
 
     css::uno::Reference< css::uno::XComponentContext > m_xContext;
-    css::uno::Reference< css::uno::XAggregation >      m_xOldModelAgg;
+    rtl::Reference< wrapper::ChartDocumentWrapper >    m_xOldModelAgg;
 
     css::uno::Reference< css::embed::XStorage >        m_xStorage;
     //the content of this should be always synchronized with the current 
m_xViewWindow size. The variable is necessary to hold the information as long 
as no view window exists.
diff --git a/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx 
b/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx
index 0450207e3255..2bbff1f3c293 100644
--- a/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx
@@ -1410,7 +1410,7 @@ std::vector< std::unique_ptr<WrappedProperty> > 
ChartDocumentWrapper::createWrap
 
 OUString SAL_CALL ChartDocumentWrapper::getImplementationName()
 {
-    return CHART_CHARTAPIWRAPPER_IMPLEMENTATION_NAME;
+    return u"com.sun.star.comp.chart2.ChartDocumentWrapper"_ustr;
 }
 
 sal_Bool SAL_CALL ChartDocumentWrapper::supportsService( const OUString& 
rServiceName )
@@ -1422,7 +1422,7 @@ css::uno::Sequence< OUString > SAL_CALL 
ChartDocumentWrapper::getSupportedServic
 {
     return {
         u"com.sun.star.chart.ChartDocument"_ustr,
-        CHART_CHARTAPIWRAPPER_SERVICE_NAME,
+        u"com.sun.star.chart2.ChartDocumentWrapper"_ustr,
         u"com.sun.star.xml.UserDefinedAttributesSupplier"_ustr,
         u"com.sun.star.beans.PropertySet"_ustr
     };
diff --git a/chart2/source/controller/inc/ChartDocumentWrapper.hxx 
b/chart2/source/controller/inc/ChartDocumentWrapper.hxx
index e06c2db0353b..5957a7e2942f 100644
--- a/chart2/source/controller/inc/ChartDocumentWrapper.hxx
+++ b/chart2/source/controller/inc/ChartDocumentWrapper.hxx
@@ -78,8 +78,6 @@ public:
     /// @throws css::uno::RuntimeException
     rtl::Reference<SvxDrawPage> impl_getDrawPage() const;
 
-protected:
-
     // ____ chart::XChartDocument ____
     virtual css::uno::Reference< css::drawing::XShape > SAL_CALL getTitle() 
override;
     virtual css::uno::Reference< css::drawing::XShape > SAL_CALL getSubTitle() 
override;
diff --git a/chart2/source/inc/servicenames.hxx 
b/chart2/source/inc/servicenames.hxx
index 0f5cbe2b40f9..6c28cc0a77dc 100644
--- a/chart2/source/inc/servicenames.hxx
+++ b/chart2/source/inc/servicenames.hxx
@@ -44,10 +44,4 @@ inline constexpr OUString 
CHART_TYPE_DIALOG_SERVICE_IMPLEMENTATION_NAME
 inline constexpr OUString CHART_TYPE_DIALOG_SERVICE_NAME
     = u"com.sun.star.chart2.ChartTypeDialog"_ustr;
 
-// wrapper for old UNO API (com.sun.star.chart)
-inline constexpr OUString CHART_CHARTAPIWRAPPER_IMPLEMENTATION_NAME
-    = u"com.sun.star.comp.chart2.ChartDocumentWrapper"_ustr;
-inline constexpr OUString CHART_CHARTAPIWRAPPER_SERVICE_NAME
-    = u"com.sun.star.chart2.ChartDocumentWrapper"_ustr;
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/model/main/ChartModel.cxx 
b/chart2/source/model/main/ChartModel.cxx
index 976a81dd1e1e..ffc9979cbd7f 100644
--- a/chart2/source/model/main/ChartModel.cxx
+++ b/chart2/source/model/main/ChartModel.cxx
@@ -40,6 +40,7 @@
 #include <ModifyListenerHelper.hxx>
 #include <RangeHighlighter.hxx>
 #include <Diagram.hxx>
+#include <ChartDocumentWrapper.hxx>
 #include <comphelper/dumpxmltostring.hxx>
 
 #include <com/sun/star/chart/ChartDataRowSource.hpp>
@@ -131,10 +132,7 @@ 
ChartModel::ChartModel(uno::Reference<uno::XComponentContext > xContext)
 {
     osl_atomic_increment(&m_refCount);
     {
-        m_xOldModelAgg.set(
-            m_xContext->getServiceManager()->createInstanceWithContext(
-            CHART_CHARTAPIWRAPPER_SERVICE_NAME,
-            m_xContext ), uno::UNO_QUERY_THROW );
+        m_xOldModelAgg = new wrapper::ChartDocumentWrapper(m_xContext);
         m_xOldModelAgg->setDelegator( *this );
     }
 
@@ -175,10 +173,7 @@ ChartModel::ChartModel( const ChartModel & rOther )
 {
     osl_atomic_increment(&m_refCount);
     {
-        m_xOldModelAgg.set(
-            m_xContext->getServiceManager()->createInstanceWithContext(
-            CHART_CHARTAPIWRAPPER_SERVICE_NAME,
-            m_xContext ), uno::UNO_QUERY_THROW );
+        m_xOldModelAgg = new wrapper::ChartDocumentWrapper(m_xContext);
         m_xOldModelAgg->setDelegator( *this );
 
         Reference< util::XModifyListener > xListener;

Reply via email to