summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-04-20 13:03:33 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-04-21 07:58:14 +0200
commitc757117afb398277a46e79ba22066c5bbf2c9f72 (patch)
tree0c27216e2364d8e8f0c27caf7accda36bfbc2ab2 /include
parenteb5606511fac2a8ee1af7cc03c12d6c5b16f7c96 (diff)
tdf#81765 slow loading of .ods with >1000 of conditional formats, part 2
This takes the loading time from 15s to 14s. Reduce unnecessary allocation/copying by passing down ownership of the newly created ScPatternAttr to the item pool Change-Id: Iec38bbff572d10ff8d86f5e65fbe9a96b6a5a706 Reviewed-on: https://gerrit.libreoffice.org/71010 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include')
-rw-r--r--include/svl/itempool.hxx7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/svl/itempool.hxx b/include/svl/itempool.hxx
index f987cf15ae62..391e1b942544 100644
--- a/include/svl/itempool.hxx
+++ b/include/svl/itempool.hxx
@@ -146,7 +146,10 @@ public:
virtual SfxItemPool* Clone() const;
const OUString& GetName() const;
- virtual const SfxPoolItem& Put( const SfxPoolItem&, sal_uInt16 nWhich = 0 );
+ const SfxPoolItem& Put( std::unique_ptr<SfxPoolItem> xItem, sal_uInt16 nWhich = 0 )
+ { return PutImpl( *xItem.release(), nWhich, /*bPassingOwnership*/true); }
+ const SfxPoolItem& Put( const SfxPoolItem& rItem, sal_uInt16 nWhich = 0 )
+ { return PutImpl( rItem, nWhich, /*bPassingOwnership*/false); }
void Remove( const SfxPoolItem& );
const SfxPoolItem& GetDefaultItem( sal_uInt16 nWhich ) const;
@@ -195,6 +198,8 @@ public:
void dumpAsXml(xmlTextWriterPtr pWriter) const;
+protected:
+ virtual const SfxPoolItem& PutImpl( const SfxPoolItem&, sal_uInt16 nWhich = 0, bool bPassingOwnership = false );
private:
const SfxItemPool& operator=(const SfxItemPool &) = delete;