summaryrefslogtreecommitdiff
path: root/svx/source/sdr/properties/attributeproperties.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/attributeproperties.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/attributeproperties.cxx')
-rw-r--r--svx/source/sdr/properties/attributeproperties.cxx8
1 files changed, 4 insertions, 4 deletions
diff --git a/svx/source/sdr/properties/attributeproperties.cxx b/svx/source/sdr/properties/attributeproperties.cxx
index 532e0bc67294..de4a22f4f533 100644
--- a/svx/source/sdr/properties/attributeproperties.cxx
+++ b/svx/source/sdr/properties/attributeproperties.cxx
@@ -268,8 +268,7 @@ namespace sdr::properties
// problem with constructors and virtual functions in C++),
// thus DontRemoveHardAttr is not needed.
const_cast< AttributeProperties* >(this)->SetStyleSheet(
- mpStyleSheet,
- true);
+ mpStyleSheet, true, true);
}
}
@@ -360,7 +359,8 @@ namespace sdr::properties
}
}
- void AttributeProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr)
+ void AttributeProperties::SetStyleSheet(SfxStyleSheet* pNewStyleSheet, bool bDontRemoveHardAttr,
+ bool /*bBroadcast*/)
{
// guarantee SfxItemSet existence
GetObjectItemSet();
@@ -535,7 +535,7 @@ namespace sdr::properties
if(pDefaultStyleSheet != GetStyleSheet())
{
// do not delete hard attributes when setting dsefault Style
- SetStyleSheet(pDefaultStyleSheet, true);
+ SetStyleSheet(pDefaultStyleSheet, true, true);
}
}