diff options
author | Gülşah Köse <gulsah.kose@collabora.com> | 2019-11-27 13:35:29 +0300 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2019-11-29 11:38:58 +0100 |
commit | cbc9190fd61c5e4ac88d92ebe1af64eff907d7d5 (patch) | |
tree | c8c8c306735c2b00c7206a32d183f48a936934db | |
parent | baac2e608dd0781cdce0e038b2a2d80537b77974 (diff) |
tdf#127090 Export textbox rotation attribute.
In case "rotated textbox in a custom shape" handle
draw:text-rotate-angle attribute while exporting
ODP to PPTX.
Change-Id: I13b99da586af5e77e51a7cc93a751ab21bed7170
Reviewed-on: https://gerrit.libreoffice.org/83888
Tested-by: Jenkins
Reviewed-by: Gülşah Köse <gulsah.kose@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/84037
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Andras Timar <andras.timar@collabora.com>
-rw-r--r-- | oox/source/export/drawingml.cxx | 14 | ||||
-rw-r--r-- | sd/qa/unit/data/pptx/tdf127090.odp | bin | 0 -> 12415 bytes | |||
-rw-r--r-- | sd/qa/unit/export-tests-ooxml1.cxx | 14 |
3 files changed, 22 insertions, 6 deletions
diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index 9ac4fd744963..bc6b7db45a44 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -2537,7 +2537,8 @@ void DrawingML::WriteText( const Reference< XInterface >& rXIface, const OUStrin if( !xXText.is() ) return; - sal_Int32 nTextRotateAngle = 0; + sal_Int32 nTextPreRotateAngle = 0; + double nTextRotateAngle = 0; #define DEFLRINS 254 #define DEFTBINS 127 @@ -2578,20 +2579,21 @@ void DrawingML::WriteText( const Reference< XInterface >& rXIface, const OUStrin { for ( sal_Int32 i = 0, nElems = aProps.getLength(); i < nElems; ++i ) { - if ( aProps[ i ].Name == "TextPreRotateAngle" && ( aProps[ i ].Value >>= nTextRotateAngle ) ) + if ( aProps[ i ].Name == "TextPreRotateAngle" && ( aProps[ i ].Value >>= nTextPreRotateAngle ) ) { - if ( nTextRotateAngle == -90 ) + if ( nTextPreRotateAngle == -90 ) { sWritingMode = "vert"; bVertical = true; } - else if ( nTextRotateAngle == -270 ) + else if ( nTextPreRotateAngle == -270 ) { sWritingMode = "vert270"; bVertical = true; } - break; } + else if ( aProps[ i ].Name == "TextRotateAngle" ) + aProps[ i ].Value >>= nTextRotateAngle; } } } @@ -2634,7 +2636,7 @@ void DrawingML::WriteText( const Reference< XInterface >& rXIface, const OUStrin XML_anchor, sVerticalAlignment, XML_anchorCtr, bHorizontalCenter ? "1" : nullptr, XML_vert, sWritingMode, - XML_rot, (nTextRotateAngle != 0) ? oox::drawingml::calcRotationValue( nTextRotateAngle * 100 ).getStr() : nullptr, + XML_rot, ((nTextPreRotateAngle + nTextRotateAngle) != 0) ? oox::drawingml::calcRotationValue( (nTextPreRotateAngle + nTextRotateAngle) * 100 ).getStr() : nullptr, FSEND ); if( !presetWarp.isEmpty()) { diff --git a/sd/qa/unit/data/pptx/tdf127090.odp b/sd/qa/unit/data/pptx/tdf127090.odp Binary files differnew file mode 100644 index 000000000000..bbdc7995853f --- /dev/null +++ b/sd/qa/unit/data/pptx/tdf127090.odp diff --git a/sd/qa/unit/export-tests-ooxml1.cxx b/sd/qa/unit/export-tests-ooxml1.cxx index 59795b9f3c22..bf35a56dcb52 100644 --- a/sd/qa/unit/export-tests-ooxml1.cxx +++ b/sd/qa/unit/export-tests-ooxml1.cxx @@ -101,6 +101,7 @@ public: void testTdf111884(); void testTdf112633(); void testTdf128952(); + void testTdf127090(); void testCustomXml(); void testPictureTransparency(); void testTdf94238(); @@ -134,6 +135,7 @@ public: CPPUNIT_TEST(testTdf111884); CPPUNIT_TEST(testTdf112633); CPPUNIT_TEST(testTdf128952); + CPPUNIT_TEST(testTdf127090); CPPUNIT_TEST(testCustomXml); CPPUNIT_TEST(testPictureTransparency); CPPUNIT_TEST(testTdf94238); @@ -853,6 +855,18 @@ void SdOOXMLExportTest1::testTdf128952() assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:xfrm/a:ext", "cy", "1462680"); } +void SdOOXMLExportTest1::testTdf127090() +{ + ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf127090.odp"), ODP); + utl::TempFile tempFile; + xDocShRef = saveAndReload(xDocShRef.get(), PPTX, &tempFile); + xDocShRef->DoClose(); + + xmlDocPtr pXmlDoc = parseExport(tempFile, "ppt/slides/slide1.xml"); + + assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp/p:txBody/a:bodyPr", "rot", "-5400000"); +} + void SdOOXMLExportTest1::testCustomXml() { // Load document and export it to a temporary file |