From 18d6373d3ae767d3f06d53acd3b1f88f008c4bf4 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 8 Sep 2021 09:37:45 +0200 Subject: reduce cost of creating large charts (tdf#144052) creating a temporary SfxItemSet for each geometry object adds up fast, so only create the temporary for those SdrTextObj subclasses that need it. Change-Id: I0c03a630057718f09c12a4a2d07ad23fca46fd2d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121800 Tested-by: Jenkins Reviewed-by: Noel Grandin --- include/svx/sdr/properties/defaultproperties.hxx | 2 +- include/svx/sdr/properties/properties.hxx | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'include/svx') diff --git a/include/svx/sdr/properties/defaultproperties.hxx b/include/svx/sdr/properties/defaultproperties.hxx index e901278d3b3e..b7e5d706aff1 100644 --- a/include/svx/sdr/properties/defaultproperties.hxx +++ b/include/svx/sdr/properties/defaultproperties.hxx @@ -52,7 +52,7 @@ namespace sdr::properties virtual void PostItemChange(const sal_uInt16 nWhich) override; // react on ItemSet changes - virtual void ItemSetChanged(const SfxItemSet& rSet) override; + virtual void ItemSetChanged(const SfxItemSet*) override; // check if SfxItemSet exists bool HasSfxItemSet() const { return bool(mxItemSet); } diff --git a/include/svx/sdr/properties/properties.hxx b/include/svx/sdr/properties/properties.hxx index 600522981dc0..f27aa5d39d3e 100644 --- a/include/svx/sdr/properties/properties.hxx +++ b/include/svx/sdr/properties/properties.hxx @@ -104,7 +104,10 @@ namespace sdr::properties virtual void PostItemChange(const sal_uInt16 nWhich) = 0; // Internally react on ItemSet changes. The given ItemSet contains all changed items, the new ones. - virtual void ItemSetChanged(const SfxItemSet& rSet) = 0; + virtual void ItemSetChanged(const SfxItemSet*) = 0; + // Subclasses need to return true if they want the ItemSetChanged() callback to actually have a non-zero pointer. + // We do this because creating the temporary item set is expensive and seldom used. + virtual bool WantItemSetInItemSetChanged() const { return false; } public: // basic constructor, used from SdrObject. -- cgit