Kaydet (Commit) a6b23e53 authored tarafından Armin Le Grand's avatar Armin Le Grand

#121237# Corrected Region export, was missing to write an end marker when RegionBand was empty

üst d3356ace
...@@ -1389,8 +1389,7 @@ bool Region::IsInside( const Point& rPoint ) const ...@@ -1389,8 +1389,7 @@ bool Region::IsInside( const Point& rPoint ) const
//} //}
// ensure RegionBand existance // ensure RegionBand existance
const_cast< Region* >(this)->GetAsRegionBand(); const RegionBand* pRegionBand = GetAsRegionBand();
const RegionBand* pRegionBand = getRegionBand();
if(pRegionBand) if(pRegionBand)
{ {
...@@ -1673,6 +1672,14 @@ SvStream& operator<<( SvStream& rOStrm, const Region& rRegion ) ...@@ -1673,6 +1672,14 @@ SvStream& operator<<( SvStream& rOStrm, const Region& rRegion )
{ {
pRegionBand->save(rOStrm); pRegionBand->save(rOStrm);
} }
else
{
// for compatibility, write an empty RegionBand (will only write
// the end marker STREAMENTRY_END, but this *is* needed)
const RegionBand aRegionBand;
aRegionBand.save(rOStrm);
}
// write polypolygon if available // write polypolygon if available
const sal_Bool bHasPolyPolygon(rRegion.HasPolyPolygonOrB2DPolyPolygon()); const sal_Bool bHasPolyPolygon(rRegion.HasPolyPolygonOrB2DPolyPolygon());
...@@ -1696,8 +1703,7 @@ void Region::GetRegionRectangles(RectangleVector& rTarget) const ...@@ -1696,8 +1703,7 @@ void Region::GetRegionRectangles(RectangleVector& rTarget) const
rTarget.clear(); rTarget.clear();
// ensure RegionBand existance // ensure RegionBand existance
const_cast< Region* >(this)->GetAsRegionBand(); const RegionBand* pRegionBand = GetAsRegionBand();
const RegionBand* pRegionBand = getRegionBand();
if(pRegionBand) if(pRegionBand)
{ {
......
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