diff options
author | Regina Henschel <rb.henschel@t-online.de> | 2022-06-15 13:15:15 +0200 |
---|---|---|
committer | Regina Henschel <rb.henschel@t-online.de> | 2022-06-16 00:57:51 +0200 |
commit | aca189d118d4351b293c089cb26584eb898e1849 (patch) | |
tree | ca05db5f69959247d4e7d92dfda7d4f8b91fa232 /xmloff/source | |
parent | 513ae848b668647093ae4161718b2585d80fdb7a (diff) |
tdf#149551 write draw:text-rotate-angle only once
The attributes 'vert' and 'vert270' set property TextPreRotateAngle on
import from OOXML. The property TextRotateAngle can be set by macro.
Both were written to file as 'draw:text-rotate-angle' attribute. So we
got a file format error 'duplicate attribute'.
The values are now added and the sum is written. That gives the same
rendering as after applying a macro. Using the sum is a workaround. We
have currently no way to save the direction specified by 'vert' and
'vert270' as style:writing-mode to ODF.
Change-Id: I93fd8ca42b82c1ed7f1bf6e33d932e5510615b2f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135901
Tested-by: Jenkins
Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
Diffstat (limited to 'xmloff/source')
-rw-r--r-- | xmloff/source/draw/shapeexport.cxx | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx index 89eceb95982c..ebe9f7b4a71d 100644 --- a/xmloff/source/draw/shapeexport.cxx +++ b/xmloff/source/draw/shapeexport.cxx @@ -4226,6 +4226,7 @@ static void ImpExportEnhancedGeometry( SvXMLExport& rExport, const uno::Referenc OUString aStr; OUStringBuffer aStrBuffer; + double fTextRotateAngle(0.0); // sum TextRotateAngle and TextPreRotateAngle SvXMLUnitConverter& rUnitConverter = rExport.GetMM100UnitConverter(); uno::Reference< beans::XPropertySetInfo > xPropSetInfo( xPropSet->getPropertySetInfo() ); @@ -4280,14 +4281,9 @@ static void ImpExportEnhancedGeometry( SvXMLExport& rExport, const uno::Referenc case EAS_TextPreRotateAngle : case EAS_TextRotateAngle : { - double fTextRotateAngle = 0; - if ( ( rGeoProp.Value >>= fTextRotateAngle ) && fTextRotateAngle != 0 ) - { - ::sax::Converter::convertDouble( - aStrBuffer, fTextRotateAngle ); - aStr = aStrBuffer.makeStringAndClear(); - rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_TEXT_ROTATE_ANGLE, aStr ); - } + double fAngle = 0.0; + rGeoProp.Value >>= fAngle; + fTextRotateAngle += fAngle; } break; case EAS_Extrusion : @@ -4864,6 +4860,12 @@ static void ImpExportEnhancedGeometry( SvXMLExport& rExport, const uno::Referenc break; } } // for + if (fTextRotateAngle != 0) + { + ::sax::Converter::convertDouble( aStrBuffer, fTextRotateAngle ); + aStr = aStrBuffer.makeStringAndClear(); + rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_TEXT_ROTATE_ANGLE, aStr ); + } rExport.AddAttribute( XML_NAMESPACE_DRAW, XML_TYPE, aCustomShapeType ); // adjustments |