summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2014-02-06 13:02:19 +0100
committerMichael Stahl <mstahl@redhat.com>2014-02-06 14:44:08 +0100
commit85a8c1361dccb2c3b98458c2c1c377d5de275d0e (patch)
tree20a9d36a65fa839cd3cae16d44540e6b9b9eff8e /sw/source
parent11dbbc792f53dc581822c873eb198731c3425576 (diff)
SwDoc::ConvertFieldsToText(): don't insert empty strings
Prevents an assert on accessing sText[0] in InsertString(). Change-Id: I1828694a4c1e46f8b48cf3571ec2bf4dd615bf2c
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/core/doc/doc.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/sw/source/core/doc/doc.cxx b/sw/source/core/doc/doc.cxx
index e5d35ddc5ca0..5155eeb06d85 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();