diff options
author | Markus Mohrhard <markus.mohrhard@collabora.co.uk> | 2014-01-12 22:53:19 +0100 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2014-01-29 08:09:47 +0100 |
commit | 4de61a662d5987c02a684ae05648e2d0637c8018 (patch) | |
tree | b17f019ba0faf79842d491f38cfc39c175a04e28 | |
parent | 6243457eb2246fff10dcd56b8f2b9371a29f0333 (diff) |
fix missing clearing of rendering area
Now there are no artifacts left from earlier renderings.
Change-Id: I48e6585d838cdf9547c150e1484a967fc9b69329
-rw-r--r-- | chart2/source/view/inc/AbstractShapeFactory.hxx | 2 | ||||
-rw-r--r-- | chart2/source/view/inc/DummyXShape.hxx | 4 | ||||
-rw-r--r-- | chart2/source/view/inc/OpenglShapeFactory.hxx | 1 | ||||
-rw-r--r-- | chart2/source/view/inc/ShapeFactory.hxx | 2 | ||||
-rw-r--r-- | chart2/source/view/main/ChartView.cxx | 1 | ||||
-rw-r--r-- | chart2/source/view/main/DummyXShape.cxx | 6 | ||||
-rw-r--r-- | chart2/source/view/main/OpenglShapeFactory.cxx | 7 |
7 files changed, 22 insertions, 1 deletions
diff --git a/chart2/source/view/inc/AbstractShapeFactory.hxx b/chart2/source/view/inc/AbstractShapeFactory.hxx index b875399991b0..9107bc27eb24 100644 --- a/chart2/source/view/inc/AbstractShapeFactory.hxx +++ b/chart2/source/view/inc/AbstractShapeFactory.hxx @@ -243,6 +243,8 @@ public: */ virtual void render(com::sun::star::uno::Reference< com::sun::star::drawing::XShapes > xRootShape) = 0; + virtual void clearPage(com::sun::star::uno::Reference< com::sun::star::drawing::XShapes > xRootShape) = 0; + static ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XShapes > getChartRootShape( const ::com::sun::star::uno::Reference< ::com::sun::star::drawing::XDrawPage>& xPage ); diff --git a/chart2/source/view/inc/DummyXShape.hxx b/chart2/source/view/inc/DummyXShape.hxx index 91ec6d42af51..42eec3044622 100644 --- a/chart2/source/view/inc/DummyXShape.hxx +++ b/chart2/source/view/inc/DummyXShape.hxx @@ -426,7 +426,7 @@ public: // normal methods virtual void render(); -private: +protected: std::vector<com::sun::star::uno::Reference< com::sun::star::drawing::XShape > > maUNOShapes; std::vector<DummyXShape*> maShapes; }; @@ -443,6 +443,8 @@ public: virtual void render() SAL_OVERRIDE; + void clear(); + private: GLWindow GLWin; /// Holds the information of our new child window diff --git a/chart2/source/view/inc/OpenglShapeFactory.hxx b/chart2/source/view/inc/OpenglShapeFactory.hxx index 7b8331eab108..03a4894b94cf 100644 --- a/chart2/source/view/inc/OpenglShapeFactory.hxx +++ b/chart2/source/view/inc/OpenglShapeFactory.hxx @@ -186,6 +186,7 @@ public: virtual void render(com::sun::star::uno::Reference< com::sun::star::drawing::XShapes > xRootShape) SAL_OVERRIDE; + virtual void clearPage(com::sun::star::uno::Reference< com::sun::star::drawing::XShapes > xRootShape) SAL_OVERRIDE; }; } diff --git a/chart2/source/view/inc/ShapeFactory.hxx b/chart2/source/view/inc/ShapeFactory.hxx index e8fb9ef70114..2551bcfd7814 100644 --- a/chart2/source/view/inc/ShapeFactory.hxx +++ b/chart2/source/view/inc/ShapeFactory.hxx @@ -201,6 +201,8 @@ public: */ virtual void render(com::sun::star::uno::Reference< com::sun::star::drawing::XShapes > ) SAL_OVERRIDE {} + virtual void clearPage(com::sun::star::uno::Reference< com::sun::star::drawing::XShapes > ) SAL_OVERRIDE {} + private: ShapeFactory(); diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx index c3b2ac20f835..001c786d35fe 100644 --- a/chart2/source/view/main/ChartView.cxx +++ b/chart2/source/view/main/ChartView.cxx @@ -2412,6 +2412,7 @@ void ChartView::createShapes() OSL_FAIL("could not set page size correctly"); } pShapeFactory->setPageSize(mxRootShape, aPageSize); + pShapeFactory->clearPage(mxRootShape); { SolarMutexGuard aSolarGuard; diff --git a/chart2/source/view/main/DummyXShape.cxx b/chart2/source/view/main/DummyXShape.cxx index 054de592e9cf..b1d446b927a7 100644 --- a/chart2/source/view/main/DummyXShape.cxx +++ b/chart2/source/view/main/DummyXShape.cxx @@ -1220,6 +1220,12 @@ void DummyChart::render() m_GLRender.renderToBitmap(); } +void DummyChart::clear() +{ + maUNOShapes.clear(); + maShapes.clear(); +} + } } diff --git a/chart2/source/view/main/OpenglShapeFactory.cxx b/chart2/source/view/main/OpenglShapeFactory.cxx index ec9f3e9488db..49c7947d3f97 100644 --- a/chart2/source/view/main/OpenglShapeFactory.cxx +++ b/chart2/source/view/main/OpenglShapeFactory.cxx @@ -435,6 +435,13 @@ void OpenglShapeFactory::render(uno::Reference< drawing::XShapes > xRootShape) pChart->render(); } +void OpenglShapeFactory::clearPage(uno::Reference< drawing::XShapes > xRootShape) +{ + dummy::DummyChart* pChart = dynamic_cast<dummy::DummyChart*>(xRootShape.get()); + assert(pChart); + pChart->clear(); +} + } //namespace dummy } //namespace chart |