diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-02-21 14:00:09 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-02-21 15:12:29 +0100 |
commit | d39f886ea541f71a09d1d7140c77852b01c847f0 (patch) | |
tree | 506dfb5867bec821456e09593e38d9d7ac88859d /svx | |
parent | e4aaf59f4801431d5bdd1aa6e18d2aa8eba39f1c (diff) |
speed up SvxShape::_setPropertyValue
by using the Properties related code to create an SfxItemSet with the
correct ranges, instead of creating an empty SfxItemSet and updating it.
Shaves 2% off the load time of a large chart.
Change-Id: Ia1f8527fa52ab5b8c70e13e1e2ab8c8f25739b2b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130270
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx')
-rw-r--r-- | svx/inc/sdr/properties/emptyproperties.hxx | 3 | ||||
-rw-r--r-- | svx/inc/sdr/properties/groupproperties.hxx | 3 | ||||
-rw-r--r-- | svx/inc/sdr/properties/pageproperties.hxx | 3 | ||||
-rw-r--r-- | svx/source/sdr/properties/emptyproperties.cxx | 6 | ||||
-rw-r--r-- | svx/source/sdr/properties/groupproperties.cxx | 5 | ||||
-rw-r--r-- | svx/source/sdr/properties/pageproperties.cxx | 5 | ||||
-rw-r--r-- | svx/source/unodraw/unoshape.cxx | 6 |
7 files changed, 26 insertions, 5 deletions
diff --git a/svx/inc/sdr/properties/emptyproperties.hxx b/svx/inc/sdr/properties/emptyproperties.hxx index 974bfd90a21d..f51c97a01ff9 100644 --- a/svx/inc/sdr/properties/emptyproperties.hxx +++ b/svx/inc/sdr/properties/emptyproperties.hxx @@ -39,6 +39,9 @@ namespace sdr::properties // Clone() operator, normally just calls the local copy constructor virtual std::unique_ptr<BaseProperties> Clone(SdrObject& rObj) const override; + // create a new object specific itemset with object specific ranges. + virtual SfxItemSet CreateObjectSpecificItemSet(SfxItemPool& pPool) override; + // get itemset virtual const SfxItemSet& GetObjectItemSet() const override; diff --git a/svx/inc/sdr/properties/groupproperties.hxx b/svx/inc/sdr/properties/groupproperties.hxx index a5798440f983..40e944eb572a 100644 --- a/svx/inc/sdr/properties/groupproperties.hxx +++ b/svx/inc/sdr/properties/groupproperties.hxx @@ -37,6 +37,9 @@ namespace sdr::properties // destructor virtual ~GroupProperties() override; + // create a new object specific itemset with object specific ranges. + virtual SfxItemSet CreateObjectSpecificItemSet(SfxItemPool& pPool) override; + // Clone() operator, normally just calls the local copy constructor virtual std::unique_ptr<BaseProperties> Clone(SdrObject& rObj) const override; diff --git a/svx/inc/sdr/properties/pageproperties.hxx b/svx/inc/sdr/properties/pageproperties.hxx index d0f633a80e16..acd1d919f24e 100644 --- a/svx/inc/sdr/properties/pageproperties.hxx +++ b/svx/inc/sdr/properties/pageproperties.hxx @@ -41,6 +41,9 @@ namespace sdr::properties // destructor virtual ~PageProperties() override; + // create a new object specific itemset with object specific ranges. + virtual SfxItemSet CreateObjectSpecificItemSet(SfxItemPool& pPool) override; + // Clone() operator, normally just calls the local copy constructor virtual std::unique_ptr<BaseProperties> Clone(SdrObject& rObj) const override; diff --git a/svx/source/sdr/properties/emptyproperties.cxx b/svx/source/sdr/properties/emptyproperties.cxx index d358955987f4..1cad150b22a7 100644 --- a/svx/source/sdr/properties/emptyproperties.cxx +++ b/svx/source/sdr/properties/emptyproperties.cxx @@ -42,6 +42,12 @@ namespace sdr::properties abort(); } + SfxItemSet EmptyProperties::CreateObjectSpecificItemSet(SfxItemPool&) + { + assert(!"EmptyProperties::CreateObjectSpecificItemSet() should never be called"); + abort(); + } + void EmptyProperties::SetObjectItem(const SfxPoolItem& /*rItem*/) { assert(!"EmptyProperties::SetObjectItem() should never be called"); diff --git a/svx/source/sdr/properties/groupproperties.cxx b/svx/source/sdr/properties/groupproperties.cxx index 011d252702e0..d0662d37f4e8 100644 --- a/svx/source/sdr/properties/groupproperties.cxx +++ b/svx/source/sdr/properties/groupproperties.cxx @@ -46,6 +46,11 @@ namespace sdr::properties return std::unique_ptr<BaseProperties>(new GroupProperties(rObj)); } + SfxItemSet GroupProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool) + { + return SfxItemSet(rPool); + } + const SfxItemSet& GroupProperties::GetObjectItemSet() const { assert(!"GroupProperties::GetObjectItemSet() should never be called"); diff --git a/svx/source/sdr/properties/pageproperties.cxx b/svx/source/sdr/properties/pageproperties.cxx index fbbf212c85f1..af43229a1a63 100644 --- a/svx/source/sdr/properties/pageproperties.cxx +++ b/svx/source/sdr/properties/pageproperties.cxx @@ -47,6 +47,11 @@ namespace sdr::properties return std::unique_ptr<BaseProperties>(new PageProperties(*this, rObj)); } + SfxItemSet PageProperties::CreateObjectSpecificItemSet(SfxItemPool& rPool) + { + return SfxItemSet(rPool); + } + // get itemset. Override here to allow creating the empty itemset // without asserting const SfxItemSet& PageProperties::GetObjectItemSet() const diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx index 3936af09616e..86c2cb74af5f 100644 --- a/svx/source/unodraw/unoshape.cxx +++ b/svx/source/unodraw/unoshape.cxx @@ -1626,11 +1626,7 @@ void SvxShape::_setPropertyValue( const OUString& rPropertyName, const uno::Any& { if( !mpImpl->mxItemSet ) { - mpImpl->mxItemSet.emplace( GetSdrObject()->getSdrModelFromSdrObject().GetItemPool(), pMap->nWID, pMap->nWID ); - } - else - { - mpImpl->mxItemSet->MergeRange(pMap->nWID, pMap->nWID); + mpImpl->mxItemSet.emplace( GetSdrObject()->GetProperties().CreateObjectSpecificItemSet( GetSdrObject()->getSdrModelFromSdrObject().GetItemPool() ) ); } pSet = &*mpImpl->mxItemSet; } |