Kaydet (Commit) d4e1802c authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:useuniqueptr in TextChainFlow

Change-Id: Iad96df43c9c7ae6d5fd4f3aa9c2c5c721711da30
Reviewed-on: https://gerrit.libreoffice.org/49331Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst f4b9c35c
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#define INCLUDED_SVX_TEXTCHAINFLOW_HXX #define INCLUDED_SVX_TEXTCHAINFLOW_HXX
#include <svx/textchain.hxx> #include <svx/textchain.hxx>
#include <memory>
class SdrTextObj; class SdrTextObj;
class SdrOutliner; class SdrOutliner;
...@@ -56,8 +57,8 @@ protected: ...@@ -56,8 +57,8 @@ protected:
ESelection maOverflowPosSel; ESelection maOverflowPosSel;
ESelection maPostChainingSel; ESelection maPostChainingSel;
OFlowChainedText *mpOverflChText; std::unique_ptr<OFlowChainedText> mpOverflChText;
UFlowChainedText *mpUnderflChText; std::unique_ptr<UFlowChainedText> mpUnderflChText;
void impCheckForFlowEvents(SdrOutliner *, SdrOutliner *); void impCheckForFlowEvents(SdrOutliner *, SdrOutliner *);
......
...@@ -46,8 +46,8 @@ TextChainFlow::TextChainFlow(SdrTextObj *pChainTarget) ...@@ -46,8 +46,8 @@ TextChainFlow::TextChainFlow(SdrTextObj *pChainTarget)
TextChainFlow::~TextChainFlow() TextChainFlow::~TextChainFlow()
{ {
delete mpOverflChText; mpOverflChText.reset();
delete mpUnderflChText; mpUnderflChText.reset();
} }
void TextChainFlow::impSetFlowOutlinerParams(SdrOutliner *, SdrOutliner *) void TextChainFlow::impSetFlowOutlinerParams(SdrOutliner *, SdrOutliner *)
...@@ -91,14 +91,14 @@ void TextChainFlow::impCheckForFlowEvents(SdrOutliner *pFlowOutl, SdrOutliner *p ...@@ -91,14 +91,14 @@ void TextChainFlow::impCheckForFlowEvents(SdrOutliner *pFlowOutl, SdrOutliner *p
// If we had an underflow before we have to deep merge paras anyway // If we had an underflow before we have to deep merge paras anyway
bool bMustMergeParaOF = bMustMergeParaAmongLinks || mbOFisUFinduced; bool bMustMergeParaOF = bMustMergeParaAmongLinks || mbOFisUFinduced;
mpOverflChText = bOverflow ? mpOverflChText.reset( bOverflow ?
new OFlowChainedText(pFlowOutl, bMustMergeParaOF) : new OFlowChainedText(pFlowOutl, bMustMergeParaOF) :
nullptr; nullptr );
// Set current underflowing text (if any) // Set current underflowing text (if any)
mpUnderflChText = bUnderflow ? mpUnderflChText.reset( bUnderflow ?
new UFlowChainedText(pFlowOutl, bMustMergeParaAmongLinks) : new UFlowChainedText(pFlowOutl, bMustMergeParaAmongLinks) :
nullptr; nullptr );
// Reset update mode // Reset it here because we use WriteRTF (needing updatemode = true) in the two constructors above // Reset update mode // Reset it here because we use WriteRTF (needing updatemode = true) in the two constructors above
if (!bOldUpdateMode) // Reset only if the old value was false if (!bOldUpdateMode) // Reset only if the old value was false
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment