[Libreoffice-commits] core.git: sw/CppunitTest_sw_macros_test.mk sw/inc sw/Library_swui.mk

2023-05-05 Thread Miklos Vajna (via logerrit)
 sw/CppunitTest_sw_macros_test.mk |5 -
 sw/Library_swui.mk   |1 +
 sw/inc/frameformats.hxx  |9 +
 3 files changed, 10 insertions(+), 5 deletions(-)

New commits:
commit d1999f23caf47a36786182adbe071619fd60f999
Author: Miklos Vajna 
AuthorDate: Fri May 5 16:39:16 2023 +0200
Commit: Miklos Vajna 
CommitDate: Fri May 5 17:47:52 2023 +0200

sw doc model xml dump: restore lost spzFrameFormatTable section

This was lost in commit b12ff94a771db17843f642a82820b2864bec4744
(introduce sw::FrameFormats<>, 2023-04-11). It used to be handy that you
can search for spzFrameFormatTable in a doc model xml dump to quickly
see how many fly/draw formats the document has, so restore it.

Change-Id: Ia5d83e2f71f589208a7ad5718d5705b17520db5e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151433
Reviewed-by: Miklos Vajna 
Tested-by: Jenkins

diff --git a/sw/CppunitTest_sw_macros_test.mk b/sw/CppunitTest_sw_macros_test.mk
index 9cc9b597c9ce..413d04a99cb2 100644
--- a/sw/CppunitTest_sw_macros_test.mk
+++ b/sw/CppunitTest_sw_macros_test.mk
@@ -11,7 +11,10 @@
 
 $(eval $(call gb_CppunitTest_CppunitTest,sw_macros_test))
 
-$(eval $(call gb_CppunitTest_use_external,sw_macros_test,boost_headers))
+$(eval $(call gb_CppunitTest_use_externals,sw_macros_test,\
+   boost_headers \
+   libxml2 \
+))
 
 $(eval $(call gb_CppunitTest_use_common_precompiled_header,sw_macros_test))
 
