summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2018-08-07 10:44:21 +0200
committerAndras Timar <andras.timar@collabora.com>2018-08-10 10:21:06 +0200
commit2b05c8c3a89357eee6fe5a4868292eb4621a9634 (patch)
tree0ff00a5394554a08a1acf0b0f7043b4f2f8f30cd /sd
parentbe177d6974e651ec28dab3dddb1fa6e1d7aee736 (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')
-rw-r--r--sd/qa/unit/export-tests-ooxml2.cxx42
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 b68c4f516180..c40ce25e5ed6 100644
--- a/sd/qa/unit/export-tests-ooxml2.cxx
+++ b/sd/qa/unit/export-tests-ooxml2.cxx
@@ -1597,6 +1597,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 );
@@ -1606,16 +1639,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 );