Kaydet (Commit) 93e7ae6f authored tarafından Caolán McNamara's avatar Caolán McNamara

with show changes on we can have negative offsets

for counting words in a range of text which has redline deleted
text at the start

Change-Id: I34149822d43f8ee3fbde58a166dad408fb588fce
üst 26967802
......@@ -175,7 +175,7 @@ sal_Int32 SwBreakIt::getGraphemeCount(const OUString& rText,
{
sal_Int32 nGraphemeCount = 0;
sal_Int32 nCurPos = nStart;
sal_Int32 nCurPos = std::max(0, nStart);
while (nCurPos < nEnd)
{
// fdo#49208 cheat and assume that nothing can combine with a space
......
......@@ -730,6 +730,8 @@ SwScanner::SwScanner( const SwTxtNode& rNd, const OUString& rTxt,
OUStringBuffer aBuf(aPreDashReplacementText);
for (sal_Int32 i = nStartPos; i < nEndPos; ++i)
{
if (i < 0)
continue;
sal_Unicode cChar = aBuf[i];
if (sDashes.indexOf(cChar) != -1)
{
......@@ -805,9 +807,9 @@ bool SwScanner::NextWord()
while ( true )
{
// skip non-letter characters:
while ( nBegin < aText.getLength() )
while (nBegin < aText.getLength())
{
if ( !u_isspace( aText[nBegin] ) )
if (nBegin >= 0 && !u_isspace(aText[nBegin]))
{
if ( !pLanguage )
{
......
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