diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2017-12-13 22:08:20 +0900 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2018-03-19 19:00:26 +0100 |
commit | b2b3e9bf87cf901c22958424920bb263c6d77ae1 (patch) | |
tree | e358a12015f98677ddba8770a06476f1bc8cb02f /chart2 | |
parent | 394e63997e9ff9eff272946e412804864ff86b86 (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>
(cherry picked from commit 55a7e836a2db662a53adc4f8b98d08b06790c758)
Diffstat (limited to 'chart2')
-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 476dc39d36fb..5700e7b29b25 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 @@ -776,9 +792,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 { |