diff --git a/sw/Library_swui.mk b/sw/Library_swui.mk
index 81a21d003e19..1f97aa0edd1c 100644
--- a/sw/Library_swui.mk
+++ b/sw/Library_swui.mk
@@ -34,6 +34,7 @@ $(eval $(call 
gb_Library_set_precompiled_header,swui,sw/inc/pch/precompiled_swui
 $(eval $(call gb_Library_use_externals,swui,\
boost_headers \
icu_headers \
+   libxml2 \
 ))
 
 $(eval $(call gb_Library_use_custom_headers,swui,\
diff --git a/sw/inc/frameformats.hxx b/sw/inc/frameformats.hxx
index bdf0a69905b5..4edb1f98b134 100644
--- a/sw/inc/frameformats.hxx
+++ b/sw/inc/frameformats.hxx
@@ -28,6 +28,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 
 class SwFrameFormat;
 class SwTableFormat;
@@ -154,13 +156,12 @@ public:
 const_iterator begin() const { return GetByPos().begin(); }
 const_iterator end() const { return GetByPos().end(); }
 
-void dumpAsXml(xmlTextWriterPtr pWriter, const char*) const
+void dumpAsXml(xmlTextWriterPtr pWriter, const char* pName) const
 {
-// TODO
-//(void)xmlTextWriterStartElement(pWriter, BAD_CAST(pName));
+(void)xmlTextWriterStartElement(pWriter, BAD_CAST(pName));
 for (const auto pFormat : GetByPos())
 pFormat->dumpAsXml(pWriter);
-//(void)xmlTextWriterEndElement(pWriter);
+(void)xmlTextWriterEndElement(pWriter);
 };
 
 virtual size_t GetFormatCount() const override { return 
m_vContainer.size(); }


[Libreoffice-commits] core.git: sw/CppunitTest_sw_macros_test.mk sw/qa

2022-10-25 Thread Xisco Fauli (via logerrit)
 sw/CppunitTest_sw_macros_test.mk |1 
 sw/qa/core/macros-test.cxx   |  144 ++-
 2 files changed, 25 insertions(+), 120 deletions(-)

New commits:
commit 7c49e352ec8a5840943cadf6382db8fd812b7250
Author: Xisco Fauli 
AuthorDate: Tue Oct 25 12:39:50 2022 +0200
Commit: Xisco Fauli 
CommitDate: Tue Oct 25 14:00:07 2022 +0200

CppunitTest_sw_macros_test: inherit from UnoApiTest

Change-Id: I2ce2c55bd718d153f038736e5474d6ead4f8c5c4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141806
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 

diff --git a/sw/CppunitTest_sw_macros_test.mk b/sw/CppunitTest_sw_macros_test.mk
index 805242613b58..74887fa70ea3 100644
--- a/sw/CppunitTest_sw_macros_test.mk
+++ b/sw/CppunitTest_sw_macros_test.mk
@@ -38,6 +38,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sw_macros_test, \
 sw \
 sfx \
 sot \
+subsequenttest \
 svl \
 svt \
 svx \
diff --git a/sw/qa/core/macros-test.cxx b/sw/qa/core/macros-test.cxx
index 23a489517b11..0dd756cb97eb 100644
--- a/sw/qa/core/macros-test.cxx
+++ b/sw/qa/core/macros-test.cxx
@@ -11,8 +11,7 @@
 
 #include 
 
-#include 
-#include 
+#include 
 
 #include 
 #include 
@@ -27,7 +26,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -59,16 +57,11 @@ using namespace ::com::sun::star::uno;
 
 /* Implementation of Macros test */
 
-class SwMacrosTest : public test::BootstrapFixture, public unotest::MacrosTest
+class SwMacrosTest : public UnoApiTest
 {
 public:
 SwMacrosTest();
 
-void createFileURL(std::u16string_view aFile, OUString& rFilePath);
-
-virtual void setUp() override;
-virtual void tearDown() override;
-
 void testVba();
 void testBookmarkDeleteAndJoin();
 void testBookmarkDeleteTdf90816();
@@ -88,21 +81,8 @@ public:
 CPPUNIT_TEST(testFdo87530);
 CPPUNIT_TEST(testFindReplace);
 CPPUNIT_TEST_SUITE_END();
-
-private:
-uno::Reference m_xWriterComponent;
-OUString m_aBaseString;
 };
 
-void SwMacrosTest::createFileURL(std::u16string_view aFile, OUString& 
rFilePath)
-{
-auto i = aFile.find_last_of('.');
-CPPUNIT_ASSERT_MESSAGE("Missing Extension", i != std::string_view::npos);
-std::u16string_view aFileExtension = aFile.substr(i+1);
-
-rFilePath = m_directories.getSrcRootURL() + m_aBaseString + "/" + 
aFileExtension + "/" + aFile;
-}
-
 void SwMacrosTest::testVba()
 {
 TestMacroInfo testInfo[] = {
@@ -149,23 +129,16 @@ void SwMacrosTest::testVba()
 };
 for ( size_t  i=0; i xComponent = 
loadFromDesktop(aFileName, "com.sun.star.text.TextDocument");
-OUString sUrl = testInfo[i].sMacroUrl;
-Any aRet;
-Sequence< sal_Int16 > aOutParamIndex;
-Sequence< Any > aOutParam;
-Sequence< uno::Any > aParams;
-
-SfxObjectShell* pFoundShell = 
SfxObjectShell::GetShellFromComponent(xComponent);
-
-CPPUNIT_ASSERT_MESSAGE("Failed to access document shell", pFoundShell);
-CPPUNIT_ASSERT_EQUAL(ERRCODE_NONE, 
SfxObjectShell::CallXScript(xComponent, sUrl, aParams, aRet, 
aOutParamIndex,aOutParam));
+OUString sFileName("docm/" + testInfo[i].sFileBaseName);
+loadFromURL(sFileName);
+
+uno::Any aRet = executeMacro(testInfo[i].sMacroUrl);
 OUString aStringRes;
 CPPUNIT_ASSERT(aRet >>= aStringRes);
 CPPUNIT_ASSERT_EQUAL(OUString("OK"), aStringRes);
-pFoundShell->DoClose();
+
+mxComponent->dispose();
+mxComponent.clear();
 }
 }
 
@@ -241,12 +214,9 @@ void SwMacrosTest::testBookmarkDeleteTdf90816()
 
 void SwMacrosTest::testControlShapeGrouping()
 {
-OUString aFileName;
-createFileURL(u"testControlShapeGrouping.odt", aFileName);
-Reference< css::lang::XComponent > xComponent(
-loadFromDesktop(aFileName, "com.sun.star.text.TextDocument"));
+loadFromURL(u"odt/testControlShapeGrouping.odt");
 
-uno::Reference const xModel(xComponent, UNO_QUERY);
+uno::Reference const xModel(mxComponent, UNO_QUERY);
 CPPUNIT_ASSERT(xModel.is());
 uno::Reference xFactory(xModel, UNO_QUERY);
 uno::Reference const xDPS(xModel, UNO_QUERY);
@@ -340,10 +310,6 @@ void SwMacrosTest::testControlShapeGrouping()
 CPPUNIT_ASSERT_EQUAL(xTS->getControl(), xTimeControlModel);
 }
 #endif
-
-// close
-Reference xDocCloseable(xComponent, UNO_QUERY_THROW);
-xDocCloseable->close(false);
 }
 
 void SwMacrosTest::testFdo55289()
@@ -381,26 +347,13 @@ void SwMacrosTest::testFdo55289()
 
 void SwMacrosTest::testFdo68983()
 {
-OUString aFileName;
-createFileURL(u"fdo68983.odt", aFileName);
-Reference< css::lang::XComponent > xComponent =
-loadFromDesktop(aFileName, "com.sun.star.text.TextDocument");
-Reference< frame::XStorable > xDocStorable(xComponent, UNO_QUERY_THROW);
-
-utl::TempFileNamed aTempFile;
-aTempFile.EnableKillingFile();
-Sequence desc( 

[Libreoffice-commits] core.git: sw/CppunitTest_sw_macros_test.mk

2014-05-22 Thread Michael Stahl
 sw/CppunitTest_sw_macros_test.mk |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 3e69b7bcd3e4a9cb1a29360c905e7fba96365999
Author: Michael Stahl mst...@redhat.com
Date:   Thu May 22 13:23:25 2014 +0200

sw: use xsec_xmlsec.windows on WNT

Change-Id: I9cb9bce9d30230d48daf2f1deccaf52014b79296

diff --git a/sw/CppunitTest_sw_macros_test.mk b/sw/CppunitTest_sw_macros_test.mk
index 7b68eff..a33fe67 100644
--- a/sw/CppunitTest_sw_macros_test.mk
+++ b/sw/CppunitTest_sw_macros_test.mk
@@ -98,7 +98,7 @@ $(eval $(call gb_CppunitTest_use_components,sw_macros_test,\
unoxml/source/rdf/unordf \
unoxml/source/service/unoxml \
xmloff/util/xo \
-   xmlsecurity/util/xsec_xmlsec \
+   xmlsecurity/util/$(if $(filter 
WNT,$(OS)),xsec_xmlsec.windows,xsec_xmlsec) \
 ))
 
 $(eval $(call gb_CppunitTest_use_configuration,sw_macros_test))
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits