[Libreoffice-commits] .: sw/source

Lubos Lunak llunak at kemper.freedesktop.org
Mon Jan 30 10:21:41 PST 2012


 sw/source/filter/ww8/ww8scan.cxx |   18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

New commits:
commit b5a73d4b2b283d3d1a57ac0f66b608998960a873
Author: Luboš Luňák <l.lunak at suse.cz>
Date:   Mon Jan 30 19:07:43 2012 +0100

    query remaining stream size after seeking, not before (fdo#45255)

diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx
index a97f383..593624b 100644
--- a/sw/source/filter/ww8/ww8scan.cxx
+++ b/sw/source/filter/ww8/ww8scan.cxx
@@ -1978,10 +1978,11 @@ WW8PLCFspecial::WW8PLCFspecial(SvStream* pSt, sal_uInt32 nFilePos,
     const sal_uInt32 nValidMin=4;
 
     sal_Size nOldPos = pSt->Tell();
-    sal_Size nRemainingSize = pSt->remainingSize();
 
-    bool bValid = checkSeek(*pSt, nFilePos) && (nRemainingSize >= nValidMin) &&
-        (nPLCF >= nValidMin);
+    bool bValid = checkSeek(*pSt, nFilePos);
+    sal_Size nRemainingSize = pSt->remainingSize();
+    if( !(nRemainingSize >= nValidMin && nPLCF >= nValidMin ))
+        bValid = false;
     nPLCF = bValid ? std::min(nRemainingSize, static_cast<sal_Size>(nPLCF)) : nValidMin;
 
     // Pointer auf Pos- u. Struct-Array
@@ -2136,9 +2137,7 @@ WW8PLCF::WW8PLCF(SvStream& rSt, WW8_FC nFilePos, sal_Int32 nPLCF, int nStruct,
 void WW8PLCF::ReadPLCF(SvStream& rSt, WW8_FC nFilePos, sal_uInt32 nPLCF)
 {
     sal_Size nOldPos = rSt.Tell();
-    sal_Size nRemainingSize = rSt.remainingSize();
-
-    bool bValid = checkSeek(rSt, nFilePos) && (nRemainingSize >= nPLCF);
+    bool bValid = checkSeek(rSt, nFilePos) && (rSt.remainingSize() >= nPLCF);
 
     if (bValid)
     {
@@ -2317,10 +2316,11 @@ WW8PLCFpcd::WW8PLCFpcd(SvStream* pSt, sal_uInt32 nFilePos,
     const sal_uInt32 nValidMin=4;
 
     sal_Size nOldPos = pSt->Tell();
-    sal_Size nRemainingSize = pSt->remainingSize();
 
-    bool bValid = checkSeek(*pSt, nFilePos) && (nRemainingSize >= nValidMin) &&
-        (nPLCF >= nValidMin);
+    bool bValid = checkSeek(*pSt, nFilePos);
+    sal_Size nRemainingSize = pSt->remainingSize();
+    if( !(nRemainingSize >= nValidMin && nPLCF >= nValidMin ))
+        bValid = false;
     nPLCF = bValid ? std::min(nRemainingSize, static_cast<sal_Size>(nPLCF)) : nValidMin;
 
     pPLCF_PosArray = new sal_Int32[ ( nPLCF + 3 ) / 4 ];    // Pointer auf Pos-Array


More information about the Libreoffice-commits mailing list