diff options
author | Armin Le Grand <alg@apache.org> | 2013-10-29 14:11:45 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-10-31 15:56:14 +0000 |
commit | 223f6b631c1b087754c0f9051fb55f029f2503ce (patch) | |
tree | 14582be2894a88d16c6b0debbc8491350f9a5cce /xmloff/source/draw/XMLImageMapContext.cxx | |
parent | 9069e26d1fe1fbbe7bceab0bae8a186d8cdb47cc (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 'xmloff/source/draw/XMLImageMapContext.cxx')
-rw-r--r-- | xmloff/source/draw/XMLImageMapContext.cxx | 35 |
1 files changed, 16 insertions, 19 deletions
diff --git a/xmloff/source/draw/XMLImageMapContext.cxx b/xmloff/source/draw/XMLImageMapContext.cxx index efa3b48c18ab..4601b0065108 100644 --- a/xmloff/source/draw/XMLImageMapContext.cxx +++ b/xmloff/source/draw/XMLImageMapContext.cxx @@ -26,7 +26,6 @@ #include <com/sun/star/container/XIndexContainer.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/drawing/PointSequenceSequence.hpp> - #include <com/sun/star/document/XEventsSupplier.hpp> #include <com/sun/star/awt/Rectangle.hpp> #include <xmloff/xmltoken.hxx> @@ -40,7 +39,8 @@ #include <xmloff/XMLEventsImportContext.hxx> #include "XMLStringBufferImportContext.hxx" #include <tools/debug.hxx> - +#include <basegfx/polygon/b2dpolygon.hxx> +#include <basegfx/polygon/b2dpolygontools.hxx> using namespace ::com::sun::star; using namespace ::xmloff::token; @@ -492,34 +492,31 @@ void XMLImageMapPolygonContext::ProcessAttribute( bValid = bViewBoxOK && bPointsOK; } -void XMLImageMapPolygonContext::Prepare( - Reference<XPropertySet> & rPropertySet) +void XMLImageMapPolygonContext::Prepare(Reference<XPropertySet> & rPropertySet) { // process view box - SdXMLImExViewBox aViewBox(sViewBoxString, - GetImport().GetMM100UnitConverter()); + SdXMLImExViewBox aViewBox(sViewBoxString, GetImport().GetMM100UnitConverter()); // get polygon sequence - awt::Point aPoint(aViewBox.GetX(), aViewBox.GetY()); - awt::Size aSize(aViewBox.GetWidth(), aViewBox.GetHeight()); - SdXMLImExPointsElement aPoints( sPointsString, aViewBox, aPoint, aSize, - GetImport().GetMM100UnitConverter() ); - PointSequenceSequence aPointSeqSeq = aPoints.GetPointSequenceSequence(); - - // only use first element of sequence-sequence - if (aPointSeqSeq.getLength() > 0) + basegfx::B2DPolygon aPolygon; + + if(basegfx::tools::importFromSvgPoints(aPolygon, sPointsString)) { - Any aAny; - aAny <<= aPointSeqSeq[0]; - rPropertySet->setPropertyValue(sPolygon, aAny); + if(aPolygon.count()) + { + com::sun::star::drawing::PointSequence aPointSequence; + uno::Any aAny; + + basegfx::tools::B2DPolygonToUnoPointSequence(aPolygon, aPointSequence); + aAny <<= aPointSequence; + rPropertySet->setPropertyValue(sPolygon, aAny); + } } // parent properties XMLImageMapObjectContext::Prepare(rPropertySet); } - - class XMLImageMapCircleContext : public XMLImageMapObjectContext { awt::Point aCenter; |