summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChr. Rossmanith <ChrRossmanith@gmx.de>2015-02-03 22:29:31 +0100
committerDavid Tardon <dtardon@redhat.com>2015-06-01 07:09:05 +0000
commitcefea9d05085bfc0e485fae5d927544a9e07739c (patch)
treee74af2f3e005da47315a4ed5c0baffd81712c2cc
parent1248240d2d0d70adc9609dfd8ff4565d845ffbaa (diff)
tdf#65788: svg export - put transform attribute into text element
if transform is put into an inner tspan element rotated text isn't rendered rotated Reviewed-on: https://gerrit.libreoffice.org/14314 Reviewed-by: Katarina Behrens <bubli@bubli.org> Tested-by: Katarina Behrens <bubli@bubli.org> (cherry picked from commit cacc3a0e7f7b04240daf63b45e457428388f4929) Change-Id: I6fcab1db0e213c65fe8ba88a7694fd10c902bfec Reviewed-on: https://gerrit.libreoffice.org/15994 Tested-by: David Tardon <dtardon@redhat.com> Reviewed-by: David Tardon <dtardon@redhat.com>
-rw-r--r--filter/source/svg/svgwriter.cxx31
1 files changed, 16 insertions, 15 deletions
diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx
index 89ae3e39514f..a63210d7077c 100644
--- a/filter/source/svg/svgwriter.cxx
+++ b/filter/source/svg/svgwriter.cxx
@@ -1157,6 +1157,22 @@ void SVGTextWriter::startTextShape()
mbIsTextShapeStarted = true;
maParentFont = vcl::Font();
mrExport.AddAttribute( XML_NAMESPACE_NONE, "class", "TextShape" );
+
+ // if text is rotated, set transform matrix at text element
+ const vcl::Font& rFont = mpVDev->GetFont();
+ if( rFont.GetOrientation() )
+ {
+ Point aRot( maTextPos );
+ OUString aTransform =
+ "translate(" + OUString::number( aRot.X() ) +
+ "," + OUString::number( aRot.Y() ) + ") rotate(" +
+ OUString::number( rFont.GetOrientation() * -0.1 ) +
+ ") translate(" + OUString::number( -aRot.X() ) +
+ "," + OUString::number( -aRot.Y() ) + ")";
+
+ mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrTransform, aTransform );
+ }
+
mpTextShapeElem = new SvXMLElementExport( mrExport, XML_NAMESPACE_NONE, aXMLElemText, true, mbIWS );
startTextParagraph();
}
@@ -1245,21 +1261,6 @@ void SVGTextWriter::startTextPosition( bool bExportX, bool bExportY )
if( bExportY )
mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrY, OUString::number( maTextPos.Y() ) );
- // if text is rotated, set transform matrix at new tspan element
- const vcl::Font& rFont = mpVDev->GetFont();
- if( rFont.GetOrientation() )
- {
- Point aRot( maTextPos );
- OUString aTransform =
- OUString("translate(") + OUString::number( aRot.X() ) +
- "," + OUString::number( aRot.Y() ) + ") rotate(" +
- OUString::number( rFont.GetOrientation() * -0.1 ) +
- ") translate(" + OUString::number( -aRot.X() ) +
- "," + OUString::number( -aRot.Y() ) + ")";
-
- mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrTransform, aTransform );
- }
-
mpTextPositionElem = new SvXMLElementExport( mrExport, XML_NAMESPACE_NONE, aXMLElemTspan, mbIWS, mbIWS );
}