[Libreoffice-commits] core.git: include/test include/toolkit include/tools include/ucbhelper include/unotools include/vcl svl/source tools/source

2023-11-05 Thread Gabor Kelemen (via logerrit)
 include/test/a11y/eventposter.hxx|1 -
 include/test/text/xautotextcontainer.hxx |1 -
 include/test/text/xfootnote.hxx  |3 ---
 include/test/text/xtextrangecompare.hxx  |3 ---
 include/toolkit/awt/vclxdevice.hxx   |1 -
 include/toolkit/awt/vclxfont.hxx |1 -
 include/toolkit/awt/vclxmenu.hxx |1 -
 include/toolkit/awt/vclxwindow.hxx   |1 -
 include/toolkit/controls/unocontrolmodel.hxx |1 -
 include/tools/bigint.hxx |4 +++-
 include/tools/gen.hxx|1 -
 include/tools/inetmime.hxx   |1 -
 include/tools/json_writer.hxx|3 ---
 include/tools/multisel.hxx   |1 -
 include/ucbhelper/interactionrequest.hxx |1 -
 include/ucbhelper/resultsethelper.hxx|1 -
 include/unotools/VersionConfig.hxx   |2 ++
 include/unotools/streamwrap.hxx  |1 -
 include/unotools/syslocale.hxx   |1 -
 include/unotools/weakref.hxx |1 -
 include/vcl/settings.hxx |2 ++
 svl/source/misc/inettype.cxx |1 +
 tools/source/inet/inetmime.cxx   |1 +
 23 files changed, 9 insertions(+), 25 deletions(-)

New commits:
commit 026be6f62f183f14b9c0bf2e50cde9ac69856f53
Author: Gabor Kelemen 
AuthorDate: Sat Sep 16 23:06:24 2023 +0200
Commit: Thorsten Behrens 
CommitDate: Mon Nov 6 00:33:57 2023 +0100

tdf#146619 Recheck include/t* with IWYU

Change-Id: I005257e458351285b1b35ffe49c8b42834a6db68
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156990
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 

diff --git a/include/test/a11y/eventposter.hxx 
b/include/test/a11y/eventposter.hxx
index c0e607a70100..d9bce5601fe0 100644
--- a/include/test/a11y/eventposter.hxx
+++ b/include/test/a11y/eventposter.hxx
@@ -12,7 +12,6 @@
 #include 
 
 #include 
-#include 
 #include 
 
 #include 
diff --git a/include/test/text/xautotextcontainer.hxx 
b/include/test/text/xautotextcontainer.hxx
index a2ab07497362..cfc20f04c629 100644
--- a/include/test/text/xautotextcontainer.hxx
+++ b/include/test/text/xautotextcontainer.hxx
@@ -14,7 +14,6 @@
 
 #include 
 
-#include 
 #include 
 #include 
 
diff --git a/include/test/text/xfootnote.hxx b/include/test/text/xfootnote.hxx
index eb6f8bd0bd5e..a6f29b8084a9 100644
--- a/include/test/text/xfootnote.hxx
+++ b/include/test/text/xfootnote.hxx
@@ -9,14 +9,11 @@
 
 #pragma once
 
-#include 
 #include 
 
 #include 
 
-#include 
 #include 
-#include 
 
 namespace apitest
 {
diff --git a/include/test/text/xtextrangecompare.hxx 
b/include/test/text/xtextrangecompare.hxx
index b7e36a5cc445..60f4ff67b10b 100644
--- a/include/test/text/xtextrangecompare.hxx
+++ b/include/test/text/xtextrangecompare.hxx
@@ -9,14 +9,11 @@
 
 #pragma once
 
-#include 
 #include 
 
 #include 
 
-#include 
 #include 
-#include 
 
 namespace apitest
 {
diff --git a/include/toolkit/awt/vclxdevice.hxx 
b/include/toolkit/awt/vclxdevice.hxx
index 08a12a65353e..4538eb9d8733 100644
--- a/include/toolkit/awt/vclxdevice.hxx
+++ b/include/toolkit/awt/vclxdevice.hxx
@@ -22,7 +22,6 @@
 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/include/toolkit/awt/vclxfont.hxx b/include/toolkit/awt/vclxfont.hxx
index c4f768954c6e..3142a18123c1 100644
--- a/include/toolkit/awt/vclxfont.hxx
+++ b/include/toolkit/awt/vclxfont.hxx
@@ -23,7 +23,6 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
diff --git a/include/toolkit/awt/vclxmenu.hxx b/include/toolkit/awt/vclxmenu.hxx
index bc971a2088ec..3498e8dabe57 100644
--- a/include/toolkit/awt/vclxmenu.hxx
+++ b/include/toolkit/awt/vclxmenu.hxx
@@ -29,7 +29,6 @@
 #include 
 #include 
 
-#include 
 #include 
 #include 
 
diff --git a/include/toolkit/awt/vclxwindow.hxx 
b/include/toolkit/awt/vclxwindow.hxx
index b4b0a82b544b..f3b605bc848c 100644
--- a/include/toolkit/awt/vclxwindow.hxx
+++ b/include/toolkit/awt/vclxwindow.hxx
@@ -32,7 +32,6 @@
 #include 
 #include 
 
-#include 
 #include 
 
 #include 
diff --git a/include/toolkit/controls/unocontrolmodel.hxx 
b/include/toolkit/controls/unocontrolmodel.hxx
index 35c14fdece7f..f157c2cd000f 100644
--- a/include/toolkit/controls/unocontrolmodel.hxx
+++ b/include/toolkit/controls/unocontrolmodel.hxx
@@ -28,7 +28,6 @@
 #include 
 #include 
 
-#include 
 #include 
 
 #include 
diff --git a/include/tools/bigint.hxx b/include/tools/bigint.hxx
index ae33a5e67d53..f8f57fc45de7 100644
--- a/include/tools/bigint.hxx
+++ b/include/tools/bigint.hxx
@@ -19,10 +19,12 @@
 #ifndef INCLUDED_TOOLS_BIGINT_HXX
 #define INCLUDED_TOOLS_BIGINT_HXX
 
-#include 
 #include 
 #include 
 
+#include 
+#include 
+
 #define MAX_DIGITS 8
 
 class SAL_WARN_UNUSED TOOLS_DLLPUBLIC BigInt
diff --git a/include/tools/gen.hxx b/include/tools/gen.hxx
index 33079e084181..d6ac5f2ec787 100644
--- 

[Libreoffice-commits] core.git: include/test include/vcl offapi/com sc/qa sw/qa test/Library_test.mk test/source toolkit/source vcl/Library_vcl.mk vcl/source

2023-10-26 Thread Noel Grandin (via logerrit)
 include/vcl/idletask.hxx |4 ++--
 offapi/com/sun/star/awt/XToolkitExperimental.idl |3 +++
 sc/qa/unit/subsequent_filters_test3.cxx  |2 +-
 sw/qa/extras/uiwriter/uiwriter7.cxx  |2 +-
 sw/qa/uitest/navigator/movechapterupdown.py  |7 +++
 sw/qa/uitest/navigator/tdf134960.py  |7 +++
 sw/qa/uitest/navigator/tdf137274.py  |7 +++
 sw/qa/uitest/navigator/tdf144672.py  |7 +++
 sw/qa/uitest/navigator/tdf151051.py  |7 +++
 sw/qa/uitest/navigator/tdf154212.py  |7 +++
 sw/qa/uitest/writer_tests7/tdf135938.py  |7 +++
 test/Library_test.mk |1 -
 toolkit/source/awt/vclxtoolkit.cxx   |8 
 vcl/Library_vcl.mk   |1 +
 vcl/source/helper/idletask.cxx   |3 ++-
 15 files changed, 67 insertions(+), 6 deletions(-)

New commits:
commit 0446f73d27a0c43de1a2d5e07c9510a287be6af2
Author: Noel Grandin 
AuthorDate: Thu Oct 26 11:40:24 2023 +0200
Commit: Noel Grandin 
CommitDate: Thu Oct 26 16:10:29 2023 +0200

tdf#153519 use new IdleTask::waitUntilIdleDispatched

to wait until the Idle inside sw/ has done populating the navigator
tree.

Which required
(*) moving the code down from test/ to vcl/ to avoid circular dependency
issues.
(*) adding a call SolarMutexGuard before Application::Yield inside
IdleTask::waitUntilIdleDispatched
(*) exposing the function to python by adding a method to the
XToolkitExperimental UNO API

Change-Id: Iee418f7a0beb1f5b53addb7fe25823d61720eb3a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158495
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/include/test/idletask.hxx b/include/vcl/idletask.hxx
similarity index 93%
rename from include/test/idletask.hxx
rename to include/vcl/idletask.hxx
index 168f9052974a..fd5b17c61bec 100644
--- a/include/test/idletask.hxx
+++ b/include/vcl/idletask.hxx
@@ -10,11 +10,11 @@
 #pragma once
 
 #include 
-#include 
+#include 
 #include 
 
 //IdleTask class to add a low priority Idle task
-class OOO_DLLPUBLIC_TEST IdleTask
+class VCL_DLLPUBLIC IdleTask
 {
 public:
 bool GetFlag() const;
diff --git a/offapi/com/sun/star/awt/XToolkitExperimental.idl 
b/offapi/com/sun/star/awt/XToolkitExperimental.idl
index 1cfcd7521f3c..d48252d95077 100644
--- a/offapi/com/sun/star/awt/XToolkitExperimental.idl
+++ b/offapi/com/sun/star/awt/XToolkitExperimental.idl
@@ -51,6 +51,9 @@ interface XToolkitExperimental : XToolkit3
  */
 sequence getRecordingAndClear();
 
+/** Wait until all idles dispatched.
+ */
+void waitUntilAllIdlesDispatched();
 };
 
 }; }; }; };
diff --git a/sc/qa/unit/subsequent_filters_test3.cxx 
b/sc/qa/unit/subsequent_filters_test3.cxx
index 0c2ec7864de2..cdde83913715 100644
--- a/sc/qa/unit/subsequent_filters_test3.cxx
+++ b/sc/qa/unit/subsequent_filters_test3.cxx
@@ -50,7 +50,7 @@
 #include 
 #include "helper/qahelper.hxx"
 #include 
-#include 
+#include 
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
diff --git a/sw/qa/extras/uiwriter/uiwriter7.cxx 
b/sw/qa/extras/uiwriter/uiwriter7.cxx
index 871ce984ba75..7ccf7477bd6e 100644
--- a/sw/qa/extras/uiwriter/uiwriter7.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter7.cxx
@@ -71,7 +71,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 
 namespace
 {
diff --git a/sw/qa/uitest/navigator/movechapterupdown.py 
b/sw/qa/uitest/navigator/movechapterupdown.py
index 6bcda9b3d4bb..0b4c7ef5f540 100644
--- a/sw/qa/uitest/navigator/movechapterupdown.py
+++ b/sw/qa/uitest/navigator/movechapterupdown.py
@@ -25,6 +25,13 @@ class movechapterupdown(UITestCase):
 # wait until the navigator panel is available
 xNavigatorPanel = 
self.ui_test.wait_until_child_is_available('NavigatorPanel')
 
+# See the `m_aUpdateTimer.SetTimeout(200)` (to "avoid flickering 
of buttons")
+# in the SwChildWinWrapper ctor in 
sw/source/uibase/fldui/fldwrap.cxx, where that
+# m_aUpdateTimer is started by SwChildWinWrapper::ReInitDlg 
triggered from the
+# xInsert click above.
+xToolkit = 
self.xContext.ServiceManager.createInstance('com.sun.star.awt.Toolkit')
+xToolkit.waitUntilAllIdlesDispatched()
+
 # Given the document chapter structure:
 # 1. One H1
 #   1.1. one_A (H2)
diff --git a/sw/qa/uitest/navigator/tdf134960.py 
b/sw/qa/uitest/navigator/tdf134960.py
index 8388b63e40f9..d60cc677bcd8 100644
--- a/sw/qa/uitest/navigator/tdf134960.py
+++ b/sw/qa/uitest/navigator/tdf134960.py
@@ -27,6 +27,13 @@ class tdf134960_hyperlinks(UITestCase):
 # wait until the navigator panel is available
 xNavigatorPanel = 
self.ui_test.wait_until_child_is_available('NavigatorPanel')
 
+# See 

[Libreoffice-commits] core.git: include/test sc/qa sw/qa test/Library_test.mk test/source

2023-10-08 Thread Caolán McNamara (via logerrit)
 include/test/idletask.hxx   |   34 
 sc/qa/unit/subsequent_filters_test3.cxx |5 +-
 sw/qa/extras/uiwriter/uiwriter7.cxx |   54 ++--
 test/Library_test.mk|1 
 test/source/idletask.cxx|   50 +
 5 files changed, 92 insertions(+), 52 deletions(-)

New commits:
commit 9a02f4ed071f15908624fb1cafcf6dbb72b00a1b
Author: Caolán McNamara 
AuthorDate: Sun Oct 8 14:33:38 2023 +0100
Commit: Caolán McNamara 
CommitDate: Sun Oct 8 19:12:46 2023 +0200

make testCondFormatFormulaListenerXLSX reliable

Change-Id: Ibd8c9b7831af73967229c578b9dcf7217d800610
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157686
Tested-by: Jenkins
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 

diff --git a/include/test/idletask.hxx b/include/test/idletask.hxx
new file mode 100644
index ..168f9052974a
--- /dev/null
+++ b/include/test/idletask.hxx
@@ -0,0 +1,34 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#pragma once
+
+#include 
+#include 
+#include 
+
+//IdleTask class to add a low priority Idle task
+class OOO_DLLPUBLIC_TEST IdleTask
+{
+public:
+bool GetFlag() const;
+IdleTask();
+
+// Launch an Idle at TaskPriority::LOWEST and wait until it completes. Can
+// be used to wait until pending Idles at higher TaskPriority::DEFAULT_IDLE
+// have completed.
+static void waitUntilIdleDispatched();
+
+private:
+DECL_LINK(FlipFlag, Timer*, void);
+bool flag;
+Idle maIdle{ "testtool IdleTask" };
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/sc/qa/unit/subsequent_filters_test3.cxx 
b/sc/qa/unit/subsequent_filters_test3.cxx
index cd9acf90bece..7980e8083559 100644
--- a/sc/qa/unit/subsequent_filters_test3.cxx
+++ b/sc/qa/unit/subsequent_filters_test3.cxx
@@ -50,6 +50,7 @@
 #include 
 #include "helper/qahelper.hxx"
 #include 
+#include 
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
@@ -420,7 +421,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest3, 
testCondFormatFormulaListenerXLSX)
 pDoc->SetDocVisible(true);
 pDoc->SetValue(0, 0, 0, 2.0);
 
-Scheduler::ProcessEventsToIdle();
+IdleTask::waitUntilIdleDispatched();
 
 CPPUNIT_ASSERT(aListener.mbCalled);
 }
@@ -442,7 +443,7 @@ CPPUNIT_TEST_FIXTURE(ScFiltersTest3, testTdf131471)
 pDoc->SetDocVisible(true);
 pDoc->SetValue(0, 0, 0, 1.0);
 
-Scheduler::ProcessEventsToIdle();
+IdleTask::waitUntilIdleDispatched();
 
 CPPUNIT_ASSERT(aListener.mbCalled);
 }
diff --git a/sw/qa/extras/uiwriter/uiwriter7.cxx 
b/sw/qa/extras/uiwriter/uiwriter7.cxx
index f29e75e8c65e..871ce984ba75 100644
--- a/sw/qa/extras/uiwriter/uiwriter7.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter7.cxx
@@ -71,6 +71,7 @@
 #include 
 #include 
 #include 
+#include 
 
 namespace
 {
@@ -2271,55 +2272,11 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testDde)
 #endif
 }
 
-namespace
-{
-//IdleTask class to add a low priority Idle task
-class IdleTask
-{
-public:
-bool GetFlag() const;
-IdleTask();
-DECL_LINK(FlipFlag, Timer*, void);
-
-private:
-bool flag;
-Idle maIdle{ "sw uiwriter IdleTask" };
-};
-}
-
-//constructor of IdleTask Class
-IdleTask::IdleTask()
-: flag(false)
-{
-//setting the Priority of Idle task to LOW, LOWEST
-maIdle.SetPriority(TaskPriority::LOWEST);
-//set idle for callback
-maIdle.SetInvokeHandler(LINK(this, IdleTask, FlipFlag));
-//starting the idle
-maIdle.Start();
-}
-
-//GetFlag() of IdleTask Class
-bool IdleTask::GetFlag() const
-{
-//returning the status of current flag
-return flag;
-}
-
-//Callback function of IdleTask Class
-IMPL_LINK(IdleTask, FlipFlag, Timer*, , void)
-{
-//setting the flag to make sure that low priority idle task has been 
dispatched
-flag = true;
-}
-
 CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testDocModState)
 {
 //creating a new writer document via the XDesktop(to have more shells etc.)
 createSwDoc();
 SwDoc* pDoc = getSwDoc();
-//creating instance of IdleTask Class
-IdleTask idleTask;
 //checking the state of the document via IDocumentState
 IDocumentState& rState(pDoc->getIDocumentState());
 //the state should not be modified
@@ -2327,12 +2284,9 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testDocModState)
 //checking the state of the document via SfxObjectShell
 SwDocShell* pShell(pDoc->GetDocShell());
 CPPUNIT_ASSERT(!(pShell->IsModified()));
-//looping around yield until low priority idle task is dispatched and flag 
is 

[Libreoffice-commits] core.git: include/test sc/qa test/source

2023-10-06 Thread Henry Castro (via logerrit)
 include/test/unoapi_test.hxx   |3 +++
 sc/qa/unit/subsequent_export_test2.cxx |   10 --
 test/source/unoapi_test.cxx|   18 ++
 3 files changed, 29 insertions(+), 2 deletions(-)

New commits:
commit df9f94a1b37d26b74d981dc4514255c46477c8ac
Author: Henry Castro 
AuthorDate: Thu Sep 21 07:11:13 2023 -0400
Commit: Henry Castro 
CommitDate: Fri Oct 6 15:27:35 2023 +0200

sc: qa: add loadWithParams and SaveWithParams

Add option to load and save with optional parameters.

Signed-off-by: Henry Castro 
Change-Id: I2d735443da11634d072742f1bf6f38f90bced2c9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157141
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157569
Tested-by: Jenkins

diff --git a/include/test/unoapi_test.hxx b/include/test/unoapi_test.hxx
index e329168dfe7b..4ba209c44d39 100644
--- a/include/test/unoapi_test.hxx
+++ b/include/test/unoapi_test.hxx
@@ -36,12 +36,15 @@ public:
 OUString createFileURL(std::u16string_view aFileBase);
 OUString createFilePath(std::u16string_view aFileBase);
 void load(const OUString& rURL, const char* pPassword = nullptr);
+void loadWithParams(const OUString& rURL,
+const css::uno::Sequence& 
rParams);
 OUString loadFromURL(std::u16string_view aFileBase, const char* pPassword 
= nullptr);
 
 css::uno::Any executeMacro(const OUString& rScriptURL,
const css::uno::Sequence& 
rParams = {});
 
 void save(const OUString& rFilter, const char* pPassword = nullptr);
+void saveWithParams(const css::uno::Sequence& 
rParams);
 void saveAndReload(const OUString& rFilter, const char* pPassword = 
nullptr);
 
 std::unique_ptr parsePDFExport(const OString& 
rPassword = OString());
diff --git a/sc/qa/unit/subsequent_export_test2.cxx 
b/sc/qa/unit/subsequent_export_test2.cxx
index 403bffc3112f..91309d9e5491 100644
--- a/sc/qa/unit/subsequent_export_test2.cxx
+++ b/sc/qa/unit/subsequent_export_test2.cxx
@@ -18,6 +18,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -698,10 +699,15 @@ CPPUNIT_TEST_FIXTURE(ScExportTest2, 
testHyperlinkTargetFrameODS)
 
 CPPUNIT_TEST_FIXTURE(ScExportTest2, testOpenDocumentAsReadOnly)
 {
-createScDoc("xlsx/open-as-read-only.xlsx");
+uno::Sequence aParams = { 
comphelper::makePropertyValue("Silent", true) };
+
+loadWithParams(createFileURL(u"xlsx/open-as-read-only.xlsx"), aParams);
 ScDocShell* pDocSh = getScDocShell();
 CPPUNIT_ASSERT(pDocSh->IsSecurityOptOpenReadOnly());
-saveAndReload("Calc Office Open XML");
+
+saveWithParams(uno::Sequence());
+loadWithParams(maTempFile.GetURL(), aParams);
+
 pDocSh = getScDocShell();
 CPPUNIT_ASSERT(pDocSh->IsSecurityOptOpenReadOnly());
 }
diff --git a/test/source/unoapi_test.cxx b/test/source/unoapi_test.cxx
index 5c689bfe5354..464f374201bd 100644
--- a/test/source/unoapi_test.cxx
+++ b/test/source/unoapi_test.cxx
@@ -121,6 +121,18 @@ void UnoApiTest::load(OUString const& rURL, const char* 
pPassword)
 }
 }
 
+void UnoApiTest::loadWithParams(OUString const& rURL,
+const uno::Sequence& 
rParams)
+{
+if (mxComponent.is())
+{
+mxComponent->dispose();
+mxComponent.clear();
+}
+
+mxComponent = loadFromDesktop(rURL, OUString(), rParams);
+}
+
 OUString UnoApiTest::loadFromURL(std::u16string_view aFileBase, const char* 
pPassword)
 {
 OUString aFileName = createFileURL(aFileBase);
@@ -203,6 +215,12 @@ void UnoApiTest::save(const OUString& rFilter, const char* 
pPassword)
 }
 }
 
+void UnoApiTest::saveWithParams(const uno::Sequence& 
rParams)
+{
+css::uno::Reference xStorable(mxComponent, 
css::uno::UNO_QUERY_THROW);
+xStorable->storeToURL(maTempFile.GetURL(), rParams);
+}
+
 void UnoApiTest::saveAndReload(const OUString& rFilter, const char* pPassword)
 {
 save(rFilter, pPassword);


[Libreoffice-commits] core.git: include/test qadevOOo/Jar_OOoRunner.mk qadevOOo/objdsc qadevOOo/tests sw/qa test/Library_subsequenttest.mk test/source

2023-08-27 Thread anfanite396 (via logerrit)
 include/test/text/footnote.hxx  |   27 ++
 qadevOOo/Jar_OOoRunner.mk   |1 
 qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXFootnote.csv |1 
 qadevOOo/tests/java/ifc/text/_Footnote.java |   47 
 sw/qa/api/SwXFootnote.cxx   |5 +
 test/Library_subsequenttest.mk  |1 
 test/source/text/footnote.cxx   |   31 +++
 7 files changed, 63 insertions(+), 50 deletions(-)

New commits:
commit 8496f805da8ea9f2585b7485b448dda52557db9a
Author: anfanite396 
AuthorDate: Thu Aug 24 19:50:12 2023 +0530
Commit: Tomaž Vajngerl 
CommitDate: Sun Aug 27 10:51:38 2023 +0200

tdf#45904: Move _Footnote Java tests to C++

Change-Id: I1e69267a72296f55fac12326ec69d3c29e63561a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156055
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/include/test/text/footnote.hxx b/include/test/text/footnote.hxx
new file mode 100644
index ..9970ee43cc3b
--- /dev/null
+++ b/include/test/text/footnote.hxx
@@ -0,0 +1,27 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#pragma once
+
+#include 
+
+#include 
+
+namespace apitest
+{
+class OOO_DLLPUBLIC_TEST Footnote
+{
+public:
+virtual css::uno::Reference init() = 0;
+virtual ~Footnote();
+void testFootnoteProperties();
+};
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/qadevOOo/Jar_OOoRunner.mk b/qadevOOo/Jar_OOoRunner.mk
index d71eb77d943b..65ed25b15758 100644
--- a/qadevOOo/Jar_OOoRunner.mk
+++ b/qadevOOo/Jar_OOoRunner.mk
@@ -594,7 +594,6 @@ $(eval $(call gb_Jar_add_sourcefiles,OOoRunner,\
 qadevOOo/tests/java/ifc/text/_Defaults \
 qadevOOo/tests/java/ifc/text/_DocumentIndex \
 qadevOOo/tests/java/ifc/text/_DocumentSettings \
-qadevOOo/tests/java/ifc/text/_Footnote \
 qadevOOo/tests/java/ifc/text/_FootnoteSettings \
 qadevOOo/tests/java/ifc/text/_GenericTextDocument \
 qadevOOo/tests/java/ifc/text/_LineNumberingProperties \
diff --git a/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXFootnote.csv 
b/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXFootnote.csv
index 125fef2ec96d..98181e7e1929 100644
--- a/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXFootnote.csv
+++ b/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXFootnote.csv
@@ -14,4 +14,3 @@
 "SwXFootnote";"com::sun::star::text::XTextContent";"getAnchor()"
 "SwXFootnote";"com::sun::star::text::XText";"insertTextContent()"
 "SwXFootnote";"com::sun::star::text::XText";"removeTextContent()"
-"SwXFootnote";"com::sun::star::text::Footnote";"ReferenceId#optional"
diff --git a/qadevOOo/tests/java/ifc/text/_Footnote.java 
b/qadevOOo/tests/java/ifc/text/_Footnote.java
deleted file mode 100644
index 4af1725644be..
--- a/qadevOOo/tests/java/ifc/text/_Footnote.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-package ifc.text;
-
-import lib.MultiPropertyTest;
-
-/**
-* Testing com.sun.star.text.Footnote
-* service properties :
-* 
-*   ReferenceId
-*  
-* Properties testing is automated by lib.MultiPropertyTest.
-* @see com.sun.star.text.Footnote
-*/
-public class _Footnote extends MultiPropertyTest {
-
-/**
-* This property can be VOID, and in case if it is so new
-* value must be defined.
-*/
-public void _ReferenceId() {
-final Short val1 = Short.valueOf( (short) 1);
-final Short val2 = Short.valueOf( (short) 2);
-
-log.println("Testing with custom Property tester");
-testProperty("ReferenceId", val1, val2);
-}
-
-} //finish class _Footnote
-
diff --git a/sw/qa/api/SwXFootnote.cxx b/sw/qa/api/SwXFootnote.cxx
index ea3ec0231e55..5c6f7418d941 100644
--- a/sw/qa/api/SwXFootnote.cxx
+++ b/sw/qa/api/SwXFootnote.cxx
@@ -9,6 +9,7 

[Libreoffice-commits] core.git: include/test qadevOOo/Jar_OOoRunner.mk qadevOOo/objdsc qadevOOo/tests sw/qa test/Library_subsequenttest.mk test/source

2023-08-26 Thread anfanite396 (via logerrit)
 include/test/text/xfootnote.hxx |   36 
 qadevOOo/Jar_OOoRunner.mk   |1 
 qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXFootnote.csv |2 
 qadevOOo/tests/java/ifc/text/_XFootnote.java|  101 
 sw/qa/api/SwXFootnote.cxx   |5 
 test/Library_subsequenttest.mk  |1 
 test/source/text/xfootnote.cxx  |   41 
 7 files changed, 82 insertions(+), 105 deletions(-)

New commits:
commit 0ab3f09011e4c4c1b85dda72f81f252899162ab5
Author: anfanite396 
AuthorDate: Sat Aug 12 01:04:27 2023 +0530
Commit: Tomaž Vajngerl 
CommitDate: Sat Aug 26 16:21:44 2023 +0200

tdf#45904: Move _XFootnote Java tests to C++

Change-Id: Ibdc28ab8818860b9c94abeac33713607dbcf8df4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155635
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/include/test/text/xfootnote.hxx b/include/test/text/xfootnote.hxx
new file mode 100644
index ..eb6f8bd0bd5e
--- /dev/null
+++ b/include/test/text/xfootnote.hxx
@@ -0,0 +1,36 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#pragma once
+
+#include 
+#include 
+
+#include 
+
+#include 
+#include 
+#include 
+
+namespace apitest
+{
+class OOO_DLLPUBLIC_TEST XFootnote
+{
+public:
+virtual css::uno::Reference init() = 0;
+
+void testGetSetLabel();
+
+protected:
+~XFootnote() {}
+};
+
+} // namespace apitest
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/qadevOOo/Jar_OOoRunner.mk b/qadevOOo/Jar_OOoRunner.mk
index 9e89070e0a97..60343d0958d0 100644
--- a/qadevOOo/Jar_OOoRunner.mk
+++ b/qadevOOo/Jar_OOoRunner.mk
@@ -623,7 +623,6 @@ $(eval $(call gb_Jar_add_sourcefiles,OOoRunner,\
 qadevOOo/tests/java/ifc/text/_XDocumentIndex \
 qadevOOo/tests/java/ifc/text/_XDocumentIndexesSupplier \
 qadevOOo/tests/java/ifc/text/_XEndnotesSupplier \
-qadevOOo/tests/java/ifc/text/_XFootnote \
 qadevOOo/tests/java/ifc/text/_XFootnotesSettingsSupplier \
 qadevOOo/tests/java/ifc/text/_XFootnotesSupplier \
 qadevOOo/tests/java/ifc/text/_XLineNumberingProperties \
diff --git a/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXFootnote.csv 
b/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXFootnote.csv
index 888987553a39..125fef2ec96d 100644
--- a/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXFootnote.csv
+++ b/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXFootnote.csv
@@ -10,8 +10,6 @@
 "SwXFootnote";"com::sun::star::text::XTextRange";"getEnd()"
 "SwXFootnote";"com::sun::star::text::XTextRange";"getString()"
 "SwXFootnote";"com::sun::star::text::XTextRange";"setString()"
-"SwXFootnote";"com::sun::star::text::XFootnote";"getLabel()"
-"SwXFootnote";"com::sun::star::text::XFootnote";"setLabel()"
 "SwXFootnote";"com::sun::star::text::XTextContent";"attach()"
 "SwXFootnote";"com::sun::star::text::XTextContent";"getAnchor()"
 "SwXFootnote";"com::sun::star::text::XText";"insertTextContent()"
diff --git a/qadevOOo/tests/java/ifc/text/_XFootnote.java 
b/qadevOOo/tests/java/ifc/text/_XFootnote.java
deleted file mode 100644
index 6aedd2c75263..
--- a/qadevOOo/tests/java/ifc/text/_XFootnote.java
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-package ifc.text;
-
-import lib.MultiMethodTest;
-import com.sun.star.text.XFootnote;
-
-
-/**
- * Testing com.sun.star.text.XFootnote
- * interface methods :
- * 
- *   getLabel()
- *   setLabel()
- *  
- * Test is  NOT  multithread compliant. 
- * @see com.sun.star.text.XFootnote
- */
-public class _XFootnote extends MultiMethodTest {
-
-public XFootnote oObj = null;// oObj filled by MultiMethodTest
-
-/**
- * Test calls the method. 
- * Has  OK  status if 

[Libreoffice-commits] core.git: include/test qadevOOo/Jar_OOoRunner.mk qadevOOo/objdsc qadevOOo/tests sw/qa test/Library_subsequenttest.mk test/source

2023-08-26 Thread anfanite396 (via logerrit)
 include/test/text/documentindexmark.hxx  |   31 

 qadevOOo/Jar_OOoRunner.mk|1 
 qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXDocumentIndexMark.csv |3 
 qadevOOo/tests/java/ifc/text/_DocumentIndexMark.java |   38 
-
 sw/qa/api/SwXDocumentIndexMark.cxx   |5 
 test/Library_subsequenttest.mk   |1 
 test/source/text/documentindexmark.cxx   |   69 
++
 7 files changed, 105 insertions(+), 43 deletions(-)

New commits:
commit d1fef008f10da02700fe9d46bc86c3a50cae7a21
Author: anfanite396 
AuthorDate: Tue Aug 1 19:39:26 2023 +0530
Commit: Tomaž Vajngerl 
CommitDate: Sat Aug 26 13:30:26 2023 +0200

tdf#45904: Move _DocumentIndexMark Java tests to C++

Change-Id: I144d06ab3abb47134060d554a4016009246aa739
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155163
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/include/test/text/documentindexmark.hxx 
b/include/test/text/documentindexmark.hxx
new file mode 100644
index ..228668c3b070
--- /dev/null
+++ b/include/test/text/documentindexmark.hxx
@@ -0,0 +1,31 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#pragma once
+
+#include 
+#include 
+
+#include 
+
+namespace apitest
+{
+class OOO_DLLPUBLIC_TEST DocumentIndexMark
+{
+public:
+virtual css::uno::Reference init() = 0;
+
+void testDocumentIndexMarkProperties();
+
+protected:
+~DocumentIndexMark() {}
+};
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/qadevOOo/Jar_OOoRunner.mk b/qadevOOo/Jar_OOoRunner.mk
index 336b99b81e9a..9e89070e0a97 100644
--- a/qadevOOo/Jar_OOoRunner.mk
+++ b/qadevOOo/Jar_OOoRunner.mk
@@ -593,7 +593,6 @@ $(eval $(call gb_Jar_add_sourcefiles,OOoRunner,\
 qadevOOo/tests/java/ifc/text/_CellRange \
 qadevOOo/tests/java/ifc/text/_Defaults \
 qadevOOo/tests/java/ifc/text/_DocumentIndex \
-qadevOOo/tests/java/ifc/text/_DocumentIndexMark \
 qadevOOo/tests/java/ifc/text/_DocumentSettings \
 qadevOOo/tests/java/ifc/text/_Footnote \
 qadevOOo/tests/java/ifc/text/_FootnoteSettings \
diff --git 
a/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXDocumentIndexMark.csv 
b/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXDocumentIndexMark.csv
index 6e02c6c3f748..cc1e491f1987 100644
--- a/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXDocumentIndexMark.csv
+++ b/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXDocumentIndexMark.csv
@@ -4,8 +4,5 @@
 
"SwXDocumentIndexMark";"com::sun::star::text::TextContent";"AnchorType#optional"
 
"SwXDocumentIndexMark";"com::sun::star::text::TextContent";"AnchorTypes#optional"
 "SwXDocumentIndexMark";"com::sun::star::text::TextContent";"TextWrap#optional"
-"SwXDocumentIndexMark";"com::sun::star::text::DocumentIndexMark";"PrimaryKey"
-"SwXDocumentIndexMark";"com::sun::star::text::DocumentIndexMark";"SecondaryKey"
-"SwXDocumentIndexMark";"com::sun::star::text::DocumentIndexMark";"IsMainEntry"
 "SwXDocumentIndexMark";"com::sun::star::text::XTextContent";"attach()"
 "SwXDocumentIndexMark";"com::sun::star::text::XTextContent";"getAnchor()"
diff --git a/qadevOOo/tests/java/ifc/text/_DocumentIndexMark.java 
b/qadevOOo/tests/java/ifc/text/_DocumentIndexMark.java
deleted file mode 100644
index d78730727e12..
--- a/qadevOOo/tests/java/ifc/text/_DocumentIndexMark.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-package ifc.text;
-
-import lib.MultiPropertyTest;
-
-/**
-* Testing com.sun.star.text.DocumentIndexMark
-* service properties :
-* 
-*   PrimaryKey
-*   SecondaryKey
-*   IsMainEntry
-*  
-* Properties testing is automated by lib.MultiPropertyTest.
-* @see 

[Libreoffice-commits] core.git: include/test qadevOOo/objdsc sw/qa test/Library_subsequenttest.mk test/source

2023-08-25 Thread anfanite396 (via logerrit)
 include/test/text/xtextrangecompare.hxx |   37 
 qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXBodyText.csv |2 
 qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXFootnoteText.csv |2 
 qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXHeadFootText.csv |2 
 sw/qa/api/SwXBodyText.cxx   |6 
 sw/qa/api/SwXFootnoteText.cxx   |6 
 sw/qa/api/SwXHeadFootText.cxx   |   34 ++--
 test/Library_subsequenttest.mk  |1 
 test/source/text/xtextrangecompare.cxx  |   76 
++
 9 files changed, 143 insertions(+), 23 deletions(-)

New commits:
commit 7a762a2c7ec5fe107697c06d31bc7a184011a338
Author: anfanite396 
AuthorDate: Fri Aug 11 23:29:32 2023 +0530
Commit: Tomaž Vajngerl 
CommitDate: Fri Aug 25 08:25:53 2023 +0200

tdf#45904: Move _XTextRangeCompare Java tests to C++

Change-Id: I40390a8b05f0e685a9408f0c486f6129633bc5b5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155634
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/include/test/text/xtextrangecompare.hxx 
b/include/test/text/xtextrangecompare.hxx
new file mode 100644
index ..b7e36a5cc445
--- /dev/null
+++ b/include/test/text/xtextrangecompare.hxx
@@ -0,0 +1,37 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#pragma once
+
+#include 
+#include 
+
+#include 
+
+#include 
+#include 
+#include 
+
+namespace apitest
+{
+class OOO_DLLPUBLIC_TEST XTextRangeCompare
+{
+public:
+virtual css::uno::Reference init() = 0;
+
+void testCompareRegionStarts();
+void testCompareRegionEnds();
+
+protected:
+~XTextRangeCompare() {}
+};
+
+} // namespace apitest
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXBodyText.csv 
b/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXBodyText.csv
index 45ebfd332ec9..44603eda85f2 100644
--- a/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXBodyText.csv
+++ b/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXBodyText.csv
@@ -1,6 +1,4 @@
 
"SwXBodyText";"com::sun::star::text::XTextRangeMover#optional";"moveTextRange()"
-"SwXBodyText";"com::sun::star::text::XTextRangeCompare#optional";"compareRegionStarts()"
-"SwXBodyText";"com::sun::star::text::XTextRangeCompare#optional";"compareRegionEnds()"
 "SwXBodyText";"com::sun::star::text::XSimpleText";"createTextCursor()"
 "SwXBodyText";"com::sun::star::text::XSimpleText";"createTextCursorByRange()"
 "SwXBodyText";"com::sun::star::text::XSimpleText";"insertString()"
diff --git a/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXFootnoteText.csv 
b/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXFootnoteText.csv
index 3f3663b8c2dd..6bba3d3cf263 100644
--- a/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXFootnoteText.csv
+++ b/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXFootnoteText.csv
@@ -1,6 +1,4 @@
 
"SwXFootnoteText";"com::sun::star::text::XTextRangeMover#optional";"moveTextRange()"
-"SwXFootnoteText";"com::sun::star::text::XTextRangeCompare#optional";"compareRegionStarts()"
-"SwXFootnoteText";"com::sun::star::text::XTextRangeCompare#optional";"compareRegionEnds()"
 "SwXFootnoteText";"com::sun::star::text::XSimpleText";"createTextCursor()"
 
"SwXFootnoteText";"com::sun::star::text::XSimpleText";"createTextCursorByRange()"
 "SwXFootnoteText";"com::sun::star::text::XSimpleText";"insertString()"
diff --git a/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXHeadFootText.csv 
b/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXHeadFootText.csv
index 0602fbf2e584..7e780f968a58 100644
--- a/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXHeadFootText.csv
+++ b/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXHeadFootText.csv
@@ -1,6 +1,4 @@
 
"SwXHeadFootText";"com::sun::star::text::XTextRangeMover#optional";"moveTextRange()"
-"SwXHeadFootText";"com::sun::star::text::XTextRangeCompare#optional";"compareRegionStarts()"
-"SwXHeadFootText";"com::sun::star::text::XTextRangeCompare#optional";"compareRegionEnds()"
 "SwXHeadFootText";"com::sun::star::text::XSimpleText";"createTextCursor()"
 
"SwXHeadFootText";"com::sun::star::text::XSimpleText";"createTextCursorByRange()"
 "SwXHeadFootText";"com::sun::star::text::XSimpleText";"insertString()"
diff --git a/sw/qa/api/SwXBodyText.cxx b/sw/qa/api/SwXBodyText.cxx
index d364ba3a8aa0..69fb22a959b2 100644
--- a/sw/qa/api/SwXBodyText.cxx
+++ b/sw/qa/api/SwXBodyText.cxx
@@ -12,6 +12,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -36,7 +37,8 @@ class 

[Libreoffice-commits] core.git: include/test qadevOOo/Jar_OOoRunner.mk qadevOOo/objdsc qadevOOo/tests sw/qa test/Library_subsequenttest.mk test/source

2023-08-25 Thread anfanite396 (via logerrit)
 include/test/text/xautotextcontainer.hxx |   45 +++
 qadevOOo/Jar_OOoRunner.mk|1 
 qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXAutoTextContainer.csv |2 
 qadevOOo/tests/java/ifc/text/_XAutoTextContainer.java|  132 
--
 sw/qa/api/SwXAutoTextContainer.cxx   |   15 -
 test/Library_subsequenttest.mk   |1 
 test/source/text/xautotextcontainer.cxx  |   54 

 7 files changed, 112 insertions(+), 138 deletions(-)

New commits:
commit 7b999ca22824e102d283a8b7327fa2717db6568a
Author: anfanite396 
AuthorDate: Fri Aug 11 19:13:08 2023 +0530
Commit: Tomaž Vajngerl 
CommitDate: Fri Aug 25 08:23:23 2023 +0200

tdf#45904: Move _XAutoTextContainer Java tests to C++

Change-Id: Ie6ebc43c52204984cb6196f539c735701d13dc22
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155627
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/include/test/text/xautotextcontainer.hxx 
b/include/test/text/xautotextcontainer.hxx
new file mode 100644
index ..a2ab07497362
--- /dev/null
+++ b/include/test/text/xautotextcontainer.hxx
@@ -0,0 +1,45 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#pragma once
+
+#include 
+#include 
+
+#include 
+
+#include 
+#include 
+#include 
+
+namespace apitest
+{
+class OOO_DLLPUBLIC_TEST XAutoTextContainer
+{
+public:
+XAutoTextContainer(OUString aNameToRemove)
+: m_aName(std::move(aNameToRemove))
+{
+}
+
+virtual css::uno::Reference init() = 0;
+
+void testInsertNewByName();
+void testRemoveByName();
+
+protected:
+~XAutoTextContainer() {}
+
+private:
+OUString m_aName;
+};
+
+} // namespace apitest
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/qadevOOo/Jar_OOoRunner.mk b/qadevOOo/Jar_OOoRunner.mk
index 71b0beaa1b9d..cb0422a1dbe3 100644
--- a/qadevOOo/Jar_OOoRunner.mk
+++ b/qadevOOo/Jar_OOoRunner.mk
@@ -616,7 +616,6 @@ $(eval $(call gb_Jar_add_sourcefiles,OOoRunner,\
 qadevOOo/tests/java/ifc/text/_TextTable \
 qadevOOo/tests/java/ifc/text/_TextTableRow \
 qadevOOo/tests/java/ifc/text/_ViewSettings \
-qadevOOo/tests/java/ifc/text/_XAutoTextContainer \
 qadevOOo/tests/java/ifc/text/_XAutoTextEntry \
 qadevOOo/tests/java/ifc/text/_XAutoTextGroup \
 qadevOOo/tests/java/ifc/text/_XBookmarksSupplier \
diff --git 
a/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXAutoTextContainer.csv 
b/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXAutoTextContainer.csv
index 25352ae1f972..d1c6e381eb9b 100644
--- a/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXAutoTextContainer.csv
+++ b/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXAutoTextContainer.csv
@@ -5,5 +5,3 @@
 
"SwXAutoTextContainer";"com::sun::star::container::XIndexAccess#optional";"getByIndex()"
 
"SwXAutoTextContainer";"com::sun::star::container::XElementAccess";"getElementType()"
 
"SwXAutoTextContainer";"com::sun::star::container::XElementAccess";"hasElements()"
-"SwXAutoTextContainer";"com::sun::star::text::XAutoTextContainer";"insertNewByName()"
-"SwXAutoTextContainer";"com::sun::star::text::XAutoTextContainer";"removeByName()"
diff --git a/qadevOOo/tests/java/ifc/text/_XAutoTextContainer.java 
b/qadevOOo/tests/java/ifc/text/_XAutoTextContainer.java
deleted file mode 100644
index fed159a320b2..
--- a/qadevOOo/tests/java/ifc/text/_XAutoTextContainer.java
+++ /dev/null
@@ -1,132 +0,0 @@
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-package ifc.text;
-
-import lib.MultiMethodTest;
-
-import com.sun.star.text.XAutoTextContainer;
-import com.sun.star.text.XAutoTextGroup;
-
-/**
- * Testing com.sun.star.text.XAutoTextContainer
- * interface methods :
- * 
- *   

[Libreoffice-commits] core.git: include/test qadevOOo/Jar_OOoRunner.mk qadevOOo/objdsc qadevOOo/tests sw/qa test/Library_subsequenttest.mk test/source

2023-08-25 Thread anfanite396 (via logerrit)
 include/test/text/baseindexmark.hxx  |   31 
++
 qadevOOo/Jar_OOoRunner.mk|1 
 qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXDocumentIndexMark.csv |1 
 qadevOOo/tests/java/ifc/text/_BaseIndexMark.java |   36 

 sw/qa/api/SwXDocumentIndexMark.cxx   |5 -
 test/Library_subsequenttest.mk   |1 
 test/source/text/baseindexmark.cxx   |   45 
++
 7 files changed, 81 insertions(+), 39 deletions(-)

New commits:
commit bb8f57dfa17e108c4cd5d08a538077c3d2c6f195
Author: anfanite396 
AuthorDate: Tue Aug 1 15:35:01 2023 +0530
Commit: Tomaž Vajngerl 
CommitDate: Fri Aug 25 08:21:53 2023 +0200

tdf#45904: Move _BaseIndexMark Java tests to C++

Change-Id: Ie6c09c0cfedbad8168281af354590ab7c9dd374e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155162
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/include/test/text/baseindexmark.hxx 
b/include/test/text/baseindexmark.hxx
new file mode 100644
index ..e6835a6d1122
--- /dev/null
+++ b/include/test/text/baseindexmark.hxx
@@ -0,0 +1,31 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#pragma once
+
+#include 
+#include 
+
+#include 
+
+namespace apitest
+{
+class OOO_DLLPUBLIC_TEST BaseIndexMark
+{
+public:
+virtual css::uno::Reference init() = 0;
+
+void testBaseIndexMarkProperties();
+
+protected:
+~BaseIndexMark() {}
+};
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/qadevOOo/Jar_OOoRunner.mk b/qadevOOo/Jar_OOoRunner.mk
index a539bc96c16a..71b0beaa1b9d 100644
--- a/qadevOOo/Jar_OOoRunner.mk
+++ b/qadevOOo/Jar_OOoRunner.mk
@@ -589,7 +589,6 @@ $(eval $(call gb_Jar_add_sourcefiles,OOoRunner,\
 qadevOOo/tests/java/ifc/text/_BaseFrame \
 qadevOOo/tests/java/ifc/text/_BaseFrameProperties \
 qadevOOo/tests/java/ifc/text/_BaseIndex \
-qadevOOo/tests/java/ifc/text/_BaseIndexMark \
 qadevOOo/tests/java/ifc/text/_CellProperties \
 qadevOOo/tests/java/ifc/text/_CellRange \
 qadevOOo/tests/java/ifc/text/_Defaults \
diff --git 
a/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXDocumentIndexMark.csv 
b/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXDocumentIndexMark.csv
index 9bf2b782aa0b..6e02c6c3f748 100644
--- a/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXDocumentIndexMark.csv
+++ b/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXDocumentIndexMark.csv
@@ -4,7 +4,6 @@
 
"SwXDocumentIndexMark";"com::sun::star::text::TextContent";"AnchorType#optional"
 
"SwXDocumentIndexMark";"com::sun::star::text::TextContent";"AnchorTypes#optional"
 "SwXDocumentIndexMark";"com::sun::star::text::TextContent";"TextWrap#optional"
-"SwXDocumentIndexMark";"com::sun::star::text::BaseIndexMark";"AlternativeText"
 "SwXDocumentIndexMark";"com::sun::star::text::DocumentIndexMark";"PrimaryKey"
 "SwXDocumentIndexMark";"com::sun::star::text::DocumentIndexMark";"SecondaryKey"
 "SwXDocumentIndexMark";"com::sun::star::text::DocumentIndexMark";"IsMainEntry"
diff --git a/qadevOOo/tests/java/ifc/text/_BaseIndexMark.java 
b/qadevOOo/tests/java/ifc/text/_BaseIndexMark.java
deleted file mode 100644
index a80d7488a37f..
--- a/qadevOOo/tests/java/ifc/text/_BaseIndexMark.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-package ifc.text;
-
-import lib.MultiPropertyTest;
-
-/**
-* Testing com.sun.star.text.BaseIndexMark
-* service properties :
-* 
-*   AlternativeText
-*  
-* Properties testing is automated by lib.MultiPropertyTest.
-* @see com.sun.star.text.BaseIndexMark
-*/
-public class _BaseIndexMark extends MultiPropertyTest {
-
-}  // finish class _BaseIndexMark
-
-
diff --git 

[Libreoffice-commits] core.git: include/test qadevOOo/objdsc sw/qa test/Library_subsequenttest.mk test/source

2023-08-25 Thread anfanite396 (via logerrit)
 include/test/text/numberingrules.hxx|   31 
 qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXChapterNumbering.csv |4 
 qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXNumberingRules.csv   |4 
 sw/qa/api/SwXChapterNumbering.cxx   |5 
 sw/qa/api/SwXNumberingRules.cxx |5 
 test/Library_subsequenttest.mk  |1 
 test/source/text/numberingrules.cxx |   77 
++
 7 files changed, 117 insertions(+), 10 deletions(-)

New commits:
commit 594665e757c4adec4d243e4c33299877b2264552
Author: anfanite396 
AuthorDate: Mon Jul 31 16:14:34 2023 +0530
Commit: Tomaž Vajngerl 
CommitDate: Fri Aug 25 08:21:14 2023 +0200

tdf#45904 Move _NumberingRules Java tests to C++

Change-Id: I86d559767204e1e8e1fd232db63f26a5c1ce67da
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155089
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/include/test/text/numberingrules.hxx 
b/include/test/text/numberingrules.hxx
new file mode 100644
index ..a6db84bd054e
--- /dev/null
+++ b/include/test/text/numberingrules.hxx
@@ -0,0 +1,31 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#pragma once
+
+#include 
+#include 
+
+#include 
+
+namespace apitest
+{
+class OOO_DLLPUBLIC_TEST NumberingRules
+{
+public:
+virtual css::uno::Reference init() = 0;
+
+void testNumberingRulesProperties();
+
+protected:
+~NumberingRules() {}
+};
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git 
a/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXChapterNumbering.csv 
b/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXChapterNumbering.csv
index 89a3669e18d9..d06312d6d1ee 100644
--- a/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXChapterNumbering.csv
+++ b/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXChapterNumbering.csv
@@ -3,10 +3,6 @@
 
"SwXChapterNumbering";"com::sun::star::container::XElementAccess";"getElementType()"
 
"SwXChapterNumbering";"com::sun::star::container::XElementAccess";"hasElements()"
 
"SwXChapterNumbering";"com::sun::star::container::XIndexReplace";"replaceByIndex()"
-"SwXChapterNumbering";"com::sun::star::text::NumberingRules";"IsAbsoluteMargins#optional"
-"SwXChapterNumbering";"com::sun::star::text::NumberingRules";"IsAutomatic#optional"
-"SwXChapterNumbering";"com::sun::star::text::NumberingRules";"IsContinuousNumbering#optional"
-"SwXChapterNumbering";"com::sun::star::text::NumberingRules";"Name#optional"
 
"SwXChapterNumbering";"com::sun::star::beans::XPropertySet#optional";"getPropertySetInfo()"
 
"SwXChapterNumbering";"com::sun::star::beans::XPropertySet#optional";"setPropertyValue()"
 
"SwXChapterNumbering";"com::sun::star::beans::XPropertySet#optional";"getPropertyValue()"
diff --git a/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXNumberingRules.csv 
b/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXNumberingRules.csv
index 6b30de486f46..45c9cbb2e25f 100644
--- a/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXNumberingRules.csv
+++ b/qadevOOo/objdsc/sw/com.sun.star.comp.office.SwXNumberingRules.csv
@@ -3,10 +3,6 @@
 
"SwXNumberingRules";"com::sun::star::container::XElementAccess";"getElementType()"
 "SwXNumberingRules";"com::sun::star::container::XElementAccess";"hasElements()"
 
"SwXNumberingRules";"com::sun::star::container::XIndexReplace";"replaceByIndex()"
-"SwXNumberingRules";"com::sun::star::text::NumberingRules";"IsAbsoluteMargins#optional"
-"SwXNumberingRules";"com::sun::star::text::NumberingRules";"IsAutomatic#optional"
-"SwXNumberingRules";"com::sun::star::text::NumberingRules";"IsContinuousNumbering#optional"
-"SwXNumberingRules";"com::sun::star::text::NumberingRules";"Name#optional"
 
"SwXNumberingRules";"com::sun::star::beans::XPropertySet#optional";"getPropertySetInfo()"
 
"SwXNumberingRules";"com::sun::star::beans::XPropertySet#optional";"setPropertyValue()"
 
"SwXNumberingRules";"com::sun::star::beans::XPropertySet#optional";"getPropertyValue()"
diff --git a/sw/qa/api/SwXChapterNumbering.cxx 
b/sw/qa/api/SwXChapterNumbering.cxx
index 30dc352535c5..5a676da9c042 100644
--- a/sw/qa/api/SwXChapterNumbering.cxx
+++ b/sw/qa/api/SwXChapterNumbering.cxx
@@ -11,6 +11,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 
@@ -29,7 +30,8 @@ namespace
 class SwXChapterNumbering final : public UnoApiTest,
   public apitest::XPropertySet,
   public apitest::XElementAccess,
-  public 

[Libreoffice-commits] core.git: include/test test/source

2023-03-13 Thread Stephan Bergmann (via logerrit)
 include/test/sheet/xdatapilotdescriptor.hxx |3 ++-
 test/source/sheet/xdatapilotdescriptor.cxx  |5 ++---
 2 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 758050caa06bd742dddea55fb29b0eec1b2309e4
Author: Stephan Bergmann 
AuthorDate: Thu Mar 9 23:05:20 2023 +0100
Commit: Stephan Bergmann 
CommitDate: Mon Mar 13 19:01:37 2023 +

Use a more reasonable type for XDataPilotDescriptor::checkName nIndex 
parameter

Change-Id: If9e6760a6b23c63d03d337d6b111493684d67c85
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148568
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 

diff --git a/include/test/sheet/xdatapilotdescriptor.hxx 
b/include/test/sheet/xdatapilotdescriptor.hxx
index 9186b52ebb8f..5e4e7c62da87 100644
--- a/include/test/sheet/xdatapilotdescriptor.hxx
+++ b/include/test/sheet/xdatapilotdescriptor.hxx
@@ -16,6 +16,7 @@
 
 #include 
 
+#include 
 #include 
 
 namespace apitest {
@@ -41,7 +42,7 @@ protected:
 private:
 static void testGetDataPilotFields_Impl( css::uno::Reference< 
css::sheet::XDataPilotDescriptor > const & xDescr );
 
-static void checkName( css::uno::Reference< css::container::XIndexAccess > 
const & xIndex, sal_Int32 nIndex );
+static void checkName( css::uno::Reference< css::container::XIndexAccess > 
const & xIndex, std::size_t nIndex );
 static std::vector maFieldNames;
 };
 
diff --git a/test/source/sheet/xdatapilotdescriptor.cxx 
b/test/source/sheet/xdatapilotdescriptor.cxx
index a9cbcf5b125c..20392ff8ae4b 100644
--- a/test/source/sheet/xdatapilotdescriptor.cxx
+++ b/test/source/sheet/xdatapilotdescriptor.cxx
@@ -16,7 +16,6 @@
 
 #include 
 
-#include 
 #include 
 
 using namespace css;
@@ -175,10 +174,10 @@ void XDataPilotDescriptor::testGetHiddenFields()
 checkName( xIndex, 3 );
 }
 
-void XDataPilotDescriptor::checkName( uno::Reference< container::XIndexAccess 
> const & xIndex, sal_Int32 nIndex )
+void XDataPilotDescriptor::checkName( uno::Reference< container::XIndexAccess 
> const & xIndex, std::size_t nIndex )
 {
 CPPUNIT_ASSERT(xIndex.is());
-CPPUNIT_ASSERT(maFieldNames.size() >= o3tl::make_unsigned(nIndex));
+CPPUNIT_ASSERT(maFieldNames.size() >= nIndex);
 
 for (sal_Int32 i = 0; i < xIndex->getCount(); ++i)
 {


[Libreoffice-commits] core.git: include/test sw/qa test/qa test/source

2023-03-03 Thread Colomban Wendling (via logerrit)
 include/test/a11y/accessibletestbase.hxx |2 ++
 sw/qa/extras/accessibility/dialogs.cxx   |   24 
 test/qa/cppunit/dialog.cxx   |9 -
 test/source/a11y/accessibletestbase.cxx  |9 -
 4 files changed, 18 insertions(+), 26 deletions(-)

New commits:
commit d1589ade91cfadf860c31ca30c97a60f95afa928
Author: Colomban Wendling 
AuthorDate: Thu Feb 23 16:34:49 2023 +0100
Commit: Michael Weghorn 
CommitDate: Fri Mar 3 10:58:22 2023 +

Disable test::AccessibleTestBase::awaitDialog() on macos altogether

The API doesn't actually work there yet because we don't get any event,
so there's no point in exposing it there, and it makes it clear it
isn't available there, avoiding future user to wonder why their tests
do not behave there.

Change-Id: I38dcc98ad3bc3b669df64bc1c53c91ef48a0d717
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147574
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/include/test/a11y/accessibletestbase.hxx 
b/include/test/a11y/accessibletestbase.hxx
index 1445d0eb4737..e23c2e12467e 100644
--- a/include/test/a11y/accessibletestbase.hxx
+++ b/include/test/a11y/accessibletestbase.hxx
@@ -181,6 +181,7 @@ protected:
   const 
css::uno::Reference& xChild,
   const EventPosterHelperBase* pEventPosterHelper = 
nullptr);
 
+#if !defined(MACOSX)
 /* Dialog handling */
 class Dialog : public test::AccessibleEventPosterHelper
 {
@@ -286,6 +287,7 @@ protected:
 static std::shared_ptr awaitDialog(const std::u16string_view 
name,
  
std::function callback,
  bool bAutoClose = true);
+#endif //defined(MACOSX)
 
 public:
 virtual void setUp() override;
diff --git a/sw/qa/extras/accessibility/dialogs.cxx 
b/sw/qa/extras/accessibility/dialogs.cxx
index e6e3ac84c068..7997f7743b1e 100644
--- a/sw/qa/extras/accessibility/dialogs.cxx
+++ b/sw/qa/extras/accessibility/dialogs.cxx
@@ -17,8 +17,9 @@
 
 using namespace css;
 
-// FIXME: dialog doesn't pop up on macos...
+// FIXME: dialog API doesn't work on macos yet
 #if !defined(MACOSX)
+
 CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, 
BasicTestSpecialCharactersDialog)
 {
 load(u"private:factory/swriter");
@@ -62,10 +63,7 @@ CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, 
BasicTestSpecialCharactersDialo
 
 CPPUNIT_ASSERT_EQUAL(rtl::OUString(u"©"), 
collectText());
 }
-#endif
 
-// FIXME: dialog doesn't pop up on macos...
-#if !defined(MACOSX)
 /* checks for the fix from https://gerrit.libreoffice.org/c/core/+/147660 */
 CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, 
TestSpecialCharactersDialogFocus)
 {
@@ -96,10 +94,7 @@ CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, 
TestSpecialCharactersDialogFocu
 
 CPPUNIT_ASSERT_EQUAL(rtl::OUString(u"0"), 
collectText());
 }
-#endif
 
-// FIXME: dialog doesn't pop up on macos...
-#if !defined(MACOSX)
 CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, BasicTestHyperlinkDialog)
 {
 load(u"private:factory/swriter");
@@ -123,10 +118,7 @@ CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, 
BasicTestHyperlinkDialog)
 
CPPUNIT_ASSERT_EQUAL(rtl::OUString("https://libreoffice.org/"),
  collectText());
 }
-#endif
 
-// FIXME: dialog doesn't pop up on macos...
-#if !defined(MACOSX)
 CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, BasicTestBookmarkDialog)
 {
 load(u"private:factory/swriter");
@@ -150,10 +142,7 @@ CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, 
BasicTestBookmarkDialog)
 CPPUNIT_ASSERT_EQUAL(rtl::OUString("#Test Bookmark 1 Bookmark 
"),
  collectText());
 }
-#endif
 
-// FIXME: dialog doesn't pop up on macos...
-#if !defined(MACOSX)
 CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, BasicTestSectionDialog)
 {
 load(u"private:factory/swriter");
@@ -171,10 +160,7 @@ CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, 
BasicTestSectionDialog)
 
 CPPUNIT_ASSERT_EQUAL(rtl::OUString(""), 
collectText());
 }
-#endif
 
-// FIXME: dialog doesn't pop up on macos...
-#if !defined(MACOSX)
 CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, BasicTestFontworkDialog)
 {
 load(u"private:factory/swriter");
@@ -195,10 +181,7 @@ CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, 
BasicTestFontworkDialog)
   "description=\"Paragraph: 0 
Simple\">Simple"),
 collectText());
 }
-#endif
 
-// FIXME: dialog doesn't pop up on macos...
-#if !defined(MACOSX)
 CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, BasicTestFrameDialog)
 {
 load(u"private:factory/swriter");
@@ -216,6 +199,7 @@ CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, 
BasicTestFrameDialog)
 rtl::OUString(""),
 collectText());
 }
-#endif
+
+#endif //defined(MACOSX)
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff 

[Libreoffice-commits] core.git: include/test test/source

2023-03-03 Thread Colomban Wendling (via logerrit)
 include/test/a11y/accessibletestbase.hxx |   11 ++-
 test/source/a11y/accessibletestbase.cxx  |   97 +++
 2 files changed, 69 insertions(+), 39 deletions(-)

New commits:
commit 8a449f2de0d926967331436adfd3d5dd0b9e2db8
Author: Colomban Wendling 
AuthorDate: Tue Feb 7 16:32:22 2023 +0100
Commit: Michael Weghorn 
CommitDate: Fri Mar 3 10:58:05 2023 +

test: Use css::awt::XExtentdedToolkit::addTopWindowListener()

Use awt::XExtentdedToolkit::addTopWindowListener() instead of
Application::AddEventListener() for lower dependency on vcl::Window.

We however still require some vcl::Window for EventPosterHelper to work
without which we cannot post events to the dialog.  It however doesn't
really have to be the top-level window itself, any vcl::Window high
enough the event tree would probably work.

Change-Id: I40b56a6c9e45f4e2ef2cab27a735856baef7e3c2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146634
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/include/test/a11y/accessibletestbase.hxx 
b/include/test/a11y/accessibletestbase.hxx
index 5f5fb54aff4b..1445d0eb4737 100644
--- a/include/test/a11y/accessibletestbase.hxx
+++ b/include/test/a11y/accessibletestbase.hxx
@@ -18,6 +18,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -181,23 +182,25 @@ protected:
   const EventPosterHelperBase* pEventPosterHelper = 
nullptr);
 
 /* Dialog handling */
-class Dialog : public test::EventPosterHelper
+class Dialog : public test::AccessibleEventPosterHelper
 {
 private:
 bool mbAutoClose;
+css::uno::Reference mxDialog2;
+css::uno::Reference mxAccessible;
 
 public:
-Dialog(vcl::Window* pWindow, bool bAutoClose = true);
+Dialog(css::uno::Reference& xDialog2, bool 
bAutoClose = true);
 virtual ~Dialog();
 
 void setAutoClose(bool bAutoClose) { mbAutoClose = bAutoClose; }
 
 css::uno::Reference getAccessible() 
const
 {
-return mxWindow ? mxWindow->GetAccessible() : nullptr;
+return mxAccessible;
 }
 
-bool close(sal_Int32 result = VclResponseType::RET_CANCEL);
+void close(sal_Int32 result = VclResponseType::RET_CANCEL);
 
 css::uno::Reference
 tabTo(const sal_Int16 role, const std::u16string_view name)
diff --git a/test/source/a11y/accessibletestbase.cxx 
b/test/source/a11y/accessibletestbase.cxx
index bcfdcc89db1d..20d6c88a5e19 100644
--- a/test/source/a11y/accessibletestbase.cxx
+++ b/test/source/a11y/accessibletestbase.cxx
@@ -17,7 +17,9 @@
 #include 
 #include 
 #include 
+#include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -30,7 +32,8 @@
 #include 
 #include 
 #include 
-#include 
+
+#include 
 
 #include 
 
@@ -347,12 +350,22 @@ bool test::AccessibleTestBase::tabTo(
 
 /* Dialog handling */
 
-test::AccessibleTestBase::Dialog::Dialog(vcl::Window* pWindow, bool bAutoClose)
-: test::EventPosterHelper(pWindow)
-, mbAutoClose(bAutoClose)
+test::AccessibleTestBase::Dialog::Dialog(uno::Reference& 
xDialog2, bool bAutoClose)
+: mbAutoClose(bAutoClose)
+, mxDialog2(xDialog2)
 {
-CPPUNIT_ASSERT(pWindow);
-CPPUNIT_ASSERT(pWindow->IsDialog());
+CPPUNIT_ASSERT(xDialog2.is());
+
+mxAccessible.set(xDialog2, uno::UNO_QUERY);
+if (mxAccessible)
+setWindow(mxAccessible);
+else
+{
+std::cerr << "WARNING: AccessibleTestBase::Dialog() constructed with 
awt::XDialog2 '"
+  << xDialog2->getTitle()
+  << "' not implementing accessibility::XAccessible. Event 
delivery will not work."
+  << std::endl;
+}
 }
 
 test::AccessibleTestBase::Dialog::~Dialog()
@@ -361,16 +374,13 @@ test::AccessibleTestBase::Dialog::~Dialog()
 close();
 }
 
-bool test::AccessibleTestBase::Dialog::close(sal_Int32 result)
+void test::AccessibleTestBase::Dialog::close(sal_Int32 result)
 {
-if (mxWindow && !mxWindow->isDisposed())
+if (mxDialog2)
 {
-uno::Reference 
xDialog2(mxWindow->GetComponentInterface(),
-   uno::UNO_QUERY_THROW);
-xDialog2->endDialog(result);
-return mxWindow->isDisposed();
+mxDialog2->endDialog(result);
+mxDialog2.clear();
 }
-return true;
 }
 
 std::shared_ptr
@@ -387,7 +397,7 @@ test::AccessibleTestBase::awaitDialog(const 
std::u16string_view name,
 class ListenerHelper : public DialogWaiter
 {
 DialogCancelMode miPreviousDialogCancelMode;
-Link mLink;
+uno::Reference mxToolkit;
 bool mbWaitingForDialog;
 std::exception_ptr mpException;
 std::u16string_view msName;
@@ -395,14 +405,14 @@ test::AccessibleTestBase::awaitDialog(const 
std::u16string_view name,
 bool mbAutoClose;
 Timer maTimeoutTimer;
 Idle 

[Libreoffice-commits] core.git: include/test sw/qa test/qa test/source

2023-03-03 Thread Colomban Wendling (via logerrit)
 include/test/a11y/accessibletestbase.hxx |5 ---
 sw/qa/extras/accessibility/dialogs.cxx   |   28 ++--
 test/qa/cppunit/dialog.cxx   |8 ++---
 test/source/a11y/accessibletestbase.cxx  |   43 +++
 4 files changed, 51 insertions(+), 33 deletions(-)

New commits:
commit 655f6164e38c2f675beb5272fc6a9780f4767429
Author: Colomban Wendling 
AuthorDate: Tue Jan 31 11:25:28 2023 +0100
Commit: Michael Weghorn 
CommitDate: Fri Mar 3 10:57:11 2023 +

test: Run user dialog callback in idle time

On e.g. Windows we need to let the dialogs fully finish starting up
before we can properly interact with them, and especially close them
again.

We notice new dialogs with the WindowActivate event, but this will
happen before the dialog is fully set up internally, leading to
failures on Windows.  In practice, the WindowActivate event might be
dispatched before the dialog setup function finishes, leading to an
intermediate state at WindowActivate time.

Work around this by running the user code in an idle timer in response
to the WindowActivate event, so that the setup code can return before
the callback is dispatched.

Based on findings by Michael Weghorn, thanks!

Change-Id: Ieecee09d84144570fe1943ca12dc1db6d9f64524
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146378
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/include/test/a11y/accessibletestbase.hxx 
b/include/test/a11y/accessibletestbase.hxx
index 0048edcd8589..5f5fb54aff4b 100644
--- a/include/test/a11y/accessibletestbase.hxx
+++ b/include/test/a11y/accessibletestbase.hxx
@@ -183,14 +183,11 @@ protected:
 /* Dialog handling */
 class Dialog : public test::EventPosterHelper
 {
-friend class AccessibleTestBase;
-
 private:
 bool mbAutoClose;
 
-Dialog(vcl::Window* pWindow, bool bAutoClose = true);
-
 public:
+Dialog(vcl::Window* pWindow, bool bAutoClose = true);
 virtual ~Dialog();
 
 void setAutoClose(bool bAutoClose) { mbAutoClose = bAutoClose; }
diff --git a/sw/qa/extras/accessibility/dialogs.cxx 
b/sw/qa/extras/accessibility/dialogs.cxx
index 13c2fd0cb750..e6e3ac84c068 100644
--- a/sw/qa/extras/accessibility/dialogs.cxx
+++ b/sw/qa/extras/accessibility/dialogs.cxx
@@ -17,8 +17,8 @@
 
 using namespace css;
 
-// FIXME: dialog doesn't pop up on macos and doesn't close on win32...
-#if !defined(_WIN32) && !defined(MACOSX)
+// FIXME: dialog doesn't pop up on macos...
+#if !defined(MACOSX)
 CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, 
BasicTestSpecialCharactersDialog)
 {
 load(u"private:factory/swriter");
@@ -64,8 +64,8 @@ CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, 
BasicTestSpecialCharactersDialo
 }
 #endif
 
-// FIXME: dialog doesn't pop up on macos and doesn't close on win32...
-#if !defined(_WIN32) && !defined(MACOSX)
+// FIXME: dialog doesn't pop up on macos...
+#if !defined(MACOSX)
 /* checks for the fix from https://gerrit.libreoffice.org/c/core/+/147660 */
 CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, 
TestSpecialCharactersDialogFocus)
 {
@@ -98,8 +98,8 @@ CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, 
TestSpecialCharactersDialogFocu
 }
 #endif
 
-// FIXME: dialog doesn't pop up on macos and doesn't close on win32...
-#if !defined(_WIN32) && !defined(MACOSX)
+// FIXME: dialog doesn't pop up on macos...
+#if !defined(MACOSX)
 CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, BasicTestHyperlinkDialog)
 {
 load(u"private:factory/swriter");
@@ -125,8 +125,8 @@ CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, 
BasicTestHyperlinkDialog)
 }
 #endif
 
-// FIXME: dialog doesn't pop up on macos and doesn't close on win32...
-#if !defined(_WIN32) && !defined(MACOSX)
+// FIXME: dialog doesn't pop up on macos...
+#if !defined(MACOSX)
 CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, BasicTestBookmarkDialog)
 {
 load(u"private:factory/swriter");
@@ -152,8 +152,8 @@ CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, 
BasicTestBookmarkDialog)
 }
 #endif
 
-// FIXME: dialog doesn't pop up on macos and doesn't close on win32...
-#if !defined(_WIN32) && !defined(MACOSX)
+// FIXME: dialog doesn't pop up on macos...
+#if !defined(MACOSX)
 CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, BasicTestSectionDialog)
 {
 load(u"private:factory/swriter");
@@ -173,8 +173,8 @@ CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, 
BasicTestSectionDialog)
 }
 #endif
 
-// FIXME: dialog doesn't pop up on macos and doesn't close on win32...
-#if !defined(_WIN32) && !defined(MACOSX)
+// FIXME: dialog doesn't pop up on macos...
+#if !defined(MACOSX)
 CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, BasicTestFontworkDialog)
 {
 load(u"private:factory/swriter");
@@ -197,8 +197,8 @@ CPPUNIT_TEST_FIXTURE(test::SwAccessibleTestBase, 
BasicTestFontworkDialog)
 }
 #endif
 
-// FIXME: dialog doesn't pop up on macos and doesn't 

[Libreoffice-commits] core.git: include/test test/source

2023-03-03 Thread Colomban Wendling (via logerrit)
 include/test/a11y/AccessibilityTools.hxx |2 +
 test/source/a11y/AccessibilityTools.cxx  |   53 +++
 2 files changed, 55 insertions(+)

New commits:
commit 1791b26d75bd50971fe58627c6554f1711890817
Author: Colomban Wendling 
AuthorDate: Thu Nov 3 15:17:46 2022 +0100
Commit: Michael Weghorn 
CommitDate: Fri Mar 3 10:56:31 2023 +

test: Add debug print support for XAccessibleAction

Change-Id: Ic511f2abc62703ead40a585989c54345cf3c17ae
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142261
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/include/test/a11y/AccessibilityTools.hxx 
b/include/test/a11y/AccessibilityTools.hxx
index 749be0635198..38a76ce407f1 100644
--- a/include/test/a11y/AccessibilityTools.hxx
+++ b/include/test/a11y/AccessibilityTools.hxx
@@ -28,6 +28,7 @@
 
 #include 
 #include 
+#include 
 #include 
 
 class OOO_DLLPUBLIC_TEST AccessibilityTools
@@ -256,6 +257,7 @@ private:
 static OUString debugName(css::accessibility::XAccessibleContext* xctx);
 static OUString debugName(css::accessibility::XAccessible* xacc);
 static OUString debugName(const css::accessibility::AccessibleEventObject* 
evobj);
+static OUString debugName(css::accessibility::XAccessibleAction* xAct);
 };
 
 CPPUNIT_NS_BEGIN
diff --git a/test/source/a11y/AccessibilityTools.cxx 
b/test/source/a11y/AccessibilityTools.cxx
index 137b1bdc3a97..b754f46d2f69 100644
--- a/test/source/a11y/AccessibilityTools.cxx
+++ b/test/source/a11y/AccessibilityTools.cxx
@@ -24,8 +24,11 @@
 #include 
 #include 
 #include 
+#include 
 #include 
+#include 
 
+#include 
 #include 
 #include 
 #include 
@@ -647,6 +650,56 @@ OUString 
AccessibilityTools::debugName(accessibility::XAccessible* acc)
 return debugName(acc->getAccessibleContext().get());
 }
 
+OUString AccessibilityTools::debugName(accessibility::XAccessibleAction* xAct)
+{
+OUStringBuffer r = "actions=[";
+
+const sal_Int32 nActions = xAct->getAccessibleActionCount();
+for (sal_Int32 i = 0; i < nActions; i++)
+{
+if (i > 0)
+r.append(", ");
+
+r.append("description=\"");
+r.append(xAct->getAccessibleActionDescription(i));
+r.append('"');
+
+const auto& xKeyBinding = xAct->getAccessibleActionKeyBinding(i);
+if (xKeyBinding)
+{
+r.append(" keybindings=[");
+const sal_Int32 nKeyBindings = 
xKeyBinding->getAccessibleKeyBindingCount();
+for (sal_Int32 j = 0; j < nKeyBindings; j++)
+{
+if (j > 0)
+r.append(", ");
+
+int k = 0;
+for (const auto& keyStroke : 
xKeyBinding->getAccessibleKeyBinding(j))
+{
+if (k++ > 0)
+r.append(", ");
+
+r.append('"');
+if (keyStroke.Modifiers & awt::KeyModifier::MOD1)
+r.append("");
+if (keyStroke.Modifiers & awt::KeyModifier::MOD2)
+r.append("");
+if (keyStroke.Modifiers & awt::KeyModifier::MOD3)
+r.append("");
+if (keyStroke.Modifiers & awt::KeyModifier::SHIFT)
+r.append("");
+r.append(keyStroke.KeyChar);
+r.append('"');
+}
+}
+r.append("]");
+}
+}
+r.append("]");
+return r.makeStringAndClear();
+}
+
 OUString AccessibilityTools::debugName(const 
accessibility::AccessibleEventObject* evobj)
 {
 return "(AccessibleEventObject) { id=" + getEventIdName(evobj->EventId)


[Libreoffice-commits] core.git: include/test sw/qa test/source

2023-03-03 Thread Colomban Wendling (via logerrit)
 include/test/a11y/AccessibilityTools.hxx |   97 +++
 include/test/a11y/accessibletestbase.hxx |9 ++
 sw/qa/extras/accessibility/dialogs.cxx   |   81 +
 test/source/a11y/AccessibilityTools.cxx  |   20 ++
 test/source/a11y/accessibletestbase.cxx  |   27 
 5 files changed, 234 insertions(+)

New commits:
commit 7801b5f7562a8d1660053a2745b4f6e97b555bb2
Author: Colomban Wendling 
AuthorDate: Thu Nov 3 15:39:38 2022 +0100
Commit: Michael Weghorn 
CommitDate: Fri Mar 3 10:49:20 2023 +

test: Add helpers to get a specific object and tab to it

Add a tabTo() variant that accepts a target object that should gain
focus. This is useful to work around focus issues in the implementation
(although they should be reported and fixed), and it's a simpler and
more efficient API if the caller happens to already have a reference to
the target object.

This also adds AccessibilityTools::getAccessibleObjectForName() as a
usually more useful alternative to
AccessibilityTools::getAccessibleObjectForRole() as it allows to easily
match both role and name. There is also a template version accepting
multiple role and name pairs to further refine the selected object.

Together, it makes it easy to obtain the target object and tab to it,
in situations where the other tabTo() variant either doesn't work for
some reason (as mentioned above), or is not the slickest solution.

Change-Id: I6a41b147331132711ac84776bb43ad24a091ba24
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142260
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/include/test/a11y/AccessibilityTools.hxx 
b/include/test/a11y/AccessibilityTools.hxx
index 88276bac700d..749be0635198 100644
--- a/include/test/a11y/AccessibilityTools.hxx
+++ b/include/test/a11y/AccessibilityTools.hxx
@@ -53,6 +53,103 @@ public:
 getAccessibleObjectForRole(const 
css::uno::Reference& xacc,
sal_Int16 role);
 
+/**
+ * @brief Gets a descendant of @p xCtx (or @p xCtx itself) that matches 
the given role and name.
+ * @param xCtx An accessible context object to start the search from
+ * @param role The role of the object to look up.
+ * @param name The name of the object to look up.
+ * @returns The found object, or @c nullptr if not found.
+ *
+ * Finds a descendant of @p xCtx (or @p xCtx itself) that matches @p role 
and @p name.
+ * @code
+ * AccessibilityTools::getAccessibleObjectForName(
+ * css::accessibility::AccessibleRole::PUSH_BUTTON, u"Insert");
+ * @endcode
+ *
+ * @see AccessibilityTools::getAccessibleObjectForPredicate() */
+static css::uno::Reference 
getAccessibleObjectForName(
+const css::uno::Reference& 
xCtx,
+const sal_Int16 role, std::u16string_view name);
+static inline css::uno::Reference
+getAccessibleObjectForName(const 
css::uno::Reference& xAcc,
+   const sal_Int16 role, std::u16string_view name)
+{
+return getAccessibleObjectForName(xAcc->getAccessibleContext(), role, 
name);
+}
+
+/**
+ * @brief Gets a descendant of @p xCtx (or @p xCtx itself) that matches 
the last given role and
+ *name pair, and has ancestors matching the leading pairs in the 
given order.
+ * @param xCtx An accessible context to start the search from.
+ * @param role The role of the first ancestor to match.
+ * @param name The name of the first ancestor to match.
+ * @param Ts...args Additional role and name pairs of ancestors, ending 
with the role and name
+ *  pair of the target object to match.
+ * @returns The found object, or @c nullptr if not found.
+ *
+ * Specialized version allowing specifying arbitrary objects on the path 
to the target one. Not
+ * all objects have to be matched, but there have to be ancestors matching 
in the given order.
+ * This is useful to easily solve conflicts if there are more than one 
possible match.
+ *
+ * This can be used to find an "Insert" push button inside a panel named 
"Some group" for
+ * example, as shown below:
+ *
+ * @code
+ * AccessibilityTools::getAccessibleObjectForName(
+ * css::accessibility::AccessibleRole::PANEL, u"Some group",
+ * css::accessibility::AccessibleRole::PUSH_BUTTON, u"Insert");
+ * @endcode
+ *
+ * @note This returns the first match in the object tree when walking it 
depth-first.  Depending
+ *   on the tree, this might not be able to find the expected match, 
e.g. if there is a
+ *   first match with intermediate unmatched objects, and the target 
has the same tree but
+ *   without intermediate objects that can be used to refine the 
search and prevent the
+ *   unwanted tree to match.  The same issue arises with two 

[Libreoffice-commits] core.git: include/test sw/CppunitTest_sw_a11y.mk sw/qa test/Library_subsequenttest.mk test/source

2023-03-03 Thread Colomban Wendling (via logerrit)
 include/test/a11y/accessibletestbase.hxx |   60 -
 include/test/a11y/eventposter.hxx|  132 +
 sw/CppunitTest_sw_a11y.mk|1 
 sw/qa/extras/accessibility/dialogs.cxx   |  140 +++
 test/Library_subsequenttest.mk   |1 
 test/source/a11y/accessibletestbase.cxx  |   84 ++
 test/source/a11y/eventposter.cxx |   46 ++
 7 files changed, 458 insertions(+), 6 deletions(-)

New commits:
commit be86c74bb5bf04347846261243c8eb21dc8d7200
Author: Colomban Wendling 
AuthorDate: Thu Nov 3 15:08:25 2022 +0100
Commit: Michael Weghorn 
CommitDate: Fri Mar 3 09:58:46 2023 +

test: Add a few basic dialog tests and helpers

This adds basic tests for a few dialogues, showcasing and exercising
the dialog handling code.  Those tests are extremely basic but show
that it is trivial enough to interact with a dialog.

This adds a few helpers to navigate the UI using keyboard events as
well, because it's one of the best methods to verify the actual
interaction works for a user of assistive technologies.

Change-Id: Idc1f279f35ff01769138c3addb10ef851ca0dbb8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142259
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/include/test/a11y/accessibletestbase.hxx 
b/include/test/a11y/accessibletestbase.hxx
index e174c0cb4b8a..745f9fae2458 100644
--- a/include/test/a11y/accessibletestbase.hxx
+++ b/include/test/a11y/accessibletestbase.hxx
@@ -28,6 +28,7 @@
 
 #include 
 #include 
+#include 
 
 #include "AccessibilityTools.hxx"
 
@@ -130,13 +131,57 @@ protected:
 return activateMenuItem(menuBar, names...);
 }
 
+/**
+ * @brief Gets the focused accessible object at @p xAcc level or below
+ * @param xAcc An accessible object
+ * @returns The accessible context of the focused object, or @c nullptr
+ *
+ * Finds the accessible object context at or under @p xAcc that has the 
focused state (and is
+ * showing).  Normally only one such object should exist in a given 
hierarchy, but in all cases
+ * this function will return the first one found.
+ *
+ * @see AccessibilityTools::getAccessibleObjectForPredicate()
+ */
+static css::uno::Reference
+getFocusedObject(const 
css::uno::Reference& xCtx);
+
+static inline css::uno::Reference
+getFocusedObject(const 
css::uno::Reference& xAcc)
+{
+return getFocusedObject(xAcc->getAccessibleContext());
+}
+
+/**
+ * @brief Navigates through focusable elements using the Tab keyboard 
shortcut.
+ * @param xRoot The root element to look for focused elements in.
+ * @param role The accessible role of the element to tab to.
+ * @param name The accessible name of the element to tab to.
+ * @param pEventPosterHelper Pointer to a @c EventPosterHelper instance, 
or @c nullptr to obtain
+ *   it from @p xRoot.
+ * @returns The element tabbed to, or @c nullptr if not found.
+ *
+ * Navigates through focusable elements in the top level containing @p 
xRoot using the Tab
+ * keyboard key until the focused elements matches @p role and @p name.
+ *
+ * Note that usually @p xRoot should be the toplevel accessible, or at 
least contain all
+ * focusable elements within that window.  It is however *not* a 
requirement, but only elements
+ * actually inside it will be candidate for a match, and thus if focus 
goes outside it, it might
+ * lead to not finding the target element.
+ *
+ * If @p pEventPosterHelper is @c nullptr, this function will try to 
construct one from
+ * @p xRoot.  @see EventPosterHelper.
+ */
+static css::uno::Reference
+tabTo(const css::uno::Reference& xRoot, 
const sal_Int16 role,
+  const std::u16string_view name,
+  const EventPosterHelperBase* pEventPosterHelper = nullptr);
+
 /* Dialog handling */
-class Dialog
+class Dialog : public test::EventPosterHelper
 {
 friend class AccessibleTestBase;
 
 private:
-VclPtr mxWindow;
 bool mbAutoClose;
 
 Dialog(vcl::Window* pWindow, bool bAutoClose = true);
@@ -144,9 +189,6 @@ protected:
 public:
 virtual ~Dialog();
 
-explicit operator bool() const { return mxWindow && 
!mxWindow->isDisposed(); }
-bool operator!() const { return !bool(*this); }
-
 void setAutoClose(bool bAutoClose) { mbAutoClose = bAutoClose; }
 
 css::uno::Reference getAccessible() 
const
@@ -155,6 +197,12 @@ protected:
 }
 
 bool close(sal_Int32 result = VclResponseType::RET_CANCEL);
+
+css::uno::Reference
+tabTo(const sal_Int16 role, const std::u16string_view name)
+{
+return AccessibleTestBase::tabTo(getAccessible(), role, name, 
this);
+}
 };
 
 class 

[Libreoffice-commits] core.git: include/test test/qa test/source

2023-02-25 Thread Andrea Gelmini (via logerrit)
 include/test/a11y/accessibletestbase.hxx |2 +-
 test/qa/cppunit/dialog.cxx   |2 +-
 test/source/a11y/accessibletestbase.cxx  |2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 5cc761b5d0852d0f5d7954692b2a152a28dcd425
Author: Andrea Gelmini 
AuthorDate: Fri Feb 24 20:59:50 2023 +0100
Commit: Julien Nabet 
CommitDate: Sat Feb 25 10:38:00 2023 +

Fix typos

Change-Id: I7e3d78e6cf80afb72be61942ac95c474dae0424d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147669
Tested-by: Julien Nabet 
Reviewed-by: Julien Nabet 

diff --git a/include/test/a11y/accessibletestbase.hxx 
b/include/test/a11y/accessibletestbase.hxx
index 913e24221353..e174c0cb4b8a 100644
--- a/include/test/a11y/accessibletestbase.hxx
+++ b/include/test/a11y/accessibletestbase.hxx
@@ -167,7 +167,7 @@ protected:
  * @param nTimeoutMs Maximum delay to wait the dialog for
  * @returns @c true if the dialog closed, @c false if timeout was 
reached
  *
- * @throws css::uno::RuntimeException if an unexpected dialog poped up 
instead of the
+ * @throws css::uno::RuntimeException if an unexpected dialog popped 
up instead of the
  * expected one.
  * @throws Any exception that the user callback supplied to 
awaitDialog() might have thrown.
  */
diff --git a/test/qa/cppunit/dialog.cxx b/test/qa/cppunit/dialog.cxx
index f64e7d13a68c..c3f68a8f0e4e 100644
--- a/test/qa/cppunit/dialog.cxx
+++ b/test/qa/cppunit/dialog.cxx
@@ -22,7 +22,7 @@ CPPUNIT_TEST_FIXTURE(test::AccessibleTestBase, 
SelfTestIncorrectDialog)
 });
 
 CPPUNIT_ASSERT(activateMenuItem(u"Insert", u"Section..."));
-/* Make sure an incorrect dialog poping up is caught and raises.  The 
exception is thrown in
+/* Make sure an incorrect dialog popping up is caught and raises.  The 
exception is thrown in
  * waitEndDialog() for consistency even though the error itself is likely 
to have been triggered
  * by the activateMenuItem() call above */
 CPPUNIT_ASSERT_THROW(dialogWaiter->waitEndDialog(), 
css::uno::RuntimeException);
diff --git a/test/source/a11y/accessibletestbase.cxx 
b/test/source/a11y/accessibletestbase.cxx
index 5566eb6cd9a0..47a77e864932 100644
--- a/test/source/a11y/accessibletestbase.cxx
+++ b/test/source/a11y/accessibletestbase.cxx
@@ -333,7 +333,7 @@ test::AccessibleTestBase::awaitDialog(const 
std::u16string_view name,
  * fails/throws */
 Dialog dialog(pWin, true);
 
-/* The poping up dialog ought to be the right one, or something's 
fishy and
+/* The popping up dialog ought to be the right one, or something's 
fishy and
  * we're bound to failure (e.g. waiting on a dialog that either 
will never come, or
  * that will not run after the current one -- deadlock style) */
 if (msName != pWin->GetText())


[Libreoffice-commits] core.git: include/test test/CppunitTest_test_a11y.mk test/Module_test.mk test/qa test/source

2023-02-24 Thread Colomban Wendling (via logerrit)
 include/test/a11y/accessibletestbase.hxx |   99 +++
 test/CppunitTest_test_a11y.mk|   31 ++
 test/Module_test.mk  |1 
 test/qa/cppunit/dialog.cxx   |   66 +
 test/source/a11y/accessibletestbase.cxx  |  156 +++
 5 files changed, 353 insertions(+)

New commits:
commit 0ccea0dd6e50199af4a7aae75d691b32c853b177
Author: Colomban Wendling 
AuthorDate: Thu Oct 27 19:07:44 2022 +0200
Commit: Michael Weghorn 
CommitDate: Fri Feb 24 15:13:39 2023 +

test: Add accessibility test dialog infrastructure

Interacting with dialogues in tests is non-trivial, so introduce
helpers to make it simpler and less error-prone.

Add tests for the infrastructure itself as well.

Change-Id: I8ea6087a61380194eb2b5ec9f25091db00f5a550
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142258
Reviewed-by: Michael Weghorn 
Tested-by: Jenkins

diff --git a/include/test/a11y/accessibletestbase.hxx 
b/include/test/a11y/accessibletestbase.hxx
index 50a39f63a7dd..913e24221353 100644
--- a/include/test/a11y/accessibletestbase.hxx
+++ b/include/test/a11y/accessibletestbase.hxx
@@ -24,6 +24,7 @@
 #include 
 
 #include 
+#include 
 
 #include 
 #include 
@@ -129,6 +130,104 @@ protected:
 return activateMenuItem(menuBar, names...);
 }
 
+/* Dialog handling */
+class Dialog
+{
+friend class AccessibleTestBase;
+
+private:
+VclPtr mxWindow;
+bool mbAutoClose;
+
+Dialog(vcl::Window* pWindow, bool bAutoClose = true);
+
+public:
+virtual ~Dialog();
+
+explicit operator bool() const { return mxWindow && 
!mxWindow->isDisposed(); }
+bool operator!() const { return !bool(*this); }
+
+void setAutoClose(bool bAutoClose) { mbAutoClose = bAutoClose; }
+
+css::uno::Reference getAccessible() 
const
+{
+return mxWindow ? mxWindow->GetAccessible() : nullptr;
+}
+
+bool close(sal_Int32 result = VclResponseType::RET_CANCEL);
+};
+
+class DialogWaiter
+{
+public:
+virtual ~DialogWaiter() {}
+
+/**
+ * @brief Waits for the associated dialog to close
+ * @param nTimeoutMs Maximum delay to wait the dialog for
+ * @returns @c true if the dialog closed, @c false if timeout was 
reached
+ *
+ * @throws css::uno::RuntimeException if an unexpected dialog poped up 
instead of the
+ * expected one.
+ * @throws Any exception that the user callback supplied to 
awaitDialog() might have thrown.
+ */
+virtual bool waitEndDialog(sal_uInt64 nTimeoutMs = 3000) = 0;
+};
+
+/**
+ * @brief Helper to call user code when a given dialog opens
+ * @param name The title of the dialog window to wait for
+ * @param callback The user code to run when the given dialog opens
+ * @param bAutoClose Whether to automatically cancel the dialog after the 
user code finished, if
+ *   the dialog is still there.  You should leave this to 
@c true unless you
+ *   know exactly what you are doing, see below.
+ * @returns A @c DialogWaiter wrapper on which call waitEndDialog() after 
having triggered the
+ *  dialog in some way.
+ *
+ * This function makes it fairly easy and safe to execute code once a 
dialog pops up:
+ * @code
+ * auto waiter = awaitDialog(u"Special Characters", [this](Dialog ) 
{
+ * // for example, something like this:
+ * // something();
+ * // CPPUNIT_ASSERT(somethingElse);
+ * });
+ * CPPUNIT_ASSERT(activateMenuItem(u"Some menu", u"Some Item Triggering a 
Dialog..."));
+ * CPPUNIT_ASSERT(waiter->waitEndDialog());
+ * @endcode
+ *
+ * @note The user code might actually be executed before 
DialogWaiter::waitEndDialog() is
+ *   called.  It is actually likely to be called at the time the call 
that triggers the
+ *   dialog happens.  However, as letting an exception slip in a event 
handler is likely to
+ *   cause problems, exceptions are forwarded to the 
DialogWaiter::waitEndDialog() call.
+ *   However, note that you cannot rely on something like this:
+ *   @code
+ *   int foo = 0;
+ *   auto waiter = awaitDialog(u"Some Dialog", [](Dialog&) {
+ *   CPPUNIT_ASSERT_EQUAL(1, foo);
+ *   });
+ *   CPPUNIT_ASSERT(activateMenuItem(u"Some menu", u"Some Item 
Triggering a Dialog..."));
+ *   foo = 1; // here, the callback likely already ran as a result of 
the
+ *// Scheduler::ProcessEventsToIdle() call that 
activateMenuItem() did.
+ *   CPPUNIT_ASSERT(waiter->waitEndDialog());
+ *   @endcode
+ *
+ * @warning You should almost certainly always leave @p bAutoClose to @c 
true. If it is set to
+ * 

[Libreoffice-commits] core.git: include/test

2023-02-03 Thread Colomban Wendling (via logerrit)
 include/test/a11y/AccessibilityTools.hxx |1 -
 1 file changed, 1 deletion(-)

New commits:
commit fb42b73d50eb3856a96c8c6f269e37d9da2181f2
Author: Colomban Wendling 
AuthorDate: Thu Feb 2 11:08:37 2023 +0100
Commit: Noel Grandin 
CommitDate: Fri Feb 3 17:11:12 2023 +

test/a11y: Remove declaration for undefined method

getStateName() has been removed and superseded by
debugAccessibleStateSet() in 8d8e6c84e512c1a8b33aac75965b84481d1a1d13
but its declaration was still there.

Change-Id: I3c7a9dc74b7230cde2fc61a86ca7659e35ba2bdf
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146496
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/include/test/a11y/AccessibilityTools.hxx 
b/include/test/a11y/AccessibilityTools.hxx
index 65116a2d19d4..88276bac700d 100644
--- a/include/test/a11y/AccessibilityTools.hxx
+++ b/include/test/a11y/AccessibilityTools.hxx
@@ -78,7 +78,6 @@ public:
 }
 
 static OUString getRoleName(const sal_Int16 role);
-static OUString getStateName(const sal_Int16 state);
 static OUString getEventIdName(const sal_Int16 event_id);
 static OUString getRelationTypeName(const sal_Int16 rel_type);
 


[Libreoffice-commits] core.git: include/test test/Library_subsequenttest.mk test/source

2023-01-25 Thread Colomban Wendling (via logerrit)
 include/test/a11y/AccessibilityTools.hxx |   19 ++
 test/Library_subsequenttest.mk   |1 
 test/source/a11y/AccessibilityTools.cxx  |   41 +++
 test/source/a11y/accessibletestbase.cxx  |   28 -
 4 files changed, 62 insertions(+), 27 deletions(-)

New commits:
commit 293db294e3408eda3f3133925fd307011b13c8d8
Author: Colomban Wendling 
AuthorDate: Wed Oct 19 18:31:43 2022 +0200
Commit: Michael Weghorn 
CommitDate: Wed Jan 25 08:22:01 2023 +

test: Add AccessibilityTools::nameEquals()

Some accessible names contain a suffix when OSL_DEBUG_LEVEL > 0, which
makes it tricky to compare to a known value.  To fix that, introduce a
helper that knows how and when to deal with the suffix properly that
can then be used to easily check accessible names.

As we already have a similar, yet private, helper for menu items on
Windows (that include the keybinding label as a suffix), merge the two
together in a unified solution for comparing names.

Change-Id: I7e67edbc7817218ef3e097062d25888172056c21
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142257
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/include/test/a11y/AccessibilityTools.hxx 
b/include/test/a11y/AccessibilityTools.hxx
index 1efd0b9f2960..65116a2d19d4 100644
--- a/include/test/a11y/AccessibilityTools.hxx
+++ b/include/test/a11y/AccessibilityTools.hxx
@@ -58,6 +58,25 @@ public:
 static bool equals(const 
css::uno::Reference& xctx1,
const 
css::uno::Reference& xctx2);
 
+/**
+ * @brief Compares the accessible name against a string
+ * @param xCtx A XAccessibleContext on which compare the name
+ * @param name The string to compare to
+ * @returns @c true if @p xCtx name matches @p name.
+ *
+ * This is conceptually equivalent to @code xCtx->getAccessibleName() == 
name @endcode, but
+ * handles the case OSL debugging is active and inserts a type suffix.  
Unless you know for
+ * sure the accessible you are comparing is not subject to those suffixes 
under debugging,
+ * always use this function instead of direct comparison.
+ */
+static bool nameEquals(const 
css::uno::Reference& xCtx,
+   const std::u16string_view name);
+static bool nameEquals(const 
css::uno::Reference& xAcc,
+   const std::u16string_view name)
+{
+return nameEquals(xAcc->getAccessibleContext(), name);
+}
+
 static OUString getRoleName(const sal_Int16 role);
 static OUString getStateName(const sal_Int16 state);
 static OUString getEventIdName(const sal_Int16 event_id);
diff --git a/test/Library_subsequenttest.mk b/test/Library_subsequenttest.mk
index 98eb17a5a557..1e94db958852 100644
--- a/test/Library_subsequenttest.mk
+++ b/test/Library_subsequenttest.mk
@@ -29,6 +29,7 @@ $(eval $(call gb_Library_use_libraries,subsequenttest,\
sal \
sfx \
test \
+   tk \
tl \
utl \
unotest \
diff --git a/test/source/a11y/AccessibilityTools.cxx 
b/test/source/a11y/AccessibilityTools.cxx
index 7a89ac2ac80f..8afc1687c889 100644
--- a/test/source/a11y/AccessibilityTools.cxx
+++ b/test/source/a11y/AccessibilityTools.cxx
@@ -27,8 +27,10 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
+#include 
 
 using namespace css;
 
@@ -136,6 +138,45 @@ bool AccessibilityTools::equals(const 
uno::ReferencegetAccessibleParent(), xctx2->getAccessibleParent());
 }
 
+bool AccessibilityTools::nameEquals(const 
uno::Reference& xCtx,
+const std::u16string_view name)
+{
+auto ctxName = xCtx->getAccessibleName();
+OUString rest;
+
+if (!ctxName.startsWith(name, ))
+return false;
+if (rest == u"")
+return true;
+
+#if defined(_WIN32)
+// see OAccessibleMenuItemComponent::GetAccessibleName():
+// on Win32, ignore a \tSHORTCUT suffix on a menu item
+switch (xCtx->getAccessibleRole())
+{
+case accessibility::AccessibleRole::MENU_ITEM:
+case accessibility::AccessibleRole::RADIO_MENU_ITEM:
+case accessibility::AccessibleRole::CHECK_MENU_ITEM:
+return rest[0] == '\t';
+
+default:
+break;
+}
+#endif
+
+#if OSL_DEBUG_LEVEL > 0
+// see VCLXAccessibleComponent::getAccessibleName()
+auto pVCLXAccessibleComponent = 
dynamic_cast(xCtx.get());
+if (pVCLXAccessibleComponent)
+{
+auto windowType = pVCLXAccessibleComponent->GetWindow()->GetType();
+if (rest == u" (Type = " + 
OUString::number(static_cast(windowType)) + ")")
+return true;
+}
+#endif
+return false;
+}
+
 static OUString unknownName(const sal_Int64 value)
 {
 return "unknown (" + OUString::number(value) + ")";
diff --git a/test/source/a11y/accessibletestbase.cxx 
b/test/source/a11y/accessibletestbase.cxx
index 

[Libreoffice-commits] core.git: include/test sc/qa svx/qa

2022-12-21 Thread Xisco Fauli (via logerrit)
 include/test/unoapi_test.hxx   |2 
 sc/qa/unit/bugfix-test.cxx |   24 +-
 sc/qa/unit/helper/qahelper.hxx |2 
 sc/qa/unit/scshapetest.cxx |   92 -
 svx/qa/unit/customshapes.cxx   |   16 +++
 5 files changed, 68 insertions(+), 68 deletions(-)

New commits:
commit 179f50f810dfa1779de5c1f212f3887031e5567d
Author: Xisco Fauli 
AuthorDate: Wed Dec 21 16:43:18 2022 +0100
Commit: Xisco Fauli 
CommitDate: Wed Dec 21 19:09:46 2022 +

qa: hint about tolerance in names

As suggested by Mike in https://gerrit.libreoffice.org/c/core/+/144171

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

diff --git a/include/test/unoapi_test.hxx b/include/test/unoapi_test.hxx
index e008b11ca2f0..e329168dfe7b 100644
--- a/include/test/unoapi_test.hxx
+++ b/include/test/unoapi_test.hxx
@@ -97,7 +97,7 @@ inline void assertRectangleEqual(const tools::Rectangle& 
rExpected, const tools:
rSourceLine, "different Height");
 }
 
-#define CPPUNIT_ASSERT_RECTANGLE_EQUAL(aExpected, aActual, aTolerance) 
\
+#define CPPUNIT_ASSERT_RECTANGLE_EQUAL_WITH_TOLERANCE(aExpected, aActual, 
aTolerance)  \
 assertRectangleEqual(aExpected, aActual, aTolerance, CPPUNIT_SOURCELINE())
 
 #endif // INCLUDED_TEST_UNOAPI_TEST_HXX
diff --git a/sc/qa/unit/bugfix-test.cxx b/sc/qa/unit/bugfix-test.cxx
index 4c7137d39ab2..af5bd91fc27b 100644
--- a/sc/qa/unit/bugfix-test.cxx
+++ b/sc/qa/unit/bugfix-test.cxx
@@ -106,9 +106,9 @@ void ScFiltersTest::testTdf137576_Measureline()
 
 // Check start and end point of measureline
 const Point aStart = pObj->GetPoint(0);
-CPPUNIT_ASSERT_POINT_EQUAL(Point(4800, 1500), aStart, 1);
+CPPUNIT_ASSERT_POINT_EQUAL_WITH_TOLERANCE(Point(4800, 1500), aStart, 1);
 const Point aEnd = pObj->GetPoint(1);
-CPPUNIT_ASSERT_POINT_EQUAL(Point(4800, 5200), aEnd, 1);
+CPPUNIT_ASSERT_POINT_EQUAL_WITH_TOLERANCE(Point(4800, 5200), aEnd, 1);
 
 // Save and reload
 saveAndReload("calc8");
@@ -124,9 +124,9 @@ void ScFiltersTest::testTdf137576_Measureline()
 
 // Check start and end point of measureline, should be unchanged
 const Point aStart2 = pObj->GetPoint(0);
-CPPUNIT_ASSERT_POINT_EQUAL(Point(4800, 1500), aStart2, 1);
+CPPUNIT_ASSERT_POINT_EQUAL_WITH_TOLERANCE(Point(4800, 1500), aStart2, 1);
 const Point aEnd2 = pObj->GetPoint(1);
-CPPUNIT_ASSERT_POINT_EQUAL(Point(4800, 5200), aEnd2, 1);
+CPPUNIT_ASSERT_POINT_EQUAL_WITH_TOLERANCE(Point(4800, 5200), aEnd2, 1);
 }
 
 void ScFiltersTest::testTdf137216_HideCol()
@@ -173,9 +173,9 @@ void ScFiltersTest::testTdf137044_CoverHiddenRows()
 // Get original object values
 tools::Rectangle aSnapRectOrig = pObj->GetSnapRect();
 Point aOriginalEndOffset = ScDrawLayer::GetObjData(pObj)->maEndOffset;
-CPPUNIT_ASSERT_RECTANGLE_EQUAL(tools::Rectangle(Point(500, 3500), 
Size(1501, 11001)),
-   aSnapRectOrig, 1);
-CPPUNIT_ASSERT_POINT_EQUAL(Point(2000, 2499), aOriginalEndOffset, 1);
+CPPUNIT_ASSERT_RECTANGLE_EQUAL_WITH_TOLERANCE(
+tools::Rectangle(Point(500, 3500), Size(1501, 11001)), aSnapRectOrig, 
1);
+CPPUNIT_ASSERT_POINT_EQUAL_WITH_TOLERANCE(Point(2000, 2499), 
aOriginalEndOffset, 1);
 
 // Hide rows 5 and 6 in UI = row index 4 to 5.
 pDoc->SetRowHidden(4, 5, 0, true);
@@ -195,9 +195,9 @@ void ScFiltersTest::testTdf137044_CoverHiddenRows()
 // Get new values and compare. End offset should be the same, height 
should be 6000 smaller.
 tools::Rectangle aSnapRectReload = pObj->GetSnapRect();
 Point aReloadEndOffset = ScDrawLayer::GetObjData(pObj)->maEndOffset;
-CPPUNIT_ASSERT_RECTANGLE_EQUAL(tools::Rectangle(Point(500, 3500), 
Size(1501, 5001)),
-   aSnapRectReload, 1);
-CPPUNIT_ASSERT_POINT_EQUAL(Point(2000, 2499), aReloadEndOffset, 1);
+CPPUNIT_ASSERT_RECTANGLE_EQUAL_WITH_TOLERANCE(
+tools::Rectangle(Point(500, 3500), Size(1501, 5001)), aSnapRectReload, 
1);
+CPPUNIT_ASSERT_POINT_EQUAL_WITH_TOLERANCE(Point(2000, 2499), 
aReloadEndOffset, 1);
 }
 
 void ScFiltersTest::testTdf137020_FlipVertical()
@@ -219,7 +219,7 @@ void ScFiltersTest::testTdf137020_FlipVertical()
 // Vertical mirror on center should not change the snap rect.
 pObj->Mirror(aSnapRectOrig.LeftCenter(), aSnapRectOrig.RightCenter());
 const tools::Rectangle aSnapRectFlip = pObj->GetSnapRect();
-CPPUNIT_ASSERT_RECTANGLE_EQUAL(aSnapRectOrig, aSnapRectFlip, 1);
+CPPUNIT_ASSERT_RECTANGLE_EQUAL_WITH_TOLERANCE(aSnapRectOrig, 
aSnapRectFlip, 1);
 
 // Save and reload
 saveAndReload("calc8");
@@ -235,7 +235,7 @@ void ScFiltersTest::testTdf137020_FlipVertical()
 
 // Check pos and size of shape again, should be unchanged
 const 

[Libreoffice-commits] core.git: include/test sc/qa svx/qa

2022-12-14 Thread Xisco Fauli (via logerrit)
 include/test/unoapi_test.hxx |   16 +++
 sc/qa/unit/bugfix-test.cxx   |   44 ++---
 sc/qa/unit/scshapetest.cxx   |   89 +++
 svx/qa/unit/customshapes.cxx |   46 +++---
 4 files changed, 54 insertions(+), 141 deletions(-)

New commits:
commit 15df8e5422010e0806eb9e93bd8822519c1ab989
Author: Xisco Fauli 
AuthorDate: Wed Dec 14 18:46:19 2022 +0100
Commit: Xisco Fauli 
CommitDate: Thu Dec 15 07:43:49 2022 +

UnoApiTest: introduce CPPUNIT_ASSERT_RECTANGLE_EQUAL

and get rid of duplicated code

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

diff --git a/include/test/unoapi_test.hxx b/include/test/unoapi_test.hxx
index f228f70e21ca..e008b11ca2f0 100644
--- a/include/test/unoapi_test.hxx
+++ b/include/test/unoapi_test.hxx
@@ -84,6 +84,22 @@ private:
 OUString maImportFilterName;
 };
 
+inline void assertRectangleEqual(const tools::Rectangle& rExpected, const 
tools::Rectangle& rActual,
+ const sal_Int32 nTolerance, const 
CppUnit::SourceLine& rSourceLine)
+{
+CPPUNIT_NS::assertDoubleEquals(rExpected.Top(), rActual.Top(), nTolerance, 
rSourceLine,
+   "different Top");
+CPPUNIT_NS::assertDoubleEquals(rExpected.Left(), rActual.Left(), 
nTolerance, rSourceLine,
+   "different Left");
+CPPUNIT_NS::assertDoubleEquals(rExpected.GetWidth(), rActual.GetWidth(), 
nTolerance,
+   rSourceLine, "different Width");
+CPPUNIT_NS::assertDoubleEquals(rExpected.GetHeight(), rActual.GetHeight(), 
nTolerance,
+   rSourceLine, "different Height");
+}
+
+#define CPPUNIT_ASSERT_RECTANGLE_EQUAL(aExpected, aActual, aTolerance) 
\
+assertRectangleEqual(aExpected, aActual, aTolerance, CPPUNIT_SOURCELINE())
+
 #endif // INCLUDED_TEST_UNOAPI_TEST_HXX
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/qa/unit/bugfix-test.cxx b/sc/qa/unit/bugfix-test.cxx
index cc7673c72b8a..4c7137d39ab2 100644
--- a/sc/qa/unit/bugfix-test.cxx
+++ b/sc/qa/unit/bugfix-test.cxx
@@ -87,38 +87,6 @@ public:
 CPPUNIT_TEST_SUITE_END();
 };
 
-static void lcl_AssertRectEqualWithTolerance(std::string_view sInfo,
- const tools::Rectangle& rExpected,
- const tools::Rectangle& rActual,
- const sal_Int32 nTolerance)
-{
-// Left
-OString sMsg = OString::Concat(sInfo) + " Left expected " + 
OString::number(rExpected.Left())
-   + " actual " + OString::number(rActual.Left()) + " 
Tolerance "
-   + OString::number(nTolerance);
-CPPUNIT_ASSERT_MESSAGE(sMsg.getStr(),
-   std::abs(rExpected.Left() - rActual.Left()) <= 
nTolerance);
-
-// Top
-sMsg = OString::Concat(sInfo) + " Top expected " + 
OString::number(rExpected.Top()) + " actual "
-   + OString::number(rActual.Top()) + " Tolerance " + 
OString::number(nTolerance);
-CPPUNIT_ASSERT_MESSAGE(sMsg.getStr(), std::abs(rExpected.Top() - 
rActual.Top()) <= nTolerance);
-
-// Width
-sMsg = OString::Concat(sInfo) + " Width expected " + 
OString::number(rExpected.GetWidth())
-   + " actual " + OString::number(rActual.GetWidth()) + " Tolerance "
-   + OString::number(nTolerance);
-CPPUNIT_ASSERT_MESSAGE(sMsg.getStr(),
-   std::abs(rExpected.GetWidth() - rActual.GetWidth()) 
<= nTolerance);
-
-// Height
-sMsg = OString::Concat(sInfo) + " Height expected " + 
OString::number(rExpected.GetHeight())
-   + " actual " + OString::number(rActual.GetHeight()) + " Tolerance "
-   + OString::number(nTolerance);
-CPPUNIT_ASSERT_MESSAGE(sMsg.getStr(),
-   std::abs(rExpected.GetHeight() - 
rActual.GetHeight()) <= nTolerance);
-}
-
 void ScFiltersTest::testTdf137576_Measureline()
 {
 // The document contains a vertical measure line, anchored "To Cell 
(resize with cell)" with
@@ -205,8 +173,8 @@ void ScFiltersTest::testTdf137044_CoverHiddenRows()
 // Get original object values
 tools::Rectangle aSnapRectOrig = pObj->GetSnapRect();
 Point aOriginalEndOffset = ScDrawLayer::GetObjData(pObj)->maEndOffset;
-lcl_AssertRectEqualWithTolerance("Load:", tools::Rectangle(Point(500, 
3500), Size(1501, 11001)),
- aSnapRectOrig, 1);
+CPPUNIT_ASSERT_RECTANGLE_EQUAL(tools::Rectangle(Point(500, 3500), 
Size(1501, 11001)),
+   aSnapRectOrig, 1);
 CPPUNIT_ASSERT_POINT_EQUAL(Point(2000, 2499), aOriginalEndOffset, 1);
 
 // Hide rows 5 and 6 in UI = row index 4 to 5.
@@ -227,8 +195,8 @@ void 

[Libreoffice-commits] core.git: include/test test/source

2022-11-25 Thread Mike Kaganski (via logerrit)
 include/test/xmltesttools.hxx |   10 +++---
 test/source/xmltesttools.cxx  |5 -
 2 files changed, 3 insertions(+), 12 deletions(-)

New commits:
commit 2f91ab025de850fe5af8114565755a8deed55911
Author: Mike Kaganski 
AuthorDate: Fri Nov 25 16:36:57 2022 +0300
Commit: Mike Kaganski 
CommitDate: Fri Nov 25 17:19:10 2022 +0100

Merge two assertXPath overloads that both check number of nodes

Change-Id: I67eec623b90ab20330fa0c268152211b6bbdbe1e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143301
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/include/test/xmltesttools.hxx b/include/test/xmltesttools.hxx
index a9f30f7d227d..09f06af5eb0d 100644
--- a/include/test/xmltesttools.hxx
+++ b/include/test/xmltesttools.hxx
@@ -65,10 +65,6 @@ protected:
  * Get the number of the nodes returned by the rXPath.
  */
 int   countXPathNodes(const xmlDocUniquePtr& pXmlDoc, const 
OString& rXPath);
-/**
- * Assert that rXPath exists, and returns exactly one node.
- */
-void  assertXPath(const xmlDocUniquePtr& pXmlDoc, const OString& 
rXPath);
 /**
  * Assert that rXPath exists, returns exactly one node, and the rXPath's 
attribute's value
  * equals to the rExpected value.
@@ -78,10 +74,10 @@ protected:
 void  assertXPathAttrs(const xmlDocUniquePtr& pXmlDoc, const 
OString& rXPath,
   const std::vector>& 
aPairVector);
 /**
- * Assert that rXPath exists, and returns exactly nNumberOfNodes nodes.
- * Useful for checking that we do _not_ export some node (nNumberOfNodes 
== 0).
+ * Assert that rXPath exists, and returns exactly nNumberOfNodes nodes (1 
by default).
+ * Also useful for checking that we do _not_ export some node 
(nNumberOfNodes == 0).
  */
-void  assertXPath(const xmlDocUniquePtr& pXmlDoc, const OString& 
rXPath, int nNumberOfNodes);
+void  assertXPath(const xmlDocUniquePtr& pXmlDoc, const OString& 
rXPath, int nNumberOfNodes = 1);
 /**
  * Assert that rXPath exists, and its content equals rContent.
  */
diff --git a/test/source/xmltesttools.cxx b/test/source/xmltesttools.cxx
index 26973b440c61..e329bc968760 100644
--- a/test/source/xmltesttools.cxx
+++ b/test/source/xmltesttools.cxx
@@ -162,11 +162,6 @@ OUString XmlTestTools::getXPathContent(const 
xmlDocUniquePtr& pXmlDoc, const OSt
 CPPUNIT_FAIL("Invalid XPath type");
 }
 
-void XmlTestTools::assertXPath(const xmlDocUniquePtr& pXmlDoc, const OString& 
rXPath)
-{
-getXPath(pXmlDoc, rXPath, ""); // it asserts that rXPath exists, and 
returns exactly one node
-}
-
 void XmlTestTools::assertXPath(const xmlDocUniquePtr& pXmlDoc, const OString& 
rXPath, const OString& rAttribute, const OUString& rExpectedValue)
 {
 OUString aValue = getXPath(pXmlDoc, rXPath, rAttribute);


[Libreoffice-commits] core.git: include/test sw/qa sw/source test/source

2022-11-25 Thread Mike Kaganski (via logerrit)
 include/test/xmltesttools.hxx  |4 ++
 sw/qa/extras/ooxmlexport/data/tdf152200-field+textbox.docx |binary
 sw/qa/extras/ooxmlexport/ooxmlexport18.cxx |   25 +
 sw/source/filter/ww8/wrtw8nds.cxx  |8 
 test/source/xmltesttools.cxx   |   12 --
 5 files changed, 46 insertions(+), 3 deletions(-)

New commits:
commit ec345c02d8fa5a7c7d4ea4ad08ae7be5303d9b20
Author: Mike Kaganski 
AuthorDate: Fri Nov 25 15:20:48 2022 +0300
Commit: Mike Kaganski 
CommitDate: Fri Nov 25 16:54:30 2022 +0100

tdf#152200: Make sure to not write objects into field character runs

Similar how it's done for preceding objects immediately after calculating
'ofs', we also need to make sure to create a separate run for the objects
that may be anchored after the last character; otherwise, the field that
was just processed (and is waiting in the attributes) would be put out of
place, inside an inner run (e.g., in a text box inside the object).

Change-Id: I2702693595acf4befdbd25ef07a9f7c444926aab
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143297
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/include/test/xmltesttools.hxx b/include/test/xmltesttools.hxx
index f408273b802e..a9f30f7d227d 100644
--- a/include/test/xmltesttools.hxx
+++ b/include/test/xmltesttools.hxx
@@ -61,6 +61,10 @@ protected:
  * Useful for checking relative order of elements.
  */
 int   getXPathPosition(const xmlDocUniquePtr& pXmlDoc, const 
OString& rXPath, std::string_view rChildName);
+/**
+ * Get the number of the nodes returned by the rXPath.
+ */
+int   countXPathNodes(const xmlDocUniquePtr& pXmlDoc, const 
OString& rXPath);
 /**
  * Assert that rXPath exists, and returns exactly one node.
  */
diff --git a/sw/qa/extras/ooxmlexport/data/tdf152200-field+textbox.docx 
b/sw/qa/extras/ooxmlexport/data/tdf152200-field+textbox.docx
new file mode 100644
index ..606d1346a27a
Binary files /dev/null and 
b/sw/qa/extras/ooxmlexport/data/tdf152200-field+textbox.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx 
b/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx
index 04c775fa8fcb..8e2732faead8 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport18.cxx
@@ -187,6 +187,31 @@ CPPUNIT_TEST_FIXTURE(Test, testImageCropping)
 CPPUNIT_ASSERT_EQUAL(sal_Int32(0), aGraphicCropStruct.Bottom);
 }
 
+CPPUNIT_TEST_FIXTURE(Test, testTdf152200)
+{
+// Given a document with a fly anchored after a FORMTEXT in the end of the 
paragraph:
+createSwDoc("tdf152200-field+textbox.docx");
+
+// When exporting that back to DOCX:
+save("Office Open XML Text");
+
+// Then make sure that fldChar with type 'end' goes prior to the at-char 
anchored fly.
+xmlDocUniquePtr pXmlDoc = parseExport("word/document.xml");
+const int nRunsBeforeFldCharEnd = countXPathNodes(pXmlDoc, 
"//w:fldChar[@w:fldCharType='end']/preceding::w:r");
+CPPUNIT_ASSERT(nRunsBeforeFldCharEnd);
+const int nRunsBeforeAlternateContent = countXPathNodes(pXmlDoc, 
"//mc:AlternateContent/preceding::w:r");
+CPPUNIT_ASSERT(nRunsBeforeAlternateContent);
+// Without the accompanying fix in place, this test would have failed with:
+// - Expected greater than: 6
+// - Actual  : 5
+CPPUNIT_ASSERT_GREATER(nRunsBeforeFldCharEnd, nRunsBeforeAlternateContent);
+// Make sure we only have one paragraph in body, and only three field 
characters overal,
+// located directly in runs of this paragraph
+assertXPath(pXmlDoc, "/w:document/w:body/w:p");
+assertXPath(pXmlDoc, "/w:document/w:body/w:p/w:r/w:fldChar", 3);
+assertXPath(pXmlDoc, "//w:fldChar", 3); // no field characters elsewhere
+}
+
 CPPUNIT_PLUGIN_IMPLEMENT();
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx 
b/sw/source/filter/ww8/wrtw8nds.cxx
index a173a2014c4b..115a009bde79 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -2640,6 +2640,14 @@ void MSWordExportBase::OutputTextNode( SwTextNode& rNode 
)
 bPostponeWritingText = false ;
 AttrOutput().RunText( aSnippet, eChrSet );
 }
+
+if (ofs == 1 && nNextAttr == nEnd)
+{
+// tdf#152200: There could be flys anchored after the last 
position; make sure
+// to provide a separate run after field character to 
write them
+AttrOutput().EndRun(, nCurrentPos, -1, nNextAttr == 
nEnd);
+AttrOutput().StartRun(pRedlineData, nCurrentPos, 
bSingleEmptyRun);
+}
 }
 
 if ( aAttrIter.IsDropCap( nNextAttr ) )
diff --git a/test/source/xmltesttools.cxx 

[Libreoffice-commits] core.git: include/test sc/qa test/source

2022-11-22 Thread Xisco Fauli (via logerrit)
 include/test/unoapi_test.hxx |3 +++
 sc/qa/unit/uicalc/uicalc.cxx |   34 ++
 test/source/unoapi_test.cxx  |6 ++
 3 files changed, 43 insertions(+)

New commits:
commit fc3993c6794e2749400755ecd032165a61d5d959
Author: Xisco Fauli 
AuthorDate: Tue Nov 22 13:42:06 2022 +0100
Commit: Xisco Fauli 
CommitDate: Tue Nov 22 16:49:36 2022 +0100

tdf#152014: sc_uicalc: Add unittest

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

diff --git a/include/test/unoapi_test.hxx b/include/test/unoapi_test.hxx
index ece36abdb149..1f14f6a21f77 100644
--- a/include/test/unoapi_test.hxx
+++ b/include/test/unoapi_test.hxx
@@ -60,6 +60,9 @@ protected:
 // reference to document component that we are testing
 css::uno::Reference mxComponent;
 
+// In case the test needs to work with two documents at the same time
+css::uno::Reference mxComponent2;
+
 utl::TempFileNamed maTempFile;
 
 SvMemoryStream maMemory; // Underlying memory for parsed PDF files.
diff --git a/sc/qa/unit/uicalc/uicalc.cxx b/sc/qa/unit/uicalc/uicalc.cxx
index 518a219e3a92..4976c19c17f0 100644
--- a/sc/qa/unit/uicalc/uicalc.cxx
+++ b/sc/qa/unit/uicalc/uicalc.cxx
@@ -2903,6 +2903,40 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf149378)
 CPPUNIT_ASSERT_EQUAL(OUString("{=ABS({-1;-2})}"), pDoc->GetFormula(8, 0, 
0));
 }
 
+CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf152014)
+{
+createScDoc();
+
+insertStringToCell("A1", u"=MATCH(1,A2,0)");
+insertStringToCell("A2", u"1");
+
+ScDocument* pDoc = getScDoc();
+CPPUNIT_ASSERT_EQUAL(OUString("1"), pDoc->GetString(ScAddress(0, 0, 0)));
+
+goToCell("A1");
+
+dispatchCommand(mxComponent, ".uno:Copy", {});
+Scheduler::ProcessEventsToIdle();
+
+// Create a second document
+mxComponent2 = loadFromDesktop("private:factory/scalc");
+
+uno::Reference xFrames = mxDesktop->getFrames();
+CPPUNIT_ASSERT_EQUAL(static_cast(2), xFrames->getCount());
+
+dispatchCommand(mxComponent2, ".uno:Paste", {});
+Scheduler::ProcessEventsToIdle();
+
+ScModelObj* pModelObj2 = dynamic_cast(mxComponent2.get());
+CPPUNIT_ASSERT(pModelObj2);
+ScDocument* pDoc2 = pModelObj2->GetDocument();
+
+// Without the fix in place, this test would have failed with
+// - Expected: #N/A
+// - Actual  : 1
+CPPUNIT_ASSERT_EQUAL(OUString("#N/A"), pDoc2->GetString(ScAddress(0, 0, 
0)));
+}
+
 CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf126926)
 {
 createScDoc();
diff --git a/test/source/unoapi_test.cxx b/test/source/unoapi_test.cxx
index a1c0580cfd61..ff566c8ffa10 100644
--- a/test/source/unoapi_test.cxx
+++ b/test/source/unoapi_test.cxx
@@ -43,6 +43,12 @@ void UnoApiTest::setUp()
 
 void UnoApiTest::tearDown()
 {
+if (mxComponent2.is())
+{
+mxComponent2->dispose();
+mxComponent2.clear();
+}
+
 if (mxComponent.is())
 {
 mxComponent->dispose();


[Libreoffice-commits] core.git: include/test sc/CppunitTest_sc_uicalc.mk sc/qa test/source

2022-11-16 Thread Xisco Fauli (via logerrit)
 include/test/unoapi_test.hxx |1 
 sc/CppunitTest_sc_uicalc.mk  |2 
 sc/qa/unit/uicalc/uicalc.cxx |  967 ++-
 test/source/unoapi_test.cxx  |8 
 4 files changed, 409 insertions(+), 569 deletions(-)

New commits:
commit b61ca6f7bf4e5b5b1980ad03f2a5f2d01e8c22fe
Author: Xisco Fauli 
AuthorDate: Wed Nov 16 16:59:38 2022 +0100
Commit: Xisco Fauli 
CommitDate: Wed Nov 16 20:08:29 2022 +0100

CppunitTest_sc_uicalc: inherit from ScModelTestBase

so createScDoc handles the dispose of new documents
saveAndClose can go now

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

diff --git a/include/test/unoapi_test.hxx b/include/test/unoapi_test.hxx
index 461b52dcad93..ece36abdb149 100644
--- a/include/test/unoapi_test.hxx
+++ b/include/test/unoapi_test.hxx
@@ -42,7 +42,6 @@ public:
const css::uno::Sequence& 
rParams = {});
 
 void save(const OUString& rFilter, const char* pPassword = nullptr);
-void saveAndClose(const OUString& rFilter);
 void saveAndReload(const OUString& rFilter, const char* pPassword = 
nullptr);
 
 std::unique_ptr parsePDFExport(const OString& 
rPassword = OString());
diff --git a/sc/CppunitTest_sc_uicalc.mk b/sc/CppunitTest_sc_uicalc.mk
index af23c8b38966..97a8291ff66c 100644
--- a/sc/CppunitTest_sc_uicalc.mk
+++ b/sc/CppunitTest_sc_uicalc.mk
@@ -12,6 +12,7 @@ $(eval $(call gb_CppunitTest_CppunitTest,sc_uicalc))
 $(eval $(call gb_CppunitTest_use_externals,sc_uicalc, \
boost_headers \
mdds_headers \
+   libxml2 \
 ))
 
 $(eval $(call gb_CppunitTest_add_exception_objects,sc_uicalc, \
@@ -25,6 +26,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sc_uicalc, \
 i18nlangtag \
 sal \
 sc \
+scqahelper \
 sfx \
 subsequenttest \
 svl \
diff --git a/sc/qa/unit/uicalc/uicalc.cxx b/sc/qa/unit/uicalc/uicalc.cxx
index 3dd1d13c4b69..518a219e3a92 100644
--- a/sc/qa/unit/uicalc/uicalc.cxx
+++ b/sc/qa/unit/uicalc/uicalc.cxx
@@ -7,7 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#include 
+#include "../helper/qahelper.hxx"
 #include 
 #include 
 #include 
@@ -36,50 +36,45 @@
 
 using namespace ::com::sun::star;
 
-class ScUiCalcTest : public UnoApiTest
+class ScUiCalcTest : public ScModelTestBase
 {
 public:
 ScUiCalcTest();
-ScModelObj* createDoc(const char* pName = nullptr);
 void goToCell(const OUString& rCell);
-void typeString(ScModelObj& rModelObj, const std::u16string_view& rStr);
-void insertStringToCell(ScModelObj& rModelObj, const OUString& rCell,
-const std::u16string_view& rStr);
-void insertArrayToCell(ScModelObj& rModelObj, const OUString& rCell,
-   const std::u16string_view& rStr);
+void typeString(const std::u16string_view& rStr);
+void insertStringToCell(const OUString& rCell, const std::u16string_view& 
rStr);
+void insertArrayToCell(const OUString& rCell, const std::u16string_view& 
rStr);
 void insertNewSheet(ScDocument& rDoc);
 };
 
 ScUiCalcTest::ScUiCalcTest()
-: UnoApiTest("sc/qa/unit/uicalc/data")
+: ScModelTestBase("sc/qa/unit/uicalc/data")
 {
 }
 
-static void lcl_AssertCurrentCursorPosition(const ScDocument& rDoc, 
std::u16string_view rStr)
+static void lcl_AssertCurrentCursorPosition(ScDocShell& rDocSh, 
std::u16string_view rStr)
 {
 ScAddress aAddr;
 sal_Int32 nOffset = 0;
-ScRangeStringConverter::GetAddressFromString(aAddr, rStr, rDoc,
+ScRangeStringConverter::GetAddressFromString(aAddr, rStr, 
rDocSh.GetDocument(),
  
formula::FormulaGrammar::CONV_OOO, nOffset);
+ScTabViewShell* pViewShell = rDocSh.GetBestViewShell(false);
 CPPUNIT_ASSERT_EQUAL_MESSAGE(
 OUString(OUString::Concat("Incorrect Column in position ") + 
rStr).toUtf8().getStr(),
-aAddr.Col(), ScDocShell::GetViewData()->GetCurX());
+aAddr.Col(), pViewShell->GetViewData().GetCurX());
 CPPUNIT_ASSERT_EQUAL_MESSAGE(
 OUString(OUString::Concat("Incorrect Row in position ") + 
rStr).toUtf8().getStr(),
-aAddr.Row(), ScDocShell::GetViewData()->GetCurY());
+aAddr.Row(), pViewShell->GetViewData().GetCurY());
 }
 
-static void lcl_SelectObjectByName(std::u16string_view rObjName)
+static void lcl_SelectObjectByName(ScTabViewShell& rViewShell, 
std::u16string_view rObjName)
 {
-ScTabViewShell* pViewShell = ScDocShell::GetViewData()->GetViewShell();
-CPPUNIT_ASSERT(pViewShell);
-
-bool bFound = pViewShell->SelectObject(rObjName);
+bool bFound = rViewShell.SelectObject(rObjName);
 CPPUNIT_ASSERT_MESSAGE(
 OString(OUStringToOString(rObjName, RTL_TEXTENCODING_UTF8) + " not 
found.").getStr(),
 bFound);
 
-

[Libreoffice-commits] core.git: include/test sc/CppunitTest_sc_filters_test.mk sc/CppunitTest_sc_opencl_test.mk sc/CppunitTest_sc_parallelism.mk sc/Library_scqahelper.mk sc/qa sc/subsequent_setup.mk s

2022-11-15 Thread Xisco Fauli (via logerrit)
 include/test/unoapi_test.hxx  |1 
 sc/CppunitTest_sc_filters_test.mk |1 
 sc/CppunitTest_sc_opencl_test.mk  |1 
 sc/CppunitTest_sc_parallelism.mk  |1 
 sc/Library_scqahelper.mk  |1 
 sc/qa/unit/helper/qahelper.cxx|  190 +++
 sc/qa/unit/helper/qahelper.hxx|   36 
 sc/qa/unit/subsequent_export_test.cxx | 1694 +-
 sc/subsequent_setup.mk|   52 -
 sc/ucalc_setup.mk |1 
 test/source/unoapi_test.cxx   |5 
 11 files changed, 899 insertions(+), 1084 deletions(-)

New commits:
commit a865d042eff3cdd4d78badcc55c9d8fdf9ef52aa
Author: Xisco Fauli 
AuthorDate: Thu Nov 10 14:18:12 2022 +0100
Commit: Xisco Fauli 
CommitDate: Tue Nov 15 11:56:34 2022 +0100

CppunitTest_sc_subsequent_export_test: inherit from UnoApiXmlTest

Some notes:
* testLinkedGraphicRT needed to be adapted. Saving to
Calc Office Open XML doesn't keep IsLinkedGraphic.
Reported in tdf#152036. No idea why it didn't fail before

* Some tests used "generic_HTML" as export filter format, which
is wrong. Instead, "HTML (StarCalc)" should have been used.
But then, the test would have failed with
- unsatisfied query for interface of type 
com.sun.star.sheet.XSpreadsheetDocument!
So trying to export to html in those tests is not expected.
No idea why it didn't fail before

* testTdf90299 fails now with
- Expected: 'file:///tmp/lu23738863wthph.tmp/dummy.xls'#$Sheet1.A1
- Actual  : 
'file:///tmp/lu23738863wthph.tmp/lu23738863wthpg.tmp/dummy.xls'#$Sheet1.A1
I added a TODO to check it later

* testNamedRangeBugfdo62729 fails on mac with an infinite loop

Change-Id: I63168583a47f510d1ac22971a274e28d085de61b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142576
Tested-by: Xisco Fauli 
Reviewed-by: Xisco Fauli 

diff --git a/include/test/unoapi_test.hxx b/include/test/unoapi_test.hxx
index 0277131e31f7..461b52dcad93 100644
--- a/include/test/unoapi_test.hxx
+++ b/include/test/unoapi_test.hxx
@@ -34,6 +34,7 @@ public:
 virtual void tearDown() override;
 
 OUString createFileURL(std::u16string_view aFileBase);
+OUString createFilePath(std::u16string_view aFileBase);
 void load(const OUString& rURL, const char* pPassword = nullptr);
 OUString loadFromURL(std::u16string_view aFileBase, const char* pPassword 
= nullptr);
 
diff --git a/sc/CppunitTest_sc_filters_test.mk 
b/sc/CppunitTest_sc_filters_test.mk
index 67ef60664081..ca12691c73a4 100644
--- a/sc/CppunitTest_sc_filters_test.mk
+++ b/sc/CppunitTest_sc_filters_test.mk
@@ -24,6 +24,7 @@ endif
 $(eval $(call gb_CppunitTest_use_externals,sc_filters_test, \
boost_headers \
mdds_headers \
+   libxml2 \
 ))
 
 $(eval $(call gb_CppunitTest_use_libraries,sc_filters_test, \
diff --git a/sc/CppunitTest_sc_opencl_test.mk b/sc/CppunitTest_sc_opencl_test.mk
index 9320d6757408..0807e14c08e1 100644
--- a/sc/CppunitTest_sc_opencl_test.mk
+++ b/sc/CppunitTest_sc_opencl_test.mk
@@ -19,6 +19,7 @@ $(eval $(call gb_CppunitTest_use_externals,sc_opencl_test, \
boost_headers \
 $(call gb_Helper_optional,OPENCL,clew) \
mdds_headers \
+   libxml2 \
 ))
 
 $(eval $(call gb_CppunitTest_use_libraries,sc_opencl_test, \
diff --git a/sc/CppunitTest_sc_parallelism.mk b/sc/CppunitTest_sc_parallelism.mk
index 8511d209f3d6..74b88f3b7d80 100644
--- a/sc/CppunitTest_sc_parallelism.mk
+++ b/sc/CppunitTest_sc_parallelism.mk
@@ -51,6 +51,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sc_parallelism, \
 sb \
 sfx \
 sot \
+subsequenttest \
 svl \
 svt \
 svx \
diff --git a/sc/Library_scqahelper.mk b/sc/Library_scqahelper.mk
index 78bbae5cd9ec..15289fea87af 100644
--- a/sc/Library_scqahelper.mk
+++ b/sc/Library_scqahelper.mk
@@ -50,6 +50,7 @@ $(eval $(call gb_Library_use_libraries,scqahelper,\
sc \
sfx \
sot \
+   subsequenttest \
svl \
svt \
svx \
diff --git a/sc/qa/unit/helper/qahelper.cxx b/sc/qa/unit/helper/qahelper.cxx
index 45816c8f6fd4..59d4177ef19c 100644
--- a/sc/qa/unit/helper/qahelper.cxx
+++ b/sc/qa/unit/helper/qahelper.cxx
@@ -313,6 +313,120 @@ void testFormats(ScBootstrapFixture* pTest, ScDocument* 
pDoc, sal_Int32 nFormat)
 CPPUNIT_ASSERT_EQUAL(ScRangeList(ScRange(1,1,2,3,1,2)), rRange3);
 }
 
+void testFormats(ScModelTestBase* pTest, ScDocument* pDoc,std::u16string_view 
sFormat)
+{
+//test Sheet1 with csv file
+OUString aCSVFileName = 
pTest->createFilePath(u"contentCSV/numberFormat.csv");
+testFile(aCSVFileName, *pDoc, 0, StringType::PureString);
+//need to test the color of B3
+//it's not a font color!
+//formatting for B5: # ??/100 gets lost during import
+
+//test Sheet2
+const ScPatternAttr* pPattern = pDoc->GetPattern(0, 0, 1);
+vcl::Font aFont;
+pPattern->GetFont(aFont,SC_AUTOCOL_RAW);
+   

[Libreoffice-commits] core.git: include/test vcl/CppunitTest_vcl_pdfexport.mk vcl/qa

2022-11-09 Thread Xisco Fauli (via logerrit)
 include/test/unoapi_test.hxx   |3 
 vcl/CppunitTest_vcl_pdfexport.mk   |1 
 vcl/qa/cppunit/pdfexport/pdfexport.cxx |  206 +
 3 files changed, 63 insertions(+), 147 deletions(-)

New commits:
commit 789872ad1b5916cc5b5abebe5221e80f77725445
Author: Xisco Fauli 
AuthorDate: Wed Nov 9 17:10:19 2022 +0100
Commit: Xisco Fauli 
CommitDate: Wed Nov 9 19:09:15 2022 +0100

CppunitTest_vcl_pdfexport: inherit from UnoApiTest

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

diff --git a/include/test/unoapi_test.hxx b/include/test/unoapi_test.hxx
index 8b7a6464f144..307d0f1a0589 100644
--- a/include/test/unoapi_test.hxx
+++ b/include/test/unoapi_test.hxx
@@ -52,11 +52,12 @@ protected:
 
 utl::TempFileNamed maTempFile;
 
+SvMemoryStream maMemory; // Underlying memory for parsed PDF files.
+
 private:
 bool mbSkipValidation;
 OUString m_aBaseString;
 OUString maFilterOptions;
-SvMemoryStream maMemory; // Underlying memory for parsed PDF files.
 };
 
 #endif // INCLUDED_TEST_UNOAPI_TEST_HXX
diff --git a/vcl/CppunitTest_vcl_pdfexport.mk b/vcl/CppunitTest_vcl_pdfexport.mk
index 533164c881d5..33716f5dad36 100644
--- a/vcl/CppunitTest_vcl_pdfexport.mk
+++ b/vcl/CppunitTest_vcl_pdfexport.mk
@@ -21,6 +21,7 @@ $(eval $(call gb_CppunitTest_use_libraries,vcl_pdfexport, \
cppu \
cppuhelper \
sal \
+   subsequenttest \
test \
unotest \
utl \
diff --git a/vcl/qa/cppunit/pdfexport/pdfexport.cxx 
b/vcl/qa/cppunit/pdfexport/pdfexport.cxx
index 0e8c4fb05407..e5fd9c495859 100644
--- a/vcl/qa/cppunit/pdfexport/pdfexport.cxx
+++ b/vcl/qa/cppunit/pdfexport/pdfexport.cxx
@@ -31,8 +31,7 @@
 #include 
 #include 
 #include 
-#include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -61,61 +60,25 @@ static std::ostream& operator<<(std::ostream& rStrm, const 
Color& rColor)
 namespace
 {
 /// Tests the PDF export filter.
-class PdfExportTest : public test::BootstrapFixture, public unotest::MacrosTest
+class PdfExportTest : public UnoApiTest
 {
 protected:
-uno::Reference mxComponent;
-utl::TempFileNamed maTempFile;
-SvMemoryStream maMemory;
 utl::MediaDescriptor aMediaDescriptor;
-std::unique_ptr parseExport(const OString& 
rPassword = OString());
-std::shared_ptr mpPDFium;
 
 public:
-PdfExportTest();
-virtual void setUp() override;
-virtual void tearDown() override;
+PdfExportTest()
+: UnoApiTest("/vcl/qa/cppunit/pdfexport/data/")
+{
+}
+
 void saveAsPDF(std::u16string_view rFile);
 void load(std::u16string_view rFile, vcl::filter::PDFDocument& rDocument);
 };
 
-PdfExportTest::PdfExportTest() { maTempFile.EnableKillingFile(); }
-
-std::unique_ptr PdfExportTest::parseExport(const 
OString& rPassword)
-{
-SvFileStream aFile(maTempFile.GetURL(), StreamMode::READ);
-maMemory.WriteStream(aFile);
-std::shared_ptr pPDFium = vcl::pdf::PDFiumLibrary::get();
-std::unique_ptr pPdfDocument
-= pPDFium->openDocument(maMemory.GetData(), maMemory.GetSize(), 
rPassword);
-CPPUNIT_ASSERT(pPdfDocument);
-return pPdfDocument;
-}
-
-void PdfExportTest::setUp()
-{
-test::BootstrapFixture::setUp();
-
-mxDesktop.set(frame::Desktop::create(mxComponentContext));
-
-mpPDFium = vcl::pdf::PDFiumLibrary::get();
-}
-
-void PdfExportTest::tearDown()
-{
-if (mxComponent.is())
-mxComponent->dispose();
-
-test::BootstrapFixture::tearDown();
-}
-
-constexpr OUStringLiteral DATA_DIRECTORY = u"/vcl/qa/cppunit/pdfexport/data/";
-
 void PdfExportTest::saveAsPDF(std::u16string_view rFile)
 {
 // Import the bugdoc and export as PDF.
-OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + rFile;
-mxComponent = loadFromDesktop(aURL);
+loadFromURL(rFile);
 uno::Reference xStorable(mxComponent, uno::UNO_QUERY);
 xStorable->storeToURL(maTempFile.GetURL(), 
aMediaDescriptor.getAsConstPropertyValueList());
 }
@@ -219,8 +182,7 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf105461)
 saveAsPDF(u"tdf105461.odp");
 
 // Parse the export result with pdfium.
-std::unique_ptr pPdfDocument = parseExport();
-CPPUNIT_ASSERT(pPdfDocument);
+std::unique_ptr pPdfDocument = parsePDFExport();
 
 // The document has one page.
 CPPUNIT_ASSERT_EQUAL(1, pPdfDocument->getPageCount());
@@ -252,8 +214,7 @@ CPPUNIT_TEST_FIXTURE(PdfExportTest, testTdf107868)
 #if !defined MACOSX && !defined _WIN32
 
 // Import the bugdoc and print to PDF.
-OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + 
"tdf107868.odt";
-mxComponent = loadFromDesktop(aURL);
+loadFromURL(u"tdf107868.odt");
 uno::Reference xStorable(mxComponent, uno::UNO_QUERY);
 uno::Reference xPrintable(mxComponent, uno::UNO_QUERY);
 CPPUNIT_ASSERT(xPrintable.is());
@@ 

[Libreoffice-commits] core.git: include/test sw/CppunitTest_sw_core_accessibilitycheck.mk sw/CppunitTest_sw_core_attr.mk sw/CppunitTest_sw_core_crsr.mk sw/CppunitTest_sw_core_doc.mk sw/CppunitTest_sw_

2022-11-09 Thread Xisco Fauli (via logerrit)
 include/test/unoapi_test.hxx |2 
 sw/CppunitTest_sw_core_accessibilitycheck.mk |1 
 sw/CppunitTest_sw_core_attr.mk   |1 
 sw/CppunitTest_sw_core_crsr.mk   |1 
 sw/CppunitTest_sw_core_doc.mk|1 
 sw/CppunitTest_sw_core_docnode.mk|1 
 sw/CppunitTest_sw_core_draw.mk   |1 
 sw/CppunitTest_sw_core_edit.mk   |1 
 sw/CppunitTest_sw_core_fields.mk |1 
 sw/CppunitTest_sw_core_frmedt.mk |1 
 sw/CppunitTest_sw_core_layout.mk |1 
 sw/CppunitTest_sw_core_objectpositioning.mk  |1 
 sw/CppunitTest_sw_core_text.mk   |1 
 sw/CppunitTest_sw_core_tox.mk|1 
 sw/CppunitTest_sw_core_txtnode.mk|1 
 sw/CppunitTest_sw_core_undo.mk   |1 
 sw/CppunitTest_sw_core_unocore.mk|1 
 sw/CppunitTest_sw_core_view.mk   |1 
 sw/CppunitTest_sw_docbookexport.mk   |1 
 sw/CppunitTest_sw_filter_html.mk |1 
 sw/CppunitTest_sw_filter_ww8.mk  |1 
 sw/CppunitTest_sw_filters_test.mk|1 
 sw/CppunitTest_sw_filters_test2.mk   |1 
 sw/CppunitTest_sw_fodfexport.mk  |1 
 sw/CppunitTest_sw_globalfilter.mk|1 
 sw/CppunitTest_sw_htmlexport.mk  |1 
 sw/CppunitTest_sw_htmlimport.mk  |1 
 sw/CppunitTest_sw_indexingexport.mk  |1 
 sw/CppunitTest_sw_mailmerge.mk   |1 
 sw/CppunitTest_sw_mailmerge2.mk  |1 
 sw/CppunitTest_sw_odfexport.mk   |1 
 sw/CppunitTest_sw_odfexport2.mk  |1 
 sw/CppunitTest_sw_odfimport.mk   |1 
 sw/CppunitTest_sw_ooxmlexport8.mk|1 
 sw/CppunitTest_sw_ooxmlimport.mk |1 
 sw/CppunitTest_sw_ooxmlimport2.mk|1 
 sw/CppunitTest_sw_rtfimport.mk   |1 
 sw/CppunitTest_sw_tiledrendering.mk  |1 
 sw/CppunitTest_sw_txtencexport.mk|1 
 sw/CppunitTest_sw_txtexport.mk   |1 
 sw/CppunitTest_sw_txtimport.mk   |1 
 sw/CppunitTest_sw_uibase_dochdl.mk   |1 
 sw/CppunitTest_sw_uibase_docvw.mk|1 
 sw/CppunitTest_sw_uibase_fldui.mk|1 
 sw/CppunitTest_sw_uibase_frmdlg.mk   |1 
 sw/CppunitTest_sw_uibase_shells.mk   |1 
 sw/CppunitTest_sw_uibase_uiview.mk   |1 
 sw/CppunitTest_sw_uibase_uno.mk  |1 
 sw/CppunitTest_sw_uibase_wrtsh.mk|1 
 sw/CppunitTest_sw_unowriter.mk   |1 
 sw/CppunitTest_sw_ww8import.mk   |1 
 sw/CppunitTest_sw_xhtmlexport.mk |1 
 sw/Library_swqahelper.mk |1 
 sw/layoutwriter_setup.mk |1 
 sw/ooxmlexport_setup.mk  |1 
 sw/qa/inc/swmodeltestbase.hxx|   34 ---
 sw/qa/unit/swmodeltestbase.cxx   |   60 ++-
 sw/rtfexport_setup.mk|1 
 sw/uiwriter_setup.mk |1 
 sw/ww8export_setup.mk|1 
 test/source/unoapi_test.cxx  |   21 +
 61 files changed, 85 insertions(+), 89 deletions(-)

New commits:
commit 4170b94c443b3bd68b4cc75b8c344ecca3c249b0
Author: Xisco Fauli 
AuthorDate: Tue Nov 8 18:27:05 2022 +0100
Commit: Xisco Fauli 
CommitDate: Wed Nov 9 11:34:05 2022 +0100

SwModelTestBase: inherit from UnoApiXmlTest

it seems setUp/tearDown can also go as well.
See the discussion in gerrit.

Change-Id: I5e81dcdcb2e070eb4beb737f3cb25c86cb9d042b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142465
Tested-by: Xisco Fauli 
Reviewed-by: Xisco Fauli 

diff --git a/include/test/unoapi_test.hxx b/include/test/unoapi_test.hxx
index 90fc65ef6d08..ede9734776ad 100644
--- a/include/test/unoapi_test.hxx
+++ b/include/test/unoapi_test.hxx
@@ -36,7 +36,7 @@ public:
 css::uno::Any executeMacro(const OUString& rScriptURL,
const css::uno::Sequence& 
rParams = {});
 
-void save(const OUString& rFilter);
+void save(const OUString& rFilter, const char* pPassword = nullptr);
 void saveAndClose(const OUString& rFilter);
 void saveAndReload(const OUString& rFilter);
 
diff --git a/sw/CppunitTest_sw_core_accessibilitycheck.mk 
b/sw/CppunitTest_sw_core_accessibilitycheck.mk
index 1780c7c4bfc9..7cfa8b79770b 100644
--- a/sw/CppunitTest_sw_core_accessibilitycheck.mk
+++ b/sw/CppunitTest_sw_core_accessibilitycheck.mk
@@ -24,6 +24,7 @@ $(eval $(call 
gb_CppunitTest_use_libraries,sw_core_accessibilitycheck, \
 sal \
 svx \
 sfx \
+subsequenttest \
 sw \
swqahelper \
 test \
diff --git a/sw/CppunitTest_sw_core_attr.mk b/sw/CppunitTest_sw_core_attr.mk
index 

[Libreoffice-commits] core.git: include/test sc/CppunitTest_sc_html_export_test.mk sc/qa test/source

2022-11-03 Thread Xisco Fauli (via logerrit)
 include/test/unoapi_test.hxx  |4 ++
 sc/CppunitTest_sc_html_export_test.mk |1 
 sc/qa/extras/htmlexporttest.cxx   |   63 --
 test/source/unoapi_test.cxx   |8 +++-
 4 files changed, 20 insertions(+), 56 deletions(-)

New commits:
commit 6f77eda1f4de7f2835a32dd597442a29fe59291c
Author: Xisco Fauli 
AuthorDate: Thu Nov 3 13:55:06 2022 +0100
Commit: Xisco Fauli 
CommitDate: Thu Nov 3 17:33:42 2022 +0100

CppunitTest_sc_html_export_test: inherit from UnoApiXmlTest

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

diff --git a/include/test/unoapi_test.hxx b/include/test/unoapi_test.hxx
index d5b8d2145d99..8c27437d237d 100644
--- a/include/test/unoapi_test.hxx
+++ b/include/test/unoapi_test.hxx
@@ -40,6 +40,8 @@ public:
 utl::TempFileNamed saveAndClose(const OUString& rFilter);
 utl::TempFileNamed saveAndReload(const OUString& rFilter);
 
+void setFilterOptions(const OUString& rFilterOptions) { maFilterOptions = 
rFilterOptions; }
+
 protected:
 // reference to document component that we are testing
 css::uno::Reference mxComponent;
@@ -48,6 +50,8 @@ protected:
 
 private:
 OUString m_aBaseString;
+
+OUString maFilterOptions;
 };
 
 #endif // INCLUDED_TEST_UNOAPI_TEST_HXX
diff --git a/sc/CppunitTest_sc_html_export_test.mk 
b/sc/CppunitTest_sc_html_export_test.mk
index 16596fb3ef89..dae834614229 100644
--- a/sc/CppunitTest_sc_html_export_test.mk
+++ b/sc/CppunitTest_sc_html_export_test.mk
@@ -40,6 +40,7 @@ $(eval $(call 
gb_CppunitTest_use_libraries,sc_html_export_test, \
 scqahelper \
 sfx \
 sot \
+subsequenttest \
 svl \
 svt \
 svx \
diff --git a/sc/qa/extras/htmlexporttest.cxx b/sc/qa/extras/htmlexporttest.cxx
index a94a34ba24d5..f7dc9c115f74 100644
--- a/sc/qa/extras/htmlexporttest.cxx
+++ b/sc/qa/extras/htmlexporttest.cxx
@@ -15,81 +15,36 @@
 #include 
 #include 
 
-#include 
 #include 
-#include 
+#include 
 #include 
-#include 
-#include 
 
 using namespace css::uno;
 using namespace css::lang;
 using namespace css::frame;
 using namespace utl;
 
-class ScHTMLExportTest : public test::BootstrapFixture, public 
unotest::MacrosTest, public XmlTestTools, public HtmlTestTools
+class ScHTMLExportTest : public UnoApiXmlTest, public HtmlTestTools
 {
-Reference mxComponent;
-OUString  maFilterOptions;
-
-void load(std::u16string_view pDir, const char* pName)
-{
-if (mxComponent.is())
-mxComponent->dispose();
-mxComponent = loadFromDesktop(m_directories.getURLFromSrc(pDir) + 
OUString::createFromAscii(pName), "com.sun.star.comp.Calc.SpreadsheetDocument");
-}
-
-void save(const OUString& aFilterName, TempFileNamed const & rTempFile)
-{
-Reference xStorable(mxComponent, UNO_QUERY);
-MediaDescriptor aMediaDescriptor;
-aMediaDescriptor["FilterName"] <<= aFilterName;
-if (!maFilterOptions.isEmpty())
-aMediaDescriptor["FilterOptions"] <<= maFilterOptions;
-xStorable->storeToURL(rTempFile.GetURL(), 
aMediaDescriptor.getAsConstPropertyValueList());
-}
-
 public:
 ScHTMLExportTest()
+: UnoApiXmlTest("/sc/qa/extras/testdocuments/")
 {}
 
-virtual void setUp() override
-{
-test::BootstrapFixture::setUp();
-
mxDesktop.set(css::frame::Desktop::create(comphelper::getComponentContext(getMultiServiceFactory(;
-}
-
-virtual void tearDown() override
-{
-if (mxComponent.is())
-mxComponent->dispose();
-
-test::BootstrapFixture::tearDown();
-}
-
 void testHtmlSkipImage()
 {
-// need a temp dir, because there's an image exported too
-TempFileNamed aTempDir(nullptr, true);
-aTempDir.EnableKillingFile();
-OUString const url(aTempDir.GetURL());
-TempFileNamed aTempFile(, false);
-
-htmlDocUniquePtr pDoc;
-
-load(u"/sc/qa/extras/testdocuments/", "BaseForHTMLExport.ods");
-save("HTML (StarCalc)", aTempFile);
-pDoc = parseHtml(aTempFile);
+loadFromURL(u"BaseForHTMLExport.ods");
+utl::TempFileNamed aTempFile = save("HTML (StarCalc)");
+htmlDocUniquePtr pDoc = parseHtml(aTempFile);
 CPPUNIT_ASSERT (pDoc);
 
 assertXPath(pDoc, "/html/body", 1);
 assertXPath(pDoc, "/html/body/table/tr/td/img", 1);
 
-load(u"/sc/qa/extras/testdocuments/", "BaseForHTMLExport.ods");
-maFilterOptions = "SkipImages";
-save("HTML (StarCalc)", aTempFile);
+setFilterOptions("SkipImages");
+utl::TempFileNamed aTempFile2 = save("HTML (StarCalc)");
 
-pDoc = parseHtml(aTempFile);
+pDoc = parseHtml(aTempFile2);
 CPPUNIT_ASSERT (pDoc);
 assertXPath(pDoc, "/html/body", 1);
 assertXPath(pDoc, 

[Libreoffice-commits] core.git: include/test sc/CppunitTest_sc_jumbosheets_test.mk sc/qa test/source

2022-10-26 Thread Xisco Fauli (via logerrit)
 include/test/unoapi_test.hxx  |2 
 sc/CppunitTest_sc_jumbosheets_test.mk |2 
 sc/qa/unit/helper/qahelper.cxx|   11 -
 sc/qa/unit/helper/qahelper.hxx|1 
 sc/qa/unit/jumbosheets-test.cxx   |  320 --
 test/source/unoapi_test.cxx   |4 
 6 files changed, 160 insertions(+), 180 deletions(-)

New commits:
commit bdb76c9ff1832041fa7a9bda30e8d4d7d937ff94
Author: Xisco Fauli 
AuthorDate: Wed Oct 26 19:30:15 2022 +0200
Commit: Xisco Fauli 
CommitDate: Wed Oct 26 21:38:56 2022 +0200

CppunitTest_sc_jumbosheets_test: inherit from UnoApiTest

Split a couple of tests into 2, one for ods and the other for xlsx
Change-Id: I9f6f908b150c435933739335f6618d335ce8f9a6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141889
Tested-by: Xisco Fauli 
Reviewed-by: Xisco Fauli 

diff --git a/include/test/unoapi_test.hxx b/include/test/unoapi_test.hxx
index 577c2d62ece7..d5b8d2145d99 100644
--- a/include/test/unoapi_test.hxx
+++ b/include/test/unoapi_test.hxx
@@ -38,7 +38,7 @@ public:
 
 utl::TempFileNamed save(const OUString& rFilter);
 utl::TempFileNamed saveAndClose(const OUString& rFilter);
-void saveAndReload(const OUString& rFilter);
+utl::TempFileNamed saveAndReload(const OUString& rFilter);
 
 protected:
 // reference to document component that we are testing
diff --git a/sc/CppunitTest_sc_jumbosheets_test.mk 
b/sc/CppunitTest_sc_jumbosheets_test.mk
index 867589c4fa60..554d3152cbc3 100644
--- a/sc/CppunitTest_sc_jumbosheets_test.mk
+++ b/sc/CppunitTest_sc_jumbosheets_test.mk
@@ -32,10 +32,12 @@ $(eval $(call 
gb_CppunitTest_use_libraries,sc_jumbosheets_test, \
 sc \
 scqahelper \
 sfx \
+subsequenttest \
 svxcore \
 test \
 tl \
 unotest \
+utl \
 vcl \
 ))
 
diff --git a/sc/qa/unit/helper/qahelper.cxx b/sc/qa/unit/helper/qahelper.cxx
index 40cc56859c4f..be0fe4d2bcf6 100644
--- a/sc/qa/unit/helper/qahelper.cxx
+++ b/sc/qa/unit/helper/qahelper.cxx
@@ -827,17 +827,6 @@ ScDocShellRef ScBootstrapFixture::saveAndReloadPassword( 
ScDocShell& rShell, sal
 return xDocSh;
 }
 
-ScDocShellRef ScBootstrapFixture::saveAndReloadNoClose( ScDocShell& rShell, 
sal_Int32 nFormat, std::shared_ptr* pTempFile )
-{
-OUString aFilterName(aFileFormats[nFormat].pFilterName, 
strlen(aFileFormats[nFormat].pFilterName), RTL_TEXTENCODING_UTF8) ;
-OUString aFilterType(aFileFormats[nFormat].pTypeName, 
strlen(aFileFormats[nFormat].pTypeName), RTL_TEXTENCODING_UTF8);
-
-ScDocShellRef xDocSh = saveAndReload(rShell, aFilterName, OUString(), 
aFilterType, aFileFormats[nFormat].nFormatType, pTempFile, nullptr, false);
-
-CPPUNIT_ASSERT(xDocSh.is());
-return xDocSh;
-}
-
 std::shared_ptr ScBootstrapFixture::exportTo( ScDocShell& 
rShell, sal_Int32 nFormat, bool bValidate )
 {
 OUString aFilterName(aFileFormats[nFormat].pFilterName, 
strlen(aFileFormats[nFormat].pFilterName), RTL_TEXTENCODING_UTF8) ;
diff --git a/sc/qa/unit/helper/qahelper.hxx b/sc/qa/unit/helper/qahelper.hxx
index b3541d9c0c5f..32447f716c02 100644
--- a/sc/qa/unit/helper/qahelper.hxx
+++ b/sc/qa/unit/helper/qahelper.hxx
@@ -226,7 +226,6 @@ public:
 
 ScDocShellRef saveAndReload( ScDocShell& rShell, sal_Int32 nFormat, 
std::shared_ptr* pTempFile = nullptr );
 ScDocShellRef saveAndReloadPassword( ScDocShell& rShell, sal_Int32 
nFormat, std::shared_ptr* pTempFile = nullptr );
-ScDocShellRef saveAndReloadNoClose( ScDocShell& rShell, sal_Int32 nFormat, 
std::shared_ptr* pTempFile = nullptr );
 
 std::shared_ptr exportTo(ScDocShell& rShell, sal_Int32 
nFormat, bool bValidate = true);
 
diff --git a/sc/qa/unit/jumbosheets-test.cxx b/sc/qa/unit/jumbosheets-test.cxx
index 388967e9c43c..1cf820895ed5 100644
--- a/sc/qa/unit/jumbosheets-test.cxx
+++ b/sc/qa/unit/jumbosheets-test.cxx
@@ -8,8 +8,7 @@
  */
 
 #include 
-#include 
-#include 
+#include 
 #include 
 #include 
 #include 
@@ -19,13 +18,14 @@
 #include 
 #include 
 
+#include 
 #include 
 #include 
 #include 
 #include 
 #include 
+#include 
 
-#include "helper/qahelper.hxx"
 #include "helper/xpath.hxx"
 
 using namespace ::com::sun::star;
@@ -33,7 +33,7 @@ using namespace ::com::sun::star::uno;
 
 /* Tests for sheets larger than 1024 columns and/or 1048576 rows. */
 
-class ScJumboSheetsTest : public unotest::MacrosTest, public 
ScBootstrapFixture, public XmlTestTools
+class ScJumboSheetsTest : public UnoApiTest, public XmlTestTools
 {
 public:
 ScJumboSheetsTest();
@@ -43,8 +43,10 @@ public:
 
 void testRoundtripColumn2000Ods();
 void testRoundtripColumn2000Xlsx();
-void testRoundtripColumnRange();
-void testRoundtripNamedRanges();
+void testRoundtripColumnRangeOds();
+void testRoundtripColumnRangeXlsx();
+void testRoundtripNamedRangesOds();
+void testRoundtripNamedRangesXlsx();
 void testNamedRangeNameConflict();
 void testTdf134553();
 void testTdf134392();
@@ -56,8 +58,10 

[Libreoffice-commits] core.git: include/test sc/qa sd/qa test/source xmloff/qa

2022-10-25 Thread Xisco Fauli (via logerrit)
 include/test/unoapi_test.hxx |2 ++
 sc/qa/unit/scshapetest.cxx   |4 
 sc/qa/unit/uicalc/uicalc.cxx |4 
 sd/qa/filter/eppt/eppt.cxx   |2 --
 test/source/unoapi_test.cxx  |   29 -
 xmloff/qa/unit/draw.cxx  |   16 ++--
 xmloff/qa/unit/style.cxx |6 --
 xmloff/qa/unit/text.cxx  |   13 +
 8 files changed, 41 insertions(+), 35 deletions(-)

New commits:
commit ff97d047393c955af2f3173a9c7e2534a059a058
Author: Xisco Fauli 
AuthorDate: Tue Oct 25 10:18:11 2022 +0200
Commit: Xisco Fauli 
CommitDate: Tue Oct 25 11:24:43 2022 +0200

UnoApiTest: use validate when saving files

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

diff --git a/include/test/unoapi_test.hxx b/include/test/unoapi_test.hxx
index d38453432f54..8c19a56333a9 100644
--- a/include/test/unoapi_test.hxx
+++ b/include/test/unoapi_test.hxx
@@ -43,6 +43,8 @@ protected:
 // reference to document component that we are testing
 css::uno::Reference mxComponent;
 
+bool mbSkipValidation; // if you set this flag for a new test I'm going to 
haunt you!
+
 private:
 OUString m_aBaseString;
 };
diff --git a/sc/qa/unit/scshapetest.cxx b/sc/qa/unit/scshapetest.cxx
index d597ac10b3fc..e641822beca1 100644
--- a/sc/qa/unit/scshapetest.cxx
+++ b/sc/qa/unit/scshapetest.cxx
@@ -1038,6 +1038,10 @@ void ScShapeTest::testTdf115655_HideDetail()
 pViewShell->GetViewData().GetDispatcher().Execute(SID_OUTLINE_HIDE);
 CPPUNIT_ASSERT_MESSAGE("Collapse: Image should not be visible", 
!pObj->IsVisible());
 
+// FIXME: validation fails with
+// Error: unexpected attribute "drawooo:display"
+mbSkipValidation = true;
+
 // Save and reload
 saveAndReload("calc8");
 CPPUNIT_ASSERT(mxComponent);
diff --git a/sc/qa/unit/uicalc/uicalc.cxx b/sc/qa/unit/uicalc/uicalc.cxx
index 1131f30463f0..27e28175bc23 100644
--- a/sc/qa/unit/uicalc/uicalc.cxx
+++ b/sc/qa/unit/uicalc/uicalc.cxx
@@ -995,6 +995,10 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest, testTdf144244)
 
 CPPUNIT_ASSERT_EQUAL(OUString("x"), pDoc->GetString(ScAddress(0, 0, 0)));
 
+// FIXME: validation fails with
+// Error: unexpected attribute "drawooo:display"
+mbSkipValidation = true;
+
 // Without the fix in place, this test would have crashed
 saveAndReload("calc8");
 pModelObj = dynamic_cast(mxComponent.get());
diff --git a/sd/qa/filter/eppt/eppt.cxx b/sd/qa/filter/eppt/eppt.cxx
index 38ba795dce2d..9b853b058044 100644
--- a/sd/qa/filter/eppt/eppt.cxx
+++ b/sd/qa/filter/eppt/eppt.cxx
@@ -81,7 +81,6 @@ CPPUNIT_TEST_FIXTURE(Test, testThemeExport)
 
 // When exporting to PPTX:
 utl::TempFileNamed aTempFile = save("Impress Office Open XML");
-validate(aTempFile.GetFileName(), test::OOXML);
 
 // Then verify that this color is not lost:
 std::unique_ptr pStream = parseExportStream(aTempFile, 
"ppt/theme/theme1.xml");
@@ -101,7 +100,6 @@ CPPUNIT_TEST_FIXTURE(Test, testLoopingFromAnimation)
 
 // When exporting that to PPTX:
 utl::TempFileNamed aTempFile = save("Impress Office Open XML");
-validate(aTempFile.GetFileName(), test::OOXML);
 
 // Then make sure that the "infinite" repeat count is written:
 std::unique_ptr pStream = parseExportStream(aTempFile, 
"ppt/slides/slide1.xml");
diff --git a/test/source/unoapi_test.cxx b/test/source/unoapi_test.cxx
index 0cc8bf0e33cc..395a10db1c37 100644
--- a/test/source/unoapi_test.cxx
+++ b/test/source/unoapi_test.cxx
@@ -22,7 +22,8 @@ using namespace css;
 using namespace css::uno;
 
 UnoApiTest::UnoApiTest(OUString path)
-: m_aBaseString(std::move(path))
+: mbSkipValidation(false)
+, m_aBaseString(std::move(path))
 {
 }
 
@@ -83,6 +84,32 @@ utl::TempFileNamed UnoApiTest::save(const OUString& rFilter)
 mxComponent->dispose();
 mxComponent.clear();
 
+if (!mbSkipValidation)
+{
+if (rFilter == "Office Open XML Text")
+validate(aTempFile.GetFileName(), test::OOXML);
+else if (rFilter == "Calc Office Open XML")
+validate(aTempFile.GetFileName(), test::OOXML);
+else if (rFilter == "Impress Office Open XML")
+validate(aTempFile.GetFileName(), test::OOXML);
+else if (rFilter == "writer8")
+validate(aTempFile.GetFileName(), test::ODF);
+else if (rFilter == "calc8")
+validate(aTempFile.GetFileName(), test::ODF);
+else if (rFilter == "impress8")
+validate(aTempFile.GetFileName(), test::ODF);
+else if (rFilter == "draw8")
+validate(aTempFile.GetFileName(), test::ODF);
+else if (rFilter == "OpenDocument Text Flat XML")
+validate(aTempFile.GetFileName(), test::ODF);
+else if (rFilter == "MS Word 97")
+validate(aTempFile.GetFileName(), test::MSBINARY);
+else if 

[Libreoffice-commits] core.git: include/test sc/qa test/source

2022-10-21 Thread Xisco Fauli (via logerrit)
 include/test/calc_unoapi_test.hxx |4 --
 sc/qa/extras/macros-test.cxx  |   76 --
 sc/qa/extras/vba-macro-test.cxx   |   45 +-
 sc/qa/unit/scshapetest.cxx|   47 ---
 sc/qa/unit/uicalc/uicalc.cxx  |6 +++
 test/source/calc_unoapi_test.cxx  |   26 -
 6 files changed, 17 insertions(+), 187 deletions(-)

New commits:
commit 03d6d07d8c1be4f0123f1f9b05b4e5f0f92eabf6
Author: Xisco Fauli 
AuthorDate: Fri Oct 21 14:12:29 2022 +0200
Commit: Xisco Fauli 
CommitDate: Fri Oct 21 18:59:47 2022 +0200

CalcUnoApiTest: work with mxComponent directly

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

diff --git a/include/test/calc_unoapi_test.hxx 
b/include/test/calc_unoapi_test.hxx
index 5bca2c150f93..a34418876bf3 100644
--- a/include/test/calc_unoapi_test.hxx
+++ b/include/test/calc_unoapi_test.hxx
@@ -20,7 +20,6 @@ class OOO_DLLPUBLIC_TEST CalcUnoApiTest : public UnoApiTest
 public:
 CalcUnoApiTest(const OUString& path);
 
-virtual void setUp() override;
 virtual void tearDown() override;
 
 css::uno::Any executeMacro(const OUString& rScriptURL,
@@ -32,9 +31,6 @@ public:
 protected:
 // reference to document component that we are testing
 css::uno::Reference mxComponent;
-
-private:
-css::uno::Reference m_xCalcComponent;
 };
 
 #endif // INCLUDED_TEST_CALC_UNOAPI_TEST_HXX
diff --git a/sc/qa/extras/macros-test.cxx b/sc/qa/extras/macros-test.cxx
index c14490473124..886548317942 100644
--- a/sc/qa/extras/macros-test.cxx
+++ b/sc/qa/extras/macros-test.cxx
@@ -136,9 +136,6 @@ void ScMacrosTest::testMSP()
 
 SAL_INFO("sc.qa", "Result is " << sResult );
 CPPUNIT_ASSERT_EQUAL_MESSAGE("TestMSP ( for fdo#67547) failed", 
OUString("OK"), sResult);
-
-css::uno::Reference xCloseable(mxComponent, 
css::uno::UNO_QUERY_THROW);
-xCloseable->close(true);
 }
 
 void ScMacrosTest::testPasswordProtectedStarBasic()
@@ -173,8 +170,6 @@ void ScMacrosTest::testPasswordProtectedStarBasic()
 
 aValue = rDoc.GetString(2,0,0);
 CPPUNIT_ASSERT_EQUAL_MESSAGE("Far Method script did not change the value 
of Sheet1.C1", OUString("success"), aValue);
-
-pDocSh->DoClose();
 }
 
 void ScMacrosTest::testStarBasic()
@@ -192,7 +187,6 @@ void ScMacrosTest::testStarBasic()
 
executeMacro("vnd.sun.Star.script:Standard.Module1.Macro1?language=Basic=document");
 double aValue = rDoc.GetValue(0,0,0);
 CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("script did not change the value of 
Sheet1.A1",2.0, aValue, 0.1);
-pDocSh->DoClose();
 }
 
 void ScMacrosTest::testRowColumn()
@@ -215,8 +209,6 @@ void ScMacrosTest::testRowColumn()
 
executeMacro("vnd.sun.Star.script:Standard.Module1.Macro_ColumnWidth?language=Basic=document");
 sal_uInt16 nWidth  = o3tl::convert(rDoc.GetColWidth(0, 0), 
o3tl::Length::twip, o3tl::Length::mm100);
 CPPUNIT_ASSERT_EQUAL(static_cast(4001), nWidth);
-
-pDocSh->DoClose();
 }
 
 void ScMacrosTest::testTdf146742()
@@ -241,8 +233,6 @@ void ScMacrosTest::testTdf146742()
 // - Expected: FALSE
 // - Actual  : TRUE
 CPPUNIT_ASSERT_EQUAL(OUString("FALSE"), rDoc.GetString(ScAddress(1,1,0)));
-
-pDocSh->DoClose();
 }
 
 void ScMacrosTest::testMacroButtonFormControlXlsxExport()
@@ -294,8 +284,6 @@ void ScMacrosTest::testTdf104902()
 // newlines
 // - Actual  : string withnewlines
 CPPUNIT_ASSERT_EQUAL(OUString(u"string with" + OUStringChar(u'\xA') + 
u"newlines"), rDoc.GetString(ScAddress(0, 1, 0)));
-
-pDocSh->DoClose();
 }
 
 void ScMacrosTest::testTdf64639()
@@ -327,8 +315,6 @@ void ScMacrosTest::testTdf64639()
 
 CPPUNIT_ASSERT_EQUAL(static_cast(0), pPage->GetObjCount());
 }
-
-pDocSh->DoClose();
 }
 
 void ScMacrosTest::testTdf142033()
@@ -357,8 +343,6 @@ void ScMacrosTest::testTdf142033()
 // - Actual  : string withnewlines
 CPPUNIT_ASSERT_EQUAL(OUString(u"string with" + OUStringChar(u'\xA') + 
u"newlines"), rDoc.GetString(ScAddress(1,0,0)));
 CPPUNIT_ASSERT_EQUAL(OUString(u"string with" + OUStringChar(u'\xA') + 
u"newlines"), rDoc.GetString(ScAddress(1,1,0)));
-
-pDocSh->DoClose();
 }
 
 void ScMacrosTest::testPasswordProtectedUnicodeString()
@@ -402,9 +386,6 @@ void ScMacrosTest::testPasswordProtectedUnicodeString()
 aRet >>= aReturnValue;
 CPPUNIT_ASSERT_EQUAL(sCorrectString, aReturnValue);
 }
-
-css::uno::Reference xCloseable(mxComponent, 
css::uno::UNO_QUERY_THROW);
-xCloseable->close(true);
 }
 
 void ScMacrosTest::testPasswordProtectedArrayInUserType()
@@ -447,9 +428,6 @@ void ScMacrosTest::testPasswordProtectedArrayInUserType()
 aRet >>= nReturnValue;
 CPPUNIT_ASSERT_EQUAL(sal_Int16(1), nReturnValue);
 }
-
-css::uno::Reference xCloseable(mxComponent, 
css::uno::UNO_QUERY_THROW);
-

[Libreoffice-commits] core.git: include/test sc/qa

2022-10-21 Thread Xisco Fauli (via logerrit)
 include/test/sheet/xdocumentauditing.hxx |1 -
 sc/qa/extras/scmodelobj.cxx  |3 ---
 2 files changed, 4 deletions(-)

New commits:
commit 57a03d7a52680e7177d07efe364785d53bf0a6df
Author: Xisco Fauli 
AuthorDate: Fri Oct 21 10:58:05 2022 +0200
Commit: Xisco Fauli 
CommitDate: Fri Oct 21 13:41:36 2022 +0200

sc: remove unused method

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

diff --git a/include/test/sheet/xdocumentauditing.hxx 
b/include/test/sheet/xdocumentauditing.hxx
index 282db0226d58..7d443bf82006 100644
--- a/include/test/sheet/xdocumentauditing.hxx
+++ b/include/test/sheet/xdocumentauditing.hxx
@@ -25,7 +25,6 @@ class OOO_DLLPUBLIC_TEST XDocumentAuditing
 {
 public:
 virtual css::uno::Reference init() = 0;
-virtual css::uno::Reference getXMSF() = 0;
 
 void testRefreshArrows();
 
diff --git a/sc/qa/extras/scmodelobj.cxx b/sc/qa/extras/scmodelobj.cxx
index 869e93734a25..2420aea874c8 100644
--- a/sc/qa/extras/scmodelobj.cxx
+++ b/sc/qa/extras/scmodelobj.cxx
@@ -42,7 +42,6 @@ public:
 virtual void setUp() override;
 
 virtual uno::Reference init() override;
-virtual uno::Reference getXMSF() override;
 virtual uno::Sequence> getXCells() override;
 
 ScModelObj();
@@ -100,8 +99,6 @@ uno::Reference ScModelObj::init()
 return xModel;
 }
 
-uno::Reference ScModelObj::getXMSF() { return 
getMultiServiceFactory(); }
-
 uno::Sequence> ScModelObj::getXCells() { return 
m_xCells; }
 
 void ScModelObj::setUp()


[Libreoffice-commits] core.git: include/test sc/qa test/source

2022-10-20 Thread Xisco Fauli (via logerrit)
 include/test/calc_unoapi_test.hxx |4 ++
 sc/qa/extras/macros-test.cxx  |   22 --
 sc/qa/unit/scshapetest.cxx|   15 --
 sc/qa/unit/uicalc/uicalc.cxx  |   57 ++
 test/source/calc_unoapi_test.cxx  |   25 
 5 files changed, 46 insertions(+), 77 deletions(-)

New commits:
commit 4856b94ae1d851546b2a95622f78af8b1be798a6
Author: Xisco Fauli 
AuthorDate: Thu Oct 20 14:54:44 2022 +0200
Commit: Xisco Fauli 
CommitDate: Thu Oct 20 19:59:29 2022 +0200

CalcUnoApiTest: factor out common code

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

diff --git a/include/test/calc_unoapi_test.hxx 
b/include/test/calc_unoapi_test.hxx
index 369e48b877f2..5bca2c150f93 100644
--- a/include/test/calc_unoapi_test.hxx
+++ b/include/test/calc_unoapi_test.hxx
@@ -11,6 +11,7 @@
 #define INCLUDED_TEST_CALC_UNOAPI_TEST_HXX
 
 #include 
+#include 
 
 // basic uno api test class for calc
 
@@ -25,6 +26,9 @@ public:
 css::uno::Any executeMacro(const OUString& rScriptURL,
const css::uno::Sequence& 
rParams = {});
 
+utl::TempFileNamed save(const OUString& rFilter);
+void saveAndReload(const OUString& rFilter);
+
 protected:
 // reference to document component that we are testing
 css::uno::Reference mxComponent;
diff --git a/sc/qa/extras/macros-test.cxx b/sc/qa/extras/macros-test.cxx
index 2df09b8626af..c14490473124 100644
--- a/sc/qa/extras/macros-test.cxx
+++ b/sc/qa/extras/macros-test.cxx
@@ -41,7 +41,6 @@ protected:
 void registerNamespaces(xmlXPathContextPtr& pXmlXPathCtx) override;
 public:
 ScMacrosTest();
-void saveAndReload(const OUString& rFilter);
 
 void testStarBasic();
 void testMSP();
@@ -118,19 +117,6 @@ void ScMacrosTest::registerNamespaces(xmlXPathContextPtr& 
pXmlXPathCtx)
 XmlTestTools::registerODFNamespaces(pXmlXPathCtx);
 }
 
-void ScMacrosTest::saveAndReload(const OUString& rFilter)
-{
-utl::TempFileNamed aTempFile;
-aTempFile.EnableKillingFile();
-css::uno::Sequence aArgs{ comphelper::makePropertyValue("FilterName", 
rFilter) };
-css::uno::Reference xStorable(mxComponent, 
css::uno::UNO_QUERY_THROW);
-xStorable->storeAsURL(aTempFile.GetURL(), aArgs);
-css::uno::Reference xCloseable(mxComponent, 
css::uno::UNO_QUERY_THROW);
-xCloseable->close(true);
-
-mxComponent = loadFromDesktop(aTempFile.GetURL(), 
"com.sun.star.sheet.SpreadsheetDocument");
-}
-
 // I suppose you could say this test doesn't really belong here, OTOH
 // we need a full document to run the test ( it related originally to an
 // imported Excel VBA macro ) It's convenient and fast to unit test
@@ -267,13 +253,7 @@ void ScMacrosTest::testMacroButtonFormControlXlsxExport()
 mxComponent = loadFromDesktop(aFileName, 
"com.sun.star.sheet.SpreadsheetDocument");
 
 // When exporting to XLSM:
-uno::Reference xStorable(mxComponent, uno::UNO_QUERY);
-utl::MediaDescriptor aMediaDescriptor;
-aMediaDescriptor["FilterName"] <<= OUString("Calc MS Excel 2007 VBA XML");
-auto pTempFile = std::make_shared();
-pTempFile->EnableKillingFile();
-xStorable->storeToURL(pTempFile->GetURL(), 
aMediaDescriptor.getAsConstPropertyValueList());
-mxComponent->dispose();
+auto pTempFile = std::make_shared(save("Calc MS Excel 
2007 VBA XML"));
 
 // Then make sure that the macro is associated with the control:
 xmlDocUniquePtr pSheetDoc = XPathHelper::parseExport(pTempFile, 
m_xSFactory, "xl/worksheets/sheet1.xml");
diff --git a/sc/qa/unit/scshapetest.cxx b/sc/qa/unit/scshapetest.cxx
index 670f956862a0..364209883709 100644
--- a/sc/qa/unit/scshapetest.cxx
+++ b/sc/qa/unit/scshapetest.cxx
@@ -42,7 +42,6 @@ class ScShapeTest : public CalcUnoApiTest
 {
 public:
 ScShapeTest();
-void saveAndReload(const OUString& rFilter);
 void testTdf143619_validation_circle_pos();
 void testTdf140252_DragCreateFormControl();
 void testTdf134355_DragCreateCustomShape();
@@ -103,20 +102,6 @@ ScShapeTest::ScShapeTest()
 {
 }
 
-void ScShapeTest::saveAndReload(const OUString& rFilter)
-{
-utl::TempFileNamed aTempFile;
-aTempFile.EnableKillingFile();
-css::uno::Sequence aArgs{ comphelper::makePropertyValue("FilterName",
-rFilter) }; // 
e.g. "calc8"
-css::uno::Reference xStorable(mxComponent, 
css::uno::UNO_QUERY_THROW);
-xStorable->storeAsURL(aTempFile.GetURL(), aArgs);
-css::uno::Reference xCloseable(mxComponent, 
css::uno::UNO_QUERY_THROW);
-xCloseable->close(true);
-
-mxComponent = loadFromDesktop(aTempFile.GetURL(), 
"com.sun.star.sheet.SpreadsheetDocument");
-}
-
 static void lcl_AssertRectEqualWithTolerance(std::string_view sInfo,
  const tools::Rectangle& rExpected,

[Libreoffice-commits] core.git: include/test sc/qa test/Library_subsequenttest.mk test/source

2022-10-19 Thread Xisco Fauli (via logerrit)
 include/test/calc_unoapi_test.hxx |3 
 sc/qa/extras/macros-test.cxx  |  253 --
 sc/qa/extras/vba-macro-test.cxx   |  215 ++--
 test/Library_subsequenttest.mk|1 
 test/source/calc_unoapi_test.cxx  |   14 ++
 5 files changed, 91 insertions(+), 395 deletions(-)

New commits:
commit f3a82a8ba51195cf31b0f78164735acc7ebbcd2f
Author: Xisco Fauli 
AuthorDate: Wed Oct 19 14:14:02 2022 +0200
Commit: Xisco Fauli 
CommitDate: Wed Oct 19 15:19:02 2022 +0200

sc: factor out common code in tests

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

diff --git a/include/test/calc_unoapi_test.hxx 
b/include/test/calc_unoapi_test.hxx
index 7d1bb0521115..369e48b877f2 100644
--- a/include/test/calc_unoapi_test.hxx
+++ b/include/test/calc_unoapi_test.hxx
@@ -22,6 +22,9 @@ public:
 virtual void setUp() override;
 virtual void tearDown() override;
 
+css::uno::Any executeMacro(const OUString& rScriptURL,
+   const css::uno::Sequence& 
rParams = {});
+
 protected:
 // reference to document component that we are testing
 css::uno::Reference mxComponent;
diff --git a/sc/qa/extras/macros-test.cxx b/sc/qa/extras/macros-test.cxx
index 1690b4f00824..2df09b8626af 100644
--- a/sc/qa/extras/macros-test.cxx
+++ b/sc/qa/extras/macros-test.cxx
@@ -144,15 +144,7 @@ void ScMacrosTest::testMSP()
 mxComponent = loadFromDesktop(aFileName, 
"com.sun.star.sheet.SpreadsheetDocument");
 
 
-Any aRet;
-Sequence< sal_Int16 > aOutParamIndex;
-Sequence< Any > aOutParam;
-Sequence< uno::Any > aParams;
-
-SfxObjectShell::CallXScript(
-mxComponent,
-
"vnd.sun.Star.script:Standard.Module1.TestMSP?language=Basic=document",
-aParams, aRet, aOutParamIndex, aOutParam);
+Any aRet = 
executeMacro("vnd.sun.Star.script:Standard.Module1.TestMSP?language=Basic=document");
 OUString sResult;
 aRet >>= sResult;
 
@@ -169,11 +161,6 @@ void ScMacrosTest::testPasswordProtectedStarBasic()
 createFileURL(u"testTypePassword.ods", aFileName);
 mxComponent = loadFromDesktop(aFileName, 
"com.sun.star.sheet.SpreadsheetDocument");
 
-Any aRet;
-Sequence< sal_Int16 > aOutParamIndex;
-Sequence< Any > aOutParam;
-Sequence< uno::Any > aParams;
-
 SfxObjectShell* pFoundShell = 
SfxObjectShell::GetShellFromComponent(mxComponent);
 
 CPPUNIT_ASSERT_MESSAGE("Failed to access document shell", pFoundShell);
@@ -182,30 +169,21 @@ void ScMacrosTest::testPasswordProtectedStarBasic()
 
 // User defined types
 
-SfxObjectShell::CallXScript(
-mxComponent,
-
"vnd.sun.Star.script:Standard.Module1.LoadAndExecuteTest?language=Basic=document",
-aParams, aRet, aOutParamIndex, aOutParam);
+
executeMacro("vnd.sun.Star.script:Standard.Module1.LoadAndExecuteTest?language=Basic=document");
 
 OUString aValue = rDoc.GetString(0,0,0);
 CPPUNIT_ASSERT_EQUAL_MESSAGE("User defined types script did not change the 
value of Sheet1.A1", OUString("success"), aValue);
 
 // Big Module
 
-SfxObjectShell::CallXScript(
-mxComponent,
-
"vnd.sun.Star.script:MyLibrary.BigModule.bigMethod?language=Basic=document",
-aParams, aRet, aOutParamIndex, aOutParam);
+
executeMacro("vnd.sun.Star.script:MyLibrary.BigModule.bigMethod?language=Basic=document");
 
 aValue = rDoc.GetString(1,0,0);
 CPPUNIT_ASSERT_EQUAL_MESSAGE("Big module script did not change the value 
of Sheet1.B1", OUString("success"), aValue);
 
 // far big method tdf#94617
 
-SfxObjectShell::CallXScript(
-mxComponent,
-
"vnd.sun.Star.script:MyLibrary.BigModule.farBigMethod?language=Basic=document",
-aParams, aRet, aOutParamIndex, aOutParam);
+
executeMacro("vnd.sun.Star.script:MyLibrary.BigModule.farBigMethod?language=Basic=document");
 
 aValue = rDoc.GetString(2,0,0);
 CPPUNIT_ASSERT_EQUAL_MESSAGE("Far Method script did not change the value 
of Sheet1.C1", OUString("success"), aValue);
@@ -219,21 +197,13 @@ void ScMacrosTest::testStarBasic()
 createFileURL(u"StarBasic.ods", aFileName);
 mxComponent = loadFromDesktop(aFileName, 
"com.sun.star.sheet.SpreadsheetDocument");
 
-Any aRet;
-Sequence< sal_Int16 > aOutParamIndex;
-Sequence< Any > aOutParam;
-Sequence< uno::Any > aParams;
-
 SfxObjectShell* pFoundShell = 
SfxObjectShell::GetShellFromComponent(mxComponent);
 
 CPPUNIT_ASSERT_MESSAGE("Failed to access document shell", pFoundShell);
 ScDocShell* pDocSh = static_cast(pFoundShell);
 ScDocument& rDoc = pDocSh->GetDocument();
 
-SfxObjectShell::CallXScript(
-mxComponent,
-
"vnd.sun.Star.script:Standard.Module1.Macro1?language=Basic=document",
-aParams, aRet, aOutParamIndex, aOutParam);
+

[Libreoffice-commits] core.git: include/test

2022-10-17 Thread Xisco Fauli (via logerrit)
 include/test/sheet/xmultiformulatokens.hxx |2 --
 1 file changed, 2 deletions(-)

New commits:
commit 8451f4691ebe0e2e6d7d067175b4f0aa548820ba
Author: Xisco Fauli 
AuthorDate: Mon Oct 17 11:00:37 2022 +0200
Commit: Xisco Fauli 
CommitDate: Mon Oct 17 13:37:11 2022 +0200

test: remove unneeded setUp/tearDown

no other class in include/test/sheet/ has them

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

diff --git a/include/test/sheet/xmultiformulatokens.hxx 
b/include/test/sheet/xmultiformulatokens.hxx
index 8f883a32071b..2d20e9bced9e 100644
--- a/include/test/sheet/xmultiformulatokens.hxx
+++ b/include/test/sheet/xmultiformulatokens.hxx
@@ -22,8 +22,6 @@ class OOO_DLLPUBLIC_TEST XMultiFormulaTokens
 {
 public:
 virtual css::uno::Reference init() = 0;
-virtual void setUp() = 0;
-virtual void tearDown() = 0;
 
 void testGetCount();
 void testGetSetTokens();


[Libreoffice-commits] core.git: include/test sccomp/qa sc/qa

2022-10-14 Thread Xisco Fauli (via logerrit)
 include/test/calc_unoapi_test.hxx|4 ++
 sc/qa/extras/anchor.cxx  |3 --
 sc/qa/extras/check_data_pilot_field.cxx  |1 
 sc/qa/extras/check_data_pilot_table.cxx  |1 
 sc/qa/extras/check_xcell_ranges_query.cxx|1 
 sc/qa/extras/macros-test.cxx |2 -
 sc/qa/extras/new_cond_format.cxx |3 --
 sc/qa/extras/recordchanges-test.cxx  |3 --
 sc/qa/extras/scannotationobj.cxx |3 --
 sc/qa/extras/scannotationshapeobj.cxx|9 
++
 sc/qa/extras/scannotationsobj.cxx|4 --
 sc/qa/extras/scarealinkobj.cxx   |9 
++
 sc/qa/extras/scarealinksobj.cxx  |9 
++
 sc/qa/extras/scautoformatobj.cxx |3 --
 sc/qa/extras/scautoformatsobj.cxx|9 
++
 sc/qa/extras/sccellcursorobj.cxx |3 --
 sc/qa/extras/sccellfieldsobj.cxx |9 
++
 sc/qa/extras/sccellformatsenumeration.cxx|9 
++
 sc/qa/extras/sccellformatsobj.cxx|9 
++
 sc/qa/extras/sccellobj.cxx   |3 --
 sc/qa/extras/sccellrangeobj.cxx  |3 --
 sc/qa/extras/sccellrangesobj.cxx |3 --
 sc/qa/extras/sccellsearchobj.cxx |9 
++
 sc/qa/extras/sccellsenumeration.cxx  |9 
++
 sc/qa/extras/sccellsobj.cxx  |9 
++
 sc/qa/extras/scchartobj.cxx  |9 
++
 sc/qa/extras/scchartsobj.cxx |9 
++
 sc/qa/extras/scconsolidationdescriptorobj.cxx|3 --
 sc/qa/extras/scdatabaserangeobj.cxx  |2 -
 sc/qa/extras/scdatabaserangesobj.cxx |3 --
 sc/qa/extras/scdatapilotfieldgroupitemobj.cxx|7 
++--
 sc/qa/extras/scdatapilotfieldgroupobj.cxx|7 
++--
 sc/qa/extras/scdatapilotfieldgroupsobj.cxx   |7 
++--
 sc/qa/extras/scdatapilotfieldobj.cxx |3 --
 sc/qa/extras/scdatapilotfieldsobj.cxx|9 
++
 sc/qa/extras/scdatapilotitemobj.cxx  |7 
++--
 sc/qa/extras/scdatapilotitemsobj.cxx |7 
++--
 sc/qa/extras/scdatapilottableobj.cxx |3 --
 sc/qa/extras/scdatapilottablesobj.cxx|3 --
 sc/qa/extras/scddelinkobj.cxx|3 --
 sc/qa/extras/scddelinksobj.cxx   |9 
++
 sc/qa/extras/scdocumentconfigurationobj.cxx  |3 --
 sc/qa/extras/scdrawpageobj.cxx   |   15 
--
 sc/qa/extras/scdrawpagesobj.cxx  |9 
++
 sc/qa/extras/sceditfieldobj-cell.cxx |1 
 sc/qa/extras/sceditfieldobj-header.cxx   |1 
 sc/qa/extras/scfilterdescriptorbase.cxx  |3 --
 sc/qa/extras/scfunctiondescriptionobj.cxx|3 --
 sc/qa/extras/scfunctionlistobj.cxx   |3 --
 sc/qa/extras/scheaderfieldsobj.cxx   |7 
++--
 sc/qa/extras/scheaderfootercontentobj.cxx|3 --
 sc/qa/extras/scimportdescriptorbaseobj.cxx   |3 --
 sc/qa/extras/scindexenumeration_cellannotationsenumeration.cxx   |9 
++
 sc/qa/extras/scindexenumeration_cellarealinksenumeration.cxx |9 
++
 sc/qa/extras/scindexenumeration_databaserangesenumeration.cxx|9 
++
 sc/qa/extras/scindexenumeration_datapilotfieldsenumeration.cxx   |9 
++
 sc/qa/extras/scindexenumeration_datapilotitemsenumeration.cxx|7 
++--
 sc/qa/extras/scindexenumeration_datapilottablesenumeration.cxx   |9 
++
 sc/qa/extras/scindexenumeration_ddelinksenumeration.cxx  |9 
++
 sc/qa/extras/scindexenumeration_functiondescriptionenumeration.cxx   |9 
++
 sc/qa/extras/scindexenumeration_labelrangesenumeration.cxx   

[Libreoffice-commits] core.git: include/test sc/CppunitTest_sc_a11y.mk sc/Module_sc.mk sc/qa sw/CppunitTest_sw_a11y.mk sw/Module_sw.mk sw/qa test/Library_subsequenttest.mk test/source

2022-08-01 Thread Colomban Wendling (via logerrit)
 include/test/a11y/AccessibilityTools.hxx   |   12 +
 include/test/a11y/accessibletestbase.hxx   |  138 +++
 include/test/a11y/swaccessibletestbase.hxx |   58 ++
 sc/CppunitTest_sc_a11y.mk  |   39 
 sc/Module_sc.mk|1 
 sc/qa/extras/accessibility/basics.cxx  |   90 ++
 sw/CppunitTest_sw_a11y.mk  |   38 
 sw/Module_sw.mk|1 
 sw/qa/extras/accessibility/basics.cxx  |   96 ++
 test/Library_subsequenttest.mk |2 
 test/source/a11y/AccessibilityTools.cxx|   50 -
 test/source/a11y/accessibletestbase.cxx|  260 +
 test/source/a11y/swaccessibletestbase.cxx  |  135 +++
 13 files changed, 907 insertions(+), 13 deletions(-)

New commits:
commit 0185ddd6d5f0324ba57b3fa36229103a6b27138e
Author: Colomban Wendling 
AuthorDate: Thu Jul 21 21:51:21 2022 +0200
Commit: Michael Weghorn 
CommitDate: Mon Aug 1 17:03:40 2022 +0200

Add infrastructure and basic tests including slight UI interaction

This introduces a couple helper base classes for implementing
accessibility tests more easily, and includes a few tests as examples,
including basic document layout check and minimal UI interaction
through menus.

Change-Id: I8961af8be1e7d52dc55fe27c758806d9b4c3c5d9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137337
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/include/test/a11y/AccessibilityTools.hxx 
b/include/test/a11y/AccessibilityTools.hxx
index e56c68c9bebb..1efd0b9f2960 100644
--- a/include/test/a11y/AccessibilityTools.hxx
+++ b/include/test/a11y/AccessibilityTools.hxx
@@ -37,6 +37,18 @@ public:
  * Calc which has a million elements, if not more. */
 static const sal_Int32 MAX_CHILDREN = 500;
 
+static css::uno::Reference
+getAccessibleObjectForPredicate(
+const css::uno::Reference& 
xCtx,
+const std::function<
+bool(const 
css::uno::Reference&)>& cPredicate);
+static css::uno::Reference
+getAccessibleObjectForPredicate(
+const css::uno::Reference& xAcc,
+const std::function<
+bool(const 
css::uno::Reference&)>& cPredicate);
+static css::uno::Reference 
getAccessibleObjectForRole(
+const css::uno::Reference& 
xCtx, sal_Int16 role);
 static css::uno::Reference
 getAccessibleObjectForRole(const 
css::uno::Reference& xacc,
sal_Int16 role);
diff --git a/include/test/a11y/accessibletestbase.hxx 
b/include/test/a11y/accessibletestbase.hxx
new file mode 100644
index ..50a39f63a7dd
--- /dev/null
+++ b/include/test/a11y/accessibletestbase.hxx
@@ -0,0 +1,138 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#pragma once
+
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+#include 
+
+#include "AccessibilityTools.hxx"
+
+namespace test
+{
+class OOO_DLLPUBLIC_TEST AccessibleTestBase : public test::BootstrapFixture
+{
+protected:
+css::uno::Reference mxDesktop;
+css::uno::Reference mxDocument;
+css::uno::Reference mxWindow;
+
+static bool isDocumentRole(const sal_Int16 role);
+
+virtual void load(const rtl::OUString& sURL);
+virtual void loadFromSrc(const rtl::OUString& sSrcPath);
+void close();
+css::uno::Reference 
getWindowAccessibleContext();
+virtual css::uno::Reference
+getDocumentAccessibleContext();
+
+void documentPostKeyEvent(int nType, int nCharCode, int nKeyCode)
+{
+vcl::ITiledRenderable* pTiledRenderable
+= dynamic_cast(mxDocument.get());
+CPPUNIT_ASSERT(pTiledRenderable);
+pTiledRenderable->postKeyEvent(nType, nCharCode, nKeyCode);
+}
+
+static css::uno::Reference 
getFirstRelationTargetOfType(
+const css::uno::Reference& 
xContext,
+sal_Int16 relationType);
+
+/**
+ * @brief Tries to list all children of an accessible
+ * @param xContext An XAccessibleContext object
+ * @returns The list of all children (but no more than @c 
AccessibilityTools::MAX_CHILDREN)
+ *
+ * This fetches children of @p xContext.  This would ideally just be the 
same than iterating
+ * over children the regular way up to @c 
AccessibilityTools::MAX_CHILDREN, but unfortunately
+ * some components (Writer, Impress, ...) do not provide all their 
children the regular way and
+ * require specifics to include them.
+ *
+ * There is no guarantee on *which* children 

[Libreoffice-commits] core.git: include/test sw/qa test/Library_subsequenttest.mk test/source toolkit/CppunitTest_toolkit_a11y.mk toolkit/qa

2022-07-27 Thread Colomban Wendling (via logerrit)
 include/test/a11y/AccessibilityTools.hxx  |5 
 sw/qa/extras/accessibility/accessible_relation_set.cxx|   67 ++
 test/Library_subsequenttest.mk|1 
 test/source/a11y/AccessibilityTools.cxx   |   35 -
 toolkit/CppunitTest_toolkit_a11y.mk   |2 
 toolkit/qa/cppunit/a11y/AccessibleStatusBarTest.cxx   |2 
 toolkit/qa/cppunit/a11y/XAccessibleComponentTester.cxx|2 
 toolkit/qa/cppunit/a11y/XAccessibleComponentTester.hxx|2 
 toolkit/qa/cppunit/a11y/XAccessibleContextTester.cxx  |2 
 toolkit/qa/cppunit/a11y/XAccessibleEventBroadcasterTester.cxx |2 
 10 files changed, 58 insertions(+), 62 deletions(-)

New commits:
commit 8fe5a832b02ea6c5113c573f5b9c23e58049a4d2
Author: Colomban Wendling 
AuthorDate: Thu Jul 21 15:58:16 2022 +0200
Commit: Michael Weghorn 
CommitDate: Wed Jul 27 10:41:03 2022 +0200

Make AccessibilityTools available more widely and use it

Move AccessibilityTools helper to test/ and use it in 
accessible_relation_set
test replacing the copied over feature and consolidating the test as well.

Change-Id: Ia5ea69bb08bb2a86e3eb6c3dba2ab182b612561d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137307
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/toolkit/qa/cppunit/a11y/AccessibilityTools.hxx 
b/include/test/a11y/AccessibilityTools.hxx
similarity index 97%
rename from toolkit/qa/cppunit/a11y/AccessibilityTools.hxx
rename to include/test/a11y/AccessibilityTools.hxx
index 96afe4377f94..e56c68c9bebb 100644
--- a/toolkit/qa/cppunit/a11y/AccessibilityTools.hxx
+++ b/include/test/a11y/AccessibilityTools.hxx
@@ -19,6 +19,8 @@
 
 #pragma once
 
+#include 
+
 #include 
 #include 
 
@@ -28,7 +30,7 @@
 #include 
 #include 
 
-class AccessibilityTools
+class OOO_DLLPUBLIC_TEST AccessibilityTools
 {
 public:
 /** Maximum number of children to work on. This is especially useful for
@@ -47,6 +49,7 @@ public:
 static OUString getRoleName(const sal_Int16 role);
 static OUString getStateName(const sal_Int16 state);
 static OUString getEventIdName(const sal_Int16 event_id);
+static OUString getRelationTypeName(const sal_Int16 rel_type);
 
 template  static std::string debugString(const 
css::uno::Reference& x)
 {
diff --git a/sw/qa/extras/accessibility/accessible_relation_set.cxx 
b/sw/qa/extras/accessibility/accessible_relation_set.cxx
index ce053c95b07b..3839a61d0504 100644
--- a/sw/qa/extras/accessibility/accessible_relation_set.cxx
+++ b/sw/qa/extras/accessibility/accessible_relation_set.cxx
@@ -20,6 +20,7 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -33,54 +34,13 @@
 #include 
 #include 
 
+#include 
+
 using namespace com::sun::star;
 using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::accessibility;
 using namespace css::lang;
 
-namespace
-{
-class AccessibilityTools
-{
-public:
-static css::uno::Reference
-getAccessibleObjectForRole(const 
css::uno::Reference& xacc,
-   sal_Int16 role);
-};
-}
-
-css::uno::Reference
-AccessibilityTools::getAccessibleObjectForRole(
-const css::uno::Reference& xacc, 
sal_Int16 role)
-{
-css::uno::Reference ac = 
xacc->getAccessibleContext();
-bool isShowing = ac->getAccessibleStateSet() & 
AccessibleStateType::SHOWING;
-
-if ((ac->getAccessibleRole() == role) && isShowing)
-{
-return ac;
-}
-else
-{
-int k = ac->getAccessibleChildCount();
-if (ac->getAccessibleChildCount() > 100)
-{
-k = 50;
-}
-
-for (int i = 0; i < k; i++)
-{
-css::uno::Reference ac2
-= 
AccessibilityTools::getAccessibleObjectForRole(ac->getAccessibleChild(i), role);
-if (ac2.is())
-{
-return ac2;
-}
-}
-}
-return nullptr;
-}
-
 class AccessibleRelationSet : public UnoApiTest
 {
 public:
@@ -137,9 +97,6 @@ 
AccessibleRelationSet::init(uno::Reference& par
 void AccessibleRelationSet::contents_flows_to_and_from()
 {
 //contents_flows_to
-std::vector types{ "INVALID",   "CONTENT_FLOWS_FROM", 
"CONTENT_FLOWS_TO",
- "CONTROLLED_BY", "CONTROLLER_FOR", 
"LABEL_FOR",
- "LABELED_BY","MEMBER_OF",  
"SUB_WINDOW_OF" };
 
 css::uno::Reference para1;
 css::uno::Reference para2;
@@ -160,8 +117,10 @@ void AccessibleRelationSet::contents_flows_to_and_from()
 css::uno::Reference adummy(
 set->getRelation(0).TargetSet[0], uno::UNO_QUERY_THROW);
 atarget = adummy;
-CPPUNIT_ASSERT_EQUAL_MESSAGE("didn't gain correct relation type for 
paragraph 0", types[2],
- types[firstrelation]);
+

[Libreoffice-commits] core.git: include/test sd/qa test/source

2022-03-07 Thread Mike Kaganski (via logerrit)
 include/test/bootstrapfixture.hxx |1 +
 sd/qa/unit/PNGExportTests.cxx |   10 --
 test/source/bootstrapfixture.cxx  |6 ++
 3 files changed, 15 insertions(+), 2 deletions(-)

New commits:
commit a144acfdf6a4be6654c6bdac4de954b91c577831
Author: Mike Kaganski 
AuthorDate: Mon Mar 7 12:17:46 2022 +0300
Commit: Mike Kaganski 
CommitDate: Mon Mar 7 12:53:27 2022 +0100

Fix some DPI-dependent tests

Change-Id: I3c669802ac558379498c877c8ac4796bbff80f82
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131096
Reviewed-by: Xisco Fauli 
Reviewed-by: Mike Kaganski 
Tested-by: Jenkins

diff --git a/include/test/bootstrapfixture.hxx 
b/include/test/bootstrapfixture.hxx
index b3463ae223d5..438bba58a431 100644
--- a/include/test/bootstrapfixture.hxx
+++ b/include/test/bootstrapfixture.hxx
@@ -53,6 +53,7 @@ protected:
 // until a proper fix is implemented that either considers the DPI 
properly in the test, or
 // makes the invariants that test uses independent of DPI.
 static bool IsDefaultDPI();
+static std::pair getDPIScaling();
 
 public:
 DECL_DLLPRIVATE_STATIC_LINK(BootstrapFixture, ImplInitFilterHdl, 
ConvertData&, bool);
diff --git a/sd/qa/unit/PNGExportTests.cxx b/sd/qa/unit/PNGExportTests.cxx
index f3ab40228953..44a282f94a97 100644
--- a/sd/qa/unit/PNGExportTests.cxx
+++ b/sd/qa/unit/PNGExportTests.cxx
@@ -83,7 +83,11 @@ CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf105998)
 
 // make sure only the shape is exported
 Size aSize = aBMPEx.GetSizePixel();
-CPPUNIT_ASSERT_EQUAL(Size(193, 193), aSize);
+const auto[scalingX, scalingY] = getDPIScaling();
+CPPUNIT_ASSERT_DOUBLES_EQUAL(193 * scalingX, aSize.getWidth(), 1.0);
+CPPUNIT_ASSERT_DOUBLES_EQUAL(193 * scalingY, aSize.getHeight(), 1.0);
+if (!IsDefaultDPI())
+return;
 
 // Check all borders are red
 // use assertColorsAreSimilar since the color might differ a little bit on 
mac
@@ -144,7 +148,9 @@ CPPUNIT_TEST_FIXTURE(SdPNGExportTest, testTdf126319)
 
 // make sure only the shape is exported
 Size aSize = aBMPEx.GetSizePixel();
-CPPUNIT_ASSERT_EQUAL(Size(295, 134), aSize);
+const auto[scalingX, scalingY] = getDPIScaling();
+CPPUNIT_ASSERT_DOUBLES_EQUAL(295 * scalingX, aSize.getWidth(), 1.0);
+CPPUNIT_ASSERT_DOUBLES_EQUAL(134 * scalingY, aSize.getHeight(), 1.0);
 
 // Check all borders are red or similar. Ignore the corners
 Bitmap aBMP = aBMPEx.GetBitmap();
diff --git a/test/source/bootstrapfixture.cxx b/test/source/bootstrapfixture.cxx
index 4d933a3fc5d2..c13caf807d1e 100644
--- a/test/source/bootstrapfixture.cxx
+++ b/test/source/bootstrapfixture.cxx
@@ -264,6 +264,12 @@ bool test::BootstrapFixture::IsDefaultDPI()
 && Application::GetDefaultDevice()->GetDPIY() == 96);
 }
 
+std::pair test::BootstrapFixture::getDPIScaling()
+{
+return { Application::GetDefaultDevice()->GetDPIX() / 96.0,
+ Application::GetDefaultDevice()->GetDPIY() / 96.0 };
+}
+
 sal_uInt16 test::BootstrapFixture::getDefaultDeviceBitCount()
 {
 ScopedVclPtr device


[Libreoffice-commits] core.git: include/test oox/qa sw/qa test/source

2021-06-04 Thread Miklos Vajna (via logerrit)
 include/test/xmltesttools.hxx  |1 
 oox/qa/unit/export.cxx |   53 -
 sw/qa/unit/swmodeltestbase.cxx |   55 --
 test/source/xmltesttools.cxx   |   58 +
 4 files changed, 61 insertions(+), 106 deletions(-)

New commits:
commit 1ba1bb1cacdc8825d01559859100a2b575967e55
Author: Miklos Vajna 
AuthorDate: Thu Jun 3 20:55:12 2021 +0200
Commit: Miklos Vajna 
CommitDate: Fri Jun 4 09:05:12 2021 +0200

test: introduce XmlTestTools::registerOOXMLNamespaces() to reduce copy

sc/ could potentially benefit from this as well, that's not yet done
here.

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

diff --git a/include/test/xmltesttools.hxx b/include/test/xmltesttools.hxx
index b56bb12db5d2..a4f0ef30d8ba 100644
--- a/include/test/xmltesttools.hxx
+++ b/include/test/xmltesttools.hxx
@@ -98,6 +98,7 @@ protected:
 void  assertXPathNoAttribute(const xmlDocUniquePtr& pXmlDoc, const 
OString& rXPath, const OString& rAttribute);
 
 static void registerODFNamespaces(xmlXPathContextPtr& pXmlXpathCtx);
+static void registerOOXMLNamespaces(xmlXPathContextPtr& pXmlXpathCtx);
 };
 
 #endif
diff --git a/oox/qa/unit/export.cxx b/oox/qa/unit/export.cxx
index 6e6620ab63a4..20ae35c6b727 100644
--- a/oox/qa/unit/export.cxx
+++ b/oox/qa/unit/export.cxx
@@ -55,58 +55,7 @@ void Test::tearDown()
 
 void Test::registerNamespaces(xmlXPathContextPtr& pXmlXpathCtx)
 {
-xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("w"),
-   
BAD_CAST("http://schemas.openxmlformats.org/wordprocessingml/2006/main;));
-xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("v"), 
BAD_CAST("urn:schemas-microsoft-com:vml"));
-xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("mc"),
-   
BAD_CAST("http://schemas.openxmlformats.org/markup-compatibility/2006;));
-xmlXPathRegisterNs(
-pXmlXpathCtx, BAD_CAST("wps"),
-
BAD_CAST("http://schemas.microsoft.com/office/word/2010/wordprocessingShape;));
-xmlXPathRegisterNs(
-pXmlXpathCtx, BAD_CAST("wpg"),
-
BAD_CAST("http://schemas.microsoft.com/office/word/2010/wordprocessingGroup;));
-xmlXPathRegisterNs(
-pXmlXpathCtx, BAD_CAST("wp"),
-
BAD_CAST("http://schemas.openxmlformats.org/drawingml/2006/wordprocessingDrawing;));
-xmlXPathRegisterNs(
-pXmlXpathCtx, BAD_CAST("wp14"),
-
BAD_CAST("http://schemas.microsoft.com/office/word/2010/wordprocessingDrawing;));
-xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("a"),
-   
BAD_CAST("http://schemas.openxmlformats.org/drawingml/2006/main;));
-xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("pic"),
-   
BAD_CAST("http://schemas.openxmlformats.org/drawingml/2006/picture;));
-xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("rels"),
-   
BAD_CAST("http://schemas.openxmlformats.org/package/2006/relationships;));
-xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("w14"),
-   
BAD_CAST("http://schemas.microsoft.com/office/word/2010/wordml;));
-xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("m"),
-   
BAD_CAST("http://schemas.openxmlformats.org/officeDocument/2006/math;));
-xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("ContentType"),
-   
BAD_CAST("http://schemas.openxmlformats.org/package/2006/content-types;));
-xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("lc"),
-   
BAD_CAST("http://schemas.openxmlformats.org/drawingml/2006/lockedCanvas;));
-xmlXPathRegisterNs(
-pXmlXpathCtx, BAD_CAST("cp"),
-
BAD_CAST("http://schemas.openxmlformats.org/package/2006/metadata/core-properties;));
-xmlXPathRegisterNs(
-pXmlXpathCtx, BAD_CAST("extended-properties"),
-
BAD_CAST("http://schemas.openxmlformats.org/officeDocument/2006/extended-properties;));
-xmlXPathRegisterNs(
-pXmlXpathCtx, BAD_CAST("custom-properties"),
-
BAD_CAST("http://schemas.openxmlformats.org/officeDocument/2006/custom-properties;));
-xmlXPathRegisterNs(
-pXmlXpathCtx, BAD_CAST("vt"),
-
BAD_CAST("http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes;));
-xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("dcterms"), 
BAD_CAST("http://purl.org/dc/terms/;));
-xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("a14"),
-   
BAD_CAST("http://schemas.microsoft.com/office/drawing/2010/main;));
-xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("c"),
-   
BAD_CAST("http://schemas.openxmlformats.org/drawingml/2006/chart;));
-xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("o"),
-   BAD_CAST("urn:schemas-microsoft-com:office:office"));
-xmlXPathRegisterNs(pXmlXpathCtx, 

[Libreoffice-commits] core.git: include/test include/unotest sw/qa test/source unotest/source vcl/qa

2021-04-01 Thread Mike Kaganski (via logerrit)
 include/test/bootstrapfixture.hxx|3 
 include/unotest/bootstrapfixturebase.hxx |2 
 sw/qa/extras/uiwriter/uiwriter3.cxx  |2 
 test/source/bootstrapfixture.cxx |9 ++
 unotest/source/cpp/bootstrapfixturebase.cxx  |   13 ---
 vcl/qa/cppunit/BackendTest.cxx   |   90 +++
 vcl/qa/cppunit/bitmaprender/BitmapRenderTest.cxx |2 
 7 files changed, 60 insertions(+), 61 deletions(-)

New commits:
commit 6dfc7354d7100effa380ec7f6e368a2c0ec92232
Author: Mike Kaganski 
AuthorDate: Thu Apr 1 16:54:44 2021 +0300
Commit: Mike Kaganski 
CommitDate: Thu Apr 1 17:39:54 2021 +0200

Exclude tests based on device color depth, not RDP

After 5c9ba1f47d00ed10960b59928befd68f6c020b15, the failures on Jenkins
(see 21191d0d8953a3ca6eac6022c0a14a87fe9c5e2a) made it apparent that
(at least some of) Jenkins builds also run in RDP sessions. Since the
tests excluded in commit 9c6142ec26a0ba61b1cf58d1e6bf0b5376394bcd never
failed in Jenkins builds before, it is wrong to exclude all those tests
in all RDP sessions: our CI would not test those on Windows.

In the meanwhile, I discovered that the system that failed the tests
actually had 16-bit color depth, despite RDP being configured to use
32-bit colors; that was the reason why the colors were modified on
roundtrip. So it is better to test the actual problem to exclude tests.

This reimplements the check that was introduced in commit
9c6142ec26a0ba61b1cf58d1e6bf0b5376394bcd to test default virtual device
color depth.

Change-Id: I329a3e2d8eca21732c77dcacf15394d1246b2e18
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113460
Tested-by: Mike Kaganski 
Reviewed-by: Mike Kaganski 

diff --git a/include/test/bootstrapfixture.hxx 
b/include/test/bootstrapfixture.hxx
index 3a0cc1da7119..b039f0e6e3bf 100644
--- a/include/test/bootstrapfixture.hxx
+++ b/include/test/bootstrapfixture.hxx
@@ -63,6 +63,9 @@ public:
 virtual void setUp() override;
 
 void validate(const OUString& rURL, ValidationFormat) const;
+
+// Allows to exclude tests dependent on color depth of the default virtual 
device
+static sal_uInt16 getDefaultDeviceBitCount();
 };
 }
 
diff --git a/include/unotest/bootstrapfixturebase.hxx 
b/include/unotest/bootstrapfixturebase.hxx
index 11650df8c4d5..1a25e25d4ca0 100644
--- a/include/unotest/bootstrapfixturebase.hxx
+++ b/include/unotest/bootstrapfixturebase.hxx
@@ -65,8 +65,6 @@ public:
 
   virtual void setUp() override;
   virtual void tearDown() override;
-
-  static bool isWindowsRDP();
 };
 
 }
diff --git a/sw/qa/extras/uiwriter/uiwriter3.cxx 
b/sw/qa/extras/uiwriter/uiwriter3.cxx
index f998e2313684..16cb96bf4186 100644
--- a/sw/qa/extras/uiwriter/uiwriter3.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter3.cxx
@@ -2622,7 +2622,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf135661)
 
 CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf133477)
 {
-if (isWindowsRDP())
+if (getDefaultDeviceBitCount() < 24)
 return;
 load(DATA_DIRECTORY, "tdf133477.fodt");
 SwXTextDocument* pTextDoc = 
dynamic_cast(mxComponent.get());
diff --git a/test/source/bootstrapfixture.cxx b/test/source/bootstrapfixture.cxx
index 5116ac32115a..5ae9b3e4ab24 100644
--- a/test/source/bootstrapfixture.cxx
+++ b/test/source/bootstrapfixture.cxx
@@ -25,7 +25,9 @@
 #include 
 #include 
 #include 
+#include 
 #include 
+#include 
 
 #include 
 #include 
@@ -246,4 +248,11 @@ bool test::BootstrapFixture::IsDefaultDPI()
 && Application::GetDefaultDevice()->GetDPIY() == 96);
 }
 
+sal_uInt16 test::BootstrapFixture::getDefaultDeviceBitCount()
+{
+ScopedVclPtr device
+= VclPtr::Create(DeviceFormat::DEFAULT);
+return device->GetBitCount();
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/unotest/source/cpp/bootstrapfixturebase.cxx 
b/unotest/source/cpp/bootstrapfixturebase.cxx
index a8affd272674..5c5b3bcc3a9c 100644
--- a/unotest/source/cpp/bootstrapfixturebase.cxx
+++ b/unotest/source/cpp/bootstrapfixturebase.cxx
@@ -13,10 +13,6 @@
 #include 
 #include 
 
-#if defined _WIN32
-#include 
-#endif
-
 using namespace ::com::sun::star;
 
 // NB. this constructor is called before any tests are run, once for each
@@ -36,13 +32,4 @@ void test::BootstrapFixtureBase::setUp()
 
 void test::BootstrapFixtureBase::tearDown() { 
StarBASIC::DetachAllDocBasicItems(); }
 
-bool test::BootstrapFixtureBase::isWindowsRDP()
-{
-#if defined _WIN32
-return GetSystemMetrics(SM_REMOTESESSION) != 0;
-#else
-return false;
-#endif
-}
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/qa/cppunit/BackendTest.cxx b/vcl/qa/cppunit/BackendTest.cxx
index bb3abce0f99c..43b7bc1b2e13 100644
--- a/vcl/qa/cppunit/BackendTest.cxx
+++ b/vcl/qa/cppunit/BackendTest.cxx
@@ -94,7 +94,7 @@ public:
 
 void testDrawRectWithRectangle()
 {
-if 

[Libreoffice-commits] core.git: include/test sw/qa test/source xmloff/qa

2021-03-26 Thread Miklos Vajna (via logerrit)
 include/test/xmltesttools.hxx  |1 
 sw/qa/unit/swmodeltestbase.cxx |   71 ---
 test/source/xmltesttools.cxx   |   74 +
 xmloff/qa/unit/style.cxx   |5 --
 4 files changed, 77 insertions(+), 74 deletions(-)

New commits:
commit 1fcc08d5dccaf8280fa7709df6eb310b8f502fb2
Author: Miklos Vajna 
AuthorDate: Thu Mar 25 20:59:50 2021 +0100
Commit: Miklos Vajna 
CommitDate: Fri Mar 26 09:07:59 2021 +0100

Extract copy namespace list to XmlTestTools::registerODFNamespaces()

Both sw/ and xmloff/ can depend on test/, so no need to duplicate this.

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

diff --git a/include/test/xmltesttools.hxx b/include/test/xmltesttools.hxx
index f6bd17f0ae30..b56bb12db5d2 100644
--- a/include/test/xmltesttools.hxx
+++ b/include/test/xmltesttools.hxx
@@ -97,6 +97,7 @@ protected:
  */
 void  assertXPathNoAttribute(const xmlDocUniquePtr& pXmlDoc, const 
OString& rXPath, const OString& rAttribute);
 
+static void registerODFNamespaces(xmlXPathContextPtr& pXmlXpathCtx);
 };
 
 #endif
diff --git a/sw/qa/unit/swmodeltestbase.cxx b/sw/qa/unit/swmodeltestbase.cxx
index 53d8d0a71b77..60cd329fbbc9 100644
--- a/sw/qa/unit/swmodeltestbase.cxx
+++ b/sw/qa/unit/swmodeltestbase.cxx
@@ -750,76 +750,7 @@ void 
SwModelTestBase::registerNamespaces(xmlXPathContextPtr& pXmlXpathCtx)
 xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("w10"),
BAD_CAST("urn:schemas-microsoft-com:office:word"));
 // odt
-xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("office"),
-   
BAD_CAST("urn:oasis:names:tc:opendocument:xmlns:office:1.0"));
-xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("style"),
-   
BAD_CAST("urn:oasis:names:tc:opendocument:xmlns:style:1.0"));
-xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("text"),
-   
BAD_CAST("urn:oasis:names:tc:opendocument:xmlns:text:1.0"));
-xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("table"),
-   
BAD_CAST("urn:oasis:names:tc:opendocument:xmlns:table:1.0"));
-xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("draw"),
-   
BAD_CAST("urn:oasis:names:tc:opendocument:xmlns:drawing:1.0"));
-xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("fo"),
-   
BAD_CAST("urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0"));
-xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("config"),
-   
BAD_CAST("urn:oasis:names:tc:opendocument:xmlns:config:1.0"));
-xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("xlink"), 
BAD_CAST("http://www.w3.org/1999/xlink;));
-xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("dc"), 
BAD_CAST("http://purl.org/dc/elements/1.1/;));
-xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("meta"),
-   
BAD_CAST("urn:oasis:names:tc:opendocument:xmlns:meta:1.0"));
-xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("number"),
-   
BAD_CAST("urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0"));
-xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("svg"),
-   
BAD_CAST("urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0"));
-xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("chart"),
-   
BAD_CAST("urn:oasis:names:tc:opendocument:xmlns:chart:1.0"));
-xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("dr3d"),
-   
BAD_CAST("urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0"));
-xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("math"),
-   BAD_CAST("http://www.w3.org/1998/Math/MathML;));
-xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("form"),
-   
BAD_CAST("urn:oasis:names:tc:opendocument:xmlns:form:1.0"));
-xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("script"),
-   
BAD_CAST("urn:oasis:names:tc:opendocument:xmlns:script:1.0"));
-xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("ooo"),
-   BAD_CAST("http://openoffice.org/2004/office;));
-xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("ooow"),
-   BAD_CAST("http://openoffice.org/2004/writer;));
-xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("oooc"), 
BAD_CAST("http://openoffice.org/2004/calc;));
-xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("dom"),
-   BAD_CAST("http://www.w3.org/2001/xml-events;));
-xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("xforms"), 
BAD_CAST("http://www.w3.org/2002/xforms;));
-xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("xsd"), 
BAD_CAST("http://www.w3.org/2001/XMLSchema;));
-xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("xsi"),
-   BAD_CAST("http://www.w3.org/2001/XMLSchema-instance;));
-xmlXPathRegisterNs(pXmlXpathCtx, BAD_CAST("rpt"),
-   

[Libreoffice-commits] core.git: include/test sd/qa svx/source test/source

2020-09-23 Thread Xisco Fauli (via logerrit)
 dev/null   |binary
 include/test/xmltesttools.hxx  |2 -
 sd/qa/unit/export-tests.cxx|   45 -
 svx/source/table/viewcontactoftableobj.cxx |   14 +
 test/source/xmltesttools.cxx   |   10 --
 5 files changed, 16 insertions(+), 55 deletions(-)

New commits:
commit 7ccd8928acbb5a27d9b9f44b09b7575757981e8a
Author: Xisco Fauli 
AuthorDate: Tue Sep 22 18:34:46 2020 +0200
Commit: Xisco Fauli 
CommitDate: Wed Sep 23 13:16:56 2020 +0200

tdf#136949: Revert "tdf#115753 fix table border missing when there are 
merged cells"

This reverts commit 2b19cd84f10552c438dace0a4c52a70ccd440369.

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

diff --git a/include/test/xmltesttools.hxx b/include/test/xmltesttools.hxx
index a23b55986b42..f69255b9b85f 100644
--- a/include/test/xmltesttools.hxx
+++ b/include/test/xmltesttools.hxx
@@ -35,7 +35,7 @@ public:
 /// Return xmlDocPtr representation of the XML stream read from pStream.
 static xmlDocUniquePtr parseXmlStream(SvStream* pStream);
 
-static xmlDocUniquePtr dumpAndParse(MetafileXmlDump& rDumper, const 
GDIMetaFile& rGDIMetaFile, const OUString& rStreamName = OUString());
+static xmlDocUniquePtr dumpAndParse(MetafileXmlDump& rDumper, const 
GDIMetaFile& rGDIMetaFile);
 
 protected:
 XmlTestTools();
diff --git a/sd/qa/unit/data/pptx/tdf115753.pptx 
b/sd/qa/unit/data/pptx/tdf115753.pptx
deleted file mode 100644
index 0350ddaad44c..
Binary files a/sd/qa/unit/data/pptx/tdf115753.pptx and /dev/null differ
diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx
index 1acda7b2712f..2a0603456bee 100644
--- a/sd/qa/unit/export-tests.cxx
+++ b/sd/qa/unit/export-tests.cxx
@@ -18,16 +18,13 @@
 #include 
 #include 
 #include 
-#include 
 #include 
-#include 
 
 #include 
 #include 
 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -80,7 +77,6 @@ public:
 void testGlow();
 void testSoftEdges();
 void testShadowBlur();
-void testTdf115753();
 void testRhbz1870501();
 
 CPPUNIT_TEST_SUITE(SdExportTest);
@@ -119,7 +115,6 @@ public:
 CPPUNIT_TEST(testGlow);
 CPPUNIT_TEST(testSoftEdges);
 CPPUNIT_TEST(testShadowBlur);
-CPPUNIT_TEST(testTdf115753);
 CPPUNIT_TEST(testRhbz1870501);
 
 CPPUNIT_TEST_SUITE_END();
@@ -556,46 +551,6 @@ void SdExportTest::testBnc480256()
 xDocShRef->DoClose();
 }
 
-void SdExportTest::testTdf115753()
-{
-sd::DrawDocShellRef xDocShRef = 
loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/tdf115753.pptx"), 
PPTX);
-xDocShRef = saveAndReload(xDocShRef.get(), PPTX);
-uno::Reference< drawing::XDrawPagesSupplier > 
xDoc(xDocShRef->GetDoc()->getUnoModel(), uno::UNO_QUERY_THROW);
-uno::Reference< drawing::XDrawPage > 
xPage(xDoc->getDrawPages()->getByIndex(0), uno::UNO_QUERY_THROW);
-uno::Reference< drawing::XShape > xShape(xPage->getByIndex(0), 
uno::UNO_QUERY_THROW);
-
-// Save the first shape to a metafile.
-uno::Reference xGraphicExporter = 
drawing::GraphicExportFilter::create(comphelper::getProcessComponentContext());
-uno::Reference xSourceDoc(xShape, uno::UNO_QUERY);
-xGraphicExporter->setSourceDocument(xSourceDoc);
-
-SvMemoryStream aStream;
-uno::Reference xOutputStream(new 
utl::OStreamWrapper(aStream));
-uno::Sequence 
aDescriptor(comphelper::InitPropertySequence({
-{ "OutputStream", uno::Any(xOutputStream) },
-{ "FilterName", uno::Any(OUString("SVM")) }
-}));
-xGraphicExporter->filter(aDescriptor);
-aStream.Seek(STREAM_SEEK_TO_BEGIN);
-
-// Read it back and dump it as an XML file.
-Graphic aGraphic;
-ReadGraphic(aStream, aGraphic);
-const GDIMetaFile& rMetaFile = aGraphic.GetGDIMetaFile();
-MetafileXmlDump dumper;
-
-xmlDocUniquePtr pXmlDoc = XmlTestTools::dumpAndParse(dumper, rMetaFile);
-CPPUNIT_ASSERT(pXmlDoc);
-// Without the fix in place, it will print:
-// - Expected: 21180
-// - Actual  : 12714
-// because without the fix, one of the border lines is missing,
-// and the value, which is where the line ends, will be shorter
-// than it should be.
-assertXPath(pXmlDoc, "/metafile/push[6]/polyline/point[2]", "x", "21180");
-xDocShRef->DoClose();
-}
-
 void SdExportTest::testUnknownAttributes()
 {
 ::sd::DrawDocShellRef xDocShRef = 
loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/unknown-attribute.fodp"), 
FODP);
diff --git a/svx/source/table/viewcontactoftableobj.cxx 
b/svx/source/table/viewcontactoftableobj.cxx
index d2778e83..fe6d03f1d900 100644
--- a/svx/source/table/viewcontactoftableobj.cxx
+++ b/svx/source/table/viewcontactoftableobj.cxx
@@ -254,6 +254,20 @@ namespace sdr::contact
   

[Libreoffice-commits] core.git: include/test

2020-08-28 Thread Michael Stahl (via logerrit)
 include/test/xmltesttools.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 92f308fdc4e425234742801001c87d330295f35a
Author: Michael Stahl 
AuthorDate: Fri Aug 28 12:29:38 2020 +0200
Commit: Michael Stahl 
CommitDate: Fri Aug 28 12:33:57 2020 +0200

test: fix misleading documentation of assertXPathNoAttribute()

Change-Id: I5bb603fe1d615f7df790bcd352beb09d65dcb3a0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101536
Reviewed-by: Michael Stahl 
Tested-by: Michael Stahl 

diff --git a/include/test/xmltesttools.hxx b/include/test/xmltesttools.hxx
index d27e40796363..a23b55986b42 100644
--- a/include/test/xmltesttools.hxx
+++ b/include/test/xmltesttools.hxx
@@ -92,7 +92,7 @@ protected:
  */
 void  assertXPathChildren(const xmlDocUniquePtr& pXmlDoc, const 
OString& rXPath, int nNumberOfChildNodes);
 /**
- * Assert that rXPath exists, has exactly 1 child node and does *not* have 
an attribute named rAttribute.
+ * Assert that rXPath exists, has exactly 1 result set nodes and does 
*not* have an attribute named rAttribute.
  */
 void  assertXPathNoAttribute(const xmlDocUniquePtr& pXmlDoc, const 
OString& rXPath, const OString& rAttribute);
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/test sd/qa svx/source test/source

2020-07-29 Thread nd101 (via logerrit)
 include/test/xmltesttools.hxx  |2 -
 sd/qa/unit/data/pptx/tdf115753.pptx|binary
 sd/qa/unit/export-tests.cxx|   45 +
 svx/source/table/viewcontactoftableobj.cxx |   14 -
 test/source/xmltesttools.cxx   |   10 +-
 5 files changed, 55 insertions(+), 16 deletions(-)

New commits:
commit 2b19cd84f10552c438dace0a4c52a70ccd440369
Author: nd101 
AuthorDate: Sat May 9 11:45:25 2020 +0800
Commit: Miklos Vajna 
CommitDate: Wed Jul 29 12:03:34 2020 +0200

tdf#115753 fix table border missing when there are merged cells

Remove code that ignores merged cells.

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

diff --git a/include/test/xmltesttools.hxx b/include/test/xmltesttools.hxx
index a2c08d7dc0e8..d27e40796363 100644
--- a/include/test/xmltesttools.hxx
+++ b/include/test/xmltesttools.hxx
@@ -35,7 +35,7 @@ public:
 /// Return xmlDocPtr representation of the XML stream read from pStream.
 static xmlDocUniquePtr parseXmlStream(SvStream* pStream);
 
-static xmlDocUniquePtr dumpAndParse(MetafileXmlDump& rDumper, const 
GDIMetaFile& rGDIMetaFile);
+static xmlDocUniquePtr dumpAndParse(MetafileXmlDump& rDumper, const 
GDIMetaFile& rGDIMetaFile, const OUString& rStreamName = OUString());
 
 protected:
 XmlTestTools();
diff --git a/sd/qa/unit/data/pptx/tdf115753.pptx 
b/sd/qa/unit/data/pptx/tdf115753.pptx
new file mode 100755
index ..0350ddaad44c
Binary files /dev/null and b/sd/qa/unit/data/pptx/tdf115753.pptx differ
diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx
index a6ad545b3221..eb97da60fd1f 100644
--- a/sd/qa/unit/export-tests.cxx
+++ b/sd/qa/unit/export-tests.cxx
@@ -18,13 +18,16 @@
 #include 
 #include 
 #include 
+#include 
 #include 
+#include 
 
 #include 
 #include 
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -77,6 +80,7 @@ public:
 void testGlow();
 void testSoftEdges();
 void testShadowBlur();
+void testTdf115753();
 
 CPPUNIT_TEST_SUITE(SdExportTest);
 
@@ -114,6 +118,7 @@ public:
 CPPUNIT_TEST(testGlow);
 CPPUNIT_TEST(testSoftEdges);
 CPPUNIT_TEST(testShadowBlur);
+CPPUNIT_TEST(testTdf115753);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -549,6 +554,46 @@ void SdExportTest::testBnc480256()
 xDocShRef->DoClose();
 }
 
+void SdExportTest::testTdf115753()
+{
+sd::DrawDocShellRef xDocShRef = 
loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/tdf115753.pptx"), 
PPTX);
+xDocShRef = saveAndReload(xDocShRef.get(), PPTX);
+uno::Reference< drawing::XDrawPagesSupplier > 
xDoc(xDocShRef->GetDoc()->getUnoModel(), uno::UNO_QUERY_THROW);
+uno::Reference< drawing::XDrawPage > 
xPage(xDoc->getDrawPages()->getByIndex(0), uno::UNO_QUERY_THROW);
+uno::Reference< drawing::XShape > xShape(xPage->getByIndex(0), 
uno::UNO_QUERY_THROW);
+
+// Save the first shape to a metafile.
+uno::Reference xGraphicExporter = 
drawing::GraphicExportFilter::create(comphelper::getProcessComponentContext());
+uno::Reference xSourceDoc(xShape, uno::UNO_QUERY);
+xGraphicExporter->setSourceDocument(xSourceDoc);
+
+SvMemoryStream aStream;
+uno::Reference xOutputStream(new 
utl::OStreamWrapper(aStream));
+uno::Sequence 
aDescriptor(comphelper::InitPropertySequence({
+{ "OutputStream", uno::Any(xOutputStream) },
+{ "FilterName", uno::Any(OUString("SVM")) }
+}));
+xGraphicExporter->filter(aDescriptor);
+aStream.Seek(STREAM_SEEK_TO_BEGIN);
+
+// Read it back and dump it as an XML file.
+Graphic aGraphic;
+ReadGraphic(aStream, aGraphic);
+const GDIMetaFile& rMetaFile = aGraphic.GetGDIMetaFile();
+MetafileXmlDump dumper;
+
+xmlDocUniquePtr pXmlDoc = XmlTestTools::dumpAndParse(dumper, rMetaFile);
+CPPUNIT_ASSERT(pXmlDoc);
+// Without the fix in place, it will print:
+// - Expected: 21180
+// - Actual  : 12714
+// because without the fix, one of the border lines is missing,
+// and the value, which is where the line ends, will be shorter
+// than it should be.
+assertXPath(pXmlDoc, "/metafile/push[6]/polyline/point[2]", "x", "21180");
+xDocShRef->DoClose();
+}
+
 void SdExportTest::testUnknownAttributes()
 {
 ::sd::DrawDocShellRef xDocShRef = 
loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/unknown-attribute.fodp"), 
FODP);
diff --git a/svx/source/table/viewcontactoftableobj.cxx 
b/svx/source/table/viewcontactoftableobj.cxx
index fe6d03f1d900..d2778e83 100644
--- a/svx/source/table/viewcontactoftableobj.cxx
+++ b/svx/source/table/viewcontactoftableobj.cxx
@@ -254,20 +254,6 @@ namespace sdr::contact
 aArray.SetCellStyleRight(aCellPos.mnCol, 
aCellPos.mnRow, impGetLineStyle(rTableLayouter, aCellPos.mnCol + 1, 

[Libreoffice-commits] core.git: include/test sc/qa test/source

2020-04-26 Thread Andrea Gelmini (via logerrit)
 include/test/sheet/xcalculatable.hxx |2 +-
 sc/qa/extras/scmodelobj.cxx  |2 +-
 test/source/sheet/xcalculatable.cxx  |2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 2c7bed21f45174833bf2b7d2598b008062917c65
Author: Andrea Gelmini 
AuthorDate: Sun Apr 26 13:33:56 2020 +0200
Commit: Julien Nabet 
CommitDate: Sun Apr 26 15:38:46 2020 +0200

Fix typo in code

Change-Id: I4709f3fd11c8d5800efab65b6f9533cbad3ffe78
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92927
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/include/test/sheet/xcalculatable.hxx 
b/include/test/sheet/xcalculatable.hxx
index 7978fe42acdc..94614768ef15 100644
--- a/include/test/sheet/xcalculatable.hxx
+++ b/include/test/sheet/xcalculatable.hxx
@@ -27,7 +27,7 @@ public:
 
 void testCalculate();
 void testCalculateAll();
-void testEnableAutomaticCaclulation();
+void testEnableAutomaticCalculation();
 
 protected:
 ~XCalculatable() {}
diff --git a/sc/qa/extras/scmodelobj.cxx b/sc/qa/extras/scmodelobj.cxx
index b939d7558cff..48b050b1134b 100644
--- a/sc/qa/extras/scmodelobj.cxx
+++ b/sc/qa/extras/scmodelobj.cxx
@@ -56,7 +56,7 @@ public:
 // XCalculatable
 CPPUNIT_TEST(testCalculate);
 CPPUNIT_TEST(testCalculateAll);
-CPPUNIT_TEST(testEnableAutomaticCaclulation);
+CPPUNIT_TEST(testEnableAutomaticCalculation);
 
 // XConsolidatable
 CPPUNIT_TEST(testCreateConsolidationDescriptor);
diff --git a/test/source/sheet/xcalculatable.cxx 
b/test/source/sheet/xcalculatable.cxx
index a63669b1727d..44c20153401c 100644
--- a/test/source/sheet/xcalculatable.cxx
+++ b/test/source/sheet/xcalculatable.cxx
@@ -22,7 +22,7 @@ using namespace com::sun::star::uno;
 
 namespace apitest
 {
-void XCalculatable::testEnableAutomaticCaclulation()
+void XCalculatable::testEnableAutomaticCalculation()
 {
 uno::Reference xCalculatable(init(), 
UNO_QUERY_THROW);
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/test sw/inc sw/source test/source testtools/source

2020-03-13 Thread Noel Grandin (via logerrit)
 include/test/bootstrapfixture.hxx   |4 -
 include/test/container/xelementaccess.hxx   |2 
 include/test/container/xindexaccess.hxx |2 
 include/test/container/xnamecontainer.hxx   |2 
 include/test/container/xnamed.hxx   |2 
 include/test/container/xnamereplace.hxx |2 
 include/test/sheet/xformulaquery.hxx|8 +--
 include/test/sheet/xnamedranges.hxx |2 
 include/test/sheet/xspreadsheetdocument.hxx |2 
 include/test/unoapi_test.hxx|2 
 include/test/util/xreplaceable.hxx  |4 -
 include/test/util/xsearchable.hxx   |4 -
 sw/inc/EnhancedPDFExportHelper.hxx  |4 -
 sw/inc/SwUndoField.hxx  |6 +-
 sw/inc/ToxLinkProcessor.hxx |8 +--
 sw/inc/ToxTabStopTokenHandler.hxx   |6 +-
 sw/inc/accmap.hxx   |2 
 sw/inc/acmplwrd.hxx |2 
 sw/inc/calc.hxx |2 
 sw/inc/ccoll.hxx|4 -
 sw/inc/crstate.hxx  |2 
 sw/inc/ddefld.hxx   |2 
 sw/inc/docufld.hxx  |6 +-
 sw/inc/editsh.hxx   |2 
 sw/inc/expfld.hxx   |6 +-
 sw/inc/fldbas.hxx   |2 
 sw/inc/fmtfld.hxx   |2 
 sw/inc/fmthdft.hxx  |4 -
 sw/inc/frmfmt.hxx   |2 
 sw/inc/gotodlg.hxx  |2 
 sw/inc/grfatr.hxx   |2 
 sw/inc/hhcwrp.hxx   |2 
 sw/inc/hints.hxx|   28 ++--
 sw/inc/htmltbl.hxx  |   36 
 sw/inc/modcfg.hxx   |2 
 sw/inc/modeltoviewhelper.hxx|6 +-
 sw/inc/node.hxx |6 +-
 sw/inc/pagedesc.hxx |2 
 sw/inc/prtopt.hxx   |2 
 sw/inc/redline.hxx  |4 -
 sw/inc/shellio.hxx  |   16 +++
 sw/inc/shellres.hxx |   50 +++---
 sw/inc/splargs.hxx  |6 +-
 sw/inc/swatrset.hxx |2 
 sw/inc/swcli.hxx|2 
 sw/inc/swscanner.hxx|6 +-
 sw/inc/tblsel.hxx   |8 +--
 sw/inc/tox.hxx  |6 +-
 sw/inc/txatritr.hxx |2 
 sw/inc/undobj.hxx   |4 -
 sw/inc/unochart.hxx |4 -
 sw/inc/unosett.hxx  |2 
 sw/inc/unostyle.hxx |   10 ++--
 sw/inc/unotxdoc.hxx |6 +-
 sw/source/core/access/acccontext.hxx|2 
 sw/source/core/access/accfrmobjmap.hxx  |6 +-
 sw/source/core/access/acchyperlink.hxx  |4 -
 sw/source/core/access/accmap.cxx|6 +-
 sw/source/core/access/accpara.cxx   |2 
 sw/source/core/access/acctable.cxx  |4 -
 sw/source/core/crsr/crbm.cxx|2 
 sw/source/core/crsr/findattr.cxx|6 +-
 sw/source/core/crsr/findtxt.cxx |4 -
 sw/source/core/crsr/swcrsr.cxx  |2 
 sw/source/core/doc/CntntIdxStore.cxx|4 -
 sw/source/core/doc/DocumentStylePoolManager.cxx |8 +--
 sw/source/core/doc/doccomp.cxx  |2 
 sw/source/core/doc/docedt.cxx   |4 -
 sw/source/core/doc/doctxm.cxx   |2 
 sw/source/core/doc/htmltbl.cxx  |6 +-
 sw/source/core/doc/tblrwcl.cxx  |2 
 sw/source/core/docnode/ndcopy.cxx   |4 -
 sw/source/core/docnode/ndtbl.cxx|2 
 sw/source/core/docnode/ndtbl1.cxx   |2 
 sw/source/core/docnode/node2lay.cxx |2 
 sw/source/core/docnode/threadmanager.hxx|2 
 sw/source/core/draw/dcontact.cxx|4 -
 sw/source/core/fields/reffld.cxx|2 
 sw/source/core/inc/SwUndoFmt.hxx|4 -
 sw/source/core/inc/SwUndoPageDesc.hxx   |2 
 sw/source/core/inc/SwXMLBlockImport.hxx |2 
 sw/source/core/inc/UndoCore.hxx |2 
 sw/source/core/inc/UndoDelete.hxx   |4 -
 sw/source/core/inc/UndoDraw.hxx |2 
 sw/source/core/inc/UndoInsert.hxx   |   20 
 

[Libreoffice-commits] core.git: include/test sc/qa

2020-03-04 Thread Jens Carl (via logerrit)
 include/test/container/xnamereplace.hxx |2 +-
 sc/qa/extras/scautoformatsobj.cxx   |6 --
 sc/qa/extras/scstylefamilyobj.cxx   |4 ++--
 sc/qa/extras/sctablesheetsobj.cxx   |2 +-
 4 files changed, 8 insertions(+), 6 deletions(-)

New commits:
commit 70d40d57f46afd593a86a12281546b570c2fd330
Author: Jens Carl 
AuthorDate: Sat Feb 29 12:05:41 2020 -0800
Commit: Jens Carl 
CommitDate: Thu Mar 5 06:28:53 2020 +0100

Rename method setReplacementElement()

... to setElement() to have a uniform interface with
similar classes like XNameContainer.

Change-Id: I2058e3ea9f14a5792a07f23f4bd13c4708dccdfc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89784
Tested-by: Jens Carl 
Reviewed-by: Jens Carl 

diff --git a/include/test/container/xnamereplace.hxx 
b/include/test/container/xnamereplace.hxx
index ddfbb4027eb7..a5e7fe516657 100644
--- a/include/test/container/xnamereplace.hxx
+++ b/include/test/container/xnamereplace.hxx
@@ -31,7 +31,7 @@ public:
 virtual css::uno::Reference init() = 0;
 void testReplaceByName();
 
-void setReplacementElement(const css::uno::Any& rElement) { 
m_aReplacementElement = rElement; }
+void setElement(const css::uno::Any& rElement) { m_aReplacementElement = 
rElement; }
 
 protected:
 ~XNameReplace() {}
diff --git a/sc/qa/extras/scautoformatsobj.cxx 
b/sc/qa/extras/scautoformatsobj.cxx
index 42cee493c9e2..ed799c018ef4 100644
--- a/sc/qa/extras/scautoformatsobj.cxx
+++ b/sc/qa/extras/scautoformatsobj.cxx
@@ -109,9 +109,11 @@ uno::Reference ScAutoFormatsObj::init()
   
uno::makeAny(xMSF->createInstance("com.sun.star.sheet.TableAutoFormat")));
 }
 // XNameContainer
-
setElement(uno::makeAny(xMSF->createInstance("com.sun.star.sheet.TableAutoFormat")));
+XNameContainer::setElement(
+
uno::makeAny(xMSF->createInstance("com.sun.star.sheet.TableAutoFormat")));
 // XNameReplace
-
setReplacementElement(uno::makeAny(xMSF->createInstance("com.sun.star.sheet.TableAutoFormat")));
+XNameReplace::setElement(
+
uno::makeAny(xMSF->createInstance("com.sun.star.sheet.TableAutoFormat")));
 
 return xTAF;
 }
diff --git a/sc/qa/extras/scstylefamilyobj.cxx 
b/sc/qa/extras/scstylefamilyobj.cxx
index fe5d8fb2ec19..a5843a8f3a1f 100644
--- a/sc/qa/extras/scstylefamilyobj.cxx
+++ b/sc/qa/extras/scstylefamilyobj.cxx
@@ -107,9 +107,9 @@ uno::Reference ScStyleFamilyObj::init()
 uno::Reference 
xCS(xMSF->createInstance("com.sun.star.style.CellStyle"),
 uno::UNO_SET_THROW);
 // XNameContainer
-
setElement(uno::makeAny(xMSF->createInstance("com.sun.star.style.CellStyle")));
+
XNameContainer::setElement(uno::makeAny(xMSF->createInstance("com.sun.star.style.CellStyle")));
 // XNameReplace
-
setReplacementElement(uno::makeAny(xMSF->createInstance("com.sun.star.style.CellStyle")));
+
XNameReplace::setElement(uno::makeAny(xMSF->createInstance("com.sun.star.style.CellStyle")));
 
 uno::Reference xNC(xNA_SF, 
uno::UNO_QUERY_THROW);
 xNC->insertByName("ScStyleFamilyObj", uno::makeAny(xCS));
diff --git a/sc/qa/extras/sctablesheetsobj.cxx 
b/sc/qa/extras/sctablesheetsobj.cxx
index 286ff839622c..a8ffa36b2ed8 100644
--- a/sc/qa/extras/sctablesheetsobj.cxx
+++ b/sc/qa/extras/sctablesheetsobj.cxx
@@ -145,7 +145,7 @@ uno::Reference ScTableSheetsObj::init()
 XNameContainer::setElement(
 uno::makeAny(xMSF->createInstance("com.sun.star.sheet.Spreadsheet")));
 // XNameReplace
-
setReplacementElement(uno::makeAny(xMSF->createInstance("com.sun.star.sheet.Spreadsheet")));
+
XNameReplace::setElement(uno::makeAny(xMSF->createInstance("com.sun.star.sheet.Spreadsheet")));
 
 return xReturn;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/test include/toolkit include/tools

2020-01-27 Thread Pelin Kuran (via logerrit)
 include/test/bootstrapfixture.hxx  |5 +
 include/test/sheet/xdocumentauditing.hxx   |5 +
 include/toolkit/helper/emptyfontdescriptor.hxx |6 +-
 include/tools/cpuid.hxx|5 +
 include/tools/inetstrm.hxx |5 +
 5 files changed, 5 insertions(+), 21 deletions(-)

New commits:
commit f61ed40fff871a5b301b05c9d8e0755f16bf0a83
Author: Pelin Kuran 
AuthorDate: Mon Jan 27 14:38:22 2020 +0300
Commit: Muhammet Kara 
CommitDate: Mon Jan 27 21:44:04 2020 +0100

tdf#124176: Use pragma once instead of header guard

Change-Id: Id28874549342349fb2727c3cb8e92da1dcdb727c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87513
Reviewed-by: Muhammet Kara 
Tested-by: Muhammet Kara 

diff --git a/include/test/bootstrapfixture.hxx 
b/include/test/bootstrapfixture.hxx
index 986ff1a7578f..e93a6a583b43 100644
--- a/include/test/bootstrapfixture.hxx
+++ b/include/test/bootstrapfixture.hxx
@@ -6,8 +6,7 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
-#ifndef INCLUDED_TEST_BOOTSTRAPFIXTURE_HXX
-#define INCLUDED_TEST_BOOTSTRAPFIXTURE_HXX
+#pragma once
 
 #include 
 
@@ -59,6 +58,4 @@ public:
 
 }
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/test/sheet/xdocumentauditing.hxx 
b/include/test/sheet/xdocumentauditing.hxx
index 5c19446ca252..282db0226d58 100644
--- a/include/test/sheet/xdocumentauditing.hxx
+++ b/include/test/sheet/xdocumentauditing.hxx
@@ -7,8 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#ifndef INCLUDED_TEST_SHEET_XDOCUMENTAUDITING_HXX
-#define INCLUDED_TEST_SHEET_XDOCUMENTAUDITING_HXX
+#pragma once
 
 #include 
 #include 
@@ -42,6 +41,4 @@ private:
 };
 } // namespace apitest
 
-#endif // INCLUDED_TEST_SHEET_XDOCUMENTAUDITING_HXX
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/include/toolkit/helper/emptyfontdescriptor.hxx 
b/include/toolkit/helper/emptyfontdescriptor.hxx
index 28a1aa3c1f14..ffd6f65b681d 100644
--- a/include/toolkit/helper/emptyfontdescriptor.hxx
+++ b/include/toolkit/helper/emptyfontdescriptor.hxx
@@ -17,8 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#ifndef INCLUDED_TOOLKIT_HELPER_EMPTYFONTDESCRIPTOR_HXX
-#define INCLUDED_TOOLKIT_HELPER_EMPTYFONTDESCRIPTOR_HXX
+#pragma once
 
 #include 
 #include 
@@ -40,7 +39,4 @@ public:
 }
 };
 
-
-#endif // INCLUDED_TOOLKIT_HELPER_EMPTYFONTDESCRIPTOR_HXX
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/tools/cpuid.hxx b/include/tools/cpuid.hxx
index 27e9987398e4..90c7d37b485c 100644
--- a/include/tools/cpuid.hxx
+++ b/include/tools/cpuid.hxx
@@ -8,8 +8,7 @@
  *
  */
 
-#ifndef INCLUDED_TOOLS_CPUID_HXX
-#define INCLUDED_TOOLS_CPUID_HXX
+#pragma once
 
 #include 
 #include 
@@ -80,6 +79,4 @@ inline bool hasHyperThreading()
 
 } // end cpuid
 
-#endif // INCLUDED_TOOLS_CPUID_HXX
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/tools/inetstrm.hxx b/include/tools/inetstrm.hxx
index 48e371fa0105..f85fc3436f09 100644
--- a/include/tools/inetstrm.hxx
+++ b/include/tools/inetstrm.hxx
@@ -16,8 +16,7 @@
  *   except in compliance with the License. You may obtain a copy of
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
-#ifndef INCLUDED_TOOLS_INETSTRM_HXX
-#define INCLUDED_TOOLS_INETSTRM_HXX
+#pragma once
 
 #include 
 #include 
@@ -61,6 +60,4 @@ public:
 int Read (char *pData, sal_uInt32 nSize);
 };
 
-#endif
-
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/test offapi/com sc/inc sc/qa sc/source sw/inc sw/PythonTest_sw_python.mk sw/qa sw/source test/source

2019-12-22 Thread Samuel Mehrbrodt (via logerrit)
 include/test/style/xstyleloader.hxx |1 
 offapi/com/sun/star/style/XStyleLoader.idl  |3 +
 sc/inc/tablink.hxx  |9 ++--
 sc/qa/extras/scstylefamiliesobj.cxx |1 
 sc/source/ui/docshell/tablink.cxx   |5 ++
 sc/source/ui/unoobj/styleuno.cxx|   22 ++-
 sw/PythonTest_sw_python.mk  |1 
 sw/inc/docsh.hxx|3 -
 sw/inc/shellio.hxx  |7 +++
 sw/qa/python/testdocuments/xstyleloader.odt |binary
 sw/qa/python/xstyleloader.py|   56 
 sw/source/core/unocore/unostyle.cxx |   24 ++--
 sw/source/uibase/app/docsh2.cxx |5 +-
 test/source/style/xstyleloader.cxx  |   30 +++
 14 files changed, 154 insertions(+), 13 deletions(-)

New commits:
commit 0322a41224a7264bbe03a068647ab093bcc88f90
Author: Samuel Mehrbrodt 
AuthorDate: Wed Dec 18 15:01:38 2019 +0100
Commit: Samuel Mehrbrodt 
CommitDate: Mon Dec 23 08:21:14 2019 +0100

XStyleLoader::loadStylesFromURL Allow loading from stream

Change-Id: Iab0c301096118203466dd91c724c25f1283a0488
Reviewed-on: https://gerrit.libreoffice.org/85392
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt 

diff --git a/include/test/style/xstyleloader.hxx 
b/include/test/style/xstyleloader.hxx
index 4077d30327d0..ca34a72cf4b3 100644
--- a/include/test/style/xstyleloader.hxx
+++ b/include/test/style/xstyleloader.hxx
@@ -32,6 +32,7 @@ public:
 
 // XStyleLoader
 void testLoadStylesFromURL();
+void testLoadStylesFromStream();
 // XStyleLoader2
 void testLoadStylesFromDocument();
 
diff --git a/offapi/com/sun/star/style/XStyleLoader.idl 
b/offapi/com/sun/star/style/XStyleLoader.idl
index a695b79dde21..2899f23d61b2 100644
--- a/offapi/com/sun/star/style/XStyleLoader.idl
+++ b/offapi/com/sun/star/style/XStyleLoader.idl
@@ -38,8 +38,10 @@ published interface XStyleLoader: 
com::sun::star::uno::XInterface
 defined in this document are loaded.
  @param URL
  The directory and the filename from document with the styles
+ You can also load from stream. Use "private:stream" as the URL 
and the InputStream parameter below.
  @param aOptions
  Specifies which of the Style families the method should load.
+
  The sequence has the following, optional 
items:
  
  boolean LoadCellStyles 
@@ -48,6 +50,7 @@ published interface XStyleLoader: 
com::sun::star::uno::XInterface
  boolean LoadPageStyles 
  boolean LoadNumberingStyles 
  boolean OverwriteStyles
+ com::sun::star::io::XInputStream InputStream (since LibreOffice 
6.5)
 
  As the default, all supported style families are loaded and existing 
styles are overwritten.
  */
diff --git a/sc/inc/tablink.hxx b/sc/inc/tablink.hxx
index 7038bd345fae..eb5e2f665696 100644
--- a/sc/inc/tablink.hxx
+++ b/sc/inc/tablink.hxx
@@ -82,10 +82,11 @@ private:
 SfxMedium*  pMedium;
 
 public:
-ScDocumentLoader( const OUString& rFileName,
-  OUString& rFilterName, OUString& 
rOptions,
-  sal_uInt32 nRekCnt = 0, 
weld::Window* pInteractionParent = nullptr );
-~ScDocumentLoader();
+ScDocumentLoader(const OUString& rFileName, OUString& rFilterName, 
OUString& rOptions,
+ sal_uInt32 nRekCnt = 0, weld::Window* pInteractionParent 
= nullptr,
+ css::uno::Reference xInputStream
+ = css::uno::Reference());
+~ScDocumentLoader();
 ScDocument* GetDocument();
 ScDocShell* GetDocShell()   { return pDocShell; }
 boolIsError() const;
diff --git a/sc/qa/extras/scstylefamiliesobj.cxx 
b/sc/qa/extras/scstylefamiliesobj.cxx
index 26cbce051de5..991334d192b7 100644
--- a/sc/qa/extras/scstylefamiliesobj.cxx
+++ b/sc/qa/extras/scstylefamiliesobj.cxx
@@ -70,6 +70,7 @@ public:
 
 // XStyleLoader
 CPPUNIT_TEST(testLoadStylesFromDocument);
+CPPUNIT_TEST(testLoadStylesFromStream);
 CPPUNIT_TEST(testLoadStylesFromURL);
 
 CPPUNIT_TEST_SUITE_END();
diff --git a/sc/source/ui/docshell/tablink.cxx 
b/sc/source/ui/docshell/tablink.cxx
index 6d43206f4c0a..9ef612caa161 100644
--- a/sc/source/ui/docshell/tablink.cxx
+++ b/sc/source/ui/docshell/tablink.cxx
@@ -514,7 +514,8 @@ SfxMedium* ScDocumentLoader::CreateMedium( const OUString& 
rFileName, std::share
 
 ScDocumentLoader::ScDocumentLoader(const OUString& rFileName,
OUString& rFilterName, OUString& rOptions,
-   sal_uInt32 nRekCnt, weld::Window* 
pInteractionParent)
+   sal_uInt32 nRekCnt, weld::Window* 
pInteractionParent,
+   

[Libreoffice-commits] core.git: include/test sc/qa test/source

2019-12-06 Thread Eike Rathke (via logerrit)
 include/test/sheet/xspreadsheets2.hxx |1 
 sc/qa/extras/sctablesheetsobj.cxx |1 
 test/source/sheet/xspreadsheets2.cxx  |   54 ++
 3 files changed, 56 insertions(+)

New commits:
commit ec1478f7da29fc5df5aa2d1ff373d60bdd5b01e0
Author: Eike Rathke 
AuthorDate: Fri Dec 6 20:36:13 2019 +0100
Commit: Eike Rathke 
CommitDate: Fri Dec 6 23:19:14 2019 +0100

Test results across all imported and inserted sheets.

Change-Id: I573467a962a2835765cc5672b81cce4c7772ddff
Reviewed-on: https://gerrit.libreoffice.org/84669
Reviewed-by: Eike Rathke 
Tested-by: Jenkins

diff --git a/include/test/sheet/xspreadsheets2.hxx 
b/include/test/sheet/xspreadsheets2.hxx
index 1340b80be216..6c2cd0952b28 100644
--- a/include/test/sheet/xspreadsheets2.hxx
+++ b/include/test/sheet/xspreadsheets2.hxx
@@ -36,6 +36,7 @@ public:
 void testImportNamedRangeRedefinedInSource();
 void testImportNewNamedRange();
 void testImportCellStyle();
+void testLastAfterInsertCopy();
 
 virtual css::uno::Reference< css::lang::XComponent > getComponent() = 0;
 virtual css::uno::Reference< css::uno::XInterface > init() = 0;
diff --git a/sc/qa/extras/sctablesheetsobj.cxx 
b/sc/qa/extras/sctablesheetsobj.cxx
index 6a8f0928d954..99d55ea75a16 100644
--- a/sc/qa/extras/sctablesheetsobj.cxx
+++ b/sc/qa/extras/sctablesheetsobj.cxx
@@ -53,6 +53,7 @@ public:
 CPPUNIT_TEST(testImportNamedRangeRedefinedInSource);
 CPPUNIT_TEST(testImportNewNamedRange);
 CPPUNIT_TEST(testImportCellStyle);
+CPPUNIT_TEST(testLastAfterInsertCopy);
 
 // XNameContainer
 CPPUNIT_TEST(testRemoveByName);
diff --git a/test/source/sheet/xspreadsheets2.cxx 
b/test/source/sheet/xspreadsheets2.cxx
index fc7f1023fc1c..dee4e3136a09 100644
--- a/test/source/sheet/xspreadsheets2.cxx
+++ b/test/source/sheet/xspreadsheets2.cxx
@@ -44,6 +44,9 @@ static constexpr OUStringLiteral 
gaSrcSheetName("SheetToCopy");
 static constexpr OUStringLiteral gaSrcFileName("rangenamessrc.ods");
 static constexpr OUStringLiteral gaDestFileBase("ScNamedRangeObj.ods");
 
+static sal_Int32 nInsertedSheets(0);
+
+
 XSpreadsheets2::XSpreadsheets2()
 {
 }
@@ -275,6 +278,56 @@ void XSpreadsheets2::testImportCellStyle()
 CPPUNIT_ASSERT_EQUAL_MESSAGE("New style: VertJustify not set", 
table::CellVertJustify_CENTER, 
static_cast(aVertJustify));
 }
 
+void XSpreadsheets2::testLastAfterInsertCopy()
+{
+/** Test that results in row 1 of all inserted sheets are equal to the
+source sheet. The loaded destination document is kept open so several
+sheets are imported.
+*/
+
+CPPUNIT_ASSERT(nInsertedSheets > 0);
+constexpr sal_Int32 nCols = 7;
+
+uno::Reference< container::XNameAccess> 
xSrcNameAccess(init(),UNO_QUERY_THROW);
+xSrcSheet.set( xSrcNameAccess->getByName(gaSrcSheetName), UNO_QUERY_THROW);
+
+OUString aSrcString[nCols];
+for (sal_Int32 nCol=0; nCol < nCols; ++nCol)
+{
+uno::Reference< table::XCell > xSrcCell = 
xSrcSheet->getCellByPosition(nCol, 0);
+uno::Reference< text::XTextRange > xSrcTextRange(xSrcCell, 
UNO_QUERY_THROW);
+aSrcString[nCol] = xSrcTextRange->getString();
+}
+// The named range 'initial2' is already present in the destination
+// document defined to $Sheet1.$B$2 and thus is not copied, pointing to
+// "content2" instead.
+aSrcString[6] = "content2";
+
+xDestDoc = getDoc(gaDestFileBase);
+CPPUNIT_ASSERT(xDestDoc.is());
+uno::Reference< container::XIndexAccess > xDestSheetIndexAccess 
(xDestDoc->getSheets(), UNO_QUERY_THROW);
+CPPUNIT_ASSERT( nInsertedSheets < xDestSheetIndexAccess->getCount());
+for (sal_Int32 nSheet=0; nSheet < nInsertedSheets; ++nSheet)
+{
+xDestSheet.set( xDestSheetIndexAccess->getByIndex(nSheet), 
UNO_QUERY_THROW);
+for (sal_Int32 nCol=0; nCol < nCols; ++nCol)
+{
+uno::Reference< table::XCell > xDestCell = 
xDestSheet->getCellByPosition(nCol, 0);
+uno::Reference< text::XTextRange > xDestTextRange(xDestCell, 
UNO_QUERY_THROW);
+OUString aDestString = xDestTextRange->getString();
+
+if (nCol == 4 && aDestString == "Err:540")
+// The created external reference to the source document not
+// allowed may result in Err:540
+continue;
+
+OString aMessage("Imported result does not match, sheet " + 
OString::number(nSheet)
++ " column " + OString::number(nCol));
+CPPUNIT_ASSERT_EQUAL_MESSAGE( aMessage.getStr(), aSrcString[nCol], 
aDestString);
+}
+}
+}
+
 uno::Reference< sheet::XSpreadsheetDocument> XSpreadsheets2::getDoc(const 
OUString& aFileBase)
 {
 OUString aFileURL;
@@ -308,6 +361,7 @@ void XSpreadsheets2::importSheetToCopy()
 sal_Int32 nDestPos = 0;
 sal_Int32 nDestPosEffective = xDestSheets->importSheet(xDocument, 
gaSrcSheetName, nDestPos);
 

[Libreoffice-commits] core.git: include/test include/vcl test/source vcl/source vcl/uiconfig vcl/UIConfig_vcl.mk vcl/unx

2019-10-10 Thread Caolán McNamara (via logerrit)
 include/test/screenshot_test.hxx|   15 -
 include/vcl/dialog.hxx  |   18 -
 include/vcl/syswin.hxx  |   18 +
 include/vcl/weld.hxx|   57 +++--
 test/source/screenshot_test.cxx |  106 +-
 vcl/UIConfig_vcl.mk |1 
 vcl/source/app/salvtables.cxx   |  124 +++
 vcl/source/window/dialog.cxx|   53 -
 vcl/source/window/syswin.cxx|   54 +
 vcl/uiconfig/ui/screenshotparent.ui |   54 +
 vcl/unx/gtk3/gtk3gtkinst.cxx|  377 +++-
 11 files changed, 511 insertions(+), 366 deletions(-)

New commits:
commit bb6bcabda53dbd64dda43f09fab9f4ad6f34eba6
Author: Caolán McNamara 
AuthorDate: Wed Oct 9 13:55:46 2019 +0100
Commit: Caolán McNamara 
CommitDate: Thu Oct 10 20:25:07 2019 +0200

support screenshotting .ui files with GtkBuilder

so...

SAL_USE_VCLPLUGIN=gtk3 make screenshot

for the "unknown dialog" cases of make screenshot, which loads .ui files and
tries to render them, will render them with the native gtk infrastructure

Change-Id: Ifc8fe264155887c4d01b7ce0e2aa53e12acbfcb0
Reviewed-on: https://gerrit.libreoffice.org/80545
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/include/test/screenshot_test.hxx b/include/test/screenshot_test.hxx
index 74bcfc721d53..3e1f3f84a06f 100644
--- a/include/test/screenshot_test.hxx
+++ b/include/test/screenshot_test.hxx
@@ -15,7 +15,8 @@
 #include 
 #include 
 #include 
-#include 
+#include 
+#include 
 #include 
 
 class VclAbstractDialog;
@@ -30,11 +31,18 @@ private:
 /// the set of known dialogs and their ID for usage in createDialogByID
 mapType maKnownDialogs;
 
+/// parent for non-dialog buildables
+weld::GenericDialogController maParent;
+std::unique_ptr mxParentWidget;
+
 private:
 /// helpers
 void implSaveScreenshot(const BitmapEx& rScreenshot, const OString& 
rScreenshotId);
 void saveScreenshot(VclAbstractDialog const & rDialog);
-void saveScreenshot(Dialog& rDialog);
+void saveScreenshot(weld::Window& rDialog);
+
+/// helper method to create and dump a dialog based on Builder contents.
+void dumpDialogToPath(weld::Builder& rDialog);
 
 /// helper method to populate maKnownDialogs, called in setUp(). Needs to 
be
 /// written and has to add entries to maKnownDialogs
@@ -58,9 +66,6 @@ public:
 /// version for AbstractDialogs, the ones created in 
AbstractDialogFactories
 void dumpDialogToPath(VclAbstractDialog& rDialog);
 
-/// version for pure vcl-based dialogs
-void dumpDialogToPath(Dialog& rDialog);
-
 /// fallback version for dialogs for which only the UXMLDescription is 
known.
 /// This should be used with care - no active layouting will be done, only 
the
 /// VclBuilder will be activated for layouting. Result can thus vary 
drastically
diff --git a/include/vcl/dialog.hxx b/include/vcl/dialog.hxx
index cc5355d58132..ee2560abc475 100644
--- a/include/vcl/dialog.hxx
+++ b/include/vcl/dialog.hxx
@@ -50,7 +50,6 @@ private:
 boolmbInSyncExecute;
 boolmbInClose;
 boolmbModalMode;
-boolmbPaintComplete;
 bool const  mbForceBorderWindow;
 InitFlag const  mnInitFlag; // used for deferred init
 
@@ -70,11 +69,6 @@ private:
 DECL_DLLPRIVATE_LINK(ImplAsyncCloseHdl, void*, void);
 DECL_DLLPRIVATE_LINK(ResponseHdl, Button*, void);
 
-// ensureRepaint - triggers Application::Yield until the dialog is
-// completely repainted. Sometimes needed for dialogs showing progress
-// during actions
-void ensureRepaint();
-
 protected:
 using Window::ImplInit;
 voidImplInit( vcl::Window* pParent, WinBits nStyle, InitFlag eFlag = 
InitFlag::Default );
@@ -95,6 +89,7 @@ protected:
 
 protected:
 friend class VclBuilder;
+friend class SalInstanceBuilder;
 void set_action_area(VclButtonBox* pBox);
 virtual void set_content_area(VclBox* pBox);
 
@@ -119,17 +114,6 @@ public:
 
 virtual boolClose() override;
 
-// try to extract content and return as Bitmap. To do that reliably, a 
Yield-loop
-// like in Execute() has to be executed and it is necessary to detect when 
the
-// paint is finished
-virtual void PrePaint(vcl::RenderContext& rRenderContext) override;
-virtual void PostPaint(vcl::RenderContext& rRenderContext) override;
-
-// Screenshot interface
-virtual std::vector getAllPageUIXMLDescriptions() const;
-virtual bool selectPageByUIXMLDescription(const OString& 
rUIXMLDescription);
-void createScreenshot(VirtualDevice& rOutput);
-
 virtual short   Execute();
 boolIsInExecute() const { return mbInExecute; }
 // Return true when dialog is synchronously executed (calling ::Execute())
diff --git a/include/vcl/syswin.hxx b/include/vcl/syswin.hxx
index 

[Libreoffice-commits] core.git: include/test test/source ucb/source unoxml/source writerfilter/source

2019-08-24 Thread Noel Grandin (via logerrit)
 include/test/table/xtablecolumns.hxx |2 +-
 test/source/table/xtablecolumns.cxx  |2 +-
 ucb/source/ucp/webdav-neon/webdavcontent.cxx |2 +-
 ucb/source/ucp/webdav-neon/webdavcontent.hxx |2 +-
 unoxml/source/rdf/librdf_repository.cxx  |8 
 writerfilter/source/dmapper/DomainMapperTableManager.cxx |4 ++--
 writerfilter/source/dmapper/DomainMapperTableManager.hxx |2 +-
 writerfilter/source/dmapper/DomainMapper_Impl.cxx|4 ++--
 writerfilter/source/dmapper/DomainMapper_Impl.hxx|4 ++--
 writerfilter/source/dmapper/FontTable.cxx|2 +-
 writerfilter/source/dmapper/FontTable.hxx|2 +-
 writerfilter/source/dmapper/StyleSheetTable.cxx  |6 +++---
 writerfilter/source/dmapper/StyleSheetTable.hxx  |6 +++---
 writerfilter/source/dmapper/ThemeTable.cxx   |2 +-
 writerfilter/source/dmapper/ThemeTable.hxx   |2 +-
 writerfilter/source/ooxml/OOXMLParserState.cxx   |2 +-
 writerfilter/source/ooxml/OOXMLParserState.hxx   |2 +-
 17 files changed, 27 insertions(+), 27 deletions(-)

New commits:
commit 57c9a995bafcaeb9ab00facb9b7f3ed52c7e7d2a
Author: Noel Grandin 
AuthorDate: Sat Aug 24 20:35:05 2019 +0200
Commit: Noel Grandin 
CommitDate: Sat Aug 24 22:12:28 2019 +0200

loplugin:returnconstval in test..writerfilter

Change-Id: Iea7d15f0a54921514cc4b71c5dc8caaa2ee573c8
Reviewed-on: https://gerrit.libreoffice.org/78063
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/include/test/table/xtablecolumns.hxx 
b/include/test/table/xtablecolumns.hxx
index 169eac9dbc77..957d344c598f 100644
--- a/include/test/table/xtablecolumns.hxx
+++ b/include/test/table/xtablecolumns.hxx
@@ -47,7 +47,7 @@ protected:
 private:
 css::uno::Reference m_xSheet;
 
-static const OUString getCellText(const 
css::uno::Reference& r_xCell);
+static OUString getCellText(const css::uno::Reference& 
r_xCell);
 };
 
 } // namespace apitest
diff --git a/test/source/table/xtablecolumns.cxx 
b/test/source/table/xtablecolumns.cxx
index 90c67977dd83..b338ddd0bdb4 100644
--- a/test/source/table/xtablecolumns.cxx
+++ b/test/source/table/xtablecolumns.cxx
@@ -163,7 +163,7 @@ void XTableColumns::testRemoveByIndexWithOutOfBoundIndex()
 CPPUNIT_ASSERT_THROW(xTC->removeByIndex(xTC->getCount(), 1), 
uno::RuntimeException);
 }
 
-const OUString XTableColumns::getCellText(const uno::Reference& 
r_xCell)
+OUString XTableColumns::getCellText(const uno::Reference& 
r_xCell)
 {
 uno::Reference xST(r_xCell, uno::UNO_QUERY_THROW);
 return xST->getString();
diff --git a/ucb/source/ucp/webdav-neon/webdavcontent.cxx 
b/ucb/source/ucp/webdav-neon/webdavcontent.cxx
index b360f300265a..62181772ae17 100644
--- a/ucb/source/ucp/webdav-neon/webdavcontent.cxx
+++ b/ucb/source/ucp/webdav-neon/webdavcontent.cxx
@@ -3664,7 +3664,7 @@ void Content::cancelCommandExecution(
 }
 
 
-const OUString
+OUString
 Content::getBaseURI( const std::unique_ptr< DAVResourceAccess > & rResAccess )
 {
 osl::Guard< osl::Mutex > aGuard( m_aMutex );
diff --git a/ucb/source/ucp/webdav-neon/webdavcontent.hxx 
b/ucb/source/ucp/webdav-neon/webdavcontent.hxx
index 2d56c02b42c3..dbe3102c744b 100644
--- a/ucb/source/ucp/webdav-neon/webdavcontent.hxx
+++ b/ucb/source/ucp/webdav-neon/webdavcontent.hxx
@@ -142,7 +142,7 @@ private:
 bool
 exchangeIdentity( const css::uno::Reference< css::ucb::XContentIdentifier 
>& xNewId );
 
-const OUString
+OUString
 getBaseURI( const std::unique_ptr< DAVResourceAccess > & rResAccess );
 
 /// @throws css::uno::Exception
diff --git a/unoxml/source/rdf/librdf_repository.cxx 
b/unoxml/source/rdf/librdf_repository.cxx
index eb15843ef25b..72e417cfd699 100644
--- a/unoxml/source/rdf/librdf_repository.cxx
+++ b/unoxml/source/rdf/librdf_repository.cxx
@@ -344,10 +344,10 @@ public:
 const uno::Sequence< css::uno::Any > & i_rArguments) override;
 
 // XNamedGraph forwards -
-const NamedGraphMap_t::iterator clearGraph_NoLock(
+NamedGraphMap_t::iterator clearGraph_NoLock(
 const OUString & i_rGraphName,
 bool i_Internal = false );
-const NamedGraphMap_t::iterator clearGraph_Lock(
+NamedGraphMap_t::iterator clearGraph_Lock(
 const OUString & i_rGraphName,
 bool i_Internal);
 void addStatementGraph_NoLock(
@@ -1747,7 +1747,7 @@ void SAL_CALL librdf_Repository::initialize(
 m_pWorld.get(), m_pStorage.get()), safe_librdf_free_model);
 }
 
-const NamedGraphMap_t::iterator librdf_Repository::clearGraph_NoLock(
+NamedGraphMap_t::iterator librdf_Repository::clearGraph_NoLock(
 OUString const& i_rGraphName, bool i_Internal)
 //throw (uno::RuntimeException, container::NoSuchElementException,
 //

[Libreoffice-commits] core.git: include/test test/source

2019-07-23 Thread Gabor Kelemen (via logerrit)
 include/test/container/xnameaccess.hxx   |1 -
 include/test/drawing/xshapedescriptor.hxx|1 -
 include/test/helper/form.hxx |1 -
 include/test/helper/shape.hxx|1 -
 include/test/helper/transferable.hxx |1 -
 include/test/lang/xcomponent.hxx |1 -
 include/test/lang/xserviceinfo.hxx   |1 -
 include/test/sheet/cellarealink.hxx  |1 -
 include/test/sheet/functiondescription.hxx   |1 -
 include/test/sheet/xprintareas.hxx   |2 +-
 include/test/sheet/xsheetannotation.hxx  |1 -
 include/test/sheet/xsheetoutline.hxx |3 +--
 include/test/sheet/xsheetpagebreak.hxx   |3 +--
 include/test/sheet/xspreadsheetdocument.hxx  |1 -
 include/test/sheet/xsubtotalcalculatable.hxx |1 -
 include/test/table/xcellrange.hxx|1 -
 include/test/table/xtablecolumns.hxx |2 --
 include/test/testinteractionhandler.hxx  |2 +-
 include/test/text/baseindex.hxx  |2 ++
 include/test/text/textdocumentindex.hxx  |3 +--
 include/test/text/textprintersettings.hxx|3 +--
 include/test/text/textsettings.hxx   |4 
 include/test/text/xsimpletext.hxx|2 +-
 include/test/text/xtext.hxx  |2 +-
 include/test/util/xsearchable.hxx|2 ++
 test/source/sheet/xsheetoutline.cxx  |1 +
 26 files changed, 17 insertions(+), 27 deletions(-)

New commits:
commit bfe225b7003d119ff214cbaa771289de105c48d5
Author: Gabor Kelemen 
AuthorDate: Sun Jul 7 23:10:31 2019 +0200
Commit: Miklos Vajna 
CommitDate: Tue Jul 23 14:16:09 2019 +0200

tdf#42949 Fix IWYU warnings in include/test

Found with bin/find-unneeded-includes
Only removal proposals are dealt with here.

New IWYU and recent developments in f-u-i helped to identify
some non self contained files, those were fixed too.

Change-Id: I527f7c2cf2660a758b13eabb4c444ff79ae35f8c
Reviewed-on: https://gerrit.libreoffice.org/75186
Tested-by: Jenkins
Reviewed-by: Miklos Vajna 

diff --git a/include/test/container/xnameaccess.hxx 
b/include/test/container/xnameaccess.hxx
index 6ff525917380..960cf67822b9 100644
--- a/include/test/container/xnameaccess.hxx
+++ b/include/test/container/xnameaccess.hxx
@@ -14,7 +14,6 @@
 
 #include 
 
-#include 
 #include 
 
 namespace apitest
diff --git a/include/test/drawing/xshapedescriptor.hxx 
b/include/test/drawing/xshapedescriptor.hxx
index cb7c37e3a5ba..2c99e7e9c197 100644
--- a/include/test/drawing/xshapedescriptor.hxx
+++ b/include/test/drawing/xshapedescriptor.hxx
@@ -14,7 +14,6 @@
 #include 
 
 #include 
-#include 
 
 namespace apitest
 {
diff --git a/include/test/helper/form.hxx b/include/test/helper/form.hxx
index d84794cc5b6d..0fbcd2c7b06a 100644
--- a/include/test/helper/form.hxx
+++ b/include/test/helper/form.hxx
@@ -15,7 +15,6 @@
 
 #include 
 
-#include 
 #include 
 #include 
 #include 
diff --git a/include/test/helper/shape.hxx b/include/test/helper/shape.hxx
index e4322bec1357..341a9fad93fc 100644
--- a/include/test/helper/shape.hxx
+++ b/include/test/helper/shape.hxx
@@ -10,7 +10,6 @@
 #ifndef INCLUDED_TEST_HELPER_SHAPE_HXX
 #define INCLUDED_TEST_HELPER_SHAPE_HXX
 
-#include 
 #include 
 #include 
 #include 
diff --git a/include/test/helper/transferable.hxx 
b/include/test/helper/transferable.hxx
index 280b28ad5006..d0454bc6e410 100644
--- a/include/test/helper/transferable.hxx
+++ b/include/test/helper/transferable.hxx
@@ -9,7 +9,6 @@
 
 #pragma once
 
-#include 
 #include 
 #include 
 #include 
diff --git a/include/test/lang/xcomponent.hxx b/include/test/lang/xcomponent.hxx
index fdbeccc6cf7b..9314749fbc52 100644
--- a/include/test/lang/xcomponent.hxx
+++ b/include/test/lang/xcomponent.hxx
@@ -10,7 +10,6 @@
 #ifndef INCLUDED_TEST_LANG_XCOMPONENT_HXX
 #define INCLUDED_TEST_LANG_XCOMPONENT_HXX
 
-#include 
 #include 
 #include 
 
diff --git a/include/test/lang/xserviceinfo.hxx 
b/include/test/lang/xserviceinfo.hxx
index 86a92480d970..14ce4e61 100644
--- a/include/test/lang/xserviceinfo.hxx
+++ b/include/test/lang/xserviceinfo.hxx
@@ -16,7 +16,6 @@
 
 #include 
 
-#include 
 #include 
 
 namespace apitest
diff --git a/include/test/sheet/cellarealink.hxx 
b/include/test/sheet/cellarealink.hxx
index 6eff944ae7be..eb3a13547c0a 100644
--- a/include/test/sheet/cellarealink.hxx
+++ b/include/test/sheet/cellarealink.hxx
@@ -15,7 +15,6 @@
 #include 
 
 #include 
-#include 
 
 namespace apitest
 {
diff --git a/include/test/sheet/functiondescription.hxx 
b/include/test/sheet/functiondescription.hxx
index 4e3128bcaaaf..bfe719bc5972 100644
--- a/include/test/sheet/functiondescription.hxx
+++ b/include/test/sheet/functiondescription.hxx
@@ -11,7 +11,6 @@
 #define INCLUDED_TEST_SHEET_FUNCTIONDESCRIPTION_HXX
 
 #include 
-#include 
 #include 
 
 #include 
diff --git a/include/test/sheet/xprintareas.hxx 
b/include/test/sheet/xprintareas.hxx

[Libreoffice-commits] core.git: include/test qadevOOo/objdsc sc/qa test/Library_subsequenttest.mk test/source

2019-06-19 Thread Jens Carl (via logerrit)
 include/test/drawing/xshape.hxx|   41 +
 qadevOOo/objdsc/sc/com.sun.star.comp.office.ScShapeObj.csv |4 
 sc/qa/extras/scshapeobj.cxx|6 +
 test/Library_subsequenttest.mk |1 
 test/source/drawing/xshape.cxx |   56 +
 5 files changed, 104 insertions(+), 4 deletions(-)

New commits:
commit 0e73f9eb415793c1c7503021c40fd746b2ef7ba2
Author: Jens Carl 
AuthorDate: Wed Jun 19 05:18:55 2019 +
Commit: Jens Carl 
CommitDate: Wed Jun 19 08:10:10 2019 +0200

tdf#45904 Move XShape Java tests to C++

Move XShape Java tests to C++ for ScShapeObj.

Change-Id: I349c4abb09c3e9e43285b63ee5f19f55d967b38f
Reviewed-on: https://gerrit.libreoffice.org/74331
Tested-by: Jenkins
Reviewed-by: Jens Carl 

diff --git a/include/test/drawing/xshape.hxx b/include/test/drawing/xshape.hxx
new file mode 100644
index ..7da565355635
--- /dev/null
+++ b/include/test/drawing/xshape.hxx
@@ -0,0 +1,41 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#pragma once
+
+#include 
+
+#include 
+
+#include 
+
+namespace apitest
+{
+class OOO_DLLPUBLIC_TEST XShape
+{
+public:
+XShape(bool bObjSupportsPosition = true)
+: m_bObjSupportsPosition(bObjSupportsPosition)
+{
+}
+virtual css::uno::Reference init() = 0;
+
+void testGetSetPosition();
+void testGetSetSize();
+
+protected:
+~XShape() {}
+
+private:
+bool const m_bObjSupportsPosition;
+};
+
+} // namespace apitest
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScShapeObj.csv 
b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScShapeObj.csv
index 4e59e44415b9..be9506938cdc 100644
--- a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScShapeObj.csv
+++ b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScShapeObj.csv
@@ -15,8 +15,4 @@
 
"ScShapeObj";"com::sun::star::beans::XPropertySet";"addPropertyChangeListener()"
 
"ScShapeObj";"com::sun::star::beans::XPropertySet";"removePropertyChangeListener()"
 
"ScShapeObj";"com::sun::star::beans::XPropertySet";"addVetoableChangeListener()"
-"ScShapeObj";"com::sun::star::beans::XPropertySet";"removeVetoableChangeListener()"
-"ScShapeObj";"com::sun::star::drawing::XShape";"getPosition()"
-"ScShapeObj";"com::sun::star::drawing::XShape";"setPosition()"
-"ScShapeObj";"com::sun::star::drawing::XShape";"getSize()"
 "ScShapeObj";"com::sun::star::drawing::XShape";"setSize()"
diff --git a/sc/qa/extras/scshapeobj.cxx b/sc/qa/extras/scshapeobj.cxx
index 723d71a3f1c4..ef8761a657d9 100644
--- a/sc/qa/extras/scshapeobj.cxx
+++ b/sc/qa/extras/scshapeobj.cxx
@@ -9,6 +9,7 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -35,6 +36,7 @@ class ScShapeObj : public CalcUnoApiTest,
public apitest::Shape,
public apitest::XComponent,
public apitest::XGluePointsSupplier,
+   public apitest::XShape,
public apitest::XShapeDescriptor
 {
 public:
@@ -60,6 +62,10 @@ public:
 // XGluePointsSupplier
 CPPUNIT_TEST(testGetGluePoints);
 
+// XShape
+CPPUNIT_TEST(testGetSetPosition);
+CPPUNIT_TEST(testGetSetSize);
+
 // XShapeDescriptor
 CPPUNIT_TEST(testGetShapeType);
 
diff --git a/test/Library_subsequenttest.mk b/test/Library_subsequenttest.mk
index c03cb7b9d8c4..aaa357ef63b8 100644
--- a/test/Library_subsequenttest.mk
+++ b/test/Library_subsequenttest.mk
@@ -59,6 +59,7 @@ $(eval $(call 
gb_Library_add_exception_objects,subsequenttest,\
test/source/drawing/xgluepointssupplier \
test/source/drawing/xshapedescriptor \
test/source/drawing/xshapegrouper \
+   test/source/drawing/xshape \
test/source/drawing/xshapes \
test/source/lang/xserviceinfo \
test/source/lang/xcomponent \
diff --git a/test/source/drawing/xshape.cxx b/test/source/drawing/xshape.cxx
new file mode 100644
index ..6992663f56d0
--- /dev/null
+++ b/test/source/drawing/xshape.cxx
@@ -0,0 +1,56 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include 
+#include 
+
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+
+using namespace css;
+
+namespace 

[Libreoffice-commits] core.git: include/test qadevOOo/objdsc sc/qa test/Library_subsequenttest.mk test/source

2019-06-17 Thread Jens Carl (via logerrit)
 include/test/drawing/xgluepointssupplier.hxx   |   33 +
 qadevOOo/objdsc/sc/com.sun.star.comp.office.ScShapeObj.csv |1 
 sc/qa/extras/scshapeobj.cxx|5 +
 test/Library_subsequenttest.mk |1 
 test/source/drawing/xgluepointssupplier.cxx|   32 
 5 files changed, 71 insertions(+), 1 deletion(-)

New commits:
commit 8a453f96f0181b1eae227ebdadea6ee458d53eb4
Author: Jens Carl 
AuthorDate: Mon Jun 17 05:50:26 2019 +
Commit: Jens Carl 
CommitDate: Tue Jun 18 06:52:14 2019 +0200

tdf#45904 Move XGluePointsSupplier Java test to C++

Move XGluePointsSupplier Java test to C++ for ScShapeObj.

Change-Id: I75babf46b664cccbb4d1df2af1764c3fa296903a
Reviewed-on: https://gerrit.libreoffice.org/74140
Tested-by: Jenkins
Reviewed-by: Jens Carl 

diff --git a/include/test/drawing/xgluepointssupplier.hxx 
b/include/test/drawing/xgluepointssupplier.hxx
new file mode 100644
index ..0dd8bf58a138
--- /dev/null
+++ b/include/test/drawing/xgluepointssupplier.hxx
@@ -0,0 +1,33 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#pragma once
+
+#include 
+
+#include 
+
+#include 
+
+namespace apitest
+{
+class OOO_DLLPUBLIC_TEST XGluePointsSupplier
+{
+public:
+virtual css::uno::Reference init() = 0;
+
+void testGetGluePoints();
+
+protected:
+~XGluePointsSupplier() {}
+};
+
+} // namespace apitest
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScShapeObj.csv 
b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScShapeObj.csv
index 6a5cd6fc7345..4e59e44415b9 100644
--- a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScShapeObj.csv
+++ b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScShapeObj.csv
@@ -9,7 +9,6 @@
 "ScShapeObj";"com::sun::star::drawing::Shape";"Transformation#optional"
 
"ScShapeObj";"com::sun::star::drawing::Shape";"ShapeUserDefinedAttributes#optional"
 "ScShapeObj";"com::sun::star::drawing::Shape";"InteropGrabBag#optional"
-"ScShapeObj";"com::sun::star::drawing::XGluePointsSupplier#optional";"getGluePoints()"
 "ScShapeObj";"com::sun::star::beans::XPropertySet";"getPropertySetInfo()"
 "ScShapeObj";"com::sun::star::beans::XPropertySet";"setPropertyValue()"
 "ScShapeObj";"com::sun::star::beans::XPropertySet";"getPropertyValue()"
diff --git a/sc/qa/extras/scshapeobj.cxx b/sc/qa/extras/scshapeobj.cxx
index 91ab4adc79af..723d71a3f1c4 100644
--- a/sc/qa/extras/scshapeobj.cxx
+++ b/sc/qa/extras/scshapeobj.cxx
@@ -8,6 +8,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -33,6 +34,7 @@ namespace sc_apitest
 class ScShapeObj : public CalcUnoApiTest,
public apitest::Shape,
public apitest::XComponent,
+   public apitest::XGluePointsSupplier,
public apitest::XShapeDescriptor
 {
 public:
@@ -55,6 +57,9 @@ public:
 CPPUNIT_TEST(testDispose);
 CPPUNIT_TEST(testRemoveEventListener);
 
+// XGluePointsSupplier
+CPPUNIT_TEST(testGetGluePoints);
+
 // XShapeDescriptor
 CPPUNIT_TEST(testGetShapeType);
 
diff --git a/test/Library_subsequenttest.mk b/test/Library_subsequenttest.mk
index bdd8900fd61b..c03cb7b9d8c4 100644
--- a/test/Library_subsequenttest.mk
+++ b/test/Library_subsequenttest.mk
@@ -56,6 +56,7 @@ $(eval $(call 
gb_Library_add_exception_objects,subsequenttest,\
test/source/document/xlinktargetsupplier \
test/source/drawing/captionshape \
test/source/drawing/xdrawpages \
+   test/source/drawing/xgluepointssupplier \
test/source/drawing/xshapedescriptor \
test/source/drawing/xshapegrouper \
test/source/drawing/xshapes \
diff --git a/test/source/drawing/xgluepointssupplier.cxx 
b/test/source/drawing/xgluepointssupplier.cxx
new file mode 100644
index ..68d6b6fb6269
--- /dev/null
+++ b/test/source/drawing/xgluepointssupplier.cxx
@@ -0,0 +1,32 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include 
+
+#include 
+#include 
+
+#include 
+
+#include 
+
+using namespace css;
+
+namespace apitest
+{
+void XGluePointsSupplier::testGetGluePoints()
+{
+uno::Reference xGPS(init(), 
uno::UNO_QUERY_THROW);
+
+uno::Reference xIC = 

[Libreoffice-commits] core.git: include/test qadevOOo/objdsc sc/qa test/Library_subsequenttest.mk test/source

2019-06-17 Thread Jens Carl (via logerrit)
 include/test/drawing/xshapedescriptor.hxx  |   41 +
 qadevOOo/objdsc/sc/com.sun.star.comp.office.ScShapeObj.csv |1 
 sc/qa/extras/scshapeobj.cxx|   10 ++-
 test/Library_subsequenttest.mk |1 
 test/source/drawing/xshapedescriptor.cxx   |   30 +
 5 files changed, 81 insertions(+), 2 deletions(-)

New commits:
commit c77a1e1c039c863e6fdb47b92ce315b87fc73d0d
Author: Jens Carl 
AuthorDate: Mon Jun 17 05:13:27 2019 +
Commit: Jens Carl 
CommitDate: Mon Jun 17 08:03:15 2019 +0200

tdf#45904 Move XShapeDescriptor Java test to C++

Move XShapeDescriptor Java test to C++ for ScShapeObj.

Change-Id: I2d530ea73c6f25e36665db0bd65f734e509d97a6
Reviewed-on: https://gerrit.libreoffice.org/74139
Tested-by: Jenkins
Reviewed-by: Jens Carl 

diff --git a/include/test/drawing/xshapedescriptor.hxx 
b/include/test/drawing/xshapedescriptor.hxx
new file mode 100644
index ..cb7c37e3a5ba
--- /dev/null
+++ b/include/test/drawing/xshapedescriptor.hxx
@@ -0,0 +1,41 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#pragma once
+
+#include 
+
+#include 
+
+#include 
+#include 
+
+namespace apitest
+{
+class OOO_DLLPUBLIC_TEST XShapeDescriptor
+{
+public:
+XShapeDescriptor(const OUString& rShapeType)
+: m_aShapeType(rShapeType)
+{
+}
+virtual css::uno::Reference init() = 0;
+
+void testGetShapeType();
+
+protected:
+~XShapeDescriptor() {}
+
+private:
+OUString const m_aShapeType;
+};
+
+} // namespace apitest
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScShapeObj.csv 
b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScShapeObj.csv
index 47138b49c5ea..6a5cd6fc7345 100644
--- a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScShapeObj.csv
+++ b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScShapeObj.csv
@@ -9,7 +9,6 @@
 "ScShapeObj";"com::sun::star::drawing::Shape";"Transformation#optional"
 
"ScShapeObj";"com::sun::star::drawing::Shape";"ShapeUserDefinedAttributes#optional"
 "ScShapeObj";"com::sun::star::drawing::Shape";"InteropGrabBag#optional"
-"ScShapeObj";"com::sun::star::drawing::XShapeDescriptor";"getShapeType()"
 
"ScShapeObj";"com::sun::star::drawing::XGluePointsSupplier#optional";"getGluePoints()"
 "ScShapeObj";"com::sun::star::beans::XPropertySet";"getPropertySetInfo()"
 "ScShapeObj";"com::sun::star::beans::XPropertySet";"setPropertyValue()"
diff --git a/sc/qa/extras/scshapeobj.cxx b/sc/qa/extras/scshapeobj.cxx
index 2a1bebb1..91ab4adc79af 100644
--- a/sc/qa/extras/scshapeobj.cxx
+++ b/sc/qa/extras/scshapeobj.cxx
@@ -8,6 +8,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 
@@ -29,7 +30,10 @@ using namespace css;
 
 namespace sc_apitest
 {
-class ScShapeObj : public CalcUnoApiTest, public apitest::Shape, public 
apitest::XComponent
+class ScShapeObj : public CalcUnoApiTest,
+   public apitest::Shape,
+   public apitest::XComponent,
+   public apitest::XShapeDescriptor
 {
 public:
 ScShapeObj();
@@ -51,6 +55,9 @@ public:
 CPPUNIT_TEST(testDispose);
 CPPUNIT_TEST(testRemoveEventListener);
 
+// XShapeDescriptor
+CPPUNIT_TEST(testGetShapeType);
+
 CPPUNIT_TEST_SUITE_END();
 
 private:
@@ -59,6 +66,7 @@ private:
 
 ScShapeObj::ScShapeObj()
 : CalcUnoApiTest("/sc/qa/extras/testdocuments")
+, XShapeDescriptor("com.sun.star.drawing.RectangleShape")
 {
 }
 
diff --git a/test/Library_subsequenttest.mk b/test/Library_subsequenttest.mk
index 2ad096c59c32..bdd8900fd61b 100644
--- a/test/Library_subsequenttest.mk
+++ b/test/Library_subsequenttest.mk
@@ -56,6 +56,7 @@ $(eval $(call 
gb_Library_add_exception_objects,subsequenttest,\
test/source/document/xlinktargetsupplier \
test/source/drawing/captionshape \
test/source/drawing/xdrawpages \
+   test/source/drawing/xshapedescriptor \
test/source/drawing/xshapegrouper \
test/source/drawing/xshapes \
test/source/lang/xserviceinfo \
diff --git a/test/source/drawing/xshapedescriptor.cxx 
b/test/source/drawing/xshapedescriptor.cxx
new file mode 100644
index ..37c95e75eff0
--- /dev/null
+++ b/test/source/drawing/xshapedescriptor.cxx
@@ -0,0 +1,30 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was 

[Libreoffice-commits] core.git: include/test qadevOOo/objdsc sc/qa test/source

2019-05-04 Thread Jens Carl (via logerrit)
 include/test/lang/xcomponent.hxx   |1 
 qadevOOo/objdsc/sc/com.sun.star.comp.office.ScShapeObj.csv |3 -
 sc/qa/extras/scshapeobj.cxx|   26 -
 test/source/lang/xcomponent.cxx|   10 +
 4 files changed, 27 insertions(+), 13 deletions(-)

New commits:
commit 35608a192df5529d8a0df4ad2f6bce42fc64a9ab
Author: Jens Carl 
AuthorDate: Sat May 4 06:27:17 2019 +
Commit: Jens Carl 
CommitDate: Sat May 4 17:37:47 2019 +0200

tdf#45904 Move XComponent Java tests to C++

Move XComponent Java tests to C++ for ScShapeObj.

Change-Id: Ib692827729dbe38eaceb76aa042d76e14d9614f8
Reviewed-on: https://gerrit.libreoffice.org/71787
Tested-by: Jenkins
Reviewed-by: Jens Carl 

diff --git a/include/test/lang/xcomponent.hxx b/include/test/lang/xcomponent.hxx
index 347a36e2925c..fdbeccc6cf7b 100644
--- a/include/test/lang/xcomponent.hxx
+++ b/include/test/lang/xcomponent.hxx
@@ -26,6 +26,7 @@ public:
 
 void testAddEventListener();
 void testRemoveEventListener();
+void testDispose();
 void testDisposedByDesktopTerminate();
 
 protected:
diff --git a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScShapeObj.csv 
b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScShapeObj.csv
index e7385e4ec6f7..47138b49c5ea 100644
--- a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScShapeObj.csv
+++ b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScShapeObj.csv
@@ -1,6 +1,3 @@
-"ScShapeObj";"com::sun::star::lang::XComponent";"dispose()"
-"ScShapeObj";"com::sun::star::lang::XComponent";"addEventListener()"
-"ScShapeObj";"com::sun::star::lang::XComponent";"removeEventListener()"
 "ScShapeObj";"com::sun::star::drawing::Shape";"ZOrder#optional"
 "ScShapeObj";"com::sun::star::drawing::Shape";"LayerID#optional"
 "ScShapeObj";"com::sun::star::drawing::Shape";"LayerName#optional"
diff --git a/sc/qa/extras/scshapeobj.cxx b/sc/qa/extras/scshapeobj.cxx
index 279b07dead3d..2a1bebb1 100644
--- a/sc/qa/extras/scshapeobj.cxx
+++ b/sc/qa/extras/scshapeobj.cxx
@@ -8,6 +8,7 @@
  */
 
 #include 
+#include 
 #include 
 
 #include 
@@ -25,17 +26,17 @@
 #include 
 
 using namespace css;
-using namespace css::uno;
 
 namespace sc_apitest
 {
-class ScShapeObj : public CalcUnoApiTest, public apitest::Shape
+class ScShapeObj : public CalcUnoApiTest, public apitest::Shape, public 
apitest::XComponent
 {
 public:
 ScShapeObj();
 
 virtual uno::Reference init() override;
 virtual uno::Reference getXSheetDocument() override;
+virtual void triggerDesktopTerminate() override{};
 virtual void setUp() override;
 virtual void tearDown() override;
 
@@ -45,6 +46,11 @@ public:
 CPPUNIT_TEST(testShapePropertiesAnchor);
 CPPUNIT_TEST(testShapePropertiesPosition);
 
+// XComponent
+CPPUNIT_TEST(testAddEventListener);
+CPPUNIT_TEST(testDispose);
+CPPUNIT_TEST(testRemoveEventListener);
+
 CPPUNIT_TEST_SUITE_END();
 
 private:
@@ -58,18 +64,18 @@ ScShapeObj::ScShapeObj()
 
 uno::Reference ScShapeObj::init()
 {
-uno::Reference xDoc(mxComponent, 
UNO_QUERY_THROW);
+uno::Reference xDoc(mxComponent, 
uno::UNO_QUERY_THROW);
 
-uno::Reference xMSF(xDoc, UNO_QUERY_THROW);
+uno::Reference xMSF(xDoc, 
uno::UNO_QUERY_THROW);
 uno::Reference xShape(
-xMSF->createInstance("com.sun.star.drawing.RectangleShape"), 
UNO_QUERY_THROW);
+xMSF->createInstance("com.sun.star.drawing.RectangleShape"), 
uno::UNO_QUERY_THROW);
 xShape->setPosition(awt::Point(5000, 3500));
 xShape->setSize(awt::Size(7500, 5000));
 
-uno::Reference xDPS(xDoc, UNO_QUERY_THROW);
+uno::Reference xDPS(xDoc, 
uno::UNO_QUERY_THROW);
 uno::Reference xDrawPages = xDPS->getDrawPages();
-uno::Reference xDrawPage(xDrawPages->getByIndex(0), 
UNO_QUERY_THROW);
-uno::Reference xShapes(xDrawPage, UNO_QUERY_THROW);
+uno::Reference xDrawPage(xDrawPages->getByIndex(0), 
uno::UNO_QUERY_THROW);
+uno::Reference xShapes(xDrawPage, uno::UNO_QUERY_THROW);
 xShapes->add(xShape);
 
 for (auto i = 0; i < 10; i++)
@@ -84,7 +90,7 @@ uno::Reference ScShapeObj::init()
 
 uno::Reference ScShapeObj::getXSheetDocument()
 {
-uno::Reference xDoc(mxComponent, 
UNO_QUERY_THROW);
+uno::Reference xDoc(mxComponent, 
uno::UNO_QUERY_THROW);
 return xDoc;
 }
 
@@ -103,7 +109,7 @@ void ScShapeObj::tearDown()
 
 CPPUNIT_TEST_SUITE_REGISTRATION(ScShapeObj);
 
-} // end namespace
+} // namespace sc_apitest
 
 CPPUNIT_PLUGIN_IMPLEMENT();
 
diff --git a/test/source/lang/xcomponent.cxx b/test/source/lang/xcomponent.cxx
index 386fa45f232f..ef0049d5953c 100644
--- a/test/source/lang/xcomponent.cxx
+++ b/test/source/lang/xcomponent.cxx
@@ -57,6 +57,16 @@ void XComponent::testRemoveEventListener()
 CPPUNIT_ASSERT_EQUAL(false, 
pListenerAddedAndRemoved->m_hasDisposingCalled);
 }
 
+void XComponent::testDispose()
+{
+Reference xComponent(init(), uno::UNO_QUERY_THROW);
+auto 

[Libreoffice-commits] core.git: include/test test/source

2019-05-02 Thread Jens Carl (via logerrit)
 include/test/lang/xserviceinfo.hxx |   11 +--
 test/source/lang/xserviceinfo.cxx  |4 ++--
 2 files changed, 11 insertions(+), 4 deletions(-)

New commits:
commit de529f32120e2eaa73d804a53ce519979da38438
Author: Jens Carl 
AuthorDate: Fri May 3 00:33:02 2019 +
Commit: Jens Carl 
CommitDate: Fri May 3 03:32:45 2019 +0200

Enable testing of multiple service names

Enable testing of multiple service names of the object supports this, by
storing all possible names in a vector.

Change-Id: Iff2c974cc30a0729cb26b07002582e0786a4de44
Reviewed-on: https://gerrit.libreoffice.org/71713
Tested-by: Jenkins
Reviewed-by: Jens Carl 

diff --git a/include/test/lang/xserviceinfo.hxx 
b/include/test/lang/xserviceinfo.hxx
index 498e5ed8387f..86a92480d970 100644
--- a/include/test/lang/xserviceinfo.hxx
+++ b/include/test/lang/xserviceinfo.hxx
@@ -10,6 +10,8 @@
 #ifndef INCLUDED_TEST_LANG_XSERVICEINFO_HXX
 #define INCLUDED_TEST_LANG_XSERVICEINFO_HXX
 
+#include 
+
 #include 
 
 #include 
@@ -24,7 +26,12 @@ class OOO_DLLPUBLIC_TEST XServiceInfo
 public:
 XServiceInfo(const OUString& rImplName, const OUString& rServiceName)
 : m_aImplName(rImplName)
-, m_aServiceName(rServiceName)
+{
+m_aServiceNames.push_back(rServiceName);
+}
+XServiceInfo(const OUString& rImplName, const std::vector 
rServiceNames)
+: m_aImplName(rImplName)
+, m_aServiceNames(rServiceNames)
 {
 }
 
@@ -39,7 +46,7 @@ protected:
 
 private:
 OUString const m_aImplName;
-OUString const m_aServiceName;
+std::vector m_aServiceNames;
 };
 
 } // namespace apitest
diff --git a/test/source/lang/xserviceinfo.cxx 
b/test/source/lang/xserviceinfo.cxx
index 9db9e4b1cbe3..3f7e6541fa85 100644
--- a/test/source/lang/xserviceinfo.cxx
+++ b/test/source/lang/xserviceinfo.cxx
@@ -18,7 +18,6 @@
 #include 
 
 using namespace css;
-using namespace css::uno;
 
 namespace apitest
 {
@@ -41,7 +40,8 @@ void XServiceInfo::testSupportsService()
 {
 uno::Reference xSI(init(), uno::UNO_QUERY_THROW);
 
-CPPUNIT_ASSERT(xSI->supportsService(m_aServiceName));
+for (const auto& aServiceName : m_aServiceNames)
+CPPUNIT_ASSERT(xSI->supportsService(aServiceName));
 }
 
 } // namespace apitest
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: include/test qadevOOo/objdsc sc/qa test/Library_subsequenttest.mk test/source

2019-05-01 Thread Jens Carl (via logerrit)
 include/test/util/searchdescriptor.hxx  |   33 +
 qadevOOo/objdsc/sc/com.sun.star.comp.office.ScCellSearchObj.csv |   10 -
 sc/qa/extras/sccellsearchobj.cxx|5 
 test/Library_subsequenttest.mk  |1 
 test/source/util/searchdescriptor.cxx   |   65 
++
 5 files changed, 104 insertions(+), 10 deletions(-)

New commits:
commit 6f763a3fcd420ddd147459db0f836ef3e05e710f
Author: Jens Carl 
AuthorDate: Wed May 1 22:48:02 2019 +
Commit: Jens Carl 
CommitDate: Thu May 2 02:52:28 2019 +0200

tdf#45904 Move SearchDescriptor Java tests to C++

Move SearchDescriptor Java tests to C++ for ScCellSearchObj.

Change-Id: I3c9ffbfc80c7fdc39d0e67fe8aae12605a8d04f5
Reviewed-on: https://gerrit.libreoffice.org/71644
Tested-by: Jenkins
Reviewed-by: Jens Carl 

diff --git a/include/test/util/searchdescriptor.hxx 
b/include/test/util/searchdescriptor.hxx
new file mode 100644
index ..b2f5d5bd62fa
--- /dev/null
+++ b/include/test/util/searchdescriptor.hxx
@@ -0,0 +1,33 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#pragma once
+
+#include 
+
+#include 
+
+#include 
+
+namespace apitest
+{
+class OOO_DLLPUBLIC_TEST SearchDescriptor
+{
+public:
+virtual css::uno::Reference init() = 0;
+
+void testSearchDescriptorProperties();
+
+protected:
+~SearchDescriptor() {}
+};
+
+} // namespace apitest
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScCellSearchObj.csv 
b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScCellSearchObj.csv
index 04f296d22cbf..0ba1e44ec269 100644
--- a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScCellSearchObj.csv
+++ b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScCellSearchObj.csv
@@ -1,12 +1,2 @@
-"ScCellSearchObj";"com::sun::star::util::SearchDescriptor";"SearchBackwards"
-"ScCellSearchObj";"com::sun::star::util::SearchDescriptor";"SearchCaseSensitive"
-"ScCellSearchObj";"com::sun::star::util::SearchDescriptor";"SearchWords"
-"ScCellSearchObj";"com::sun::star::util::SearchDescriptor";"SearchRegularExpression"
-"ScCellSearchObj";"com::sun::star::util::SearchDescriptor";"SearchStyles"
-"ScCellSearchObj";"com::sun::star::util::SearchDescriptor";"SearchSimilarity"
-"ScCellSearchObj";"com::sun::star::util::SearchDescriptor";"SearchSimilarityRelax"
-"ScCellSearchObj";"com::sun::star::util::SearchDescriptor";"SearchSimilarityRemove"
-"ScCellSearchObj";"com::sun::star::util::SearchDescriptor";"SearchSimilarityAdd"
-"ScCellSearchObj";"com::sun::star::util::SearchDescriptor";"SearchSimilarityExchange"
 
"ScCellSearchObj";"com::sun::star::util::XReplaceDescriptor";"getReplaceString()"
 
"ScCellSearchObj";"com::sun::star::util::XReplaceDescriptor";"setReplaceString()"
diff --git a/sc/qa/extras/sccellsearchobj.cxx b/sc/qa/extras/sccellsearchobj.cxx
index 0dfb94a8c245..7d376a5b5262 100644
--- a/sc/qa/extras/sccellsearchobj.cxx
+++ b/sc/qa/extras/sccellsearchobj.cxx
@@ -9,6 +9,7 @@
 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -26,6 +27,7 @@ using namespace css;
 namespace sc_apitest
 {
 class ScCellSearchObj : public CalcUnoApiTest,
+public apitest::SearchDescriptor,
 public apitest::XPropertySet,
 public apitest::XSearchDescriptor
 {
@@ -38,6 +40,9 @@ public:
 
 CPPUNIT_TEST_SUITE(ScCellSearchObj);
 
+// SearchDescriptor
+CPPUNIT_TEST(testSearchDescriptorProperties);
+
 // XPropertSet
 CPPUNIT_TEST(testGetPropertySetInfo);
 CPPUNIT_TEST(testGetPropertyValue);
diff --git a/test/Library_subsequenttest.mk b/test/Library_subsequenttest.mk
index 2d8a876d6a95..6bdde7dece5b 100644
--- a/test/Library_subsequenttest.mk
+++ b/test/Library_subsequenttest.mk
@@ -186,6 +186,7 @@ $(eval $(call 
gb_Library_add_exception_objects,subsequenttest,\
 test/source/text/textprintersettings \
 test/source/text/textsettings \
 test/source/text/textdocumentindex \
+   test/source/util/searchdescriptor \
test/source/util/xindent \
test/source/util/xmergeable \
test/source/util/xrefreshable \
diff --git a/test/source/util/searchdescriptor.cxx 
b/test/source/util/searchdescriptor.cxx
new file mode 100644
index ..a2b72ce588dc
--- /dev/null
+++ b/test/source/util/searchdescriptor.cxx
@@ -0,0 +1,65 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code 

[Libreoffice-commits] core.git: include/test qadevOOo/objdsc sc/qa test/Library_subsequenttest.mk test/source

2019-05-01 Thread Jens Carl (via logerrit)
 include/test/util/xsearchdescriptor.hxx |   33 
+
 qadevOOo/objdsc/sc/com.sun.star.comp.office.ScCellSearchObj.csv |2 
 sc/qa/extras/sccellsearchobj.cxx|8 +-
 test/Library_subsequenttest.mk  |1 
 test/source/util/xsearchdescriptor.cxx  |   36 
++
 5 files changed, 77 insertions(+), 3 deletions(-)

New commits:
commit 976bb31199baf8ded562323e35626c61ef5bffbe
Author: Jens Carl 
AuthorDate: Wed May 1 03:55:35 2019 +
Commit: Jens Carl 
CommitDate: Thu May 2 01:19:34 2019 +0200

tdf#45904 Move XSearchDescriptor Java tests to C++

Move XSearchDescriptor Java tests to C++ for ScCellSearchObj.

Change-Id: I1ae50bb586fd742b7cc19f71bcae018ca42139e6
Reviewed-on: https://gerrit.libreoffice.org/71643
Tested-by: Jenkins
Reviewed-by: Jens Carl 

diff --git a/include/test/util/xsearchdescriptor.hxx 
b/include/test/util/xsearchdescriptor.hxx
new file mode 100644
index ..1bad973753db
--- /dev/null
+++ b/include/test/util/xsearchdescriptor.hxx
@@ -0,0 +1,33 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#pragma once
+
+#include 
+
+#include 
+
+#include 
+
+namespace apitest
+{
+class OOO_DLLPUBLIC_TEST XSearchDescriptor
+{
+public:
+virtual css::uno::Reference init() = 0;
+
+void testGetSetSearchString();
+
+protected:
+~XSearchDescriptor() {}
+};
+
+} // namespace apitest
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScCellSearchObj.csv 
b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScCellSearchObj.csv
index 8f8a0add5ae6..04f296d22cbf 100644
--- a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScCellSearchObj.csv
+++ b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScCellSearchObj.csv
@@ -1,5 +1,3 @@
-"ScCellSearchObj";"com::sun::star::util::XSearchDescriptor";"getSearchString()"
-"ScCellSearchObj";"com::sun::star::util::XSearchDescriptor";"setSearchString()"
 "ScCellSearchObj";"com::sun::star::util::SearchDescriptor";"SearchBackwards"
 
"ScCellSearchObj";"com::sun::star::util::SearchDescriptor";"SearchCaseSensitive"
 "ScCellSearchObj";"com::sun::star::util::SearchDescriptor";"SearchWords"
diff --git a/sc/qa/extras/sccellsearchobj.cxx b/sc/qa/extras/sccellsearchobj.cxx
index 21ece504221b..0dfb94a8c245 100644
--- a/sc/qa/extras/sccellsearchobj.cxx
+++ b/sc/qa/extras/sccellsearchobj.cxx
@@ -9,6 +9,7 @@
 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -24,7 +25,9 @@ using namespace css;
 
 namespace sc_apitest
 {
-class ScCellSearchObj : public CalcUnoApiTest, public apitest::XPropertySet
+class ScCellSearchObj : public CalcUnoApiTest,
+public apitest::XPropertySet,
+public apitest::XSearchDescriptor
 {
 public:
 ScCellSearchObj();
@@ -42,6 +45,9 @@ public:
 CPPUNIT_TEST(testPropertyChangeListener);
 CPPUNIT_TEST(testVetoableChangeListener);
 
+// XSearchDescriptor
+CPPUNIT_TEST(testGetSetSearchString);
+
 CPPUNIT_TEST_SUITE_END();
 
 private:
diff --git a/test/Library_subsequenttest.mk b/test/Library_subsequenttest.mk
index 95341a5f91f5..2d8a876d6a95 100644
--- a/test/Library_subsequenttest.mk
+++ b/test/Library_subsequenttest.mk
@@ -191,6 +191,7 @@ $(eval $(call 
gb_Library_add_exception_objects,subsequenttest,\
test/source/util/xrefreshable \
test/source/util/xreplaceable \
test/source/util/xsearchable \
+   test/source/util/xsearchdescriptor \
test/source/view/xcontrolaccess \
test/source/view/xformlayeraccess \
 ))
diff --git a/test/source/util/xsearchdescriptor.cxx 
b/test/source/util/xsearchdescriptor.cxx
new file mode 100644
index ..b42ed7f90a44
--- /dev/null
+++ b/test/source/util/xsearchdescriptor.cxx
@@ -0,0 +1,36 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include 
+
+#include 
+
+#include 
+
+#include 
+
+using namespace css;
+
+namespace apitest
+{
+void XSearchDescriptor::testGetSetSearchString()
+{
+uno::Reference xDS(init(), uno::UNO_QUERY_THROW);
+const OUString aSearchStringOld = xDS->getSearchString();
+CPPUNIT_ASSERT(aSearchStringOld.isEmpty());
+
+xDS->setSearchString("_XSearchDescriptor");
+const 

[Libreoffice-commits] core.git: include/test test/source

2019-04-25 Thread Mike Kaganski (via logerrit)
 include/test/xmltesttools.hxx |   12 +++-
 test/source/xmltesttools.cxx  |5 +
 2 files changed, 12 insertions(+), 5 deletions(-)

New commits:
commit 3fef9fa3f5d260dd1264b67d8b42aad476332eea
Author: Mike Kaganski 
AuthorDate: Thu Apr 25 12:51:40 2019 +0300
Commit: Mike Kaganski 
CommitDate: Thu Apr 25 14:42:13 2019 +0200

assertXPath: disallow passing rAttribute without rExpectedValue

Change-Id: I7fb59039429361dad04fb68507f40545f9c4dd6d
Reviewed-on: https://gerrit.libreoffice.org/71290
Reviewed-by: Mike Kaganski 
Tested-by: Mike Kaganski 

diff --git a/include/test/xmltesttools.hxx b/include/test/xmltesttools.hxx
index 4f725f5948c5..c24a81eb65d6 100644
--- a/include/test/xmltesttools.hxx
+++ b/include/test/xmltesttools.hxx
@@ -61,12 +61,14 @@ protected:
 int   getXPathPosition(xmlDocPtr pXmlDoc, const OString& rXPath, 
const OUString& rChildName);
 /**
  * Assert that rXPath exists, and returns exactly one node.
- * In case rAttribute is provided, the rXPath's attribute's value must
- * equal to the rExpected value.
  */
-void  assertXPath(xmlDocPtr pXmlDoc, const OString& rXPath,
-  const OString& rAttribute = OString(),
-  const OUString& rExpectedValue = OUString());
+void  assertXPath(xmlDocPtr pXmlDoc, const OString& rXPath);
+/**
+ * Assert that rXPath exists, returns exactly one node, and the rXPath's 
attribute's value
+ * equals to the rExpected value.
+ */
+void  assertXPath(xmlDocPtr pXmlDoc, const OString& rXPath, const 
OString& rAttribute,
+  const OUString& rExpectedValue);
 void  assertXPathAttrs(xmlDocPtr pXmlDoc, const OString& rXPath,
   const std::vector>& 
aPairVector);
 /**
diff --git a/test/source/xmltesttools.cxx b/test/source/xmltesttools.cxx
index 123af01b28db..20149cc03c37 100644
--- a/test/source/xmltesttools.cxx
+++ b/test/source/xmltesttools.cxx
@@ -135,6 +135,11 @@ OUString XmlTestTools::getXPathContent(xmlDocPtr pXmlDoc, 
const OString& rXPath)
 CPPUNIT_FAIL("Invalid XPath type");
 }
 
+void XmlTestTools::assertXPath(xmlDocPtr pXmlDoc, const OString& rXPath)
+{
+getXPath(pXmlDoc, rXPath, ""); // it asserts that rXPath exists, and 
returns exactly one node
+}
+
 void XmlTestTools::assertXPath(xmlDocPtr pXmlDoc, const OString& rXPath, const 
OString& rAttribute, const OUString& rExpectedValue)
 {
 OUString aValue = getXPath(pXmlDoc, rXPath, rAttribute);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: include/test qadevOOo/objdsc sc/qa test/Library_subsequenttest.mk test/source

2019-04-18 Thread Jens Carl (via logerrit)
 include/test/chart/xchartdata.hxx  |   35 ++
 qadevOOo/objdsc/sc/com.sun.star.comp.office.ScCellRangeObj.csv |4 
 sc/qa/extras/sccellrangeobj.cxx|  134 
+-
 test/Library_subsequenttest.mk |1 
 test/source/chart/xchartdata.cxx   |   93 ++
 5 files changed, 201 insertions(+), 66 deletions(-)

New commits:
commit eb7a731bcfbacec15b77889f0ac545d36ef5ad19
Author: Jens Carl 
AuthorDate: Thu Apr 18 14:47:40 2019 -0700
Commit: Jens Carl 
CommitDate: Fri Apr 19 05:00:46 2019 +0200

tdf#45904 Move XChartData Java tests to C++

Fix tdf#43309: Move XChartData Java tests to C++ for ScCellRangeObj.

Change-Id: I6b57db53fdddab2ff382354d32809404224a2e1e
Reviewed-on: https://gerrit.libreoffice.org/70956
Tested-by: Jenkins
Reviewed-by: Jens Carl 

diff --git a/include/test/chart/xchartdata.hxx 
b/include/test/chart/xchartdata.hxx
new file mode 100644
index ..315d727ed5a3
--- /dev/null
+++ b/include/test/chart/xchartdata.hxx
@@ -0,0 +1,35 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#pragma once
+
+#include 
+
+#include 
+
+#include 
+
+namespace apitest
+{
+class OOO_DLLPUBLIC_TEST XChartData
+{
+public:
+virtual css::uno::Reference init() = 0;
+
+void testChartDataChangeEventListener();
+void testGetNotANumber();
+void testIsNotANumber();
+
+protected:
+~XChartData() {}
+};
+
+} // namespace apitest
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScCellRangeObj.csv 
b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScCellRangeObj.csv
index 3e2bbaf97550..0e3a7ab8191e 100644
--- a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScCellRangeObj.csv
+++ b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScCellRangeObj.csv
@@ -35,10 +35,6 @@
 
"ScCellRangeObj";"com::sun::star::style::CharacterPropertiesAsian";"ParaIsCharacterDistance"
 
"ScCellRangeObj";"com::sun::star::style::CharacterPropertiesAsian";"ParaIsForbiddenRules"
 
"ScCellRangeObj";"com::sun::star::style::CharacterPropertiesAsian";"ParaIsHangingPunctuation"
-"ScCellRangeObj";"com::sun::star::chart::XChartData";"addChartDataChangeEventListener()"
-"ScCellRangeObj";"com::sun::star::chart::XChartData";"removeChartDataChangeEventListener()"
-"ScCellRangeObj";"com::sun::star::chart::XChartData";"getNotANumber()"
-"ScCellRangeObj";"com::sun::star::chart::XChartData";"isNotANumber()"
 "ScCellRangeObj";"com::sun::star::style::ParagraphProperties";"ParaAdjust"
 
"ScCellRangeObj";"com::sun::star::style::ParagraphProperties";"ParaLineSpacing#optional"
 
"ScCellRangeObj";"com::sun::star::style::ParagraphProperties";"ParaBackColor#optional"
diff --git a/sc/qa/extras/sccellrangeobj.cxx b/sc/qa/extras/sccellrangeobj.cxx
index a529c9b4eb1f..aba1a458b9eb 100644
--- a/sc/qa/extras/sccellrangeobj.cxx
+++ b/sc/qa/extras/sccellrangeobj.cxx
@@ -8,6 +8,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -30,60 +31,62 @@
 #include 
 #include 
 #include 
-
-#include 
-#include 
-#include 
-#include 
-#include 
 #include 
 
 #include 
 #include 
 #include 
-#include 
 #include 
+#include 
+#include 
+#include 
+#include 
 #include 
 #include 
+#include 
+#include 
+
+#include 
 #include 
 #include 
 
 using namespace css;
-using namespace css::uno;
-
-namespace sc_apitest {
-
-class ScCellRangeObj : public CalcUnoApiTest, public apitest::CellProperties,
-  public apitest::SheetCellRange,
-  public 
apitest::XArrayFormulaRange,
-  public 
apitest::XCellFormatRangesSupplier,
-  public 
apitest::XCellRangeAddressable,
-  public apitest::XCellRangeData,
-  public 
apitest::XCellRangeFormula,
-  public apitest::XCellRangesQuery,
-  public apitest::XCellSeries,
-  public apitest::XColumnRowRange,
-  public apitest::XFormulaQuery,
-  public apitest::XIndent,
-  public apitest::XMergeable,
-  public 
apitest::XMultipleOperation,
-  public 

[Libreoffice-commits] core.git: include/test qadevOOo/objdsc sc/qa test/source

2019-04-16 Thread Jens Carl (via logerrit)
 include/test/text/xtextfield.hxx |   17 ---
 qadevOOo/objdsc/sc/com.sun.star.comp.office.ScHeaderFieldObj.csv |1 
 sc/qa/extras/sceditfieldobj-header.cxx   |7 ++-
 test/source/text/xtextfield.cxx  |   23 
+++---
 4 files changed, 34 insertions(+), 14 deletions(-)

New commits:
commit 5696272f9055b9b15c94d70a0dea7cee299c23ed
Author: Jens Carl 
AuthorDate: Tue Apr 16 19:21:58 2019 +
Commit: Jens Carl 
CommitDate: Wed Apr 17 01:11:58 2019 +0200

tdf#45904 Move XTextField Java tests to C++

Move XTextField Java tests to C++ for ScEditFieldObj_Header (formerly
ScHeaderFieldObj).

Change-Id: I36b723945d9306720846b4a4e2d3eaddb1a1c063
Reviewed-on: https://gerrit.libreoffice.org/70841
Tested-by: Jenkins
Reviewed-by: Jens Carl 

diff --git a/include/test/text/xtextfield.hxx b/include/test/text/xtextfield.hxx
index 870d51d20da5..6d717b1ead06 100644
--- a/include/test/text/xtextfield.hxx
+++ b/include/test/text/xtextfield.hxx
@@ -1,4 +1,4 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
 /*
  * This file is part of the LibreOffice project.
  *
@@ -10,25 +10,28 @@
 #ifndef INCLUDED_TEST_TEXT_XTEXTFIELD_HXX
 #define INCLUDED_TEST_TEXT_XTEXTFIELD_HXX
 
+#include 
+
 #include 
 
 #include 
 
 namespace apitest
 {
-
 class OOO_DLLPUBLIC_TEST XTextField
 {
 public:
-virtual ~XTextField() {}
-
-virtual css::uno::Reference< css::uno::XInterface > init() = 0;
+virtual css::uno::Reference init() = 0;
 
 void testGetPresentation();
+void testGetPresentationEmptyString();
+
+protected:
+~XTextField() {}
 };
 
-}
+} // namespace apitest
 
 #endif // INCLUDED_TEST_TEXT_XTEXTFIELD_HXX
 
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScHeaderFieldObj.csv 
b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScHeaderFieldObj.csv
index 343631dee5b6..e4f37d6e1016 100644
--- a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScHeaderFieldObj.csv
+++ b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScHeaderFieldObj.csv
@@ -1,4 +1,3 @@
 "ScHeaderFieldObj";"com::sun::star::lang::XComponent";"dispose()"
 "ScHeaderFieldObj";"com::sun::star::lang::XComponent";"addEventListener()"
 "ScHeaderFieldObj";"com::sun::star::lang::XComponent";"removeEventListener()"
-"ScHeaderFieldObj";"com::sun::star::text::XTextField";"getPresentation()"
diff --git a/sc/qa/extras/sceditfieldobj-header.cxx 
b/sc/qa/extras/sceditfieldobj-header.cxx
index a38b3a122ebb..f8d1e5d5a0d4 100644
--- a/sc/qa/extras/sceditfieldobj-header.cxx
+++ b/sc/qa/extras/sceditfieldobj-header.cxx
@@ -11,6 +11,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -38,7 +39,8 @@ namespace sc_apitest
 class ScEditFieldObj_Header : public CalcUnoApiTest,
   public apitest::TextContent,
   public apitest::XPropertySet,
-  public apitest::XTextContent
+  public apitest::XTextContent,
+  public apitest::XTextField
 {
 public:
 ScEditFieldObj_Header();
@@ -66,6 +68,9 @@ public:
 CPPUNIT_TEST(testGetAnchor);
 CPPUNIT_TEST(testAttach);
 
+// XTextField
+CPPUNIT_TEST(testGetPresentationEmptyString);
+
 CPPUNIT_TEST_SUITE_END();
 
 private:
diff --git a/test/source/text/xtextfield.cxx b/test/source/text/xtextfield.cxx
index 1d0abb22dad0..87fff9db3f83 100644
--- a/test/source/text/xtextfield.cxx
+++ b/test/source/text/xtextfield.cxx
@@ -1,4 +1,4 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
 /*
  * This file is part of the LibreOffice project.
  *
@@ -8,24 +8,37 @@
  */
 
 #include 
+#include 
+
 #include 
+
+#include 
+
 #include 
 
 using namespace css;
-using namespace css::uno;
 
 namespace apitest
 {
-
 void XTextField::testGetPresentation()
 {
-uno::Reference< text::XTextField > xTextField(init(), UNO_QUERY_THROW);
+uno::Reference xTextField(init(), uno::UNO_QUERY_THROW);
+
 OUString aString = xTextField->getPresentation(true);
 CPPUNIT_ASSERT(!aString.isEmpty());
 aString = xTextField->getPresentation(false);
 CPPUNIT_ASSERT(!aString.isEmpty());
 }
 
+void XTextField::testGetPresentationEmptyString()
+{
+uno::Reference xTextField(init(), uno::UNO_QUERY_THROW);
+
+OUString aString = xTextField->getPresentation(true);
+CPPUNIT_ASSERT(aString.isEmpty());
+aString = xTextField->getPresentation(false);
+CPPUNIT_ASSERT(aString.isEmpty());
 }
+} // namespace apitest
 
-/* vim:set shiftwidth=4 

[Libreoffice-commits] core.git: include/test qadevOOo/objdsc sc/qa test/Library_subsequenttest.mk test/source

2019-04-11 Thread Jens Carl (via logerrit)
 include/test/text/textcontent.hxx  |   51 +++
 qadevOOo/objdsc/sc/com.sun.star.comp.office.ScCellFieldObj.csv |3 
 sc/qa/extras/sceditfieldobj-cell.cxx   |   12 +
 sc/qa/extras/sceditfieldobj-header.cxx |   14 +-
 test/Library_subsequenttest.mk |1 
 test/source/text/textcontent.cxx   |   68 
++
 6 files changed, 143 insertions(+), 6 deletions(-)

New commits:
commit c498e548ee45430b31cb63df17818ba39771ef7c
Author: Jens Carl 
AuthorDate: Thu Apr 11 22:24:00 2019 +
Commit: Jens Carl 
CommitDate: Fri Apr 12 06:12:19 2019 +0200

tdf#45904 Move TextContent Java tests to C++

Move TextContent Java tests to C++ for ScEditFieldObj_Cell and
ScEditFieldObj_Header (formerly ScCellFieldObj).

Change-Id: Ieed5cdbc128490e66d1797c817d998a932317dd4
Reviewed-on: https://gerrit.libreoffice.org/70615
Tested-by: Jenkins
Reviewed-by: Jens Carl 

diff --git a/include/test/text/textcontent.hxx 
b/include/test/text/textcontent.hxx
new file mode 100644
index ..e6333d60e478
--- /dev/null
+++ b/include/test/text/textcontent.hxx
@@ -0,0 +1,51 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#pragma once
+
+#include 
+
+#include 
+#include 
+#include 
+
+#include 
+
+namespace apitest
+{
+class OOO_DLLPUBLIC_TEST TextContent
+{
+public:
+TextContent(const css::text::TextContentAnchorType aExpectedTCAT,
+const css::text::TextContentAnchorType aNewTCAT,
+const css::text::WrapTextMode aExpectedWTM, const 
css::text::WrapTextMode aNewWTM)
+: m_aExpectedTCAT(aExpectedTCAT)
+, m_aNewTCAT(aNewTCAT)
+, m_aExpectedWTM(aExpectedWTM)
+, m_aNewWTM(aNewWTM)
+{
+}
+
+virtual css::uno::Reference init() = 0;
+
+void testTextContentProperties();
+
+protected:
+~TextContent() {}
+
+private:
+css::text::TextContentAnchorType const m_aExpectedTCAT;
+css::text::TextContentAnchorType const m_aNewTCAT;
+css::text::WrapTextMode const m_aExpectedWTM;
+css::text::WrapTextMode const m_aNewWTM;
+};
+
+} // namespace apitest
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScCellFieldObj.csv 
b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScCellFieldObj.csv
index 1912ae235b3b..35be57d9423c 100644
--- a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScCellFieldObj.csv
+++ b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScCellFieldObj.csv
@@ -1,6 +1,3 @@
 "ScCellFieldObj";"com::sun::star::lang::XComponent";"dispose()"
 "ScCellFieldObj";"com::sun::star::lang::XComponent";"addEventListener()"
 "ScCellFieldObj";"com::sun::star::lang::XComponent";"removeEventListener()"
-"ScCellFieldObj";"com::sun::star::text::TextContent";"AnchorType#optional"
-"ScCellFieldObj";"com::sun::star::text::TextContent";"AnchorTypes#optional"
-"ScCellFieldObj";"com::sun::star::text::TextContent";"TextWrap#optional"
diff --git a/sc/qa/extras/sceditfieldobj-cell.cxx 
b/sc/qa/extras/sceditfieldobj-cell.cxx
index 071be82489ff..4852fcc1ca41 100644
--- a/sc/qa/extras/sceditfieldobj-cell.cxx
+++ b/sc/qa/extras/sceditfieldobj-cell.cxx
@@ -9,15 +9,18 @@
 
 #include 
 #include 
+#include 
 #include 
 #include 
 
 #include 
-#include 
 #include 
+#include 
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -33,6 +36,7 @@ using namespace css;
 namespace sc_apitest
 {
 class ScEditFieldObj_Cell : public CalcUnoApiTest,
+public apitest::TextContent,
 public apitest::XPropertySet,
 public apitest::XTextContent,
 public apitest::XTextField
@@ -51,6 +55,9 @@ public:
 
 CPPUNIT_TEST_SUITE(ScEditFieldObj_Cell);
 
+// TextContent
+CPPUNIT_TEST(testTextContentProperties);
+
 // XPropertySet
 CPPUNIT_TEST(testGetPropertySetInfo);
 CPPUNIT_TEST(testGetPropertyValue);
@@ -79,6 +86,9 @@ uno::Reference ScEditFieldObj_Cell::mxField;
 
 ScEditFieldObj_Cell::ScEditFieldObj_Cell()
 : CalcUnoApiTest("/sc/qa/extras/testdocuments")
+, TextContent(text::TextContentAnchorType_AS_CHARACTER,
+  text::TextContentAnchorType_AS_CHARACTER, 
text::WrapTextMode_NONE,
+  text::WrapTextMode_NONE)
 {
 }
 
diff --git a/sc/qa/extras/sceditfieldobj-header.cxx 
b/sc/qa/extras/sceditfieldobj-header.cxx
index e04f5087f17f..a38b3a122ebb 100644
--- a/sc/qa/extras/sceditfieldobj-header.cxx
+++ 

[Libreoffice-commits] core.git: include/test qadevOOo/objdsc sc/qa test/Library_subsequenttest.mk test/source

2019-04-02 Thread Jens Carl (via logerrit)
 include/test/table/tablerow.hxx   |   36 
 qadevOOo/objdsc/sc/com.sun.star.comp.office.ScTableRowObj.csv |4 
 sc/qa/extras/sctablerowobj.cxx|6 +
 test/Library_subsequenttest.mk|1 
 test/source/table/tablerow.cxx|   43 ++
 5 files changed, 85 insertions(+), 5 deletions(-)

New commits:
commit cc9a8c13dad6f3d82a2386554bd6113b486a1752
Author: Jens Carl 
AuthorDate: Tue Apr 2 21:14:33 2019 +
Commit: Jens Carl 
CommitDate: Wed Apr 3 00:39:08 2019 +0200

tdf#45904 Move TableRow Java tests to C++

Move TableRow Java tests to C++ for ScTableRowObj.

Change-Id: I72cd8006b8ad932bab56681de9aac66fb40542fe
Reviewed-on: https://gerrit.libreoffice.org/70159
Tested-by: Jenkins
Reviewed-by: Jens Carl 

diff --git a/include/test/table/tablerow.hxx b/include/test/table/tablerow.hxx
new file mode 100644
index ..150534bb2227
--- /dev/null
+++ b/include/test/table/tablerow.hxx
@@ -0,0 +1,36 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef INCLUDED_TEST_TABLE_TABLEROW_HXX
+#define INCLUDED_TEST_TABLE_TABLEROW_HXX
+
+#include 
+
+#include 
+
+#include 
+
+namespace apitest
+{
+class OOO_DLLPUBLIC_TEST TableRow
+{
+public:
+virtual css::uno::Reference init() = 0;
+
+void testTableRowProperties();
+
+protected:
+~TableRow() {}
+};
+
+} // namespace apitest
+
+#endif // INCLUDED_TEST_TABLE_TABLEROW_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScTableRowObj.csv 
b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScTableRowObj.csv
index 59f7efd6554a..3b6fe9714ae4 100644
--- a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScTableRowObj.csv
+++ b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScTableRowObj.csv
@@ -1,7 +1,3 @@
-"ScTableRowObj";"com::sun::star::table::TableRow";"Height"
-"ScTableRowObj";"com::sun::star::table::TableRow";"OptimalHeight"
-"ScTableRowObj";"com::sun::star::table::TableRow";"IsVisible"
-"ScTableRowObj";"com::sun::star::table::TableRow";"IsStartOfNewPage"
 "ScTableRowObj";"com::sun::star::table::XCellRange";"getCellByPosition()"
 "ScTableRowObj";"com::sun::star::table::XCellRange";"getCellRangeByPosition()"
 "ScTableRowObj";"com::sun::star::table::XCellRange";"getCellRangeByName()"
diff --git a/sc/qa/extras/sctablerowobj.cxx b/sc/qa/extras/sctablerowobj.cxx
index 381c4dc3a78c..d264d24ca69f 100644
--- a/sc/qa/extras/sctablerowobj.cxx
+++ b/sc/qa/extras/sctablerowobj.cxx
@@ -9,6 +9,7 @@
 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -25,7 +26,7 @@ using namespace css;
 
 namespace sc_apitest
 {
-class ScTableRowObj : public CalcUnoApiTest, public apitest::XPropertySet
+class ScTableRowObj : public CalcUnoApiTest, public apitest::TableRow, public 
apitest::XPropertySet
 {
 public:
 ScTableRowObj();
@@ -36,6 +37,9 @@ public:
 
 CPPUNIT_TEST_SUITE(ScTableRowObj);
 
+// TableRow
+CPPUNIT_TEST(testTableRowProperties);
+
 // XPropertySet
 CPPUNIT_TEST(testGetPropertySetInfo);
 CPPUNIT_TEST(testGetPropertyValue);
diff --git a/test/Library_subsequenttest.mk b/test/Library_subsequenttest.mk
index c636235913bf..796fbcef122c 100644
--- a/test/Library_subsequenttest.mk
+++ b/test/Library_subsequenttest.mk
@@ -162,6 +162,7 @@ $(eval $(call 
gb_Library_add_exception_objects,subsequenttest,\
test/source/sheet/xviewpane \
test/source/sheet/xviewsplitable \
test/source/style/xstyleloader \
+   test/source/table/tablerow \
test/source/table/xcell \
test/source/table/xcellcursor \
test/source/table/xcolumnrowrange \
diff --git a/test/source/table/tablerow.cxx b/test/source/table/tablerow.cxx
new file mode 100644
index ..f07f6e2f67a7
--- /dev/null
+++ b/test/source/table/tablerow.cxx
@@ -0,0 +1,43 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+
+using namespace css;
+
+namespace apitest
+{
+void TableRow::testTableRowProperties()
+{
+uno::Reference xPS(init(), uno::UNO_QUERY_THROW);
+
+OUString aPropName;
+
+aPropName = "Height";
+testLongProperty(xPS, aPropName);
+
+aPropName = 

[Libreoffice-commits] core.git: include/test sc/qa test/source

2019-04-02 Thread Samuel Mehrbrodt (via logerrit)
 include/test/sheet/shape.hxx |3 ++-
 sc/qa/extras/scshapeobj.cxx  |3 ++-
 test/source/sheet/shape.cxx  |8 +++-
 3 files changed, 11 insertions(+), 3 deletions(-)

New commits:
commit 8ecdaecfa8f8665b0c8c9e3e909f683a6c198797
Author: Samuel Mehrbrodt 
AuthorDate: Tue Apr 2 08:58:25 2019 +0200
Commit: Samuel Mehrbrodt 
CommitDate: Tue Apr 2 15:03:53 2019 +0200

Split large test method in two

Change-Id: If1b915f721a5768b682c63dc9c08b708ba37a705
Reviewed-on: https://gerrit.libreoffice.org/70116
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt 

diff --git a/include/test/sheet/shape.hxx b/include/test/sheet/shape.hxx
index 3d10fc31eb4f..ad2b7b7657ce 100644
--- a/include/test/sheet/shape.hxx
+++ b/include/test/sheet/shape.hxx
@@ -23,7 +23,8 @@ public:
 virtual css::uno::Reference init() = 0;
 virtual css::uno::Reference getXSheetDocument() = 0;
 
-void testShapeProperties();
+void testShapePropertiesAnchor();
+void testShapePropertiesPosition();
 
 protected:
 ~Shape() {}
diff --git a/sc/qa/extras/scshapeobj.cxx b/sc/qa/extras/scshapeobj.cxx
index c32ab1d899ed..279b07dead3d 100644
--- a/sc/qa/extras/scshapeobj.cxx
+++ b/sc/qa/extras/scshapeobj.cxx
@@ -42,7 +42,8 @@ public:
 CPPUNIT_TEST_SUITE(ScShapeObj);
 
 // Shape
-CPPUNIT_TEST(testShapeProperties);
+CPPUNIT_TEST(testShapePropertiesAnchor);
+CPPUNIT_TEST(testShapePropertiesPosition);
 
 CPPUNIT_TEST_SUITE_END();
 
diff --git a/test/source/sheet/shape.cxx b/test/source/sheet/shape.cxx
index ac50a1a11223..f1422f5b857a 100644
--- a/test/source/sheet/shape.cxx
+++ b/test/source/sheet/shape.cxx
@@ -25,7 +25,7 @@ using namespace com::sun::star::uno;
 
 namespace apitest
 {
-void Shape::testShapeProperties()
+void Shape::testShapePropertiesAnchor()
 {
 uno::Reference xShape(init(), UNO_QUERY_THROW);
 uno::Any aNewValue;
@@ -72,6 +72,12 @@ void Shape::testShapeProperties()
 xShape->getPropertyValue("ResizeWithCell") >>= bIsResizeWithCell;
 CPPUNIT_ASSERT_MESSAGE("ResizeWithCell should be unchangeable for sheet 
anchored shapes",
!bIsResizeWithCell);
+}
+
+void Shape::testShapePropertiesPosition()
+{
+uno::Reference xShape(init(), UNO_QUERY_THROW);
+uno::Any aNewValue;
 
 sal_Int32 nHoriOrientPositionGet = 0;
 sal_Int32 nHoriOrientPositionSet = 0;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: include/test qadevOOo/Jar_OOoRunner.mk qadevOOo/objdsc qadevOOo/tests sc/qa solenv/clang-format test/Library_subsequenttest.mk test/source

2019-03-30 Thread Jens Carl (via logerrit)
 include/test/helper/form.hxx  |   15 
 include/test/view/xformlayeraccess.hxx|   43 ++
 qadevOOo/Jar_OOoRunner.mk |1 
 qadevOOo/objdsc/sc/com.sun.star.comp.office.ScViewPaneObj.csv |4 
 qadevOOo/tests/java/mod/_sc/ScViewPaneObj.java|  174 --
 sc/qa/extras/scviewpaneobj.cxx|   65 ++-
 sc/qa/unoapi/sc_7.sce |1 
 solenv/clang-format/blacklist |1 
 test/Library_subsequenttest.mk|1 
 test/source/helper/form.cxx   |8 
 test/source/view/xformlayeraccess.cxx |   58 +++
 11 files changed, 171 insertions(+), 200 deletions(-)

New commits:
commit 2e0e7a15f66f5cb55f2a424fae6a9050c2c7f9ca
Author: Jens Carl 
AuthorDate: Fri Mar 29 22:06:59 2019 +
Commit: Jens Carl 
CommitDate: Sat Mar 30 22:40:23 2019 +0100

tdf#45904 Move XFormLayerAccess Java tests to C++

Move XFormLayerAccess Java tests to C++ for ScViewPaneObj.

Change-Id: I7ed6ff51d435b6f3de85daec99a13583e50a450a
Reviewed-on: https://gerrit.libreoffice.org/69942
Tested-by: Jenkins
Reviewed-by: Jens Carl 

diff --git a/include/test/helper/form.hxx b/include/test/helper/form.hxx
index f6e035d64fec..d84794cc5b6d 100644
--- a/include/test/helper/form.hxx
+++ b/include/test/helper/form.hxx
@@ -26,6 +26,19 @@ namespace helper
 {
 namespace form
 {
+/** @brief Create a XControlShape of kind "CommandButton".
+ *
+ * @param r_xComponent  The document.
+ * @param nXThe x-position of the shape.
+ * @param nYThe y-position of the shape.
+ * @param nHeight   The height of the shape.
+ * @param nWidthThe width of the shape.
+ * @return  The created XControlShape.
+ */
+css::uno::Reference OOO_DLLPUBLIC_TEST 
createCommandButton(
+const css::uno::Reference& r_xComponent, const 
sal_Int32 nX,
+const sal_Int32 nY, const sal_Int32 nHeight, const sal_Int32 nWidth);
+
 /** @brief Create a XControlShape
  *
  * @param r_xComponent  The document.
@@ -34,7 +47,7 @@ namespace form
  * @param nYThe y-position of the shape.
  * @param nHeight   The height of the shape.
  * @param nWidthThe width of the shape.
- * @return  The create XControlShape.
+ * @return  The created XControlShape.
  */
 css::uno::Reference OOO_DLLPUBLIC_TEST 
createControlShape(
 const css::uno::Reference& r_xComponent, const 
OUString& r_aKind,
diff --git a/include/test/view/xformlayeraccess.hxx 
b/include/test/view/xformlayeraccess.hxx
new file mode 100644
index ..ddd2542ab8ef
--- /dev/null
+++ b/include/test/view/xformlayeraccess.hxx
@@ -0,0 +1,43 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef INCLUDED_TEST_VIEW_XFORMLAYERACCESS_HXX
+#define INCLUDED_TEST_VIEW_XFORMLAYERACCESS_HXX
+
+#include 
+#include 
+
+#include 
+
+#include 
+
+namespace apitest
+{
+class OOO_DLLPUBLIC_TEST XFormLayerAccess
+{
+public:
+virtual css::uno::Reference init() = 0;
+void setForm(const css::uno::Reference& r_xForm) { 
m_xForm = r_xForm; }
+
+void testGetFormController();
+void testIsFormDesignMode();
+void testSetFormDesignMode();
+
+protected:
+~XFormLayerAccess() {}
+
+private:
+css::uno::Reference m_xForm;
+};
+
+} // namespace apitest
+
+#endif // INCLUDED_TEST_VIEW_XFORMLAYERACCESS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/qadevOOo/Jar_OOoRunner.mk b/qadevOOo/Jar_OOoRunner.mk
index 3cb59e2c61de..3539ddbfce9d 100644
--- a/qadevOOo/Jar_OOoRunner.mk
+++ b/qadevOOo/Jar_OOoRunner.mk
@@ -975,7 +975,6 @@ $(eval $(call gb_Jar_add_sourcefiles,OOoRunner,\
 qadevOOo/tests/java/mod/_sc/ScTableSheetObj \
 qadevOOo/tests/java/mod/_sc/ScTableSheetsObj \
 qadevOOo/tests/java/mod/_sc/ScTabViewObj \
-qadevOOo/tests/java/mod/_sc/ScViewPaneObj \
 qadevOOo/tests/java/mod/_sc/XMLContentExporter \
 qadevOOo/tests/java/mod/_sc/XMLContentImporter \
 qadevOOo/tests/java/mod/_sc/XMLExporter \
diff --git a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScViewPaneObj.csv 
b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScViewPaneObj.csv
deleted file mode 100644
index a4a3586f943f..
--- a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScViewPaneObj.csv
+++ /dev/null
@@ -1,4 +0,0 @@
-"ScViewPaneObj";"com::sun::star::view::XFormLayerAccess#optional";"getFromController()"

[Libreoffice-commits] core.git: include/test test/inc test/Library_subsequenttest.mk test/Library_test.mk test/source

2019-03-29 Thread Jens Carl (via logerrit)
 include/test/helper/form.hxx|6 +++---
 test/Library_subsequenttest.mk  |1 -
 test/Library_test.mk|1 -
 test/source/helper/form.cxx |2 +-
 test/source/view/xcontrolaccess.cxx |2 +-
 5 files changed, 5 insertions(+), 7 deletions(-)

New commits:
commit 413bfc34423b950fa5a9f9a6edc2f3d36b1e638b
Author: Jens Carl 
AuthorDate: Fri Mar 29 18:54:53 2019 +
Commit: Jens Carl 
CommitDate: Fri Mar 29 23:04:32 2019 +0100

Move UNO Api helper form to include/

Move UNO Api helper form to include/, so it can be used outside of
directory test/.

Change-Id: I9392f44df8a93d2b5ee092b0458aeef12f99fc7a
Reviewed-on: https://gerrit.libreoffice.org/69936
Tested-by: Jenkins
Reviewed-by: Jens Carl 

diff --git a/test/inc/helper/form.hxx b/include/test/helper/form.hxx
similarity index 91%
rename from test/inc/helper/form.hxx
rename to include/test/helper/form.hxx
index 271f06be0b7e..f6e035d64fec 100644
--- a/test/inc/helper/form.hxx
+++ b/include/test/helper/form.hxx
@@ -7,8 +7,8 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#ifndef INCLUDED_TEST_INC_HELPER_FORM_HXX
-#define INCLUDED_TEST_INC_HELPER_FORM_HXX
+#ifndef INCLUDED_TEST_HELPER_FORM_HXX
+#define INCLUDED_TEST_HELPER_FORM_HXX
 
 #include 
 #include 
@@ -44,6 +44,6 @@ css::uno::Reference 
OOO_DLLPUBLIC_TEST createContro
 } // namespace helper
 } // namespace apitest
 
-#endif // INCLUDED_TEST_INC_HELPER_FORM_HXX
+#endif // INCLUDED_TEST_HELPER_FORM_HXX
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/test/Library_subsequenttest.mk b/test/Library_subsequenttest.mk
index 65d9d1f7efd8..42cec9343c75 100644
--- a/test/Library_subsequenttest.mk
+++ b/test/Library_subsequenttest.mk
@@ -10,7 +10,6 @@
 $(eval $(call gb_Library_Library,subsequenttest))
 
 $(eval $(call gb_Library_set_include,subsequenttest,\
-   -I$(SRCDIR)/test/inc \
 $$(INCLUDE) \
 ))
 
diff --git a/test/Library_test.mk b/test/Library_test.mk
index f80cacf6ed9a..ce318d95471c 100644
--- a/test/Library_test.mk
+++ b/test/Library_test.mk
@@ -10,7 +10,6 @@
 $(eval $(call gb_Library_Library,test))
 
 $(eval $(call gb_Library_set_include,test,\
-   -I$(SRCDIR)/test/inc \
 $$(INCLUDE) \
 ))
 
diff --git a/test/source/helper/form.cxx b/test/source/helper/form.cxx
index 610bd43f1a51..3dbf079af59d 100644
--- a/test/source/helper/form.cxx
+++ b/test/source/helper/form.cxx
@@ -7,7 +7,7 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#include 
+#include 
 #include 
 #include 
 
diff --git a/test/source/view/xcontrolaccess.cxx 
b/test/source/view/xcontrolaccess.cxx
index 5f00e88a5f63..2c24d85328c8 100644
--- a/test/source/view/xcontrolaccess.cxx
+++ b/test/source/view/xcontrolaccess.cxx
@@ -8,7 +8,7 @@
  */
 
 #include 
-#include 
+#include 
 
 #include 
 #include 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: include/test qadevOOo/objdsc sc/qa test/source

2019-03-28 Thread Jens Carl (via logerrit)
 include/test/container/xnamed.hxx  |2 +
 qadevOOo/objdsc/sc/com.sun.star.comp.office.ScSheetLinkObj.csv |2 -
 sc/qa/extras/scsheetlinkobj.cxx|7 +
 test/source/container/xnamed.cxx   |   14 
++
 4 files changed, 23 insertions(+), 2 deletions(-)

New commits:
commit d757b121e3f0f5de03da1be430ed51bf830dce67
Author: Jens Carl 
AuthorDate: Fri Mar 29 00:30:18 2019 +
Commit: Jens Carl 
CommitDate: Fri Mar 29 02:47:05 2019 +0100

tdf#45904 Move XNamed Java tests to C++

Move XNamed Java tests to C++ for ScSheetLinkObj.

Change-Id: I64904ed6bae1b96767f8b0a65b0850a8694b10c2
Reviewed-on: https://gerrit.libreoffice.org/69907
Tested-by: Jenkins
Reviewed-by: Jens Carl 

diff --git a/include/test/container/xnamed.hxx 
b/include/test/container/xnamed.hxx
index 1b1a762ef8b4..de8618ce4436 100644
--- a/include/test/container/xnamed.hxx
+++ b/include/test/container/xnamed.hxx
@@ -30,6 +30,8 @@ public:
 
 void testGetName();
 void testSetName();
+// special case, here name is equal to links URL
+void testSetNameByScSheetLinkObj();
 void testSetNameThrowsException();
 
 virtual css::uno::Reference< css::uno::XInterface > init() = 0;
diff --git a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScSheetLinkObj.csv 
b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScSheetLinkObj.csv
index 2d72f6819568..63be54e69d85 100644
--- a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScSheetLinkObj.csv
+++ b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScSheetLinkObj.csv
@@ -1,5 +1,3 @@
-"ScSheetLinkObj";"com::sun::star::container::XNamed";"getName()"
-"ScSheetLinkObj";"com::sun::star::container::XNamed";"setName()"
 "ScSheetLinkObj";"com::sun::star::beans::XPropertySet";"getPropertySetInfo()"
 "ScSheetLinkObj";"com::sun::star::beans::XPropertySet";"setPropertyValue()"
 "ScSheetLinkObj";"com::sun::star::beans::XPropertySet";"getPropertyValue()"
diff --git a/sc/qa/extras/scsheetlinkobj.cxx b/sc/qa/extras/scsheetlinkobj.cxx
index 2819c915b6f0..5239a3288cee 100644
--- a/sc/qa/extras/scsheetlinkobj.cxx
+++ b/sc/qa/extras/scsheetlinkobj.cxx
@@ -8,6 +8,7 @@
  */
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -31,6 +32,7 @@ namespace sc_apitest
 {
 class ScSheetLinkObj : public CalcUnoApiTest,
public apitest::SheetLink,
+   public apitest::XNamed,
public apitest::XRefreshable
 {
 public:
@@ -46,6 +48,10 @@ public:
 // SheetLink
 CPPUNIT_TEST(testSheetLinkProperties);
 
+// XNamed
+CPPUNIT_TEST(testGetName);
+CPPUNIT_TEST(testSetNameByScSheetLinkObj);
+
 // XRefreshable
 CPPUNIT_TEST(testRefreshListener);
 
@@ -57,6 +63,7 @@ private:
 
 ScSheetLinkObj::ScSheetLinkObj()
 : CalcUnoApiTest("/sc/qa/extras/testdocuments")
+, 
XNamed(m_directories.getURLFromSrc("/sc/qa/extras/testdocuments/ScSheetLinkObj.ods"))
 {
 }
 
diff --git a/test/source/container/xnamed.cxx b/test/source/container/xnamed.cxx
index c8234f6dde4f..3b8023b6bc95 100644
--- a/test/source/container/xnamed.cxx
+++ b/test/source/container/xnamed.cxx
@@ -8,6 +8,7 @@
  */
 
 #include 
+#include 
 
 #include 
 #include 
@@ -40,6 +41,19 @@ void XNamed::testSetName()
 CPPUNIT_ASSERT_EQUAL(m_aTestName, xNamed->getName());
 }
 
+void XNamed::testSetNameByScSheetLinkObj()
+{
+uno::Reference xNamed(init(), uno::UNO_QUERY_THROW);
+OUString aTestName(m_aTestName.replaceAll("ScSheetLinkObj", 
"NewScSheetLinkObj"));
+
+xNamed->setName(aTestName);
+CPPUNIT_ASSERT_EQUAL(aTestName, xNamed->getName());
+
+// restore old name
+xNamed->setName(m_aTestName);
+CPPUNIT_ASSERT_EQUAL(m_aTestName, xNamed->getName());
+}
+
 void XNamed::testSetNameThrowsException()
 {
 uno::Reference xNamed(init(), uno::UNO_QUERY_THROW);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: include/test qadevOOo/Jar_OOoRunner.mk qadevOOo/objdsc qadevOOo/tests sc/qa test/Library_subsequenttest.mk test/source

2019-03-28 Thread Jens Carl (via logerrit)
 include/test/drawing/xshapes.hxx  |   43 +++
 qadevOOo/Jar_OOoRunner.mk |1 
 qadevOOo/objdsc/sc/com.sun.star.comp.office.ScDrawPageObj.csv |2 
 qadevOOo/tests/java/mod/_sc/ScDrawPageObj.java|  130 --
 sc/qa/extras/scdrawpageobj.cxx|9 
 sc/qa/unoapi/sc_4.sce |1 
 test/Library_subsequenttest.mk|1 
 test/source/drawing/xshapes.cxx   |   38 ++
 8 files changed, 90 insertions(+), 135 deletions(-)

New commits:
commit b99ea0ff33b78ba76d1ae436895efac490252e0f
Author: Jens Carl 
AuthorDate: Thu Mar 28 21:24:35 2019 +
Commit: Jens Carl 
CommitDate: Fri Mar 29 00:45:46 2019 +0100

tdf#45904 Move XShapes Java tests to C++

Move XShapes Java tests to C++ for ScDrawPageObj.

Change-Id: I1b65e8ad685c3d387a5023e8e8e9b9e06627af11
Reviewed-on: https://gerrit.libreoffice.org/69904
Tested-by: Jenkins
Reviewed-by: Jens Carl 

diff --git a/include/test/drawing/xshapes.hxx b/include/test/drawing/xshapes.hxx
new file mode 100644
index ..f04131dc41f7
--- /dev/null
+++ b/include/test/drawing/xshapes.hxx
@@ -0,0 +1,43 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef INCLUDED_TEST_DRAWING_XSHAPES_HXX
+#define INCLUDED_TEST_DRAWING_XSHAPES_HXX
+
+#include 
+#include 
+
+#include 
+
+#include 
+
+namespace apitest
+{
+class OOO_DLLPUBLIC_TEST XShapes
+{
+public:
+virtual css::uno::Reference init() = 0;
+void setShape(const css::uno::Reference& r_xShape)
+{
+m_xShape = r_xShape;
+}
+
+void testAddRemove();
+
+protected:
+~XShapes() {}
+
+private:
+css::uno::Reference m_xShape;
+};
+} // namespace apitest
+
+#endif // INCLUDED_TEST_DRAWING_XSHAPES_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/qadevOOo/Jar_OOoRunner.mk b/qadevOOo/Jar_OOoRunner.mk
index 4bc4edde3ba3..3cb59e2c61de 100644
--- a/qadevOOo/Jar_OOoRunner.mk
+++ b/qadevOOo/Jar_OOoRunner.mk
@@ -961,7 +961,6 @@ $(eval $(call gb_Jar_add_sourcefiles,OOoRunner,\
 qadevOOo/tests/java/mod/_sc/ScDatabaseRangeObj \
 qadevOOo/tests/java/mod/_sc/ScDataPilotItemObj \
 qadevOOo/tests/java/mod/_sc/ScDocumentConfiguration \
-qadevOOo/tests/java/mod/_sc/ScDrawPageObj \
 qadevOOo/tests/java/mod/_sc/ScHeaderFieldObj \
 qadevOOo/tests/java/mod/_sc/ScHeaderFieldsObj \
 qadevOOo/tests/java/mod/_sc/ScHeaderFooterTextCursor \
diff --git a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScDrawPageObj.csv 
b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScDrawPageObj.csv
deleted file mode 100644
index b39d7b6062be..
--- a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScDrawPageObj.csv
+++ /dev/null
@@ -1,2 +0,0 @@
-"ScDrawPageObj";"com::sun::star::drawing::XShapes";"add()"
-"ScDrawPageObj";"com::sun::star::drawing::XShapes";"remove()"
diff --git a/qadevOOo/tests/java/mod/_sc/ScDrawPageObj.java 
b/qadevOOo/tests/java/mod/_sc/ScDrawPageObj.java
deleted file mode 100644
index 0619ca7533c4..
--- a/qadevOOo/tests/java/mod/_sc/ScDrawPageObj.java
+++ /dev/null
@@ -1,130 +0,0 @@
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-package mod._sc;
-
-import java.io.PrintWriter;
-
-import lib.TestCase;
-import lib.TestEnvironment;
-import lib.TestParameters;
-import util.DrawTools;
-import util.InstCreator;
-import util.SOfficeFactory;
-import util.ShapeDsc;
-
-import com.sun.star.drawing.XDrawPage;
-import com.sun.star.drawing.XDrawPages;
-import com.sun.star.drawing.XDrawPagesSupplier;
-import com.sun.star.drawing.XShape;
-import com.sun.star.lang.XComponent;
-import com.sun.star.sheet.XSpreadsheetDocument;
-import com.sun.star.uno.AnyConverter;
-import com.sun.star.uno.Type;

[Libreoffice-commits] core.git: include/test

2019-03-28 Thread Jens Carl (via logerrit)
 include/test/helper/shape.hxx |   14 +++---
 1 file changed, 7 insertions(+), 7 deletions(-)

New commits:
commit ee92196179d7697a514e55774be09cbf60f2c466
Author: Jens Carl 
AuthorDate: Thu Mar 28 20:12:35 2019 +
Commit: Jens Carl 
CommitDate: Thu Mar 28 22:18:48 2019 +0100

Fix header guard and improve comments

Change-Id: I7ddef04a88381e3e58a6604de35694dea658c81d
Reviewed-on: https://gerrit.libreoffice.org/69900
Tested-by: Jenkins
Reviewed-by: Jens Carl 

diff --git a/include/test/helper/shape.hxx b/include/test/helper/shape.hxx
index 9f8bd9e8b73b..e4322bec1357 100644
--- a/include/test/helper/shape.hxx
+++ b/include/test/helper/shape.hxx
@@ -7,8 +7,8 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  */
 
-#ifndef INCLUDED_TEST_HELPER_SHAPEFACTORY_HXX
-#define INCLUDED_TEST_HELPER_SHAPEFACTORY_HXX
+#ifndef INCLUDED_TEST_HELPER_SHAPE_HXX
+#define INCLUDED_TEST_HELPER_SHAPE_HXX
 
 #include 
 #include 
@@ -33,7 +33,7 @@ namespace shape
  * @param nYThe y-position of the shape.
  * @param nHeight   The height of the shape.
  * @param nWidthThe width of the shape.
- * @return  The create XShape.
+ * @return  The created XShape.
  */
 css::uno::Reference
 OOO_DLLPUBLIC_TEST createEllipse(const 
css::uno::Reference& r_xComponent,
@@ -47,7 +47,7 @@ css::uno::Reference
  * @param nYThe y-position of the shape.
  * @param nHeight   The height of the shape.
  * @param nWidthThe width of the shape.
- * @return  The create XShape.
+ * @return  The created XShape.
  */
 css::uno::Reference
 OOO_DLLPUBLIC_TEST createLine(const 
css::uno::Reference& r_xComponent,
@@ -61,7 +61,7 @@ css::uno::Reference
  * @param nYThe y-position of the shape.
  * @param nHeight   The height of the shape.
  * @param nWidthThe width of the shape.
- * @return  The create XShape.
+ * @return  The created XShape.
  */
 css::uno::Reference OOO_DLLPUBLIC_TEST
 createRectangle(const css::uno::Reference& 
r_xComponent, const sal_Int32 nX,
@@ -75,7 +75,7 @@ createRectangle(const 
css::uno::Reference& r_xComponent,
  * @param nYThe y-position of the shape.
  * @param nHeight   The height of the shape.
  * @param nWidthThe width of the shape.
- * @return  The create XShape.
+ * @return  The created XShape.
  */
 css::uno::Reference
 OOO_DLLPUBLIC_TEST createShape(const 
css::uno::Reference& r_xComponent,
@@ -86,6 +86,6 @@ css::uno::Reference
 } // namespace helper
 } // namespace apitest
 
-#endif // INCLUDED_TEST_HELPER_SHAPEFACTORY_HXX
+#endif // INCLUDED_TEST_HELPER_SHAPE_HXX
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: include/test qadevOOo/objdsc sc/qa test/Library_subsequenttest.mk test/source

2019-03-27 Thread Jens Carl (via logerrit)
 include/test/drawing/xshapegrouper.hxx|   44 +++
 qadevOOo/objdsc/sc/com.sun.star.comp.office.ScDrawPageObj.csv |2 
 sc/qa/extras/scdrawpageobj.cxx|   10 +
 test/Library_subsequenttest.mk|1 
 test/source/drawing/xshapegrouper.cxx |   58 ++
 5 files changed, 112 insertions(+), 3 deletions(-)

New commits:
commit ee503c36199d225f4c906fe43c927f911c2097c7
Author: Jens Carl 
AuthorDate: Thu Mar 28 00:22:44 2019 +
Commit: Jens Carl 
CommitDate: Thu Mar 28 06:28:16 2019 +0100

tdf#45904 Move XShapeGrouper Java tests to C++

Move XShapeGrouper Java tests to C++ for ScDrawPageObj.

Change-Id: I4a1ed4f14f759fa4214141f0d552e35ccae28035
Reviewed-on: https://gerrit.libreoffice.org/69873
Tested-by: Jenkins
Reviewed-by: Jens Carl 

diff --git a/include/test/drawing/xshapegrouper.hxx 
b/include/test/drawing/xshapegrouper.hxx
new file mode 100644
index ..1770d3f76d6c
--- /dev/null
+++ b/include/test/drawing/xshapegrouper.hxx
@@ -0,0 +1,44 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef INCLUDED_TEST_DRAWING_XSHAPEGROUPER_HXX
+#define INCLUDED_TEST_DRAWING_XSHAPEGROUPER_HXX
+
+#include 
+
+#include 
+
+#include 
+
+namespace apitest
+{
+class OOO_DLLPUBLIC_TEST XShapeGrouper
+{
+public:
+void setDrawPage(const css::uno::Reference& 
r_xDrawPage)
+{
+m_xDrawPage = r_xDrawPage;
+}
+
+virtual css::uno::Reference init() = 0;
+
+void testGroup();
+void testUngroup();
+
+protected:
+~XShapeGrouper() {}
+
+private:
+css::uno::Reference m_xDrawPage;
+};
+} // namespace apitest
+
+#endif // INCLUDED_TEST_DRAWING_XSHAPEGROUPER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScDrawPageObj.csv 
b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScDrawPageObj.csv
index c742ce529e4f..b39d7b6062be 100644
--- a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScDrawPageObj.csv
+++ b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScDrawPageObj.csv
@@ -1,4 +1,2 @@
 "ScDrawPageObj";"com::sun::star::drawing::XShapes";"add()"
 "ScDrawPageObj";"com::sun::star::drawing::XShapes";"remove()"
-"ScDrawPageObj";"com::sun::star::drawing::XShapeGrouper";"group()"
-"ScDrawPageObj";"com::sun::star::drawing::XShapeGrouper";"ungroup()"
diff --git a/sc/qa/extras/scdrawpageobj.cxx b/sc/qa/extras/scdrawpageobj.cxx
index de8d8baa4e9c..7d50a783d9d5 100644
--- a/sc/qa/extras/scdrawpageobj.cxx
+++ b/sc/qa/extras/scdrawpageobj.cxx
@@ -11,6 +11,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 
@@ -32,7 +33,8 @@ namespace sc_apitest
 class ScDrawPageObj : public CalcUnoApiTest,
   public apitest::XElementAccess,
   public apitest::XIndexAccess,
-  public apitest::XServiceInfo
+  public apitest::XServiceInfo,
+  public apitest::XShapeGrouper
 {
 public:
 ScDrawPageObj();
@@ -56,6 +58,10 @@ public:
 CPPUNIT_TEST(testGetSupportedServiceNames);
 CPPUNIT_TEST(testSupportsService);
 
+// XShapeGrouper
+CPPUNIT_TEST(testGroup);
+CPPUNIT_TEST(testUngroup);
+
 CPPUNIT_TEST_SUITE_END();
 
 private:
@@ -90,6 +96,8 @@ uno::Reference ScDrawPageObj::init()
 uno::UNO_QUERY_THROW);
 xShapes->add(xRectangle1);
 
+// needed for XShapeGrouper tests
+setDrawPage(xDrawPage);
 return xDrawPage;
 }
 
diff --git a/test/Library_subsequenttest.mk b/test/Library_subsequenttest.mk
index 7fca94314977..c267a1570d1f 100644
--- a/test/Library_subsequenttest.mk
+++ b/test/Library_subsequenttest.mk
@@ -56,6 +56,7 @@ $(eval $(call 
gb_Library_add_exception_objects,subsequenttest,\
test/source/document/xlinktargetsupplier \
test/source/drawing/captionshape \
test/source/drawing/xdrawpages \
+   test/source/drawing/xshapegrouper \
test/source/lang/xserviceinfo \
test/source/lang/xcomponent \
test/source/sheet/cellarealink \
diff --git a/test/source/drawing/xshapegrouper.cxx 
b/test/source/drawing/xshapegrouper.cxx
new file mode 100644
index ..6595050ad418
--- /dev/null
+++ b/test/source/drawing/xshapegrouper.cxx
@@ -0,0 +1,58 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this

[Libreoffice-commits] core.git: include/test test/Library_test.mk test/source

2019-03-27 Thread Jens Carl (via logerrit)
 include/test/helper/shape.hxx |   91 ++
 test/Library_test.mk  |1 
 test/source/helper/shape.cxx  |   78 
 3 files changed, 170 insertions(+)

New commits:
commit 28eab5de358631758315a3581e860d6ef533259a
Author: Jens Carl 
AuthorDate: Tue Mar 26 21:55:00 2019 +
Commit: Jens Carl 
CommitDate: Wed Mar 27 19:35:51 2019 +0100

Helper to create various drawing::XShape

This ports SOfficeFactory::createShape() from file
qadevOOo/runner/util/SOfficeFactory.

Change-Id: I2c7eb0304ac1d439211d3851b2debdb4843130e3
Reviewed-on: https://gerrit.libreoffice.org/69772
Tested-by: Jenkins
Reviewed-by: Jens Carl 

diff --git a/include/test/helper/shape.hxx b/include/test/helper/shape.hxx
new file mode 100644
index ..9f8bd9e8b73b
--- /dev/null
+++ b/include/test/helper/shape.hxx
@@ -0,0 +1,91 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef INCLUDED_TEST_HELPER_SHAPEFACTORY_HXX
+#define INCLUDED_TEST_HELPER_SHAPEFACTORY_HXX
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+
+namespace apitest
+{
+namespace helper
+{
+namespace shape
+{
+/** @brief Create a XShape of kind "Ellipse".
+ *
+ * @param r_xComponent  The document
+ * @param nXThe x-position of the shape.
+ * @param nYThe y-position of the shape.
+ * @param nHeight   The height of the shape.
+ * @param nWidthThe width of the shape.
+ * @return  The create XShape.
+ */
+css::uno::Reference
+OOO_DLLPUBLIC_TEST createEllipse(const 
css::uno::Reference& r_xComponent,
+ const sal_Int32 nX, const sal_Int32 nY, 
const sal_Int32 nWidth,
+ const sal_Int32 nHeight);
+
+/** @brief Create a XShape of kind "Line".
+ *
+ * @param r_xComponent  The document
+ * @param nXThe x-position of the shape.
+ * @param nYThe y-position of the shape.
+ * @param nHeight   The height of the shape.
+ * @param nWidthThe width of the shape.
+ * @return  The create XShape.
+ */
+css::uno::Reference
+OOO_DLLPUBLIC_TEST createLine(const 
css::uno::Reference& r_xComponent,
+  const sal_Int32 nX, const sal_Int32 nY, 
const sal_Int32 nWidth,
+  const sal_Int32 nHeight);
+
+/** @brief Create a XShape of kind "Rectangle".
+ *
+ * @param r_xComponent  The document
+ * @param nXThe x-position of the shape.
+ * @param nYThe y-position of the shape.
+ * @param nHeight   The height of the shape.
+ * @param nWidthThe width of the shape.
+ * @return  The create XShape.
+ */
+css::uno::Reference OOO_DLLPUBLIC_TEST
+createRectangle(const css::uno::Reference& 
r_xComponent, const sal_Int32 nX,
+const sal_Int32 nY, const sal_Int32 nWidth, const sal_Int32 
nHeight);
+
+/** @brief Create a XShape.
+ *
+ * @param r_xComponent  The document
+ * @param r_aKind   The kind of shape.
+ * @param nXThe x-position of the shape.
+ * @param nYThe y-position of the shape.
+ * @param nHeight   The height of the shape.
+ * @param nWidthThe width of the shape.
+ * @return  The create XShape.
+ */
+css::uno::Reference
+OOO_DLLPUBLIC_TEST createShape(const 
css::uno::Reference& r_xComponent,
+   const OUString& r_aKind, const sal_Int32 
nX, const sal_Int32 nY,
+   const sal_Int32 nWidth, const sal_Int32 
nHeight);
+
+} // namespace shape
+} // namespace helper
+} // namespace apitest
+
+#endif // INCLUDED_TEST_HELPER_SHAPEFACTORY_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/test/Library_test.mk b/test/Library_test.mk
index 3d55e1116d71..f80cacf6ed9a 100644
--- a/test/Library_test.mk
+++ b/test/Library_test.mk
@@ -52,6 +52,7 @@ $(eval $(call gb_Library_add_exception_objects,test,\
 test/source/screenshot_test \
 test/source/unoapi_property_testers \
test/source/helper/form \
+   test/source/helper/shape \
 ))
 
 # vim: set noet sw=4 ts=4:
diff --git a/test/source/helper/shape.cxx b/test/source/helper/shape.cxx
new file mode 100644
index ..130951527706
--- /dev/null
+++ b/test/source/helper/shape.cxx
@@ -0,0 +1,78 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. 

[Libreoffice-commits] core.git: include/test test/source

2019-03-27 Thread Noel Grandin (via logerrit)
 include/test/sheet/xspreadsheets2.hxx |2 +-
 test/source/sheet/xspreadsheets2.cxx  |   29 ++---
 2 files changed, 11 insertions(+), 20 deletions(-)

New commits:
commit 705558aa455403cd006993f95b5b13981fdb3483
Author: Noel Grandin 
AuthorDate: Tue Mar 26 15:54:47 2019 +0200
Commit: Noel Grandin 
CommitDate: Wed Mar 27 07:40:12 2019 +0100

condition always true in XSpreadsheets2::importSheetToCopy

leftover from
commit ed45c87896de74048708d51c050ecd42c9f4a0a0
Date:   Mon Oct 20 21:08:54 2014 +0200
sc: fix temp file leak in ScTableSheetsObj

Change-Id: Ic108fb36cc0caccbe57f2b47f7fcbe80156842dc
Reviewed-on: https://gerrit.libreoffice.org/69749
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/include/test/sheet/xspreadsheets2.hxx 
b/include/test/sheet/xspreadsheets2.hxx
index e3928d349efb..1340b80be216 100644
--- a/include/test/sheet/xspreadsheets2.hxx
+++ b/include/test/sheet/xspreadsheets2.hxx
@@ -46,7 +46,7 @@ protected:
 css::uno::Reference< css::sheet::XSpreadsheetDocument> xDocument;
 
 private:
-css::uno::Reference< css::sheet::XSpreadsheetDocument> getDoc(const 
OUString&, css::uno::Reference< css::lang::XComponent >&);
+css::uno::Reference< css::sheet::XSpreadsheetDocument> getDoc(const 
OUString&);
 static css::uno::Reference< css::sheet::XNamedRanges> 
getNamedRanges(css::uno::Reference< css::sheet::XSpreadsheetDocument > const &);
 void importSheetToCopy();
 static bool isExternalReference(const OUString& aDestContent, const 
OUString& aSrcContent );
diff --git a/test/source/sheet/xspreadsheets2.cxx 
b/test/source/sheet/xspreadsheets2.cxx
index cea68e1cfad9..ab3ef3e75688 100644
--- a/test/source/sheet/xspreadsheets2.cxx
+++ b/test/source/sheet/xspreadsheets2.cxx
@@ -275,13 +275,12 @@ void XSpreadsheets2::testImportCellStyle()
 CPPUNIT_ASSERT_EQUAL_MESSAGE("New style: VertJustify not set", 
table::CellVertJustify_CENTER, 
static_cast(aVertJustify));
 }
 
-uno::Reference< sheet::XSpreadsheetDocument> XSpreadsheets2::getDoc(const 
OUString& aFileBase, uno::Reference< lang::XComponent >& xComp)
+uno::Reference< sheet::XSpreadsheetDocument> XSpreadsheets2::getDoc(const 
OUString& aFileBase)
 {
 OUString aFileURL;
 createFileURL(aFileBase, aFileURL);
 
-if (!xComp.is())
-xComp = loadFromDesktop(aFileURL);
+uno::Reference< lang::XComponent > xComp = loadFromDesktop(aFileURL);
 
 CPPUNIT_ASSERT(xComp.is());
 
@@ -301,22 +300,14 @@ void XSpreadsheets2::importSheetToCopy()
 uno::Reference< container::XNameAccess> 
xSrcNameAccess(init(),UNO_QUERY_THROW);
 xSrcSheet.set( xSrcNameAccess->getByName(gaSrcSheetName), UNO_QUERY_THROW);
 
-uno::Reference< lang::XComponent > xDestComponent;
-if (!xDestComponent.is())
-{
-xDestDoc = getDoc(gaDestFileBase, xDestComponent);
-CPPUNIT_ASSERT(xDestDoc.is());
-
-// import sheet
-uno::Reference< sheet::XSpreadsheets2 > xDestSheets 
(xDestDoc->getSheets(), UNO_QUERY_THROW);
-sal_Int32 nDestPos = 0;
-sal_Int32 nDestPosEffective = xDestSheets->importSheet(xDocument, 
gaSrcSheetName, nDestPos);
-CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong sheet index", nDestPosEffective, 
nDestPos);
-}
-else
-{
-xDestDoc.set(xDestComponent,UNO_QUERY_THROW);
-}
+xDestDoc = getDoc(gaDestFileBase);
+CPPUNIT_ASSERT(xDestDoc.is());
+
+// import sheet
+uno::Reference< sheet::XSpreadsheets2 > xDestSheets 
(xDestDoc->getSheets(), UNO_QUERY_THROW);
+sal_Int32 nDestPos = 0;
+sal_Int32 nDestPosEffective = xDestSheets->importSheet(xDocument, 
gaSrcSheetName, nDestPos);
+CPPUNIT_ASSERT_EQUAL_MESSAGE("Wrong sheet index", nDestPosEffective, 
nDestPos);
 
 uno::Reference< container::XNameAccess > xDestSheetNameAccess 
(xDestDoc->getSheets(), UNO_QUERY_THROW);
 xDestSheet.set( xDestSheetNameAccess->getByName(gaSrcSheetName), 
UNO_QUERY_THROW);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: include/test sw/CppunitTest_sw_apitests.mk sw/qa test/Library_subsequenttest.mk test/source

2019-03-19 Thread Libreoffice Gerrit user
 include/test/text/baseindex.hxx|   28 +
 include/test/text/textdocumentindex.hxx|   31 +
 include/test/text/textdocumentsettings.hxx |   29 +
 include/test/text/textprintersettings.hxx  |   31 +
 include/test/text/textsettings.hxx |   26 
 include/test/text/xdocumentindex.hxx   |   36 ++
 sw/CppunitTest_sw_apitests.mk  |2 
 sw/qa/api/ApiTestBase.hxx  |   57 --
 sw/qa/api/BaseIndexTest.hxx|  161 -
 sw/qa/api/DocumentIndexTest.hxx|   47 
 sw/qa/api/DocumentSettingsTest.hxx |   47 
 sw/qa/api/PrinterSettingsTest.hxx  |   79 --
 sw/qa/api/SettingsTest.hxx |  137 
 sw/qa/api/SwXDocumentIndex.cxx |   50 +
 sw/qa/api/SwXDocumentSettings.cxx  |   31 ++---
 sw/qa/api/XDocumentIndexTest.hxx   |   85 ---
 sw/qa/api/XTextContentTest.hxx |   61 --
 test/Library_subsequenttest.mk |6 +
 test/source/text/baseindex.cxx |  153 +++
 test/source/text/textdocumentindex.cxx |   36 ++
 test/source/text/textdocumentsettings.cxx  |   42 +++
 test/source/text/textprintersettings.cxx   |   39 +++
 test/source/text/textsettings.cxx  |  153 +++
 test/source/text/xdocumentindex.cxx|   67 
 24 files changed, 724 insertions(+), 710 deletions(-)

New commits:
commit 3428ca9c3b98c275bbcd852e733aa42eef89bdd2
Author: Bjoern Michaelsen 
AuthorDate: Sat Mar 16 15:21:43 2019 +0100
Commit: Björn Michaelsen 
CommitDate: Tue Mar 19 08:38:34 2019 +0100

name apitest suites consistently while we still can

- writer test apitest suites are now called like the UNO implementation they
  are testing
- also mark them final for good measure
- move tests to module test and try to match its conventions
  * BaseIndex
  * TextDocumentIndex
  * TextDocumentSettings
  * TextPrinterSettings
  * TextSettings
  * XDocumentIndex
- also remove anonymous namespace in header, as that is a bad idea
- also remove now obsolete ApiBaseTest
- also remove dead code in TextPrinterSettings
- remove writer xtextcontent test as it duplicates the impl in module test

Change-Id: I71aa5f3755d5c90726f4ff4394117fa2391495d7
Reviewed-on: https://gerrit.libreoffice.org/69374
Tested-by: Jenkins
Reviewed-by: Björn Michaelsen 

diff --git a/include/test/text/baseindex.hxx b/include/test/text/baseindex.hxx
new file mode 100644
index ..2c8d2734fa57
--- /dev/null
+++ b/include/test/text/baseindex.hxx
@@ -0,0 +1,28 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef INCLUDED_TEST_TEXT_BASEINDEXTEST_HXX
+#define INCLUDED_TEST_TEXT_BASEINDEXTEST_HXX
+
+#include 
+
+namespace apitest
+{
+class OOO_DLLPUBLIC_TEST BaseIndex
+{
+public:
+virtual css::uno::Reference init() = 0;
+virtual ~BaseIndex();
+void testBaseIndexProperties();
+};
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/test/text/textdocumentindex.hxx 
b/include/test/text/textdocumentindex.hxx
new file mode 100644
index ..d045954018d2
--- /dev/null
+++ b/include/test/text/textdocumentindex.hxx
@@ -0,0 +1,31 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef INCLUDED_TEST_TEXT_DOCUMENTINDEXTEST_HXX
+#define INCLUDED_TEST_TEXT_DOCUMENTINDEXTEST_HXX
+
+#include 
+
+#include 
+#include 
+
+namespace apitest
+{
+class OOO_DLLPUBLIC_TEST TextDocumentIndex
+{
+public:
+virtual css::uno::Reference init() = 0;
+virtual ~TextDocumentIndex();
+void testDocumentIndexProperties();
+};
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/test/text/textdocumentsettings.hxx 
b/include/test/text/textdocumentsettings.hxx
new file mode 100644
index ..e7a28a2f158f
--- /dev/null
+++ b/include/test/text/textdocumentsettings.hxx
@@ -0,0 +1,29 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not 

[Libreoffice-commits] core.git: include/test sw/CppunitTest_sw_apitests.mk sw/qa test/Library_subsequenttest.mk test/source

2019-03-16 Thread Libreoffice Gerrit user
 include/test/lang/xcomponent.hxx |   39 ++
 sw/CppunitTest_sw_apitests.mk|2 
 sw/qa/api/SwXTextTable.cxx   |   81 +++
 test/Library_subsequenttest.mk   |1 
 test/source/lang/xcomponent.cxx  |   71 ++
 5 files changed, 194 insertions(+)

New commits:
commit e4600ec9339e4a301e50874b1bafb87f55a54a80
Author: Bjoern Michaelsen 
AuthorDate: Tue Mar 12 00:05:22 2019 +0100
Commit: Björn Michaelsen 
CommitDate: Sat Mar 16 23:36:10 2019 +0100

Component test

Change-Id: I03785b3126671629011d5e62925a5658ab5ec2f7
Reviewed-on: https://gerrit.libreoffice.org/69067
Tested-by: Jenkins
Reviewed-by: Björn Michaelsen 

diff --git a/include/test/lang/xcomponent.hxx b/include/test/lang/xcomponent.hxx
new file mode 100644
index ..347a36e2925c
--- /dev/null
+++ b/include/test/lang/xcomponent.hxx
@@ -0,0 +1,39 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef INCLUDED_TEST_LANG_XCOMPONENT_HXX
+#define INCLUDED_TEST_LANG_XCOMPONENT_HXX
+
+#include 
+#include 
+#include 
+
+#include 
+
+namespace apitest
+{
+class OOO_DLLPUBLIC_TEST XComponent
+{
+public:
+virtual css::uno::Reference init() = 0;
+virtual void triggerDesktopTerminate() = 0;
+
+void testAddEventListener();
+void testRemoveEventListener();
+void testDisposedByDesktopTerminate();
+
+protected:
+~XComponent() {}
+};
+
+} // namespace apitest
+
+#endif // INCLUDED_TEST_LANG_XCOMPONENT_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/sw/CppunitTest_sw_apitests.mk b/sw/CppunitTest_sw_apitests.mk
index b601b948d82f..1f850da50efc 100644
--- a/sw/CppunitTest_sw_apitests.mk
+++ b/sw/CppunitTest_sw_apitests.mk
@@ -16,6 +16,7 @@ $(eval $(call 
gb_CppunitTest_use_external,sw_apitests,boost_headers))
 $(eval $(call gb_CppunitTest_add_exception_objects,sw_apitests, \
 sw/qa/api/SwXDocumentIndex \
 sw/qa/api/DocumentSettings \
+sw/qa/api/SwXTextTable \
 ))
 
 $(eval $(call gb_CppunitTest_use_libraries,sw_apitests, \
@@ -41,6 +42,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sw_apitests, \
 svt \
 svx \
 svxcore \
+subsequenttest \
 test \
 tl \
 tk \
diff --git a/sw/qa/api/SwXTextTable.cxx b/sw/qa/api/SwXTextTable.cxx
new file mode 100644
index ..e35de37c0024
--- /dev/null
+++ b/sw/qa/api/SwXTextTable.cxx
@@ -0,0 +1,81 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include "XTextContentTest.hxx"
+
+#include 
+#include 
+#include 
+
+#include 
+//#include 
+
+#include 
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+using namespace css;
+using namespace css::uno;
+
+namespace
+{
+/**
+ * Initial tests for SwXTextTable.
+ */
+struct SwXTextTable final : public test::BootstrapFixture,
+public unotest::MacrosTest,
+public apitest::XComponent
+{
+virtual void setUp() override;
+
+Reference init() override;
+void triggerDesktopTerminate() override;
+
+CPPUNIT_TEST_SUITE(SwXTextTable);
+CPPUNIT_TEST(testAddEventListener);
+CPPUNIT_TEST(testRemoveEventListener);
+CPPUNIT_TEST(testDisposedByDesktopTerminate);
+CPPUNIT_TEST_SUITE_END();
+};
+
+void SwXTextTable::setUp()
+{
+test::BootstrapFixture::setUp();
+mxDesktop.set(
+
frame::Desktop::create(comphelper::getComponentContext(getMultiServiceFactory(;
+}
+
+void SwXTextTable::triggerDesktopTerminate() { mxDesktop->terminate(); }
+
+Reference SwXTextTable::init()
+{
+auto xComponent = loadFromDesktop("private:factory/swriter", 
"com.sun.star.text.TextDocument");
+CPPUNIT_ASSERT(xComponent.is());
+Reference xTextDocument(xComponent, UNO_QUERY_THROW);
+Reference xMSF(xComponent, UNO_QUERY_THROW);
+Reference xText = xTextDocument->getText();
+Reference xCursor = xText->createTextCursor();
+Reference 
xTable(xMSF->createInstance("com.sun.star.text.TextTable"),
+   UNO_QUERY_THROW);
+xTable->initialize(4, 3);
+xText->insertTextContent(xCursor, xTable, false);
+CPPUNIT_ASSERT(xCursor.is());
+return Reference(xTable, UNO_QUERY_THROW);
+}
+
+CPPUNIT_TEST_SUITE_REGISTRATION(SwXTextTable);
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 

[Libreoffice-commits] core.git: include/test sc/qa

2019-03-16 Thread Libreoffice Gerrit user
 include/test/container/xnamereplace.hxx |6 +-
 sc/qa/extras/scautoformatsobj.cxx   |2 +-
 sc/qa/extras/scstylefamilyobj.cxx   |2 +-
 3 files changed, 3 insertions(+), 7 deletions(-)

New commits:
commit c7aed551abd2f8c80ce3fb2c3ab652c8a7c7135a
Author: Jens Carl 
AuthorDate: Sat Mar 16 18:07:11 2019 +
Commit: Jens Carl 
CommitDate: Sat Mar 16 21:03:11 2019 +0100

Fix typo

Change-Id: I5e75f430090e6812d82146c88e7b687d6c6fcffa
Reviewed-on: https://gerrit.libreoffice.org/69344
Tested-by: Jenkins
Reviewed-by: Jens Carl 

diff --git a/include/test/container/xnamereplace.hxx 
b/include/test/container/xnamereplace.hxx
index e10d198794ff..ddfbb4027eb7 100644
--- a/include/test/container/xnamereplace.hxx
+++ b/include/test/container/xnamereplace.hxx
@@ -31,11 +31,7 @@ public:
 virtual css::uno::Reference init() = 0;
 void testReplaceByName();
 
-void setReplacmentElement(const css::uno::Any& rElement)
-{
-m_aReplacementElement = rElement;
-}
-
+void setReplacementElement(const css::uno::Any& rElement) { 
m_aReplacementElement = rElement; }
 
 protected:
 ~XNameReplace() {}
diff --git a/sc/qa/extras/scautoformatsobj.cxx 
b/sc/qa/extras/scautoformatsobj.cxx
index c3c1f30b0468..f9dece97320b 100644
--- a/sc/qa/extras/scautoformatsobj.cxx
+++ b/sc/qa/extras/scautoformatsobj.cxx
@@ -70,7 +70,7 @@ uno::Reference ScAutoFormatsObj::init()
   
uno::makeAny(xMSF->createInstance("com.sun.star.sheet.TableAutoFormat")));
 }
 // XNameReplace
-
setReplacmentElement(uno::makeAny(xMSF->createInstance("com.sun.star.sheet.TableAutoFormat")));
+
setReplacementElement(uno::makeAny(xMSF->createInstance("com.sun.star.sheet.TableAutoFormat")));
 
 return xTAF;
 }
diff --git a/sc/qa/extras/scstylefamilyobj.cxx 
b/sc/qa/extras/scstylefamilyobj.cxx
index aa49cb34580a..731a4e26b59b 100644
--- a/sc/qa/extras/scstylefamilyobj.cxx
+++ b/sc/qa/extras/scstylefamilyobj.cxx
@@ -109,7 +109,7 @@ uno::Reference ScStyleFamilyObj::init()
 // XNameContainer
 
setElement(uno::makeAny(xMSF->createInstance("com.sun.star.style.CellStyle")));
 // XNameReplace
-
setReplacmentElement(uno::makeAny(xMSF->createInstance("com.sun.star.style.CellStyle")));
+
setReplacementElement(uno::makeAny(xMSF->createInstance("com.sun.star.style.CellStyle")));
 
 uno::Reference xNC(xNA_SF, 
uno::UNO_QUERY_THROW);
 xNC->insertByName("ScStyleFamilyObj", uno::makeAny(xCS));
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: include/test qadevOOo/Jar_OOoRunner.mk qadevOOo/objdsc qadevOOo/tests sc/qa test/source

2019-03-08 Thread Libreoffice Gerrit user
 include/test/sheet/cellarealink.hxx   |   18 +
 qadevOOo/Jar_OOoRunner.mk |1 
 qadevOOo/objdsc/sc/com.sun.star.comp.office.ScAreaLinkObj.csv |3 
 qadevOOo/tests/java/mod/_sc/ScAreaLinkObj.java|  117 --
 sc/qa/extras/scarealinkobj.cxx|   11 
 sc/qa/extras/testdocuments/scarealinkobj.ods  |binary
 sc/qa/unoapi/sc_2.sce |1 
 test/source/sheet/cellarealink.cxx|   44 ++-
 test/source/sheet/xarealink.cxx   |   13 -
 9 files changed, 56 insertions(+), 152 deletions(-)

New commits:
commit fe632c86aa250bb355a59ce6acf4dd75eae7afe0
Author: Jens Carl 
AuthorDate: Fri Mar 8 22:48:04 2019 +
Commit: Jens Carl 
CommitDate: Sat Mar 9 02:52:05 2019 +0100

tdf#45904 Move XRefreshable Java tests to C++

Move XRefreshable Java tests to C++ for ScAreaLinkObj.
To make this test work, had to provide parameter aSourceArea (in this
case file sc/qa/extras/testdocuments/scarealinkobj.ods). All the other
depended tests of ScAreaLinkObj had to adjusted to the new test
environment.
Also fixes i84711, because the XRefreshable test runs independent from
the other tests, as mentioned in the bug description.

Change-Id: I8847813431e2fdd60ed95be0f7d115bcaeafe500
Reviewed-on: https://gerrit.libreoffice.org/68949
Tested-by: Jenkins
Reviewed-by: Jens Carl 

diff --git a/include/test/sheet/cellarealink.hxx 
b/include/test/sheet/cellarealink.hxx
index a5f63747d316..6eff944ae7be 100644
--- a/include/test/sheet/cellarealink.hxx
+++ b/include/test/sheet/cellarealink.hxx
@@ -11,15 +11,22 @@
 #define INCLUDED_TEST_SHEET_CELLAREALINK_HXX
 
 #include 
+
 #include 
-#include 
 
-namespace apitest {
+#include 
+#include 
 
+namespace apitest
+{
 class OOO_DLLPUBLIC_TEST CellAreaLink
 {
 public:
-virtual css::uno::Reference< css::uno::XInterface > init() = 0;
+CellAreaLink(const OUString& rFileURL)
+: m_aFileURL(rFileURL)
+{
+}
+virtual css::uno::Reference init() = 0;
 
 void testUrl();
 void testFilter();
@@ -29,9 +36,12 @@ public:
 
 protected:
 ~CellAreaLink() {}
+
+private:
+OUString const m_aFileURL;
 };
 
-}
+} // namespace apitest
 
 #endif // INCLUDED_TEST_SHEET_CELLAREALINK_HXX
 
diff --git a/qadevOOo/Jar_OOoRunner.mk b/qadevOOo/Jar_OOoRunner.mk
index 2e025ea03057..d592ff21e77a 100644
--- a/qadevOOo/Jar_OOoRunner.mk
+++ b/qadevOOo/Jar_OOoRunner.mk
@@ -950,7 +950,6 @@ $(eval $(call gb_Jar_add_sourcefiles,OOoRunner,\
 qadevOOo/tests/java/mod/_sc/ScAccessibleSpreadsheet \
 qadevOOo/tests/java/mod/_sc/ScAnnotationShapeObj \
 qadevOOo/tests/java/mod/_sc/ScAnnotationTextCursor \
-qadevOOo/tests/java/mod/_sc/ScAreaLinkObj \
 qadevOOo/tests/java/mod/_sc/ScAutoFormatFieldObj \
 qadevOOo/tests/java/mod/_sc/ScAutoFormatObj \
 qadevOOo/tests/java/mod/_sc/ScAutoFormatsObj \
diff --git a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScAreaLinkObj.csv 
b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScAreaLinkObj.csv
deleted file mode 100644
index d5d82c8483f0..
--- a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScAreaLinkObj.csv
+++ /dev/null
@@ -1,3 +0,0 @@
-"ScAreaLinkObj";"com::sun::star::util::XRefreshable";"refresh()"
-"ScAreaLinkObj";"com::sun::star::util::XRefreshable";"addRefreshListener()"
-"ScAreaLinkObj";"com::sun::star::util::XRefreshable";"removeRefreshListener()"
diff --git a/qadevOOo/tests/java/mod/_sc/ScAreaLinkObj.java 
b/qadevOOo/tests/java/mod/_sc/ScAreaLinkObj.java
deleted file mode 100644
index f40eea8a509f..
--- a/qadevOOo/tests/java/mod/_sc/ScAreaLinkObj.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-package mod._sc;
-
-import java.io.PrintWriter;
-
-import lib.TestCase;
-import lib.TestEnvironment;
-import lib.TestParameters;
-import util.SOfficeFactory;
-
-import com.sun.star.beans.XPropertySet;
-import com.sun.star.lang.XComponent;
-import com.sun.star.sheet.XAreaLinks;
-import com.sun.star.sheet.XSpreadsheetDocument;
-import 

[Libreoffice-commits] core.git: include/test sc/qa test/source

2019-02-27 Thread Libreoffice Gerrit user
 include/test/container/xnamecontainer.hxx  |   43 ++
 sc/qa/extras/scdatapilotfieldgroupsobj.cxx |   12 +++-
 test/source/container/xnamecontainer.cxx   |   87 +
 3 files changed, 104 insertions(+), 38 deletions(-)

New commits:
commit 4b98337699e5e59a543d95c73ea7c64b3d9a1caf
Author: Jens Carl 
AuthorDate: Tue Feb 26 21:43:29 2019 +
Commit: Jens Carl 
CommitDate: Wed Feb 27 09:39:42 2019 +0100

Add missing XNameContainer tests to ScDataPilotFieldGroupsObj

Change-Id: Ia59b2a6136e2e56bf6c43a84e3cb6268471278a5
Reviewed-on: https://gerrit.libreoffice.org/68410
Tested-by: Jenkins
Reviewed-by: Jens Carl 

diff --git a/include/test/container/xnamecontainer.hxx 
b/include/test/container/xnamecontainer.hxx
index 9ff614473795..6c0b24d20e0d 100644
--- a/include/test/container/xnamecontainer.hxx
+++ b/include/test/container/xnamecontainer.hxx
@@ -1,4 +1,4 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
 /*
  * This file is part of the LibreOffice project.
  *
@@ -11,31 +11,50 @@
 #define INCLUDED_TEST_CONTAINER_XNAMECONTAINER_HXX
 
 #include 
-#include 
 #include 
 
-namespace apitest {
+#include 
+
+#include 
+#include 
 
+namespace apitest
+{
 class OOO_DLLPUBLIC_TEST XNameContainer
 {
 public:
 // removes default entry
-XNameContainer();
+XNameContainer()
+: m_aName("XNameContainer")
+{
+}
 // removes given entry
-XNameContainer(const OUString& rName);
-
-virtual css::uno::Reference< css::uno::XInterface > init() = 0;
-
+XNameContainer(const OUString& rNameToRemove)
+: m_aName(rNameToRemove)
+{
+}
+
+virtual css::uno::Reference init() = 0;
+virtual void setElement(const css::uno::Any& rElement) { m_aElement = 
rElement; }
+
+void testInsertByName();
+void testInsertByNameEmptyName();
+void testInsertByNameDuplicate();
+void testInsertByNameInvalidElement();
 void testRemoveByName();
+void testRemoveByNameEmptyName();
+void testRemoveByNameNoneExistingElement();
 
-virtual ~XNameContainer() {}
+protected:
+~XNameContainer() {}
 
 private:
-OUString const maNameToRemove;
+OUString const m_aName;
+css::uno::Any m_aElement;
 };
 
-}
+} // namespace apitest
 
 #endif // INCLUDED_TEST_CONTAINER_XNAMECONTAINER_HXX
 
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/sc/qa/extras/scdatapilotfieldgroupsobj.cxx 
b/sc/qa/extras/scdatapilotfieldgroupsobj.cxx
index 228075df34fd..9a9fdcb7e102 100644
--- a/sc/qa/extras/scdatapilotfieldgroupsobj.cxx
+++ b/sc/qa/extras/scdatapilotfieldgroupsobj.cxx
@@ -1,4 +1,4 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
 /*
  * This file is part of the LibreOffice project.
  *
@@ -80,7 +80,11 @@ public:
 CPPUNIT_TEST(testHasByName);
 
 // XNameContainer
+CPPUNIT_TEST(testInsertByName);
+CPPUNIT_TEST(testInsertByNameEmptyName);
 CPPUNIT_TEST(testRemoveByName);
+CPPUNIT_TEST(testRemoveByNameEmptyName);
+CPPUNIT_TEST(testRemoveByNameNoneExistingElement);
 
 // XServiceInfo
 CPPUNIT_TEST(testGetImplementationName);
@@ -199,6 +203,10 @@ uno::Reference 
ScDataPilotFieldGroupItemObj::init()
 }
 }
 
+// set element for testing XNameContainer::insertByName()
+uno::Any aElement;
+setElement(aElement);
+
 return aDPFGI.Groups;
 }
 
@@ -221,4 +229,4 @@ 
CPPUNIT_TEST_SUITE_REGISTRATION(ScDataPilotFieldGroupItemObj);
 
 CPPUNIT_PLUGIN_IMPLEMENT();
 
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/test/source/container/xnamecontainer.cxx 
b/test/source/container/xnamecontainer.cxx
index fefc5d35530e..c871debaecce 100644
--- a/test/source/container/xnamecontainer.cxx
+++ b/test/source/container/xnamecontainer.cxx
@@ -1,4 +1,4 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
 /*
  * This file is part of the LibreOffice project.
  *
@@ -8,47 +8,86 @@
  */
 
 #include 
+
+#include 
+#include 
 #include 
+#include 
 #include 
 
+#include 
+#include 
+
 #include 
+
 #include 
 
 using namespace css;
-using namespace css::uno;
 
-namespace apitest {
+namespace apitest
+{
+void XNameContainer::testInsertByName()
+{
+uno::Reference xNameContainer(init(), 
uno::UNO_QUERY_THROW);
 
-XNameContainer::XNameContainer(): maNameToRemove("XNameContainer")
+CPPUNIT_ASSERT(!xNameContainer->hasByName(m_aName + "Insert"));
+

[Libreoffice-commits] core.git: include/test sc/qa solenv/clang-format test/Library_subsequenttest.mk test/source

2019-01-29 Thread Libreoffice Gerrit user
 include/test/sheet/xsheetfilterdescriptor.hxx  |   13 +++
 include/test/sheet/xsheetfilterdescriptor2.hxx |   35 
 include/test/sheet/xsheetfilterdescriptor3.hxx |   35 
 sc/qa/extras/scfilterdescriptorbase.cxx|   14 +++-
 solenv/clang-format/blacklist  |2 -
 test/Library_subsequenttest.mk |2 +
 test/source/sheet/xsheetfilterdescriptor.cxx   |   29 
 test/source/sheet/xsheetfilterdescriptor2.cxx  |   43 +
 test/source/sheet/xsheetfilterdescriptor3.cxx  |   43 +
 9 files changed, 192 insertions(+), 24 deletions(-)

New commits:
commit ce2b98580b9f36d6f358bd2c9c027d3d82cb33d7
Author: Jens Carl 
AuthorDate: Tue Jan 29 21:32:14 2019 +
Commit: Jens Carl 
CommitDate: Tue Jan 29 23:57:08 2019 +0100

Add XSheetFilterDescriptor2 and XSheetFilterDescriptor3 tests

Add XSheetFilterDescriptor2 and XSheetFilterDescriptor3 tests
to ScFilterDescriptorBase.

Change-Id: I932560c42d9c5f3077f47f116f6ae011f6aea79e
Reviewed-on: https://gerrit.libreoffice.org/67097
Tested-by: Jenkins
Reviewed-by: Jens Carl 

diff --git a/include/test/sheet/xsheetfilterdescriptor.hxx 
b/include/test/sheet/xsheetfilterdescriptor.hxx
index 3a4a6a695c1b..65620f0f0936 100644
--- a/include/test/sheet/xsheetfilterdescriptor.hxx
+++ b/include/test/sheet/xsheetfilterdescriptor.hxx
@@ -1,4 +1,4 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
 /*
  * This file is part of the LibreOffice project.
  *
@@ -10,18 +10,17 @@
 #ifndef INCLUDED_TEST_SHEET_XSHEETFILTERDESCRIPTOR_HXX
 #define INCLUDED_TEST_SHEET_XSHEETFILTERDESCRIPTOR_HXX
 
-
 #include 
 #include 
 
 #include 
 
-namespace apitest {
-
+namespace apitest
+{
 class OOO_DLLPUBLIC_TEST XSheetFilterDescriptor
 {
 public:
-virtual css::uno::Reference< css::uno::XInterface > init() =0;
+virtual css::uno::Reference init() = 0;
 
 void testGetSetFilterFields();
 
@@ -29,8 +28,8 @@ protected:
 ~XSheetFilterDescriptor() {}
 };
 
-}
+} // namespace apitest
 
 #endif // INCLUDED_TEST_SHEET_XSHEETFILTERDESCRIPTOR_HXX
 
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/include/test/sheet/xsheetfilterdescriptor2.hxx 
b/include/test/sheet/xsheetfilterdescriptor2.hxx
new file mode 100644
index ..7555c65cb3a5
--- /dev/null
+++ b/include/test/sheet/xsheetfilterdescriptor2.hxx
@@ -0,0 +1,35 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef INCLUDED_TEST_SHEET_XSHEETFILTERDESCRIPTOR2_HXX
+#define INCLUDED_TEST_SHEET_XSHEETFILTERDESCRIPTOR2_HXX
+
+#include 
+#include 
+
+#include 
+
+namespace apitest
+{
+class OOO_DLLPUBLIC_TEST XSheetFilterDescriptor2
+{
+public:
+virtual css::uno::Reference init() = 0;
+
+void testGetSetFilterFields2();
+
+protected:
+~XSheetFilterDescriptor2() {}
+};
+
+} // namespace apitest
+
+#endif // INCLUDED_TEST_SHEET_XSHEETFILTERDESCRIPTOR2_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/include/test/sheet/xsheetfilterdescriptor3.hxx 
b/include/test/sheet/xsheetfilterdescriptor3.hxx
new file mode 100644
index ..1d8f94087200
--- /dev/null
+++ b/include/test/sheet/xsheetfilterdescriptor3.hxx
@@ -0,0 +1,35 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef INCLUDED_TEST_SHEET_XSHEETFILTERDESCRIPTOR3_HXX
+#define INCLUDED_TEST_SHEET_XSHEETFILTERDESCRIPTOR3_HXX
+
+#include 
+#include 
+
+#include 
+
+namespace apitest
+{
+class OOO_DLLPUBLIC_TEST XSheetFilterDescriptor3
+{
+public:
+virtual css::uno::Reference init() = 0;
+
+void testGetSetFilterFields3();
+
+protected:
+~XSheetFilterDescriptor3() {}
+};
+
+} // namespace apitest
+
+#endif // INCLUDED_TEST_SHEET_XSHEETFILTERDESCRIPTOR3_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/sc/qa/extras/scfilterdescriptorbase.cxx 
b/sc/qa/extras/scfilterdescriptorbase.cxx
index c989e60b743b..7811d6c83bf1 100644
--- a/sc/qa/extras/scfilterdescriptorbase.cxx
+++ 

[Libreoffice-commits] core.git: include/test sc/CppunitTest_sc_ddelinkobj.mk sc/qa test/source

2019-01-29 Thread Libreoffice Gerrit user
 include/test/sheet/xddelink.hxx |6 ++
 sc/CppunitTest_sc_ddelinkobj.mk |1 +
 sc/qa/extras/scddelinkobj.cxx   |   32 +++-
 test/source/sheet/xddelink.cxx  |3 +--
 4 files changed, 35 insertions(+), 7 deletions(-)

New commits:
commit 3cacdf5b0f1a6285370d5b06ddec9bce770ea603
Author: Michael Stahl 
AuthorDate: Tue Jan 29 13:40:21 2019 +0100
Commit: Michael Stahl 
CommitDate: Tue Jan 29 17:02:17 2019 +0100

sc: fix CppunitTest_sc_ddelinkobj to copy its test document

XRefreshable::testRefreshListener() fails on read-only filesystem
because the ScDDELinksObj.ods cannot be loaded read-write.

It is loaded read-write since commit
5b2794e27a81f8078cc251580ca59cc47807c7a0.

Change-Id: I27b954b216acd3d138ade0d3f1b21fedd2f74fb1
Reviewed-on: https://gerrit.libreoffice.org/67071
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/include/test/sheet/xddelink.hxx b/include/test/sheet/xddelink.hxx
index fa974ea321d8..854462a0dc1c 100644
--- a/include/test/sheet/xddelink.hxx
+++ b/include/test/sheet/xddelink.hxx
@@ -27,7 +27,13 @@ public:
 void testGetTopic();
 
 protected:
+explicit XDDELink(OUString const& rURL)
+: m_URL(rURL)
+{
+}
 ~XDDELink() {}
+
+OUString const m_URL;
 };
 } // namespace apitest
 
diff --git a/sc/CppunitTest_sc_ddelinkobj.mk b/sc/CppunitTest_sc_ddelinkobj.mk
index c59cf6e96360..60ab216aaca4 100644
--- a/sc/CppunitTest_sc_ddelinkobj.mk
+++ b/sc/CppunitTest_sc_ddelinkobj.mk
@@ -23,6 +23,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sc_ddelinkobj, \
subsequenttest \
test \
unotest \
+   utl \
vcl \
 ))
 
diff --git a/sc/qa/extras/scddelinkobj.cxx b/sc/qa/extras/scddelinkobj.cxx
index 0aa2e968c58e..4d1838a3b321 100644
--- a/sc/qa/extras/scddelinkobj.cxx
+++ b/sc/qa/extras/scddelinkobj.cxx
@@ -12,6 +12,7 @@
 #include 
 #include 
 
+#include 
 #include 
 
 #include 
@@ -33,7 +34,29 @@ using namespace com::sun::star;
 
 namespace sc_apitest
 {
+static utl::TempFile createTempCopy(OUString const& url)
+{
+utl::TempFile tmp;
+tmp.EnableKillingFile();
+auto const e = osl::File::copy(url, tmp.GetURL());
+CPPUNIT_ASSERT_EQUAL_MESSAGE(
+(OUStringToOString("<" + url + "> -> <" + tmp.GetURL() + ">", 
RTL_TEXTENCODING_UTF8)
+ .getStr()),
+osl::FileBase::E_None, e);
+return tmp;
+}
+
+struct TempFileBase
+{
+utl::TempFile m_TempFile;
+explicit TempFileBase(OUString const& url)
+: m_TempFile(createTempCopy(url))
+{
+}
+};
+
 class ScDDELinkObj : public CalcUnoApiTest,
+ public TempFileBase,
  public apitest::XDDELink,
  public apitest::XNamed,
  public apitest::XRefreshable
@@ -67,9 +90,9 @@ private:
 
 ScDDELinkObj::ScDDELinkObj()
 : CalcUnoApiTest("/sc/qa/extras/testdocuments")
-, XNamed("soffice|"
- + 
m_directories.getURLFromSrc("/sc/qa/unoapi/testdocuments/ScDDELinksObj.ods")
- + "!Sheet1.A1")
+, 
TempFileBase(m_directories.getURLFromSrc("/sc/qa/unoapi/testdocuments/ScDDELinksObj.ods"))
+, XDDELink(m_TempFile.GetURL())
+, XNamed("soffice|" + m_TempFile.GetURL() + "!Sheet1.A1")
 {
 }
 
@@ -81,8 +104,7 @@ uno::Reference ScDDELinkObj::init()
 uno::Reference xIA(xSheets, UNO_QUERY_THROW);
 uno::Reference xSheet(xIA->getByIndex(0), 
UNO_QUERY_THROW);
 
-const OUString testdoc
-= 
m_directories.getURLFromSrc("/sc/qa/unoapi/testdocuments/ScDDELinksObj.ods");
+const OUString testdoc = m_TempFile.GetURL();
 
 xSheet->getCellByPosition(5, 5)->setFormula("=DDE(\"soffice\";\"" + testdoc
 + "\";\"Sheet1.A1\")");
diff --git a/test/source/sheet/xddelink.cxx b/test/source/sheet/xddelink.cxx
index b166275d5367..4227c3b4c9a4 100644
--- a/test/source/sheet/xddelink.cxx
+++ b/test/source/sheet/xddelink.cxx
@@ -37,8 +37,7 @@ void XDDELink::testGetTopic()
 {
 uno::Reference xLink(init(), UNO_QUERY_THROW);
 
-CPPUNIT_ASSERT_MESSAGE("Unable to execute getTopic()",
-   xLink->getTopic().endsWith("ScDDELinksObj.ods"));
+CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to execute getTopic()", m_URL, 
xLink->getTopic());
 }
 } // namespace apitest
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/test qadevOOo/objdsc sc/qa test/Library_subsequenttest.mk test/source

2019-01-28 Thread Libreoffice Gerrit user
 include/test/text/xsimpletext.hxx |   36 ++
 qadevOOo/objdsc/sc/com.sun.star.comp.office.ScCellObj.csv |4 
 sc/qa/extras/sccellobj.cxx|   54 +
 test/Library_subsequenttest.mk|1 
 test/source/text/xsimpletext.cxx  |   76 ++
 5 files changed, 145 insertions(+), 26 deletions(-)

New commits:
commit ecc855aa1c86d88a99c3be06c70ed382180be688
Author: Ajay Mahato 
AuthorDate: Mon Jan 21 23:14:15 2019 +0530
Commit: Jens Carl 
CommitDate: Tue Jan 29 01:02:34 2019 +0100

tdf#45904 Move XSimpleText Java tests to C++

Change-Id: I6232615f15b52a1f004a13ed97fc0b8002a22269
Reviewed-on: https://gerrit.libreoffice.org/66694
Tested-by: Jenkins
Reviewed-by: Jens Carl 

diff --git a/include/test/text/xsimpletext.hxx 
b/include/test/text/xsimpletext.hxx
new file mode 100644
index ..fca6d24a0d6a
--- /dev/null
+++ b/include/test/text/xsimpletext.hxx
@@ -0,0 +1,36 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef INCLUDED_TEST_TEXT_XSIMPLETEXT_HXX
+#define INCLUDED_TEST_TEXT_XSIMPLETEXT_HXX
+
+#include 
+
+#include 
+
+namespace apitest
+{
+class OOO_DLLPUBLIC_TEST XSimpleText
+{
+public:
+virtual css::uno::Reference init() = 0;
+
+void testCreateTextCursor();
+void testCreateTextCursorByRange();
+void testInsertString();
+void testInsertControlCharacter();
+
+protected:
+~XSimpleText() {}
+};
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScCellObj.csv 
b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScCellObj.csv
index 3be24423a38d..e31e938fe88b 100644
--- a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScCellObj.csv
+++ b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScCellObj.csv
@@ -109,10 +109,6 @@
 "ScCellObj";"com::sun::star::text::XTextRangeMover#optional";"moveTextRange()"
 
"ScCellObj";"com::sun::star::text::XTextRangeCompare#optional";"compareRegionStarts()"
 
"ScCellObj";"com::sun::star::text::XTextRangeCompare#optional";"compareRegionEnds()"
-"ScCellObj";"com::sun::star::text::XSimpleText";"createTextCursor()"
-"ScCellObj";"com::sun::star::text::XSimpleText";"createTextCursorByRange()"
-"ScCellObj";"com::sun::star::text::XSimpleText";"insertString()"
-"ScCellObj";"com::sun::star::text::XSimpleText";"insertControlCharacter()"
 "ScCellObj";"com::sun::star::sheet::XCellRangesQuery";"queryVisibleCells()"
 "ScCellObj";"com::sun::star::sheet::XCellRangesQuery";"queryEmptyCells()"
 "ScCellObj";"com::sun::star::sheet::XCellRangesQuery";"queryContentCells()"
diff --git a/sc/qa/extras/sccellobj.cxx b/sc/qa/extras/sccellobj.cxx
index cb1c5a1421fd..51d7b0ce22b1 100644
--- a/sc/qa/extras/sccellobj.cxx
+++ b/sc/qa/extras/sccellobj.cxx
@@ -10,11 +10,12 @@
 #include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
+#include 
 #include 
+#include 
 #include 
 
 #include 
@@ -25,27 +26,30 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 using namespace css;
 using namespace css::uno;
 
-namespace sc_apitest {
-
-class ScCellObj : public CalcUnoApiTest, public apitest::SheetCell,
- public apitest::XCell,
- public apitest::XCellAddressable,
- public apitest::XColumnRowRange,
- public apitest::XEnumerationAccess,
- public apitest::XFormulaQuery,
- public apitest::XIndent,
- public apitest::XSheetAnnotationAnchor
+namespace sc_apitest
+{
+class ScCellObj : public CalcUnoApiTest,
+  public apitest::SheetCell,
+  public apitest::XCell,
+  public apitest::XCellAddressable,
+  public apitest::XColumnRowRange,
+  public apitest::XEnumerationAccess,
+  public apitest::XFormulaQuery,
+  public apitest::XIndent,
+  public apitest::XSheetAnnotationAnchor,
+  public apitest::XSimpleText
 {
 public:
 ScCellObj();
 
-virtual uno::Reference< uno::XInterface > init() override;
-virtual uno::Reference< uno::XInterface > getXSpreadsheet() override;
+virtual uno::Reference init() override;
+virtual uno::Reference getXSpreadsheet() override;
 virtual void setUp() override;
 virtual void tearDown() override;
 
@@ -81,23 +85,30 @@ public:
 // XSheetAnnotationAnchor
 

[Libreoffice-commits] core.git: include/test qadevOOo/objdsc sc/qa solenv/clang-format test/source

2019-01-25 Thread Libreoffice Gerrit user
 include/test/sheet/xnamedranges.hxx  |   31 +-
 qadevOOo/objdsc/sc/com.sun.star.comp.office.ScNamedRangesObj.csv |1 
 sc/qa/extras/scnamedrangesobj.cxx|   51 ++--
 solenv/clang-format/blacklist|3 
 test/source/sheet/xnamedranges.cxx   |  124 
--
 5 files changed, 118 insertions(+), 92 deletions(-)

New commits:
commit 412fbb6f017a12b423ae7e98fb7a56971084185e
Author: Jens Carl 
AuthorDate: Fri Jan 25 22:58:02 2019 +
Commit: Jens Carl 
CommitDate: Sat Jan 26 02:12:24 2019 +0100

tdf#45904 Move XEnumerationAccess Java test to C++

Move XEnumerationAccess Java test to C++ for ScNamedRangesObj.

Change-Id: Ia19281b8e481eda2535eb6f26c60dedc65f1beec
Reviewed-on: https://gerrit.libreoffice.org/66933
Tested-by: Jenkins
Reviewed-by: Jens Carl 

diff --git a/include/test/sheet/xnamedranges.hxx 
b/include/test/sheet/xnamedranges.hxx
index 9e750c333f45..3ce90f8f3401 100644
--- a/include/test/sheet/xnamedranges.hxx
+++ b/include/test/sheet/xnamedranges.hxx
@@ -10,23 +10,33 @@
 #ifndef INCLUDED_TEST_SHEET_XNAMEDRANGES_HXX
 #define INCLUDED_TEST_SHEET_XNAMEDRANGES_HXX
 
-#include 
 #include 
-#include 
 
-namespace apitest {
+#include 
+
+#include 
+#include 
+#include 
 
+namespace apitest
+{
 class OOO_DLLPUBLIC_TEST XNamedRanges
 {
 public:
 // remove default entry
-XNamedRanges();
-// removes given entry
-XNamedRanges(const OUString& rNameToRemove);
+XNamedRanges()
+: maNameToRemove("initial1")
+{
+}
 
-virtual ~XNamedRanges();
+// removes given entry
+XNamedRanges(const OUString& rNameToRemove)
+: maNameToRemove(rNameToRemove)
+{
+}
 
-virtual css::uno::Reference< css::uno::XInterface > init(sal_Int32 nSheets 
= 0) = 0;
+virtual css::uno::Reference init() = 0;
+virtual css::uno::Reference 
getXNamedRanges(sal_Int32 nSheet = 0) = 0;
 
 // XNamedRanges
 void testAddNewByName();
@@ -35,13 +45,14 @@ public:
 void testOutputList();
 
 protected:
-css::uno::Reference< css::sheet::XSpreadsheet > xSheet;
+~XNamedRanges(){};
+css::uno::Reference xSheet;
 
 private:
 OUString const maNameToRemove;
 };
 
-}
+} // namespace apitest
 
 #endif // INCLUDED_TEST_SHEET_XNAMEDRANGES_HXX
 
diff --git a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScNamedRangesObj.csv 
b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScNamedRangesObj.csv
index 815f57b9b10e..da83532fe621 100644
--- a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScNamedRangesObj.csv
+++ b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScNamedRangesObj.csv
@@ -5,4 +5,3 @@
 "ScNamedRangesObj";"com::sun::star::container::XIndexAccess";"getByIndex()"
 
"ScNamedRangesObj";"com::sun::star::container::XElementAccess";"getElementType()"
 "ScNamedRangesObj";"com::sun::star::container::XElementAccess";"hasElements()"
-"ScNamedRangesObj";"com::sun::star::container::XEnumerationAccess";"createEnumeration()"
diff --git a/sc/qa/extras/scnamedrangesobj.cxx 
b/sc/qa/extras/scnamedrangesobj.cxx
index dd08cbb01743..d09ad0dcc40b 100644
--- a/sc/qa/extras/scnamedrangesobj.cxx
+++ b/sc/qa/extras/scnamedrangesobj.cxx
@@ -8,18 +8,24 @@
  */
 
 #include 
+#include 
 #include 
 
-#include 
 #include 
 #include 
+#include 
+#include 
+
+#include 
 
 using namespace css;
 using namespace css::uno;
 
-namespace sc_apitest {
-
-class ScNamedRangesObj : public CalcUnoApiTest, public apitest::XNamedRanges
+namespace sc_apitest
+{
+class ScNamedRangesObj : public CalcUnoApiTest,
+ public apitest::XEnumerationAccess,
+ public apitest::XNamedRanges
 {
 public:
 ScNamedRangesObj();
@@ -27,10 +33,14 @@ public:
 virtual void setUp() override;
 virtual void tearDown() override;
 
-virtual uno::Reference< uno::XInterface > init(sal_Int32 nSheet = 0) 
override;
+virtual uno::Reference init() override;
+virtual uno::Reference getXNamedRanges(sal_Int32 nSheet = 
0) override;
 
 CPPUNIT_TEST_SUITE(ScNamedRangesObj);
 
+// XEnumerationAccess
+CPPUNIT_TEST(testCreateEnumeration);
+
 // XNamedRanges
 CPPUNIT_TEST(testAddNewByName);
 CPPUNIT_TEST(testAddNewFromTitles);
@@ -40,24 +50,37 @@ public:
 CPPUNIT_TEST_SUITE_END();
 
 private:
-uno::Reference< lang::XComponent > mxComponent;
+uno::Reference mxComponent;
 };
 
 ScNamedRangesObj::ScNamedRangesObj()
- : CalcUnoApiTest("/sc/qa/extras/testdocuments")
+: CalcUnoApiTest("/sc/qa/extras/testdocuments")
 {
 }
 
-uno::Reference< uno::XInterface > ScNamedRangesObj::init(sal_Int32 nSheet)
+uno::Reference ScNamedRangesObj::init()
 {
-CPPUNIT_ASSERT_MESSAGE("no component loaded", mxComponent.is());
+uno::Reference xPropSet(mxComponent, UNO_QUERY_THROW);
+uno::Reference 
xNamedRanges(xPropSet->getPropertyValue("NamedRanges"),
+

[Libreoffice-commits] core.git: include/test sc/qa test/Library_subsequenttest.mk test/source

2019-01-25 Thread Libreoffice Gerrit user
 include/test/sheet/xmultiformulatokens.hxx |   39 +
 sc/qa/extras/sctablevalidationobj.cxx  |6 +++
 test/Library_subsequenttest.mk |1 
 test/source/sheet/xmultiformulatokens.cxx  |   44 +
 4 files changed, 90 insertions(+)

New commits:
commit 059a958a65e064b701a74f6cb87e295b13ffbd0e
Author: Jens Carl 
AuthorDate: Fri Jan 25 03:16:29 2019 +
Commit: Jens Carl 
CommitDate: Fri Jan 25 14:55:18 2019 +0100

Add XMultiFormulaTokens tests to ScTableValidationObj

Change-Id: I6239cfba2b275c5f0b8794e30d57d1835ed569fa
Reviewed-on: https://gerrit.libreoffice.org/66892
Tested-by: Jenkins
Reviewed-by: Jens Carl 

diff --git a/include/test/sheet/xmultiformulatokens.hxx 
b/include/test/sheet/xmultiformulatokens.hxx
new file mode 100644
index ..8f883a32071b
--- /dev/null
+++ b/include/test/sheet/xmultiformulatokens.hxx
@@ -0,0 +1,39 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef INCLUDED_TEST_SHEET_XMULTIFORMULATOKENS_HXX
+#define INCLUDED_TEST_SHEET_XMULTIFORMULATOKENS_HXX
+
+#include 
+
+#include 
+
+#include 
+
+namespace apitest
+{
+class OOO_DLLPUBLIC_TEST XMultiFormulaTokens
+{
+public:
+virtual css::uno::Reference init() = 0;
+virtual void setUp() = 0;
+virtual void tearDown() = 0;
+
+void testGetCount();
+void testGetSetTokens();
+
+protected:
+~XMultiFormulaTokens() {}
+};
+
+} // namespace apitest
+
+#endif // INCLUDED_TEST_SHEET_XMULTIFORMULATOKENS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/sc/qa/extras/sctablevalidationobj.cxx 
b/sc/qa/extras/sctablevalidationobj.cxx
index e2fed2e9ca2e..6eb5e58d2987 100644
--- a/sc/qa/extras/sctablevalidationobj.cxx
+++ b/sc/qa/extras/sctablevalidationobj.cxx
@@ -12,6 +12,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -33,6 +34,7 @@ namespace sc_apitest
 {
 class ScTableValidationObj : public CalcUnoApiTest,
  public apitest::TableValidation,
+ public apitest::XMultiFormulaTokens,
  public apitest::XPropertySet,
  public apitest::XServiceInfo,
  public apitest::XSheetCondition
@@ -49,6 +51,10 @@ public:
 // TableValidation
 CPPUNIT_TEST(testTableValidationProperties);
 
+// XMultiFormulaTokens
+CPPUNIT_TEST(testGetCount);
+CPPUNIT_TEST(testGetSetTokens);
+
 // XPropertySet
 CPPUNIT_TEST(testGetPropertySetInfo);
 CPPUNIT_TEST(testSetPropertyValue);
diff --git a/test/Library_subsequenttest.mk b/test/Library_subsequenttest.mk
index 5ea8ade69775..e3f3bce700bb 100644
--- a/test/Library_subsequenttest.mk
+++ b/test/Library_subsequenttest.mk
@@ -113,6 +113,7 @@ $(eval $(call 
gb_Library_add_exception_objects,subsequenttest,\
test/source/sheet/xheaderfootercontent \
test/source/sheet/xlabelrange \
test/source/sheet/xlabelranges \
+   test/source/sheet/xmultiformulatokens \
test/source/sheet/xmultipleoperation \
test/source/sheet/xnamedrange \
test/source/sheet/xnamedranges \
diff --git a/test/source/sheet/xmultiformulatokens.cxx 
b/test/source/sheet/xmultiformulatokens.cxx
new file mode 100644
index ..3478c0188602
--- /dev/null
+++ b/test/source/sheet/xmultiformulatokens.cxx
@@ -0,0 +1,44 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include 
+
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+
+using namespace css;
+
+namespace apitest
+{
+void XMultiFormulaTokens::testGetCount()
+{
+uno::Reference xMFT(init(), 
uno::UNO_QUERY_THROW);
+
+CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xMFT->getCount());
+}
+
+void XMultiFormulaTokens::testGetSetTokens()
+{
+uno::Reference xMFT(init(), 
uno::UNO_QUERY_THROW);
+
+uno::Sequence aTokens(1);
+aTokens[0].OpCode = 2;
+xMFT->setTokens(0, aTokens);
+
+CPPUNIT_ASSERT_EQUAL(aTokens[0].OpCode, xMFT->getTokens(0)[0].OpCode);
+}
+
+} // namespace apitest
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org

[Libreoffice-commits] core.git: include/test sc/qa test/source

2019-01-25 Thread Libreoffice Gerrit user
 include/test/beans/xpropertyset.hxx   |4 ++--
 sc/qa/extras/sctablevalidationobj.cxx |4 ++--
 test/source/beans/xpropertyset.cxx|4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 3e36b6b1fc13b34dd82c79998bd1f73b8c7f15f8
Author: Jens Carl 
AuthorDate: Fri Jan 25 03:26:21 2019 +
Commit: Julien Nabet 
CommitDate: Fri Jan 25 14:24:06 2019 +0100

Fix typos

Change-Id: I57e99100d76d64bd9a7cf27016bbb02de9ed9d6a
Reviewed-on: https://gerrit.libreoffice.org/66893
Tested-by: Jenkins
Reviewed-by: Julien Nabet 

diff --git a/include/test/beans/xpropertyset.hxx 
b/include/test/beans/xpropertyset.hxx
index 72827aa6ee76..dbfac0a2e86c 100644
--- a/include/test/beans/xpropertyset.hxx
+++ b/include/test/beans/xpropertyset.hxx
@@ -36,8 +36,8 @@ public:
 void testGetPropertySetInfo();
 void testSetPropertyValue();
 void testGetPropertyValue();
-void testPropertyChangeListner();
-void testVetoableChangeListner();
+void testPropertyChangeListener();
+void testVetoableChangeListener();
 
 protected:
 ~XPropertySet(){};
diff --git a/sc/qa/extras/sctablevalidationobj.cxx 
b/sc/qa/extras/sctablevalidationobj.cxx
index 8ba211c43cc6..e2fed2e9ca2e 100644
--- a/sc/qa/extras/sctablevalidationobj.cxx
+++ b/sc/qa/extras/sctablevalidationobj.cxx
@@ -53,8 +53,8 @@ public:
 CPPUNIT_TEST(testGetPropertySetInfo);
 CPPUNIT_TEST(testSetPropertyValue);
 CPPUNIT_TEST(testGetPropertyValue);
-CPPUNIT_TEST(testPropertyChangeListner);
-CPPUNIT_TEST(testVetoableChangeListner);
+CPPUNIT_TEST(testPropertyChangeListener);
+CPPUNIT_TEST(testVetoableChangeListener);
 
 // XServiceInfo
 CPPUNIT_TEST(testGetImplementationName);
diff --git a/test/source/beans/xpropertyset.cxx 
b/test/source/beans/xpropertyset.cxx
index f0b6ac67e3b5..b67c485a17a7 100644
--- a/test/source/beans/xpropertyset.cxx
+++ b/test/source/beans/xpropertyset.cxx
@@ -76,7 +76,7 @@ public:
 virtual void SAL_CALL disposing(const lang::EventObject& /* xEventObj */) 
override {}
 };
 
-void XPropertySet::testPropertyChangeListner()
+void XPropertySet::testPropertyChangeListener()
 {
 uno::Reference xPropSet(init(), uno::UNO_QUERY_THROW);
 uno::Reference xPropInfo = 
xPropSet->getPropertySetInfo();
@@ -100,7 +100,7 @@ void XPropertySet::testPropertyChangeListner()
 }
 }
 
-void XPropertySet::testVetoableChangeListner()
+void XPropertySet::testVetoableChangeListener()
 {
 uno::Reference xPropSet(init(), uno::UNO_QUERY_THROW);
 uno::Reference xPropInfo = 
xPropSet->getPropertySetInfo();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/test qadevOOo/Jar_OOoRunner.mk qadevOOo/objdsc qadevOOo/tests sc/qa test/Library_subsequenttest.mk test/source

2019-01-24 Thread Libreoffice Gerrit user
 include/test/table/xtablechart.hxx |   37 ++
 qadevOOo/Jar_OOoRunner.mk  |1 
 qadevOOo/objdsc/sc/com.sun.star.comp.office.ScChartObj.csv |6 
 qadevOOo/tests/java/mod/_sc/ScChartObj.java|  234 -
 sc/qa/extras/scchartobj.cxx|9 
 sc/qa/unoapi/sc_3.sce  |1 
 test/Library_subsequenttest.mk |1 
 test/source/table/xtablechart.cxx  |   60 +++
 8 files changed, 106 insertions(+), 243 deletions(-)

New commits:
commit b5d2ebb76e763457a8c8f07b26d542295e82e192
Author: Jens Carl 
AuthorDate: Thu Jan 24 08:49:21 2019 +
Commit: Jens Carl 
CommitDate: Thu Jan 24 22:02:07 2019 +0100

tdf#45904 Move XTableChart Java tests to C++

Move XTableChart Java tests to C++ for ScChartObj.

Change-Id: I007d484357b5743a4283e9aa41bc6d203d312379
Reviewed-on: https://gerrit.libreoffice.org/66842
Tested-by: Jenkins
Reviewed-by: Jens Carl 

diff --git a/include/test/table/xtablechart.hxx 
b/include/test/table/xtablechart.hxx
new file mode 100644
index ..6c57bf3ac332
--- /dev/null
+++ b/include/test/table/xtablechart.hxx
@@ -0,0 +1,37 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef INCLUDED_TEST_TABLE_XTABLECHART_HXX
+#define INCLUDED_TEST_TABLE_XTABLECHART_HXX
+
+#include 
+
+#include 
+
+#include 
+
+namespace apitest
+{
+class OOO_DLLPUBLIC_TEST XTableChart
+{
+public:
+virtual css::uno::Reference init() = 0;
+
+void testGetSetHasColumnHeaders();
+void testGetSetHasRowHeaders();
+void testGetSetRanges();
+
+protected:
+~XTableChart() {}
+};
+} // namespace apitest
+
+#endif // INCLUDED_TEST_TABLE_XTABLECHART_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/qadevOOo/Jar_OOoRunner.mk b/qadevOOo/Jar_OOoRunner.mk
index 2828744ee90e..8a8374069326 100644
--- a/qadevOOo/Jar_OOoRunner.mk
+++ b/qadevOOo/Jar_OOoRunner.mk
@@ -962,7 +962,6 @@ $(eval $(call gb_Jar_add_sourcefiles,OOoRunner,\
 qadevOOo/tests/java/mod/_sc/ScCellRangesObj \
 qadevOOo/tests/java/mod/_sc/ScCellSearchObj \
 qadevOOo/tests/java/mod/_sc/ScCellTextCursor \
-qadevOOo/tests/java/mod/_sc/ScChartObj \
 qadevOOo/tests/java/mod/_sc/ScChartsObj \
 qadevOOo/tests/java/mod/_sc/ScDatabaseRangeObj \
 qadevOOo/tests/java/mod/_sc/ScDataPilotFieldGroupItemObj \
diff --git a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScChartObj.csv 
b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScChartObj.csv
deleted file mode 100644
index 921ae1ef8e1b..
--- a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScChartObj.csv
+++ /dev/null
@@ -1,6 +0,0 @@
-"ScChartObj";"com::sun::star::table::XTableChart";"getHasColumnHeaders()"
-"ScChartObj";"com::sun::star::table::XTableChart";"setHasColumnHeaders()"
-"ScChartObj";"com::sun::star::table::XTableChart";"getHasRowHeaders()"
-"ScChartObj";"com::sun::star::table::XTableChart";"setHasRowHeaders()"
-"ScChartObj";"com::sun::star::table::XTableChart";"getRanges()"
-"ScChartObj";"com::sun::star::table::XTableChart";"setRanges()"
diff --git a/qadevOOo/tests/java/mod/_sc/ScChartObj.java 
b/qadevOOo/tests/java/mod/_sc/ScChartObj.java
deleted file mode 100644
index d768ceb61128..
--- a/qadevOOo/tests/java/mod/_sc/ScChartObj.java
+++ /dev/null
@@ -1,234 +0,0 @@
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- *   Licensed to the Apache Software Foundation (ASF) under one or more
- *   contributor license agreements. See the NOTICE file distributed
- *   with this work for additional information regarding copyright
- *   ownership. The ASF licenses this file to you under the Apache
- *   License, Version 2.0 (the "License"); you may not use this file
- *   except in compliance with the License. You may obtain a copy of
- *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-package mod._sc;
-
-import java.io.PrintWriter;
-
-import lib.TestCase;
-import lib.TestEnvironment;
-import lib.TestParameters;
-import util.SOfficeFactory;
-
-import com.sun.star.awt.Rectangle;
-import com.sun.star.container.XIndexAccess;
-import com.sun.star.container.XNameAccess;
-import com.sun.star.lang.XComponent;
-import 

[Libreoffice-commits] core.git: include/test qadevOOo/objdsc sc/qa test/Library_subsequenttest.mk test/source

2019-01-24 Thread Libreoffice Gerrit user
 include/test/document/xembeddedobjectsupplier.hxx  |   35 +
 qadevOOo/objdsc/sc/com.sun.star.comp.office.ScChartObj.csv |1 
 sc/qa/extras/scchartobj.cxx|8 ++
 test/Library_subsequenttest.mk |1 
 test/source/document/xembeddedobjectsupplier.cxx   |   30 +++
 5 files changed, 73 insertions(+), 2 deletions(-)

New commits:
commit 9a2954f566b88c06c9e3aa34e1fa7e23200182ee
Author: Jens Carl 
AuthorDate: Thu Jan 24 08:17:56 2019 +
Commit: Jens Carl 
CommitDate: Thu Jan 24 18:42:23 2019 +0100

tdf#45904 Move XEmbeddedObjectSupplier Java test to C++

Move XEmbeddedObjectSupplier Java test to C++ for ScChartObj.

Change-Id: I125951e490719de225f1ac48d10b857c457fa529
Reviewed-on: https://gerrit.libreoffice.org/66839
Tested-by: Jenkins
Reviewed-by: Jens Carl 

diff --git a/include/test/document/xembeddedobjectsupplier.hxx 
b/include/test/document/xembeddedobjectsupplier.hxx
new file mode 100644
index ..b9caee190aec
--- /dev/null
+++ b/include/test/document/xembeddedobjectsupplier.hxx
@@ -0,0 +1,35 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef INCLUDED_TEST_DOCUMENT_XEMBEDDEDOBJECTSUPPLIER_HXX
+#define INCLUDED_TEST_DOCUMENT_XEMBEDDEDOBJECTSUPPLIER_HXX
+
+#include 
+
+#include 
+
+#include 
+
+namespace apitest
+{
+class OOO_DLLPUBLIC_TEST XEmbeddedObjectSupplier
+{
+public:
+virtual css::uno::Reference init() = 0;
+
+void testGetEmbeddedObject();
+
+protected:
+~XEmbeddedObjectSupplier() {}
+};
+} // namespace apitest
+
+#endif // INCLUDED_TEST_DOCUMENT_XEMBEDDEDOBJECTSUPPLIER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScChartObj.csv 
b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScChartObj.csv
index 6cc64619217c..921ae1ef8e1b 100644
--- a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScChartObj.csv
+++ b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScChartObj.csv
@@ -4,4 +4,3 @@
 "ScChartObj";"com::sun::star::table::XTableChart";"setHasRowHeaders()"
 "ScChartObj";"com::sun::star::table::XTableChart";"getRanges()"
 "ScChartObj";"com::sun::star::table::XTableChart";"setRanges()"
-"ScChartObj";"com::sun::star::document::XEmbeddedObjectSupplier";"getEmbeddedObject()"
diff --git a/sc/qa/extras/scchartobj.cxx b/sc/qa/extras/scchartobj.cxx
index c6ead1372d67..b4925ac43219 100644
--- a/sc/qa/extras/scchartobj.cxx
+++ b/sc/qa/extras/scchartobj.cxx
@@ -9,6 +9,7 @@
 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -33,7 +34,9 @@ using namespace css;
 
 namespace sc_apitest
 {
-class ScChartObj : public CalcUnoApiTest, public apitest::XNamed
+class ScChartObj : public CalcUnoApiTest,
+   public apitest::XEmbeddedObjectSupplier,
+   public apitest::XNamed
 {
 public:
 ScChartObj();
@@ -44,6 +47,9 @@ public:
 
 CPPUNIT_TEST_SUITE(ScChartObj);
 
+// XEmbeddedObjectSupplier
+CPPUNIT_TEST(testGetEmbeddedObject);
+
 // XNamed
 CPPUNIT_TEST(testGetName);
 CPPUNIT_TEST(testSetNameThrowsException);
diff --git a/test/Library_subsequenttest.mk b/test/Library_subsequenttest.mk
index 80e8f0be7952..14faf49f6e57 100644
--- a/test/Library_subsequenttest.mk
+++ b/test/Library_subsequenttest.mk
@@ -51,6 +51,7 @@ $(eval $(call 
gb_Library_add_exception_objects,subsequenttest,\
test/source/container/xnamecontainer \
test/source/container/xnamed \
test/source/container/xnamereplace \
+   test/source/document/xembeddedobjectsupplier \
test/source/document/xlinktargetsupplier \
test/source/drawing/captionshape \
test/source/drawing/xdrawpages \
diff --git a/test/source/document/xembeddedobjectsupplier.cxx 
b/test/source/document/xembeddedobjectsupplier.cxx
new file mode 100644
index ..8a0ce9b32d55
--- /dev/null
+++ b/test/source/document/xembeddedobjectsupplier.cxx
@@ -0,0 +1,30 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include 
+
+#include 
+
+#include 
+
+#include 
+
+using namespace css;
+
+namespace apitest
+{
+void XEmbeddedObjectSupplier::testGetEmbeddedObject()
+{
+uno::Reference xEOS(init(), 
uno::UNO_QUERY_THROW);
+
+CPPUNIT_ASSERT(xEOS->getEmbeddedObject());
+}
+} 

[Libreoffice-commits] core.git: include/test qadevOOo/objdsc sc/qa test/Library_subsequenttest.mk test/source

2019-01-21 Thread Libreoffice Gerrit user
 include/test/drawing/xdrawpages.hxx|   37 +++
 qadevOOo/objdsc/sc/com.sun.star.comp.office.ScDrawPagesObj.csv |2 
 sc/qa/extras/scdrawpagesobj.cxx|6 +
 test/Library_subsequenttest.mk |3 
 test/source/drawing/xdrawpages.cxx |   49 
++
 5 files changed, 94 insertions(+), 3 deletions(-)

New commits:
commit fd8a724d22c92e3ebef4a3da126baaac3d3bde79
Author: Jens Carl 
AuthorDate: Tue Jan 22 04:33:17 2019 +
Commit: Jens Carl 
CommitDate: Tue Jan 22 07:18:17 2019 +0100

tdf#45904 Move XDrawPages Java tests to C++

Move XDrawPages Java tests to C++ for ScDrawPagesObj.

Change-Id: I0e48aae9caadf0d9834c4f973095ba9d10435fdc
Reviewed-on: https://gerrit.libreoffice.org/66712
Tested-by: Jenkins
Reviewed-by: Jens Carl 

diff --git a/include/test/drawing/xdrawpages.hxx 
b/include/test/drawing/xdrawpages.hxx
new file mode 100644
index ..b6430df6026b
--- /dev/null
+++ b/include/test/drawing/xdrawpages.hxx
@@ -0,0 +1,37 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef INCLUDED_TEST_DRAWING_XDRAWPAGES_HXX
+#define INCLUDED_TEST_DRAWING_XDRAWPAGES_HXX
+
+#include 
+
+#include 
+
+#include 
+
+namespace apitest
+{
+class OOO_DLLPUBLIC_TEST XDrawPages
+{
+public:
+virtual css::uno::Reference init() = 0;
+
+virtual void testInsertNewByIndex();
+virtual void testRemove();
+
+protected:
+~XDrawPages() {}
+};
+
+} // namespace apitest
+
+#endif // INCLUDED_TEST_DRAWING_XDRAWPAGES_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScDrawPagesObj.csv 
b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScDrawPagesObj.csv
index 11ce9966a95a..844f27507b3e 100644
--- a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScDrawPagesObj.csv
+++ b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScDrawPagesObj.csv
@@ -1,4 +1,2 @@
-"ScDrawPagesObj";"com::sun::star::drawing::XDrawPages";"insertNewByIndex()"
-"ScDrawPagesObj";"com::sun::star::drawing::XDrawPages";"remove()"
 
"ScDrawPagesObj";"com::sun::star::drawing::XDrawPageExpander#optional";"expand()"
 
"ScDrawPagesObj";"com::sun::star::drawing::XDrawPageSummarizer#optional";"summarize()"
diff --git a/sc/qa/extras/scdrawpagesobj.cxx b/sc/qa/extras/scdrawpagesobj.cxx
index 9a40d417791e..16ba202fb19b 100644
--- a/sc/qa/extras/scdrawpagesobj.cxx
+++ b/sc/qa/extras/scdrawpagesobj.cxx
@@ -10,6 +10,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -28,6 +29,7 @@ using namespace css::uno;
 namespace sc_apitest
 {
 class ScDrawPagesObj : public CalcUnoApiTest,
+   public apitest::XDrawPages,
public apitest::XElementAccess,
public apitest::XIndexAccess
 {
@@ -40,6 +42,10 @@ public:
 
 CPPUNIT_TEST_SUITE(ScDrawPagesObj);
 
+// XDrawPages
+CPPUNIT_TEST(testInsertNewByIndex);
+CPPUNIT_TEST(testRemove);
+
 // XElementAccess
 CPPUNIT_TEST(testGetElementType);
 CPPUNIT_TEST(testHasElements);
diff --git a/test/Library_subsequenttest.mk b/test/Library_subsequenttest.mk
index 43c4593efaca..80e8f0be7952 100644
--- a/test/Library_subsequenttest.mk
+++ b/test/Library_subsequenttest.mk
@@ -51,8 +51,9 @@ $(eval $(call 
gb_Library_add_exception_objects,subsequenttest,\
test/source/container/xnamecontainer \
test/source/container/xnamed \
test/source/container/xnamereplace \
-   test/source/drawing/captionshape \
test/source/document/xlinktargetsupplier \
+   test/source/drawing/captionshape \
+   test/source/drawing/xdrawpages \
test/source/lang/xserviceinfo \
test/source/sheet/cellarealink \
test/source/sheet/cellproperties \
diff --git a/test/source/drawing/xdrawpages.cxx 
b/test/source/drawing/xdrawpages.cxx
new file mode 100644
index ..5fe89abfb348
--- /dev/null
+++ b/test/source/drawing/xdrawpages.cxx
@@ -0,0 +1,49 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include 
+
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+
+using namespace css;
+using namespace css::uno;
+
+namespace apitest
+{
+void XDrawPages::testInsertNewByIndex()
+{
+

[Libreoffice-commits] core.git: include/test sc/qa test/Library_subsequenttest.mk test/source

2019-01-17 Thread Libreoffice Gerrit user
 include/test/sheet/xddelinks.hxx |   44 +++
 sc/qa/extras/scddelinksobj.cxx   |6 +
 test/Library_subsequenttest.mk   |1 
 test/source/sheet/xddelinks.cxx  |   41 
 4 files changed, 92 insertions(+)

New commits:
commit eee8c16a5c541fd355e7e6fe3b25c3f36d2f6eb8
Author: Jens Carl 
AuthorDate: Thu Jan 17 23:25:30 2019 +
Commit: Jens Carl 
CommitDate: Fri Jan 18 08:41:38 2019 +0100

Add XDDELinks tests to ScDDELinksObj

Change-Id: I9e6efbd5a1cd9e4787e8143dd4f8adbe6ab2cae7
Reviewed-on: https://gerrit.libreoffice.org/66561
Tested-by: Jenkins
Reviewed-by: Jens Carl 

diff --git a/include/test/sheet/xddelinks.hxx b/include/test/sheet/xddelinks.hxx
new file mode 100644
index ..8ceb07cdd39e
--- /dev/null
+++ b/include/test/sheet/xddelinks.hxx
@@ -0,0 +1,44 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef INCLUDED_TEST_SHEET_XDDELINKS_HXX
+#define INCLUDED_TEST_SHEET_XDDELINKS_HXX
+
+#include 
+
+#include 
+#include 
+
+#include 
+
+namespace apitest
+{
+class OOO_DLLPUBLIC_TEST XDDELinks
+{
+public:
+XDDELinks(const OUString& rTopic)
+: m_aTopic(rTopic)
+{
+}
+
+virtual css::uno::Reference init() = 0;
+
+void testAddDDELink();
+
+protected:
+~XDDELinks() {}
+
+private:
+OUString const m_aTopic;
+};
+} // namespace apitest
+
+#endif // INCLUDED_TEST_SHEET_XDDELINKS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/sc/qa/extras/scddelinksobj.cxx b/sc/qa/extras/scddelinksobj.cxx
index 721478ba839d..bc62f4cfbc2d 100644
--- a/sc/qa/extras/scddelinksobj.cxx
+++ b/sc/qa/extras/scddelinksobj.cxx
@@ -13,6 +13,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -38,6 +39,7 @@ using namespace com::sun::star;
 namespace sc_apitest
 {
 class ScDDELinksObj : public CalcUnoApiTest,
+  public apitest::XDDELinks,
   public apitest::XElementAccess,
   public apitest::XEnumerationAccess,
   public apitest::XIndexAccess,
@@ -53,6 +55,9 @@ public:
 
 CPPUNIT_TEST_SUITE(ScDDELinksObj);
 
+// XDDELinks
+CPPUNIT_TEST(testAddDDELink);
+
 // XElementAccess
 CPPUNIT_TEST(testGetElementType);
 CPPUNIT_TEST(testHasElements);
@@ -82,6 +87,7 @@ private:
 
 ScDDELinksObj::ScDDELinksObj()
 : CalcUnoApiTest("/sc/qa/extras/testdocuments")
+, 
XDDELinks(m_directories.getURLFromSrc("/sc/qa/unoapi/testdocuments/ScDDELinksObj.ods"))
 , XElementAccess(cppu::UnoType::get())
 , XIndexAccess(1)
 , XNameAccess("soffice|"
diff --git a/test/Library_subsequenttest.mk b/test/Library_subsequenttest.mk
index 081763980f95..43c4593efaca 100644
--- a/test/Library_subsequenttest.mk
+++ b/test/Library_subsequenttest.mk
@@ -103,6 +103,7 @@ $(eval $(call 
gb_Library_add_exception_objects,subsequenttest,\
test/source/sheet/xdatapilottables \
test/source/sheet/xdatapilottablessupplier \
test/source/sheet/xddelink \
+   test/source/sheet/xddelinks \
test/source/sheet/xdocumentauditing \
test/source/sheet/xformulaquery \
test/source/sheet/xfunctiondescriptions \
diff --git a/test/source/sheet/xddelinks.cxx b/test/source/sheet/xddelinks.cxx
new file mode 100644
index ..1115a29b828b
--- /dev/null
+++ b/test/source/sheet/xddelinks.cxx
@@ -0,0 +1,41 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include 
+
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+
+using namespace css;
+using namespace css::uno;
+
+namespace apitest
+{
+void XDDELinks::testAddDDELink()
+{
+uno::Reference xLinks(init(), UNO_QUERY_THROW);
+
+uno::Reference xLink
+= xLinks->addDDELink("soffice", m_aTopic, "Sheet1.A1", 
sheet::DDELinkMode_DEFAULT);
+
+CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to execute getApplication()", 
OUString("soffice"),
+ xLink->getApplication());
+CPPUNIT_ASSERT_MESSAGE("Unable to execute getTopic()",
+   xLink->getTopic().endsWith("ScDDELinksObj.ods"));
+CPPUNIT_ASSERT_EQUAL_MESSAGE("Unable to execute getItem()", 
OUString("Sheet1.A1"),
+ xLink->getItem());
+}
+} // namespace 

[Libreoffice-commits] core.git: include/test sc/CppunitTest_sc_styleloaderobj.mk sc/Module_sc.mk sc/qa solenv/clang-format test/Library_subsequenttest.mk test/source

2019-01-16 Thread Libreoffice Gerrit user
 include/test/sheet/xstyleloader.hxx |   45 
 include/test/style/xstyleloader.hxx |   50 ++
 sc/CppunitTest_sc_styleloaderobj.mk |   43 ---
 sc/Module_sc.mk |1 
 sc/qa/extras/scstylefamiliesobj.cxx |   37 +
 sc/qa/extras/scstyleloaderobj.cxx   |   99 
 solenv/clang-format/blacklist   |3 -
 test/Library_subsequenttest.mk  |2 
 test/source/sheet/xstyleloader.cxx  |   97 ---
 test/source/style/xstyleloader.cxx  |   93 +
 10 files changed, 180 insertions(+), 290 deletions(-)

New commits:
commit 7b7cc20d83f48a0d114f3e726c9d5710aabc1a4c
Author: Jens Carl 
AuthorDate: Wed Jan 16 02:22:58 2019 +
Commit: Jens Carl 
CommitDate: Wed Jan 16 18:57:49 2019 +0100

Move XStyleLoader2 tests to ScStyleFamiliesObj

Change-Id: Ibba0464d17a9517eb48f3f33b46db2455093ac52
Reviewed-on: https://gerrit.libreoffice.org/66413
Tested-by: Jenkins
Reviewed-by: Jens Carl 

diff --git a/include/test/sheet/xstyleloader.hxx 
b/include/test/sheet/xstyleloader.hxx
deleted file mode 100644
index 02ec28e5bf0e..
--- a/include/test/sheet/xstyleloader.hxx
+++ /dev/null
@@ -1,45 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- */
-
-#ifndef INCLUDED_TEST_SHEET_XSTYLELOADER_HXX
-#define INCLUDED_TEST_SHEET_XSTYLELOADER_HXX
-
-#include 
-#include 
-#include 
-
-#include 
-
-namespace apitest {
-
-class OOO_DLLPUBLIC_TEST XStyleLoader
-{
-public:
-virtual css::uno::Reference< css::uno::XInterface > init() = 0;
-
-virtual OUString getTestURL() = 0;
-virtual css::uno::Reference< css::lang::XComponent  > getTargetComponent() 
= 0;
-virtual css::uno::Reference< css::lang::XComponent > getSourceComponent() 
= 0;
-
-// XStyleLoader
-void testLoadStylesFromURL();
-// XStyleLoader2
-void testLoadStylesFromDocument();
-
-private:
-static void checkStyleProperties(css::uno::Reference< 
css::style::XStyleFamiliesSupplier > const & xFamilySupplier);
-
-protected:
-~XStyleLoader() {}
-
-};
-
-}
-
-#endif // INCLUDED_TEST_SHEET_XSTYLELOADER_HXX
diff --git a/include/test/style/xstyleloader.hxx 
b/include/test/style/xstyleloader.hxx
new file mode 100644
index ..4077d30327d0
--- /dev/null
+++ b/include/test/style/xstyleloader.hxx
@@ -0,0 +1,50 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef INCLUDED_TEST_STYLE_XSTYLELOADER_HXX
+#define INCLUDED_TEST_STYLE_XSTYLELOADER_HXX
+
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+#include 
+#include 
+
+namespace apitest
+{
+class OOO_DLLPUBLIC_TEST XStyleLoader
+{
+public:
+virtual css::uno::Reference init() = 0;
+virtual css::uno::Reference 
getTargetDoc() = 0;
+virtual css::uno::Reference getSourceComponent() = 
0;
+virtual OUString getTestURL() = 0;
+
+// XStyleLoader
+void testLoadStylesFromURL();
+// XStyleLoader2
+void testLoadStylesFromDocument();
+
+private:
+static void checkStyleProperties(
+css::uno::Reference const& 
xFamilySupplier);
+
+protected:
+~XStyleLoader() {}
+};
+
+} // namespace apitest
+
+#endif // INCLUDED_TEST_STYLE_XSTYLELOADER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/sc/CppunitTest_sc_styleloaderobj.mk 
b/sc/CppunitTest_sc_styleloaderobj.mk
deleted file mode 100644
index 61e1bdb552bf..
--- a/sc/CppunitTest_sc_styleloaderobj.mk
+++ /dev/null
@@ -1,43 +0,0 @@
-# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
-#*
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-#*
-
-$(eval $(call gb_CppunitTest_CppunitTest,sc_styleloaderobj))
-
-$(eval $(call gb_CppunitTest_use_external,sc_styleloaderobj,boost_headers))
-
-$(eval $(call gb_CppunitTest_add_exception_objects,sc_styleloaderobj, \
-   sc/qa/extras/scstyleloaderobj \
-))
-
-$(eval $(call 

[Libreoffice-commits] core.git: include/test sw/CppunitTest_sw_apitests.mk sw/qa test/source

2019-01-10 Thread Libreoffice Gerrit user
 include/test/unoapi_property_testers.hxx |   20 
 sw/CppunitTest_sw_apitests.mk|1 
 sw/qa/api/ApiTestBase.hxx|   29 ++
 sw/qa/api/DocumentSettings.cxx   |   99 +
 sw/qa/api/DocumentSettingsTest.hxx   |   49 ++
 sw/qa/api/PrinterSettingsTest.hxx|   81 +
 sw/qa/api/SettingsTest.hxx   |  140 +++
 test/source/unoapi_property_testers.cxx  |   26 +
 8 files changed, 445 insertions(+)

New commits:
commit 4631c5d4c129b826df1cc29af1a558149b823667
Author: Tomaž Vajngerl 
AuthorDate: Sun Jan 6 21:59:21 2019 +0100
Commit: Tomaž Vajngerl 
CommitDate: Thu Jan 10 20:11:21 2019 +0100

DocumentSettings Writer UNO API test (converted from Java test)

Change-Id: Id9a691b1aae62f37ef7f865c5ed015b7c6a13976
Reviewed-on: https://gerrit.libreoffice.org/65909
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 

diff --git a/include/test/unoapi_property_testers.hxx 
b/include/test/unoapi_property_testers.hxx
index f45b772b86e3..4d83e8179ce4 100644
--- a/include/test/unoapi_property_testers.hxx
+++ b/include/test/unoapi_property_testers.hxx
@@ -75,6 +75,16 @@ void OOO_DLLPUBLIC_TEST
 testLongProperty(css::uno::Reference const& 
xPropertySet,
  const OUString& name, const sal_Int32& nValue = 42);
 
+/** @brief Tester for optional property type 'long' of a @see 
com::sun::star::beans::XPropertySet.
+ *
+ * @param   xPropertySetThe property set, which contains the property to 
test against.
+ * @param   nameName of property to test.
+ * @param   nValue  Value to use when setting a new value.
+ */
+void OOO_DLLPUBLIC_TEST
+testLongOptionalProperty(css::uno::Reference const& 
xPropertySet,
+ const OUString& name, const sal_Int32& nValue = 42);
+
 /** @brief Tester for read-only property type 'long' of a @see 
com::sun::star::beans::XPropertySet.
  *
  * @param   xPropertySetThe property set, which contains the property to 
test against.
@@ -95,6 +105,16 @@ void OOO_DLLPUBLIC_TEST
 testShortProperty(css::uno::Reference const& 
xPropertySet,
   const OUString& name, const sal_Int16& nValue = 42);
 
+/** @brief Tester for optional property type 'short' of a @see 
com::sun::star::beans::XPropertySet.
+ *
+ * @param   xPropertySetThe property set, which contains the property to 
test against.
+ * @param   nameName of property to test.
+ * @param   nValue  Value to use when setting a new value.
+ */
+void OOO_DLLPUBLIC_TEST
+testShortOptionalProperty(css::uno::Reference const& 
xPropertySet,
+  const OUString& name, const sal_Int16& nValue = 42);
+
 /** @brief Tester for read-only property type 'short' of a @see 
com::sun::star::beans::XPropertySet.
  *
  * @param   xPropertySetThe property set, which contains the property to 
test against.
diff --git a/sw/CppunitTest_sw_apitests.mk b/sw/CppunitTest_sw_apitests.mk
index fa0fc26e7d20..595a1940e27f 100644
--- a/sw/CppunitTest_sw_apitests.mk
+++ b/sw/CppunitTest_sw_apitests.mk
@@ -15,6 +15,7 @@ $(eval $(call 
gb_CppunitTest_use_external,sw_apitests,boost_headers))
 
 $(eval $(call gb_CppunitTest_add_exception_objects,sw_apitests, \
 sw/qa/api/SwXDocumentIndex \
+sw/qa/api/DocumentSettings \
 ))
 
 $(eval $(call gb_CppunitTest_use_libraries,sw_apitests, \
diff --git a/sw/qa/api/ApiTestBase.hxx b/sw/qa/api/ApiTestBase.hxx
index 7687ff3f..fc25bc3122be 100644
--- a/sw/qa/api/ApiTestBase.hxx
+++ b/sw/qa/api/ApiTestBase.hxx
@@ -11,6 +11,9 @@
 #define INCLUDED_SW_QA_CORE_APITESTBASE_HXX
 
 #include 
+#include 
+#include 
+#include 
 
 #include 
 
@@ -19,6 +22,32 @@ namespace apitest
 class ApiTestBase
 {
 protected:
+static bool extstsProperty(css::uno::Reference 
const& rxPropertySet,
+   OUString const& rPropertyName)
+{
+css::uno::Reference xPropertySetInfo(
+rxPropertySet->getPropertySetInfo());
+return xPropertySetInfo->hasPropertyByName(rPropertyName);
+}
+
+static bool
+isPropertyReadOnly(css::uno::Reference const& 
rxPropertySet,
+   OUString const& rPropertyName)
+{
+css::uno::Reference xPropertySetInfo(
+rxPropertySet->getPropertySetInfo());
+css::uno::Sequence xProperties = 
xPropertySetInfo->getProperties();
+
+for (auto const& rProperty : xProperties)
+{
+if (rProperty.Name == rPropertyName)
+return (rProperty.Attributes & 
com::sun::star::beans::PropertyAttribute::READONLY)
+   != 0;
+}
+
+return false;
+}
+
 virtual ~ApiTestBase() {}
 
 virtual std::unordered_map> init() = 0;
diff --git a/sw/qa/api/DocumentSettings.cxx b/sw/qa/api/DocumentSettings.cxx
new file mode 100644
index ..901730d0d65d
--- /dev/null
+++ 

[Libreoffice-commits] core.git: include/test sc/qa test/Library_subsequenttest.mk test/source

2018-12-18 Thread Libreoffice Gerrit user
 include/test/lang/xserviceinfo.hxx |   49 +
 sc/qa/extras/scscenariosobj.cxx|   10 ++-
 test/Library_subsequenttest.mk |1 
 test/source/lang/xserviceinfo.cxx  |   49 +
 4 files changed, 108 insertions(+), 1 deletion(-)

New commits:
commit 2b9739b9b009de93efa4f24995469c3bb9d82261
Author: Jens Carl 
AuthorDate: Tue Dec 18 19:14:13 2018 +
Commit: Jens Carl 
CommitDate: Tue Dec 18 23:55:18 2018 +0100

Add XServiceInfo tests to ScScenariosObj

Change-Id: I4d8fb95af78330d488e4b782eb8cdff5b83f1cc2
Reviewed-on: https://gerrit.libreoffice.org/65369
Tested-by: Jenkins
Reviewed-by: Jens Carl 

diff --git a/include/test/lang/xserviceinfo.hxx 
b/include/test/lang/xserviceinfo.hxx
new file mode 100644
index ..498e5ed8387f
--- /dev/null
+++ b/include/test/lang/xserviceinfo.hxx
@@ -0,0 +1,49 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef INCLUDED_TEST_LANG_XSERVICEINFO_HXX
+#define INCLUDED_TEST_LANG_XSERVICEINFO_HXX
+
+#include 
+
+#include 
+
+#include 
+#include 
+
+namespace apitest
+{
+class OOO_DLLPUBLIC_TEST XServiceInfo
+{
+public:
+XServiceInfo(const OUString& rImplName, const OUString& rServiceName)
+: m_aImplName(rImplName)
+, m_aServiceName(rServiceName)
+{
+}
+
+virtual css::uno::Reference init() = 0;
+
+void testGetImplementationName();
+void testGetSupportedServiceNames();
+void testSupportsService();
+
+protected:
+~XServiceInfo() {}
+
+private:
+OUString const m_aImplName;
+OUString const m_aServiceName;
+};
+
+} // namespace apitest
+
+#endif // INCLUDED_TEST_LANG_XSERVICEINFO_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/sc/qa/extras/scscenariosobj.cxx b/sc/qa/extras/scscenariosobj.cxx
index 22f35f10cb52..a379cf249ece 100644
--- a/sc/qa/extras/scscenariosobj.cxx
+++ b/sc/qa/extras/scscenariosobj.cxx
@@ -12,6 +12,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -43,7 +44,8 @@ class ScScenariosObj : public CalcUnoApiTest,
public apitest::XEnumerationAccess,
public apitest::XNameAccess,
public apitest::XIndexAccess,
-   public apitest::XScenarios
+   public apitest::XScenarios,
+   public apitest::XServiceInfo
 {
 public:
 ScScenariosObj();
@@ -74,6 +76,11 @@ public:
 CPPUNIT_TEST(testAddNewByName);
 CPPUNIT_TEST(testRemoveByName);
 
+// XServiceInfo
+CPPUNIT_TEST(testGetImplementationName);
+CPPUNIT_TEST(testGetSupportedServiceNames);
+CPPUNIT_TEST(testSupportsService);
+
 CPPUNIT_TEST_SUITE_END();
 
 private:
@@ -85,6 +92,7 @@ ScScenariosObj::ScScenariosObj()
 , XElementAccess(cppu::UnoType::get())
 , XNameAccess("ScScenarios")
 , XIndexAccess(1)
+, XServiceInfo("ScScenariosObj", "com.sun.star.sheet.Scenarios")
 {
 }
 
diff --git a/test/Library_subsequenttest.mk b/test/Library_subsequenttest.mk
index 1ce96cbd84ae..88edfeed9741 100644
--- a/test/Library_subsequenttest.mk
+++ b/test/Library_subsequenttest.mk
@@ -53,6 +53,7 @@ $(eval $(call 
gb_Library_add_exception_objects,subsequenttest,\
test/source/container/xnamereplace \
test/source/drawing/captionshape \
test/source/document/xlinktargetsupplier \
+   test/source/lang/xserviceinfo \
test/source/sheet/cellarealink \
test/source/sheet/cellproperties \
test/source/sheet/databaseimportdescriptor \
diff --git a/test/source/lang/xserviceinfo.cxx 
b/test/source/lang/xserviceinfo.cxx
new file mode 100644
index ..eeba62784b14
--- /dev/null
+++ b/test/source/lang/xserviceinfo.cxx
@@ -0,0 +1,49 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include 
+#include 
+
+#include 
+
+#include 
+#include 
+
+#include 
+
+using namespace css;
+using namespace css::uno;
+
+namespace apitest
+{
+void XServiceInfo::testGetImplementationName()
+{
+uno::Reference xSI(init(), uno::UNO_QUERY_THROW);
+
+CPPUNIT_ASSERT_EQUAL(m_aImplName, xSI->getImplementationName());
+}
+
+void XServiceInfo::testGetSupportedServiceNames()
+{
+uno::Reference xSI(init(), uno::UNO_QUERY_THROW);
+
+uno::Sequence 

[Libreoffice-commits] core.git: include/test

2018-12-18 Thread Libreoffice Gerrit user
 include/test/container/xnameaccess.hxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 3ff6f789b063fd24e8dd7cf956a8141ce3060d80
Author: Jens Carl 
AuthorDate: Tue Dec 18 18:32:59 2018 +
Commit: Jens Carl 
CommitDate: Tue Dec 18 22:57:41 2018 +0100

Add missing header

Change-Id: I4bc3f2743b2d57308e687eb37f78c625c2bdc184
Reviewed-on: https://gerrit.libreoffice.org/65364
Tested-by: Jenkins
Reviewed-by: Jens Carl 

diff --git a/include/test/container/xnameaccess.hxx 
b/include/test/container/xnameaccess.hxx
index 960cf67822b9..6ff525917380 100644
--- a/include/test/container/xnameaccess.hxx
+++ b/include/test/container/xnameaccess.hxx
@@ -14,6 +14,7 @@
 
 #include 
 
+#include 
 #include 
 
 namespace apitest
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: include/test sc/CppunitTest_sc_ddelinkobj.mk sc/qa test/source

2018-12-13 Thread Libreoffice Gerrit user
 include/test/util/xrefreshable.hxx |4 +---
 sc/CppunitTest_sc_ddelinkobj.mk|1 +
 sc/qa/extras/sccellfieldsobj.cxx   |4 +---
 sc/qa/extras/scddelinkobj.cxx  |   22 ++
 test/source/sheet/xddelink.cxx |6 +++---
 test/source/util/xrefreshable.cxx  |   22 +-
 6 files changed, 21 insertions(+), 38 deletions(-)

New commits:
commit c94ae40267ae3352e95911bcd1fb9f12f4a714a0
Author: Mike Kaganski 
AuthorDate: Thu Dec 13 12:02:32 2018 +0300
Commit: Mike Kaganski 
CommitDate: Thu Dec 13 17:17:22 2018 +0100

Fix sc_ddelinkobj tests

Regression from commit 63ff8602c16b0c26927dc3413b12a5368fe367b0.
See thread started at
  
https://lists.freedesktop.org/archives/libreoffice/2018-December/081542.html

The Application::SetName is mandatory for DDE to work; otherwise
InitializeDde() in SfxApplication::SfxApplication() fails.

DDE spreadsheet formula expects full name of the target spreadsheet,
including path.

Fixed sheet name (it's "Sheet1", not "Sheet").

Removed redundant tests (former "testRemoveRefreshListener" tests all).

Change-Id: I6299a9ec03c3657a21ad42d0ff87db25cf2be905
Reviewed-on: https://gerrit.libreoffice.org/65079
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 

diff --git a/include/test/util/xrefreshable.hxx 
b/include/test/util/xrefreshable.hxx
index 2ffab9946e4a..dd82303259ef 100644
--- a/include/test/util/xrefreshable.hxx
+++ b/include/test/util/xrefreshable.hxx
@@ -23,9 +23,7 @@ class OOO_DLLPUBLIC_TEST XRefreshable
 public:
 virtual css::uno::Reference init() = 0;
 
-void testAddRefreshListener();
-void testRefresh();
-void testRemoveRefreshListener();
+void testRefreshListener();
 
 protected:
 ~XRefreshable() {}
diff --git a/sc/CppunitTest_sc_ddelinkobj.mk b/sc/CppunitTest_sc_ddelinkobj.mk
index 123e4cf3a021..c59cf6e96360 100644
--- a/sc/CppunitTest_sc_ddelinkobj.mk
+++ b/sc/CppunitTest_sc_ddelinkobj.mk
@@ -23,6 +23,7 @@ $(eval $(call gb_CppunitTest_use_libraries,sc_ddelinkobj, \
subsequenttest \
test \
unotest \
+   vcl \
 ))
 
 $(eval $(call gb_CppunitTest_set_include,sc_ddelinkobj,\
diff --git a/sc/qa/extras/sccellfieldsobj.cxx b/sc/qa/extras/sccellfieldsobj.cxx
index b015b96f99b0..f1626527b063 100644
--- a/sc/qa/extras/sccellfieldsobj.cxx
+++ b/sc/qa/extras/sccellfieldsobj.cxx
@@ -56,9 +56,7 @@ public:
 CPPUNIT_TEST(testCreateEnumeration);
 
 // XRefreshable
-CPPUNIT_TEST(testAddRefreshListener);
-CPPUNIT_TEST(testRefresh);
-CPPUNIT_TEST(testRemoveRefreshListener);
+CPPUNIT_TEST(testRefreshListener);
 
 CPPUNIT_TEST_SUITE_END();
 
diff --git a/sc/qa/extras/scddelinkobj.cxx b/sc/qa/extras/scddelinkobj.cxx
index 204c5b6f8ace..0aa2e968c58e 100644
--- a/sc/qa/extras/scddelinkobj.cxx
+++ b/sc/qa/extras/scddelinkobj.cxx
@@ -12,6 +12,8 @@
 #include 
 #include 
 
+#include 
+
 #include 
 #include 
 #include 
@@ -55,9 +57,7 @@ public:
 CPPUNIT_TEST(testSetNameThrowsException);
 
 // XRefreshable
-CPPUNIT_TEST(testAddRefreshListener);
-CPPUNIT_TEST(testRefresh);
-CPPUNIT_TEST(testRemoveRefreshListener);
+CPPUNIT_TEST(testRefreshListener);
 
 CPPUNIT_TEST_SUITE_END();
 
@@ -67,7 +67,9 @@ private:
 
 ScDDELinkObj::ScDDELinkObj()
 : CalcUnoApiTest("/sc/qa/extras/testdocuments")
-, XNamed("soffice|ScDDELinksObj.ods!Sheet.A1")
+, XNamed("soffice|"
+ + 
m_directories.getURLFromSrc("/sc/qa/unoapi/testdocuments/ScDDELinksObj.ods")
+ + "!Sheet1.A1")
 {
 }
 
@@ -79,10 +81,13 @@ uno::Reference ScDDELinkObj::init()
 uno::Reference xIA(xSheets, UNO_QUERY_THROW);
 uno::Reference xSheet(xIA->getByIndex(0), 
UNO_QUERY_THROW);
 
-xSheet->getCellByPosition(5, 5)->setFormula(
-"=DDE(\"soffice\";\"ScDDELinksObj.ods\";\"Sheet.A1\"");
-xSheet->getCellByPosition(1, 4)->setFormula(
-"=DDE(\"soffice\";\"ScDDELinksObj.ods\";\"Sheet.A1\"");
+const OUString testdoc
+= 
m_directories.getURLFromSrc("/sc/qa/unoapi/testdocuments/ScDDELinksObj.ods");
+
+xSheet->getCellByPosition(5, 5)->setFormula("=DDE(\"soffice\";\"" + testdoc
++ "\";\"Sheet1.A1\")");
+xSheet->getCellByPosition(1, 4)->setFormula("=DDE(\"soffice\";\"" + testdoc
++ "\";\"Sheet1.A1\")");
 
 uno::Reference xPropSet(xDoc, UNO_QUERY_THROW);
 uno::Any aDDELinks = xPropSet->getPropertyValue("DDELinks");
@@ -94,6 +99,7 @@ uno::Reference ScDDELinkObj::init()
 
 void ScDDELinkObj::setUp()
 {
+Application::SetAppName("soffice"); // Enable DDE
 CalcUnoApiTest::setUp();
 // create a calc document
 mxComponent = loadFromDesktop("private:factory/scalc");
diff --git a/test/source/sheet/xddelink.cxx b/test/source/sheet/xddelink.cxx
index 403449452ba5..b166275d5367 100644
--- a/test/source/sheet/xddelink.cxx
+++ 

[Libreoffice-commits] core.git: include/test qadevOOo/objdsc sc/qa test/Library_subsequenttest.mk test/source

2018-12-05 Thread Libreoffice Gerrit user
 include/test/view/xcontrolaccess.hxx  |   35 ++
 qadevOOo/objdsc/sc/com.sun.star.comp.office.ScViewPaneObj.csv |1 
 sc/qa/extras/scviewpaneobj.cxx|   11 +
 test/Library_subsequenttest.mk|2 
 test/source/view/xcontrolaccess.cxx   |   56 ++
 5 files changed, 104 insertions(+), 1 deletion(-)

New commits:
commit 4cb874c1b068d45039d7eed6f47c5ae5229fa301
Author: Jens Carl 
AuthorDate: Wed Dec 5 05:01:27 2018 +
Commit: Jens Carl 
CommitDate: Wed Dec 5 18:47:23 2018 +0100

tdf#45904 Move XControlAccess Java test to C++

Move XControlAccess Java test to C++ for ScViewPaneObj.

Change-Id: If18596b41fccc140186820c9e370f502fb2b6458
Reviewed-on: https://gerrit.libreoffice.org/64606
Tested-by: Jenkins
Reviewed-by: Jens Carl 

diff --git a/include/test/view/xcontrolaccess.hxx 
b/include/test/view/xcontrolaccess.hxx
new file mode 100644
index ..b25cb169c377
--- /dev/null
+++ b/include/test/view/xcontrolaccess.hxx
@@ -0,0 +1,35 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef INCLUDED_TEST_VIEW_XCONTROLACCESS_HXX
+#define INCLUDED_TEST_VIEW_XCONTROLACCESS_HXX
+
+#include 
+#include 
+
+#include 
+
+namespace apitest
+{
+class OOO_DLLPUBLIC_TEST XControlAccess
+{
+public:
+virtual css::uno::Reference init() = 0;
+virtual css::uno::Reference getXComponent() = 0;
+
+void testGetControl();
+
+protected:
+~XControlAccess() {}
+};
+} // namespace apitest
+
+#endif // INCLUDED_TEST_VIEW_XCONTROLACCESS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s 
cinkeys+=0=break: */
diff --git a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScViewPaneObj.csv 
b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScViewPaneObj.csv
index fb9eba91fcf4..a4a3586f943f 100644
--- a/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScViewPaneObj.csv
+++ b/qadevOOo/objdsc/sc/com.sun.star.comp.office.ScViewPaneObj.csv
@@ -1,4 +1,3 @@
-"ScViewPaneObj";"com::sun::star::view::XControlAccess#optional";"getControl()"
 
"ScViewPaneObj";"com::sun::star::view::XFormLayerAccess#optional";"getFromController()"
 
"ScViewPaneObj";"com::sun::star::view::XFormLayerAccess#optional";"isFormDesignMode()"
 
"ScViewPaneObj";"com::sun::star::view::XFormLayerAccess#optional";"setFormDesignMode()"
diff --git a/sc/qa/extras/scviewpaneobj.cxx b/sc/qa/extras/scviewpaneobj.cxx
index 9aee4a553cd6..499cc7924f31 100644
--- a/sc/qa/extras/scviewpaneobj.cxx
+++ b/sc/qa/extras/scviewpaneobj.cxx
@@ -10,6 +10,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -26,12 +27,14 @@ namespace sc_apitest {
 
 class ScViewPaneObj : public CalcUnoApiTest,
   public apitest::XCellRangeReferrer,
+  public apitest::XControlAccess,
   public apitest::XViewPane
 {
 public:
 ScViewPaneObj();
 
 virtual uno::Reference< uno::XInterface > init() override;
+virtual uno::Reference< uno::XInterface > getXComponent() override;
 virtual void setUp() override;
 virtual void tearDown() override;
 
@@ -40,6 +43,9 @@ public:
 // XCellRangeReferrer
 CPPUNIT_TEST(testGetReferredCells);
 
+// XControlAccess
+CPPUNIT_TEST(testGetControl);
+
 // XViewPane
 CPPUNIT_TEST(testFirstVisibleColumn);
 CPPUNIT_TEST(testFirstVisibleRow);
@@ -56,6 +62,11 @@ ScViewPaneObj::ScViewPaneObj()
 {
 }
 
+uno::Reference ScViewPaneObj::getXComponent()
+{
+return mxComponent;
+}
+
 uno::Reference< uno::XInterface > ScViewPaneObj::init()
 {
 uno::Reference< sheet::XSpreadsheetDocument > xSheetDoc(mxComponent, 
uno::UNO_QUERY_THROW);
diff --git a/test/Library_subsequenttest.mk b/test/Library_subsequenttest.mk
index 78c2e7f6a727..1b71ab44270b 100644
--- a/test/Library_subsequenttest.mk
+++ b/test/Library_subsequenttest.mk
@@ -10,6 +10,7 @@
 $(eval $(call gb_Library_Library,subsequenttest))
 
 $(eval $(call gb_Library_set_include,subsequenttest,\
+   -I$(SRCDIR)/test/inc \
 $$(INCLUDE) \
 ))
 
@@ -162,6 +163,7 @@ $(eval $(call 
gb_Library_add_exception_objects,subsequenttest,\
test/source/util/xrefreshable \
test/source/util/xreplaceable \
test/source/util/xsearchable \
+   test/source/view/xcontrolaccess \
 ))
 
 # vim: set noet sw=4 ts=4:
diff --git a/test/source/view/xcontrolaccess.cxx 
b/test/source/view/xcontrolaccess.cxx
new file mode 100644
index ..29ca1fa339aa
--- /dev/null
+++ b/test/source/view/xcontrolaccess.cxx
@@ -0,0 +1,56 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 

  1   2   3   >