summaryrefslogtreecommitdiff
path: root/sw/source/core/attr
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-04-23 14:04:16 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-04-23 19:49:43 +0200
commitd4248915d7db69aa7bf31d9d6189b7375aca70ed (patch)
tree03e53496dd63b2a9725ede707c78cc02079d1018 /sw/source/core/attr
parent3cbcaa8d36ef889a28d790e18d68b838cfc46bb2 (diff)
pass SvxBrushItem around by unique_ptr
we never create an object that is actually shared, so this is wasted Note1: in IMPL_LINK_NOARG(SwEditRegionDlg, OkHdl, weld::Button&, void) there was a comparison if( aBrush != pRepr->GetBackground() || ... which I removed Note2: In bool SwDoc::GetBoxAttr( const SwCursor& rCursor, std::shared_ptr<SfxPoolItem>& rToFill ) which had a condition else if( rToFill != xBack ) I changed to compare contents Change-Id: Idd769f44917c5ccc7e9f4bfbaddf12f9cd4151cf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92791 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/core/attr')
-rw-r--r--sw/source/core/attr/format.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/sw/source/core/attr/format.cxx b/sw/source/core/attr/format.cxx
index ac03070f20d0..c856abb50b34 100644
--- a/sw/source/core/attr/format.cxx
+++ b/sw/source/core/attr/format.cxx
@@ -779,7 +779,7 @@ void SwFormat::SetGrabBagItem(const uno::Any& rVal)
m_pGrabBagItem->PutValue(rVal, 0);
}
-std::shared_ptr<SvxBrushItem> SwFormat::makeBackgroundBrushItem(bool bInP) const
+std::unique_ptr<SvxBrushItem> SwFormat::makeBackgroundBrushItem(bool bInP) const
{
if (supportsFullDrawingLayerFillAttributeSet())
{
@@ -792,7 +792,7 @@ std::shared_ptr<SvxBrushItem> SwFormat::makeBackgroundBrushItem(bool bInP) const
return getSvxBrushItemFromSourceSet(m_aSet, RES_BACKGROUND, bInP);
}
- return std::shared_ptr<SvxBrushItem>(m_aSet.GetBackground(bInP).Clone());
+ return std::unique_ptr<SvxBrushItem>(m_aSet.GetBackground(bInP).Clone());
}
drawinglayer::attribute::SdrAllFillAttributesHelperPtr SwFormat::getSdrAllFillAttributesHelper() const