diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2017-12-13 22:08:20 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2017-12-18 12:38:04 +0100 |
commit | 55a7e836a2db662a53adc4f8b98d08b06790c758 (patch) | |
tree | 1453dceb8e253f700d895451d83b88b60948a1ff /chart2/source | |
parent | e1697600253361a26d77a1ef61f8bde16af0ed2c (diff) |
chart2: When creating objects prevent setting object rects dirty
3D objects using a E3dScene are traversing all object in the tree
when setting rects dirty. When we are creating objects, setting
properties and adding them to the tree we trigger setting rects
dirty which slows down considerably - more are added objects,
bigger the slowdown gets. So the solution here is to temporary
disable setting object rects dirty during creation of objects.
Change-Id: Id068cda9cb798d49b75bf4228cf6460f7e98c033
Reviewed-on: https://gerrit.libreoffice.org/46446
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'chart2/source')
-rw-r--r-- | chart2/source/view/charttypes/BarChart.cxx | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/chart2/source/view/charttypes/BarChart.cxx b/chart2/source/view/charttypes/BarChart.cxx index 41002429d900..34c28deb9057 100644 --- a/chart2/source/view/charttypes/BarChart.cxx +++ b/chart2/source/view/charttypes/BarChart.cxx @@ -26,6 +26,8 @@ #include <AxisIndexDefines.hxx> #include <Clipping.hxx> #include <DateHelper.hxx> +#include <svx/scene3d.hxx> +#include <svx/unoshape.hxx> #include <com/sun/star/chart/DataLabelPlacement.hpp> @@ -404,6 +406,20 @@ void BarChart::adaptOverlapAndGapwidthForGroupBarsPerAxis() } } +E3dScene* lcl_getE3dScene(uno::Reference<drawing::XShapes> const & xShapes) +{ + E3dScene* pScene = nullptr; + + SvxShape* pSvxShape = SvxShape::getImplementation(xShapes); + if (pSvxShape) + { + SdrObject* pObject = pSvxShape->GetSdrObject(); + if (pObject && dynamic_cast<const E3dScene*>(pObject) != nullptr) + pScene = static_cast<E3dScene*>(pObject); + } + return pScene; +} + void BarChart::createShapes() { if( m_aZSlots.empty() ) //no series @@ -761,9 +777,12 @@ void BarChart::createShapes() if( fTopHeight < 0 ) fTopHeight *= -1.0; + E3dScene* pScene = lcl_getE3dScene(xSeriesGroupShape_Shapes); + pScene->EnterObjectSetupMode(); xShape = createDataPoint3D_Bar( xSeriesGroupShape_Shapes, aTransformedBottom, aSize, fTopHeight, nRotateZAngleHundredthDegree , xDataPointProperties, nGeometry3D ); + pScene->ExitObjectSetupMode(); } else //m_nDimension!=3 { |