summaryrefslogtreecommitdiff
path: root/sw/source/core/txtnode/ndtxt.cxx
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@suse.cz>2013-03-08 18:51:53 +0100
committerMiklos Vajna <vmiklos@suse.cz>2013-03-08 19:05:51 +0100
commit73422d433bde55a107e4cfebc72a099cbd9b5933 (patch)
tree87ca89c3050c29e45b7cd8d547003157c2c254e9 /sw/source/core/txtnode/ndtxt.cxx
parent46bab17e6d48c2279f4698d46f01db5404b0ba6f (diff)
SwTxtNode::GetRedlineTxt: fix string conversion
As I understand it, String allowed the length parameter to be longer than the remaining string, in which case it simply returned the substring till the end of the string. In case of OUString, "!!br0ken!!" is returned instead, so make sure the length is never longer then the remaining string. Change-Id: I69499d74f1d9ba8ed6d9ba1a18d10b45ce319bf5
Diffstat (limited to 'sw/source/core/txtnode/ndtxt.cxx')
-rw-r--r--sw/source/core/txtnode/ndtxt.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index 0070f9e7167c..6421edd675cd 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -3308,7 +3308,7 @@ XubString SwTxtNode::GetRedlineTxt( xub_StrLen nIdx, xub_StrLen nLen,
}
}
- XubString aTxt(GetTxt().copy(nIdx, nLen));
+ XubString aTxt(nLen > GetTxt().getLength() ? GetTxt().copy(nIdx) : GetTxt().copy(nIdx, nLen));
xub_StrLen nTxtStt = nIdx, nIdxEnd = nIdx + aTxt.Len();
for( sal_uInt16 n = 0; n < aRedlArr.size(); n += 2 )