Kaydet (Commit) 25d39658 authored tarafından Caolán McNamara's avatar Caolán McNamara

test for end before start, e.g. hang-3.doc

Change-Id: I3b0c7766cdba31d6303de7fe34a5c85567de8116
üst 6f3d58c6
...@@ -6670,6 +6670,11 @@ bool WW8PLCF_HdFt::GetTextPos(sal_uInt8 grpfIhdt, sal_uInt8 nWhich, WW8_CP& rSta ...@@ -6670,6 +6670,11 @@ bool WW8PLCF_HdFt::GetTextPos(sal_uInt8 grpfIhdt, sal_uInt8 nWhich, WW8_CP& rSta
aPLCF.SetIdx( nIdx ); // Lookup suitable CP aPLCF.SetIdx( nIdx ); // Lookup suitable CP
aPLCF.Get( rStart, nEnd, pData ); aPLCF.Get( rStart, nEnd, pData );
if (nEnd < rStart)
{
SAL_WARN("sw.ww8", "End " << nEnd << " before Start " << rStart);
return false;
}
rLen = nEnd - rStart; rLen = nEnd - rStart;
aPLCF.advance(); aPLCF.advance();
...@@ -6683,7 +6688,13 @@ bool WW8PLCF_HdFt::GetTextPosExact(short nIdx, WW8_CP& rStart, WW8_CP& rLen) ...@@ -6683,7 +6688,13 @@ bool WW8PLCF_HdFt::GetTextPosExact(short nIdx, WW8_CP& rStart, WW8_CP& rLen)
aPLCF.SetIdx( nIdx ); // Lookup suitable CP aPLCF.SetIdx( nIdx ); // Lookup suitable CP
aPLCF.Get( rStart, nEnd, pData ); aPLCF.Get( rStart, nEnd, pData );
rLen = static_cast<sal_uInt32>(nEnd) - static_cast<sal_uInt32>(rStart); if (nEnd < rStart)
{
SAL_WARN("sw.ww8", "End " << nEnd << " before Start " << rStart);
return false;
}
rLen = nEnd - rStart;
return true; return true;
} }
......
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