summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2014-02-06 13:02:19 +0100
committerAndras Timar <andras.timar@collabora.com>2014-05-09 14:48:54 +0200
commitf1aa6122223572a46b693e73e2b5606efe9f1f8d (patch)
treea252f0f47265441d710ecfeff898f6b0e3d96c49 /sw/source
parentc4e5b8efd740620fc2fb4335bcf14a49caa01846 (diff)
SwDoc::ConvertFieldsToText(): don't insert empty strings
Prevents an assert on accessing sText[0] in InsertString(). Manually cherry-picked from 85a8c1361dccb2c3b98458c2c1c377d5de275d0e to resolve fdo#77720, see bt here https://bugs.freedesktop.org/attachment.cgi?id=97684 Change-Id: I1828694a4c1e46f8b48cf3571ec2bf4dd615bf2c Reviewed-on: https://gerrit.libreoffice.org/9113 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
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 6382d74bdf38..e1d84f3d4ce9 100644
--- a/sw/source/core/doc/doc.cxx
+++ b/sw/source/core/doc/doc.cxx
@@ -2427,7 +2427,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();