[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - xmloff/source

Andras Timar andras.timar at collabora.com
Sun Jan 4 12:51:13 PST 2015


 xmloff/source/draw/ximpcustomshape.cxx |   43 ---------------------------------
 1 file changed, 1 insertion(+), 42 deletions(-)

New commits:
commit fc3bc11324f87d8254924c076d82c74b97520c68
Author: Andras Timar <andras.timar at collabora.com>
Date:   Sun Dec 28 16:55:16 2014 +0100

    Revert "Resolves: #i124452# correct svg:viewBox for EnhancedCustomShape..."
    
    This reverts commit c6e316f52021cc26d4c5ec9a7b87a07fbf595b62.
    The bug #i124452# was in AOO only, no need to fix it in LibreOffice.
    Especially when the "fix" causes regression. The related fdo#76334
    should be fixed one day, but that is a different issue.
    
    Conflicts:
    	xmloff/source/draw/ximpcustomshape.cxx
    
    Change-Id: Ice0bf378f97e2caf0ee8386d0b5c0b8abcbcd1c2
    (cherry picked from commit 4cd048d98ff258abc6ce036cb715d2c577128fb0)
    Reviewed-on: https://gerrit.libreoffice.org/13684
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/xmloff/source/draw/ximpcustomshape.cxx b/xmloff/source/draw/ximpcustomshape.cxx
index c3938c0..d1e0803 100644
--- a/xmloff/source/draw/ximpcustomshape.cxx
+++ b/xmloff/source/draw/ximpcustomshape.cxx
@@ -44,9 +44,7 @@
 #include <com/sun/star/drawing/EnhancedCustomShapeSegmentCommand.hpp>
 #include <com/sun/star/drawing/EnhancedCustomShapeTextPathMode.hpp>
 #include <com/sun/star/drawing/ProjectionMode.hpp>
-#include <com/sun/star/drawing/HomogenMatrix3.hpp>
 #include <boost/unordered_map.hpp>
-#include <basegfx/vector/b2dvector.hxx>
 #include <sax/tools/converter.hxx>
 
 using namespace ::com::sun::star;
@@ -919,46 +917,7 @@ void XMLEnhancedCustomShapeContext::StartElement( const uno::Reference< xml::sax
                 case EAS_viewBox :
                 {
                     SdXMLImExViewBox aViewBox( rValue, GetImport().GetMM100UnitConverter() );
-                    awt::Rectangle aRect(
-                        basegfx::fround(aViewBox.GetX()),
-                        basegfx::fround(aViewBox.GetY()),
-                        basegfx::fround(aViewBox.GetWidth()),
-                        basegfx::fround(aViewBox.GetHeight()));
-
-                    if(0 == aRect.Width && 0 == aRect.Height)
-                    {
-                        // #i124452# If in svg:viewBox no width and height is given the objects should normally
-                        // not be visible at all, but in this case it is a bug in LO to write empty svg:viewBox
-                        // entries for CustomShapes. To allow for a better ODF user experience, just correct this
-                        // here by getting the real object scale from the already set transformation from the xShape.
-                        // Hopefully LO will fix that bug (but this will still leave the files with the error), but
-                        // even when not this will do no harm as long no one uses this state explicitely for some
-                        // purpose (e.g. to really have CustomShapes without content, but unlikely).
-                        uno::Reference< beans::XPropertySet > xProps(mrxShape, uno::UNO_QUERY_THROW);
-                        uno::Any aObjectTransform = xProps->getPropertyValue(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Transformation")));
-                        drawing::HomogenMatrix3 aTransformMatrix;
-                        aObjectTransform >>= aTransformMatrix;
-                        basegfx::B2DHomMatrix aMatrix;
-
-                        aMatrix.set(0, 0, aTransformMatrix.Line1.Column1);
-                        aMatrix.set(0, 1, aTransformMatrix.Line1.Column2);
-                        aMatrix.set(0, 2, aTransformMatrix.Line1.Column3);
-                        aMatrix.set(1, 0, aTransformMatrix.Line2.Column1);
-                        aMatrix.set(1, 1, aTransformMatrix.Line2.Column2);
-                        aMatrix.set(1, 2, aTransformMatrix.Line2.Column3);
-                        aMatrix.set(2, 0, aTransformMatrix.Line3.Column1);
-                        aMatrix.set(2, 1, aTransformMatrix.Line3.Column2);
-                        aMatrix.set(2, 2, aTransformMatrix.Line3.Column3);
-
-                        basegfx::B2DVector aScale, aTranslate;
-                        double fRotate, fShearX;
-
-                        aMatrix.decompose(aScale, aTranslate, fRotate, fShearX);
-
-                        aRect.Width = basegfx::fround(fabs(aScale.getX()));
-                        aRect.Height = basegfx::fround(fabs(aScale.getY()));
-                    }
-
+                    awt::Rectangle aRect( aViewBox.GetX(), aViewBox.GetY(), aViewBox.GetWidth(), aViewBox.GetHeight() );
                     beans::PropertyValue aProp;
                     aProp.Name = EASGet( EAS_ViewBox );
                     aProp.Value <<= aRect;


More information about the Libreoffice-commits mailing list