Kaydet (Commit) 73422d43 authored tarafından Miklos Vajna's avatar Miklos Vajna

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
üst 46bab17e
...@@ -3308,7 +3308,7 @@ XubString SwTxtNode::GetRedlineTxt( xub_StrLen nIdx, xub_StrLen nLen, ...@@ -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(); xub_StrLen nTxtStt = nIdx, nIdxEnd = nIdx + aTxt.Len();
for( sal_uInt16 n = 0; n < aRedlArr.size(); n += 2 ) for( sal_uInt16 n = 0; n < aRedlArr.size(); n += 2 )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment