external/libxml2/deprecated.patch.0 | 10 ---------- unoxml/source/dom/documentbuilder.cxx | 16 ++++++++++------ 2 files changed, 10 insertions(+), 16 deletions(-)
New commits: commit feb5d010a69c8922574cb8b673f4c147a9bc0bd0 Author: Xisco Fauli <xiscofa...@libreoffice.org> AuthorDate: Mon Jun 9 10:12:15 2025 +0200 Commit: Xisco Fauli <xiscofa...@libreoffice.org> CommitDate: Mon Jun 9 11:16:37 2025 +0200 libxml2: replace deprecated lastError with xmlCtxtGetLastError Follow-up to commit e3b5e3aebcf178ccfbba3f7510062d5f2c5abb4a Author: Xisco Fauli <xiscofa...@libreoffice.org> Date: Wed Apr 23 13:38:50 2025 +0200 libxml2: upgrade to 2.14.3 Change-Id: I10acc368d9a0dd6db2f6569b2f174583d91dcf35 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/186285 Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org> Tested-by: Jenkins diff --git a/external/libxml2/deprecated.patch.0 b/external/libxml2/deprecated.patch.0 index 40f5e2392ca0..c063e5057704 100644 --- a/external/libxml2/deprecated.patch.0 +++ b/external/libxml2/deprecated.patch.0 @@ -44,13 +44,3 @@ /* unused */ int progressive XML_DEPRECATED_MEMBER; /* dictionary for the parser */ -@@ -436,7 +436,7 @@ - /* - * the complete error information for the last error. - */ -- xmlError lastError XML_DEPRECATED_MEMBER; -+ xmlError lastError; - /* the parser mode */ - xmlParserMode parseMode XML_DEPRECATED_MEMBER; - /* unused */ - diff --git a/unoxml/source/dom/documentbuilder.cxx b/unoxml/source/dom/documentbuilder.cxx index d24b1d7364f7..9183735f686c 100644 --- a/unoxml/source/dom/documentbuilder.cxx +++ b/unoxml/source/dom/documentbuilder.cxx @@ -137,11 +137,12 @@ namespace DOM static OUString make_error_message(xmlParserCtxtPtr ctxt) { - return OUString(ctxt->lastError.message, strlen(ctxt->lastError.message), RTL_TEXTENCODING_ASCII_US) + + const xmlError* lastError = xmlCtxtGetLastError(ctxt); + return OUString(lastError->message, strlen(lastError->message), RTL_TEXTENCODING_ASCII_US) + "Line: " + - OUString::number(static_cast<sal_Int32>(ctxt->lastError.line)) + + OUString::number(static_cast<sal_Int32>(lastError->line)) + " Column: " + - OUString::number(static_cast<sal_Int32>(ctxt->lastError.int2)); + OUString::number(static_cast<sal_Int32>(lastError->int2)); } // -- callbacks and context struct for parsing from stream @@ -258,8 +259,9 @@ namespace DOM if (xErrorHandler.is()) // if custom error handler is set (using setErrorHandler ()) { // Prepare SAXParseException to be passed to custom XErrorHandler::warning function + const xmlError* lastError = xmlCtxtGetLastError(pctx); css::xml::sax::SAXParseException saxex(make_error_message(pctx), {}, {}, {}, {}, - pctx->lastError.line, pctx->lastError.int2); + lastError->line, lastError->int2); // Call custom warning function xErrorHandler->warning(::css::uno::Any(saxex)); @@ -289,8 +291,9 @@ namespace DOM if (xErrorHandler.is()) // if custom error handler is set (using setErrorHandler ()) { // Prepare SAXParseException to be passed to custom XErrorHandler::error function + const xmlError* lastError = xmlCtxtGetLastError(pctx); css::xml::sax::SAXParseException saxex(make_error_message(pctx), {}, {}, {}, {}, - pctx->lastError.line, pctx->lastError.int2); + lastError->line, lastError->int2); // Call custom warning function xErrorHandler->error(::css::uno::Any(saxex)); @@ -306,8 +309,9 @@ namespace DOM static void throwEx(xmlParserCtxtPtr ctxt) { + const xmlError* lastError = xmlCtxtGetLastError(ctxt); css::xml::sax::SAXParseException saxex(make_error_message(ctxt), {}, {}, {}, {}, - ctxt->lastError.line, ctxt->lastError.int2); + lastError->line, lastError->int2); throw saxex; }