diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-01-29 10:21:15 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-01-29 10:47:08 +0100 |
commit | 5e4d88a27802848ae23874a81592c2a6758d77e1 (patch) | |
tree | 8c96909d974988c5be0da730a0b02d6b2d87e69c /sc/source/ui/unoobj | |
parent | e7bd86b399e549ef51397e3ae46947d78852e9cc (diff) |
pass ScConditionalFormat around by unique_ptr
Change-Id: If15ac08d8334a386312870d3ebebb385cf55e5f6
Reviewed-on: https://gerrit.libreoffice.org/67050
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/ui/unoobj')
-rw-r--r-- | sc/source/ui/unoobj/cellsuno.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/unoobj/condformatuno.cxx | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx index ae441efc365d..4afafe7c91fb 100644 --- a/sc/source/ui/unoobj/cellsuno.cxx +++ b/sc/source/ui/unoobj/cellsuno.cxx @@ -2388,10 +2388,10 @@ void ScCellRangesBase::SetOnePropertyValue( const SfxItemPropertySimpleEntry* pE // Then we can apply new conditional format if there is one if (pFormat->getCount()) { - ScConditionalFormat* pNew = new ScConditionalFormat( 0, &rDoc ); // Index will be set on inserting + auto pNew = std::make_unique<ScConditionalFormat>( 0, &rDoc ); // Index will be set on inserting pFormat->FillFormat( *pNew, &rDoc, eGrammar ); pNew->SetRange( aRanges ); - pDocShell->GetDocFunc().ReplaceConditionalFormat( 0, pNew, nTab, aRanges ); + pDocShell->GetDocFunc().ReplaceConditionalFormat( 0, std::move(pNew), nTab, aRanges ); } // and repaint diff --git a/sc/source/ui/unoobj/condformatuno.cxx b/sc/source/ui/unoobj/condformatuno.cxx index 8456a8fb84e5..4685fd0387c4 100644 --- a/sc/source/ui/unoobj/condformatuno.cxx +++ b/sc/source/ui/unoobj/condformatuno.cxx @@ -357,9 +357,9 @@ sal_Int32 ScCondFormatsObj::createByRange(const uno::Reference< sheet::XSheetCel SCTAB nTab = aCoreRange[0].aStart.Tab(); - ScConditionalFormat* pNewFormat = new ScConditionalFormat(0, &mpDocShell->GetDocument()); + auto pNewFormat = std::make_unique<ScConditionalFormat>(0, &mpDocShell->GetDocument()); pNewFormat->SetRange(aCoreRange); - return mpDocShell->GetDocument().AddCondFormat(pNewFormat, nTab); + return mpDocShell->GetDocument().AddCondFormat(std::move(pNewFormat), nTab); } void ScCondFormatsObj::removeByID(const sal_Int32 nID) |