[Libreoffice-commits] core.git: svx/source

Julien Nabet serval2412 at yahoo.fr
Wed Mar 13 13:10:54 PDT 2013


 svx/source/svdraw/svdundo.cxx |   13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

New commits:
commit 6e29f56895cd38aa7dee85112370a7cfc0d24632
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Wed Mar 13 21:06:52 2013 +0100

    coverity#705732: Resource leak
    
    Change-Id: I926c3cbe25b7b4310d67a8f9e96b4a98e61b26e0

diff --git a/svx/source/svdraw/svdundo.cxx b/svx/source/svdraw/svdundo.cxx
index c1e4b4d..7f310ee 100644
--- a/svx/source/svdraw/svdundo.cxx
+++ b/svx/source/svdraw/svdundo.cxx
@@ -1136,16 +1136,13 @@ void SdrUndoObjSetText::Undo()
 
 void SdrUndoObjSetText::Redo()
 {
-    // copy text for Undo, because the original now belongs to SetOutlinerParaObject()
-    OutlinerParaObject* pText1 = pNewText;
-
-    if(pText1)
-        pText1 = new OutlinerParaObject(*pText1);
-
     SdrText* pText = static_cast< SdrTextObj*>( pObj )->getText(mnText);
-    if( pText )
+    if( pText && pNewText)
+    {
+        // copy text for Undo, because the original now belongs to SetOutlinerParaObject()
+        OutlinerParaObject* pText1 = new OutlinerParaObject(*pNewText);
         static_cast< SdrTextObj* >( pObj )->NbcSetOutlinerParaObjectForText( pText1, pText );
-
+    }
     pObj->ActionChanged();
 
     // Trigger PageChangeCall


More information about the Libreoffice-commits mailing list