summaryrefslogtreecommitdiff
path: root/svgio
diff options
context:
space:
mode:
authorArmin Le Grand <alg@apache.org>2013-10-29 14:11:45 +0000
committerCaolán McNamara <caolanm@redhat.com>2013-10-31 15:56:14 +0000
commit223f6b631c1b087754c0f9051fb55f029f2503ce (patch)
tree14582be2894a88d16c6b0debbc8491350f9a5cce /svgio
parent9069e26d1fe1fbbe7bceab0bae8a186d8cdb47cc (diff)
Resolves: #i123433# Detect pseudo-vertices at svg import...
unify svg:d handling, correct svg:d import for relative sub-polygons in svg import; changed default for moveto writes for svg:d in ODF to absolute (cherry picked from commit f15874d8f976f3874bdbcb53429eeefa65c28841) Conflicts: basegfx/inc/basegfx/polygon/b2dpolygontools.hxx basegfx/inc/basegfx/polygon/b2dpolypolygontools.hxx basegfx/inc/basegfx/polygon/b3dpolypolygontools.hxx basegfx/source/polygon/b2dpolypolygontools.cxx basegfx/source/polygon/b2dsvgpolypolygon.cxx basegfx/source/polygon/b3dpolypolygontools.cxx basegfx/source/tools/makefile.mk basegfx/test/boxclipper.cxx basegfx/test/clipstate.cxx basegfx/test/genericclipper.cxx canvas/source/tools/surfaceproxy.cxx sdext/source/pdfimport/tree/drawtreevisiting.cxx sdext/source/pdfimport/tree/writertreevisiting.cxx xmloff/inc/xexptran.hxx xmloff/source/draw/XMLImageMapContext.cxx xmloff/source/draw/XMLImageMapExport.cxx xmloff/source/draw/shapeexport2.cxx xmloff/source/draw/shapeexport3.cxx xmloff/source/draw/xexptran.cxx xmloff/source/draw/ximp3dobject.cxx xmloff/source/draw/ximpshap.cxx xmloff/source/style/MarkerStyle.cxx xmloff/source/text/XMLTextFrameContext.cxx xmloff/source/text/txtparae.cxx Change-Id: I5171b4a3559ea116bea45152e1f2685666463635
Diffstat (limited to 'svgio')
-rw-r--r--svgio/inc/svgio/svgreader/svgpathnode.hxx10
-rw-r--r--svgio/inc/svgio/svgreader/svgstyleattributes.hxx7
-rw-r--r--svgio/source/svgreader/svgcirclenode.cxx2
-rw-r--r--svgio/source/svgreader/svgellipsenode.cxx2
-rw-r--r--svgio/source/svgreader/svglinenode.cxx2
-rw-r--r--svgio/source/svgreader/svgpathnode.cxx4
-rw-r--r--svgio/source/svgreader/svgpolynode.cxx3
-rw-r--r--svgio/source/svgreader/svgrectnode.cxx2
-rw-r--r--svgio/source/svgreader/svgstyleattributes.cxx20
9 files changed, 36 insertions, 16 deletions
diff --git a/svgio/inc/svgio/svgreader/svgpathnode.hxx b/svgio/inc/svgio/svgreader/svgpathnode.hxx
index a9e61d3361f4..1907baba8411 100644
--- a/svgio/inc/svgio/svgreader/svgpathnode.hxx
+++ b/svgio/inc/svgio/svgreader/svgpathnode.hxx
@@ -22,6 +22,7 @@
#include <svgio/svgreader/svgnode.hxx>
#include <svgio/svgreader/svgstyleattributes.hxx>
+#include <basegfx/polygon/b2dpolypolygontools.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -33,12 +34,13 @@ namespace svgio
{
private:
/// use styles
- SvgStyleAttributes maSvgStyleAttributes;
+ SvgStyleAttributes maSvgStyleAttributes;
/// variable scan values, dependent of given XAttributeList
- basegfx::B2DPolyPolygon* mpPolyPolygon;
- basegfx::B2DHomMatrix* mpaTransform;
- SvgNumber maPathLength;
+ basegfx::B2DPolyPolygon* mpPolyPolygon;
+ basegfx::B2DHomMatrix* mpaTransform;
+ SvgNumber maPathLength;
+ basegfx::tools::PointIndexSet maHelpPointIndices;
public:
SvgPathNode(
diff --git a/svgio/inc/svgio/svgreader/svgstyleattributes.hxx b/svgio/inc/svgio/svgreader/svgstyleattributes.hxx
index be8ddd4e64e1..1624b37aebc8 100644
--- a/svgio/inc/svgio/svgreader/svgstyleattributes.hxx
+++ b/svgio/inc/svgio/svgreader/svgstyleattributes.hxx
@@ -23,6 +23,7 @@
#include <svgio/svgreader/svgpaint.hxx>
#include <svgio/svgreader/svgnode.hxx>
#include <vcl/vclenum.hxx>
+#include <basegfx/polygon/b2dpolypolygontools.hxx>
//////////////////////////////////////////////////////////////////////////////
// predefines
@@ -250,7 +251,8 @@ namespace svgio
const SvgMarkerNode& rMarker) const;
void add_markers(
const basegfx::B2DPolyPolygon& rPath,
- drawinglayer::primitive2d::Primitive2DSequence& rTarget) const;
+ drawinglayer::primitive2d::Primitive2DSequence& rTarget,
+ const basegfx::tools::PointIndexSet* pHelpPointIndices) const;
public:
/// local attribute scanner
@@ -262,7 +264,8 @@ namespace svgio
drawinglayer::primitive2d::Primitive2DSequence& rSource) const;
void add_path(
const basegfx::B2DPolyPolygon& rPath,
- drawinglayer::primitive2d::Primitive2DSequence& rTarget) const;
+ drawinglayer::primitive2d::Primitive2DSequence& rTarget,
+ const basegfx::tools::PointIndexSet* pHelpPointIndices) const;
void add_postProcess(
drawinglayer::primitive2d::Primitive2DSequence& rTarget,
const drawinglayer::primitive2d::Primitive2DSequence& rSource,
diff --git a/svgio/source/svgreader/svgcirclenode.cxx b/svgio/source/svgreader/svgcirclenode.cxx
index c742a41f9989..f462a07e3284 100644
--- a/svgio/source/svgreader/svgcirclenode.cxx
+++ b/svgio/source/svgreader/svgcirclenode.cxx
@@ -135,7 +135,7 @@ namespace svgio
drawinglayer::primitive2d::Primitive2DSequence aNewTarget;
- pStyle->add_path(basegfx::B2DPolyPolygon(aPath), aNewTarget);
+ pStyle->add_path(basegfx::B2DPolyPolygon(aPath), aNewTarget, 0);
if(aNewTarget.hasElements())
{
diff --git a/svgio/source/svgreader/svgellipsenode.cxx b/svgio/source/svgreader/svgellipsenode.cxx
index aa42d7adc757..283e9da9826b 100644
--- a/svgio/source/svgreader/svgellipsenode.cxx
+++ b/svgio/source/svgreader/svgellipsenode.cxx
@@ -150,7 +150,7 @@ namespace svgio
drawinglayer::primitive2d::Primitive2DSequence aNewTarget;
- pStyle->add_path(basegfx::B2DPolyPolygon(aPath), aNewTarget);
+ pStyle->add_path(basegfx::B2DPolyPolygon(aPath), aNewTarget, 0);
if(aNewTarget.hasElements())
{
diff --git a/svgio/source/svgreader/svglinenode.cxx b/svgio/source/svgreader/svglinenode.cxx
index 74e9facbf973..aebefe7fdd9c 100644
--- a/svgio/source/svgreader/svglinenode.cxx
+++ b/svgio/source/svgreader/svglinenode.cxx
@@ -146,7 +146,7 @@ namespace svgio
drawinglayer::primitive2d::Primitive2DSequence aNewTarget;
- pStyle->add_path(basegfx::B2DPolyPolygon(aPath), aNewTarget);
+ pStyle->add_path(basegfx::B2DPolyPolygon(aPath), aNewTarget, 0);
if(aNewTarget.hasElements())
{
diff --git a/svgio/source/svgreader/svgpathnode.cxx b/svgio/source/svgreader/svgpathnode.cxx
index 9e77f723a6df..e745711e786d 100644
--- a/svgio/source/svgreader/svgpathnode.cxx
+++ b/svgio/source/svgreader/svgpathnode.cxx
@@ -69,7 +69,7 @@ namespace svgio
{
basegfx::B2DPolyPolygon aPath;
- if(basegfx::tools::importFromSvgD(aPath, aContent))
+ if(basegfx::tools::importFromSvgD(aPath, aContent, false, &maHelpPointIndices))
{
if(aPath.count())
{
@@ -114,7 +114,7 @@ namespace svgio
{
drawinglayer::primitive2d::Primitive2DSequence aNewTarget;
- pStyle->add_path(*getPath(), aNewTarget);
+ pStyle->add_path(*getPath(), aNewTarget, &maHelpPointIndices);
if(aNewTarget.hasElements())
{
diff --git a/svgio/source/svgreader/svgpolynode.cxx b/svgio/source/svgreader/svgpolynode.cxx
index eef4808404dc..c475c79f7206 100644
--- a/svgio/source/svgreader/svgpolynode.cxx
+++ b/svgio/source/svgreader/svgpolynode.cxx
@@ -20,6 +20,7 @@
#include <svgio/svgreader/svgpolynode.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
#include <basegfx/polygon/b2dpolypolygontools.hxx>
+#include <basegfx/polygon/b2dpolygontools.hxx>
//////////////////////////////////////////////////////////////////////////////
@@ -111,7 +112,7 @@ namespace svgio
{
drawinglayer::primitive2d::Primitive2DSequence aNewTarget;
- pStyle->add_path(basegfx::B2DPolyPolygon(*getPolygon()), aNewTarget);
+ pStyle->add_path(basegfx::B2DPolyPolygon(*getPolygon()), aNewTarget, 0);
if(aNewTarget.hasElements())
{
diff --git a/svgio/source/svgreader/svgrectnode.cxx b/svgio/source/svgreader/svgrectnode.cxx
index 5d518a46c245..8348ed76ae14 100644
--- a/svgio/source/svgreader/svgrectnode.cxx
+++ b/svgio/source/svgreader/svgrectnode.cxx
@@ -207,7 +207,7 @@ namespace svgio
drawinglayer::primitive2d::Primitive2DSequence aNewTarget;
- pStyle->add_path(basegfx::B2DPolyPolygon(aPath), aNewTarget);
+ pStyle->add_path(basegfx::B2DPolyPolygon(aPath), aNewTarget, 0);
if(aNewTarget.hasElements())
{
diff --git a/svgio/source/svgreader/svgstyleattributes.cxx b/svgio/source/svgreader/svgstyleattributes.cxx
index 958debdfe21c..0e8be846a6fc 100644
--- a/svgio/source/svgreader/svgstyleattributes.cxx
+++ b/svgio/source/svgreader/svgstyleattributes.cxx
@@ -829,7 +829,8 @@ namespace svgio
void SvgStyleAttributes::add_markers(
const basegfx::B2DPolyPolygon& rPath,
- drawinglayer::primitive2d::Primitive2DSequence& rTarget) const
+ drawinglayer::primitive2d::Primitive2DSequence& rTarget,
+ const basegfx::tools::PointIndexSet* pHelpPointIndices) const
{
// try to access linked markers
const SvgMarkerNode* pStart = accessMarkerStartXLink();
@@ -888,6 +889,18 @@ namespace svgio
pNeeded = pMid;
}
+ if(pHelpPointIndices && !pHelpPointIndices->empty())
+ {
+ const basegfx::tools::PointIndexSet::const_iterator aFound(
+ pHelpPointIndices->find(basegfx::tools::PointIndex(a, b)));
+
+ if(aFound != pHelpPointIndices->end())
+ {
+ // this point is a pure helper point; do not create a marker for it
+ continue;
+ }
+ }
+
if(!pNeeded)
{
// no marker needs to be created for this point
@@ -999,7 +1012,8 @@ namespace svgio
void SvgStyleAttributes::add_path(
const basegfx::B2DPolyPolygon& rPath,
- drawinglayer::primitive2d::Primitive2DSequence& rTarget) const
+ drawinglayer::primitive2d::Primitive2DSequence& rTarget,
+ const basegfx::tools::PointIndexSet* pHelpPointIndices) const
{
if(!rPath.count())
{
@@ -1057,7 +1071,7 @@ namespace svgio
SVGTokenLine == mrOwner.getType()) // line
{
// try to add markers
- add_markers(rPath, rTarget);
+ add_markers(rPath, rTarget, pHelpPointIndices);
}
}