#i105939# Decided returning by const ref was a bad idea, coupling-
and in terms of unwanted side effects (think vector re-allocating the mem). Fixed iterator-to-ptr conversion for obvious oversights.
This commit is contained in:
@@ -83,7 +83,7 @@ namespace basegfx
|
|||||||
sal_uInt32 count() const;
|
sal_uInt32 count() const;
|
||||||
|
|
||||||
/// Coordinate interface
|
/// Coordinate interface
|
||||||
const basegfx::B2DPoint& getB2DPoint(sal_uInt32 nIndex) const;
|
basegfx::B2DPoint getB2DPoint(sal_uInt32 nIndex) const;
|
||||||
void setB2DPoint(sal_uInt32 nIndex, const basegfx::B2DPoint& rValue);
|
void setB2DPoint(sal_uInt32 nIndex, const basegfx::B2DPoint& rValue);
|
||||||
|
|
||||||
/// Coordinate insert/append
|
/// Coordinate insert/append
|
||||||
@@ -201,7 +201,7 @@ namespace basegfx
|
|||||||
@return
|
@return
|
||||||
The outer range of the bezier curve/polygon
|
The outer range of the bezier curve/polygon
|
||||||
*/
|
*/
|
||||||
const B2DRange& getB2DRange() const;
|
B2DRange getB2DRange() const;
|
||||||
|
|
||||||
/** insert other 2D polygons
|
/** insert other 2D polygons
|
||||||
|
|
||||||
@@ -262,7 +262,7 @@ namespace basegfx
|
|||||||
/// apply transformation given in matrix form
|
/// apply transformation given in matrix form
|
||||||
void transform(const basegfx::B2DHomMatrix& rMatrix);
|
void transform(const basegfx::B2DHomMatrix& rMatrix);
|
||||||
|
|
||||||
// point iterators
|
// point iterators (same iterator validity conditions as for vector)
|
||||||
const B2DPoint* begin() const;
|
const B2DPoint* begin() const;
|
||||||
const B2DPoint* end() const;
|
const B2DPoint* end() const;
|
||||||
B2DPoint* begin();
|
B2DPoint* begin();
|
||||||
|
@@ -129,7 +129,7 @@ namespace basegfx
|
|||||||
// apply transformation given in matrix form to the polygon
|
// apply transformation given in matrix form to the polygon
|
||||||
void transform(const basegfx::B2DHomMatrix& rMatrix);
|
void transform(const basegfx::B2DHomMatrix& rMatrix);
|
||||||
|
|
||||||
// polygon iterators
|
// polygon iterators (same iterator validity conditions as for vector)
|
||||||
const B2DPolygon* begin() const;
|
const B2DPolygon* begin() const;
|
||||||
const B2DPolygon* end() const;
|
const B2DPolygon* end() const;
|
||||||
B2DPolygon* begin();
|
B2DPolygon* begin();
|
||||||
|
@@ -131,7 +131,7 @@ namespace basegfx
|
|||||||
*/
|
*/
|
||||||
B2DPolyPolygon solveCrossovers() const;
|
B2DPolyPolygon solveCrossovers() const;
|
||||||
|
|
||||||
// element iterators
|
// element iterators (same iterator validity conditions as for vector)
|
||||||
const B2DRange* begin() const;
|
const B2DRange* begin() const;
|
||||||
const B2DRange* end() const;
|
const B2DRange* end() const;
|
||||||
B2DRange* begin();
|
B2DRange* begin();
|
||||||
|
@@ -210,22 +210,34 @@ public:
|
|||||||
|
|
||||||
const basegfx::B2DPoint* begin() const
|
const basegfx::B2DPoint* begin() const
|
||||||
{
|
{
|
||||||
|
if(maVector.empty())
|
||||||
|
return 0;
|
||||||
|
else
|
||||||
return &maVector.front();
|
return &maVector.front();
|
||||||
}
|
}
|
||||||
|
|
||||||
const basegfx::B2DPoint* end() const
|
const basegfx::B2DPoint* end() const
|
||||||
{
|
{
|
||||||
return &maVector[maVector.size()];
|
if(maVector.empty())
|
||||||
|
return 0;
|
||||||
|
else
|
||||||
|
return (&maVector.back())+1;
|
||||||
}
|
}
|
||||||
|
|
||||||
basegfx::B2DPoint* begin()
|
basegfx::B2DPoint* begin()
|
||||||
{
|
{
|
||||||
|
if(maVector.empty())
|
||||||
|
return 0;
|
||||||
|
else
|
||||||
return &maVector.front();
|
return &maVector.front();
|
||||||
}
|
}
|
||||||
|
|
||||||
basegfx::B2DPoint* end()
|
basegfx::B2DPoint* end()
|
||||||
{
|
{
|
||||||
return &maVector[maVector.size()];
|
if(maVector.empty())
|
||||||
|
return 0;
|
||||||
|
else
|
||||||
|
return (&maVector.back())+1;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -1201,7 +1213,7 @@ namespace basegfx
|
|||||||
return mpPolygon->count();
|
return mpPolygon->count();
|
||||||
}
|
}
|
||||||
|
|
||||||
const B2DPoint& B2DPolygon::getB2DPoint(sal_uInt32 nIndex) const
|
B2DPoint B2DPolygon::getB2DPoint(sal_uInt32 nIndex) const
|
||||||
{
|
{
|
||||||
OSL_ENSURE(nIndex < mpPolygon->count(), "B2DPolygon access outside range (!)");
|
OSL_ENSURE(nIndex < mpPolygon->count(), "B2DPolygon access outside range (!)");
|
||||||
|
|
||||||
@@ -1460,7 +1472,7 @@ namespace basegfx
|
|||||||
return mpPolygon->getDefaultAdaptiveSubdivision(*this);
|
return mpPolygon->getDefaultAdaptiveSubdivision(*this);
|
||||||
}
|
}
|
||||||
|
|
||||||
const B2DRange& B2DPolygon::getB2DRange() const
|
B2DRange B2DPolygon::getB2DRange() const
|
||||||
{
|
{
|
||||||
return mpPolygon->getB2DRange(*this);
|
return mpPolygon->getB2DRange(*this);
|
||||||
}
|
}
|
||||||
|
@@ -169,22 +169,34 @@ public:
|
|||||||
|
|
||||||
const basegfx::B2DPolygon* begin() const
|
const basegfx::B2DPolygon* begin() const
|
||||||
{
|
{
|
||||||
|
if(maPolygons.empty())
|
||||||
|
return 0;
|
||||||
|
else
|
||||||
return &maPolygons.front();
|
return &maPolygons.front();
|
||||||
}
|
}
|
||||||
|
|
||||||
const basegfx::B2DPolygon* end() const
|
const basegfx::B2DPolygon* end() const
|
||||||
{
|
{
|
||||||
return &maPolygons[maPolygons.size()];
|
if(maPolygons.empty())
|
||||||
|
return 0;
|
||||||
|
else
|
||||||
|
return (&maPolygons.back())+1;
|
||||||
}
|
}
|
||||||
|
|
||||||
basegfx::B2DPolygon* begin()
|
basegfx::B2DPolygon* begin()
|
||||||
{
|
{
|
||||||
|
if(maPolygons.empty())
|
||||||
|
return 0;
|
||||||
|
else
|
||||||
return &maPolygons.front();
|
return &maPolygons.front();
|
||||||
}
|
}
|
||||||
|
|
||||||
basegfx::B2DPolygon* end()
|
basegfx::B2DPolygon* end()
|
||||||
{
|
{
|
||||||
return &maPolygons[maPolygons.size()];
|
if(maPolygons.empty())
|
||||||
|
return 0;
|
||||||
|
else
|
||||||
|
return &(maPolygons.back())+1;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -229,22 +229,34 @@ namespace basegfx
|
|||||||
|
|
||||||
const B2DRange* begin() const
|
const B2DRange* begin() const
|
||||||
{
|
{
|
||||||
|
if(maRanges.empty())
|
||||||
|
return 0;
|
||||||
|
else
|
||||||
return &maRanges.front();
|
return &maRanges.front();
|
||||||
}
|
}
|
||||||
|
|
||||||
const B2DRange* end() const
|
const B2DRange* end() const
|
||||||
{
|
{
|
||||||
return &maRanges[maRanges.size()];
|
if(maRanges.empty())
|
||||||
|
return 0;
|
||||||
|
else
|
||||||
|
return (&maRanges.back())+1;
|
||||||
}
|
}
|
||||||
|
|
||||||
B2DRange* begin()
|
B2DRange* begin()
|
||||||
{
|
{
|
||||||
|
if(maRanges.empty())
|
||||||
|
return 0;
|
||||||
|
else
|
||||||
return &maRanges.front();
|
return &maRanges.front();
|
||||||
}
|
}
|
||||||
|
|
||||||
B2DRange* end()
|
B2DRange* end()
|
||||||
{
|
{
|
||||||
return &maRanges[maRanges.size()];
|
if(maRanges.empty())
|
||||||
|
return 0;
|
||||||
|
else
|
||||||
|
return (&maRanges.back())+1;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
Reference in New Issue
Block a user