summaryrefslogtreecommitdiff
path: root/svgio
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-08-21 13:17:01 +0100
committerCaolán McNamara <caolanm@redhat.com>2013-08-21 13:20:46 +0100
commit172c37522bca256b1d0bd9f966d06f49845ba102 (patch)
tree614e8e049f2c1f69bc972b23adf2ad812294b0ec /svgio
parent19277d02fb996058e896725bae7500f356f08af0 (diff)
Revert "returning pointers to temporaries"
Diffstat (limited to 'svgio')
-rw-r--r--svgio/inc/svgio/svgreader/svgsvgnode.hxx2
-rw-r--r--svgio/source/svgreader/svgsvgnode.cxx13
2 files changed, 5 insertions, 10 deletions
diff --git a/svgio/inc/svgio/svgreader/svgsvgnode.hxx b/svgio/inc/svgio/svgreader/svgsvgnode.hxx
index 157637a9f399..7226d7fcfc27 100644
--- a/svgio/inc/svgio/svgreader/svgsvgnode.hxx
+++ b/svgio/inc/svgio/svgreader/svgsvgnode.hxx
@@ -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;
diff --git a/svgio/source/svgreader/svgsvgnode.cxx b/svgio/source/svgreader/svgsvgnode.cxx
index 1c8e2f746982..8524a016c3e5 100644
--- a/svgio/source/svgreader/svgsvgnode.cxx
+++ b/svgio/source/svgreader/svgsvgnode.cxx
@@ -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