summaryrefslogtreecommitdiff
path: root/svx/source/svdraw
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2013-03-13 21:20:13 +0100
committerFridrich Strba <fridrich@documentfoundation.org>2013-03-14 07:48:43 +0000
commit28d2a0c162b477a013c7c51c19a94fb08b55b276 (patch)
tree7d3561af3c2716539a308547a408fe9565eefa74 /svx/source/svdraw
parent1d559d9e386591551baec14ef5eae9bacf7a0d97 (diff)
coverity#705733: Resource leak
+ Fix "if" format Change-Id: Iafd46d21e5b9ed21d7c7c338502d780be9f0c222 Reviewed-on: https://gerrit.libreoffice.org/2711 Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org> Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
Diffstat (limited to 'svx/source/svdraw')
-rw-r--r--svx/source/svdraw/svdundo.cxx13
1 files changed, 6 insertions, 7 deletions
diff --git a/svx/source/svdraw/svdundo.cxx b/svx/source/svdraw/svdundo.cxx
index 7f310ee349c5..19f6098f38b8 100644
--- a/svx/source/svdraw/svdundo.cxx
+++ b/svx/source/svdraw/svdundo.cxx
@@ -1121,14 +1121,13 @@ void SdrUndoObjSetText::Undo()
if (!bNewTextAvailable)
AfterSetText();
- // copy text for Undo, because the original now belongs to SetOutlinerParaObject()
- OutlinerParaObject* pText1 = pOldText;
- if(pText1)
- pText1 = new OutlinerParaObject(*pText1);
-
SdrText* pText = static_cast< SdrTextObj*>( pObj )->getText(mnText);
- if( pText )
+ if (pText && pOldText)
+ {
+ // copy text for Undo, because the original now belongs to SetOutlinerParaObject()
+ OutlinerParaObject* pText1 = new OutlinerParaObject(*pOldText);
pText->SetOutlinerParaObject(pText1);
+ }
pObj->SetEmptyPresObj( bEmptyPresObj );
pObj->ActionChanged();
@@ -1137,7 +1136,7 @@ void SdrUndoObjSetText::Undo()
void SdrUndoObjSetText::Redo()
{
SdrText* pText = static_cast< SdrTextObj*>( pObj )->getText(mnText);
- if( pText && pNewText)
+ if (pText && pNewText)
{
// copy text for Undo, because the original now belongs to SetOutlinerParaObject()
OutlinerParaObject* pText1 = new OutlinerParaObject(*pNewText);