summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorFridrich Štrba <fridrich.strba@bluewin.ch>2013-05-31 12:27:49 +0200
committerFridrich Strba <fridrich@documentfoundation.org>2013-07-30 09:59:07 +0000
commit44ad2d98a5e9dbf7f6429caf920cdcf3931a62c4 (patch)
tree07343d18186e2d82e29f9e18b785adf8fb0435a4 /sw/source
parent1e1d5847102cc23f33649118637e1723155e4b1a (diff)
Resolves: rhbz#989686 Fix crash with ooo120774-1.doc
Do not try to remove line breaks from empty string Reviewed-on: https://gerrit.libreoffice.org/4114 Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org> Tested-by: Fridrich Strba <fridrich@documentfoundation.org> (cherry picked from commit 2cb9aaf44dc589af79d62d7b1136b5d65e9f47d4) Change-Id: Ieb12c541d42944aac813cee10ce479207b1c674b Reviewed-on: https://gerrit.libreoffice.org/5195 Reviewed-by: Fridrich Strba <fridrich@documentfoundation.org> Tested-by: Fridrich Strba <fridrich@documentfoundation.org>
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/core/doc/doctxm.cxx2
1 files changed, 2 insertions, 0 deletions
diff --git a/sw/source/core/doc/doctxm.cxx b/sw/source/core/doc/doctxm.cxx
index 2029d9f30ee3..6498585a79fb 100644
--- a/sw/source/core/doc/doctxm.cxx
+++ b/sw/source/core/doc/doctxm.cxx
@@ -1536,6 +1536,8 @@ static String lcl_GetNumString( const SwTOXSortTabBase& rBase, bool bUsePrefix,
/// to a single space, and trailing space removed.
String lcl_RemoveLineBreaks( String sRet )
{
+ if (!sRet.Len())
+ return sRet;
xub_StrLen nOffset = 0;
sRet.SearchAndReplaceAll('\n', ' ');
for (xub_StrLen i = 1; i < sRet.Len(); i++)