[Libreoffice-commits] .: filter/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Mon Dec 3 08:58:29 PST 2012
filter/source/svg/svgwriter.cxx | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
New commits:
commit b49ea0c9d24aa48d62590cb3443c3ad4143d2e2f
Author: Horacio Fernandes <horacio.fernandes at gmail.com>
Date: Sun Dec 2 17:52:26 2012 -0400
fdo#57215: Fixed wrong text rotation in SVG Export
Added text rotation to "non-positioned characters" in SVG Export.
Change-Id: I831644329625fa74e5a2436096d26ec22d8b0319
Reviewed-on: https://gerrit.libreoffice.org/1227
Reviewed-by: Petr Mladek <pmladek at suse.cz>
Tested-by: Petr Mladek <pmladek at suse.cz>
diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx
index b9e556d..2f269ba 100644
--- a/filter/source/svg/svgwriter.cxx
+++ b/filter/source/svg/svgwriter.cxx
@@ -1520,6 +1520,27 @@ void SVGTextWriter::startTextPosition( sal_Bool bExportX, sal_Bool bExportY )
mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrX, ::rtl::OUString::valueOf( maTextPos.X() ) );
if( bExportY )
mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrY, ::rtl::OUString::valueOf( maTextPos.Y() ) );
+
+ // if text is rotated, set transform matrix at new tspan element
+ const Font& rFont = mpVDev->GetFont();
+ if( rFont.GetOrientation() )
+ {
+ Point aRot( maTextPos );
+ OUString aTransform( "translate(" );
+ aTransform += OUString::valueOf( aRot.X() ) + ",";
+ aTransform += OUString::valueOf( aRot.Y() ) + ")";
+
+ aTransform += " rotate(";
+ aTransform += OUString::valueOf( rFont.GetOrientation() * -0.1 );
+ aTransform += ")";
+
+ aTransform += " translate(";
+ aTransform += OUString::valueOf( -aRot.X() ) + ",";
+ aTransform += OUString::valueOf( -aRot.Y() ) + ")";
+
+ mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrTransform, aTransform );
+ }
+
mpTextPositionElem = new SvXMLElementExport( mrExport, XML_NAMESPACE_NONE, aXMLElemTspan, mbIWS, mbIWS );
}
More information about the Libreoffice-commits
mailing list