[Libreoffice-commits] core.git: 2 commits - configure.ac sw/qa

2022-06-15 Thread Xisco Fauli (via logerrit)
 configure.ac  |3 +-
 sw/qa/extras/uiwriter/data/tdf149507.docx |binary
 sw/qa/extras/uiwriter/uiwriter3.cxx   |   36 ++
 3 files changed, 38 insertions(+), 1 deletion(-)

New commits:
commit 1968563b1dec40f2134a04b1241178ae27b0d6bb
Author: Xisco Fauli 
AuthorDate: Tue Jun 14 12:22:10 2022 +0200
Commit: Xisco Fauli 
CommitDate: Wed Jun 15 08:42:18 2022 +0200

tdf#149507: sw_uiwriter3: Add unittest

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

diff --git a/sw/qa/extras/uiwriter/data/tdf149507.docx 
b/sw/qa/extras/uiwriter/data/tdf149507.docx
new file mode 100644
index ..83704edfb8b3
Binary files /dev/null and b/sw/qa/extras/uiwriter/data/tdf149507.docx differ
diff --git a/sw/qa/extras/uiwriter/uiwriter3.cxx 
b/sw/qa/extras/uiwriter/uiwriter3.cxx
index 1c7c4a87d3c5..619e5c032549 100644
--- a/sw/qa/extras/uiwriter/uiwriter3.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter3.cxx
@@ -131,6 +131,42 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf146848)
 CPPUNIT_ASSERT_EQUAL(4, nFieldsCount);
 }
 
+CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf149507)
+{
+createSwDoc(DATA_DIRECTORY, "tdf149507.docx");
+
+CPPUNIT_ASSERT_EQUAL(1, getShapes());
+CPPUNIT_ASSERT_EQUAL(1, getPages());
+
+dispatchCommand(mxComponent, ".uno:SelectAll", {});
+Scheduler::ProcessEventsToIdle();
+
+dispatchCommand(mxComponent, ".uno:Cut", {});
+Scheduler::ProcessEventsToIdle();
+
+CPPUNIT_ASSERT_EQUAL(0, getShapes());
+CPPUNIT_ASSERT_EQUAL(1, getPages());
+
+dispatchCommand(mxComponent, ".uno:Paste", {});
+Scheduler::ProcessEventsToIdle();
+
+CPPUNIT_ASSERT_EQUAL(1, getShapes());
+CPPUNIT_ASSERT_EQUAL(1, getPages());
+
+// Without the fix in place, this test would have crashed here
+dispatchCommand(mxComponent, ".uno:Undo", {});
+Scheduler::ProcessEventsToIdle();
+
+CPPUNIT_ASSERT_EQUAL(0, getShapes());
+CPPUNIT_ASSERT_EQUAL(1, getPages());
+
+dispatchCommand(mxComponent, ".uno:Undo", {});
+Scheduler::ProcessEventsToIdle();
+
+CPPUNIT_ASSERT_EQUAL(1, getShapes());
+CPPUNIT_ASSERT_EQUAL(1, getPages());
+}
+
 CPPUNIT_TEST_FIXTURE(SwUiWriterTest3, testTdf145321)
 {
 createSwDoc(DATA_DIRECTORY, "tdf145321.odt");
commit 47f1602b2681130e1400a37909fac3dfa7f667bb
Author: Thorsten Behrens 
AuthorDate: Tue Jun 14 14:10:04 2022 +0200
Commit: Thorsten Behrens 
CommitDate: Wed Jun 15 08:41:55 2022 +0200

Fix with-vendor for cross-build targets some more

Regression from be2252c8d3e5d892ec1e6b12a2b55c2026597cb9 where spaces
in --with-vendor end up being poorly quoted.

Opted to pass down --with-vendor to sub-configure unconditionally even
if empty, due to the need of word splitting generally being needed for
the sub_conf_opts variable.

Change-Id: Id3740255bc8fbf98adf7464de7e2836fcde9f2fd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135826
Reviewed-by: Balazs Varga 
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 

diff --git a/configure.ac b/configure.ac
index f2dded1c65c8..8c24eb84fd5e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5651,7 +5651,6 @@ if test "$cross_compiling" = "yes"; then
 test "$enable_wasm_strip" = "yes" && sub_conf_opts="$sub_conf_opts 
--enable-wasm-strip"
 test "${with_system_lockfile+set}" = set && sub_conf_opts="$sub_conf_opts 
--with-system-lockfile=${with_system_lockfile}"
 test "${enable_fuzzers}" = yes && sub_conf_opts="$sub_conf_opts 
--without-system-libxml"
-test -n "$with_vendor" -a "$with_vendor" != "no" && 
sub_conf_opts="$sub_conf_opts --with-vendor=$with_vendor"
 if test "$_os" = "Emscripten"; then
 sub_conf_opts="$sub_conf_opts --without-system-libxml 
--without-system-fontconfig --without-system-freetype --without-system-zlib"
 fi
@@ -5689,6 +5688,7 @@ if test "$cross_compiling" = "yes"; then
 $sub_conf_defaults \
 --with-parallelism="'$with_parallelism'" \
 --with-theme="'$with_theme'" \
+--with-vendor="'$with_vendor'" \
 $sub_conf_opts \
 $with_build_platform_configure_options \
 --srcdir=$srcdir
@@ -5697,6 +5697,7 @@ if test "$cross_compiling" = "yes"; then
 $sub_conf_defaults \
 --with-parallelism="$with_parallelism" \
 --with-theme="$with_theme" \
+"--with-vendor=$with_vendor" \
 $sub_conf_opts \
 $with_build_platform_configure_options \
 --srcdir=$srcdir \


[Libreoffice-commits] core.git: 2 commits - configure.ac sw/qa

2017-09-07 Thread Michael Stahl
 configure.ac  |   40 --
 sw/qa/python/text_portion_enumeration_test.py |   32 ++--
 2 files changed, 47 insertions(+), 25 deletions(-)

New commits:
commit e137b0ee2ac2c7dcd209f44768433b709c432918
Author: Michael Stahl 
Date:   Thu Sep 7 17:42:19 2017 +0200

sw: fix text_portion_enumeration_test.py on WNT

This fails, mostly because of confusing native paths and URLs, and
because of deleting the temp. directory before closing the file that the
test wrote into it.

Also, why open the document as a template.

Change-Id: I6da2f3f2c47308c4956444869b5b100a124b8db0

diff --git a/sw/qa/python/text_portion_enumeration_test.py 
b/sw/qa/python/text_portion_enumeration_test.py
index cc7a28e785ea..343a7da39196 100644
--- a/sw/qa/python/text_portion_enumeration_test.py
+++ b/sw/qa/python/text_portion_enumeration_test.py
@@ -770,8 +770,8 @@ class EnumConverter():
 continue
 else:
 node = self._stack.pop()
-assert (isinstance(node, RubyNode),
-"stack error: Ruby expected; is: {}".format(str(node)))
+assert (isinstance(node, RubyNode)),
+"stack error: Ruby expected; is: {}".format(str(node))
 elif type_ == "InContentMetadata":
 xMeta = xPortion.InContentMetadata
 xmlid = xMeta.MetadataReference
@@ -3267,15 +3267,21 @@ class TextPortionEnumerationTest(unittest.TestCase):
 xComp = None
 filename = "TESTMETA.odt"
 try:
-xComp = self.__class__._uno.openWriterTemplateDoc(filename)
+xComp = self.__class__._uno.openBaseDoc(filename)
 if xComp:
 self.checkloadmeta(xComp)
 with TemporaryDirectory() as tempdir:
-file = os.path.join(tempdir, filename)
+if os.altsep: # we need URL so replace "\" with "/"
+tempdir = tempdir.replace(os.sep, os.altsep)
+file = tempdir + "/" + filename
 self.dostore(xComp, file)
 self.close(xComp)
-xComp = self.doload(file)
-self.checkloadmeta(xComp)
+xComp2 = None
+try:
+xComp2 = self.doload(file)
+self.checkloadmeta(xComp2)
+finally:
+self.close(xComp2)
 finally:
 self.close(xComp)
 
@@ -,15 +3339,21 @@ class TextPortionEnumerationTest(unittest.TestCase):
 xComp = None
 filename = "TESTXMLID.odt"
 try:
-xComp = self.__class__._uno.openWriterTemplateDoc(filename)
+xComp = self.__class__._uno.openBaseDoc(filename)
 if xComp:
 self.checkloadxmlid(xComp)
 with TemporaryDirectory() as tempdir:
-file = os.path.join(tempdir, filename)
+if os.altsep: # we need URL so replace "\" with "/"
+tempdir = tempdir.replace(os.sep, os.altsep)
+file = tempdir + "/" + filename
 self.dostore(xComp, file)
 self.close(xComp)
-xComp = self.doload(file)
-self.checkloadxmlid(xComp)
+xComp2 = None
+try:
+xComp2 = self.doload(file)
+self.checkloadxmlid(xComp2)
+finally:
+self.close(xComp2)
 finally:
 self.close(xComp)
 
commit d74424a09ee7207138ad9da0869b194d3d5c476c
Author: Michael Stahl 
Date:   Thu Sep 7 13:26:44 2017 +0200

configure: find MSVC 2017 MSMs & DLLs again

They're still called "VC150" in my installation.

Change-Id: I0a005236ff5edc758be41616e33b254577144f17

diff --git a/configure.ac b/configure.ac
index 127998708b30..c804dd3f0ce5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5206,19 +5206,21 @@ find_winsdk()
 
 find_msms()
 {
-my_msm_file=Microsoft_VC${VCVER}_CRT_x86.msm
+my_msm_files=Microsoft_VC${VCVER}_CRT_x86.msm
 if test $VCVER = 150; then
-my_msm_file=Microsoft_VC141_CRT_x86.msm
+my_msm_files="Microsoft_VC141_CRT_x86.msm ${my_msm_files}"
 fi
-AC_MSG_CHECKING([for $my_msm_file])
+AC_MSG_CHECKING([for ${my_msm_files}])
 msmdir=
 for ver in 14.0 15.0; do
 reg_get_value_32 
HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/VisualStudio/$ver/Setup/VS/MSMDir
 if test -n "$regvalue"; then
-if test -e "$regvalue/$my_msm_file"; then
-msmdir=$regvalue
-break
-fi
+for f in ${my_msm_files}; do
+if test -e "$regvalue/${f}"; then
+