summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-04-11 10:47:14 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-04-11 13:22:49 +0200
commit56e0f1fcd43e0d4ab8c7a678cbbed1ea2c612868 (patch)
tree5053bac1d4d99d7b625a8b3684288922cad6ae63
parent4dcecf295c90759f419545b2db5fffbd506f15e0 (diff)
make EditPosition::Clone return std::unique_ptr
Change-Id: Ie1f987f58fd7be8067dba47e47300dd97a01a393 Reviewed-on: https://gerrit.libreoffice.org/52714 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--editeng/source/editeng/eertfpar.cxx4
-rw-r--r--editeng/source/rtf/svxrtf.cxx2
-rw-r--r--include/editeng/svxrtf.hxx2
3 files changed, 4 insertions, 4 deletions
diff --git a/editeng/source/editeng/eertfpar.cxx b/editeng/source/editeng/eertfpar.cxx
index 1b6bfce431a1..ccecfa5723de 100644
--- a/editeng/source/editeng/eertfpar.cxx
+++ b/editeng/source/editeng/eertfpar.cxx
@@ -617,9 +617,9 @@ sal_Int32 EditNodeIdx::GetIdx() const
EditPosition::EditPosition(EditEngine* pEE, EditSelection* pSel) :
mpEditEngine(pEE), mpCurSel(pSel) {}
-EditPosition* EditPosition::Clone() const
+std::unique_ptr<EditPosition> EditPosition::Clone() const
{
- return new EditPosition(mpEditEngine, mpCurSel);
+ return std::unique_ptr<EditPosition>(new EditPosition(mpEditEngine, mpCurSel));
}
EditNodeIdx* EditPosition::MakeNodeIdx() const
diff --git a/editeng/source/rtf/svxrtf.cxx b/editeng/source/rtf/svxrtf.cxx
index 1b0efa0617b0..369995b1d293 100644
--- a/editeng/source/rtf/svxrtf.cxx
+++ b/editeng/source/rtf/svxrtf.cxx
@@ -87,7 +87,7 @@ SvxRTFParser::~SvxRTFParser()
void SvxRTFParser::SetInsPos( const EditPosition& rNew )
{
- pInsPos.reset( rNew.Clone() );
+ pInsPos = rNew.Clone();
}
SvParserState SvxRTFParser::CallParser()
diff --git a/include/editeng/svxrtf.hxx b/include/editeng/svxrtf.hxx
index 8273e64b6f12..89f1cdc4bfae 100644
--- a/include/editeng/svxrtf.hxx
+++ b/include/editeng/svxrtf.hxx
@@ -81,7 +81,7 @@ public:
sal_Int32 GetCntIdx() const;
// clone
- EditPosition* Clone() const;
+ std::unique_ptr<EditPosition> Clone() const;
// clone NodeIndex
EditNodeIdx* MakeNodeIdx() const;