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

Kohei Yoshida kohei.yoshida at collabora.com
Wed Oct 15 15:34:02 PDT 2014


 chart2/source/view/main/ChartView.cxx |   17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

New commits:
commit e85bae1e25fe96848f28b2f43c4ab49d8c53e8d0
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Wed Oct 15 17:27:01 2014 -0400

    Delete old VCoordinateSystem objects right before creating new ones.
    
    Later I'll convert them into resetting rather than deleting old and
    creating new.
    
    Change-Id: I4e68979feda1dedc2465b873bf6ac3307df4d7de

diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx
index 4ba924b..24a707a 100644
--- a/chart2/source/view/main/ChartView.cxx
+++ b/chart2/source/view/main/ChartView.cxx
@@ -246,6 +246,7 @@ public:
     SeriesPlotterContainer( std::vector< VCoordinateSystem* >& rVCooSysList );
     ~SeriesPlotterContainer();
 
+    void resetCoordinateSystems();
     void initializeCooSysAndSeriesPlotter( ChartModel& rModel );
     void initAxisUsageList(const Date& rNullDate);
 
@@ -373,6 +374,20 @@ VCoordinateSystem* addCooSysToList( std::vector< VCoordinateSystem* >& rVCooSysL
     return pVCooSys;
 }
 
+void SeriesPlotterContainer::resetCoordinateSystems()
+{
+    //delete all coordinate systems
+    ::std::vector< VCoordinateSystem* > aVectorToDeleteObjects;
+    ::std::swap( aVectorToDeleteObjects, m_rVCooSysList );//#i109770#
+    ::std::vector< VCoordinateSystem* >::const_iterator       aIter = aVectorToDeleteObjects.begin();
+    const ::std::vector< VCoordinateSystem* >::const_iterator aEnd  = aVectorToDeleteObjects.end();
+    for( ; aIter != aEnd; ++aIter )
+    {
+        delete *aIter;
+    }
+    aVectorToDeleteObjects.clear();
+}
+
 void SeriesPlotterContainer::initializeCooSysAndSeriesPlotter(
               ChartModel& rChartModel )
 {
@@ -2543,7 +2558,6 @@ void ChartView::createShapes()
         return;
 
     m_aResultingDiagramRectangleExcludingAxes = awt::Rectangle(0,0,0,0);
-    impl_deleteCoordinateSystems();
     if( m_pDrawModelWrapper )
     {
         SolarMutexGuard aSolarGuard;
@@ -3114,6 +3128,7 @@ void ChartView::createShapes2D( const awt::Size& rPageSize )
         return;
 
     aParam.mpSeriesPlotterContainer.reset(new SeriesPlotterContainer(m_aVCooSysList));
+    aParam.mpSeriesPlotterContainer->resetCoordinateSystems();
     aParam.mpSeriesPlotterContainer->initializeCooSysAndSeriesPlotter( mrChartModel );
     if(maTimeBased.bTimeBased && maTimeBased.nFrame != 0)
     {


More information about the Libreoffice-commits mailing list