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

clip PolyPolygon::Insert on .svm load

valgrind + bff

Change-Id: Ib3ed8a6e518c0686f8cbeaf021b9ca3a07005032
üst aba01069
......@@ -154,7 +154,7 @@ void PolyPolygon::Insert( const Polygon& rPoly, sal_uInt16 nPos )
void PolyPolygon::Remove( sal_uInt16 nPos )
{
DBG_ASSERT( nPos < Count(), "PolyPolygon::Remove(): nPos >= nSize" );
assert(nPos < Count() && "PolyPolygon::Remove(): nPos >= nSize");
if ( mpImplPolyPolygon->mnRefCount > 1 )
{
......@@ -171,7 +171,7 @@ void PolyPolygon::Remove( sal_uInt16 nPos )
void PolyPolygon::Replace( const Polygon& rPoly, sal_uInt16 nPos )
{
DBG_ASSERT( nPos < Count(), "PolyPolygon::Replace(): nPos >= nSize" );
assert(nPos < Count() && "PolyPolygon::Replace(): nPos >= nSize");
if ( mpImplPolyPolygon->mnRefCount > 1 )
{
......@@ -185,7 +185,7 @@ void PolyPolygon::Replace( const Polygon& rPoly, sal_uInt16 nPos )
const Polygon& PolyPolygon::GetObject( sal_uInt16 nPos ) const
{
DBG_ASSERT( nPos < Count(), "PolyPolygon::GetObject(): nPos >= nSize" );
assert(nPos < Count() && "PolyPolygon::GetObject(): nPos >= nSize");
return *(mpImplPolyPolygon->mpPolyAry[nPos]);
}
......@@ -508,7 +508,7 @@ Rectangle PolyPolygon::GetBoundRect() const
Polygon& PolyPolygon::operator[]( sal_uInt16 nPos )
{
DBG_ASSERT( nPos < Count(), "PolyPolygon::[](): nPos >= nSize" );
assert(nPos < Count() && "PolyPolygon::[](): nPos >= nSize");
if ( mpImplPolyPolygon->mnRefCount > 1 )
{
......
......@@ -1077,6 +1077,12 @@ void MetaPolyPolygonAction::Read( SvStream& rIStm, ImplMetaReadData* )
rIStm.ReadUInt16( nIndex );
Polygon aPoly;
aPoly.Read( rIStm );
if (nIndex >= maPolyPoly.Count())
{
SAL_WARN("vcl.gdi", "svm contains polygon index " << nIndex
<< " outside possible range " << maPolyPoly.Count());
continue;
}
maPolyPoly.Replace( aPoly, nIndex );
}
}
......
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