You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by al...@apache.org on 2011/12/15 19:03:29 UTC
svn commit: r1214899 [1/2] - in
/incubator/ooo/branches/alg/svgreplacement/main/svgio: inc/svgio/svgreader/
source/svgreader/ source/svguno/
Author: alg
Date: Thu Dec 15 18:03:28 2011
New Revision: 1214899
URL: http://svn.apache.org/viewvc?rev=1214899&view=rev
Log:
svg: unified primitive usage to sequence of primitives to make memory handling more safe; relayouted applying object transformations to fix some problems; added support for clipping of inplace Svg elements; added support for clipping outmost Svg element; added support for transformation of image element
Modified:
incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svgcharacternode.hxx
incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svgcirclenode.hxx
incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svgclippathnode.hxx
incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svgellipsenode.hxx
incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svggnode.hxx
incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svgimagenode.hxx
incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svglinenode.hxx
incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svgmasknode.hxx
incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svgnode.hxx
incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svgpathnode.hxx
incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svgpolynode.hxx
incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svgrectnode.hxx
incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svgstyleattributes.hxx
incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svgsvgnode.hxx
incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svgtextnode.hxx
incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svgtextpathnode.hxx
incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svgusenode.hxx
incubator/ooo/branches/alg/svgreplacement/main/svgio/source/svgreader/svgcharacternode.cxx
incubator/ooo/branches/alg/svgreplacement/main/svgio/source/svgreader/svgcirclenode.cxx
incubator/ooo/branches/alg/svgreplacement/main/svgio/source/svgreader/svgclippathnode.cxx
incubator/ooo/branches/alg/svgreplacement/main/svgio/source/svgreader/svgellipsenode.cxx
incubator/ooo/branches/alg/svgreplacement/main/svgio/source/svgreader/svggnode.cxx
incubator/ooo/branches/alg/svgreplacement/main/svgio/source/svgreader/svgimagenode.cxx
incubator/ooo/branches/alg/svgreplacement/main/svgio/source/svgreader/svglinenode.cxx
incubator/ooo/branches/alg/svgreplacement/main/svgio/source/svgreader/svgmarkernode.cxx
incubator/ooo/branches/alg/svgreplacement/main/svgio/source/svgreader/svgmasknode.cxx
incubator/ooo/branches/alg/svgreplacement/main/svgio/source/svgreader/svgnode.cxx
incubator/ooo/branches/alg/svgreplacement/main/svgio/source/svgreader/svgpathnode.cxx
incubator/ooo/branches/alg/svgreplacement/main/svgio/source/svgreader/svgpatternnode.cxx
incubator/ooo/branches/alg/svgreplacement/main/svgio/source/svgreader/svgpolynode.cxx
incubator/ooo/branches/alg/svgreplacement/main/svgio/source/svgreader/svgrectnode.cxx
incubator/ooo/branches/alg/svgreplacement/main/svgio/source/svgreader/svgstyleattributes.cxx
incubator/ooo/branches/alg/svgreplacement/main/svgio/source/svgreader/svgsvgnode.cxx
incubator/ooo/branches/alg/svgreplacement/main/svgio/source/svgreader/svgtextnode.cxx
incubator/ooo/branches/alg/svgreplacement/main/svgio/source/svgreader/svgtextpathnode.cxx
incubator/ooo/branches/alg/svgreplacement/main/svgio/source/svgreader/svgusenode.cxx
incubator/ooo/branches/alg/svgreplacement/main/svgio/source/svguno/xsvgparser.cxx
Modified: incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svgcharacternode.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svgcharacternode.hxx?rev=1214899&r1=1214898&r2=1214899&view=diff
==============================================================================
--- incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svgcharacternode.hxx (original)
+++ incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svgcharacternode.hxx Thu Dec 15 18:03:28 2011
@@ -154,7 +154,7 @@ namespace svgio
SvgTextPosition& rSvgTextPosition,
const SvgStyleAttributes& rSvgStyleAttributes) const;
void decomposeTextWithStyle(
- drawinglayer::primitive2d::Primitive2DVector& rTarget,
+ drawinglayer::primitive2d::Primitive2DSequence& rTarget,
SvgTextPosition& rSvgTextPosition,
const SvgStyleAttributes& rSvgStyleAttributes) const;
@@ -166,7 +166,7 @@ namespace svgio
virtual ~SvgCharacterNode();
virtual const SvgStyleAttributes* getSvgStyleAttributes() const;
- virtual void decomposeText(drawinglayer::primitive2d::Primitive2DVector& rTarget, SvgTextPosition& rSvgTextPosition) const;
+ virtual void decomposeText(drawinglayer::primitive2d::Primitive2DSequence& rTarget, SvgTextPosition& rSvgTextPosition) const;
void whiteSpaceHandling();
void addGap();
void concatenate(const rtl::OUString& rText);
Modified: incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svgcirclenode.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svgcirclenode.hxx?rev=1214899&r1=1214898&r2=1214899&view=diff
==============================================================================
--- incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svgcirclenode.hxx (original)
+++ incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svgcirclenode.hxx Thu Dec 15 18:03:28 2011
@@ -52,7 +52,7 @@ namespace svgio
virtual const SvgStyleAttributes* getSvgStyleAttributes() const;
virtual void parseAttribute(const rtl::OUString& rTokenName, SVGToken aSVGToken, const rtl::OUString& aContent);
- virtual void decomposeSvgNode(drawinglayer::primitive2d::Primitive2DVector& rTarget, bool bReferenced) const;
+ virtual void decomposeSvgNode(drawinglayer::primitive2d::Primitive2DSequence& rTarget, bool bReferenced) const;
/// Cx content, set if found in current context
const SvgNumber& getCx() const { return maCx; }
Modified: incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svgclippathnode.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svgclippathnode.hxx?rev=1214899&r1=1214898&r2=1214899&view=diff
==============================================================================
--- incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svgclippathnode.hxx (original)
+++ incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svgclippathnode.hxx Thu Dec 15 18:03:28 2011
@@ -50,10 +50,10 @@ namespace svgio
virtual const SvgStyleAttributes* getSvgStyleAttributes() const;
virtual void parseAttribute(const rtl::OUString& rTokenName, SVGToken aSVGToken, const rtl::OUString& aContent);
- virtual void decomposeSvgNode(drawinglayer::primitive2d::Primitive2DVector& rTarget, bool bReferenced) const;
+ virtual void decomposeSvgNode(drawinglayer::primitive2d::Primitive2DSequence& rTarget, bool bReferenced) const;
/// apply contained clipPath to given geometry
- void apply(drawinglayer::primitive2d::Primitive2DVector& rTarget) const;
+ void apply(drawinglayer::primitive2d::Primitive2DSequence& rTarget) const;
/// clipPathUnits content
SvgUnits getClipPathUnits() const { return maClipPathUnits; }
Modified: incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svgellipsenode.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svgellipsenode.hxx?rev=1214899&r1=1214898&r2=1214899&view=diff
==============================================================================
--- incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svgellipsenode.hxx (original)
+++ incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svgellipsenode.hxx Thu Dec 15 18:03:28 2011
@@ -53,7 +53,7 @@ namespace svgio
virtual const SvgStyleAttributes* getSvgStyleAttributes() const;
virtual void parseAttribute(const rtl::OUString& rTokenName, SVGToken aSVGToken, const rtl::OUString& aContent);
- virtual void decomposeSvgNode(drawinglayer::primitive2d::Primitive2DVector& rTarget, bool bReferenced) const;
+ virtual void decomposeSvgNode(drawinglayer::primitive2d::Primitive2DSequence& rTarget, bool bReferenced) const;
/// Cx content, set if found in current context
const SvgNumber& getCx() const { return maCx; }
Modified: incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svggnode.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svggnode.hxx?rev=1214899&r1=1214898&r2=1214899&view=diff
==============================================================================
--- incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svggnode.hxx (original)
+++ incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svggnode.hxx Thu Dec 15 18:03:28 2011
@@ -50,7 +50,7 @@ namespace svgio
virtual const SvgStyleAttributes* getSvgStyleAttributes() const;
virtual void parseAttribute(const rtl::OUString& rTokenName, SVGToken aSVGToken, const rtl::OUString& aContent);
- virtual void decomposeSvgNode(drawinglayer::primitive2d::Primitive2DVector& rTarget, bool bReferenced) const;
+ virtual void decomposeSvgNode(drawinglayer::primitive2d::Primitive2DSequence& rTarget, bool bReferenced) const;
/// transform content
const basegfx::B2DHomMatrix* getTransform() const { return mpaTransform; }
Modified: incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svgimagenode.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svgimagenode.hxx?rev=1214899&r1=1214898&r2=1214899&view=diff
==============================================================================
--- incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svgimagenode.hxx (original)
+++ incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svgimagenode.hxx Thu Dec 15 18:03:28 2011
@@ -60,7 +60,7 @@ namespace svgio
virtual const SvgStyleAttributes* getSvgStyleAttributes() const;
virtual void parseAttribute(const rtl::OUString& rTokenName, SVGToken aSVGToken, const rtl::OUString& aContent);
- virtual void decomposeSvgNode(drawinglayer::primitive2d::Primitive2DVector& rTarget, bool bReferenced) const;
+ virtual void decomposeSvgNode(drawinglayer::primitive2d::Primitive2DSequence& rTarget, bool bReferenced) const;
/// SvgAspectRatio content
const SvgAspectRatio& getSvgAspectRatio() const { return maSvgAspectRatio; }
Modified: incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svglinenode.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svglinenode.hxx?rev=1214899&r1=1214898&r2=1214899&view=diff
==============================================================================
--- incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svglinenode.hxx (original)
+++ incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svglinenode.hxx Thu Dec 15 18:03:28 2011
@@ -53,7 +53,7 @@ namespace svgio
virtual const SvgStyleAttributes* getSvgStyleAttributes() const;
virtual void parseAttribute(const rtl::OUString& rTokenName, SVGToken aSVGToken, const rtl::OUString& aContent);
- virtual void decomposeSvgNode(drawinglayer::primitive2d::Primitive2DVector& rTarget, bool bReferenced) const;
+ virtual void decomposeSvgNode(drawinglayer::primitive2d::Primitive2DSequence& rTarget, bool bReferenced) const;
/// X1 content, set if found in current context
const SvgNumber& getX1() const { return maX1; }
Modified: incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svgmasknode.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svgmasknode.hxx?rev=1214899&r1=1214898&r2=1214899&view=diff
==============================================================================
--- incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svgmasknode.hxx (original)
+++ incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svgmasknode.hxx Thu Dec 15 18:03:28 2011
@@ -55,10 +55,10 @@ namespace svgio
virtual const SvgStyleAttributes* getSvgStyleAttributes() const;
virtual void parseAttribute(const rtl::OUString& rTokenName, SVGToken aSVGToken, const rtl::OUString& aContent);
- virtual void decomposeSvgNode(drawinglayer::primitive2d::Primitive2DVector& rTarget, bool bReferenced) const;
+ virtual void decomposeSvgNode(drawinglayer::primitive2d::Primitive2DSequence& rTarget, bool bReferenced) const;
/// apply contained clipPath to given geometry
- void apply(drawinglayer::primitive2d::Primitive2DVector& rTarget) const;
+ void apply(drawinglayer::primitive2d::Primitive2DSequence& rTarget) const;
/// x content, set if found in current context
const SvgNumber& getX() const { return maX; }
Modified: incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svgnode.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svgnode.hxx?rev=1214899&r1=1214898&r2=1214899&view=diff
==============================================================================
--- incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svgnode.hxx (original)
+++ incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svgnode.hxx Thu Dec 15 18:03:28 2011
@@ -89,7 +89,7 @@ namespace svgio
void parseAttributes(const com::sun::star::uno::Reference< com::sun::star::xml::sax::XAttributeList >& xAttribs);
virtual const SvgStyleAttributes* getSvgStyleAttributes() const;
virtual void parseAttribute(const rtl::OUString& rTokenName, SVGToken aSVGToken, const rtl::OUString& aContent);
- virtual void decomposeSvgNode(drawinglayer::primitive2d::Primitive2DVector& rTarget, bool bReferenced) const;
+ virtual void decomposeSvgNode(drawinglayer::primitive2d::Primitive2DSequence& rTarget, bool bReferenced) const;
/// basic data read access
const SVGToken getType() const { return maType; }
Modified: incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svgpathnode.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svgpathnode.hxx?rev=1214899&r1=1214898&r2=1214899&view=diff
==============================================================================
--- incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svgpathnode.hxx (original)
+++ incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svgpathnode.hxx Thu Dec 15 18:03:28 2011
@@ -51,7 +51,7 @@ namespace svgio
virtual const SvgStyleAttributes* getSvgStyleAttributes() const;
virtual void parseAttribute(const rtl::OUString& rTokenName, SVGToken aSVGToken, const rtl::OUString& aContent);
- virtual void decomposeSvgNode(drawinglayer::primitive2d::Primitive2DVector& rTarget, bool bReferenced) const;
+ virtual void decomposeSvgNode(drawinglayer::primitive2d::Primitive2DSequence& rTarget, bool bReferenced) const;
/// path content, set if found in current context
const basegfx::B2DPolyPolygon* getPath() const { return mpPolyPolygon; }
Modified: incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svgpolynode.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svgpolynode.hxx?rev=1214899&r1=1214898&r2=1214899&view=diff
==============================================================================
--- incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svgpolynode.hxx (original)
+++ incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svgpolynode.hxx Thu Dec 15 18:03:28 2011
@@ -55,7 +55,7 @@ namespace svgio
virtual const SvgStyleAttributes* getSvgStyleAttributes() const;
virtual void parseAttribute(const rtl::OUString& rTokenName, SVGToken aSVGToken, const rtl::OUString& aContent);
- virtual void decomposeSvgNode(drawinglayer::primitive2d::Primitive2DVector& rTarget, bool bReferenced) const;
+ virtual void decomposeSvgNode(drawinglayer::primitive2d::Primitive2DSequence& rTarget, bool bReferenced) const;
/// type read access
bool isPolyline() const { return mbIsPolyline; }
Modified: incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svgrectnode.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svgrectnode.hxx?rev=1214899&r1=1214898&r2=1214899&view=diff
==============================================================================
--- incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svgrectnode.hxx (original)
+++ incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svgrectnode.hxx Thu Dec 15 18:03:28 2011
@@ -55,7 +55,7 @@ namespace svgio
virtual const SvgStyleAttributes* getSvgStyleAttributes() const;
virtual void parseAttribute(const rtl::OUString& rTokenName, SVGToken aSVGToken, const rtl::OUString& aContent);
- virtual void decomposeSvgNode(drawinglayer::primitive2d::Primitive2DVector& rTarget, bool bReferenced) const;
+ virtual void decomposeSvgNode(drawinglayer::primitive2d::Primitive2DSequence& rTarget, bool bReferenced) const;
/// x content, set if found in current context
const SvgNumber& getX() const { return maX; }
Modified: incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svgstyleattributes.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svgstyleattributes.hxx?rev=1214899&r1=1214898&r2=1214899&view=diff
==============================================================================
--- incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svgstyleattributes.hxx (original)
+++ incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svgstyleattributes.hxx Thu Dec 15 18:03:28 2011
@@ -200,26 +200,26 @@ namespace svgio
/// internal helpers
void add_fillGradient(
const basegfx::B2DPolyPolygon& rPath,
- drawinglayer::primitive2d::Primitive2DVector& rTarget,
+ drawinglayer::primitive2d::Primitive2DSequence& rTarget,
const SvgGradientNode& rFillGradient,
const basegfx::B2DRange& rGeoRange) const;
void add_fillPatternTransform(
const basegfx::B2DPolyPolygon& rPath,
- drawinglayer::primitive2d::Primitive2DVector& rTarget,
+ drawinglayer::primitive2d::Primitive2DSequence& rTarget,
const SvgPatternNode& rFillGradient,
const basegfx::B2DRange& rGeoRange) const;
void add_fillPattern(
const basegfx::B2DPolyPolygon& rPath,
- drawinglayer::primitive2d::Primitive2DVector& rTarget,
+ drawinglayer::primitive2d::Primitive2DSequence& rTarget,
const SvgPatternNode& rFillGradient,
const basegfx::B2DRange& rGeoRange) const;
void add_fill(
const basegfx::B2DPolyPolygon& rPath,
- drawinglayer::primitive2d::Primitive2DVector& rTarget,
+ drawinglayer::primitive2d::Primitive2DSequence& rTarget,
const basegfx::B2DRange& rGeoRange) const;
void add_stroke(
const basegfx::B2DPolyPolygon& rPath,
- drawinglayer::primitive2d::Primitive2DVector& rTarget,
+ drawinglayer::primitive2d::Primitive2DSequence& rTarget,
const basegfx::B2DRange& rGeoRange) const;
bool prepare_singleMarker(
drawinglayer::primitive2d::Primitive2DSequence& rMarkerPrimitives,
@@ -227,7 +227,7 @@ namespace svgio
basegfx::B2DRange& rClipRange,
const SvgMarkerNode& rMarker) const;
void add_singleMarker(
- drawinglayer::primitive2d::Primitive2DVector& rTarget,
+ drawinglayer::primitive2d::Primitive2DSequence& rTarget,
const drawinglayer::primitive2d::Primitive2DSequence& rMarkerPrimitives,
const basegfx::B2DHomMatrix& rMarkerTransform,
const basegfx::B2DRange& rClipRange,
@@ -236,7 +236,7 @@ namespace svgio
const sal_uInt32 nIndex) const;
void add_markers(
const basegfx::B2DPolyPolygon& rPath,
- drawinglayer::primitive2d::Primitive2DVector& rTarget) const;
+ drawinglayer::primitive2d::Primitive2DSequence& rTarget) const;
public:
/// local attribute scanner
@@ -244,19 +244,19 @@ namespace svgio
/// helper which does the necessary with a given path
void add_text(
- drawinglayer::primitive2d::Primitive2DVector& rTarget,
- drawinglayer::primitive2d::Primitive2DVector& rSource) const;
+ drawinglayer::primitive2d::Primitive2DSequence& rTarget,
+ drawinglayer::primitive2d::Primitive2DSequence& rSource) const;
void add_path(
const basegfx::B2DPolyPolygon& rPath,
- drawinglayer::primitive2d::Primitive2DVector& rTarget,
+ drawinglayer::primitive2d::Primitive2DSequence& rTarget) const;
+ void add_postProcess(
+ drawinglayer::primitive2d::Primitive2DSequence& rTarget,
+ const drawinglayer::primitive2d::Primitive2DSequence& rSource,
const basegfx::B2DHomMatrix* pTransform) const;
/// helper to evtl. link to css style
void checkForCssStyle(const rtl::OUString& rClassStr) const;
- /// helper to postprocess created primitives
- void decomposePostProcess(drawinglayer::primitive2d::Primitive2DVector& rTarget) const;
-
/// scan helpers
void readStyle(const rtl::OUString& rCandidate);
const SvgStyleAttributes* getParentStyle() const;
Modified: incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svgsvgnode.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svgsvgnode.hxx?rev=1214899&r1=1214898&r2=1214899&view=diff
==============================================================================
--- incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svgsvgnode.hxx (original)
+++ incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svgsvgnode.hxx Thu Dec 15 18:03:28 2011
@@ -54,7 +54,7 @@ namespace svgio
virtual const SvgStyleAttributes* getSvgStyleAttributes() const;
virtual void parseAttribute(const rtl::OUString& rTokenName, SVGToken aSVGToken, const rtl::OUString& aContent);
- virtual void decomposeSvgNode(drawinglayer::primitive2d::Primitive2DVector& rTarget, bool bReferenced) const;
+ virtual void decomposeSvgNode(drawinglayer::primitive2d::Primitive2DSequence& rTarget, bool bReferenced) const;
/// InfoProvider support for % values
virtual const basegfx::B2DRange* getCurrentViewPort() const;
Modified: incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svgtextnode.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svgtextnode.hxx?rev=1214899&r1=1214898&r2=1214899&view=diff
==============================================================================
--- incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svgtextnode.hxx (original)
+++ incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svgtextnode.hxx Thu Dec 15 18:03:28 2011
@@ -44,8 +44,14 @@ namespace svgio
SvgTextPositions maSvgTextPositions;
/// local helpers
- void DecomposeChild(const SvgNode& rCandidate, drawinglayer::primitive2d::Primitive2DVector& rTarget, SvgTextPosition& rSvgTextPosition) const;
- void addTextPrimitives(const SvgNode& rCandidate, drawinglayer::primitive2d::Primitive2DVector& rTarget, drawinglayer::primitive2d::Primitive2DVector& rSource) const;
+ void DecomposeChild(
+ const SvgNode& rCandidate,
+ drawinglayer::primitive2d::Primitive2DSequence& rTarget,
+ SvgTextPosition& rSvgTextPosition) const;
+ void addTextPrimitives(
+ const SvgNode& rCandidate,
+ drawinglayer::primitive2d::Primitive2DSequence& rTarget,
+ drawinglayer::primitive2d::Primitive2DSequence& rSource) const;
public:
SvgTextNode(
@@ -55,7 +61,7 @@ namespace svgio
virtual const SvgStyleAttributes* getSvgStyleAttributes() const;
virtual void parseAttribute(const rtl::OUString& rTokenName, SVGToken aSVGToken, const rtl::OUString& aContent);
- virtual void decomposeSvgNode(drawinglayer::primitive2d::Primitive2DVector& rTarget, bool bReferenced) const;
+ virtual void decomposeSvgNode(drawinglayer::primitive2d::Primitive2DSequence& rTarget, bool bReferenced) const;
/// transform content, set if found in current context
const basegfx::B2DHomMatrix* getTransform() const { return mpaTransform; }
Modified: incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svgtextpathnode.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svgtextpathnode.hxx?rev=1214899&r1=1214898&r2=1214899&view=diff
==============================================================================
--- incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svgtextpathnode.hxx (original)
+++ incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svgtextpathnode.hxx Thu Dec 15 18:03:28 2011
@@ -60,7 +60,7 @@ namespace svgio
virtual void parseAttribute(const rtl::OUString& rTokenName, SVGToken aSVGToken, const rtl::OUString& aContent);
void decomposePathNode(
const drawinglayer::primitive2d::Primitive2DSequence& rPathContent,
- drawinglayer::primitive2d::Primitive2DVector& rTarget,
+ drawinglayer::primitive2d::Primitive2DSequence& rTarget,
const basegfx::B2DPoint& rTextStart) const;
bool isValid() const;
Modified: incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svgusenode.hxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svgusenode.hxx?rev=1214899&r1=1214898&r2=1214899&view=diff
==============================================================================
--- incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svgusenode.hxx (original)
+++ incubator/ooo/branches/alg/svgreplacement/main/svgio/inc/svgio/svgreader/svgusenode.hxx Thu Dec 15 18:03:28 2011
@@ -57,7 +57,7 @@ namespace svgio
virtual const SvgStyleAttributes* getSvgStyleAttributes() const;
virtual void parseAttribute(const rtl::OUString& rTokenName, SVGToken aSVGToken, const rtl::OUString& aContent);
- virtual void decomposeSvgNode(drawinglayer::primitive2d::Primitive2DVector& rTarget, bool bReferenced) const;
+ virtual void decomposeSvgNode(drawinglayer::primitive2d::Primitive2DSequence& rTarget, bool bReferenced) const;
/// transform content
const basegfx::B2DHomMatrix* getTransform() const { return mpaTransform; }
Modified: incubator/ooo/branches/alg/svgreplacement/main/svgio/source/svgreader/svgcharacternode.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/svgreplacement/main/svgio/source/svgreader/svgcharacternode.cxx?rev=1214899&r1=1214898&r2=1214899&view=diff
==============================================================================
--- incubator/ooo/branches/alg/svgreplacement/main/svgio/source/svgreader/svgcharacternode.cxx (original)
+++ incubator/ooo/branches/alg/svgreplacement/main/svgio/source/svgreader/svgcharacternode.cxx Thu Dec 15 18:03:28 2011
@@ -460,30 +460,31 @@ namespace svgio
}
void SvgCharacterNode::decomposeTextWithStyle(
- drawinglayer::primitive2d::Primitive2DVector& rTarget,
+ drawinglayer::primitive2d::Primitive2DSequence& rTarget,
SvgTextPosition& rSvgTextPosition,
const SvgStyleAttributes& rSvgStyleAttributes) const
{
- drawinglayer::primitive2d::TextSimplePortionPrimitive2D* pNew = createSimpleTextPrimitive(
- rSvgTextPosition, rSvgStyleAttributes);
+ const drawinglayer::primitive2d::Primitive2DReference xRef(
+ createSimpleTextPrimitive(
+ rSvgTextPosition,
+ rSvgStyleAttributes));
- if(pNew)
+ if(xRef.is())
{
if(!rSvgTextPosition.isRotated())
{
- rTarget.push_back(pNew);
+ drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(rTarget, xRef);
}
else
{
// need to apply rotations to each character as given
- const drawinglayer::primitive2d::Primitive2DReference xRef(pNew);
localTextBreakupHelper alocalTextBreakupHelper(xRef, rSvgTextPosition);
const drawinglayer::primitive2d::Primitive2DSequence aResult(
alocalTextBreakupHelper.getResult(drawinglayer::primitive2d::BreakupUnit_character));
if(aResult.hasElements())
{
- rTarget.push_back(new drawinglayer::primitive2d::GroupPrimitive2D(aResult));
+ drawinglayer::primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence(rTarget, aResult);
}
// also consume for the implied single space
@@ -514,7 +515,7 @@ namespace svgio
maText += rText;
}
- void SvgCharacterNode::decomposeText(drawinglayer::primitive2d::Primitive2DVector& rTarget, SvgTextPosition& rSvgTextPosition) const
+ void SvgCharacterNode::decomposeText(drawinglayer::primitive2d::Primitive2DSequence& rTarget, SvgTextPosition& rSvgTextPosition) const
{
if(getText().getLength())
{
Modified: incubator/ooo/branches/alg/svgreplacement/main/svgio/source/svgreader/svgcirclenode.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/svgreplacement/main/svgio/source/svgreader/svgcirclenode.cxx?rev=1214899&r1=1214898&r2=1214899&view=diff
==============================================================================
--- incubator/ooo/branches/alg/svgreplacement/main/svgio/source/svgreader/svgcirclenode.cxx (original)
+++ incubator/ooo/branches/alg/svgreplacement/main/svgio/source/svgreader/svgcirclenode.cxx Thu Dec 15 18:03:28 2011
@@ -119,7 +119,7 @@ namespace svgio
}
}
- void SvgCircleNode::decomposeSvgNode(drawinglayer::primitive2d::Primitive2DVector& rTarget, bool bReferenced) const
+ void SvgCircleNode::decomposeSvgNode(drawinglayer::primitive2d::Primitive2DSequence& rTarget, bool bReferenced) const
{
const SvgStyleAttributes* pStyle = getSvgStyleAttributes();
@@ -136,7 +136,14 @@ namespace svgio
getCy().isSet() ? getCy().solve(*this, ycoordinate) : 0.0),
fR));
- pStyle->add_path(basegfx::B2DPolyPolygon(aPath), rTarget, getTransform());
+ drawinglayer::primitive2d::Primitive2DSequence aNewTarget;
+
+ pStyle->add_path(basegfx::B2DPolyPolygon(aPath), aNewTarget);
+
+ if(aNewTarget.hasElements())
+ {
+ pStyle->add_postProcess(rTarget, aNewTarget, getTransform());
+ }
}
}
}
Modified: incubator/ooo/branches/alg/svgreplacement/main/svgio/source/svgreader/svgclippathnode.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/svgreplacement/main/svgio/source/svgreader/svgclippathnode.cxx?rev=1214899&r1=1214898&r2=1214899&view=diff
==============================================================================
--- incubator/ooo/branches/alg/svgreplacement/main/svgio/source/svgreader/svgclippathnode.cxx (original)
+++ incubator/ooo/branches/alg/svgreplacement/main/svgio/source/svgreader/svgclippathnode.cxx Thu Dec 15 18:03:28 2011
@@ -101,53 +101,50 @@ namespace svgio
}
}
- void SvgClipPathNode::decomposeSvgNode(drawinglayer::primitive2d::Primitive2DVector& rTarget, bool bReferenced) const
+ void SvgClipPathNode::decomposeSvgNode(drawinglayer::primitive2d::Primitive2DSequence& rTarget, bool bReferenced) const
{
- drawinglayer::primitive2d::Primitive2DVector aNewTarget;
+ drawinglayer::primitive2d::Primitive2DSequence aNewTarget;
// decompose childs
SvgNode::decomposeSvgNode(aNewTarget, bReferenced);
- if(!aNewTarget.empty())
+ if(aNewTarget.hasElements())
{
if(getTransform())
{
// create embedding group element with transformation
- rTarget.push_back(
+ const drawinglayer::primitive2d::Primitive2DReference xRef(
new drawinglayer::primitive2d::TransformPrimitive2D(
*getTransform(),
- drawinglayer::primitive2d::Primitive2DVectorToPrimitive2DSequence(aNewTarget)));
- aNewTarget.clear();
+ aNewTarget));
+
+ drawinglayer::primitive2d::appendPrimitive2DReferenceToPrimitive2DSequence(rTarget, xRef);
}
else
{
// append to current target
- rTarget.insert(rTarget.end(), aNewTarget.begin(), aNewTarget.end());
+ drawinglayer::primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence(rTarget, aNewTarget);
}
}
}
- void SvgClipPathNode::apply(drawinglayer::primitive2d::Primitive2DVector& rTarget) const
+ void SvgClipPathNode::apply(drawinglayer::primitive2d::Primitive2DSequence& rContent) const
{
- if(rTarget.size())
+ if(rContent.hasElements())
{
- drawinglayer::primitive2d::Primitive2DVector aClipTarget;
+ drawinglayer::primitive2d::Primitive2DSequence aClipTarget;
// get clipPath definition as primitives
decomposeSvgNode(aClipTarget, true);
- if(aClipTarget.size())
+ if(aClipTarget.hasElements())
{
- // put content and clip definition to primitive sequence
- const drawinglayer::primitive2d::Primitive2DSequence aContent(drawinglayer::primitive2d::Primitive2DVectorToPrimitive2DSequence(rTarget));
- drawinglayer::primitive2d::Primitive2DSequence aClip(drawinglayer::primitive2d::Primitive2DVectorToPrimitive2DSequence(aClipTarget));
-
if(objectBoundingBox == getClipPathUnits())
{
// clip is object-relative, embed in content transformation
const basegfx::B2DRange aContentRange(
drawinglayer::primitive2d::getB2DRangeFromPrimitive2DSequence(
- aContent,
+ rContent,
drawinglayer::geometry::ViewInformation2D()));
const drawinglayer::primitive2d::Primitive2DReference xTransform(
@@ -155,26 +152,27 @@ namespace svgio
basegfx::tools::createScaleTranslateB2DHomMatrix(
aContentRange.getRange(),
aContentRange.getMinimum()),
- aClip));
+ aClipTarget));
- aClip = drawinglayer::primitive2d::Primitive2DSequence(&xTransform, 1);
+ aClipTarget = drawinglayer::primitive2d::Primitive2DSequence(&xTransform, 1);
}
// redefine target. Use TransparencePrimitive2D with created clip
// geometry. Using the automatically set mbIsClipPathContent at
// SvgStyleAttributes the clip definition is without fill, stroke,
// and strokeWidth and forced to black, thus being 100% opaque
- rTarget.clear();
- rTarget.push_back(
+ const drawinglayer::primitive2d::Primitive2DReference xEmbedTransparence(
new drawinglayer::primitive2d::TransparencePrimitive2D(
- aContent,
- aClip));
+ rContent,
+ aClipTarget));
+
+ rContent = drawinglayer::primitive2d::Primitive2DSequence(&xEmbedTransparence, 1);
}
else
{
// An empty clipping path will completely clip away the element that had
// the clip-path property applied. (Svg spec)
- rTarget.clear();
+ rContent.realloc(0);
}
}
}
Modified: incubator/ooo/branches/alg/svgreplacement/main/svgio/source/svgreader/svgellipsenode.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/svgreplacement/main/svgio/source/svgreader/svgellipsenode.cxx?rev=1214899&r1=1214898&r2=1214899&view=diff
==============================================================================
--- incubator/ooo/branches/alg/svgreplacement/main/svgio/source/svgreader/svgellipsenode.cxx (original)
+++ incubator/ooo/branches/alg/svgreplacement/main/svgio/source/svgreader/svgellipsenode.cxx Thu Dec 15 18:03:28 2011
@@ -133,7 +133,7 @@ namespace svgio
}
}
- void SvgEllipseNode::decomposeSvgNode(drawinglayer::primitive2d::Primitive2DVector& rTarget, bool bReferenced) const
+ void SvgEllipseNode::decomposeSvgNode(drawinglayer::primitive2d::Primitive2DSequence& rTarget, bool bReferenced) const
{
const SvgStyleAttributes* pStyle = getSvgStyleAttributes();
@@ -151,7 +151,14 @@ namespace svgio
getCy().isSet() ? getCy().solve(*this, ycoordinate) : 0.0),
fRx, fRy));
- pStyle->add_path(basegfx::B2DPolyPolygon(aPath), rTarget, getTransform());
+ drawinglayer::primitive2d::Primitive2DSequence aNewTarget;
+
+ pStyle->add_path(basegfx::B2DPolyPolygon(aPath), aNewTarget);
+
+ if(aNewTarget.hasElements())
+ {
+ pStyle->add_postProcess(rTarget, aNewTarget, getTransform());
+ }
}
}
}
Modified: incubator/ooo/branches/alg/svgreplacement/main/svgio/source/svgreader/svggnode.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/svgreplacement/main/svgio/source/svgreader/svggnode.cxx?rev=1214899&r1=1214898&r2=1214899&view=diff
==============================================================================
--- incubator/ooo/branches/alg/svgreplacement/main/svgio/source/svgreader/svggnode.cxx (original)
+++ incubator/ooo/branches/alg/svgreplacement/main/svgio/source/svgreader/svggnode.cxx Thu Dec 15 18:03:28 2011
@@ -85,7 +85,7 @@ namespace svgio
}
}
- void SvgGNode::decomposeSvgNode(drawinglayer::primitive2d::Primitive2DVector& rTarget, bool bReferenced) const
+ void SvgGNode::decomposeSvgNode(drawinglayer::primitive2d::Primitive2DSequence& rTarget, bool bReferenced) const
{
const SvgStyleAttributes* pStyle = getSvgStyleAttributes();
@@ -95,40 +95,14 @@ namespace svgio
if(fOpacity > 0.0)
{
- drawinglayer::primitive2d::Primitive2DVector aNewTarget;
+ drawinglayer::primitive2d::Primitive2DSequence aContent;
// decompose childs
- SvgNode::decomposeSvgNode(aNewTarget, bReferenced);
+ SvgNode::decomposeSvgNode(aContent, bReferenced);
- if(!aNewTarget.empty())
+ if(aContent.hasElements())
{
- // put content to primitive sequence
- drawinglayer::primitive2d::Primitive2DSequence aContent(drawinglayer::primitive2d::Primitive2DVectorToPrimitive2DSequence(aNewTarget));
-
- if(basegfx::fTools::less(fOpacity, 1.0))
- {
- // embed in UnifiedTransparencePrimitive2D
- const drawinglayer::primitive2d::Primitive2DReference xRef(
- new drawinglayer::primitive2d::UnifiedTransparencePrimitive2D(
- aContent,
- 1.0 - fOpacity));
-
- aContent = drawinglayer::primitive2d::Primitive2DSequence(&xRef, 1);
- }
-
- if(getTransform())
- {
- // create embedding group element with transformation
- const drawinglayer::primitive2d::Primitive2DReference xRef(
- new drawinglayer::primitive2d::TransformPrimitive2D(
- *getTransform(),
- aContent));
-
- aContent = drawinglayer::primitive2d::Primitive2DSequence(&xRef, 1);
- }
-
- // append to current target
- rTarget.push_back(new drawinglayer::primitive2d::GroupPrimitive2D(aContent));
+ pStyle->add_postProcess(rTarget, aContent, getTransform());
}
}
}
Modified: incubator/ooo/branches/alg/svgreplacement/main/svgio/source/svgreader/svgimagenode.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/svgreplacement/main/svgio/source/svgreader/svgimagenode.cxx?rev=1214899&r1=1214898&r2=1214899&view=diff
==============================================================================
--- incubator/ooo/branches/alg/svgreplacement/main/svgio/source/svgreader/svgimagenode.cxx (original)
+++ incubator/ooo/branches/alg/svgreplacement/main/svgio/source/svgreader/svgimagenode.cxx Thu Dec 15 18:03:28 2011
@@ -194,7 +194,7 @@ namespace svgio
}
}
- void SvgImageNode::decomposeSvgNode(drawinglayer::primitive2d::Primitive2DVector& rTarget, bool bReferenced) const
+ void SvgImageNode::decomposeSvgNode(drawinglayer::primitive2d::Primitive2DSequence& rTarget, bool bReferenced) const
{
// get size range and create path
const SvgStyleAttributes* pStyle = getSvgStyleAttributes();
@@ -207,8 +207,7 @@ namespace svgio
if(fWidth > 0.0 && fHeight > 0.0)
{
BitmapEx aBitmapEx;
- drawinglayer::primitive2d::Primitive2DVector aNewTarget;
- drawinglayer::primitive2d::Primitive2DSequence aEmbedded;
+ drawinglayer::primitive2d::Primitive2DSequence aNewTarget;
// prepare Target and ViewBox for evtl. AspectRatio mappings
const double fX(getX().isSet() ? getX().solve(*this, xcoordinate) : 0.0);
@@ -232,7 +231,7 @@ namespace svgio
String(),
aStream))
{
- extractFromGraphic(aGraphic, aEmbedded, aViewBox, aBitmapEx);
+ extractFromGraphic(aGraphic, aNewTarget, aViewBox, aBitmapEx);
}
}
}
@@ -251,7 +250,7 @@ namespace svgio
aAbsUrl,
aStream))
{
- extractFromGraphic(aGraphic, aEmbedded, aViewBox, aBitmapEx);
+ extractFromGraphic(aGraphic, aNewTarget, aViewBox, aBitmapEx);
}
}
}
@@ -261,97 +260,86 @@ namespace svgio
if(mpXLink)
{
- drawinglayer::primitive2d::Primitive2DVector aLinkedTarget;
+ mpXLink->decomposeSvgNode(aNewTarget, true);
- mpXLink->decomposeSvgNode(aLinkedTarget, true);
-
- if(aLinkedTarget.size())
+ if(aNewTarget.hasElements())
{
- aEmbedded = drawinglayer::primitive2d::Primitive2DVectorToPrimitive2DSequence(aLinkedTarget);
-
- if(aEmbedded.hasElements())
- {
- const drawinglayer::geometry::ViewInformation2D aViewInformation2D;
-
- aViewBox = drawinglayer::primitive2d::getB2DRangeFromPrimitive2DSequence(aEmbedded, aViewInformation2D);
- }
+ aViewBox = drawinglayer::primitive2d::getB2DRangeFromPrimitive2DSequence(
+ aNewTarget,
+ drawinglayer::geometry::ViewInformation2D());
}
}
}
if(!aBitmapEx.IsEmpty())
{
- // create content from bitmap
- aNewTarget.push_back(
- new drawinglayer::primitive2d::BitmapPrimitive2D(
- aBitmapEx,
- basegfx::B2DHomMatrix()));
+ // create content from created bitmap
+ aNewTarget.realloc(1);
+ aNewTarget[0] = new drawinglayer::primitive2d::BitmapPrimitive2D(
+ aBitmapEx,
+ basegfx::B2DHomMatrix());
// fill aViewBox. No size set yet, use unit size
aViewBox = basegfx::B2DRange(0.0, 0.0, 1.0, 1.0);
}
- else if(aEmbedded.hasElements())
- {
- // add to aNewTarget as Group
- aNewTarget.push_back(
- new drawinglayer::primitive2d::GroupPrimitive2D(
- aEmbedded));
- }
- if(aNewTarget.size())
+ if(aNewTarget.hasElements())
{
if(aTarget.equal(aViewBox))
{
// just add to rTarget
- rTarget.insert(rTarget.end(), aNewTarget.begin(), aNewTarget.end());
+ drawinglayer::primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence(rTarget, aNewTarget);
}
else
{
// create mapping
const SvgAspectRatio& rRatio = getSvgAspectRatio();
- const drawinglayer::primitive2d::Primitive2DSequence aSequence(drawinglayer::primitive2d::Primitive2DVectorToPrimitive2DSequence(aNewTarget));
if(rRatio.isSet())
{
// let mapping be created from SvgAspectRatio
- const basegfx::B2DHomMatrix aEmbeddingTransform(
- rRatio.createMapping(aTarget, aViewBox));
+ const basegfx::B2DHomMatrix aEmbeddingTransform(rRatio.createMapping(aTarget, aViewBox));
- // prepare embedding in transformation
- drawinglayer::primitive2d::TransformPrimitive2D* pNew =
- new drawinglayer::primitive2d::TransformPrimitive2D(
- aEmbeddingTransform,
- aSequence);
-
- if(rRatio.isMeetOrSlice())
+ if(!aEmbeddingTransform.isIdentity())
{
- // embed in transformation
- rTarget.push_back(pNew);
+ const drawinglayer::primitive2d::Primitive2DReference xRef(
+ new drawinglayer::primitive2d::TransformPrimitive2D(
+ aEmbeddingTransform,
+ aNewTarget));
+
+ aNewTarget = drawinglayer::primitive2d::Primitive2DSequence(&xRef, 1);
}
- else
- {
- // need to embed in MaskPrimitive2D, too
- const drawinglayer::primitive2d::Primitive2DReference xRef(pNew);
- rTarget.push_back(
+ if(!rRatio.isMeetOrSlice())
+ {
+ // need to embed in MaskPrimitive2D to ensure clipping
+ const drawinglayer::primitive2d::Primitive2DReference xMask(
new drawinglayer::primitive2d::MaskPrimitive2D(
- basegfx::B2DPolyPolygon(basegfx::tools::createPolygonFromRect(aTarget)),
- drawinglayer::primitive2d::Primitive2DSequence(&xRef, 1)));
+ basegfx::B2DPolyPolygon(
+ basegfx::tools::createPolygonFromRect(aTarget)),
+ aNewTarget));
+
+ aNewTarget = drawinglayer::primitive2d::Primitive2DSequence(&xMask, 1);
}
}
else
{
// choose default mapping
- const basegfx::B2DHomMatrix aEmbeddingTransform(
- rRatio.createLinearMapping(
- aTarget, aViewBox));
-
- // embed in transformation
- rTarget.push_back(
- new drawinglayer::primitive2d::TransformPrimitive2D(
- aEmbeddingTransform,
- aSequence));
+ const basegfx::B2DHomMatrix aEmbeddingTransform(rRatio.createLinearMapping(aTarget, aViewBox));
+
+ if(!aEmbeddingTransform.isIdentity())
+ {
+ const drawinglayer::primitive2d::Primitive2DReference xRef(
+ new drawinglayer::primitive2d::TransformPrimitive2D(
+ aEmbeddingTransform,
+ aNewTarget));
+
+ aNewTarget = drawinglayer::primitive2d::Primitive2DSequence(&xRef, 1);
+ }
}
+
+ // embed and add to rTarget, take local extra-transform into account
+ pStyle->add_postProcess(rTarget, aNewTarget, getTransform());
}
}
}
Modified: incubator/ooo/branches/alg/svgreplacement/main/svgio/source/svgreader/svglinenode.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/svgreplacement/main/svgio/source/svgreader/svglinenode.cxx?rev=1214899&r1=1214898&r2=1214899&view=diff
==============================================================================
--- incubator/ooo/branches/alg/svgreplacement/main/svgio/source/svgreader/svglinenode.cxx (original)
+++ incubator/ooo/branches/alg/svgreplacement/main/svgio/source/svgreader/svglinenode.cxx Thu Dec 15 18:03:28 2011
@@ -127,7 +127,7 @@ namespace svgio
}
}
- void SvgLineNode::decomposeSvgNode(drawinglayer::primitive2d::Primitive2DVector& rTarget, bool bReferenced) const
+ void SvgLineNode::decomposeSvgNode(drawinglayer::primitive2d::Primitive2DSequence& rTarget, bool bReferenced) const
{
const SvgStyleAttributes* pStyle = getSvgStyleAttributes();
@@ -147,7 +147,14 @@ namespace svgio
aPath.append(X);
aPath.append(Y);
- pStyle->add_path(basegfx::B2DPolyPolygon(aPath), rTarget, getTransform());
+ drawinglayer::primitive2d::Primitive2DSequence aNewTarget;
+
+ pStyle->add_path(basegfx::B2DPolyPolygon(aPath), aNewTarget);
+
+ if(aNewTarget.hasElements())
+ {
+ pStyle->add_postProcess(rTarget, aNewTarget, getTransform());
+ }
}
}
}
Modified: incubator/ooo/branches/alg/svgreplacement/main/svgio/source/svgreader/svgmarkernode.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/svgreplacement/main/svgio/source/svgreader/svgmarkernode.cxx?rev=1214899&r1=1214898&r2=1214899&view=diff
==============================================================================
--- incubator/ooo/branches/alg/svgreplacement/main/svgio/source/svgreader/svgmarkernode.cxx (original)
+++ incubator/ooo/branches/alg/svgreplacement/main/svgio/source/svgreader/svgmarkernode.cxx Thu Dec 15 18:03:28 2011
@@ -187,14 +187,7 @@ namespace svgio
{
if(!aPrimitives.hasElements())
{
- drawinglayer::primitive2d::Primitive2DVector aNewTarget;
-
- decomposeSvgNode(aNewTarget, true);
-
- if(aNewTarget.size())
- {
- const_cast< SvgMarkerNode* >(this)->aPrimitives = drawinglayer::primitive2d::Primitive2DVectorToPrimitive2DSequence(aNewTarget);
- }
+ decomposeSvgNode(const_cast< SvgMarkerNode* >(this)->aPrimitives, true);
}
return aPrimitives;
Modified: incubator/ooo/branches/alg/svgreplacement/main/svgio/source/svgreader/svgmasknode.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/svgreplacement/main/svgio/source/svgreader/svgmasknode.cxx?rev=1214899&r1=1214898&r2=1214899&view=diff
==============================================================================
--- incubator/ooo/branches/alg/svgreplacement/main/svgio/source/svgreader/svgmasknode.cxx (original)
+++ incubator/ooo/branches/alg/svgreplacement/main/svgio/source/svgreader/svgmasknode.cxx Thu Dec 15 18:03:28 2011
@@ -171,51 +171,46 @@ namespace svgio
}
}
- void SvgMaskNode::decomposeSvgNode(drawinglayer::primitive2d::Primitive2DVector& rTarget, bool bReferenced) const
+ void SvgMaskNode::decomposeSvgNode(drawinglayer::primitive2d::Primitive2DSequence& rTarget, bool bReferenced) const
{
- drawinglayer::primitive2d::Primitive2DVector aNewTarget;
+ drawinglayer::primitive2d::Primitive2DSequence aNewTarget;
// decompose childs
SvgNode::decomposeSvgNode(aNewTarget, bReferenced);
- if(!aNewTarget.empty())
+ if(aNewTarget.hasElements())
{
if(getTransform())
{
// create embedding group element with transformation
- rTarget.push_back(
+ const drawinglayer::primitive2d::Primitive2DReference xRef(
new drawinglayer::primitive2d::TransformPrimitive2D(
*getTransform(),
- Primitive2DVectorToPrimitive2DSequence(aNewTarget)));
- aNewTarget.clear();
- }
- else
- {
- // append to current target
- rTarget.insert(rTarget.end(), aNewTarget.begin(), aNewTarget.end());
+ aNewTarget));
+
+ aNewTarget = drawinglayer::primitive2d::Primitive2DSequence(&xRef, 1);
}
+
+ // append to current target
+ drawinglayer::primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence(rTarget, aNewTarget);
}
}
- void SvgMaskNode::apply(drawinglayer::primitive2d::Primitive2DVector& rTarget) const
+ void SvgMaskNode::apply(drawinglayer::primitive2d::Primitive2DSequence& rTarget) const
{
- if(rTarget.size())
+ if(rTarget.hasElements())
{
- drawinglayer::primitive2d::Primitive2DVector aMaskTarget;
+ drawinglayer::primitive2d::Primitive2DSequence aMaskTarget;
// get mask definition as primitives
decomposeSvgNode(aMaskTarget, true);
- if(aMaskTarget.size())
+ if(aMaskTarget.hasElements())
{
- // put content and clip definition to primitive sequence
- const drawinglayer::primitive2d::Primitive2DSequence aContent(drawinglayer::primitive2d::Primitive2DVectorToPrimitive2DSequence(rTarget));
- drawinglayer::primitive2d::Primitive2DSequence aMask(drawinglayer::primitive2d::Primitive2DVectorToPrimitive2DSequence(aMaskTarget));
-
// get range of content to be masked
const basegfx::B2DRange aContentRange(
drawinglayer::primitive2d::getB2DRangeFromPrimitive2DSequence(
- aContent,
+ rTarget,
drawinglayer::geometry::ViewInformation2D()));
const double fContentWidth(aContentRange.getWidth());
const double fContentHeight(aContentRange.getHeight());
@@ -259,9 +254,9 @@ namespace svgio
basegfx::tools::createScaleTranslateB2DHomMatrix(
aContentRange.getRange(),
aContentRange.getMinimum()),
- aMask));
+ aMaskTarget));
- aMask = drawinglayer::primitive2d::Primitive2DSequence(&xTransform, 1);
+ aMaskTarget = drawinglayer::primitive2d::Primitive2DSequence(&xTransform, 1);
}
// embed content to a ModifiedColorPrimitive2D since the definitions
@@ -269,43 +264,48 @@ namespace svgio
{
const drawinglayer::primitive2d::Primitive2DReference xInverseMask(
new drawinglayer::primitive2d::ModifiedColorPrimitive2D(
- aMask,
+ aMaskTarget,
basegfx::BColorModifier(
basegfx::BColor(0.0, 0.0, 0.0),
0.5,
basegfx::BCOLORMODIFYMODE_LUMINANCE_TO_ALPHA)));
- aMask = drawinglayer::primitive2d::Primitive2DSequence(&xInverseMask, 1);
+ aMaskTarget = drawinglayer::primitive2d::Primitive2DSequence(&xInverseMask, 1);
}
// prepare new content
- drawinglayer::primitive2d::BasePrimitive2D* pNewContent = new drawinglayer::primitive2d::TransparencePrimitive2D(
- aContent,
- aMask);
+ drawinglayer::primitive2d::Primitive2DReference xNewContent(
+ new drawinglayer::primitive2d::TransparencePrimitive2D(
+ rTarget,
+ aMaskTarget));
// output up to now is defined by aContentRange and mask is oriented
// relative to it. It is possible that aOffscreenBufferRange defines
// a smaller area. In that case, embed to a mask primitive
if(!aOffscreenBufferRange.isInside(aContentRange))
{
- const drawinglayer::primitive2d::Primitive2DReference xContent(pNewContent);
-
- pNewContent = new drawinglayer::primitive2d::MaskPrimitive2D(
- basegfx::B2DPolyPolygon(basegfx::tools::createPolygonFromRect(aOffscreenBufferRange)),
- drawinglayer::primitive2d::Primitive2DSequence(&xContent, 1));
+ xNewContent = new drawinglayer::primitive2d::MaskPrimitive2D(
+ basegfx::B2DPolyPolygon(
+ basegfx::tools::createPolygonFromRect(
+ aOffscreenBufferRange)),
+ drawinglayer::primitive2d::Primitive2DSequence(&xNewContent, 1));
}
// redefine target. Use TransparencePrimitive2D with created mask
// geometry
- rTarget.clear();
- rTarget.push_back(pNewContent);
+ rTarget = drawinglayer::primitive2d::Primitive2DSequence(&xNewContent, 1);
+ }
+ else
+ {
+ // content is geometrically empty
+ rTarget.realloc(0);
}
}
else
{
// An empty clipping path will completely clip away the element that had
// the clip-path property applied. (Svg spec)
- rTarget.clear();
+ rTarget.realloc(0);
}
}
}
Modified: incubator/ooo/branches/alg/svgreplacement/main/svgio/source/svgreader/svgnode.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/svgreplacement/main/svgio/source/svgreader/svgnode.cxx?rev=1214899&r1=1214898&r2=1214899&view=diff
==============================================================================
--- incubator/ooo/branches/alg/svgreplacement/main/svgio/source/svgreader/svgnode.cxx (original)
+++ incubator/ooo/branches/alg/svgreplacement/main/svgio/source/svgreader/svgnode.cxx Thu Dec 15 18:03:28 2011
@@ -134,7 +134,7 @@ namespace svgio
}
}
- void SvgNode::decomposeSvgNode(drawinglayer::primitive2d::Primitive2DVector& rTarget, bool bReferenced) const
+ void SvgNode::decomposeSvgNode(drawinglayer::primitive2d::Primitive2DSequence& rTarget, bool bReferenced) const
{
if(!bReferenced)
{
@@ -171,22 +171,13 @@ namespace svgio
if(pCandidate)
{
- drawinglayer::primitive2d::Primitive2DVector aNewTarget;
+ drawinglayer::primitive2d::Primitive2DSequence aNewTarget;
pCandidate->decomposeSvgNode(aNewTarget, bReferenced);
- if(aNewTarget.size())
+ if(aNewTarget.hasElements())
{
- const SvgStyleAttributes* pAttributes = pCandidate->getSvgStyleAttributes();
-
- if(pAttributes)
- {
- // check for global attributes which need to be applied,
- // e.g. ClipPath or Mask
- pAttributes->decomposePostProcess(aNewTarget);
- }
-
- rTarget.insert(rTarget.end(), aNewTarget.begin(), aNewTarget.end());
+ drawinglayer::primitive2d::appendPrimitive2DSequenceToPrimitive2DSequence(rTarget, aNewTarget);
}
}
else
Modified: incubator/ooo/branches/alg/svgreplacement/main/svgio/source/svgreader/svgpathnode.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/svgreplacement/main/svgio/source/svgreader/svgpathnode.cxx?rev=1214899&r1=1214898&r2=1214899&view=diff
==============================================================================
--- incubator/ooo/branches/alg/svgreplacement/main/svgio/source/svgreader/svgpathnode.cxx (original)
+++ incubator/ooo/branches/alg/svgreplacement/main/svgio/source/svgreader/svgpathnode.cxx Thu Dec 15 18:03:28 2011
@@ -108,14 +108,21 @@ namespace svgio
}
}
- void SvgPathNode::decomposeSvgNode(drawinglayer::primitive2d::Primitive2DVector& rTarget, bool bReferenced) const
+ void SvgPathNode::decomposeSvgNode(drawinglayer::primitive2d::Primitive2DSequence& rTarget, bool bReferenced) const
{
// fill and/or stroke needed, also a path
const SvgStyleAttributes* pStyle = getSvgStyleAttributes();
if(pStyle && getPath())
{
- pStyle->add_path(*getPath(), rTarget, getTransform());
+ drawinglayer::primitive2d::Primitive2DSequence aNewTarget;
+
+ pStyle->add_path(*getPath(), aNewTarget);
+
+ if(aNewTarget.hasElements())
+ {
+ pStyle->add_postProcess(rTarget, aNewTarget, getTransform());
+ }
}
}
} // end of namespace svgreader
Modified: incubator/ooo/branches/alg/svgreplacement/main/svgio/source/svgreader/svgpatternnode.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/svgreplacement/main/svgio/source/svgreader/svgpatternnode.cxx?rev=1214899&r1=1214898&r2=1214899&view=diff
==============================================================================
--- incubator/ooo/branches/alg/svgreplacement/main/svgio/source/svgreader/svgpatternnode.cxx (original)
+++ incubator/ooo/branches/alg/svgreplacement/main/svgio/source/svgreader/svgpatternnode.cxx Thu Dec 15 18:03:28 2011
@@ -274,14 +274,7 @@ namespace svgio
{
if(!aPrimitives.hasElements())
{
- drawinglayer::primitive2d::Primitive2DVector aNewTarget;
-
- decomposeSvgNode(aNewTarget, true);
-
- if(aNewTarget.size())
- {
- const_cast< SvgPatternNode* >(this)->aPrimitives = drawinglayer::primitive2d::Primitive2DVectorToPrimitive2DSequence(aNewTarget);
- }
+ decomposeSvgNode(const_cast< SvgPatternNode* >(this)->aPrimitives, true);
}
if(!aPrimitives.hasElements() && maXLink.getLength())
Modified: incubator/ooo/branches/alg/svgreplacement/main/svgio/source/svgreader/svgpolynode.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/svgreplacement/main/svgio/source/svgreader/svgpolynode.cxx?rev=1214899&r1=1214898&r2=1214899&view=diff
==============================================================================
--- incubator/ooo/branches/alg/svgreplacement/main/svgio/source/svgreader/svgpolynode.cxx (original)
+++ incubator/ooo/branches/alg/svgreplacement/main/svgio/source/svgreader/svgpolynode.cxx Thu Dec 15 18:03:28 2011
@@ -105,13 +105,20 @@ namespace svgio
}
}
- void SvgPolyNode::decomposeSvgNode(drawinglayer::primitive2d::Primitive2DVector& rTarget, bool bReferenced) const
+ void SvgPolyNode::decomposeSvgNode(drawinglayer::primitive2d::Primitive2DSequence& rTarget, bool bReferenced) const
{
const SvgStyleAttributes* pStyle = getSvgStyleAttributes();
if(pStyle && getPolygon())
{
- pStyle->add_path(basegfx::B2DPolyPolygon(*getPolygon()), rTarget, getTransform());
+ drawinglayer::primitive2d::Primitive2DSequence aNewTarget;
+
+ pStyle->add_path(basegfx::B2DPolyPolygon(*getPolygon()), aNewTarget);
+
+ if(aNewTarget.hasElements())
+ {
+ pStyle->add_postProcess(rTarget, aNewTarget, getTransform());
+ }
}
}
} // end of namespace svgreader
Modified: incubator/ooo/branches/alg/svgreplacement/main/svgio/source/svgreader/svgrectnode.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/branches/alg/svgreplacement/main/svgio/source/svgreader/svgrectnode.cxx?rev=1214899&r1=1214898&r2=1214899&view=diff
==============================================================================
--- incubator/ooo/branches/alg/svgreplacement/main/svgio/source/svgreader/svgrectnode.cxx (original)
+++ incubator/ooo/branches/alg/svgreplacement/main/svgio/source/svgreader/svgrectnode.cxx Thu Dec 15 18:03:28 2011
@@ -161,7 +161,7 @@ namespace svgio
}
}
- void SvgRectNode::decomposeSvgNode(drawinglayer::primitive2d::Primitive2DVector& rTarget, bool bReferenced) const
+ void SvgRectNode::decomposeSvgNode(drawinglayer::primitive2d::Primitive2DSequence& rTarget, bool bReferenced) const
{
// get size range and create path
const SvgStyleAttributes* pStyle = getSvgStyleAttributes();
@@ -208,7 +208,14 @@ namespace svgio
aPath = basegfx::tools::createPolygonFromRect(aRange);
}
- pStyle->add_path(basegfx::B2DPolyPolygon(aPath), rTarget, getTransform());
+ drawinglayer::primitive2d::Primitive2DSequence aNewTarget;
+
+ pStyle->add_path(basegfx::B2DPolyPolygon(aPath), aNewTarget);
+
+ if(aNewTarget.hasElements())
+ {
+ pStyle->add_postProcess(rTarget, aNewTarget, getTransform());
+ }
}
}
}