diff options
Diffstat (limited to 'sd')
-rwxr-xr-x | sd/qa/unit/data/odp/preset-shapes-export.odp | bin | 0 -> 21208 bytes | |||
-rw-r--r-- | sd/qa/unit/export-tests-ooxml2.cxx | 81 |
2 files changed, 81 insertions, 0 deletions
diff --git a/sd/qa/unit/data/odp/preset-shapes-export.odp b/sd/qa/unit/data/odp/preset-shapes-export.odp Binary files differnew file mode 100755 index 000000000000..30668535be70 --- /dev/null +++ b/sd/qa/unit/data/odp/preset-shapes-export.odp diff --git a/sd/qa/unit/export-tests-ooxml2.cxx b/sd/qa/unit/export-tests-ooxml2.cxx index 78050171a8fd..fdf5d0453460 100644 --- a/sd/qa/unit/export-tests-ooxml2.cxx +++ b/sd/qa/unit/export-tests-ooxml2.cxx @@ -90,6 +90,7 @@ public: void testMathObjectPPT2010(); void testTdf80224(); void testExportTransitionsPPTX(); + void testPresetShapesExport(); void testTdf92527(); void testDatetimeFieldNumberFormat(); void testDatetimeFieldNumberFormatPPTX(); @@ -113,6 +114,7 @@ public: CPPUNIT_TEST(testMathObjectPPT2010); CPPUNIT_TEST(testTdf80224); CPPUNIT_TEST(testExportTransitionsPPTX); + CPPUNIT_TEST(testPresetShapesExport); CPPUNIT_TEST(testTdf92527); CPPUNIT_TEST(testDatetimeFieldNumberFormat); CPPUNIT_TEST(testDatetimeFieldNumberFormatPPTX); @@ -438,6 +440,85 @@ void SdOOXMLExportTest2::testExportTransitionsPPTX() xDocShRef->DoClose(); } +void SdOOXMLExportTest2::testPresetShapesExport() +{ + ::sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/odp/preset-shapes-export.odp"), ODP); + const sal_Char *sShapeTypeAndValues[] = + { + "wedgeEllipseCallout", + "adj1","val 45310", + "adj2","val 97194", + "wedgeRoundRectCallout", + "adj1","val 46694", + "adj2","val 129726", + "adj3","val 16667", + "wedgeRectCallout", + "adj1","val 40037", + "adj2","val 111694", + "smileyFace", + "adj","val -9282", + "can", + "adj","val 50000", + "frame", + "adj1","val 10490", + "donut", + "adj","val 9601", + "noSmoking", + "adj","val 16118", + "bevel", + "adj","val 42587", + "foldedCorner", + "adj","val 10750", + "verticalScroll", + "adj","val 25000", + "horizontalScroll", + "adj","val 25000", + "cube", + "adj","val 85129", + "bracketPair", + "adj","val 50000", + "sun", + "adj","val 12500", + "bracePair", + "adj","val 25000", + "cloudCallout", + "adj1","val 77611", + "adj2","val -47819", + "borderCallout1", + "adj1","val 18750", + "adj2","val -8333", + "adj3","val 170013", + "adj4","val 143972", + "borderCallout2", + "adj1","val 18750", + "adj2","val -8333", + "adj3","val 113768", + "adj4","val -81930", + "adj5","val -22375", + "adj6","val -134550", + }; + + utl::TempFile tempFile; + xDocShRef = saveAndReload( xDocShRef, PPTX, &tempFile ); + + xmlDocPtr pXmlDocCT = parseExport(tempFile, "ppt/slides/slide1.xml"); + const OString sPattern( "/p:sld/p:cSld/p:spTree/p:sp/p:spPr/a:prstGeom[@prst='_T_']/a:avLst/a:gd[_N_]" ); + const OString sT( "_T_" ); + const OString sN( "_N_" ); + const OString sPropertyName("name"); + const OString sPropertyFmla("fmla"); + + size_t i = 0; + while(i < SAL_N_ELEMENTS( sShapeTypeAndValues )) { + OString sType = OString( sShapeTypeAndValues[ i++ ] ); + for ( size_t j = 1 ; i < SAL_N_ELEMENTS( sShapeTypeAndValues ) && OString(sShapeTypeAndValues[i]).startsWith("adj") ; ++j ) { + OString sXPath= sPattern.replaceFirst( sT, sType).replaceFirst( sN, OString::number(j) ); + assertXPath(pXmlDocCT, sXPath, sPropertyName , OUString::createFromAscii(sShapeTypeAndValues[ i++ ]) ); + assertXPath(pXmlDocCT, sXPath, sPropertyFmla , OUString::createFromAscii(sShapeTypeAndValues[ i++ ]) ); + } + } +} + void SdOOXMLExportTest2::testTdf92527() { // We draw a diamond in an empty document. A newly created diamond shape does not have |