diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2018-08-07 10:44:21 +0200 |
---|---|---|
committer | Szymon Kłos <szymon.klos@collabora.com> | 2018-08-08 15:58:24 +0200 |
commit | e1d6ed941590a771abfc73f9eef4a98346eca762 (patch) | |
tree | 96263e1ce3bb87f653abd3fb68c269cfbd8ad219 /sd/qa | |
parent | 63c91b9cb3f73b66a915875721b0efd65b8aebac (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>
Diffstat (limited to 'sd/qa')
-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 06a4c343b28e..fe2be051603e 100644 --- a/sd/qa/unit/export-tests-ooxml2.cxx +++ b/sd/qa/unit/export-tests-ooxml2.cxx @@ -1816,6 +1816,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 ); @@ -1825,16 +1858,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 ); |