[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - sd/qa xmloff/inc xmloff/source

Szymon Kłos szymon.klos at collabora.com
Tue Oct 31 07:54:44 UTC 2017


 sd/qa/unit/data/pptx/shape-text-rotate.pptx     |binary
 sd/qa/unit/export-tests.cxx                     |   24 ++++++++++++++++++++++++
 xmloff/inc/EnhancedCustomShapeToken.hxx         |    1 +
 xmloff/source/draw/EnhancedCustomShapeToken.cxx |    1 +
 xmloff/source/draw/shapeexport.cxx              |    3 ++-
 5 files changed, 28 insertions(+), 1 deletion(-)

New commits:
commit e7a0948db44f049b1cf03a6e6fcaca7e63e88ac2
Author: Szymon Kłos <szymon.klos at collabora.com>
Date:   Thu Oct 26 10:33:45 2017 +0200

    ODP: export TextPreRotateAngle
    
    Change-Id: I13eb005195ebbdee5016bf279cba423e388723a0
    Reviewed-on: https://gerrit.libreoffice.org/43910
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
    Tested-by: Szymon Kłos <szymon.klos at collabora.com>
    Reviewed-on: https://gerrit.libreoffice.org/44079
    Reviewed-by: Andras Timar <andras.timar at collabora.com>
    Tested-by: Andras Timar <andras.timar at collabora.com>

diff --git a/sd/qa/unit/data/pptx/shape-text-rotate.pptx b/sd/qa/unit/data/pptx/shape-text-rotate.pptx
new file mode 100755
index 000000000000..4a433c748d32
Binary files /dev/null and b/sd/qa/unit/data/pptx/shape-text-rotate.pptx differ
diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx
index 6bbb2a53648b..f7240647814d 100644
--- a/sd/qa/unit/export-tests.cxx
+++ b/sd/qa/unit/export-tests.cxx
@@ -93,6 +93,7 @@ public:
     void testTdf62176();
     void testTransparentBackground();
     void testEmbeddedPdf();
+    void testTextRotation();
 
     CPPUNIT_TEST_SUITE(SdExportTest);
 
@@ -108,6 +109,7 @@ public:
     CPPUNIT_TEST(testTdf62176);
     CPPUNIT_TEST(testTransparentBackground);
     CPPUNIT_TEST(testEmbeddedPdf);
+    CPPUNIT_TEST(testTextRotation);
 
     CPPUNIT_TEST_SUITE_END();
 
@@ -653,6 +655,28 @@ void SdExportTest::testEmbeddedPdf()
 #endif
 }
 
+void SdExportTest::testTextRotation()
+{
+    ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/shape-text-rotate.pptx"), PPTX);
+    utl::TempFile tempFile;
+    xDocShRef = saveAndReload(xDocShRef.get(), ODP, &tempFile);
+
+    uno::Reference<drawing::XDrawPage> xPage(getPage(0, xDocShRef));
+    uno::Reference<beans::XPropertySet> xPropSet(getShape(0, xPage));
+
+    CPPUNIT_ASSERT(xPropSet.is());
+
+    auto aGeomPropSeq = xPropSet->getPropertyValue("CustomShapeGeometry").get<uno::Sequence<beans::PropertyValue>>();
+    comphelper::SequenceAsHashMap aCustomShapeGeometry(aGeomPropSeq);
+
+    auto it = aCustomShapeGeometry.find("TextRotateAngle");
+    CPPUNIT_ASSERT(it != aCustomShapeGeometry.end());
+
+    CPPUNIT_ASSERT_EQUAL((double)(-90), aCustomShapeGeometry["TextRotateAngle"].get<double>());
+
+    xDocShRef->DoClose();
+}
+
 CPPUNIT_TEST_SUITE_REGISTRATION(SdExportTest);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/xmloff/inc/EnhancedCustomShapeToken.hxx b/xmloff/inc/EnhancedCustomShapeToken.hxx
index dafe8b8ec8ec..92e200333dbc 100644
--- a/xmloff/inc/EnhancedCustomShapeToken.hxx
+++ b/xmloff/inc/EnhancedCustomShapeToken.hxx
@@ -93,6 +93,7 @@ namespace xmloff { namespace EnhancedCustomShapeToken {
         EAS_MirroredY,
         EAS_ViewBox,
         EAS_TextRotateAngle,
+        EAS_TextPreRotateAngle,
         EAS_ExtrusionAllowed,
         EAS_ConcentricGradientFillAllowed,
         EAS_TextPathAllowed,
diff --git a/xmloff/source/draw/EnhancedCustomShapeToken.cxx b/xmloff/source/draw/EnhancedCustomShapeToken.cxx
index 076ae2728fbd..9e6c25b49e4d 100644
--- a/xmloff/source/draw/EnhancedCustomShapeToken.cxx
+++ b/xmloff/source/draw/EnhancedCustomShapeToken.cxx
@@ -108,6 +108,7 @@ static const TokenTable pTokenTableArray[] =
     { "MirroredY",                          EAS_MirroredY },
     { "ViewBox",                            EAS_ViewBox },
     { "TextRotateAngle",                    EAS_TextRotateAngle },
+    { "TextPreRotateAngle",                 EAS_TextPreRotateAngle },
     { "ExtrusionAllowed",                   EAS_ExtrusionAllowed },
     { "TextPathAllowed",                    EAS_TextPathAllowed },
     { "ConcentricGradientFillAllowed",      EAS_ConcentricGradientFillAllowed },
diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx
index e4ec98689841..34786ce43d31 100644
--- a/xmloff/source/draw/shapeexport.cxx
+++ b/xmloff/source/draw/shapeexport.cxx
@@ -4268,10 +4268,11 @@ void ImpExportEnhancedGeometry( SvXMLExport& rExport, const uno::Reference< bean
                         }
                     }
                     break;
+                    case EAS_TextPreRotateAngle :
                     case EAS_TextRotateAngle :
                     {
                         double fTextRotateAngle = 0;
-                        if ( rGeoProp.Value >>= fTextRotateAngle )
+                        if ( ( rGeoProp.Value >>= fTextRotateAngle ) && fTextRotateAngle != 0 )
                         {
                             ::sax::Converter::convertDouble(
                                     aStrBuffer, fTextRotateAngle );


More information about the Libreoffice-commits mailing list