summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-04-30 12:22:14 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-04-30 13:14:32 +0200
commite00c87caa399d37426d839f5264a747c115d0b12 (patch)
tree42418f076529d02e5bbbb405a48c65aacc478ae3
parent492675180203b3409074923d7993429237611f99 (diff)
loplugin:makeshared in sw
Change-Id: I58d91e75ef96beaab7ec34df519ae3a376dce976 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93201 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--sw/inc/format.hxx2
-rw-r--r--sw/qa/inc/swmodeltestbase.hxx6
-rw-r--r--sw/source/core/attr/format.cxx6
-rw-r--r--sw/source/core/docnode/ndtbl1.cxx2
-rw-r--r--sw/source/core/inc/unoparaframeenum.hxx4
-rw-r--r--sw/source/core/unocore/unoframe.cxx2
-rw-r--r--sw/source/core/unocore/unoobj2.cxx4
-rw-r--r--sw/source/filter/basflt/fltini.cxx2
-rw-r--r--sw/source/filter/basflt/fltshell.cxx4
-rw-r--r--sw/source/filter/inc/fltshell.hxx2
-rw-r--r--sw/source/filter/ww8/docxexport.cxx4
-rw-r--r--sw/source/filter/ww8/rtfexport.cxx2
-rw-r--r--sw/source/filter/ww8/wrtww8.cxx9
-rw-r--r--sw/source/filter/ww8/wrtww8.hxx2
-rw-r--r--sw/source/filter/ww8/ww8par.cxx6
-rw-r--r--sw/source/filter/ww8/ww8par5.cxx2
-rw-r--r--sw/source/filter/ww8/ww8par6.cxx2
-rw-r--r--sw/source/ui/dialog/swdlgfact.cxx50
-rw-r--r--sw/source/ui/dialog/swdlgfact.hxx22
-rw-r--r--sw/source/uibase/inc/swrenamexnameddlg.hxx4
-rw-r--r--sw/source/uibase/shells/frmsh.cxx6
-rw-r--r--sw/source/uibase/shells/tabsh.cxx4
-rw-r--r--sw/source/uibase/shells/textsh.cxx2
-rw-r--r--sw/source/uibase/uiview/formatclipboard.cxx9
-rw-r--r--sw/source/uibase/uiview/viewtab.cxx2
25 files changed, 78 insertions, 82 deletions
diff --git a/sw/inc/format.hxx b/sw/inc/format.hxx
index 8a8c984ec58f..b0025beb7958 100644
--- a/sw/inc/format.hxx
+++ b/sw/inc/format.hxx
@@ -96,7 +96,7 @@ public:
}
SfxItemState GetItemState( sal_uInt16 nWhich, bool bSrchInParent = true,
const SfxPoolItem **ppItem = nullptr ) const;
- SfxItemState GetBackgroundState(std::shared_ptr<SvxBrushItem>& rItem) const;
+ SfxItemState GetBackgroundState(std::unique_ptr<SvxBrushItem>& rItem) const;
virtual bool SetFormatAttr( const SfxPoolItem& rAttr );
virtual bool SetFormatAttr( const SfxItemSet& rSet );
virtual bool ResetFormatAttr( sal_uInt16 nWhich1, sal_uInt16 nWhich2 = 0 );
diff --git a/sw/qa/inc/swmodeltestbase.hxx b/sw/qa/inc/swmodeltestbase.hxx
index dcc7b6a146c1..60b652c59b77 100644
--- a/sw/qa/inc/swmodeltestbase.hxx
+++ b/sw/qa/inc/swmodeltestbase.hxx
@@ -937,19 +937,19 @@ protected:
return parseXmlStream(maTempFile.GetStream(StreamMode::READ));
}
- std::shared_ptr<SvStream> parseExportStream(const OUString& url, const OUString& rStreamName)
+ std::unique_ptr<SvStream> parseExportStream(const OUString& url, const OUString& rStreamName)
{
// Read the stream we're interested in.
uno::Reference<packages::zip::XZipFileAccess2> xNameAccess = packages::zip::ZipFileAccess::createWithURL(comphelper::getComponentContext(m_xSFactory), url);
uno::Reference<io::XInputStream> xInputStream(xNameAccess->getByName(rStreamName), uno::UNO_QUERY);
CPPUNIT_ASSERT(xInputStream.is());
- std::shared_ptr<SvStream> pStream(utl::UcbStreamHelper::CreateStream(xInputStream, true));
+ std::unique_ptr<SvStream> pStream(utl::UcbStreamHelper::CreateStream(xInputStream, true));
return pStream;
}
xmlDocPtr parseExportInternal(const OUString& url, const OUString& rStreamName)
{
- std::shared_ptr<SvStream> pStream(parseExportStream(url, rStreamName));
+ std::unique_ptr<SvStream> pStream(parseExportStream(url, rStreamName));
xmlDocPtr pXmlDoc = parseXmlStream(pStream.get());
pXmlDoc->name = reinterpret_cast<char *>(xmlStrdup(reinterpret_cast<xmlChar const *>(OUStringToOString(url, RTL_TEXTENCODING_UTF8).getStr())));
diff --git a/sw/source/core/attr/format.cxx b/sw/source/core/attr/format.cxx
index c856abb50b34..30f72d7fc3ac 100644
--- a/sw/source/core/attr/format.cxx
+++ b/sw/source/core/attr/format.cxx
@@ -380,7 +380,7 @@ const SfxPoolItem& SwFormat::GetFormatAttr( sal_uInt16 nWhich, bool bInParents )
{
// FALLBACKBREAKHERE should not be used; instead use [XATTR_FILL_FIRST .. XATTR_FILL_LAST]
SAL_INFO("sw.core", "Do no longer use SvxBrushItem, instead use [XATTR_FILL_FIRST .. XATTR_FILL_LAST] FillAttributes or makeBackgroundBrushItem (simple fallback is in place and used)");
- static std::shared_ptr<SvxBrushItem> aSvxBrushItem; //(std::make_shared<SvxBrushItem>(RES_BACKGROUND));
+ static std::unique_ptr<SvxBrushItem> aSvxBrushItem; //(std::make_shared<SvxBrushItem>(RES_BACKGROUND));
// fill the local static SvxBrushItem from the current ItemSet so that
// the fill attributes [XATTR_FILL_FIRST .. XATTR_FILL_LAST] are used
@@ -407,7 +407,7 @@ SfxItemState SwFormat::GetItemState( sal_uInt16 nWhich, bool bSrchInParent, cons
// if yes, fill the local SvxBrushItem using the new fill attributes
// as good as possible to have an instance for the pointer to point
// to and return as state that it is set
- static std::shared_ptr<SvxBrushItem> aSvxBrushItem; //(RES_BACKGROUND);
+ static std::unique_ptr<SvxBrushItem> aSvxBrushItem; //(RES_BACKGROUND);
aSvxBrushItem = getSvxBrushItemFromSourceSet(m_aSet, RES_BACKGROUND, bSrchInParent);
if( ppItem )
@@ -427,7 +427,7 @@ SfxItemState SwFormat::GetItemState( sal_uInt16 nWhich, bool bSrchInParent, cons
return m_aSet.GetItemState( nWhich, bSrchInParent, ppItem );
}
-SfxItemState SwFormat::GetBackgroundState(std::shared_ptr<SvxBrushItem>& rItem) const
+SfxItemState SwFormat::GetBackgroundState(std::unique_ptr<SvxBrushItem>& rItem) const
{
if (supportsFullDrawingLayerFillAttributeSet())
{
diff --git a/sw/source/core/docnode/ndtbl1.cxx b/sw/source/core/docnode/ndtbl1.cxx
index 8d8fa399ac9a..6dc3814db244 100644
--- a/sw/source/core/docnode/ndtbl1.cxx
+++ b/sw/source/core/docnode/ndtbl1.cxx
@@ -885,7 +885,7 @@ void SwDoc::SetTabLineStyle( const SwCursor& rCursor,
const_cast<SwTableBox*>(pCell->GetTabBox())->ClaimFrameFormat();
SwFrameFormat *pFormat = pCell->GetFormat();
- std::shared_ptr<SvxBoxItem> aBox(pFormat->GetBox().Clone());
+ std::unique_ptr<SvxBoxItem> aBox(pFormat->GetBox().Clone());
if ( !pBorderLine && bSetLine )
{
diff --git a/sw/source/core/inc/unoparaframeenum.hxx b/sw/source/core/inc/unoparaframeenum.hxx
index 17b1b0013b36..e3712cf28b8b 100644
--- a/sw/source/core/inc/unoparaframeenum.hxx
+++ b/sw/source/core/inc/unoparaframeenum.hxx
@@ -44,8 +44,8 @@ struct FrameClientSortListEntry
std::shared_ptr<sw::FrameClient> pFrameClient;
FrameClientSortListEntry (sal_Int32 const i_nIndex,
- sal_uInt32 const i_nOrder, sw::FrameClient* const i_pClient)
- : nIndex(i_nIndex), nOrder(i_nOrder), pFrameClient(i_pClient) { }
+ sal_uInt32 const i_nOrder, std::shared_ptr<sw::FrameClient> i_pClient)
+ : nIndex(i_nIndex), nOrder(i_nOrder), pFrameClient(std::move(i_pClient)) { }
};
typedef std::deque< FrameClientSortListEntry >
diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx
index 99d0098fcf72..d453f1c79709 100644
--- a/sw/source/core/unocore/unoframe.cxx
+++ b/sw/source/core/unocore/unoframe.cxx
@@ -339,7 +339,7 @@ bool BaseFrameProperties_Impl::FillBaseProperties(SfxItemSet& rToSet, const SfxI
if(bXFillStyleItemUsed)
{
XFillStyleItem aXFillStyleItem;
- std::shared_ptr<SvxBrushItem> aBrush(std::make_shared<SvxBrushItem>(RES_BACKGROUND));
+ std::unique_ptr<SvxBrushItem> aBrush(std::make_unique<SvxBrushItem>(RES_BACKGROUND));
if(pXFillStyleItem)
{
diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx
index 600ee1fca9f8..9f0dc5d8eb9e 100644
--- a/sw/source/core/unocore/unoobj2.cxx
+++ b/sw/source/core/unocore/unoobj2.cxx
@@ -127,7 +127,7 @@ struct FrameClientSortListLess
const auto nIdx =
rFormat.GetAnchor().GetContentAnchor()->nContent.GetIndex();
const auto nOrder = rFormat.GetAnchor().GetOrder();
- FrameClientSortListEntry entry(nIdx, nOrder, new sw::FrameClient(&rFormat));
+ FrameClientSortListEntry entry(nIdx, nOrder, std::make_shared<sw::FrameClient>(&rFormat));
rFrames.push_back(entry);
}
}
@@ -174,7 +174,7 @@ void CollectFrameAtNode( const SwNodeIndex& rIdx,
const sal_Int32 nIndex = pAnchorPos->nContent.GetIndex();
sal_uInt32 nOrder = rAnchor.GetOrder();
- FrameClientSortListEntry entry(nIndex, nOrder, new sw::FrameClient(const_cast<SwFrameFormat*>(pFormat)));
+ FrameClientSortListEntry entry(nIndex, nOrder, std::make_shared<sw::FrameClient>(const_cast<SwFrameFormat*>(pFormat)));
rFrames.push_back(entry);
}
}
diff --git a/sw/source/filter/basflt/fltini.cxx b/sw/source/filter/basflt/fltini.cxx
index f76ae2684a61..a36bc9ae0603 100644
--- a/sw/source/filter/basflt/fltini.cxx
+++ b/sw/source/filter/basflt/fltini.cxx
@@ -276,7 +276,7 @@ void CalculateFlySize(SfxItemSet& rFlySet, const SwNodeIndex& rAnchor,
if( SfxItemState::SET != rFlySet.GetItemState( RES_FRM_SIZE, true, &pItem ) ||
MINFLY > static_cast<const SwFormatFrameSize*>(pItem)->GetWidth() )
{
- std::shared_ptr<SwFormatFrameSize> aSz(rFlySet.Get(RES_FRM_SIZE).Clone());
+ std::unique_ptr<SwFormatFrameSize> aSz(rFlySet.Get(RES_FRM_SIZE).Clone());
if (pItem)
aSz.reset(static_cast<SwFormatFrameSize*>(pItem->Clone()));
diff --git a/sw/source/filter/basflt/fltshell.cxx b/sw/source/filter/basflt/fltshell.cxx
index 95172677076d..4f725a98b9a9 100644
--- a/sw/source/filter/basflt/fltshell.cxx
+++ b/sw/source/filter/basflt/fltshell.cxx
@@ -1067,8 +1067,8 @@ const std::vector< std::pair<OUString, OUString> >& SwFltRDFMark::GetAttributes(
}
// methods of SwFltTOX follow
-SwFltTOX::SwFltTOX(SwTOXBase* pBase)
- : SfxPoolItem(RES_FLTR_TOX), m_xTOXBase(pBase),
+SwFltTOX::SwFltTOX(std::shared_ptr<SwTOXBase> xBase)
+ : SfxPoolItem(RES_FLTR_TOX), m_xTOXBase(std::move(xBase)),
bHadBreakItem( false ), bHadPageDescItem( false )
{
}
diff --git a/sw/source/filter/inc/fltshell.hxx b/sw/source/filter/inc/fltshell.hxx
index 344a5ace1f45..615917929475 100644
--- a/sw/source/filter/inc/fltshell.hxx
+++ b/sw/source/filter/inc/fltshell.hxx
@@ -282,7 +282,7 @@ class SW_DLLPUBLIC SwFltTOX : public SfxPoolItem
bool bHadBreakItem; // there was a break item BEFORE insertion of the TOX
bool bHadPageDescItem;
public:
- SwFltTOX(SwTOXBase* pBase);
+ SwFltTOX(std::shared_ptr<SwTOXBase> xBase);
// "purely virtual methods" of SfxPoolItem
virtual bool operator==(const SfxPoolItem&) const override;
virtual SwFltTOX* Clone(SfxItemPool* = nullptr) const override;
diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx
index b18d94410027..1b8f95f48115 100644
--- a/sw/source/filter/ww8/docxexport.cxx
+++ b/sw/source/filter/ww8/docxexport.cxx
@@ -1014,7 +1014,7 @@ void DocxExport::WriteSettings()
}
// Display Background Shape
- if (std::shared_ptr<SvxBrushItem> oBrush = getBackground(); oBrush)
+ if (std::unique_ptr<SvxBrushItem> oBrush = getBackground(); oBrush)
{
// Turn on the 'displayBackgroundShape'
pFS->singleElementNS(XML_w, XML_displayBackgroundShape);
@@ -1642,7 +1642,7 @@ void DocxExport::WriteMainText()
m_aLinkedTextboxesHelper.clear();
// Write background page color
- if (std::shared_ptr<SvxBrushItem> oBrush = getBackground(); oBrush)
+ if (std::unique_ptr<SvxBrushItem> oBrush = getBackground(); oBrush)
{
Color backgroundColor = oBrush->GetColor();
OString aBackgroundColorStr = msfilter::util::ConvertColor(backgroundColor);
diff --git a/sw/source/filter/ww8/rtfexport.cxx b/sw/source/filter/ww8/rtfexport.cxx
index 967e5a650981..3cea7bfb88fe 100644
--- a/sw/source/filter/ww8/rtfexport.cxx
+++ b/sw/source/filter/ww8/rtfexport.cxx
@@ -420,7 +420,7 @@ void RtfExport::WriteMainText()
{
SAL_INFO("sw.rtf", OSL_THIS_FUNC << " start");
- if (std::shared_ptr<SvxBrushItem> oBrush = getBackground(); oBrush)
+ if (std::unique_ptr<SvxBrushItem> oBrush = getBackground(); oBrush)
{
Strm().WriteCharPtr(LO_STRING_SVTOOLS_RTF_VIEWBKSP).WriteChar('1');
Strm().WriteCharPtr("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_BACKGROUND);
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index 5a5ff4bf395c..6982cd7a8fcc 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -1515,20 +1515,19 @@ void WW8Export::AppendBookmarkEndWithCorrection( const OUString& rName )
m_pBkmks->Append( nEndCP - 1, rName );
}
-std::shared_ptr<SvxBrushItem> MSWordExportBase::getBackground()
+std::unique_ptr<SvxBrushItem> MSWordExportBase::getBackground()
{
- std::shared_ptr<SvxBrushItem> oRet;
const SwFrameFormat &rFormat = m_pDoc->GetPageDesc(0).GetMaster();
- std::shared_ptr<SvxBrushItem> aBrush(std::make_shared<SvxBrushItem>(RES_BACKGROUND));
+ std::unique_ptr<SvxBrushItem> aBrush = std::make_unique<SvxBrushItem>(RES_BACKGROUND);
SfxItemState eState = rFormat.GetBackgroundState(aBrush);
if (SfxItemState::SET == eState)
{
// The 'color' is set for the first page style - take it and use it as the background color of the entire DOCX
if (aBrush->GetColor() != COL_AUTO)
- oRet = aBrush;
+ return aBrush;
}
- return oRet;
+ return nullptr;
}
// #i120928 collect all the graphics of bullets applied to paragraphs
diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx
index d950aa7e1fee..3f165d8fb4a8 100644
--- a/sw/source/filter/ww8/wrtww8.hxx
+++ b/sw/source/filter/ww8/wrtww8.hxx
@@ -911,7 +911,7 @@ protected:
void SetCurPam(sal_uLong nStt, sal_uLong nEnd);
/// Get background color of the document, if there is one.
- std::shared_ptr<SvxBrushItem> getBackground();
+ std::unique_ptr<SvxBrushItem> getBackground();
/// Populates m_vecBulletPic with all the bullet graphics used by numberings.
int CollectGrfsOfBullets();
/// Write the numbering picture bullets.
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 07f994b14ad8..cad890294a36 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -4993,7 +4993,7 @@ ErrCode SwWW8ImplReader::CoreLoad(WW8Glossary const *pGloss)
ReadDocInfo();
}
- ::ww8::WW8FibData * pFibData = new ::ww8::WW8FibData();
+ auto pFibData = std::make_shared<::ww8::WW8FibData>();
if (m_xWwFib->m_fReadOnlyRecommended)
pFibData->setReadOnlyRecommended(true);
@@ -5005,9 +5005,7 @@ ErrCode SwWW8ImplReader::CoreLoad(WW8Glossary const *pGloss)
else
pFibData->setWriteReservation(false);
- ::sw::tExternalDataPointer pExternalFibData(pFibData);
-
- m_rDoc.getIDocumentExternalData().setExternalData(::sw::tExternalDataType::FIB, pExternalFibData);
+ m_rDoc.getIDocumentExternalData().setExternalData(::sw::tExternalDataType::FIB, pFibData);
::sw::tExternalDataPointer pSttbfAsoc
= std::make_shared<::ww8::WW8Sttb<ww8::WW8Struct>>(*m_pTableStream, m_xWwFib->m_fcSttbfAssoc, m_xWwFib->m_lcbSttbfAssoc);
diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx
index b8cdf1c27671..95e96f9357b6 100644
--- a/sw/source/filter/ww8/ww8par5.cxx
+++ b/sw/source/filter/ww8/ww8par5.cxx
@@ -2984,7 +2984,7 @@ eF_ResT SwWW8ImplReader::Read_F_Tox( WW8FieldDesc* pF, OUString& rStr )
const SwTOXType* pType = m_rDoc.GetTOXType( eTox, 0 );
SwForm aOrigForm(eTox);
- SwTOXBase* pBase = new SwTOXBase( pType, aOrigForm, nCreateOf, OUString() );
+ std::shared_ptr<SwTOXBase> pBase = std::make_shared<SwTOXBase>( pType, aOrigForm, nCreateOf, OUString() );
pBase->SetProtected(m_aSectionManager.CurrentSectionIsProtected());
switch( eTox ){
case TOX_INDEX:
diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index dd260b4804a1..2d7de4556b66 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -5063,7 +5063,7 @@ void SwWW8ImplReader::Read_CharBorder(sal_uInt16 nId, const sal_uInt8* pData, sh
= static_cast<const SvxBoxItem*>(GetFormatAttr( RES_CHRATR_BOX ));
if( pBox )
{
- std::shared_ptr<SvxBoxItem> aBoxItem(pBox->Clone());
+ std::unique_ptr<SvxBoxItem> aBoxItem(pBox->Clone());
WW8_BRCVer9 aBrc;
int nBrcVer = (nId == NS_sprm::sprmCBrc) ? 9 : (m_bVer67 ? 6 : 8);
diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx
index b73e844555b3..b3a40e9ecebc 100644
--- a/sw/source/ui/dialog/swdlgfact.cxx
+++ b/sw/source/ui/dialog/swdlgfact.cxx
@@ -807,7 +807,7 @@ VclPtr<AbstractSwAsciiFilterDlg> SwAbstractDialogFactory_Impl::CreateSwAsciiFilt
VclPtr<VclAbstractDialog> SwAbstractDialogFactory_Impl::CreateSwInsertBookmarkDlg(weld::Window *pParent,
SwWrtShell &rSh, SfxRequest& rReq)
{
- return VclPtr<AbstractGenericDialog_Impl>::Create(std::make_unique<SwInsertBookmarkDlg>(pParent, rSh, rReq));
+ return VclPtr<AbstractGenericDialog_Impl>::Create(std::make_shared<SwInsertBookmarkDlg>(pParent, rSh, rReq));
}
VclPtr<AbstractSwBreakDlg> SwAbstractDialogFactory_Impl::CreateSwBreakDlg(weld::Window* pParent, SwWrtShell &rSh)
@@ -818,7 +818,7 @@ VclPtr<AbstractSwBreakDlg> SwAbstractDialogFactory_Impl::CreateSwBreakDlg(weld::
VclPtr<VclAbstractDialog> SwAbstractDialogFactory_Impl::CreateSwChangeDBDlg(SwView& rVw)
{
#if HAVE_FEATURE_DBCONNECTIVITY
- return VclPtr<AbstractGenericDialog_Impl>::Create(std::make_unique<SwChangeDBDlg>(rVw));
+ return VclPtr<AbstractGenericDialog_Impl>::Create(std::make_shared<SwChangeDBDlg>(rVw));
#else
(void) rVw;
return nullptr;
@@ -828,7 +828,7 @@ VclPtr<VclAbstractDialog> SwAbstractDialogFactory_Impl::CreateSwChangeDBDlg(SwVi
VclPtr<SfxAbstractTabDialog> SwAbstractDialogFactory_Impl::CreateSwCharDlg(weld::Window* pParent, SwView& pVw,
const SfxItemSet& rCoreSet, SwCharDlgMode nDialogMode, const OUString* pFormatStr)
{
- return VclPtr<AbstractTabController_Impl>::Create(std::make_unique<SwCharDlg>(pParent, pVw, rCoreSet, nDialogMode, pFormatStr));
+ return VclPtr<AbstractTabController_Impl>::Create(std::make_shared<SwCharDlg>(pParent, pVw, rCoreSet, nDialogMode, pFormatStr));
}
VclPtr<AbstractSwConvertTableDlg> SwAbstractDialogFactory_Impl::CreateSwConvertTableDlg(SwView& rView, bool bToTable)
@@ -838,7 +838,7 @@ VclPtr<AbstractSwConvertTableDlg> SwAbstractDialogFactory_Impl::CreateSwConvertT
VclPtr<VclAbstractDialog> SwAbstractDialogFactory_Impl::CreateSwCaptionDialog(weld::Window *pParent, SwView &rV)
{
- return VclPtr<AbstractGenericDialog_Impl>::Create(std::make_unique<SwCaptionDialog>(pParent, rV));
+ return VclPtr<AbstractGenericDialog_Impl>::Create(std::make_shared<SwCaptionDialog>(pParent, rV));
}
VclPtr<AbstractSwInsertDBColAutoPilot> SwAbstractDialogFactory_Impl::CreateSwInsertDBColAutoPilot( SwView& rView,
@@ -859,7 +859,7 @@ VclPtr<AbstractSwInsertDBColAutoPilot> SwAbstractDialogFactory_Impl::CreateSwIns
VclPtr<SfxAbstractTabDialog> SwAbstractDialogFactory_Impl::CreateSwFootNoteOptionDlg(weld::Window *pParent, SwWrtShell &rSh)
{
- return VclPtr<AbstractTabController_Impl>::Create(std::make_unique<SwFootNoteOptionDlg>(pParent, rSh));
+ return VclPtr<AbstractTabController_Impl>::Create(std::make_shared<SwFootNoteOptionDlg>(pParent, rSh));
}
VclPtr<AbstractDropDownFieldDialog> SwAbstractDialogFactory_Impl::CreateDropDownFieldDialog(weld::Widget *pParent,
@@ -882,7 +882,7 @@ VclPtr<SfxAbstractTabDialog> SwAbstractDialogFactory_Impl::CreateSwEnvDlg(weld::
SwWrtShell* pWrtSh, Printer* pPrt,
bool bInsert)
{
- return VclPtr<AbstractTabController_Impl>::Create(std::make_unique<SwEnvDlg>(pParent, rSet, pWrtSh,pPrt, bInsert));
+ return VclPtr<AbstractTabController_Impl>::Create(std::make_shared<SwEnvDlg>(pParent, rSet, pWrtSh,pPrt, bInsert));
}
VclPtr<AbstractSwLabDlg> SwAbstractDialogFactory_Impl::CreateSwLabDlg(weld::Window* pParent, const SfxItemSet& rSet,
@@ -901,17 +901,17 @@ VclPtr<SfxAbstractTabDialog> SwAbstractDialogFactory_Impl::CreateSwParaDlg(weld:
bool bDraw ,
const OString& sDefPage)
{
- return VclPtr<AbstractTabController_Impl>::Create(std::make_unique<SwParaDlg>(pParent, rVw, rCoreSet, DLG_STD, nullptr, bDraw, sDefPage));
+ return VclPtr<AbstractTabController_Impl>::Create(std::make_shared<SwParaDlg>(pParent, rVw, rCoreSet, DLG_STD, nullptr, bDraw, sDefPage));
}
VclPtr<VclAbstractDialog> SwAbstractDialogFactory_Impl::CreateSwAutoMarkDialog(weld::Window *pParent, SwWrtShell &rSh)
{
- return VclPtr<AbstractGenericDialog_Impl>::Create(std::make_unique<SwAuthMarkModalDlg>(pParent, rSh));
+ return VclPtr<AbstractGenericDialog_Impl>::Create(std::make_shared<SwAuthMarkModalDlg>(pParent, rSh));
}
VclPtr<VclAbstractDialog> SwAbstractDialogFactory_Impl::CreateSwColumnDialog(weld::Window *pParent, SwWrtShell &rSh)
{
- return VclPtr<AbstractGenericDialog_Impl>::Create(std::make_unique<SwColumnDlg>(pParent, rSh));
+ return VclPtr<AbstractGenericDialog_Impl>::Create(std::make_shared<SwColumnDlg>(pParent, rSh));
}
VclPtr<VclAbstractDialog> SwAbstractDialogFactory_Impl::CreateSwTableHeightDialog(weld::Window *pParent, SwWrtShell &rSh)
@@ -960,12 +960,12 @@ VclPtr<VclAbstractDialog> SwAbstractDialogFactory_Impl::CreateSwTableWidthDlg(we
VclPtr<SfxAbstractTabDialog> SwAbstractDialogFactory_Impl::CreateSwTableTabDlg(weld::Window* pParent,
const SfxItemSet* pItemSet, SwWrtShell* pSh)
{
- return VclPtr<AbstractTabController_Impl>::Create(std::make_unique<SwTableTabDlg>(pParent, pItemSet, pSh));
+ return VclPtr<AbstractTabController_Impl>::Create(std::make_shared<SwTableTabDlg>(pParent, pItemSet, pSh));
}
VclPtr<AbstractSwFieldDlg> SwAbstractDialogFactory_Impl::CreateSwFieldDlg(SfxBindings* pB, SwChildWinWrapper* pCW, weld::Window *pParent)
{
- return VclPtr<AbstractSwFieldDlg_Impl>::Create(std::make_unique<SwFieldDlg>(pB, pCW, pParent));
+ return VclPtr<AbstractSwFieldDlg_Impl>::Create(std::make_shared<SwFieldDlg>(pB, pCW, pParent));
}
VclPtr<SfxAbstractDialog> SwAbstractDialogFactory_Impl::CreateSwFieldEditDlg(SwView& rVw)
@@ -996,7 +996,7 @@ VclPtr<SfxAbstractTabDialog> SwAbstractDialogFactory_Impl::CreateFrameTabDialog(
bool bNewFrame,
const OString& sDefPage )
{
- return VclPtr<AbstractTabController_Impl>::Create(std::make_unique<SwFrameDlg>(pFrame, pParent, rCoreSet, bNewFrame, rDialogType, false/*bFormat*/, sDefPage, nullptr));
+ return VclPtr<AbstractTabController_Impl>::Create(std::make_shared<SwFrameDlg>(pFrame, pParent, rCoreSet, bNewFrame, rDialogType, false/*bFormat*/, sDefPage, nullptr));
}
VclPtr<SfxAbstractApplyTabDialog> SwAbstractDialogFactory_Impl::CreateTemplateDialog(
@@ -1007,7 +1007,7 @@ VclPtr<SfxAbstractApplyTabDialog> SwAbstractDialogFactory_Impl::CreateTemplateDi
SwWrtShell* pActShell,
bool bNew )
{
- return VclPtr<AbstractApplyTabController_Impl>::Create(std::make_unique<SwTemplateDlgController>(pParent, rBase, nRegion,
+ return VclPtr<AbstractApplyTabController_Impl>::Create(std::make_shared<SwTemplateDlgController>(pParent, rBase, nRegion,
sPage, pActShell, bNew));
}
@@ -1031,12 +1031,12 @@ VclPtr<AbstractInsFootNoteDlg> SwAbstractDialogFactory_Impl::CreateInsFootNoteDl
VclPtr<VclAbstractDialog> SwAbstractDialogFactory_Impl::CreateTitlePageDlg(weld::Window *pParent)
{
- return VclPtr<AbstractGenericDialog_Impl>::Create(std::make_unique<SwTitlePageDlg>(pParent));
+ return VclPtr<AbstractGenericDialog_Impl>::Create(std::make_shared<SwTitlePageDlg>(pParent));
}
VclPtr<VclAbstractDialog> SwAbstractDialogFactory_Impl::CreateVclSwViewDialog(SwView& rView)
{
- return VclPtr<AbstractGenericDialog_Impl>::Create(std::make_unique<SwLineNumberingDlg>(rView));
+ return VclPtr<AbstractGenericDialog_Impl>::Create(std::make_shared<SwLineNumberingDlg>(rView));
}
VclPtr<AbstractInsTableDlg> SwAbstractDialogFactory_Impl::CreateInsTableDlg(SwView& rView)
@@ -1079,31 +1079,31 @@ VclPtr<SfxAbstractTabDialog> SwAbstractDialogFactory_Impl::CreateSvxNumBulletTab
const SfxItemSet* pSwItemSet,
SwWrtShell & rWrtSh)
{
- return VclPtr<AbstractTabController_Impl>::Create(std::make_unique<SwSvxNumBulletTabDialog>(pParent, pSwItemSet, rWrtSh));
+ return VclPtr<AbstractTabController_Impl>::Create(std::make_shared<SwSvxNumBulletTabDialog>(pParent, pSwItemSet, rWrtSh));
}
VclPtr<SfxAbstractTabDialog> SwAbstractDialogFactory_Impl::CreateOutlineTabDialog(weld::Window* pParent,
const SfxItemSet* pSwItemSet,
SwWrtShell & rWrtSh )
{
- return VclPtr<AbstractTabController_Impl>::Create(std::make_unique<SwOutlineTabDialog>(pParent, pSwItemSet, rWrtSh));
+ return VclPtr<AbstractTabController_Impl>::Create(std::make_shared<SwOutlineTabDialog>(pParent, pSwItemSet, rWrtSh));
}
VclPtr<AbstractMultiTOXTabDialog> SwAbstractDialogFactory_Impl::CreateMultiTOXTabDialog(weld::Window* pParent, const SfxItemSet& rSet,
SwWrtShell &rShell, SwTOXBase* pCurTOX, bool bGlobal)
{
- return VclPtr<AbstractMultiTOXTabDialog_Impl>::Create(std::make_unique<SwMultiTOXTabDialog>(pParent, rSet, rShell, pCurTOX, USHRT_MAX, bGlobal));
+ return VclPtr<AbstractMultiTOXTabDialog_Impl>::Create(std::make_shared<SwMultiTOXTabDialog>(pParent, rSet, rShell, pCurTOX, USHRT_MAX, bGlobal));
}
VclPtr<AbstractEditRegionDlg> SwAbstractDialogFactory_Impl::CreateEditRegionDlg(weld::Window* pParent, SwWrtShell& rWrtSh)
{
- return VclPtr<AbstractEditRegionDlg_Impl>::Create(std::make_unique<SwEditRegionDlg>(pParent, rWrtSh));
+ return VclPtr<AbstractEditRegionDlg_Impl>::Create(std::make_shared<SwEditRegionDlg>(pParent, rWrtSh));
}
VclPtr<AbstractInsertSectionTabDialog> SwAbstractDialogFactory_Impl::CreateInsertSectionTabDialog(weld::Window* pParent,
const SfxItemSet& rSet, SwWrtShell& rSh)
{
- return VclPtr<AbstractInsertSectionTabDialog_Impl>::Create(std::make_unique<SwInsertSectionTabDialog>(pParent, rSet, rSh));
+ return VclPtr<AbstractInsertSectionTabDialog_Impl>::Create(std::make_shared<SwInsertSectionTabDialog>(pParent, rSet, rSh));
}
VclPtr<AbstractMarkFloatDlg> SwAbstractDialogFactory_Impl::CreateIndexMarkFloatDlg(
@@ -1112,7 +1112,7 @@ VclPtr<AbstractMarkFloatDlg> SwAbstractDialogFactory_Impl::CreateIndexMarkFloatD
weld::Window *pParent,
SfxChildWinInfo* pInfo )
{
- return VclPtr<AbstractIndexMarkFloatDlg_Impl>::Create(std::make_unique<SwIndexMarkFloatDlg>(pBindings, pChild, pParent, pInfo, true/*bNew*/));
+ return VclPtr<AbstractIndexMarkFloatDlg_Impl>::Create(std::make_shared<SwIndexMarkFloatDlg>(pBindings, pChild, pParent, pInfo, true/*bNew*/));
}
VclPtr<AbstractMarkFloatDlg> SwAbstractDialogFactory_Impl::CreateAuthMarkFloatDlg(
@@ -1121,7 +1121,7 @@ VclPtr<AbstractMarkFloatDlg> SwAbstractDialogFactory_Impl::CreateAuthMarkFloatDl
weld::Window *pParent,
SfxChildWinInfo* pInfo)
{
- return VclPtr<AbstractAuthMarkFloatDlg_Impl>::Create(std::make_unique<SwAuthMarkFloatDlg>(pBindings, pChild, pParent, pInfo, true/*bNew*/));
+ return VclPtr<AbstractAuthMarkFloatDlg_Impl>::Create(std::make_shared<SwAuthMarkFloatDlg>(pBindings, pChild, pParent, pInfo, true/*bNew*/));
}
VclPtr<AbstractSwWordCountFloatDlg> SwAbstractDialogFactory_Impl::CreateSwWordCountDialog(
@@ -1130,19 +1130,19 @@ VclPtr<AbstractSwWordCountFloatDlg> SwAbstractDialogFactory_Impl::CreateSwWordCo
weld::Window *pParent,
SfxChildWinInfo* pInfo)
{
- return VclPtr<AbstractSwWordCountFloatDlg_Impl>::Create(std::make_unique<SwWordCountFloatDlg>(pBindings, pChild, pParent, pInfo));
+ return VclPtr<AbstractSwWordCountFloatDlg_Impl>::Create(std::make_shared<SwWordCountFloatDlg>(pBindings, pChild, pParent, pInfo));
}
VclPtr<VclAbstractDialog> SwAbstractDialogFactory_Impl::CreateIndexMarkModalDlg(weld::Window *pParent, SwWrtShell& rSh, SwTOXMark* pCurTOXMark )
{
- return VclPtr<AbstractGenericDialog_Impl>::Create(std::make_unique<SwIndexMarkModalDlg>(pParent, rSh, pCurTOXMark));
+ return VclPtr<AbstractGenericDialog_Impl>::Create(std::make_shared<SwIndexMarkModalDlg>(pParent, rSh, pCurTOXMark));
}
VclPtr<AbstractMailMergeWizard> SwAbstractDialogFactory_Impl::CreateMailMergeWizard(
SwView& rView, std::shared_ptr<SwMailMergeConfigItem>& rConfigItem)
{
#if HAVE_FEATURE_DBCONNECTIVITY
- return VclPtr<AbstractMailMergeWizard_Impl>::Create(std::make_unique<SwMailMergeWizard>(rView, rConfigItem));
+ return VclPtr<AbstractMailMergeWizard_Impl>::Create(std::make_shared<SwMailMergeWizard>(rView, rConfigItem));
#else
(void) rView;
(void) rConfigItem;
diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx
index c34c16b80660..315cfba7b143 100644
--- a/sw/source/ui/dialog/swdlgfact.hxx
+++ b/sw/source/ui/dialog/swdlgfact.hxx
@@ -90,7 +90,7 @@ class AbstractSwWordCountFloatDlg_Impl : public AbstractSwWordCountFloatDlg
{
std::shared_ptr<SwWordCountFloatDlg> m_xDlg;
public:
- explicit AbstractSwWordCountFloatDlg_Impl(std::unique_ptr<SwWordCountFloatDlg> p)
+ explicit AbstractSwWordCountFloatDlg_Impl(std::shared_ptr<SwWordCountFloatDlg> p)
: m_xDlg(std::move(p))
{
}
@@ -142,7 +142,7 @@ class AbstractGenericDialog_Impl : public VclAbstractDialog
{
std::shared_ptr<weld::GenericDialogController> m_xDlg;
public:
- explicit AbstractGenericDialog_Impl(std::unique_ptr<weld::GenericDialogController> p)
+ explicit AbstractGenericDialog_Impl(std::shared_ptr<weld::GenericDialogController> p)
: m_xDlg(std::move(p))
{
}
@@ -236,7 +236,7 @@ class AbstractTabController_Impl : virtual public SfxAbstractTabDialog
protected:
std::shared_ptr<SfxTabDialogController> m_xDlg;
public:
- explicit AbstractTabController_Impl(std::unique_ptr<SfxTabDialogController> p)
+ explicit AbstractTabController_Impl(std::shared_ptr<SfxTabDialogController> p)
: m_xDlg(std::move(p))
{
}
@@ -253,7 +253,7 @@ public:
class AbstractApplyTabController_Impl : public AbstractTabController_Impl, virtual public SfxAbstractApplyTabDialog
{
public:
- explicit AbstractApplyTabController_Impl(std::unique_ptr<SfxTabDialogController> p)
+ explicit AbstractApplyTabController_Impl(std::shared_ptr<SfxTabDialogController> p)
: AbstractTabController_Impl(std::move(p))
{
}
@@ -375,7 +375,7 @@ class AbstractSwFieldDlg_Impl : public AbstractSwFieldDlg
{
std::shared_ptr<SwFieldDlg> m_xDlg;
public:
- explicit AbstractSwFieldDlg_Impl(std::unique_ptr<SwFieldDlg> p)
+ explicit AbstractSwFieldDlg_Impl(std::shared_ptr<SwFieldDlg> p)
: m_xDlg(std::move(p))
{
}
@@ -552,7 +552,7 @@ class AbstractMultiTOXTabDialog_Impl : public AbstractMultiTOXTabDialog
protected:
std::shared_ptr<SwMultiTOXTabDialog> m_xDlg;
public:
- explicit AbstractMultiTOXTabDialog_Impl(std::unique_ptr<SwMultiTOXTabDialog> p)
+ explicit AbstractMultiTOXTabDialog_Impl(std::shared_ptr<SwMultiTOXTabDialog> p)
: m_xDlg(std::move(p))
{
}
@@ -569,7 +569,7 @@ class AbstractEditRegionDlg_Impl : public AbstractEditRegionDlg
{
std::shared_ptr<SwEditRegionDlg> m_xDlg;
public:
- explicit AbstractEditRegionDlg_Impl(std::unique_ptr<SwEditRegionDlg> p)
+ explicit AbstractEditRegionDlg_Impl(std::shared_ptr<SwEditRegionDlg> p)
: m_xDlg(std::move(p))
{
}
@@ -582,7 +582,7 @@ class AbstractInsertSectionTabDialog_Impl : public AbstractInsertSectionTabDialo
{
std::shared_ptr<SwInsertSectionTabDialog> m_xDlg;
public:
- explicit AbstractInsertSectionTabDialog_Impl(std::unique_ptr<SwInsertSectionTabDialog> p)
+ explicit AbstractInsertSectionTabDialog_Impl(std::shared_ptr<SwInsertSectionTabDialog> p)
: m_xDlg(std::move(p))
{
}
@@ -596,7 +596,7 @@ class AbstractIndexMarkFloatDlg_Impl : public AbstractMarkFloatDlg
{
std::shared_ptr<SwIndexMarkFloatDlg> m_xDlg;
public:
- explicit AbstractIndexMarkFloatDlg_Impl(std::unique_ptr<SwIndexMarkFloatDlg> p)
+ explicit AbstractIndexMarkFloatDlg_Impl(std::shared_ptr<SwIndexMarkFloatDlg> p)
: m_xDlg(std::move(p))
{
}
@@ -610,7 +610,7 @@ class AbstractAuthMarkFloatDlg_Impl : public AbstractMarkFloatDlg
{
std::shared_ptr<SwAuthMarkFloatDlg> m_xDlg;
public:
- explicit AbstractAuthMarkFloatDlg_Impl(std::unique_ptr<SwAuthMarkFloatDlg> p)
+ explicit AbstractAuthMarkFloatDlg_Impl(std::shared_ptr<SwAuthMarkFloatDlg> p)
: m_xDlg(std::move(p))
{
}
@@ -625,7 +625,7 @@ class AbstractMailMergeWizard_Impl : public AbstractMailMergeWizard
std::shared_ptr<SwMailMergeWizard> m_xDlg;
public:
- explicit AbstractMailMergeWizard_Impl(std::unique_ptr<SwMailMergeWizard> p)
+ explicit AbstractMailMergeWizard_Impl(std::shared_ptr<SwMailMergeWizard> p)
: m_xDlg(std::move(p))
{
}
diff --git a/sw/source/uibase/inc/swrenamexnameddlg.hxx b/sw/source/uibase/inc/swrenamexnameddlg.hxx
index 381f9e7a35b2..b4540857e563 100644
--- a/sw/source/uibase/inc/swrenamexnameddlg.hxx
+++ b/sw/source/uibase/inc/swrenamexnameddlg.hxx
@@ -33,8 +33,8 @@ class SwRenameXNamedDlg : public weld::GenericDialogController
TextFilter m_aTextFilter;
- std::shared_ptr<weld::Entry> m_xNewNameED;
- std::shared_ptr<weld::Button> m_xOk;
+ std::unique_ptr<weld::Entry> m_xNewNameED;
+ std::unique_ptr<weld::Button> m_xOk;
DECL_LINK(TextFilterHdl, OUString&, bool);
DECL_LINK(OkHdl, weld::Button&, void);
diff --git a/sw/source/uibase/shells/frmsh.cxx b/sw/source/uibase/shells/frmsh.cxx
index 61ab59bfc00e..186a6d337801 100644
--- a/sw/source/uibase/shells/frmsh.cxx
+++ b/sw/source/uibase/shells/frmsh.cxx
@@ -1101,7 +1101,7 @@ void SwFrameShell::ExecFrameStyle(SfxRequest const & rReq)
if (pPoolBoxItem == &rBoxItem)
bDefault = true;
- std::shared_ptr<SvxBoxItem> aBoxItem(rBoxItem.Clone());
+ std::unique_ptr<SvxBoxItem> aBoxItem(rBoxItem.Clone());
SvxBorderLine aBorderLine;
const SfxPoolItem *pItem = nullptr;
@@ -1114,7 +1114,7 @@ void SwFrameShell::ExecFrameStyle(SfxRequest const & rReq)
{
if (pArgs->GetItemState(RES_BOX, true, &pItem) == SfxItemState::SET)
{
- std::shared_ptr<SvxBoxItem> aNewBox(static_cast<SvxBoxItem*>(pItem->Clone()));
+ std::unique_ptr<SvxBoxItem> aNewBox(static_cast<SvxBoxItem*>(pItem->Clone()));
const SvxBorderLine* pBorderLine;
if ((pBorderLine = aBoxItem->GetTop()) != nullptr)
@@ -1142,7 +1142,7 @@ void SwFrameShell::ExecFrameStyle(SfxRequest const & rReq)
aNewBox->SetAllDistances(rBoxItem.GetSmallestDistance());
}
- aBoxItem = aNewBox;
+ aBoxItem = std::move(aNewBox);
if( aBoxItem->GetTop() != nullptr )
aBoxItem->SetLine(&aBorderLine, SvxBoxItemLine::TOP);
diff --git a/sw/source/uibase/shells/tabsh.cxx b/sw/source/uibase/shells/tabsh.cxx
index 50ec6815ea0b..0348f461f0e0 100644
--- a/sw/source/uibase/shells/tabsh.cxx
+++ b/sw/source/uibase/shells/tabsh.cxx
@@ -305,13 +305,13 @@ void ItemSetToTableParam( const SfxItemSet& rSet,
rSh.SetBoxBackground( *static_cast<const SvxBrushItem*>(pItem) );
if(pRowItem)
{
- std::shared_ptr<SvxBrushItem> aBrush(static_cast<SvxBrushItem*>(pRowItem->Clone()));
+ std::unique_ptr<SvxBrushItem> aBrush(static_cast<SvxBrushItem*>(pRowItem->Clone()));
aBrush->SetWhich(RES_BACKGROUND);
rSh.SetRowBackground(*aBrush);
}
if(pTableItem)
{
- std::shared_ptr<SvxBrushItem> aBrush(static_cast<SvxBrushItem*>(pTableItem->Clone()));
+ std::unique_ptr<SvxBrushItem> aBrush(static_cast<SvxBrushItem*>(pTableItem->Clone()));
aBrush->SetWhich(RES_BACKGROUND);
rSh.SetTabBackground( *aBrush );
}
diff --git a/sw/source/uibase/shells/textsh.cxx b/sw/source/uibase/shells/textsh.cxx
index ef1341d078bc..2b1735456e94 100644
--- a/sw/source/uibase/shells/textsh.cxx
+++ b/sw/source/uibase/shells/textsh.cxx
@@ -961,7 +961,7 @@ void SwTextShell::InsertSymbol( SfxRequest& rReq )
// #108876# a font attribute has to be set always due to a guessed script type
if( !aNewFont.GetFamilyName().isEmpty() )
{
- std::shared_ptr<SvxFontItem> aNewFontItem(aFont->Clone());
+ std::unique_ptr<SvxFontItem> aNewFontItem(aFont->Clone());
aNewFontItem->SetFamilyName( aNewFont.GetFamilyName() );
aNewFontItem->SetFamily( aNewFont.GetFamilyType());
aNewFontItem->SetPitch( aNewFont.GetPitch());
diff --git a/sw/source/uibase/uiview/formatclipboard.cxx b/sw/source/uibase/uiview/formatclipboard.cxx
index d60fe21f3fb7..e9268bffa23f 100644
--- a/sw/source/uibase/uiview/formatclipboard.cxx
+++ b/sw/source/uibase/uiview/formatclipboard.cxx
@@ -158,13 +158,13 @@ void lcl_setTableAttributes( const SfxItemSet& rSet, SwWrtShell &rSh )
rSh.SetBoxBackground( *static_cast<const SvxBrushItem*>(pItem) );
if(pRowItem)
{
- std::shared_ptr<SvxBrushItem> aBrush(static_cast<SvxBrushItem*>(pRowItem->Clone()));
+ std::unique_ptr<SvxBrushItem> aBrush(static_cast<SvxBrushItem*>(pRowItem->Clone()));
aBrush->SetWhich(RES_BACKGROUND);
rSh.SetRowBackground(*aBrush);
}
if(pTableItem)
{
- std::shared_ptr<SvxBrushItem> aBrush(static_cast<SvxBrushItem*>(pTableItem->Clone()));
+ std::unique_ptr<SvxBrushItem> aBrush(static_cast<SvxBrushItem*>(pTableItem->Clone()));
aBrush->SetWhich(RES_BACKGROUND);
rSh.SetTabBackground(*aBrush);
}
@@ -416,8 +416,7 @@ void SwFormatClipboard::Copy( SwWrtShell& rWrtShell, SfxItemPool& rPool, bool bP
rWrtShell.EndAction();
}
-typedef std::shared_ptr< SfxPoolItem > SfxPoolItemSharedPtr;
-typedef std::vector< SfxPoolItemSharedPtr > ItemVector;
+typedef std::vector< std::unique_ptr< SfxPoolItem > > ItemVector;
// collect all PoolItems from the applied styles
static void lcl_AppendSetItems( ItemVector& rItemVector, const SfxItemSet& rStyleAttrSet )
{
@@ -429,7 +428,7 @@ static void lcl_AppendSetItems( ItemVector& rItemVector, const SfxItemSet& rStyl
const SfxPoolItem* pItem;
if( SfxItemState::SET == rStyleAttrSet.GetItemState( nWhich, false, &pItem ) )
{
- rItemVector.push_back( SfxPoolItemSharedPtr( pItem->Clone() ) );
+ rItemVector.emplace_back( pItem->Clone() );
}
}
pRanges += 2;
diff --git a/sw/source/uibase/uiview/viewtab.cxx b/sw/source/uibase/uiview/viewtab.cxx
index 6b7dee96379b..7be532cd29b4 100644
--- a/sw/source/uibase/uiview/viewtab.cxx
+++ b/sw/source/uibase/uiview/viewtab.cxx
@@ -763,7 +763,7 @@ void SwView::ExecTabWin( SfxRequest const & rReq )
if ( i >= rTabStops.Count() )
{
// No DefTab
- std::shared_ptr<SvxTabStopItem> aTabStops(rTabStops.Clone());
+ std::unique_ptr<SvxTabStopItem> aTabStops(rTabStops.Clone());
::lcl_EraseDefTabs(*aTabStops);