diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-09-29 10:13:18 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-09-29 11:10:31 +0100 |
commit | d6377753ef481de643ce77db2d977177b67eb0cb (patch) | |
tree | 8e163743ea45bd0a93051db75b09682f546c6e9b /svx | |
parent | d643165f8161fbc4d2ade3a0f315565a87da0d63 (diff) |
coverit#1325064 Resource leak
Change-Id: Iaf0798fdddf38698816dba6a1c512d8ce3a4db39
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/svdraw/textchainflow.cxx | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/svx/source/svdraw/textchainflow.cxx b/svx/source/svdraw/textchainflow.cxx index c8de6c6bc17c..cfdb6ce5e007 100644 --- a/svx/source/svdraw/textchainflow.cxx +++ b/svx/source/svdraw/textchainflow.cxx @@ -160,9 +160,9 @@ bool TextChainFlow::IsUnderflow() const // XXX:Would it be possible to unify undeflow and its possibly following overrflow? void TextChainFlow::ExecuteUnderflow(SdrOutliner *pOutl) { - //GetTextChain()->SetNilChainingEvent(mpTargetLink, true); // making whole text + bool bNewTextTransferred = false; OutlinerParaObject *pNewText = impGetMergedUnderflowParaObject(pOutl); // Set the other box empty; it will be replaced by the rest of the text if overflow occurs @@ -174,13 +174,18 @@ void TextChainFlow::ExecuteUnderflow(SdrOutliner *pOutl) // This should not be done in editing mode!! //XXX if (!mpTargetLink->IsInEditMode()) + { mpTargetLink->NbcSetOutlinerParaObject(pNewText); + bNewTextTransferred = true; + } // Restore size and set new text //pOutl->SetMaxAutoPaperSize(aOldSize); // XXX (it seems to be working anyway without this) pOutl->SetText(*pNewText); //GetTextChain()->SetNilChainingEvent(mpTargetLink, false); + if (!bNewTextTransferred) + delete pNewText; // Check for new overflow CheckForFlowEvents(pOutl); |