summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--oox/source/drawingml/customshapepresetdata.cxx2
-rwxr-xr-xsw/qa/extras/ooxmlexport/data/preset-shape.docxbin0 -> 16054 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx12
3 files changed, 13 insertions, 1 deletions
diff --git a/oox/source/drawingml/customshapepresetdata.cxx b/oox/source/drawingml/customshapepresetdata.cxx
index a4856a89e11e..85d87cba669b 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 000000000000..922b906e25d4
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/preset-shape.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlsdrexport.cxx
index 6ec9982a1c86..913a6111ab81 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();