diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2018-08-07 10:44:21 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2018-08-20 10:14:41 +0200 |
commit | 40b396ef207213ebd07981206674a2260256cb3c (patch) | |
tree | aed1e5334a28cfa67dbe709fd4ac4ad8edb2f358 /sd | |
parent | 406280c62843e9ed167e7adaa005fba92a39608f (diff) |
tdf#116350 Correctly display text on arc
Change-Id: Ice8c141db20d43ccc8d6e2b56004a4a28d2b257a
Reviewed-on: https://gerrit.libreoffice.org/58729
Tested-by: Jenkins
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/58840
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/qa/unit/export-tests-ooxml2.cxx | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx index 1f246fec7a90..80cd202c533c 100644 --- a/sd/qa/unit/export-tests-ooxml2.cxx +++ b/sd/qa/unit/export-tests-ooxml2.cxx @@ -1717,6 +1717,39 @@ static inline double getAdjustmentValue( uno::Reference<beans::XPropertySet>& xS return -1.0; } +static inline bool getScaleXValue(uno::Reference<beans::XPropertySet>& xSet) +{ + bool bScaleX = false; + + auto aGeomPropSeq = xSet->getPropertyValue("CustomShapeGeometry") + .get<uno::Sequence<beans::PropertyValue>>(); + auto aGeomPropVec + = comphelper::sequenceToContainer<std::vector<beans::PropertyValue>>( + aGeomPropSeq); + + const OUString sName = "TextPath"; + auto aIterator = std::find_if( + aGeomPropVec.begin(), aGeomPropVec.end(), + [sName](const beans::PropertyValue& rValue) { return rValue.Name == sName; }); + + if (aIterator != aGeomPropVec.end()) + { + uno::Sequence<beans::PropertyValue> aTextPathProperties; + aIterator->Value >>= aTextPathProperties; + const OUString sScaleX = "ScaleX"; + auto aIterator2 = std::find_if( + aTextPathProperties.begin(), aTextPathProperties.end(), + [sScaleX](const beans::PropertyValue& rValue) { return rValue.Name == sScaleX; }); + + if (aIterator2 != aTextPathProperties.end()) + { + aIterator2->Value >>= bScaleX; + } + } + + return bScaleX; +} + void SdOOXMLExportTest2::testTdf116350TextEffects() { ::sd::DrawDocShellRef xDocShRef = loadURL( m_directories.getURLFromSrc( "sd/qa/unit/data/pptx/tdf116350-texteffects.pptx" ), PPTX ); @@ -1726,16 +1759,25 @@ void SdOOXMLExportTest2::testTdf116350TextEffects() double fAdjust = getAdjustmentValue( xShape0 ); CPPUNIT_ASSERT_EQUAL( 180.0, fAdjust ); + bool bScaleX = getScaleXValue( xShape0 ); + CPPUNIT_ASSERT_EQUAL( true, bScaleX ); + // Default angle for ArchDown uno::Reference<beans::XPropertySet> xShape14( getShapeFromPage( 14, 0, xDocShRef ) ); fAdjust = getAdjustmentValue( xShape14 ); CPPUNIT_ASSERT_EQUAL( 0.0, fAdjust ); + bScaleX = getScaleXValue( xShape14 ); + CPPUNIT_ASSERT_EQUAL( true, bScaleX ); + // Angle directly set uno::Reference<beans::XPropertySet> xShape1( getShapeFromPage( 1, 0, xDocShRef ) ); fAdjust = getAdjustmentValue( xShape1 ); CPPUNIT_ASSERT_EQUAL( 213.25, fAdjust ); + bScaleX = getScaleXValue( xShape1 ); + CPPUNIT_ASSERT_EQUAL( true, bScaleX ); + // Export utl::TempFile tempFile; xDocShRef = saveAndReload( xDocShRef.get(), PPTX, &tempFile ); |