[Libreoffice-commits] core.git: Branch 'private/moggi/chart-opengl-window-version2' - 2 commits - chart2/source sc/source
chart2/source/view/charttypes/GL3DBarChart.cxx |6 +- chart2/source/view/inc/3DChartObjects.hxx |2 +- chart2/source/view/main/3DChartObjects.cxx |3 ++- sc/source/ui/drawfunc/fuins2.cxx |2 +- 4 files changed, 9 insertions(+), 4 deletions(-) New commits: commit 98aa0b2f0893e1fb02849e2b867c424bf2efc455 Author: Markus Mohrhard markus.mohrh...@collabora.co.uk Date: Wed May 7 20:37:15 2014 +0200 provide bar color for 3D OGL chart Change-Id: Ia41748cabba89a0257c62f66a280810adc56960e diff --git a/chart2/source/view/charttypes/GL3DBarChart.cxx b/chart2/source/view/charttypes/GL3DBarChart.cxx index e21a34b..12a5417 100644 --- a/chart2/source/view/charttypes/GL3DBarChart.cxx +++ b/chart2/source/view/charttypes/GL3DBarChart.cxx @@ -17,6 +17,8 @@ #include 3DChartObjects.hxx #include GL3DRenderer.hxx +using namespace com::sun::star; + namespace chart { GL3DBarChart::GL3DBarChart(const std::vectorVDataSeries* rDataSeries, @@ -53,11 +55,13 @@ void GL3DBarChart::create3DShapes() float nXPos = nIndex * (nBarSizeX + nBarDistanceX); float nYPos = nSeriesIndex * (nBarSizeY + nBarDistanceY); +sal_Int32 nColor = COL_BLUE; + glm::mat4 aBarPosition; aBarPosition = glm::scale(aBarPosition, nBarSizeX, nBarSizeY, nVal); aBarPosition = glm::translate(aBarPosition, nXPos, nYPos, nVal/2); -maShapes.push_back(new opengl3D::Bar(mpRenderer.get(), aBarPosition, nId++)); +maShapes.push_back(new opengl3D::Bar(mpRenderer.get(), aBarPosition, nColor, nId++)); } ++nSeriesIndex; diff --git a/chart2/source/view/inc/3DChartObjects.hxx b/chart2/source/view/inc/3DChartObjects.hxx index e9490e3..666d097 100644 --- a/chart2/source/view/inc/3DChartObjects.hxx +++ b/chart2/source/view/inc/3DChartObjects.hxx @@ -37,7 +37,7 @@ protected: class Bar : public Renderable3DObject { public: -Bar(OpenGL3DRenderer* pRenderer, const glm::mat4 rPosition, sal_uInt32 nId); +Bar(OpenGL3DRenderer* pRenderer, const glm::mat4 rPosition, sal_Int32 nColor, sal_uInt32 nId); virtual void render() SAL_OVERRIDE; private: diff --git a/chart2/source/view/main/3DChartObjects.cxx b/chart2/source/view/main/3DChartObjects.cxx index 86f9c63..c43b999 100644 --- a/chart2/source/view/main/3DChartObjects.cxx +++ b/chart2/source/view/main/3DChartObjects.cxx @@ -24,10 +24,11 @@ void Renderable3DObject::render() (void) mnUniqueId; } -Bar::Bar(OpenGL3DRenderer* pRenderer, const glm::mat4 rPosition, sal_uInt32 nId) +Bar::Bar(OpenGL3DRenderer* pRenderer, const glm::mat4 rPosition, sal_Int32 aColor, sal_uInt32 nId) : Renderable3DObject(pRenderer, nId) , mbRoundedCorners(false) , maPos(rPosition) +, maColor(aColor) { } commit 65109f43338f2ee7b5b295cd28123f04d51f96e3 Author: Markus Mohrhard markus.mohrh...@collabora.co.uk Date: Wed May 7 20:35:42 2014 +0200 fix crash when canceling the chart wizard Change-Id: Iebd9db279e9db22bc273509cf480737d7c7a1dd6 diff --git a/sc/source/ui/drawfunc/fuins2.cxx b/sc/source/ui/drawfunc/fuins2.cxx index 873588d..0c941b2 100644 --- a/sc/source/ui/drawfunc/fuins2.cxx +++ b/sc/source/ui/drawfunc/fuins2.cxx @@ -724,7 +724,7 @@ FuInsertChart::FuInsertChart(ScTabViewShell* pViewSh, Window* pWin, ScDrawView* sal_Int16 nDialogRet = xDialog-execute(); if( nDialogRet == ui::dialogs::ExecutableDialogResults::CANCEL ) { -delete pWindow; +delete pChildWindow; // leave OLE inplace mode and unmark OSL_ASSERT( pViewShell ); OSL_ASSERT( pView ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'private/moggi/chart-opengl-window-version2' - 2 commits - chart2/source sc/source
chart2/source/view/main/ChartView.cxx | 10 ++ sc/source/ui/drawfunc/fuins2.cxx | 13 +++-- sc/source/ui/inc/gridwin.hxx |7 +++ sc/source/ui/view/gridwin5.cxx|5 + 4 files changed, 33 insertions(+), 2 deletions(-) New commits: commit ab04cf268c0ef482b78f142b8de057f5b25b9239 Author: Markus Mohrhard markus.mohrh...@collabora.co.uk Date: Wed May 7 21:01:47 2014 +0200 fix crash on exit Change-Id: I31374684a09f1b056154efcaa5c7dfe73bcc1a61 diff --git a/sc/source/ui/drawfunc/fuins2.cxx b/sc/source/ui/drawfunc/fuins2.cxx index 0c941b2..2043ff9 100644 --- a/sc/source/ui/drawfunc/fuins2.cxx +++ b/sc/source/ui/drawfunc/fuins2.cxx @@ -82,6 +82,7 @@ using namespace ::com::sun::star; #include globstr.hrc #include drawview.hxx #include markdata.hxx +#include gridwin.hxx namespace { @@ -544,11 +545,19 @@ FuInsertChart::FuInsertChart(ScTabViewShell* pViewSh, Window* pWin, ScDrawView* ScDocument* pScDoc = pScDocSh-GetDocument(); bool bUndo (pScDoc-IsUndoEnabled()); -OpenGLWindow* pChildWindow = new OpenGLWindow(pData-GetActiveWin()); +Window* pParentWindow = pData-GetActiveWin(); +ScGridWindow* pGridWindow = dynamic_castScGridWindow*(pParentWindow); +if(pGridWindow) +{ +pGridWindow-AddChildWindow(pGridWindow); +} +else +SAL_WARN(sc, not a grid window. Youare in serious trouble); +OpenGLWindow* pChildWindow = new OpenGLWindow(pParentWindow); Size aWindowSize = pChildWindow-LogicToPixel( aSize, MapMode( MAP_100TH_MM ) ); pChildWindow-SetSizePixel(aWindowSize); Wallpaper aBackground = pChildWindow-GetBackground(); -aBackground.SetColor(COL_RED); +aBackground.SetColor(COL_BLUE); pChildWindow-SetBackground(aBackground); pChildWindow-Show(); uno::Reference chart2::X3DChartWindowProvider x3DWindowProvider( xChartModel, uno::UNO_QUERY_THROW ); diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx index 63e930b..5170e25 100644 --- a/sc/source/ui/inc/gridwin.hxx +++ b/sc/source/ui/inc/gridwin.hxx @@ -32,6 +32,7 @@ #include boost/scoped_ptr.hpp #include boost/unordered_map.hpp #include boost/ptr_container/ptr_map.hpp +#include boost/ptr_container/ptr_vector.hpp namespace editeng { struct MisspellRanges; @@ -129,6 +130,7 @@ class ScGridWindow : public Window, public DropTargetHelper, public DragSourceHe VisibleRange maVisibleRange; boost::scoped_ptrsc::SpellCheckContext mpSpellCheckCxt; +boost::ptr_vectorWindow maChildWindows; ScViewData* pViewData; ScSplitPos eWhich; @@ -409,6 +411,11 @@ public: voidUpdateShrinkOverlay(); voidUpdateAllOverlays(); +/** + * Takes ownership of the window + */ +voidAddChildWindow(Window* pChildWindow); + protected: // #114409# void ImpCreateOverlayObjects(); diff --git a/sc/source/ui/view/gridwin5.cxx b/sc/source/ui/view/gridwin5.cxx index 404ca59..798d34a 100644 --- a/sc/source/ui/view/gridwin5.cxx +++ b/sc/source/ui/view/gridwin5.cxx @@ -474,4 +474,9 @@ void ScGridWindow::SwitchView() } } +void ScGridWindow::AddChildWindow(Window* pWindow) +{ +maChildWindows.push_back(pWindow); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ commit ee8f7b518353538c31e3dabf5bbc1bdf86a48454 Author: Markus Mohrhard markus.mohrh...@collabora.co.uk Date: Wed May 7 21:01:28 2014 +0200 hide OpenGLWindow in normal charts Change-Id: Ie45a910d2b99b7644a8055476aa191ef8a724d38 diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx index 79eec7b..93d4133 100644 --- a/chart2/source/view/main/ChartView.cxx +++ b/chart2/source/view/main/ChartView.cxx @@ -2459,6 +2459,14 @@ void ChartView::createShapes() createShapes3D(); return; } +else +{ +// hide OpenGL window for now in normal charts +OpenGLWindow* pWindow = mrChartModel.getOpenGLWindow(); +if(pWindow) +pWindow-Show(false); + +} #endif { @@ -3149,6 +3157,8 @@ void ChartView::createShapes3D() if(!pWindow) return; +pWindow-Show(); + GL3DBarChart aBarChart(aDataSeries, *pWindow); aBarChart.create3DShapes(); aBarChart.render(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits