[Libreoffice-commits] .: Branch 'libreoffice-3-3' - sw/source

Caolán McNamara caolan at kemper.freedesktop.org
Wed Dec 22 08:06:06 PST 2010


 sw/source/core/undo/SwUndoField.cxx |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 77db4e7e28cd861c07c442bc0c0cf5d2f0346fb3
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Dec 22 14:18:41 2010 +0000

    Resolves: rhbz#660342 Undo/Redo crash with postits
    (cherry picked from commit 1b58066892daa9365d23b39d7439fbbe7d562b13)

diff --git a/sw/source/core/undo/SwUndoField.cxx b/sw/source/core/undo/SwUndoField.cxx
index 6d93bfc..7bb38c3 100644
--- a/sw/source/core/undo/SwUndoField.cxx
+++ b/sw/source/core/undo/SwUndoField.cxx
@@ -87,7 +87,8 @@ SwUndoFieldFromDoc::~SwUndoFieldFromDoc()
 void SwUndoFieldFromDoc::Undo( SwUndoIter& )
 {
     SwTxtFld * pTxtFld = SwDoc::GetTxtFld(GetPosition());
-    const SwField * pField = pTxtFld->GetFld().GetFld();
+
+    const SwField * pField = pTxtFld ? pTxtFld->GetFld().GetFld() : NULL;
 
     if (pField)
     {
@@ -102,7 +103,7 @@ void SwUndoFieldFromDoc::Undo( SwUndoIter& )
 void SwUndoFieldFromDoc::Redo( SwUndoIter& )
 {
     SwTxtFld * pTxtFld = SwDoc::GetTxtFld(GetPosition());
-    const SwField * pField = pTxtFld->GetFld().GetFld();
+    const SwField * pField = pTxtFld ? pTxtFld->GetFld().GetFld() : NULL;
 
     if (pField)
     {


More information about the Libreoffice-commits mailing list