diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-09-06 16:02:45 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-09-06 21:40:03 +0200 |
commit | 374782be555c1d91628a098c3f1c5cd85f7b0b01 (patch) | |
tree | c2c16d4d2a330611e2c8dcaf0d3ac030f2413d94 /editeng | |
parent | f76a7bcc65343a4aa51d24b13c998bf04031d89f (diff) |
use unique_ptr in Outliner
Change-Id: I022cf01f2c36f8846227a89418735271880d1f95
Reviewed-on: https://gerrit.libreoffice.org/78715
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/outliner/outliner.cxx | 10 | ||||
-rw-r--r-- | editeng/source/outliner/overflowingtxt.cxx | 4 |
2 files changed, 7 insertions, 7 deletions
diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx index 320dc6958355..515a9bcebe02 100644 --- a/editeng/source/outliner/outliner.cxx +++ b/editeng/source/outliner/outliner.cxx @@ -2012,7 +2012,7 @@ bool Outliner::IsPageOverflow() return pEditEngine->IsPageOverflow(); } -NonOverflowingText *Outliner::GetNonOverflowingText() const +std::unique_ptr<NonOverflowingText> Outliner::GetNonOverflowingText() const { /* XXX: * nCount should be the number of paragraphs of the non overflowing text @@ -2076,7 +2076,7 @@ NonOverflowingText *Outliner::GetNonOverflowingText() const ESelection aEmptySel(0,0,0,0); //EditTextObject *pTObj = pEditEngine->CreateTextObject(aEmptySel); bool const bLastParaInterrupted = true; // Last Para was interrupted since everything overflew - return new NonOverflowingText(aEmptySel, bLastParaInterrupted); + return std::make_unique<NonOverflowingText>(aEmptySel, bLastParaInterrupted); } else { // Get the lines that of the overflowing para fit in the box sal_Int32 nOverflowingPara = nCount; @@ -2113,7 +2113,7 @@ NonOverflowingText *Outliner::GetNonOverflowingText() const bool bLastParaInterrupted = pEditEngine->GetOverflowingLineNum() > 0; - return new NonOverflowingText(aOverflowingTextSelection, bLastParaInterrupted); + return std::make_unique<NonOverflowingText>(aOverflowingTextSelection, bLastParaInterrupted); } } @@ -2125,7 +2125,7 @@ std::unique_ptr<OutlinerParaObject> Outliner::GetEmptyParaObject() const return pPObj; } -OverflowingText *Outliner::GetOverflowingText() const +std::unique_ptr<OverflowingText> Outliner::GetOverflowingText() const { if ( pEditEngine->GetOverflowingParaNum() < 0) return nullptr; @@ -2156,7 +2156,7 @@ OverflowingText *Outliner::GetOverflowingText() const sal_Int32 nLastParaLen = GetText(GetParagraph(nLastPara)).getLength(); aOverflowingTextSel = ESelection(nOverflowingPara, nLen, nLastPara, nLastParaLen); - return new OverflowingText(pEditEngine->CreateTransferable(aOverflowingTextSel)); + return std::make_unique<OverflowingText>(pEditEngine->CreateTransferable(aOverflowingTextSel)); } diff --git a/editeng/source/outliner/overflowingtxt.cxx b/editeng/source/outliner/overflowingtxt.cxx index 0181d93b2249..7d09dfb02acc 100644 --- a/editeng/source/outliner/overflowingtxt.cxx +++ b/editeng/source/outliner/overflowingtxt.cxx @@ -159,8 +159,8 @@ std::unique_ptr<OutlinerParaObject> OverflowingText::DeeplyMergeParaObject(Outli OFlowChainedText::OFlowChainedText(Outliner const *pOutl, bool bIsDeepMerge) { - mpOverflowingTxt.reset( pOutl->GetOverflowingText() ); - mpNonOverflowingTxt.reset( pOutl->GetNonOverflowingText() ); + mpOverflowingTxt = pOutl->GetOverflowingText(); + mpNonOverflowingTxt = pOutl->GetNonOverflowingText(); mbIsDeepMerge = bIsDeepMerge; } |