diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-02-17 12:19:49 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-02-27 19:42:58 +0100 |
commit | 31e7845339b30a69f06a04619660398fe4267268 (patch) | |
tree | 049ffea6c16bfa05e798ca9dac81aa1a05a17aef /sfx2/source/appl | |
parent | c97a3592c78ce276a353f95ce68c70a8a39174a0 (diff) |
use more SfxItemSet::CloneAsValue
to reduce heap allocations
Change-Id: Ia755c3e7f9610a5441a447cc74ea38ebcef068bc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130066
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sfx2/source/appl')
-rw-r--r-- | sfx2/source/appl/appopen.cxx | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx index 5d8a28b7d21c..a2e3fc5e3f10 100644 --- a/sfx2/source/appl/appopen.cxx +++ b/sfx2/source/appl/appopen.cxx @@ -388,11 +388,11 @@ ErrCode SfxApplication::LoadTemplate( SfxObjectShellLock& xDoc, const OUString & css::uno::Reference< css::frame::XModel > xModel = xDoc->GetModel(); if ( xModel.is() ) { - std::unique_ptr<SfxItemSet> pNew = xDoc->GetMedium()->GetItemSet()->Clone(); - pNew->ClearItem( SID_PROGRESS_STATUSBAR_CONTROL ); - pNew->ClearItem( SID_FILTER_NAME ); + SfxItemSet aNew = xDoc->GetMedium()->GetItemSet()->CloneAsValue(); + aNew.ClearItem( SID_PROGRESS_STATUSBAR_CONTROL ); + aNew.ClearItem( SID_FILTER_NAME ); css::uno::Sequence< css::beans::PropertyValue > aArgs; - TransformItems( SID_OPENDOC, *pNew, aArgs ); + TransformItems( SID_OPENDOC, aNew, aArgs ); sal_Int32 nLength = aArgs.getLength(); aArgs.realloc( nLength + 1 ); auto pArgs = aArgs.getArray(); |