summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2021-09-28 15:35:21 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-09-28 18:26:03 +0200
commit73c56d8c7830b800aea23ecd083194d7b6ab8a03 (patch)
tree293fcc709e14232604c739629d10a4b02084b94d
parent8156a8f87996e353f8d36935e0497624245f1ad1 (diff)
no need to allocate this on the heap
Change-Id: Ie4935dbf9e5a2a9e7906839b260706a12494b610 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122778 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--sw/source/core/layout/calcmove.cxx12
1 files changed, 6 insertions, 6 deletions
diff --git a/sw/source/core/layout/calcmove.cxx b/sw/source/core/layout/calcmove.cxx
index 98df857e3910..ec53f551f135 100644
--- a/sw/source/core/layout/calcmove.cxx
+++ b/sw/source/core/layout/calcmove.cxx
@@ -1248,7 +1248,7 @@ void SwContentFrame::MakeAll(vcl::RenderContext* /*pRenderContext*/)
PROTOCOL_ENTER( this, PROT::MakeAll, DbgAction::NONE, nullptr )
// takes care of the notification in the dtor
- std::unique_ptr<SwContentNotify, o3tl::default_delete<SwContentNotify>> pNotify(new SwContentNotify( this ));
+ std::optional<SwContentNotify> oNotify( std::in_place, this );
// as long as bMakePage is true, a new page can be created (exactly once)
bool bMakePage = true;
@@ -1280,7 +1280,7 @@ void SwContentFrame::MakeAll(vcl::RenderContext* /*pRenderContext*/)
if ( !IsFollow() && rAttrs.JoinedWithPrev( *(this) ) )
{
- pNotify->SetBordersJoinedWithPrev();
+ oNotify->SetBordersJoinedWithPrev();
}
const bool bKeep = IsKeep(rAttrs.GetAttrSet().GetKeep(), GetBreakItem());
@@ -1720,7 +1720,7 @@ void SwContentFrame::MakeAll(vcl::RenderContext* /*pRenderContext*/)
bNxtNew) )
{
if( bMovedFwd )
- pNotify->SetInvaKeep();
+ oNotify->SetInvaKeep();
bMovedFwd = false;
}
}
@@ -1909,12 +1909,12 @@ void SwContentFrame::MakeAll(vcl::RenderContext* /*pRenderContext*/)
UnlockJoin();
oDeleteGuard.reset();
if ( bMovedFwd || bMovedBwd )
- pNotify->SetInvaKeep();
+ oNotify->SetInvaKeep();
if ( bMovedFwd )
{
- pNotify->SetInvalidatePrevPrtArea();
+ oNotify->SetInvalidatePrevPrtArea();
}
- pNotify.reset();
+ oNotify.reset();
SetFlyLock( false );
}