chart2/source/controller/chartapiwrapper/WrappedStatisticProperties.cxx |    7 
+-
 chart2/source/inc/ColorPerPointHelper.hxx                               |    6 
+-
 chart2/source/tools/ColorPerPointHelper.cxx                             |   24 
+++++-----
 3 files changed, 21 insertions(+), 16 deletions(-)

New commits:
commit 98a23169bf761825d0e6ed432632d71dee5a691f
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Wed Mar 29 10:13:33 2023 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Wed Mar 29 16:20:42 2023 +0000

    use more concrete types in chart2
    
    Change-Id: I932d8a45d525b1b629a0aaee96a1643b155069f6
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149692
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/chart2/source/inc/ColorPerPointHelper.hxx 
b/chart2/source/inc/ColorPerPointHelper.hxx
index f1665123b800..43a8d56802ca 100644
--- a/chart2/source/inc/ColorPerPointHelper.hxx
+++ b/chart2/source/inc/ColorPerPointHelper.hxx
@@ -20,18 +20,20 @@
 #pragma once
 
 #include "charttoolsdllapi.hxx"
+#include <rtl/ref.hxx>
 
 namespace com::sun::star::beans { class XPropertySet; }
 namespace com::sun::star::uno { template <class interface_type> class 
Reference; }
 
 namespace chart
 {
+class DataSeries;
 
 class OOO_DLLPUBLIC_CHARTTOOLS ColorPerPointHelper
 {
 public:
     static bool hasPointOwnColor(
-        const css::uno::Reference< css::beans::XPropertySet >& 
xDataSeriesProperties
+        const rtl::Reference< ::chart::DataSeries >& xDataSeries
         , sal_Int32 nPointIndex
         , const css::uno::Reference< css::beans::XPropertySet >& 
xDataPointProperties //may be NULL this is just for performance
          );
@@ -39,7 +41,7 @@ public:
     // returns true if AttributedDataPoints contains nPointIndex and the
     // property Color is DEFAULT
     SAL_DLLPRIVATE static bool hasPointOwnProperties(
-        const css::uno::Reference< css::beans::XPropertySet >& 
xSeriesProperties
+        const rtl::Reference< ::chart::DataSeries >& xDataSeries
         , sal_Int32 nPointIndex );
 };
 
diff --git a/chart2/source/tools/ColorPerPointHelper.cxx 
b/chart2/source/tools/ColorPerPointHelper.cxx
index 34aeb7866021..04cc09cb44ec 100644
--- a/chart2/source/tools/ColorPerPointHelper.cxx
+++ b/chart2/source/tools/ColorPerPointHelper.cxx
@@ -18,33 +18,35 @@
  */
 
 #include <ColorPerPointHelper.hxx>
+#include <DataSeries.hxx>
+#include <DataSeriesProperties.hxx>
 #include <com/sun/star/chart2/XDataSeries.hpp>
 #include <com/sun/star/beans/XPropertyState.hpp>
 
 #include <algorithm>
 
-namespace chart
-{
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::chart2;
+using namespace ::chart::DataSeriesProperties;
+
+namespace chart
+{
 
 bool ColorPerPointHelper::hasPointOwnColor(
-        const css::uno::Reference< css::beans::XPropertySet >& 
xDataSeriesProperties
+        const rtl::Reference< DataSeries >& xDataSeries
         , sal_Int32 nPointIndex
         , const css::uno::Reference< css::beans::XPropertySet >& 
xDataPointProperties //may be NULL this is just for performance
          )
 {
-    if( !xDataSeriesProperties.is() )
+    if( !xDataSeries.is() )
         return false;
 
-    if( hasPointOwnProperties( xDataSeriesProperties, nPointIndex ))
+    if( hasPointOwnProperties( xDataSeries, nPointIndex ))
     {
         uno::Reference< beans::XPropertyState > xPointState( 
xDataPointProperties, uno::UNO_QUERY );
         if( !xPointState.is() )
         {
-            uno::Reference< XDataSeries > xSeries( xDataSeriesProperties, 
uno::UNO_QUERY );
-            if(xSeries.is())
-                xPointState.set( xSeries->getDataPointByIndex( nPointIndex ), 
uno::UNO_QUERY );
+            xPointState.set( xDataSeries->getDataPointByIndex( nPointIndex ), 
uno::UNO_QUERY );
         }
         if( !xPointState.is() )
             return false;
@@ -56,13 +58,13 @@ bool ColorPerPointHelper::hasPointOwnColor(
 }
 
 bool ColorPerPointHelper::hasPointOwnProperties(
-    const css::uno::Reference< css::beans::XPropertySet >& xSeriesProperties
+    const rtl::Reference< ::chart::DataSeries >& xDataSeries
     , sal_Int32 nPointIndex )
 {
-    if( xSeriesProperties.is() )
+    if( xDataSeries.is() )
     {
         uno::Sequence< sal_Int32 > aIndexList;
-        if( xSeriesProperties->getPropertyValue( "AttributedDataPoints" ) >>= 
aIndexList )
+        if( xDataSeries->getFastPropertyValue( 
PROP_DATASERIES_ATTRIBUTED_DATA_POINTS ) >>= aIndexList ) // 
"AttributedDataPoints"
         {
             const sal_Int32 * pBegIt = aIndexList.getConstArray();
             const sal_Int32 * pEndIt = pBegIt + aIndexList.getLength();
commit 2714b18cbaefb13131ae63396297cd57b564a3af
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Wed Mar 29 14:45:12 2023 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Wed Mar 29 16:20:28 2023 +0000

    fix bug in WrappedRegressionCurvesProperty::setValueToSeries
    
    ever since
        commit 1cd3e2038010cb37bda82d38dd058b793b7eec26
        Author: Tomaž Vajngerl <qui...@gmail.com>
        Date:   Sat Jun 29 18:43:16 2013 +0200
        Multiple trendline removing and changing type support.
    
    Change-Id: Ibd24d0831932f25e60c05a00450d611e15875102
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149691
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git 
a/chart2/source/controller/chartapiwrapper/WrappedStatisticProperties.cxx 
b/chart2/source/controller/chartapiwrapper/WrappedStatisticProperties.cxx
index 2de01cc8b966..a50ac7527c76 100644
--- a/chart2/source/controller/chartapiwrapper/WrappedStatisticProperties.cxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedStatisticProperties.cxx
@@ -840,9 +840,10 @@ css::chart::ChartRegressionCurveType 
WrappedRegressionCurvesProperty::getValueFr
 void WrappedRegressionCurvesProperty::setValueToSeries( const Reference< 
beans::XPropertySet >& xSeriesPropertySet, const 
css::chart::ChartRegressionCurveType& aNewValue ) const
 {
     uno::Reference< chart2::XRegressionCurveContainer > 
xRegressionCurveContainer( xSeriesPropertySet, uno::UNO_QUERY );
-    uno::Reference< chart2::XRegressionCurve > xRegressionCurve( 
xSeriesPropertySet, uno::UNO_QUERY );
-
-    if( xRegressionCurveContainer.is() && xRegressionCurve.is() )
+    if (!xRegressionCurveContainer)
+        return;
+    rtl::Reference< ::chart::RegressionCurveModel> xRegressionCurve = 
RegressionCurveHelper::getFirstCurveNotMeanValueLine( xRegressionCurveContainer 
);
+    if( xRegressionCurve.is() )
     {
         SvxChartRegress eNewRegressionType = lcl_getRegressionType( aNewValue 
);
 

Reply via email to