oox/source/drawingml/customshapeproperties.cxx |    2 +
 sd/qa/unit/data/pptx/tdf128684.pptx            |binary
 sd/qa/unit/import-tests.cxx                    |   29 +++++++++++++++++++++++++
 3 files changed, 31 insertions(+)

New commits:
commit c2097477e3a43d75c170a6f7a5daf5dcb2169329
Author:     Tamas Bunth <tamas.bu...@collabora.co.uk>
AuthorDate: Thu Nov 14 00:56:08 2019 +0100
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Sun Nov 17 16:15:04 2019 +0100

    tdf128684: Rotate text in not preset custom shape
    
    The TextPreRotateAngle property should be set in case of a not preset
    custom shape as well during ooxml import.
    
    Also add unit test for testing the TextPreRotateAngle property.
    
    Change-Id: Ib5b822286f8a78fe8398bf7e2014a36d7e0a24d5
    Reviewed-on: https://gerrit.libreoffice.org/82643
    Tested-by: Jenkins
    Reviewed-by: Tamás Bunth <btom...@gmail.com>
    (cherry picked from commit 742f59eaa38a3f13b6110573b1428de45c55b035)
    Reviewed-on: https://gerrit.libreoffice.org/83020
    Reviewed-by: Andras Timar <andras.ti...@collabora.com>

diff --git a/oox/source/drawingml/customshapeproperties.cxx 
b/oox/source/drawingml/customshapeproperties.cxx
index df878d39eec3..2f4848088cc4 100644
--- a/oox/source/drawingml/customshapeproperties.cxx
+++ b/oox/source/drawingml/customshapeproperties.cxx
@@ -230,6 +230,8 @@ void CustomShapeProperties::pushToPropSet(
         aPropertyMap.setProperty( PROP_Type, OUString( "ooxml-non-primitive" 
));
         aPropertyMap.setProperty( PROP_MirroredX, mbMirroredX );
         aPropertyMap.setProperty( PROP_MirroredY, mbMirroredY );
+        if( mnTextRotateAngle )
+            aPropertyMap.setProperty( PROP_TextPreRotateAngle, 
mnTextRotateAngle );
         // Note 1: If Equations are defined - they are processed using 
internal div by 360 coordinates
         // while if they are not, standard ooxml coordinates are used.
         // This size specifically affects scaling.
diff --git a/sd/qa/unit/data/pptx/tdf128684.pptx 
b/sd/qa/unit/data/pptx/tdf128684.pptx
new file mode 100755
index 000000000000..80a5f30568d3
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf128684.pptx differ
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index 191592bbc592..3b50bce311ad 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -196,6 +196,7 @@ public:
     void testTdf77747();
     void testTdf116266();
     void testTdf126324();
+    void testTdf128684();
 
     bool checkPattern(sd::DrawDocShellRef const & rDocRef, int nShapeNumber, 
std::vector<sal_uInt8>& rExpected);
     void testPatternImport();
@@ -311,6 +312,7 @@ public:
     CPPUNIT_TEST(testCropToShape);
     CPPUNIT_TEST(testTdf127964);
     CPPUNIT_TEST(testTdf106638);
+    CPPUNIT_TEST(testTdf128684);
 
     CPPUNIT_TEST_SUITE_END();
 };
@@ -3006,6 +3008,33 @@ void SdImportTest::testTdf106638()
     CPPUNIT_ASSERT(aCharFontName != "Wingdings");
 }
 
+
+void SdImportTest::testTdf128684()
+{
+    sd::DrawDocShellRef xDocShRef
+        = 
loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/tdf128684.pptx"), 
PPTX);
+    uno::Reference<drawing::XDrawPagesSupplier> 
xDoc(xDocShRef->GetDoc()->getUnoModel(),
+                                                     uno::UNO_QUERY);
+    CPPUNIT_ASSERT(xDoc.is());
+    uno::Reference<drawing::XDrawPage> 
xPage(xDoc->getDrawPages()->getByIndex(0), uno::UNO_QUERY);
+    CPPUNIT_ASSERT(xPage.is());
+    uno::Reference<beans::XPropertySet> xShape(getShape(0, xPage));
+    CPPUNIT_ASSERT(xShape.is());
+    uno::Any aAny = xShape->getPropertyValue("CustomShapeGeometry");
+    CPPUNIT_ASSERT(aAny.hasValue());
+    uno::Sequence<beans::PropertyValue> aProps;
+    CPPUNIT_ASSERT(aAny >>= aProps);
+    sal_Int32 nRotateAngle = 0;
+    for( const auto& rProp : std::as_const(aProps) )
+    {
+        if( rProp.Name == "TextPreRotateAngle")
+        {
+            rProp.Value >>= nRotateAngle;
+        }
+    }
+    CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(-90), nRotateAngle);
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(SdImportTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to