[Libreoffice-commits] core.git: 2 commits - chart2/Library_chartcontroller.mk chart2/source sc/source

Markus Mohrhard markus.mohrhard at collabora.co.uk
Wed Jul 23 13:28:01 PDT 2014


 chart2/Library_chartcontroller.mk                 |    1 
 chart2/source/controller/main/ChartController.cxx |    3 
 chart2/source/controller/main/ChartWindow.cxx     |   35 +--------
 chart2/source/controller/main/ChartWindow.hxx     |    9 --
 chart2/source/model/main/ChartModel.cxx           |    1 
 chart2/source/view/charttypes/GL3DBarChart.cxx    |   82 +++++++++-------------
 chart2/source/view/inc/AbstractShapeFactory.hxx   |    2 
 chart2/source/view/inc/GL3DBarChart.hxx           |    6 -
 chart2/source/view/inc/OpenglShapeFactory.hxx     |    2 
 chart2/source/view/inc/ShapeFactory.hxx           |    2 
 chart2/source/view/main/ChartView.cxx             |   16 ----
 chart2/source/view/main/DummyXShape.hxx           |    1 
 chart2/source/view/main/OpenglShapeFactory.cxx    |    6 -
 sc/source/ui/drawfunc/fuins2.cxx                  |   18 ++++
 sc/source/ui/inc/gridwin.hxx                      |    1 
 sc/source/ui/view/gridwin5.cxx                    |   13 +++
 16 files changed, 84 insertions(+), 114 deletions(-)

New commits:
commit cc827ab81d285156fffb8920cba460703cad789d
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Wed Jul 23 18:48:43 2014 +0200

    Revert "opengl charts: Move the init from sc to chart2 ...
    
    This reverts commit 46cea34638b371570073c0e86f79969753c543ed.
    
    Conflicts:
    	chart2/source/view/charttypes/GL3DBarChart.cxx
    
    Change-Id: Ia29ea6a95b8b9eb870d14538d0cadaa40472582f

diff --git a/chart2/Library_chartcontroller.mk b/chart2/Library_chartcontroller.mk
index 9657998..b7e86bf 100644
--- a/chart2/Library_chartcontroller.mk
+++ b/chart2/Library_chartcontroller.mk
@@ -43,7 +43,6 @@ $(eval $(call gb_Library_use_libraries,chartcontroller,\
     ucbhelper \
     utl \
     vcl \
-    vclopengl \
 	$(gb_UWINAPI) \
 ))
 
diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx
index d5eca79..b57045d 100644
--- a/chart2/source/controller/main/ChartController.cxx
+++ b/chart2/source/controller/main/ChartController.cxx
@@ -726,9 +726,6 @@ void SAL_CALL ChartController::dispose()
 
         //--release all resources and references
         {
-            uno::Reference< chart2::X3DChartWindowProvider > x3DWindowProvider(getModel(), uno::UNO_QUERY_THROW);
-            x3DWindowProvider->setWindow(0);
-
             uno::Reference< util::XModeChangeBroadcaster > xViewBroadcaster( m_xChartView, uno::UNO_QUERY );
             if( xViewBroadcaster.is() )
                 xViewBroadcaster->removeModeChangeListener(this);
diff --git a/chart2/source/controller/main/ChartWindow.cxx b/chart2/source/controller/main/ChartWindow.cxx
index 37335c4..917d69e 100644
--- a/chart2/source/controller/main/ChartWindow.cxx
+++ b/chart2/source/controller/main/ChartWindow.cxx
@@ -22,11 +22,8 @@
 #include "HelpIds.hrc"
 
 #include <vcl/help.hxx>
-#include <vcl/openglwin.hxx>
 #include <vcl/settings.hxx>
 
-#include <com/sun/star/chart2/X3DChartWindowProvider.hpp>
-
 using namespace ::com::sun::star;
 
 namespace
@@ -45,11 +42,10 @@ namespace
 namespace chart
 {
 
-ChartWindow::ChartWindow( ChartController* pController, Window* pParent, WinBits nStyle )
+ChartWindow::ChartWindow( WindowController* pWindowController, Window* pParent, WinBits nStyle )
         : Window(pParent, nStyle)
-        , m_pWindowController( pController )
+        , m_pWindowController( pWindowController )
         , m_bInPaint(false)
-        , m_pOpenGLWindow(new OpenGLWindow(this))
 {
     this->SetHelpId( HID_SCH_WIN_DOCUMENT );
     this->SetMapMode( MapMode(MAP_100TH_MM) );
@@ -59,21 +55,10 @@ ChartWindow::ChartWindow( ChartController* pController, Window* pParent, WinBits
     EnableRTL( false );
     if( pParent )
         pParent->EnableRTL( false );// #i96215# necessary for a correct position of the context menu in rtl mode
-
-    m_pOpenGLWindow->Show();
-    uno::Reference< chart2::X3DChartWindowProvider > x3DWindowProvider(pController->getModel(), uno::UNO_QUERY_THROW);
-    sal_uInt64 nWindowPtr = reinterpret_cast<sal_uInt64>(m_pOpenGLWindow);
-    x3DWindowProvider->setWindow(nWindowPtr);
 }
 
 ChartWindow::~ChartWindow()
 {
-    if (m_pWindowController && m_pWindowController->getModel().is())
-    {
-        uno::Reference< chart2::X3DChartWindowProvider > x3DWindowProvider(m_pWindowController->getModel(), uno::UNO_QUERY_THROW);
-        x3DWindowProvider->setWindow(0);
-    }
-    delete m_pOpenGLWindow;
 }
 
 void ChartWindow::clear()
@@ -94,18 +79,10 @@ void ChartWindow::PrePaint()
 void ChartWindow::Paint( const Rectangle& rRect )
 {
     m_bInPaint = true;
-    if (m_pOpenGLWindow && m_pOpenGLWindow->IsVisible())
-    {
-        m_pOpenGLWindow->Paint(rRect);
-    }
-    else if (m_pWindowController)
-    {
-        m_pWindowController->execute_Paint(rRect);
-    }
+    if( m_pWindowController )
+        m_pWindowController->execute_Paint( rRect );
     else
-    {
         Window::Paint( rRect );
-    }
     m_bInPaint = false;
 }
 
@@ -147,8 +124,6 @@ void ChartWindow::Resize()
         m_pWindowController->execute_Resize();
     else
         Window::Resize();
-
-    m_pOpenGLWindow->SetSizePixel(GetSizePixel());
 }
 
 void ChartWindow::Activate()
diff --git a/chart2/source/controller/main/ChartWindow.hxx b/chart2/source/controller/main/ChartWindow.hxx
index ee5884f..ec5c05b 100644
--- a/chart2/source/controller/main/ChartWindow.hxx
+++ b/chart2/source/controller/main/ChartWindow.hxx
@@ -21,12 +21,10 @@
 
 #include <vcl/window.hxx>
 
-class OpenGLWindow;
-
 namespace chart
 {
 
-class ChartController;
+class WindowController;
 
 /** The ChartWindow collects events from the window and forwards them the to the controller
 thus the controller can perform appropriate actions
@@ -35,7 +33,7 @@ thus the controller can perform appropriate actions
 class ChartWindow : public Window
 {
 public:
-    ChartWindow( ChartController* pController, Window* pParent, WinBits nStyle );
+    ChartWindow( WindowController* pWindowController, Window* pParent, WinBits nStyle );
     virtual ~ChartWindow();
 
     void clear();
@@ -65,9 +63,8 @@ public:
     virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible() SAL_OVERRIDE;
 
 private:
-    ChartController* m_pWindowController;
+    WindowController*    m_pWindowController;
     bool m_bInPaint;
-    OpenGLWindow* m_pOpenGLWindow;
 
     void adjustHighContrastMode();
 };
diff --git a/chart2/source/model/main/ChartModel.cxx b/chart2/source/model/main/ChartModel.cxx
index 0fb584b..2d2a848 100644
--- a/chart2/source/model/main/ChartModel.cxx
+++ b/chart2/source/model/main/ChartModel.cxx
@@ -1412,6 +1412,7 @@ void ChartModel::setWindow( const sal_uInt64 nWindowPtr )
 {
     void* pPtr = (void*)nWindowPtr;
     OpenGLWindow* pWindow = reinterpret_cast<OpenGLWindow*>(pPtr);
+    assert(pWindow);
     mpOpenGLWindow = pWindow;
 }
 
diff --git a/chart2/source/view/charttypes/GL3DBarChart.cxx b/chart2/source/view/charttypes/GL3DBarChart.cxx
index 0d12c4f..62e5ec9 100644
--- a/chart2/source/view/charttypes/GL3DBarChart.cxx
+++ b/chart2/source/view/charttypes/GL3DBarChart.cxx
@@ -47,8 +47,8 @@ void RenderThread::renderFrame()
     if(!mpChart->mbValidContext)
         return;
 
-    mpChart->mpWindow->getContext().makeCurrent();
-    Size aSize = mpChart->mpWindow->GetSizePixel();
+    mpChart->mrWindow.getContext().makeCurrent();
+    Size aSize = mpChart->mrWindow.GetSizePixel();
     mpChart->mpRenderer->SetSize(aSize);
     if(mpChart->mbNeedsNewRender)
     {
@@ -64,7 +64,7 @@ void RenderThread::renderFrame()
     }
     mpChart->mpRenderer->ProcessUnrenderedShape(mpChart->mbNeedsNewRender);
     mpChart->mbNeedsNewRender = false;
-    mpChart->mpWindow->getContext().swapBuffers();
+    mpChart->mrWindow.getContext().swapBuffers();
 
 }
 
@@ -127,10 +127,10 @@ void RenderAnimationThread::execute()
 
 GL3DBarChart::GL3DBarChart(
     const css::uno::Reference<css::chart2::XChartType>& xChartType,
-    OpenGLWindow* pWindow) :
+    OpenGLWindow& rWindow) :
     mxChartType(xChartType),
     mpRenderer(new opengl3D::OpenGL3DRenderer()),
-    mpWindow(pWindow),
+    mrWindow(rWindow),
     mpCamera(NULL),
     mbValidContext(true),
     mpTextCache(new opengl3D::TextCache()),
@@ -142,13 +142,9 @@ GL3DBarChart::GL3DBarChart(
     mbNeedsNewRender(true),
     mbCameraInit(false)
 {
-    Size aSize;
-    if (mpWindow)
-    {
-        mpWindow->setRenderer(this);
-        aSize = mpWindow->GetSizePixel();
-    }
+    Size aSize = mrWindow.GetSizePixel();
     mpRenderer->SetSize(aSize);
+    mrWindow.setRenderer(this);
     mpRenderer->init();
 }
 
@@ -166,8 +162,8 @@ GL3DBarChart::~GL3DBarChart()
     if(mpRenderThread.is())
         mpRenderThread->join();
     osl::MutexGuard aGuard(maMutex);
-    if(mbValidContext && mpWindow)
-        mpWindow->setRenderer(NULL);
+    if(mbValidContext)
+        mrWindow.setRenderer(NULL);
 }
 
 namespace {
@@ -222,9 +218,9 @@ void GL3DBarChart::create3DShapes(const boost::ptr_vector<VDataSeries>& rDataSer
     float nXEnd = 0.0;
     float nYPos = 0.0;
 
-    //const Color aSeriesColor[] = {
-    //    COL_RED, COL_GREEN, COL_YELLOW, COL_BROWN, COL_BLUE
-    //};
+    const Color aSeriesColor[] = {
+        COL_RED, COL_GREEN, COL_YELLOW, COL_BROWN, COL_BLUE
+    };
 
     maCategories.clear();
     maSeriesNames.clear();
@@ -246,7 +242,7 @@ void GL3DBarChart::create3DShapes(const boost::ptr_vector<VDataSeries>& rDataSer
         sal_Int32 nPointCount = rDataSeries.getTotalPointCount();
         nMaxPointCount = std::max(nMaxPointCount, nPointCount);
 
-        //bool bMappedFillProperty = rDataSeries.hasPropertyMapping("FillColor");
+        bool bMappedFillProperty = rDataSeries.hasPropertyMapping("FillColor");
 
         // Create series name text object.
         OUString aSeriesName =
@@ -271,28 +267,28 @@ void GL3DBarChart::create3DShapes(const boost::ptr_vector<VDataSeries>& rDataSer
             p->setPosition(aTopLeft, aTopRight, aBottomRight);
         }
 
-        //sal_Int32 nColor = aSeriesColor[nSeriesIndex % SAL_N_ELEMENTS(aSeriesColor)].GetColor();
+        sal_Int32 nColor = aSeriesColor[nSeriesIndex % SAL_N_ELEMENTS(aSeriesColor)].GetColor();
         for(sal_Int32 nIndex = 0; nIndex < nPointCount; ++nIndex)
         {
-            //if(bMappedFillProperty)
-            //{
-            //    double nPropVal = rDataSeries.getValueByProperty(nIndex, "FillColor");
-            //    if(!rtl::math::isNan(nPropVal))
-            //        nColor = static_cast<sal_uInt32>(nPropVal);
-            //}
+            if(bMappedFillProperty)
+            {
+                double nPropVal = rDataSeries.getValueByProperty(nIndex, "FillColor");
+                if(!rtl::math::isNan(nPropVal))
+                    nColor = static_cast<sal_uInt32>(nPropVal);
+            }
 
             float nVal = rDataSeries.getYValue(nIndex);
             float nXPos = nIndex * (BAR_SIZE_X + BAR_DISTANCE_X) + BAR_DISTANCE_X;
 
-            //glm::mat4 aScaleMatrix = glm::scale(glm::vec3(BAR_SIZE_X, BAR_SIZE_Y, float(nVal/nMaxVal)));
-            //glm::mat4 aTranslationMatrix = glm::translate(glm::vec3(nXPos, nYPos, 0.0f));
-            //glm::mat4 aBarPosition = aTranslationMatrix * aScaleMatrix;
+            glm::mat4 aScaleMatrix = glm::scale(glm::vec3(BAR_SIZE_X, BAR_SIZE_Y, float(nVal/nMaxVal)));
+            glm::mat4 aTranslationMatrix = glm::translate(glm::vec3(nXPos, nYPos, 0.0f));
+            glm::mat4 aBarPosition = aTranslationMatrix * aScaleMatrix;
 
             maBarMap.insert(std::pair<sal_uInt32, BarInformation>(nId,
                         BarInformation(glm::vec3(nXPos, nYPos, float(nVal/nMaxVal)),
                             nVal, nIndex, nSeriesIndex)));
 
-            //maShapes.push_back(new opengl3D::Bar(mpRenderer.get(), aBarPosition, nColor, nId));
+            maShapes.push_back(new opengl3D::Bar(mpRenderer.get(), aBarPosition, nColor, nId));
             nId += ID_STEP;
         }
 
@@ -407,10 +403,10 @@ void GL3DBarChart::update()
 {
     if(mpRenderThread.is())
         mpRenderThread->join();
-    Size aSize = mpWindow->GetSizePixel();
-    mpWindow->getContext().setWinSize(aSize);
+    Size aSize = mrWindow.GetSizePixel();
+    mrWindow.getContext().setWinSize(aSize);
     mpRenderThread = rtl::Reference<RenderThread>(new RenderOneFrameThread(this));
-    mpWindow->getContext().resetCurrent();
+    mrWindow.getContext().resetCurrent();
     mpRenderThread->launch();
 }
 
@@ -442,10 +438,10 @@ void GL3DBarChart::moveToDefault()
     if(mpRenderThread.is())
         mpRenderThread->join();
 
-    Size aSize = mpWindow->GetSizePixel();
-    mpWindow->getContext().setWinSize(aSize);
+    Size aSize = mrWindow.GetSizePixel();
+    mrWindow.getContext().setWinSize(aSize);
     mpRenderThread = rtl::Reference<RenderThread>(new RenderAnimationThread(this, maCameraPosition, maDefaultCameraPosition, STEPS));
-    mpWindow->getContext().resetCurrent();
+    mrWindow.getContext().resetCurrent();
     mpRenderThread->launch();
 
     /*
@@ -500,10 +496,10 @@ void GL3DBarChart::clickedAt(const Point& rPos, sal_uInt16 nButtons)
     glm::vec3 maTargetPosition = rBarInfo.maPos;
     maTargetPosition.z += 240;
     maTargetPosition.y += BAR_SIZE_Y / 2.0f;
-    Size aSize = mpWindow->GetSizePixel();
-    mpWindow->getContext().setWinSize(aSize);
+    Size aSize = mrWindow.GetSizePixel();
+    mrWindow.getContext().setWinSize(aSize);
     mpRenderThread = rtl::Reference<RenderThread>(new RenderAnimationThread(this, maCameraPosition, maTargetPosition, STEPS));
-    mpWindow->getContext().resetCurrent();
+    mrWindow.getContext().resetCurrent();
     mpRenderThread->launch();
 
     /*
@@ -581,11 +577,11 @@ void GL3DBarChart::moveToCorner()
     if(mpRenderThread.is())
         mpRenderThread->join();
 
-    Size aSize = mpWindow->GetSizePixel();
-    mpWindow->getContext().setWinSize(aSize);
+    Size aSize = mrWindow.GetSizePixel();
+    mrWindow.getContext().setWinSize(aSize);
     mpRenderThread = rtl::Reference<RenderThread>(new RenderAnimationThread(this, getCornerPosition(mnCornerId),
                 maCameraPosition, STEPS));
-    mpWindow->getContext().resetCurrent();
+    mrWindow.getContext().resetCurrent();
     mpRenderThread->launch();
 
     // TODO: moggi: add to thread
@@ -608,12 +604,6 @@ void GL3DBarChart::contextDestroyed()
     mbValidContext = false;
 }
 
-void GL3DBarChart::setOpenGLWindow(OpenGLWindow* pWindow)
-{
-    if (mpWindow != pWindow)
-        mpWindow = pWindow;
-}
-
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/view/inc/GL3DBarChart.hxx b/chart2/source/view/inc/GL3DBarChart.hxx
index 56bac83..2517627 100644
--- a/chart2/source/view/inc/GL3DBarChart.hxx
+++ b/chart2/source/view/inc/GL3DBarChart.hxx
@@ -49,7 +49,7 @@ class GL3DBarChart : public GL3DPlotterBase, public IRenderer
 public:
     GL3DBarChart(
         const css::uno::Reference<css::chart2::XChartType>& xChartType,
-        OpenGLWindow* pContext);
+        OpenGLWindow& rContext);
 
     virtual ~GL3DBarChart();
 
@@ -65,8 +65,6 @@ public:
     virtual void scroll(long nDelta) SAL_OVERRIDE;
     virtual void contextDestroyed() SAL_OVERRIDE;
 
-    void setOpenGLWindow(OpenGLWindow* pWindow);
-
 private:
 
     void moveToCorner();
@@ -77,7 +75,7 @@ private:
     boost::ptr_vector<opengl3D::Renderable3DObject> maShapes;
 
     boost::scoped_ptr<opengl3D::OpenGL3DRenderer> mpRenderer;
-    OpenGLWindow* mpWindow;
+    OpenGLWindow& mrWindow;
 
     opengl3D::Camera* mpCamera;
     bool mbValidContext;
diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx
index 8dc8046..2e8dc25 100644
--- a/chart2/source/view/main/ChartView.cxx
+++ b/chart2/source/view/main/ChartView.cxx
@@ -3250,13 +3250,7 @@ void ChartView::createShapes3D()
 
     if (!m_pGL3DPlotter)
     {
-        m_pGL3DPlotter.reset(new GL3DBarChart(xChartType, pWindow));
-    }
-    else
-    {
-        GL3DBarChart* pChart = dynamic_cast<GL3DBarChart*>(m_pGL3DPlotter.get());
-        if (pChart)
-            pChart->setOpenGLWindow(pWindow);
+        m_pGL3DPlotter.reset(new GL3DBarChart(xChartType, *pWindow));
     }
 
     uno::Reference< XDataSeriesContainer > xDataSeriesContainer( xChartType, uno::UNO_QUERY );
diff --git a/sc/source/ui/drawfunc/fuins2.cxx b/sc/source/ui/drawfunc/fuins2.cxx
index 0a7703d7..fa9dbfd 100644
--- a/sc/source/ui/drawfunc/fuins2.cxx
+++ b/sc/source/ui/drawfunc/fuins2.cxx
@@ -544,6 +544,22 @@ FuInsertChart::FuInsertChart(ScTabViewShell* pViewSh, Window* pWin, ScDrawView*
     ScDocument& rScDoc   = pScDocSh->GetDocument();
     bool bUndo (rScDoc.IsUndoEnabled());
 
+    Window* pParentWindow = rData.GetActiveWin();
+    OpenGLWindow* pChildWindow = new OpenGLWindow(pParentWindow);
+    Size aWindowSize = pChildWindow->LogicToPixel( aSize, MapMode( MAP_100TH_MM ) );
+    pChildWindow->SetSizePixel(aWindowSize);
+    pChildWindow->Show();
+    uno::Reference< chart2::X3DChartWindowProvider > x3DWindowProvider( xChartModel, uno::UNO_QUERY_THROW );
+    sal_uInt64 nWindowPtr = reinterpret_cast<sal_uInt64>(pChildWindow);
+    x3DWindowProvider->setWindow(nWindowPtr);
+    ScGridWindow* pGridWindow = dynamic_cast<ScGridWindow*>(pParentWindow);
+    if(pGridWindow)
+    {
+        pGridWindow->AddChildWindow(pChildWindow);
+    }
+    else
+        SAL_WARN("sc", "not a grid window. You are in serious trouble");
+
     if( pReqArgs )
     {
         const SfxPoolItem* pItem;
@@ -618,6 +634,7 @@ FuInsertChart::FuInsertChart(ScTabViewShell* pViewSh, Window* pWin, ScDrawView*
         // get chart position (from window size and data range)
         aStart = pViewSh->GetChartInsertPos( aSize, aPositionRange );
     }
+    pChildWindow->SetPosPixel(pChildWindow->LogicToPixel(aStart, MapMode(MAP_100TH_MM)));
 
     Rectangle aRect (aStart, aSize);
     SdrOle2Obj* pObj = new SdrOle2Obj( svt::EmbeddedObjectRef( xObj, nAspect ), aName, aRect);
@@ -712,6 +729,7 @@ FuInsertChart::FuInsertChart(ScTabViewShell* pViewSh, Window* pWin, ScDrawView*
                     sal_Int16 nDialogRet = xDialog->execute();
                     if( nDialogRet == ui::dialogs::ExecutableDialogResults::CANCEL )
                     {
+                        pGridWindow->DeleteChildWindow(pChildWindow);
                         // leave OLE inplace mode and unmark
                         OSL_ASSERT( pViewShell );
                         OSL_ASSERT( pView );
diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx
index 5afa835..ed066b2 100644
--- a/sc/source/ui/inc/gridwin.hxx
+++ b/sc/source/ui/inc/gridwin.hxx
@@ -420,6 +420,7 @@ public:
      * Takes ownership of the window
      */
     void            AddChildWindow(Window* pChildWindow);
+    void            DeleteChildWindow(Window* pChildWindow);
 
 protected:
     // #114409#
diff --git a/sc/source/ui/view/gridwin5.cxx b/sc/source/ui/view/gridwin5.cxx
index 8a3f271..bed697b 100644
--- a/sc/source/ui/view/gridwin5.cxx
+++ b/sc/source/ui/view/gridwin5.cxx
@@ -477,4 +477,17 @@ void ScGridWindow::AddChildWindow(Window* pWindow)
     maChildWindows.push_back(pWindow);
 }
 
+void ScGridWindow::DeleteChildWindow(Window* pWindow)
+{
+    for(boost::ptr_vector<Window>::iterator itr = maChildWindows.begin(),
+            itrEnd = maChildWindows.end(); itr != itrEnd; ++itr)
+    {
+        if(&(*itr) == pWindow)
+        {
+            maChildWindows.erase(itr);
+            return;
+        }
+    }
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit c02e393c7dd55ad6d1f94972543d3c14dd30351f
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date:   Wed Jul 23 18:47:52 2014 +0200

    Revert "Fix OpenGL chart reinitializing"
    
    This reverts commit cbc50c90ad63f0e59b8cf3bbfb6b5b1f61db09b9.

diff --git a/chart2/source/controller/main/ChartWindow.cxx b/chart2/source/controller/main/ChartWindow.cxx
index 40e6933..37335c4 100644
--- a/chart2/source/controller/main/ChartWindow.cxx
+++ b/chart2/source/controller/main/ChartWindow.cxx
@@ -64,7 +64,6 @@ ChartWindow::ChartWindow( ChartController* pController, Window* pParent, WinBits
     uno::Reference< chart2::X3DChartWindowProvider > x3DWindowProvider(pController->getModel(), uno::UNO_QUERY_THROW);
     sal_uInt64 nWindowPtr = reinterpret_cast<sal_uInt64>(m_pOpenGLWindow);
     x3DWindowProvider->setWindow(nWindowPtr);
-    x3DWindowProvider->update();
 }
 
 ChartWindow::~ChartWindow()
@@ -73,7 +72,6 @@ ChartWindow::~ChartWindow()
     {
         uno::Reference< chart2::X3DChartWindowProvider > x3DWindowProvider(m_pWindowController->getModel(), uno::UNO_QUERY_THROW);
         x3DWindowProvider->setWindow(0);
-        x3DWindowProvider->update();
     }
     delete m_pOpenGLWindow;
 }
diff --git a/chart2/source/view/inc/AbstractShapeFactory.hxx b/chart2/source/view/inc/AbstractShapeFactory.hxx
index 3e55165..9cb3e47 100644
--- a/chart2/source/view/inc/AbstractShapeFactory.hxx
+++ b/chart2/source/view/inc/AbstractShapeFactory.hxx
@@ -238,7 +238,7 @@ public:
     /**
      * Only necessary for stateless implementations
      */
-    virtual void render(com::sun::star::uno::Reference< com::sun::star::drawing::XShapes > xRootShape, bool bInitOpenGL = true) = 0;
+    virtual void render(com::sun::star::uno::Reference< com::sun::star::drawing::XShapes > xRootShape) = 0;
 
     virtual bool preRender(OpenGLWindow* pWindow) = 0;
     virtual void postRender(OpenGLWindow* pWindow) = 0;
diff --git a/chart2/source/view/inc/OpenglShapeFactory.hxx b/chart2/source/view/inc/OpenglShapeFactory.hxx
index 7907d0d..896249e 100644
--- a/chart2/source/view/inc/OpenglShapeFactory.hxx
+++ b/chart2/source/view/inc/OpenglShapeFactory.hxx
@@ -184,7 +184,7 @@ public:
 
     virtual void setPageSize( com::sun::star::uno::Reference < com::sun::star::drawing::XShapes > xChartShapes, const com::sun::star::awt::Size& rSize ) SAL_OVERRIDE;
 
-    virtual void render(com::sun::star::uno::Reference< com::sun::star::drawing::XShapes > xDrawPage, bool bInitOpenGL = true) SAL_OVERRIDE;
+    virtual void render(com::sun::star::uno::Reference< com::sun::star::drawing::XShapes > xDrawPage) SAL_OVERRIDE;
 
     virtual bool preRender(OpenGLWindow* pWindow) SAL_OVERRIDE;
     virtual void postRender(OpenGLWindow* pWindow) SAL_OVERRIDE;
diff --git a/chart2/source/view/inc/ShapeFactory.hxx b/chart2/source/view/inc/ShapeFactory.hxx
index 480c1b1..171daad 100644
--- a/chart2/source/view/inc/ShapeFactory.hxx
+++ b/chart2/source/view/inc/ShapeFactory.hxx
@@ -197,7 +197,7 @@ public:
     /**
      * not necessary right now
      */
-    virtual void render(com::sun::star::uno::Reference< com::sun::star::drawing::XShapes >, bool ) SAL_OVERRIDE {}
+    virtual void render(com::sun::star::uno::Reference< com::sun::star::drawing::XShapes > ) SAL_OVERRIDE {}
 
     virtual bool preRender(OpenGLWindow*) SAL_OVERRIDE { return true; }
     virtual void postRender(OpenGLWindow*) SAL_OVERRIDE {}
diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx
index d6f0430..8dc8046 100644
--- a/chart2/source/view/main/ChartView.cxx
+++ b/chart2/source/view/main/ChartView.cxx
@@ -166,7 +166,6 @@ public:
     virtual void scroll(long nDelta) SAL_OVERRIDE;
     virtual void contextDestroyed() SAL_OVERRIDE;
 
-    const OpenGLWindow* getOpenGLWindow() const;
     void updateOpenGLWindow();
 private:
     ChartView* mpView;
@@ -209,11 +208,6 @@ void GL2DRenderer::contextDestroyed()
     mbContextDestroyed = true;
 }
 
-const OpenGLWindow* GL2DRenderer::getOpenGLWindow() const
-{
-    return mpWindow;
-}
-
 void GL2DRenderer::updateOpenGLWindow()
 {
     if(mbContextDestroyed)
@@ -2771,7 +2765,7 @@ void ChartView::render()
     bool bRender = pShapeFactory->preRender(pWindow);
     if(bRender)
     {
-        pShapeFactory->render(mxRootShape, pWindow != mp2DRenderer->getOpenGLWindow());
+        pShapeFactory->render(mxRootShape);
         pShapeFactory->postRender(pWindow);
     }
 }
diff --git a/chart2/source/view/main/DummyXShape.hxx b/chart2/source/view/main/DummyXShape.hxx
index 54f5df4..ee9e1af 100644
--- a/chart2/source/view/main/DummyXShape.hxx
+++ b/chart2/source/view/main/DummyXShape.hxx
@@ -395,7 +395,6 @@ public:
     virtual void render() SAL_OVERRIDE;
 
     void clear();
-    void invalidateInit() { mbNotInit = true; }
     TextCache& getTextCache() { return maTextCache;}
 
 private:
diff --git a/chart2/source/view/main/OpenglShapeFactory.cxx b/chart2/source/view/main/OpenglShapeFactory.cxx
index a26024e..c486f01 100644
--- a/chart2/source/view/main/OpenglShapeFactory.cxx
+++ b/chart2/source/view/main/OpenglShapeFactory.cxx
@@ -446,13 +446,9 @@ uno::Reference< drawing::XShape >
     return pText;
 }
 
-void OpenglShapeFactory::render(uno::Reference< drawing::XShapes > xRootShape, bool bInitOpenGL)
+void OpenglShapeFactory::render(uno::Reference< drawing::XShapes > xRootShape)
 {
     dummy::DummyChart& rChart = dynamic_cast<dummy::DummyChart&>(*xRootShape.get());
-    if(bInitOpenGL)
-    {
-        rChart.invalidateInit();
-    }
     rChart.render();
 }
 


More information about the Libreoffice-commits mailing list