oox/source/drawingml/shape.cxx      |    2 +-
 sd/qa/unit/data/pptx/tdf113198.pptx |binary
 sd/qa/unit/import-tests.cxx         |   16 ++++++++++++++--
 3 files changed, 15 insertions(+), 3 deletions(-)

New commits:
commit baac2e608dd0781cdce0e038b2a2d80537b77974
Author:     Tamas Bunth <tamas.bu...@collabora.co.uk>
AuthorDate: Tue Nov 19 12:38:56 2019 +0100
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Fri Nov 29 10:51:32 2019 +0100

    tdf#113198 set default shape paragraph alignment..
    
    to center when importing oox document.
    
    Using MS Office, the default aligment of a (text) paragraph
    inside a shape is centered.
    
    Reviewed-on: https://gerrit.libreoffice.org/83193
    Tested-by: Jenkins
    Reviewed-by: Tamás Bunth <btom...@gmail.com>
    (cherry picked from commit 89f0af144c18efafe2573801641689a1432c0cae)
    Reviewed-on: https://gerrit.libreoffice.org/83971
    Reviewed-by: Xisco Faulí <xiscofa...@libreoffice.org>
    Signed-off-by: Xisco Fauli <xiscofa...@libreoffice.org>
    
    Change-Id: Id9bcaaab109df65f4124f733b2cfee438e82b79b
    Reviewed-on: https://gerrit.libreoffice.org/83988
    Tested-by: Jenkins
    Reviewed-by: Xisco Faulí <xiscofa...@libreoffice.org>
    Reviewed-on: https://gerrit.libreoffice.org/84038
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Andras Timar <andras.ti...@collabora.com>

diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index 93619d0e7642..baf9b66a996e 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -206,7 +206,7 @@ void Shape::setDefaults(bool bHeight)
     if (bHeight)
         maDefaultShapeProperties.setProperty(PROP_CharHeight, static_cast< 
float >( 18.0 ));
     maDefaultShapeProperties.setProperty(PROP_TextVerticalAdjust, 
TextVerticalAdjust_TOP);
-    maDefaultShapeProperties.setProperty(PROP_ParaAdjust, static_cast< 
sal_Int16 >( ParagraphAdjust_LEFT )); // check for RTL?
+    maDefaultShapeProperties.setProperty(PROP_ParaAdjust, static_cast< 
sal_Int16 >( ParagraphAdjust_CENTER ));
 }
 
 ::oox::vml::OleObjectInfo& Shape::setOleObjectType()
diff --git a/sd/qa/unit/data/pptx/tdf113198.pptx 
b/sd/qa/unit/data/pptx/tdf113198.pptx
new file mode 100755
index 000000000000..a541a2b2647d
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf113198.pptx differ
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index b38d5e51d0c9..c525444c5b26 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -186,7 +186,6 @@ public:
     void testTdf77747();
     void testTdf116266();
     void testTdf126324();
-    void testTdf128684();
 
     bool checkPattern(sd::DrawDocShellRef const & rDocRef, int nShapeNumber, 
std::vector<sal_uInt8>& rExpected);
     void testPatternImport();
@@ -196,6 +195,8 @@ public:
     void testTdf120028();
     void testTdf120028b();
     void testCropToShape();
+    void testTdf128684();
+    void testTdf113198();
 
     CPPUNIT_TEST_SUITE(SdImportTest);
 
@@ -284,6 +285,7 @@ public:
     CPPUNIT_TEST(testTdf120028b);
     CPPUNIT_TEST(testCropToShape);
     CPPUNIT_TEST(testTdf128684);
+    CPPUNIT_TEST(testTdf113198);
 
     CPPUNIT_TEST_SUITE_END();
 };
@@ -2694,7 +2696,6 @@ void SdImportTest::testCropToShape()
     CPPUNIT_ASSERT_EQUAL(css::drawing::BitmapMode_STRETCH, bitmapmode);
 }
 
-
 void SdImportTest::testTdf128684()
 {
     sd::DrawDocShellRef xDocShRef
@@ -2722,6 +2723,17 @@ void SdImportTest::testTdf128684()
     CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(-90), nRotateAngle);
 }
 
+void SdImportTest::testTdf113198()
+{
+    sd::DrawDocShellRef xDocShRef
+        = 
loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf113198.pptx"), 
PPTX);
+
+    uno::Reference<beans::XPropertySet> xShape(getShapeFromPage(0, 0, 
xDocShRef));
+    sal_Int16 nParaAdjust = -1;
+    xShape->getPropertyValue("ParaAdjust") >>= nParaAdjust;
+    CPPUNIT_ASSERT_EQUAL(style::ParagraphAdjust_CENTER, 
static_cast<style::ParagraphAdjust>(nParaAdjust));
+}
+
 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