[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [koffice] libs/kotext: Avoid null pointer dereference.
From:       "Dr. Robert Marmorstein" <robert () narnia ! homeunix ! com>
Date:       2011-08-02 9:16:39
Message-ID: 20110802091639.83965A60CE () git ! kde ! org
[Download RAW message or body]

Git commit d03cbb78429cfee088f0c732d04bc3e08b34c6af by Dr. Robert Marmorstein.
Committed on 01/08/2011 at 18:01.
Pushed by robertm into branch 'master'.

Avoid null pointer dereference.

Another static checking catch.

M  +3    -2    libs/kotext/KTextShapeData.cpp

http://commits.kde.org/koffice/d03cbb78429cfee088f0c732d04bc3e08b34c6af

diff --git a/libs/kotext/KTextShapeData.cpp b/libs/kotext/KTextShapeData.cpp
index efbfb0b..d912106 100644
--- a/libs/kotext/KTextShapeData.cpp
+++ b/libs/kotext/KTextShapeData.cpp
@@ -225,9 +225,10 @@ bool KTextShapeData::loadOdf(const KXmlElement &element, KShapeLoadingContext &c
     QTextCursor cursor(document());
     loader.loadBody(element, cursor);   // now let's load the body from the ODF KXmlElement.
     KoTextEditor *editor = KTextDocument(document()).textEditor();
-    if (editor) // at one point we have to get the position from the odf doc instead.
+    if (editor) { // at one point we have to get the position from the odf doc instead.
         editor->setPosition(0);
-    editor->finishedLoading();
+        editor->finishedLoading();
+    }
 
     return true;
 }


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic