summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/crsr/bookmrk.cxx5
-rw-r--r--sw/source/core/doc/docbm.cxx5
-rw-r--r--sw/source/core/doc/tblafmt.cxx3
-rw-r--r--sw/source/core/fields/authfld.cxx3
-rw-r--r--sw/source/core/frmedt/fetab.cxx3
-rw-r--r--sw/source/core/tox/ToxLinkProcessor.cxx5
-rw-r--r--sw/source/core/unocore/unoportenum.cxx3
-rw-r--r--sw/source/core/unocore/unostyle.cxx5
-rw-r--r--sw/source/filter/xml/xmltbli.cxx17
-rw-r--r--sw/source/uibase/shells/grfsh.cxx5
-rw-r--r--sw/source/uibase/shells/txtattr.cxx3
-rw-r--r--sw/source/uibase/sidebar/StylePresetsPanel.cxx3
12 files changed, 36 insertions, 24 deletions
diff --git a/sw/source/core/crsr/bookmrk.cxx b/sw/source/core/crsr/bookmrk.cxx
index 2f3002167b77..08594bc3d0e8 100644
--- a/sw/source/core/crsr/bookmrk.cxx
+++ b/sw/source/core/crsr/bookmrk.cxx
@@ -32,6 +32,7 @@
#include <UndoBookmark.hxx>
#include <unobookmark.hxx>
#include <rtl/random.h>
+#include <o3tl/make_unique.hxx>
#include <xmloff/odffields.hxx>
#include <libxml/xmlwriter.h>
#include <comphelper/anytostring.hxx>
@@ -167,13 +168,13 @@ namespace sw { namespace mark
void MarkBase::SetMarkPos(const SwPosition& rNewPos)
{
- std::unique_ptr<SwPosition>(new SwPosition(rNewPos)).swap(m_pPos1);
+ o3tl::make_unique<SwPosition>(rNewPos).swap(m_pPos1);
m_pPos1->nContent.SetMark(this);
}
void MarkBase::SetOtherMarkPos(const SwPosition& rNewPos)
{
- std::unique_ptr<SwPosition>(new SwPosition(rNewPos)).swap(m_pPos2);
+ o3tl::make_unique<SwPosition>(rNewPos).swap(m_pPos2);
m_pPos2->nContent.SetMark(this);
}
diff --git a/sw/source/core/doc/docbm.cxx b/sw/source/core/doc/docbm.cxx
index 2c79ac1bdad9..89252fb447cf 100644
--- a/sw/source/core/doc/docbm.cxx
+++ b/sw/source/core/doc/docbm.cxx
@@ -40,6 +40,7 @@
#include <pam.hxx>
#include <redline.hxx>
#include <rolbck.hxx>
+#include <o3tl/make_unique.hxx>
#include <rtl/ustrbuf.hxx>
#include <rtl/ustring.hxx>
#include <sal/types.h>
@@ -135,7 +136,7 @@ namespace
return lcl_PositionFromContentNode( pNode, bPosAtEndOfNode );
}
- return ::std::unique_ptr<SwPosition>(new SwPosition(rOtherPosition));
+ return o3tl::make_unique<SwPosition>(rOtherPosition);
}
IMark* lcl_getMarkAfter(const IDocumentMarkAccess::container_t& rMarks, const SwPosition& rPos)
@@ -756,7 +757,7 @@ namespace sw { namespace mark
{
if ( pEndIdx != nullptr )
{
- pNewPos = ::std::unique_ptr< SwPosition >( new SwPosition( rEnd, *pEndIdx ) );
+ pNewPos = o3tl::make_unique< SwPosition >( rEnd, *pEndIdx );
}
else
{
diff --git a/sw/source/core/doc/tblafmt.cxx b/sw/source/core/doc/tblafmt.cxx
index 414895b13e1d..c27194c40ee4 100644
--- a/sw/source/core/doc/tblafmt.cxx
+++ b/sw/source/core/doc/tblafmt.cxx
@@ -17,6 +17,7 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <o3tl/make_unique.hxx>
#include <tools/resid.hxx>
#include <tools/stream.hxx>
#include <vcl/svapp.hxx>
@@ -1032,7 +1033,7 @@ void SwTableAutoFormatTable::AddAutoFormat(const SwTableAutoFormat& rTableStyle)
if (FindAutoFormat(rTableStyle.GetName()))
return;
- InsertAutoFormat(size(), std::unique_ptr<SwTableAutoFormat>(new SwTableAutoFormat(rTableStyle)));
+ InsertAutoFormat(size(), o3tl::make_unique<SwTableAutoFormat>(rTableStyle));
}
void SwTableAutoFormatTable::InsertAutoFormat(size_t const i, std::unique_ptr<SwTableAutoFormat> pFormat)
diff --git a/sw/source/core/fields/authfld.cxx b/sw/source/core/fields/authfld.cxx
index 8f65c6abffc1..9339aa28dea4 100644
--- a/sw/source/core/fields/authfld.cxx
+++ b/sw/source/core/fields/authfld.cxx
@@ -21,6 +21,7 @@
#include <comphelper/string.hxx>
#include <editeng/unolingu.hxx>
#include <editeng/langitem.hxx>
+#include <o3tl/make_unique.hxx>
#include <swtypes.hxx>
#include <tools/resid.hxx>
#include <comcore.hrc>
@@ -217,7 +218,7 @@ sal_uInt16 SwAuthorityFieldType::AppendField( const SwAuthEntry& rInsert )
}
//if it is a new Entry - insert
- m_DataArr.push_back(std::unique_ptr<SwAuthEntry>(new SwAuthEntry(rInsert)));
+ m_DataArr.push_back(o3tl::make_unique<SwAuthEntry>(rInsert));
return m_DataArr.size()-1;
}
diff --git a/sw/source/core/frmedt/fetab.cxx b/sw/source/core/frmedt/fetab.cxx
index de56b8c6c606..d0fd94d7282b 100644
--- a/sw/source/core/frmedt/fetab.cxx
+++ b/sw/source/core/frmedt/fetab.cxx
@@ -19,6 +19,7 @@
#include <hintids.hxx>
+#include <o3tl/make_unique.hxx>
#include <tools/errinf.hxx>
#include <vcl/svapp.hxx>
#include <basegfx/vector/b2dvector.hxx>
@@ -91,7 +92,7 @@ class TableWait
{ return our_kLineLimit < nCnt || our_kLineLimit < nCnt2 || (pFrame && our_kLineLimit < pFrame->ImplFindTabFrame()->GetTable()->GetTabLines().size()); }
public:
TableWait(size_t nCnt, SwFrame *pFrame, SwDocShell &rDocShell, size_t nCnt2 = 0)
- : m_pWait( ShouldWait(nCnt, pFrame, nCnt2) ? ::std::unique_ptr<SwWait>(new SwWait( rDocShell, true )) : nullptr )
+ : m_pWait( ShouldWait(nCnt, pFrame, nCnt2) ? o3tl::make_unique<SwWait>( rDocShell, true ) : nullptr )
{ }
};
diff --git a/sw/source/core/tox/ToxLinkProcessor.cxx b/sw/source/core/tox/ToxLinkProcessor.cxx
index cbb7275ca42f..1ef40d271625 100644
--- a/sw/source/core/tox/ToxLinkProcessor.cxx
+++ b/sw/source/core/tox/ToxLinkProcessor.cxx
@@ -11,6 +11,7 @@
#include "SwStyleNameMapper.hxx"
#include "ndtxt.hxx"
+#include <o3tl/make_unique.hxx>
#include <poolfmt.hrc>
#include <stdexcept>
@@ -20,8 +21,8 @@ namespace sw {
void
ToxLinkProcessor::StartNewLink(sal_Int32 startPosition, const OUString& characterStyle)
{
- m_StartedLinks.push_back(std::unique_ptr<StartedLink>(
- new StartedLink(startPosition, characterStyle)));
+ m_StartedLinks.push_back(o3tl::make_unique<StartedLink>(
+ startPosition, characterStyle));
}
void
diff --git a/sw/source/core/unocore/unoportenum.cxx b/sw/source/core/unocore/unoportenum.cxx
index 1f0db3dfda0c..920f3b70b8f6 100644
--- a/sw/source/core/unocore/unoportenum.cxx
+++ b/sw/source/core/unocore/unoportenum.cxx
@@ -62,6 +62,7 @@
#include <comphelper/string.hxx>
#include <comphelper/servicehelper.hxx>
#include <cppuhelper/supportsservice.hxx>
+#include <o3tl/make_unique.hxx>
#include <algorithm>
#include <memory>
#include <set>
@@ -160,7 +161,7 @@ namespace
else if (pCrossRefMark)
{
// Crossrefbookmarks only remember the start position but have to span the whole paragraph
- pCrossRefEndPos = unique_ptr<SwPosition>(new SwPosition(rEndPos));
+ pCrossRefEndPos = o3tl::make_unique<SwPosition>(rEndPos);
pCrossRefEndPos->nContent = pCrossRefEndPos->nNode.GetNode().GetTextNode()->Len();
pEndPos = pCrossRefEndPos.get();
}
diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx
index e4b67d816697..7b7a4676082a 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -72,6 +72,7 @@
#include <comphelper/servicehelper.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <comphelper/sequence.hxx>
+#include <o3tl/make_unique.hxx>
//UUUU
#include <svx/unobrushitemhelper.hxx>
@@ -1180,8 +1181,8 @@ SwXStyle::SwXStyle(SwDoc* pDoc, SfxStyleFamily eFamily, bool bConditional)
assert(!m_bIsConditional || m_rEntry.m_eFamily == SfxStyleFamily::Para); // only paragraph styles are conditional
// Register ourselves as a listener to the document (via the page descriptor)
pDoc->getIDocumentStylePoolAccess().GetPageDescFromPool(RES_POOLPAGE_STANDARD)->Add(this);
- m_pPropertiesImpl = std::unique_ptr<SwStyleProperties_Impl>(
- new SwStyleProperties_Impl(aSwMapProvider.GetPropertySet(m_bIsConditional ? PROPERTY_MAP_CONDITIONAL_PARA_STYLE : m_rEntry.m_nPropMapType)->getPropertyMap()));
+ m_pPropertiesImpl = o3tl::make_unique<SwStyleProperties_Impl>(
+ aSwMapProvider.GetPropertySet(m_bIsConditional ? PROPERTY_MAP_CONDITIONAL_PARA_STYLE : m_rEntry.m_nPropMapType)->getPropertyMap());
}
SwXStyle::SwXStyle(SfxStyleSheetBasePool* pPool, SfxStyleFamily eFamily, SwDoc* pDoc, const OUString& rStyleName)
diff --git a/sw/source/filter/xml/xmltbli.cxx b/sw/source/filter/xml/xmltbli.cxx
index 96915cd1de80..0e65d2fcd444 100644
--- a/sw/source/filter/xml/xmltbli.cxx
+++ b/sw/source/filter/xml/xmltbli.cxx
@@ -23,6 +23,7 @@
#include <com/sun/star/text/XTextTable.hpp>
#include <com/sun/star/table/XCellRange.hpp>
#include <o3tl/numeric.hxx>
+#include <o3tl/make_unique.hxx>
#include <svl/itemset.hxx>
#include <svl/zformat.hxx>
#include <sax/tools/converter.hxx>
@@ -338,7 +339,7 @@ SwXMLTableRow_Impl::SwXMLTableRow_Impl( const OUString& rStyleName,
for( sal_uInt32 i=0U; i<nCells; ++i )
{
- m_Cells.push_back(std::unique_ptr<SwXMLTableCell_Impl>(new SwXMLTableCell_Impl));
+ m_Cells.push_back(o3tl::make_unique<SwXMLTableCell_Impl>());
}
}
@@ -362,8 +363,8 @@ void SwXMLTableRow_Impl::Expand( sal_uInt32 nCells, bool bOneCell )
sal_uInt32 nColSpan = nCells - m_Cells.size();
for (size_t i = m_Cells.size(); i < nCells; ++i)
{
- m_Cells.push_back(std::unique_ptr<SwXMLTableCell_Impl>(
- new SwXMLTableCell_Impl(1UL, (bOneCell) ? nColSpan : 1UL)));
+ m_Cells.push_back(o3tl::make_unique<SwXMLTableCell_Impl>(
+ 1UL, (bOneCell) ? nColSpan : 1UL));
nColSpan--;
}
@@ -1635,8 +1636,8 @@ void SwXMLTableContext::InsertCell( const OUString& rStyleName,
if (m_pRows->size() < nRowsReq)
{
for (size_t i = m_pRows->size(); i < nRowsReq; ++i)
- m_pRows->push_back(std::unique_ptr<SwXMLTableRow_Impl>(
- new SwXMLTableRow_Impl("", GetColumnCount())));
+ m_pRows->push_back(o3tl::make_unique<SwXMLTableRow_Impl>(
+ "", GetColumnCount()));
}
OUString sStyleName( rStyleName );
@@ -1694,9 +1695,9 @@ void SwXMLTableContext::InsertRow( const OUString& rStyleName,
else
{
// add a new row
- m_pRows->push_back(std::unique_ptr<SwXMLTableRow_Impl>(
- new SwXMLTableRow_Impl(rStyleName, GetColumnCount(),
- &rDfltCellStyleName, i_rXmlId)));
+ m_pRows->push_back(o3tl::make_unique<SwXMLTableRow_Impl>(
+ rStyleName, GetColumnCount(),
+ &rDfltCellStyleName, i_rXmlId));
}
// We start at the first column ...
diff --git a/sw/source/uibase/shells/grfsh.cxx b/sw/source/uibase/shells/grfsh.cxx
index 43362f444017..a056e9af88e8 100644
--- a/sw/source/uibase/shells/grfsh.cxx
+++ b/sw/source/uibase/shells/grfsh.cxx
@@ -19,6 +19,7 @@
#include <cmdid.h>
#include <hintids.hxx>
+#include <o3tl/make_unique.hxx>
#include <tools/urlobj.hxx>
#include <vcl/msgbox.hxx>
#include <svl/stritem.hxx>
@@ -195,8 +196,8 @@ void SwGrfShell::Execute(SfxRequest &rReq)
GraphicObject const*const pGraphicObject(rSh.GetGraphicObj());
if(nullptr != pGraphicObject)
{
- m_ExternalEdits.push_back(std::unique_ptr<SwExternalToolEdit>(
- new SwExternalToolEdit(&rSh)));
+ m_ExternalEdits.push_back(o3tl::make_unique<SwExternalToolEdit>(
+ &rSh));
m_ExternalEdits.back()->Edit(pGraphicObject);
}
}
diff --git a/sw/source/uibase/shells/txtattr.cxx b/sw/source/uibase/shells/txtattr.cxx
index a6532d604250..4125dd337ef5 100644
--- a/sw/source/uibase/shells/txtattr.cxx
+++ b/sw/source/uibase/shells/txtattr.cxx
@@ -19,6 +19,7 @@
#include <hintids.hxx>
+#include <o3tl/make_unique.hxx>
#include <vcl/msgbox.hxx>
#include <svl/whiter.hxx>
#include <svl/stritem.hxx>
@@ -231,7 +232,7 @@ void SwTextShell::ExecCharAttrArgs(SfxRequest &rReq)
{
// must create new one, otherwise document is without pam
SwPaM* pPaM = rWrtSh.GetCursor();
- vItems.push_back( std::make_pair( pSize, std::unique_ptr<SwPaM>(new SwPaM( *(pPaM->GetMark()), *(pPaM->GetPoint()))) ) );
+ vItems.push_back( std::make_pair( pSize, o3tl::make_unique<SwPaM>( *(pPaM->GetMark()), *(pPaM->GetPoint())) ) );
}
else
vItems = rWrtSh.GetItemWithPaM( RES_CHRATR_FONTSIZE );
diff --git a/sw/source/uibase/sidebar/StylePresetsPanel.cxx b/sw/source/uibase/sidebar/StylePresetsPanel.cxx
index 68005354adce..2dc12033bd12 100644
--- a/sw/source/uibase/sidebar/StylePresetsPanel.cxx
+++ b/sw/source/uibase/sidebar/StylePresetsPanel.cxx
@@ -40,6 +40,7 @@
#include <comphelper/processfactory.hxx>
#include <comphelper/documentconstants.hxx>
#include <comphelper/string.hxx>
+#include <o3tl/make_unique.hxx>
namespace sw { namespace sidebar {
@@ -182,7 +183,7 @@ void StylePresetsPanel::RefreshList()
OUString aURL = aTemplates.GetPath(i,j);
BitmapEx aPreview = CreatePreview(aURL, aName);
mpValueSet->InsertItem(j, Image(aPreview), aName);
- maTemplateEntries.push_back(std::unique_ptr<TemplateEntry>(new TemplateEntry(aURL)));
+ maTemplateEntries.push_back(o3tl::make_unique<TemplateEntry>(aURL));
mpValueSet->SetItemData(j, maTemplateEntries.back().get());
}
}