oox/source/drawingml/customshapepresetdata.cxx | 2 +- sw/qa/extras/ooxmlexport/data/preset-shape.docx |binary sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx | 12 ++++++++++++ 3 files changed, 13 insertions(+), 1 deletion(-)
New commits: commit aa3a25ca74d3abd204051c2747907031f7557510 Author: Miklos Vajna <vmik...@collabora.co.uk> Date: Tue May 6 13:19:36 2014 +0200 oox custom shape preset data: fix typo in parsing awt::Size Regression from commit f5ccbfdc561c68099872d1abe07ac72fcddedd35 (oox customshapepreset: switch to generated data -> code, 2014-04-17). Change-Id: I2106271e2f43e7936237628e47cd4e01ab34441c diff --git a/oox/source/drawingml/customshapepresetdata.cxx b/oox/source/drawingml/customshapepresetdata.cxx index a4856a8..85d87cb 100644 --- a/oox/source/drawingml/customshapepresetdata.cxx +++ b/oox/source/drawingml/customshapepresetdata.cxx @@ -175,7 +175,7 @@ awt::Size lcl_parseSize(const OString& rValue) aToken = aToken.copy(nIndex); assert(aToken.startsWith(aExpectedHeightPrefix)); nIndex = aExpectedHeightPrefix.getLength(); - aSize.Width = static_cast<sal_Int32>(aToken.copy(nIndex).toInt32()); + aSize.Height = static_cast<sal_Int32>(aToken.copy(nIndex).toInt32()); return aSize; } diff --git a/sw/qa/extras/ooxmlexport/data/preset-shape.docx b/sw/qa/extras/ooxmlexport/data/preset-shape.docx new file mode 100755 index 0000000..922b906 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/preset-shape.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx index 6ec9982..913a611 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx @@ -24,6 +24,7 @@ #include <com/sun/star/text/GraphicCrop.hpp> #include <comphelper/sequenceashashmap.hxx> +#include <comphelper/sequenceasvector.hxx> class Test : public SwModelTestBase { @@ -1209,6 +1210,17 @@ DECLARE_OOXMLEXPORT_TEST(test77219, "test77219.docx") assertXPath(pXmlDoc, "/w:document[1]/w:body[1]/w:p[6]/w:r[1]/mc:AlternateContent[1]/mc:Choice[1]/w:drawing[1]/wp:anchor[1]", "behindDoc", "1"); } +DECLARE_OOXMLEXPORT_TEST(testPresetShape, "preset-shape.docx") +{ + // Document contains a flowChartMultidocument preset shape, our date for that shape wasn't correct. + uno::Reference<beans::XPropertySet> xPropertySet(getShape(1), uno::UNO_QUERY); + comphelper::SequenceAsHashMap aCustomShapeGeometry(xPropertySet->getPropertyValue("CustomShapeGeometry")); + comphelper::SequenceAsHashMap aPath(aCustomShapeGeometry["Path"]); + comphelper::SequenceAsVector<awt::Size> aSubViewSize(aPath["SubViewSize"]); + // This was 0. + CPPUNIT_ASSERT_EQUAL(sal_Int32(21600), aSubViewSize[0].Height); +} + #endif CPPUNIT_PLUGIN_IMPLEMENT(); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits