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

Revert "returning pointers to temporaries"

This reverts commit 342438c6.
üst 19277d02
......@@ -21,7 +21,6 @@
#define INCLUDED_SVGIO_SVGREADER_SVGSVGNODE_HXX
#include <svgio/svgreader/svgstyleattributes.hxx>
#include <boost/scoped_ptr.hpp>
//////////////////////////////////////////////////////////////////////////////
......@@ -37,7 +36,6 @@ namespace svgio
/// variable scan values, dependent of given XAttributeList
basegfx::B2DRange* mpViewBox;
mutable boost::scoped_ptr<basegfx::B2DRange> xGeneratedBox;
SvgAspectRatio maSvgAspectRatio;
SvgNumber maX;
SvgNumber maY;
......
......@@ -611,7 +611,7 @@ namespace svgio
// Extract known viewport data
// bXXXIsAbsolute tracks whether relative values could be resolved to absolute values
if (getParent())
{
{
// If width or height is not provided, the default 100% is used, see SVG 1.1 section 5.1.2
// value 0.0 here is only to initialize variable
bool bWidthIsAbsolute(getWidth().isSet() && Unit_percent != getWidth().getUnit());
......@@ -628,8 +628,7 @@ namespace svgio
if (bXIsAbsolute && bYIsAbsolute && bWidthIsAbsolute && bHeightIsAbsolute)
{
xGeneratedBox.reset(new basegfx::B2DRange(fX, fY, fX+fW, fY+fH));
return xGeneratedBox.get();
return &basegfx::B2DRange(fX, fY, fX+fW, fY+fH);
}
else // try to resolve relative values
{
......@@ -672,8 +671,7 @@ namespace svgio
if (bXIsAbsolute && bYIsAbsolute && bWidthIsAbsolute && bHeightIsAbsolute)
{
xGeneratedBox.reset(new basegfx::B2DRange(fX, fY, fX+fW, fY+fH));
return xGeneratedBox.get();
return &basegfx::B2DRange(fX, fY, fX+fW, fY+fH);
}
else // relative values could not be resolved, there exists no fallback
{
......@@ -692,12 +690,11 @@ namespace svgio
double fH( bHeightIsAbsolute ? getHeight().solveNonPercentage(*this) : 0.0);
if (bWidthIsAbsolute && bHeightIsAbsolute)
{
xGeneratedBox.reset(new basegfx::B2DRange(0.0, 0.0, fW, fH));
return xGeneratedBox.get();
return &basegfx::B2DRange(0.0, 0.0, fW, fH);
}
else // no fallback exists
{
return SvgNode::getCurrentViewPort();
return SvgNode::getCurrentViewPort();
}
}
// ToDo: Is it possible to decompose and use the bounding box of the childs, if even the
......
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