[Libreoffice-commits] core.git: Branch 'distro/collabora/co-2021' - 7 commits - configure.ac cui/source download.lst external/expat include/sal sw/qa sw/source writerfilter/CppunitTest_writerfilter_rtftok.mk writerfilter/qa writerfilter/source xmloff/source
Noel Grandin (via logerrit)
logerrit at kemper.freedesktop.org
Fri Jun 4 13:47:28 UTC 2021
configure.ac | 2
cui/source/dialogs/AdditionsDialog.cxx | 11 ++
download.lst | 4
external/expat/UnpackedTarball_expat.mk | 1
external/expat/expat-winapi.patch | 14 ++
external/expat/ubsan.patch.0 | 11 --
include/sal/log.hxx | 5 -
sw/qa/extras/ww8export/data/tdf138302_restartNumbering.odt |binary
sw/qa/extras/ww8export/ww8export3.cxx | 6 +
sw/source/filter/ww8/wrtw8num.cxx | 11 ++
sw/source/filter/ww8/wrtww8.hxx | 1
sw/source/filter/ww8/ww8atr.cxx | 7 +
writerfilter/CppunitTest_writerfilter_rtftok.mk | 1
writerfilter/qa/cppunittests/rtftok/data/invalid-hex.rtf | 3
writerfilter/qa/cppunittests/rtftok/rtftokenizer.cxx | 63 +++++++++++++
writerfilter/source/rtftok/rtftokenizer.cxx | 15 ++-
xmloff/source/core/XMLEmbeddedObjectImportContext.cxx | 5 +
17 files changed, 139 insertions(+), 21 deletions(-)
New commits:
commit 24be9488c1a4ceafa272a9e671500d665652eec7
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Thu Jun 3 14:15:13 2021 +0200
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Fri Jun 4 15:46:52 2021 +0200
tdf#142546 broken formulas in .FODT files
regression from
commit 81fe31d2c8977791f9b90ab1da4fbb1a778f87fb
Date: Tue Nov 3 18:25:10 2020 +0200
use fastparser in XMLEmbeddedObjectImportContext
Change-Id: Ib5bae81001ae97c574c078c979484f016c7d4323
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116664
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
(cherry picked from commit 06a983b213b8fb71fdac1004868d7b4fdd6a9833)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116470
Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>
diff --git a/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx b/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx
index 5f6073d171bc..e468384122dd 100644
--- a/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx
+++ b/xmloff/source/core/XMLEmbeddedObjectImportContext.cxx
@@ -135,6 +135,11 @@ void XMLEmbeddedObjectImportContext::SetComponent( Reference< XComponent > const
xImporter->setTargetDocument( rComp );
xComp = rComp; // keep ref to component only if there is a handler
+
+ // #i34042: copy namepspace declarations
+ // We created a new instance of XMLImport, so we need to propogate the namespace
+ // declarations to it.
+ pFastHandler->GetNamespaceMap() = GetImport().GetNamespaceMap();
}
XMLEmbeddedObjectImportContext::XMLEmbeddedObjectImportContext(
commit 35b8a2e93aa6dab1cef4e67ea59e838a155f2a92
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue May 25 10:44:13 2021 +0100
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Fri Jun 4 15:46:52 2021 +0200
upgrade to Expat 2.4.1
drop ubsan patch in favour of fix applied as
https://github.com/libexpat/libexpat/pull/398
Change-Id: I59eb9e24206b9a4cf323b7f7d48d8df0792a1c46
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116102
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl at allotropia.de>
diff --git a/download.lst b/download.lst
index 73b417ab57d5..70d61e41c5e4 100644
--- a/download.lst
+++ b/download.lst
@@ -52,8 +52,8 @@ export EPUBGEN_TARBALL := libepubgen-0.1.1.tar.xz
export ETONYEK_SHA256SUM := e61677e8799ce6e55b25afc11aa5339113f6a49cff031f336e32fa58635b1a4a
export ETONYEK_VERSION_MICRO := 9
export ETONYEK_TARBALL := libetonyek-0.1.$(ETONYEK_VERSION_MICRO).tar.xz
-export EXPAT_SHA256SUM := 9a130948b05a82da34e4171d5f5ae5d321d9630277af02c8fa51e431f6475102
-export EXPAT_TARBALL := expat-2.2.8.tar.bz2
+export EXPAT_SHA256SUM := 2f9b6a580b94577b150a7d5617ad4643a4301a6616ff459307df3e225bcfbf40
+export EXPAT_TARBALL := expat-2.4.1.tar.bz2
export FIREBIRD_SHA256SUM := 6994be3555e23226630c587444be19d309b25b0fcf1f87df3b4e3f88943e5860
export FIREBIRD_TARBALL := Firebird-3.0.0.32483-0.tar.bz2
export FONTCONFIG_SHA256SUM := 19e5b1bc9d013a52063a44e1307629711f0bfef35b9aca16f9c793971e2eb1e5
diff --git a/external/expat/UnpackedTarball_expat.mk b/external/expat/UnpackedTarball_expat.mk
index 96f4e3ec8732..5d4f41f6d147 100644
--- a/external/expat/UnpackedTarball_expat.mk
+++ b/external/expat/UnpackedTarball_expat.mk
@@ -15,7 +15,6 @@ $(eval $(call gb_UnpackedTarball_update_autoconf_configs,expat,conftools))
$(eval $(call gb_UnpackedTarball_add_patches,expat,\
external/expat/expat-winapi.patch \
- external/expat/ubsan.patch.0 \
))
# This is a bit hackish.
diff --git a/external/expat/expat-winapi.patch b/external/expat/expat-winapi.patch
index b33c12b83b4c..bd4da1472fc8 100644
--- a/external/expat/expat-winapi.patch
+++ b/external/expat/expat-winapi.patch
@@ -11,3 +11,17 @@
# endif
#endif /* not defined XML_STATIC */
+--- misc/expat-2.1.0/lib/xmlparse.c 2021-05-23 16:56:25.000000000 +0100
++++ misc/build/expat-2.1.0/lib/xmlparse.c 2021-05-25 12:42:11.997173600 +0100
+@@ -92,6 +92,11 @@
+
+ #include <expat_config.h>
+
++#ifdef _WIN32
++# undef HAVE_GETRANDOM
++# undef HAVE_SYSCALL_GETRANDOM
++#endif
++
+ #include "ascii.h"
+ #include "expat.h"
+ #include "siphash.h"
diff --git a/external/expat/ubsan.patch.0 b/external/expat/ubsan.patch.0
deleted file mode 100644
index 8317f922df88..000000000000
--- a/external/expat/ubsan.patch.0
+++ /dev/null
@@ -1,11 +0,0 @@
---- lib/xmlparse.c
-+++ lib/xmlparse.c
-@@ -6485,7 +6485,7 @@
- static void FASTCALL
- hashTableIterInit(HASH_TABLE_ITER *iter, const HASH_TABLE *table) {
- iter->p = table->v;
-- iter->end = iter->p + table->size;
-+ iter->end = table->size == 0 ? iter->p : iter->p + table->size;
- }
-
- static NAMED *FASTCALL
commit aa3bb43ce733ed16e59739dbc43f36d77fafa173
Author: Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Mon May 31 13:30:37 2021 +0200
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Fri Jun 4 15:46:51 2021 +0200
Adapt to hamcrest-2.2-3.fc35.noarch.rpm
Change-Id: Ibddfc30a5f0828ab77235ec1155f1c2e1eef24ee
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116506
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
(cherry picked from commit e6c25186c8584f68b5f8074004556bd855200fff)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116456
Reviewed-by: Michael Stahl <michael.stahl at allotropia.de>
diff --git a/configure.ac b/configure.ac
index 583f3ce2820a..4ad5a31d76ef 100644
--- a/configure.ac
+++ b/configure.ac
@@ -13220,6 +13220,8 @@ if test "$ENABLE_JAVA" != "" -a "$with_junit" != "no" -a "$cross_compiling" != "
HAMCREST_JAR=/usr/share/lib/java/hamcrest.jar
elif test -e /usr/share/java/hamcrest/core.jar; then
HAMCREST_JAR=/usr/share/java/hamcrest/core.jar
+ elif test -e /usr/share/java/hamcrest/hamcrest.jar; then
+ HAMCREST_JAR=/usr/share/java/hamcrest/hamcrest.jar
else
HAMCREST_JAR=/usr/share/java/hamcrest.jar
fi
commit 7836f2d4d0a4deb0a9a9bf240ec29fc934356d40
Author: Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Mon May 31 21:12:12 2021 +0200
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Fri Jun 4 15:46:51 2021 +0200
tdf#142325 RTF import: tolerate invalid hex markup like "\'3?"
The RTF spec says \'hh is the expected form, where both "h" are 0-9, a-f
or A-F. But Word accepts the bugdoc, so don't reject this input, handle
\'<number><junk> as \'0<number>.
At least the current case ignores the actual value, as it's a single
character to provide a non-unicode value after \uN for old readers that
don't support Unicode.
Change-Id: Ib61247ab08278ca5012cc887cee26c7571c29fc6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116499
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos at collabora.com>
(cherry picked from commit 6fc8a6b0b52509d735971f079d7b1660559d475d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116457
Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>
diff --git a/writerfilter/CppunitTest_writerfilter_rtftok.mk b/writerfilter/CppunitTest_writerfilter_rtftok.mk
index db038292ebdd..07271b777ae0 100644
--- a/writerfilter/CppunitTest_writerfilter_rtftok.mk
+++ b/writerfilter/CppunitTest_writerfilter_rtftok.mk
@@ -18,6 +18,7 @@ $(eval $(call gb_CppunitTest_use_externals,writerfilter_rtftok,\
$(eval $(call gb_CppunitTest_add_exception_objects,writerfilter_rtftok, \
writerfilter/qa/cppunittests/rtftok/rtfsdrimport \
writerfilter/qa/cppunittests/rtftok/rtfsprm \
+ writerfilter/qa/cppunittests/rtftok/rtftokenizer \
))
$(eval $(call gb_CppunitTest_use_libraries,writerfilter_rtftok, \
diff --git a/writerfilter/qa/cppunittests/rtftok/data/invalid-hex.rtf b/writerfilter/qa/cppunittests/rtftok/data/invalid-hex.rtf
new file mode 100644
index 000000000000..8f9224c0e905
--- /dev/null
+++ b/writerfilter/qa/cppunittests/rtftok/data/invalid-hex.rtf
@@ -0,0 +1,3 @@
+{\rtf1
+x\u345\'3?x
+\par}
diff --git a/writerfilter/qa/cppunittests/rtftok/rtftokenizer.cxx b/writerfilter/qa/cppunittests/rtftok/rtftokenizer.cxx
new file mode 100644
index 000000000000..530e9bb7245a
--- /dev/null
+++ b/writerfilter/qa/cppunittests/rtftok/rtftokenizer.cxx
@@ -0,0 +1,63 @@
+/* -*- 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 <test/bootstrapfixture.hxx>
+#include <unotest/macros_test.hxx>
+
+#include <com/sun/star/frame/Desktop.hpp>
+#include <com/sun/star/text/XTextDocument.hpp>
+
+using namespace ::com::sun::star;
+
+namespace
+{
+/// Tests for writerfilter/source/rtftok/rtftokenizer.cxx.
+class Test : public test::BootstrapFixture, public unotest::MacrosTest
+{
+private:
+ uno::Reference<lang::XComponent> mxComponent;
+
+public:
+ void setUp() override;
+ void tearDown() override;
+ uno::Reference<lang::XComponent>& getComponent() { return mxComponent; }
+};
+
+void Test::setUp()
+{
+ test::BootstrapFixture::setUp();
+
+ mxDesktop.set(frame::Desktop::create(mxComponentContext));
+}
+
+void Test::tearDown()
+{
+ if (mxComponent.is())
+ mxComponent->dispose();
+
+ test::BootstrapFixture::tearDown();
+}
+
+constexpr OUStringLiteral DATA_DIRECTORY = u"/writerfilter/qa/cppunittests/rtftok/data/";
+
+CPPUNIT_TEST_FIXTURE(Test, testInvalidHex)
+{
+ // Given a document with a markup like "\'3?":
+ OUString aURL = m_directories.getURLFromSrc(DATA_DIRECTORY) + "invalid-hex.rtf";
+
+ // When load that document:
+ getComponent() = loadFromDesktop(aURL);
+
+ // Then make sure the result matches Word, rather than just refusing to import the document:
+ uno::Reference<text::XTextDocument> xTextDocument(getComponent(), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(OUString::fromUtf8("xřx"), xTextDocument->getText()->getString());
+}
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/writerfilter/source/rtftok/rtftokenizer.cxx b/writerfilter/source/rtftok/rtftokenizer.cxx
index bfd29c38f118..b205227b94e3 100644
--- a/writerfilter/source/rtftok/rtftokenizer.cxx
+++ b/writerfilter/source/rtftok/rtftokenizer.cxx
@@ -144,11 +144,16 @@ RTFError RTFTokenizer::resolveParse()
else
{
SAL_INFO("writerfilter.rtf", __func__ << ": hex internal state");
- b = b << 4;
- sal_Int8 parsed = msfilter::rtfutil::AsHex(ch);
- if (parsed == -1)
- return RTFError::HEX_INVALID;
- b += parsed;
+ // Assume that \'<number><junk> means \'0<number>.
+ if (rtl::isAsciiDigit(static_cast<unsigned char>(ch))
+ || (ch >= 'a' && ch <= 'f') || (ch >= 'A' && ch <= 'F'))
+ {
+ b = b << 4;
+ sal_Int8 parsed = msfilter::rtfutil::AsHex(ch);
+ if (parsed == -1)
+ return RTFError::HEX_INVALID;
+ b += parsed;
+ }
count--;
if (!count)
{
commit f1e3d036500aab8560adacd98095dc80195a471f
Author: Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Wed May 5 08:20:18 2021 +0200
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Fri Jun 4 15:46:50 2021 +0200
Adapt to "libstdc++: Implement LWG 1203 for rvalue iostreams"
<https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=aa475c4ac80733f85ba47b109fc1900f05e810e2>
towards GCC 12, so that now "the return type is the original rvalue stream type
not its base class." (And which would thus have caused issues like
> sfx2/source/control/bindings.cxx:1323:19: error: dynamic_cast from rvalue to reference type '::std::ostringstream &' (aka 'basic_ostringstream<char> &')
> ? SAL_STREAM("File: " << pFile << " Line: " << nLine) : ""));
> ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> include/sal/log.hxx:198:6: note: expanded from macro 'SAL_STREAM'
> (dynamic_cast< ::std::ostringstream & >(::std::ostringstream() << stream).str())
> ^
> include/sal/log.hxx:341:20: note: expanded from macro 'SAL_INFO'
> SAL_WHERE, stream)
> ~~~~~~~~~~~^~~~~~~
> include/sal/log.hxx:155:68: note: expanded from macro 'SAL_DETAIL_LOG_STREAM'
> SAL_DETAIL_LOG_STREAM_PRIVATE_(level, area, where, stream); \
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
> include/sal/log.hxx:133:45: note: expanded from macro 'SAL_DETAIL_LOG_STREAM_PRIVATE_'
> ::sal::detail::StreamStart() << stream) == 1) \
> ^~~~~~
now. While the issue with old libstdc++ that originally prompted the
dynamic_cast was
> sfx2/source/control/bindings.cxx:1323:19: error: no member named 'str' in 'std::basic_ostream<char>'
> ? SAL_STREAM("File: " << pFile << " Line: " << nLine) : ""));
> ~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> include/sal/log.hxx:194:40: note: expanded from macro 'SAL_STREAM'
> (::std::ostringstream() << stream).str()
> ^
> include/sal/log.hxx:336:20: note: expanded from macro 'SAL_INFO'
> SAL_WHERE, stream)
> ~~~~~~~~~~~^~~~~~~
> include/sal/log.hxx:155:68: note: expanded from macro 'SAL_DETAIL_LOG_STREAM'
> SAL_DETAIL_LOG_STREAM_PRIVATE_(level, area, where, stream); \
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~
> include/sal/log.hxx:133:45: note: expanded from macro 'SAL_DETAIL_LOG_STREAM_PRIVATE_'
> ::sal::detail::StreamStart() << stream) == 1) \
> ^~~~~~
.)
The libstdc++ macro _GLIBCXX_RELEASE is reportedly available since GCC 7.1.
Change-Id: I1ee6eabb66355c1f28b9d305cbd85bac50d6b0e1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115121
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
(cherry picked from commit 1f3dddd6f21d91c429190ae314dadeec409f35f4, plus
follow-up 95e26d3dce4f5a3b2d010d5ca47b4e450905a100 "tdf#142326: Adapt to
'libstdc++: Implement LWG 1203 for rvalue iostreams'")
Change-Id: I7c8fef25e15fcfa9b83924467dc86dc2957fbd7d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116447
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/include/sal/log.hxx b/include/sal/log.hxx
index b3515acfca7d..fd3bf56e0dd7 100644
--- a/include/sal/log.hxx
+++ b/include/sal/log.hxx
@@ -188,7 +188,10 @@ inline char const * unwrapStream(SAL_UNUSED_PARAMETER StreamIgnore const &) {
@since LibreOffice 3.5
*/
-#if defined _LIBCPP_VERSION || (defined _MSC_VER && _MSC_VER >= 1915)
+#if defined _LIBCPP_VERSION \
+ || (defined _GLIBCXX_RELEASE \
+ && (_GLIBCXX_RELEASE >= 12 || (_GLIBCXX_RELEASE == 11 && __GLIBCXX__ > 20210428))) \
+ || (defined _MSC_VER && _MSC_VER >= 1915)
#define SAL_STREAM(stream) \
(::std::ostringstream() << stream).str()
#else
commit 73f4abb5dbb5a589cc867ba24a6cc79affdcb91c
Author: Justin Luth <justin_luth at sil.org>
AuthorDate: Fri May 28 16:03:52 2021 +0200
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Fri Jun 4 15:46:49 2021 +0200
tdf#138302 partial revert tdf#108496: DOCX: redesign of override in lists
LO 6.4.5 commit cf13fe3e6f6a40f6db064d65d4514d13a23a31f0
was only concerned about DOCX, but just elinated shared code.
So restore the shared code and just don't execute it for DOCX.
It doesn't look like RTF was working before this,
but this does fix DOC format.
I looked for existing unit tests in rtf and doc,
but none were found that hit this code.
Change-Id: Id624f73181384f38e1ef9f27575e0fb82eea19c7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116349
Tested-by: Jenkins
Reviewed-by: Vasily Melenchuk <vasily.melenchuk at cib.de>
(cherry picked from commit f49e5902a3737c02fabf5bec23243ccb126426c4)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116170
Reviewed-by: Justin Luth <justin_luth at sil.org>
diff --git a/sw/qa/extras/ww8export/data/tdf138302_restartNumbering.odt b/sw/qa/extras/ww8export/data/tdf138302_restartNumbering.odt
new file mode 100644
index 000000000000..8c99963616a7
Binary files /dev/null and b/sw/qa/extras/ww8export/data/tdf138302_restartNumbering.odt differ
diff --git a/sw/qa/extras/ww8export/ww8export3.cxx b/sw/qa/extras/ww8export/ww8export3.cxx
index 2da94717f407..3836db666088 100644
--- a/sw/qa/extras/ww8export/ww8export3.cxx
+++ b/sw/qa/extras/ww8export/ww8export3.cxx
@@ -212,6 +212,12 @@ DECLARE_WW8EXPORT_TEST(testdf79553_lineNumbers, "tdf79553_lineNumbers.doc")
CPPUNIT_ASSERT_MESSAGE("automatic distance", nValue > 0);
}
+DECLARE_WW8EXPORT_TEST(tesTdf138302_restartNumbering, "tdf138302_restartNumbering.odt")
+{
+ uno::Reference<beans::XPropertySet> xPara(getParagraph(8), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(OUString("1."), getProperty<OUString>(xPara, "ListLabelString"));
+}
+
DECLARE_WW8EXPORT_TEST(testTdf122429_header, "tdf122429_header.doc")
{
uno::Reference<container::XNameAccess> pageStyles = getStyles("PageStyles");
diff --git a/sw/source/filter/ww8/wrtw8num.cxx b/sw/source/filter/ww8/wrtw8num.cxx
index c3f8eabe9fd9..7c1866f74718 100644
--- a/sw/source/filter/ww8/wrtw8num.cxx
+++ b/sw/source/filter/ww8/wrtw8num.cxx
@@ -56,6 +56,17 @@ SwNumRule* MSWordExportBase::DuplicateNumRuleImpl(const SwNumRule *pRule)
return pMyNumRule;
}
+sal_uInt16 MSWordExportBase::DuplicateNumRule(const SwNumRule* pRule, sal_uInt8 nLevel, sal_uInt16 nVal)
+{
+ SwNumRule* const pMyNumRule = DuplicateNumRuleImpl(pRule);
+
+ SwNumFormat aNumFormat(pMyNumRule->Get(nLevel));
+ aNumFormat.SetStart(nVal);
+ pMyNumRule->Set(nLevel, aNumFormat);
+
+ return GetNumberingId(*pMyNumRule);
+}
+
// multiple SwList can be based on the same SwNumRule; ensure one w:abstractNum
// per SwList
sal_uInt16 MSWordExportBase::DuplicateAbsNum(OUString const& rListId,
diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx
index 1baa627ece71..69f9f2b1a2ed 100644
--- a/sw/source/filter/ww8/wrtww8.hxx
+++ b/sw/source/filter/ww8/wrtww8.hxx
@@ -651,6 +651,7 @@ public:
/// List is set to restart at a particular value so for export make a
/// completely new list based on this one and export that instead,
/// which duplicates words behaviour in this respect.
+ sal_uInt16 DuplicateNumRule(const SwNumRule* pRule, sal_uInt8 nLevel, sal_uInt16 nVal);
SwNumRule * DuplicateNumRuleImpl(const SwNumRule *pRule);
/// check if a new abstractNum is needed for this list
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 30e2a4d97976..de0b2b6ed6ee 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -3627,6 +3627,13 @@ void AttributeOutputBase::ParaNumRule( const SwNumRuleItem& rNumRule )
}
}
}
+ else if (pTextNd->IsListRestart())
+ {
+ sal_uInt16 nStartWith = static_cast<sal_uInt16>(pTextNd->GetActualListStartValue());
+ nNumId = GetExport().DuplicateNumRule(pRule, nLvl, nStartWith);
+ if (USHRT_MAX != nNumId)
+ ++nNumId;
+ }
}
else
{
commit 0d22077bb1651d99b4b8985297260cbbc8cd65f9
Author: Muhammet Kara <muhammet.kara at collabora.com>
AuthorDate: Sat May 29 18:17:54 2021 +0300
Commit: Andras Timar <andras.timar at collabora.com>
CommitDate: Fri Jun 4 15:46:49 2021 +0200
tdf#136292: Fix crash on invalid JSON from the extensions API
Change-Id: I91ed555f93173dee10e87025b231560693be50b5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116390
Tested-by: Jenkins
Reviewed-by: Muhammet Kara <muhammet.kara at collabora.com>
(cherry picked from commit e98b0891d6e0f1d6be4e4a4761bd1ab16bfab85c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116168
Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>
diff --git a/cui/source/dialogs/AdditionsDialog.cxx b/cui/source/dialogs/AdditionsDialog.cxx
index 8bd5dee65222..a80e8562c398 100644
--- a/cui/source/dialogs/AdditionsDialog.cxx
+++ b/cui/source/dialogs/AdditionsDialog.cxx
@@ -45,6 +45,7 @@
#include <com/sun/star/task/XInteractionApprove.hpp>
#include <orcus/json_document_tree.hpp>
+#include <orcus/json_parser.hpp>
#include <orcus/config.hpp>
#include <orcus/pstring.hpp>
@@ -124,7 +125,15 @@ void parseResponse(const std::string& rResponse, std::vector<AdditionInfo>& aAdd
if (rResponse.empty())
return;
- aJsonDoc.load(rResponse, aConfig);
+ try
+ {
+ aJsonDoc.load(rResponse, aConfig);
+ }
+ catch (const orcus::json::parse_error&)
+ {
+ TOOLS_WARN_EXCEPTION("cui.dialogs", "Invalid JSON file from the extensions API");
+ return;
+ }
auto aDocumentRoot = aJsonDoc.get_document_root();
if (aDocumentRoot.type() != orcus::json::node_t::object)
More information about the Libreoffice-commits
mailing list