clip PolyPolygon::Insert on .svm load
valgrind + bff Change-Id: Ib3ed8a6e518c0686f8cbeaf021b9ca3a07005032
This commit is contained in:
@@ -154,7 +154,7 @@ void PolyPolygon::Insert( const Polygon& rPoly, sal_uInt16 nPos )
|
|||||||
|
|
||||||
void PolyPolygon::Remove( 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 )
|
if ( mpImplPolyPolygon->mnRefCount > 1 )
|
||||||
{
|
{
|
||||||
@@ -171,7 +171,7 @@ void PolyPolygon::Remove( sal_uInt16 nPos )
|
|||||||
|
|
||||||
void PolyPolygon::Replace( const Polygon& rPoly, 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 )
|
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
|
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]);
|
return *(mpImplPolyPolygon->mpPolyAry[nPos]);
|
||||||
}
|
}
|
||||||
@@ -508,7 +508,7 @@ Rectangle PolyPolygon::GetBoundRect() const
|
|||||||
|
|
||||||
Polygon& PolyPolygon::operator[]( sal_uInt16 nPos )
|
Polygon& PolyPolygon::operator[]( sal_uInt16 nPos )
|
||||||
{
|
{
|
||||||
DBG_ASSERT( nPos < Count(), "PolyPolygon::[](): nPos >= nSize" );
|
assert(nPos < Count() && "PolyPolygon::[](): nPos >= nSize");
|
||||||
|
|
||||||
if ( mpImplPolyPolygon->mnRefCount > 1 )
|
if ( mpImplPolyPolygon->mnRefCount > 1 )
|
||||||
{
|
{
|
||||||
|
@@ -1077,6 +1077,12 @@ void MetaPolyPolygonAction::Read( SvStream& rIStm, ImplMetaReadData* )
|
|||||||
rIStm.ReadUInt16( nIndex );
|
rIStm.ReadUInt16( nIndex );
|
||||||
Polygon aPoly;
|
Polygon aPoly;
|
||||||
aPoly.Read( rIStm );
|
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 );
|
maPolyPoly.Replace( aPoly, nIndex );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user