summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2012-09-13 19:14:22 +0200
committerThorsten Behrens <tbehrens@suse.com>2012-09-14 14:23:57 +0000
commit003e8e887b79248a4775a97ecf02589de1b031a8 (patch)
treef3f117d7506ab2ea7c2aee12b64286c674a0b42e
parent5f9dae87f7cc6d287892b30cc5b89200f348ea77 (diff)
fdo#49678: ODF export: add svg:viewBox to draw:connector
This attribute is mandatory; for the given bugdoc various svg:viewBox="0 0 2500 1" are now written. Change-Id: I7ea2294e0796546dcbb245993c01c2dd2b2a755a (cherry picked from commit a2959aba6affa06dc0c6fb19d0c2b73958e6b221) Reviewed-on: https://gerrit.libreoffice.org/618 Reviewed-by: Thorsten Behrens <tbehrens@suse.com> Tested-by: Thorsten Behrens <tbehrens@suse.com>
-rw-r--r--xmloff/source/draw/shapeexport2.cxx18
1 files changed, 18 insertions, 0 deletions
diff --git a/xmloff/source/draw/shapeexport2.cxx b/xmloff/source/draw/shapeexport2.cxx
index 91c72c3f59eb..c492d90baf5d 100644
--- a/xmloff/source/draw/shapeexport2.cxx
+++ b/xmloff/source/draw/shapeexport2.cxx
@@ -1454,6 +1454,24 @@ void XMLShapeExport::ImpExportConnectorShape(
}
}
+ // get matrix
+ ::basegfx::B2DHomMatrix aMatrix;
+ ImpExportNewTrans_GetB2DHomMatrix(aMatrix, xProps);
+
+ // decompose and correct about pRefPoint
+ ::basegfx::B2DTuple aTRScale;
+ double fTRShear(0.0);
+ double fTRRotate(0.0);
+ ::basegfx::B2DTuple aTRTranslate;
+ ImpExportNewTrans_DecomposeAndRefPoint(aMatrix, aTRScale, fTRShear,
+ fTRRotate, aTRTranslate, pRefPoint);
+
+ // fdo#49678: create and export ViewBox
+ awt::Point aPoint(0, 0);
+ awt::Size aSize(FRound(aTRScale.getX()), FRound(aTRScale.getY()));
+ SdXMLImExViewBox aViewBox(0, 0, aSize.Width, aSize.Height);
+ mrExport.AddAttribute(XML_NAMESPACE_SVG, XML_VIEWBOX, aViewBox.GetExportString());
+
// write connector shape. Add Export later.
sal_Bool bCreateNewline( (nFeatures & SEF_EXPORT_NO_WS) == 0 ); // #86116#/#92210#
SvXMLElementExport aOBJ(mrExport, XML_NAMESPACE_DRAW, XML_CONNECTOR, bCreateNewline, sal_True);