[Libreoffice-commits] core.git: Branch 'feature/chart-opengl2' - chart2/source

Markus Mohrhard markus.mohrhard at googlemail.com
Fri Jan 3 21:41:03 PST 2014


 chart2/source/view/main/VDataSeries.cxx |   10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

New commits:
commit 29094d9cc750928cb5897cf189a42f1e02df39e2
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date:   Sat Jan 4 08:39:13 2014 +0100

    make the property mapping also time based
    
    Change-Id: I5c7dec27fc6057b28a5b82a0e9d26723fbbbbae0

diff --git a/chart2/source/view/main/VDataSeries.cxx b/chart2/source/view/main/VDataSeries.cxx
index dad92a8..1f86264 100644
--- a/chart2/source/view/main/VDataSeries.cxx
+++ b/chart2/source/view/main/VDataSeries.cxx
@@ -1069,6 +1069,7 @@ void VDataSeries::setOldTimeBased( VDataSeries* pOldSeries, double nPercent )
 {
     mnPercent = nPercent;
     mpOldSeries = pOldSeries;
+    mpOldSeries->mpOldSeries = NULL;
 }
 
 VDataSeries* VDataSeries::createCopyForTimeBased() const
@@ -1082,6 +1083,7 @@ VDataSeries* VDataSeries::createCopyForTimeBased() const
     pNew->m_aValues_Y_First = m_aValues_Y_First;
     pNew->m_aValues_Y_Last = m_aValues_Y_Last;
     pNew->m_aValues_Bubble_Size = m_aValues_Bubble_Size;
+    pNew->maPropertyMap = maPropertyMap;
 
     pNew->m_nPointCount = m_nPointCount;
 
@@ -1101,7 +1103,13 @@ double VDataSeries::getValueByProperty( sal_Int32 nIndex, const OUString& rPropN
 
     // TODO:moggi handle time based charting
     const VDataSequence* pData = itr->second;
-    return pData->getValue(nIndex);
+    double fValue = pData->getValue(nIndex);
+    if(mpOldSeries && mpOldSeries->hasPropertyMapping(rPropName))
+    {
+        double fOldValue = mpOldSeries->getValueByProperty( nIndex, rPropName );
+        return fOldValue + (fValue - fOldValue) * mnPercent;
+    }
+    return fValue;
 }
 
 bool VDataSeries::hasPropertyMapping(const OUString& rPropName ) const


More information about the Libreoffice-commits mailing list