summaryrefslogtreecommitdiff
path: root/svx/source/table
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2022-02-15 21:02:02 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-02-16 14:55:51 +0100
commitf04ae7a8b7be6205f6cbc645cb15e7a48f1df960 (patch)
tree6f63fefb45a31c5353801fec68c067d27623359a /svx/source/table
parent741ae431ed680ae66e9b242626eef0d8f274486a (diff)
speed up DefaultProperties::SetObjectItem when loading large chart
The cost of creating a SfxItemSet to pass around changed item information is surprisingly high, so avoid that and just pass the vector of changed items down (which we are already building anyway). Change-Id: Ifa48e3ce07fb6c92ad05a119ae95ce002af76199 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129976 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx/source/table')
-rw-r--r--svx/source/table/cell.cxx13
1 files changed, 8 insertions, 5 deletions
diff --git a/svx/source/table/cell.cxx b/svx/source/table/cell.cxx
index 4788c17c24d4..8f1dbe55ddca 100644
--- a/svx/source/table/cell.cxx
+++ b/svx/source/table/cell.cxx
@@ -166,7 +166,7 @@ namespace sdr::properties
void ForceDefaultAttributes() override;
- void ItemSetChanged(const SfxItemSet*) override;
+ void ItemSetChanged(o3tl::span< const SfxPoolItem* const > aChangedItems, sal_uInt16 nDeletedWhich) override;
void ItemChange(const sal_uInt16 nWhich, const SfxPoolItem* pNewItem = nullptr) override;
@@ -222,7 +222,7 @@ namespace sdr::properties
{
}
- void CellProperties::ItemSetChanged(const SfxItemSet* pSet )
+ void CellProperties::ItemSetChanged(o3tl::span< const SfxPoolItem* const > aChangedItems, sal_uInt16 nDeletedWhich)
{
SdrTextObj& rObj = static_cast<SdrTextObj&>(GetSdrObject());
@@ -253,12 +253,15 @@ namespace sdr::properties
// if the user sets character attributes to the complete
// cell we want to remove all hard set character attributes
// with same which ids from the text
- std::vector<sal_uInt16> aCharWhichIds(GetAllCharPropIds(*pSet));
+ std::vector<sal_uInt16> aCharWhichIds(GetAllCharPropIds(aChangedItems));
for(sal_Int32 nPara = 0; nPara < nParaCount; nPara++)
{
SfxItemSet aSet(pOutliner->GetParaAttribs(nPara));
- aSet.Put(*pSet);
+ for (const SfxPoolItem* pItem : aChangedItems)
+ aSet.Put(*pItem);
+ if (nDeletedWhich)
+ aSet.ClearItem(nDeletedWhich);
for (const auto& rWhichId : aCharWhichIds)
{
@@ -288,7 +291,7 @@ namespace sdr::properties
}
// call parent
- AttributeProperties::ItemSetChanged(pSet);
+ AttributeProperties::ItemSetChanged(aChangedItems, nDeletedWhich);
if( mxCell.is() )
mxCell->notifyModified();