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

Michael Stahl mstahl at redhat.com
Thu Feb 6 05:47:44 PST 2014


 sw/source/core/doc/doc.cxx |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 85a8c1361dccb2c3b98458c2c1c377d5de275d0e
Author: Michael Stahl <mstahl at redhat.com>
Date:   Thu Feb 6 13:02:19 2014 +0100

    SwDoc::ConvertFieldsToText(): don't insert empty strings
    
    Prevents an assert on accessing sText[0] in InsertString().
    
    Change-Id: I1828694a4c1e46f8b48cf3571ec2bf4dd615bf2c

diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index e5d35dd..5155eeb 100644
--- a/sw/source/core/doc/doc.cxx
+++ b/sw/source/core/doc/doc.cxx
@@ -2426,7 +2426,8 @@ bool SwDoc::ConvertFieldsToText()
                     SwPaM aPam1(*pTxtFld->GetpTxtNode(), *pTxtFld->GetStart());
                     aPam1.Move();
                     //insert first to keep the field's attributes
-                    InsertString( aPam1, sText );
+                    if (!sText.isEmpty())
+                        InsertString( aPam1, sText );
                     SwPaM aPam2(*pTxtFld->GetpTxtNode(), *pTxtFld->GetStart());
                     aPam2.SetMark();
                     aPam2.Move();


More information about the Libreoffice-commits mailing list