summaryrefslogtreecommitdiff
path: root/sw/source/filter/ww8/ww8par.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-08-20 20:55:25 +0100
committerCaolán McNamara <caolanm@redhat.com>2015-08-21 08:04:43 +0100
commit684a210dd44ba5bb239eb07842ced767059a3fb8 (patch)
tree3062aa30642e5c4f851b697004da70e89d33771e /sw/source/filter/ww8/ww8par.cxx
parent18e4f434d0cdb3c81cb90c7dd24ca3fefcca8d00 (diff)
clip text to skip to max text available
Change-Id: I5c5c033954d5b6f869a05f19f312f9330df74efb
Diffstat (limited to 'sw/source/filter/ww8/ww8par.cxx')
-rw-r--r--sw/source/filter/ww8/ww8par.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 21791a99457f..0d0fb1e54b86 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -3783,8 +3783,9 @@ long SwWW8ImplReader::ReadTextAttr(WW8_CP& rTextPos, long nTextEnd, bool& rbStar
(aRes.nSprmId == eFLD) || (aRes.nSprmId == eAND)
)
{
+ WW8_CP nMaxLegalSkip = nTextEnd - rTextPos;
// Skip Field/Footnote-/End-Note here
- rTextPos += nSkipChars;
+ rTextPos += std::min<WW8_CP>(nSkipChars, nMaxLegalSkip);
nSkipPos = rTextPos-1;
}
}