summaryrefslogtreecommitdiff
path: root/svx/source/sdr/properties/rectangleproperties.cxx
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2022-01-06 14:40:41 +0100
committerLuboš Luňák <l.lunak@collabora.com>2022-01-11 15:23:29 +0100
commit4c3384dd6c4a92404d170f9011c569de045dfbf7 (patch)
tree9457b51aecbbe073462f45b54d5870a695850b8c /svx/source/sdr/properties/rectangleproperties.cxx
parent5b7a32ac6e39d2c5991ee2fbdcf7d40556747578 (diff)
do not call broadcast SetStyleSheet from a non-broadcast one
In the document from bsc#1183308, which contains a large number of custom shapes, I get a noticeable time spent in the callchain EnhancedCustomShapeEngine::render() -> SdrObject::NbcSetStyleSheet() -> sdr::properties::GroupProperties::SetStyleSheet() -> SdrObject::SetStyleSheet(), which means that a non-broadcast call ends up in a broadcast one, and the time is spent in SvxShape::Notify(). And it even seems that nobody actually cares about the broadcasts, possibly because the SfxStyleSheet* value is actually the same. I originally tried to make SdrObject::SetStyleSheet() return if the SfxStyleSheet* is the same, but that fails the test from 717dc8e3575a18e1e. I don't quite understand the reasoning for that, but solve it then by changing the code to call the Nbc variant if that's enough. Change-Id: I096a6799a0dc51c31ec3b0ba070c7f99ec96ac5d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/128048 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'svx/source/sdr/properties/rectangleproperties.cxx')
-rw-r--r--svx/source/sdr/properties/rectangleproperties.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/svx/source/sdr/properties/rectangleproperties.cxx b/svx/source/sdr/properties/rectangleproperties.cxx
index 894df2a2cc93..0ff4286b93e0 100644
--- a/svx/source/sdr/properties/rectangleproperties.cxx
+++ b/svx/source/sdr/properties/rectangleproperties.cxx
@@ -54,10 +54,11 @@ namespace sdr::properties
}
// set a new StyleSheet and broadcast
- void RectangleProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr)
+ void RectangleProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr,
+ bool bBroadcast)
{
// call parent (always first thing to do, may create the SfxItemSet)
- TextProperties::SetStyleSheet(pNewStyleSheet, bDontRemoveHardAttr);
+ TextProperties::SetStyleSheet(pNewStyleSheet, bDontRemoveHardAttr, bBroadcast);
// local changes
SdrRectObj& rObj = static_cast<SdrRectObj&>(GetSdrObject());