[Libreoffice-commits] .: sw/source
Caolán McNamara
caolan at kemper.freedesktop.org
Thu Jun 23 05:14:13 PDT 2011
sw/source/filter/ww8/ww8par.cxx | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
New commits:
commit 65a8b16c138d97f0de851eedfbe07323f7ccd155
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Jun 23 12:45:44 2011 +0100
Resolves: #i95550# handle wrong text len gracefully
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 753e4c9..47606ff 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -2622,9 +2622,6 @@ bool SwWW8ImplReader::ReadPlainChars(WW8_CP& rPos, long nEnd, long nCpOfs)
// Unicode-Flag neu setzen und notfalls File-Pos korrigieren
// merke: Seek kostet nicht viel, da inline geprueft wird,
// ob die korrekte FilePos nicht schon erreicht ist.
- WW8_FC nStreamPos = pSBase->WW8Cp2Fc(nCpOfs+rPos, &bIsUnicode);
- pStrm->Seek( nStreamPos );
-
xub_StrLen nLen;
if (nEnd - rPos <= (STRING_MAXLEN-1))
nLen = writer_cast<xub_StrLen>(nEnd - rPos);
@@ -2634,6 +2631,16 @@ bool SwWW8ImplReader::ReadPlainChars(WW8_CP& rPos, long nEnd, long nCpOfs)
if (!nLen)
return true;
+ sal_Size nRequestedPos = pSBase->WW8Cp2Fc(nCpOfs+rPos, &bIsUnicode);
+ sal_Size nSeekedPos = pStrm->Seek(nRequestedPos);
+ OSL_ENSURE(nRequestedPos == nSeekedPos, "Document claimed to have more text than available");
+ if (nRequestedPos != nSeekedPos)
+ {
+ //Swallow missing range, e.g. #i95550#
+ rPos+=nLen;
+ return true;
+ }
+
const CharSet eSrcCharSet = bVer67 ? GetCurrentCharSet() :
RTL_TEXTENCODING_MS_1252;
const CharSet eSrcCJKCharSet = bVer67 ? GetCurrentCJKCharSet() :
More information about the Libreoffice-commits
mailing list