summaryrefslogtreecommitdiff
path: root/svgio/inc/svgio/svgreader
diff options
context:
space:
mode:
authorArmin Le Grand <alg@apache.org>2013-08-13 16:58:52 +0000
committerArmin Le Grand <alg@apache.org>2013-08-13 16:58:52 +0000
commit8a9164f5f853db66b4453fc6fb798acf0a88a238 (patch)
treee463c1ece225dfc89c39ec13e4c1e8203c307b14 /svgio/inc/svgio/svgreader
parent4ccb1eb7d58005ab3b501b7c6ff128fadbcd5066 (diff)
i122600 Added patch from Regina that fixes a bunch of tasks (list see in task itself) and a reression/crash
Patch by: regina Review by: ALG
Notes
Diffstat (limited to 'svgio/inc/svgio/svgreader')
-rw-r--r--svgio/inc/svgio/svgreader/svgsvgnode.hxx10
-rw-r--r--svgio/inc/svgio/svgreader/svgtools.hxx8
2 files changed, 17 insertions, 1 deletions
diff --git a/svgio/inc/svgio/svgreader/svgsvgnode.hxx b/svgio/inc/svgio/svgreader/svgsvgnode.hxx
index a72fcf7ad243..134dabedd6a2 100644
--- a/svgio/inc/svgio/svgreader/svgsvgnode.hxx
+++ b/svgio/inc/svgio/svgreader/svgsvgnode.hxx
@@ -56,7 +56,15 @@ namespace svgio
virtual void parseAttribute(const rtl::OUString& rTokenName, SVGToken aSVGToken, const rtl::OUString& aContent);
virtual void decomposeSvgNode(drawinglayer::primitive2d::Primitive2DSequence& rTarget, bool bReferenced) const;
- /// InfoProvider support for % values
+ /// Seeks width and height of viewport, which is current before the new viewport is set.
+ // needed for percentage unit in x, y, width or height
+ virtual void seekReferenceWidth(double& fWidth, bool& bHasFound) const;
+ virtual void seekReferenceHeight(double& fHeight, bool& bHasFound) const;
+
+ /// InfoProvider support for % values in childs
+ // The returned 'CurrentViewPort' is the viewport as it is set by this svg element
+ // and as it is needed to resolve relative values in childs
+ // The method does not check for invalid width and height
virtual const basegfx::B2DRange* getCurrentViewPort() const;
/// viewBox content
diff --git a/svgio/inc/svgio/svgreader/svgtools.hxx b/svgio/inc/svgio/svgreader/svgtools.hxx
index 3933d3b41335..3efc337e0234 100644
--- a/svgio/inc/svgio/svgreader/svgtools.hxx
+++ b/svgio/inc/svgio/svgreader/svgtools.hxx
@@ -40,6 +40,9 @@ namespace svgio
void myAssert(const rtl::OUString& rMessage);
#endif
+// recommended value for this devise dependend unit, see CSS2 section 4.3.2 Lenghts
+#define F_SVG_PIXEL_PER_INCH 90.0
+
// common non-token strings
struct commonStrings
{
@@ -126,7 +129,12 @@ namespace svgio
bool isPositive() const;
+ // Only usable in cases, when the unit is not Unit_percent, otherwise use method solve
+ double solveNonPercentage(const InfoProvider& rInfoProvider) const;
+
double solve(const InfoProvider& rInfoProvider, NumberType aNumberType = length) const;
+
+
};
typedef ::std::vector< SvgNumber > SvgNumberVector;