summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-09-06 16:23:52 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-09-06 21:39:19 +0200
commit08e09136a60e176703c08aff8a7a8e8a12d3f9b1 (patch)
treed118824da65c66f0fa6223f2ee29e087311c2245
parent2b591a40b0f6894531350ccb733abef3c3e1d9bf (diff)
use unique_ptr in EditNodeIdx
Change-Id: I59702aa3d54f60cb3e41410e82b0532bac05274f Reviewed-on: https://gerrit.libreoffice.org/78717 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--editeng/source/editeng/eertfpar.cxx4
-rw-r--r--editeng/source/rtf/svxrtf.cxx8
-rw-r--r--include/editeng/svxrtf.hxx2
3 files changed, 7 insertions, 7 deletions
diff --git a/editeng/source/editeng/eertfpar.cxx b/editeng/source/editeng/eertfpar.cxx
index a8fac71a7c72..cc1cf2bd3424 100644
--- a/editeng/source/editeng/eertfpar.cxx
+++ b/editeng/source/editeng/eertfpar.cxx
@@ -617,9 +617,9 @@ std::unique_ptr<EditPosition> EditPosition::Clone() const
return std::unique_ptr<EditPosition>(new EditPosition(mpEditEngine, mpCurSel));
}
-EditNodeIdx* EditPosition::MakeNodeIdx() const
+std::unique_ptr<EditNodeIdx> EditPosition::MakeNodeIdx() const
{
- return new EditNodeIdx(mpEditEngine, mpCurSel->Max().GetNode());
+ return std::make_unique<EditNodeIdx>(mpEditEngine, mpCurSel->Max().GetNode());
}
sal_Int32 EditPosition::GetNodeIdx() const
diff --git a/editeng/source/rtf/svxrtf.cxx b/editeng/source/rtf/svxrtf.cxx
index 4c284248c3e8..cb50be3cb795 100644
--- a/editeng/source/rtf/svxrtf.cxx
+++ b/editeng/source/rtf/svxrtf.cxx
@@ -793,7 +793,7 @@ void SvxRTFParser::AttrGroupEnd() // process the current, delete from Stack
}
}
- pOld->pEndNd = pInsPos->MakeNodeIdx();
+ pOld->pEndNd = pInsPos->MakeNodeIdx().release();
pOld->nEndCnt = pInsPos->GetCntIdx();
/*
@@ -939,7 +939,7 @@ SvxRTFItemStackType::SvxRTFItemStackType(
: aAttrSet( rPool, pWhichRange )
, nStyleNo( 0 )
{
- pSttNd.reset( rPos.MakeNodeIdx() );
+ pSttNd = rPos.MakeNodeIdx();
nSttCnt = rPos.GetCntIdx();
pEndNd = pSttNd.get();
nEndCnt = nSttCnt;
@@ -952,7 +952,7 @@ SvxRTFItemStackType::SvxRTFItemStackType(
: aAttrSet( *rCpy.aAttrSet.GetPool(), rCpy.aAttrSet.GetRanges() )
, nStyleNo( rCpy.nStyleNo )
{
- pSttNd.reset( rPos.MakeNodeIdx() );
+ pSttNd = rPos.MakeNodeIdx();
nSttCnt = rPos.GetCntIdx();
pEndNd = pSttNd.get();
nEndCnt = nSttCnt;
@@ -1017,7 +1017,7 @@ void SvxRTFItemStackType::SetStartPos( const EditPosition& rPos )
{
if (pSttNd.get() != pEndNd)
delete pEndNd;
- pSttNd.reset(rPos.MakeNodeIdx() );
+ pSttNd = rPos.MakeNodeIdx();
pEndNd = pSttNd.get();
nSttCnt = rPos.GetCntIdx();
}
diff --git a/include/editeng/svxrtf.hxx b/include/editeng/svxrtf.hxx
index d38d1c605460..1188ed65f8af 100644
--- a/include/editeng/svxrtf.hxx
+++ b/include/editeng/svxrtf.hxx
@@ -71,7 +71,7 @@ public:
std::unique_ptr<EditPosition> Clone() const;
// clone NodeIndex
- EditNodeIdx* MakeNodeIdx() const;
+ std::unique_ptr<EditNodeIdx> MakeNodeIdx() const;
};
typedef std::map<short, std::unique_ptr<vcl::Font>> SvxRTFFontTbl;