[PATCH] fdo#51656 Mean value line starts in wrong place

Cao Cuong Ngo (via Code Review) gerrit at gerrit.libreoffice.org
Mon Apr 1 10:12:30 PDT 2013


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/3156

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/56/3156/1

fdo#51656 Mean value line starts in wrong place

In case of a mean value line, don't shift position.

Change-Id: I056423b3214e8f904202e6e6a3aeaec12122e62d
---
M chart2/source/view/charttypes/VSeriesPlotter.cxx
1 file changed, 4 insertions(+), 2 deletions(-)



diff --git a/chart2/source/view/charttypes/VSeriesPlotter.cxx b/chart2/source/view/charttypes/VSeriesPlotter.cxx
index 6e114dd..b35739d 100644
--- a/chart2/source/view/charttypes/VSeriesPlotter.cxx
+++ b/chart2/source/view/charttypes/VSeriesPlotter.cxx
@@ -1011,13 +1011,16 @@
             xRegressionCurveCalculator->getCurveValues(
                 fMinX, fMaxX, nRegressionPointCount, xScalingX, xScalingY, bMaySkipPointsInRegressionCalculation ));
         nRegressionPointCount = aCalculatedPoints.getLength();
+        bool bAverageLine = RegressionCurveHelper::isMeanValueLine( aCurveList[nN] );
         for(sal_Int32 nP=0; nP<nRegressionPointCount; nP++)
         {
             double fLogicX = aCalculatedPoints[nP].X;
             double fLogicY = aCalculatedPoints[nP].Y;
             double fLogicZ = 0.0;//dummy
 
-            m_pPosHelper->doLogicScaling( &fLogicX, &fLogicY, &fLogicZ );
+            // Don't do scaling if it's a mean value line ( fdo#51656 ).
+            if ( !bAverageLine )
+                m_pPosHelper->doLogicScaling( &fLogicX, &fLogicY, &fLogicZ );
 
             if(    !::rtl::math::isNan(fLogicX) && !::rtl::math::isInf(fLogicX)
                     && !::rtl::math::isNan(fLogicY) && !::rtl::math::isInf(fLogicY)
@@ -1045,7 +1048,6 @@
             aVLineProperties.initFromPropertySet( xCurveModelProp );
 
             //create an extra group shape for each curve for selection handling
-            bool bAverageLine = RegressionCurveHelper::isMeanValueLine( aCurveList[nN] );
             uno::Reference< drawing::XShapes > xRegressionGroupShapes =
                 createGroupShape( xTarget, rVDataSeries.getDataCurveCID( nN, bAverageLine ) );
             uno::Reference< drawing::XShape > xShape = m_pShapeFactory->createLine2D(

-- 
To view, visit https://gerrit.libreoffice.org/3156
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I056423b3214e8f904202e6e6a3aeaec12122e62d
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: Cao Cuong Ngo <cao.cuong.ngo at gmail.com>



More information about the LibreOffice mailing list