sc/qa/unit/data/xlsm/tdf117266_macroButton.xlsm |binary sc/qa/unit/subsequent_export_test2.cxx | 17 +++++++++++++++++ 2 files changed, 17 insertions(+)
New commits: commit 5b92a7f211adb229a45c7dedf1ce63e15fcfe5d9 Author: Justin Luth <justin.l...@collabora.com> AuthorDate: Sat Jan 14 10:52:20 2023 -0500 Commit: Justin Luth <jl...@mail.com> CommitDate: Sun Jan 15 04:15:14 2023 +0000 tdf#117266 sc oox: macro button unit test Change-Id: I50b8b5a2d29a5892490a7dbd4cc428786147d500 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145519 Tested-by: Jenkins Reviewed-by: Justin Luth <jl...@mail.com> diff --git a/sc/qa/unit/data/xlsm/tdf117266_macroButton.xlsm b/sc/qa/unit/data/xlsm/tdf117266_macroButton.xlsm new file mode 100644 index 000000000000..f587ba639c7e Binary files /dev/null and b/sc/qa/unit/data/xlsm/tdf117266_macroButton.xlsm differ diff --git a/sc/qa/unit/subsequent_export_test2.cxx b/sc/qa/unit/subsequent_export_test2.cxx index 5a1ebc5c2d3c..9ac4aa7704b8 100644 --- a/sc/qa/unit/subsequent_export_test2.cxx +++ b/sc/qa/unit/subsequent_export_test2.cxx @@ -64,6 +64,7 @@ public: void testTdf121260(); void testTextDirectionXLSX(); void testTdf120168(); + void testTdf117266(); void testTdf66668(); void testTdf130108(); void testTdf76949(); @@ -195,6 +196,7 @@ public: CPPUNIT_TEST(testTdf121260); CPPUNIT_TEST(testTextDirectionXLSX); CPPUNIT_TEST(testTdf120168); + CPPUNIT_TEST(testTdf117266); CPPUNIT_TEST(testTdf66668); CPPUNIT_TEST(testTdf130108); CPPUNIT_TEST(testTdf76949); @@ -532,6 +534,21 @@ void ScExportTest2::testTdf120168() assertXPath(pDoc, "/x:styleSheet/x:cellXfs/x:xf[3]/x:alignment", "horizontal", "right"); } +void ScExportTest2::testTdf117266() +{ + createScDoc("xlsm/tdf117266_macroButton.xlsm"); + + save("Calc MS Excel 2007 VBA XML"); + xmlDocUniquePtr pVmlDrawing = parseExport("xl/drawings/vmlDrawing1.vml"); + + OUString sName = getXPath(pVmlDrawing, "/xml/v:shape", "id"); + CPPUNIT_ASSERT(sName.startsWith("_x0000_s")); + + assertXPathContent(pVmlDrawing, "/xml/v:shape/v:textbox/div/font", "Button 1 \"y\" z"); + // Why the xx:, I have no idea..., but it certainly doesn't work with just x:. + assertXPathContent(pVmlDrawing, "/xml/v:shape//xx:FmlaMacro", "Module1.Button1_Click"); +} + void ScExportTest2::testTdf66668() { // Would hang on exporting without the fix in place