Kaydet (Commit) 4308702e authored tarafından Caolán McNamara's avatar Caolán McNamara Kaydeden (comit) Andras Timar

add ww6 test dir and fix a crash

Change-Id: Id08176640672095c03e0b124cd65a9dce26ac2db
(cherry picked from commit 42a709d1)
Reviewed-on: https://gerrit.libreoffice.org/17892Reviewed-by: 's avatarDavid Tardon <dtardon@redhat.com>
Tested-by: 's avatarDavid Tardon <dtardon@redhat.com>
üst d27b1190
This diff was suppressed by a .gitattributes entry.
...@@ -151,6 +151,10 @@ void SwFiltersTest::testCVEs() ...@@ -151,6 +151,10 @@ void SwFiltersTest::testCVEs()
getURLFromSrc("/sw/qa/core/data/ww8/"), getURLFromSrc("/sw/qa/core/data/ww8/"),
OUString(FILTER_WW8)); OUString(FILTER_WW8));
testDir(OUString("MS WinWord 6.0"),
getURLFromSrc("/sw/qa/core/data/ww6/"),
OUString(sWW6));
testDir(OUString("MS WinWord 5"), testDir(OUString("MS WinWord 5"),
getURLFromSrc("/sw/qa/core/data/ww5/"), getURLFromSrc("/sw/qa/core/data/ww5/"),
OUString(sWW5)); OUString(sWW5));
......
...@@ -4276,6 +4276,14 @@ void WW8RStyle::ImportOldFormatStyles() ...@@ -4276,6 +4276,14 @@ void WW8RStyle::ImportOldFormatStyles()
std::vector< std::vector<sal_uInt8> > aConvertedChpx; std::vector< std::vector<sal_uInt8> > aConvertedChpx;
while (nByteCount < cbChpx) while (nByteCount < cbChpx)
{ {
if (stcp == aCHPXOffsets.size())
{
//more data than style slots, skip remainder
rSt.SeekRel(cbChpx-nByteCount);
nByteCount += cbChpx-nByteCount;
break;
}
sal_uInt8 cb(0); sal_uInt8 cb(0);
rSt.ReadUChar( cb ); rSt.ReadUChar( cb );
nByteCount++; nByteCount++;
...@@ -4298,12 +4306,7 @@ void WW8RStyle::ImportOldFormatStyles() ...@@ -4298,12 +4306,7 @@ void WW8RStyle::ImportOldFormatStyles()
else else
aConvertedChpx.push_back( std::vector<sal_uInt8>() ); aConvertedChpx.push_back( std::vector<sal_uInt8>() );
stcp++; ++stcp;
if (stcp == nStyles)
{
rSt.SeekRel(cbChpx-nByteCount);
nByteCount += cbChpx-nByteCount;
}
} }
std::vector<pxoffset> aPAPXOffsets(stcp); std::vector<pxoffset> aPAPXOffsets(stcp);
...@@ -4320,6 +4323,12 @@ void WW8RStyle::ImportOldFormatStyles() ...@@ -4320,6 +4323,12 @@ void WW8RStyle::ImportOldFormatStyles()
stcp=0; stcp=0;
while (nByteCount < cbPapx) while (nByteCount < cbPapx)
{ {
if (stcp == aPAPXOffsets.size())
{
rSt.SeekRel(cbPapx-nByteCount);
nByteCount += cbPapx-nByteCount;
}
sal_uInt8 cb(0); sal_uInt8 cb(0);
rSt.ReadUChar( cb ); rSt.ReadUChar( cb );
nByteCount++; nByteCount++;
...@@ -4341,13 +4350,7 @@ void WW8RStyle::ImportOldFormatStyles() ...@@ -4341,13 +4350,7 @@ void WW8RStyle::ImportOldFormatStyles()
nByteCount += nRemainder; nByteCount += nRemainder;
} }
stcp++; ++stcp;
if (stcp == nStyles)
{
rSt.SeekRel(cbPapx-nByteCount);
nByteCount += cbPapx-nByteCount;
}
} }
sal_uInt16 iMac(0); sal_uInt16 iMac(0);
......
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