[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - oox/source sd/qa

Gülşah Köse (via logerrit) logerrit at kemper.freedesktop.org
Fri Nov 22 22:19:08 UTC 2019


 oox/source/export/drawingml.cxx     |    2 +-
 sd/qa/unit/data/pptx/tdf128952.pptx |binary
 sd/qa/unit/export-tests-ooxml1.cxx  |   17 +++++++++++++++++
 3 files changed, 18 insertions(+), 1 deletion(-)

New commits:
commit fe9545f05a5d5ad871564a24a395d9893fe00da4
Author:     Gülşah Köse <gulsah.kose at collabora.com>
AuthorDate: Fri Nov 22 14:05:24 2019 +0300
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Fri Nov 22 23:18:22 2019 +0100

    tdf#128952 Set the position of shape for 180 deg.
    
    If the rotation value is 180, 540, 900... degree with mirror
    pShape->GetRotateAngle() returns 0. In that control 0 means
    no rotation but that is not true. For that cases (180, 540, 900)
    after the angle conversition GetRotateAngle() returns 0. We should
    recalculate the position for 0 too.
    
    Change-Id: I14e981235b2d6cd8382d4c9e151bccd2e73a3fd9
    Reviewed-on: https://gerrit.libreoffice.org/83468
    Tested-by: Jenkins
    Reviewed-by: Gülşah Köse <gulsah.kose at collabora.com>
    (cherry picked from commit aca2e4d270f472b2cbdb9084a55f1855529ea705)
    Reviewed-on: https://gerrit.libreoffice.org/83536
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Andras Timar <andras.timar at collabora.com>

diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index 7962c41f6406..9ac4fd744963 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -1576,7 +1576,7 @@ void DrawingML::WriteShapeTransformation( const Reference< XShape >& rXShape, sa
     {
         SdrObject* pShape = GetSdrObjectFromXShape( rXShape );
         nRotation = pShape ? pShape->GetRotateAngle() : 0;
-        if ( nRotation != 0 && GetDocumentType() != DOCUMENT_DOCX )
+        if ( GetDocumentType() != DOCUMENT_DOCX )
         {
             int faccos=bFlipV ? -1 : 1;
             int facsin=bFlipH ? -1 : 1;
diff --git a/sd/qa/unit/data/pptx/tdf128952.pptx b/sd/qa/unit/data/pptx/tdf128952.pptx
new file mode 100644
index 000000000000..242a3ee9ace5
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf128952.pptx differ
diff --git a/sd/qa/unit/export-tests-ooxml1.cxx b/sd/qa/unit/export-tests-ooxml1.cxx
index 601497cee2b3..59795b9f3c22 100644
--- a/sd/qa/unit/export-tests-ooxml1.cxx
+++ b/sd/qa/unit/export-tests-ooxml1.cxx
@@ -100,6 +100,7 @@ public:
     void testParaMarginAndindentation();
     void testTdf111884();
     void testTdf112633();
+    void testTdf128952();
     void testCustomXml();
     void testPictureTransparency();
     void testTdf94238();
@@ -132,6 +133,7 @@ public:
     CPPUNIT_TEST(testParaMarginAndindentation);
     CPPUNIT_TEST(testTdf111884);
     CPPUNIT_TEST(testTdf112633);
+    CPPUNIT_TEST(testTdf128952);
     CPPUNIT_TEST(testCustomXml);
     CPPUNIT_TEST(testPictureTransparency);
     CPPUNIT_TEST(testTdf94238);
@@ -836,6 +838,21 @@ void SdOOXMLExportTest1::testTdf112633()
     CPPUNIT_ASSERT_EQUAL(true, bool(xNameAccess->hasByName("ppt/media/hdphoto1.wdp")));
 }
 
+void SdOOXMLExportTest1::testTdf128952()
+{
+    ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf128952.pptx"), PPTX);
+    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:spPr/a:xfrm/a:off", "x", "360");
+    assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:xfrm/a:off", "y", "-360");
+    assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:xfrm/a:ext", "cx", "1919880");
+    assertXPath(pXmlDoc, "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:xfrm/a:ext", "cy", "1462680");
+}
+
 void SdOOXMLExportTest1::testCustomXml()
 {
     // Load document and export it to a temporary file


More information about the Libreoffice-commits mailing list