[Libreoffice-commits] core.git: 3 commits - xmloff/source

Armin Le Grand alg at apache.org
Sat May 18 10:03:29 PDT 2013


 xmloff/source/draw/xexptran.cxx |    4 +++-
 xmloff/source/draw/ximpshap.cxx |   39 ++++++++++++++++++++++++++++++++++++++-
 2 files changed, 41 insertions(+), 2 deletions(-)

New commits:
commit 7d2c9ac5c12232c15d21ee83387c31847553de80
Author: Armin Le Grand <alg at apache.org>
Date:   Wed Apr 10 08:31:18 2013 +0000

    i121972 Use svg rx/ry/cx/cy defines in draw:ellipse when used(cherry picked from commit 19abb8de7e218ba08b2fa79c0379844303da328a)

diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx
index 72f528b..7447e17 100644
--- a/xmloff/source/draw/ximpshap.cxx
+++ b/xmloff/source/draw/ximpshap.cxx
@@ -1231,6 +1231,15 @@ void SdXMLEllipseShapeContext::StartElement(const uno::Reference< xml::sax::XAtt
         SetStyle();
         SetLayer();
 
+        if(mnCX != 0 || mnCY != 0 || mnRX != 1 || mnRY != 1)
+        {
+            // #121972# center/radius is used, put to pos and size
+            maSize.Width = 2 * mnRX;
+            maSize.Height = 2 * mnRY;
+            maPosition.X = mnCX - mnRX;
+            maPosition.Y = mnCY - mnRY;
+        }
+
         // set pos, size, shear and rotate
         SetTransformation();
 
commit 14589274cd9999dd3f9ef844cc1aff20e106a977
Author: Armin Le Grand <alg at apache.org>
Date:   Mon Sep 24 15:25:25 2012 +0000

    #121090# corrceted point reduction on svg:d export to only happen when polygon is closed(cherry picked from commit 6e114c242bb21950fd8ea01885c2269744d0fc6f)

diff --git a/xmloff/source/draw/xexptran.cxx b/xmloff/source/draw/xexptran.cxx
index 2bed18d..61a0771 100644
--- a/xmloff/source/draw/xexptran.cxx
+++ b/xmloff/source/draw/xexptran.cxx
@@ -1581,7 +1581,9 @@ void SdXMLImExSvgDElement::AddPolygon(
         // Test for Last point same -> closed, ignore last point. Take
         // some more circumstances in account when looking at curve segments.
         drawing::PolygonFlags* pFlagArray = (pFlags) ? pFlags->getArray() : 0L;
-        if((pPointArray->X == (pPointArray + (nCnt - 1))->X) && (pPointArray->Y == (pPointArray + (nCnt - 1))->Y))
+
+        // #121090# only reduce double start/end points if polygon *is* closed
+        if(bClosed && (pPointArray->X == (pPointArray + (nCnt - 1))->X) && (pPointArray->Y == (pPointArray + (nCnt - 1))->Y))
         {
             if(pFlags)
             {
commit f9da1991ed0cf5936797d92f004462dbe93f1be7
Author: Armin Le Grand <alg at apache.org>
Date:   Mon Apr 8 11:46:32 2013 +0000

    i121965 Take draw:transform into account for draw:connector shapes
    
    (cherry picked from commit 7b3f5521bd3c400cd9e08b745176b4ce40885011)
    
    Conflicts:
    	xmloff/source/draw/ximpshap.cxx
    
    Change-Id: I973627f85ce6463c863863d6c180cb4c2cab86d0

diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx
index eb7171b..72f528b 100644
--- a/xmloff/source/draw/ximpshap.cxx
+++ b/xmloff/source/draw/ximpshap.cxx
@@ -78,7 +78,7 @@
 #include <com/sun/star/drawing/XEnhancedCustomShapeDefaulter.hpp>
 #include <com/sun/star/container/XChild.hpp>
 #include <com/sun/star/text/XTextDocument.hpp>
-
+#include <basegfx/point/b2dpoint.hxx>
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
@@ -1813,6 +1813,11 @@ void SdXMLConnectorShapeContext::processAttribute( sal_uInt16 nPrefix, const OUS
             SvXMLUnitConverter::convertEnum( mnType, rValue, aXML_ConnectionKind_EnumMap );
             return;
         }
+        // #121965# draw:transform may be used in ODF1.2, e.g. exports from MS seem to use these
+        else if( IsXMLToken( rLocalName, XML_TRANSFORM ) )
+        {
+            mnTransform.SetString(rValue, GetImport().GetMM100UnitConverter());
+        }
     }
     case XML_NAMESPACE_SVG:
     {
@@ -1903,6 +1908,29 @@ void SdXMLConnectorShapeContext::StartElement(const uno::Reference< xml::sax::XA
         AddShape("com.sun.star.drawing.ConnectorShape");
         if(mxShape.is())
         {
+            // #121965# if draw:transform is used, apply directly to the start
+            // and end positions before using these
+            if(mnTransform.NeedsAction())
+            {
+                // transformation is used, apply to object.
+                ::basegfx::B2DHomMatrix aMat;
+                mnTransform.GetFullTransform(aMat);
+
+                if(!aMat.isIdentity())
+                {
+                    basegfx::B2DPoint aStart(maStart.X, maStart.Y);
+                    basegfx::B2DPoint aEnd(maEnd.X, maEnd.Y);
+
+                    aStart = aMat * aStart;
+                    aEnd = aMat * aEnd;
+
+                    maStart.X = basegfx::fround(aStart.getX());
+                    maStart.Y = basegfx::fround(aStart.getY());
+                    maEnd.X = basegfx::fround(aEnd.getX());
+                    maEnd.Y = basegfx::fround(aEnd.getY());
+                }
+            }
+
             // add connection ids
             if( !maStartShapeId.isEmpty() )
                 GetImport().GetShapeImport()->addShapeConnection( mxShape, sal_True, maStartShapeId, mnStartGlueId );


More information about the Libreoffice-commits mailing list