drawinglayer/source/tools/primitive2dxmldump.cxx |    2 ++
 filter/source/xsltfilter/LibXSLTTransformer.cxx  |    2 +-
 helpcompiler/source/HelpLinker.cxx               |    4 ++++
 include/xmloff/xmltoken.hxx                      |    2 +-
 sax/source/fastparser/fastparser.cxx             |    2 +-
 sc/source/core/tool/interpr7.cxx                 |    1 +
 sc/source/filter/xml/XMLExportDataPilot.cxx      |    2 +-
 sc/source/filter/xml/XMLExportDatabaseRanges.cxx |    2 +-
 sc/source/filter/xml/xmlfilti.cxx                |    4 ++--
 unoxml/source/dom/attr.cxx                       |    1 +
 unoxml/source/dom/document.cxx                   |    1 +
 unoxml/source/dom/documentbuilder.cxx            |    1 +
 unoxml/source/dom/entity.cxx                     |    1 +
 unoxml/source/xpath/xpathapi.cxx                 |    7 ++++++-
 xmloff/source/core/xmltoken.cxx                  |    2 +-
 xmloff/source/draw/sdpropls.cxx                  |    2 +-
 xmloff/source/style/PageMasterStyleMap.cxx       |    6 +++---
 xmloff/source/table/XMLTableExport.cxx           |    2 +-
 xmlsecurity/inc/xmlsec-wrapper.h                 |    1 +
 xmlsecurity/inc/xmlsec/saxhelper.hxx             |    1 +
 20 files changed, 32 insertions(+), 14 deletions(-)

New commits:
commit 901c1a6a00ed9de4953f7027926b63eeabc9a8b4
Author:     Miklos Vajna <vmik...@collabora.com>
AuthorDate: Mon Nov 27 08:02:59 2023 +0100
Commit:     Michael Stahl <michael.st...@allotropia.de>
CommitDate: Mon Feb 26 16:30:51 2024 +0100

    tdf#158302 fix build against system-libxml-2.12
    
    Seen in a fedora:40 container, using --with-system-libcmis,
    --with-system-liblangtag and --with-system-xmlsec.
    
    Change-Id: I9d748d3dc0b70dbfdfcb6b99c9ce8440bda6f326
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159980
    Tested-by: Jenkins
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>
    (cherry picked from commit c8f7408db73d2f2ccacb25a2b4fef8dfebdfc6cb)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161661
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>
    (cherry picked from commit 764890a53cea2ccb6d2fb6d8c7edb5e1c91ecdc0)
    (cherry picked from commit 81cc1e539114cf826f82c3d3718fe0dfacf66a9a)

diff --git a/drawinglayer/source/tools/primitive2dxmldump.cxx 
b/drawinglayer/source/tools/primitive2dxmldump.cxx
index 65170ae096f2..4c12c32ae079 100644
--- a/drawinglayer/source/tools/primitive2dxmldump.cxx
+++ b/drawinglayer/source/tools/primitive2dxmldump.cxx
@@ -16,6 +16,8 @@
 #include <tools/XmlWriter.hxx>
 
 #include <memory>
+#include <libxml/parser.h>
+#include <sal/log.hxx>
 
 #include <drawinglayer/primitive2d/drawinglayer_primitivetypes2d.hxx>
 #include <drawinglayer/primitive2d/transformprimitive2d.hxx>
diff --git a/filter/source/xsltfilter/LibXSLTTransformer.cxx 
b/filter/source/xsltfilter/LibXSLTTransformer.cxx
index e1092d94e900..5f3bd9e21cee 100644
--- a/filter/source/xsltfilter/LibXSLTTransformer.cxx
+++ b/filter/source/xsltfilter/LibXSLTTransformer.cxx
@@ -320,7 +320,7 @@ namespace XSLT
         }
         else
         {
-            xmlErrorPtr lastErr = xmlGetLastError();
+            const xmlError* lastErr = xmlGetLastError();
             OUString msg;
             if (lastErr)
                 msg = OStringToOUString(lastErr->message, 
RTL_TEXTENCODING_UTF8);
diff --git a/helpcompiler/source/HelpLinker.cxx 
b/helpcompiler/source/HelpLinker.cxx
index 44444902eb71..c2893390e639 100644
--- a/helpcompiler/source/HelpLinker.cxx
+++ b/helpcompiler/source/HelpLinker.cxx
@@ -807,7 +807,11 @@ static const HelpProcessingException* 
GpXMLParsingException = nullptr;
 
 extern "C" {
 
+#if LIBXML_VERSION >= 21200
+static void StructuredXMLErrorFunction(SAL_UNUSED_PARAMETER void *, const 
xmlError* error)
+#else
 static void StructuredXMLErrorFunction(SAL_UNUSED_PARAMETER void *, 
xmlErrorPtr error)
+#endif
 {
     std::string aErrorMsg = error->message;
     std::string aXMLParsingFile;
diff --git a/include/xmloff/xmltoken.hxx b/include/xmloff/xmltoken.hxx
index a0e52903060a..3e2227147de5 100644
--- a/include/xmloff/xmltoken.hxx
+++ b/include/xmloff/xmltoken.hxx
@@ -706,7 +706,7 @@ namespace xmloff { namespace token {
         XML_EMBEDDED_VISIBLE_AREA,
         XML_EMBOSSED,
         XML_EMISSIVE_COLOR,
-        XML_EMPTY,
+        XML_TOKEN_EMPTY,
         XML_EMPTY_LINE_REFRESH,
         XML_ENABLE_NUMBERING,
         XML_ENABLED,
diff --git a/sax/source/fastparser/fastparser.cxx 
b/sax/source/fastparser/fastparser.cxx
index 9b35c1682be5..3c30d7384ab5 100644
--- a/sax/source/fastparser/fastparser.cxx
+++ b/sax/source/fastparser/fastparser.cxx
@@ -548,7 +548,7 @@ Event& Entity::getEvent( CallbackType aType )
 OUString lclGetErrorMessage( xmlParserCtxtPtr ctxt, const OUString& sSystemId, 
sal_Int32 nLine )
 {
     const sal_Char* pMessage;
-    xmlErrorPtr error = xmlCtxtGetLastError( ctxt );
+    const xmlError* error = xmlCtxtGetLastError( ctxt );
     if( error && error->message )
         pMessage = error->message;
     else
diff --git a/sc/source/core/tool/interpr7.cxx b/sc/source/core/tool/interpr7.cxx
index a255d22232d2..2da332b2b14f 100644
--- a/sc/source/core/tool/interpr7.cxx
+++ b/sc/source/core/tool/interpr7.cxx
@@ -34,6 +34,7 @@
 
 #include <cstring>
 #include <memory>
+#include <libxml/parser.h>
 
 using namespace com::sun::star;
 
diff --git a/sc/source/filter/xml/XMLExportDataPilot.cxx 
b/sc/source/filter/xml/XMLExportDataPilot.cxx
index fa88b9bd1966..4133de40e9e3 100644
--- a/sc/source/filter/xml/XMLExportDataPilot.cxx
+++ b/sc/source/filter/xml/XMLExportDataPilot.cxx
@@ -127,7 +127,7 @@ void ScXMLExportDataPilot::WriteDPCondition(const 
ScQueryEntry& aQueryEntry, boo
 
     if (aQueryEntry.IsQueryByEmpty())
     {
-        rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_OPERATOR, 
GetXMLToken(XML_EMPTY));
+        rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_OPERATOR, 
GetXMLToken(XML_TOKEN_EMPTY));
     }
     else if (aQueryEntry.IsQueryByNonEmpty())
     {
diff --git a/sc/source/filter/xml/XMLExportDatabaseRanges.cxx 
b/sc/source/filter/xml/XMLExportDatabaseRanges.cxx
index 937ac271db26..7b1b2b5381a7 100644
--- a/sc/source/filter/xml/XMLExportDatabaseRanges.cxx
+++ b/sc/source/filter/xml/XMLExportDatabaseRanges.cxx
@@ -381,7 +381,7 @@ private:
             case SC_EQUAL:
             {
                 if (rEntry.IsQueryByEmpty())
-                    return GetXMLToken(XML_EMPTY);
+                    return GetXMLToken(XML_TOKEN_EMPTY);
                 else if (rEntry.IsQueryByNonEmpty())
                     return GetXMLToken(XML_NOEMPTY);
 
diff --git a/sc/source/filter/xml/xmlfilti.cxx 
b/sc/source/filter/xml/xmlfilti.cxx
index 47fea817123c..a84f12cdd47e 100644
--- a/sc/source/filter/xml/xmlfilti.cxx
+++ b/sc/source/filter/xml/xmlfilti.cxx
@@ -380,7 +380,7 @@ void ScXMLConditionContext::GetOperator(
         rEntry.eOp = SC_BOTPERC;
     else if (IsXMLToken(aOpStr, XML_BOTTOM_VALUES))
         rEntry.eOp = SC_BOTVAL;
-    else if (IsXMLToken(aOpStr, XML_EMPTY))
+    else if (IsXMLToken(aOpStr, XML_TOKEN_EMPTY))
         rEntry.SetQueryByEmpty();
     else if (aOpStr == ">")
         rEntry.eOp = SC_GREATER;
@@ -759,7 +759,7 @@ void SAL_CALL ScXMLDPConditionContext::endFastElement( 
sal_Int32 /*nElement*/ )
     else
         aFilterField.eConnect = SC_AND;
     pFilterContext->SetIsCaseSensitive(bIsCaseSensitive);
-    if (IsXMLToken(sOperator, XML_EMPTY))
+    if (IsXMLToken(sOperator, XML_TOKEN_EMPTY))
         aFilterField.SetQueryByEmpty();
     else if (IsXMLToken(sOperator, XML_NOEMPTY))
         aFilterField.SetQueryByNonEmpty();
diff --git a/unoxml/source/dom/attr.cxx b/unoxml/source/dom/attr.cxx
index 4ff411d3f62c..39889e114c99 100644
--- a/unoxml/source/dom/attr.cxx
+++ b/unoxml/source/dom/attr.cxx
@@ -22,6 +22,7 @@
 #include <string.h>
 
 #include <memory>
+#include <libxml/entities.h>
 
 #include <osl/diagnose.h>
 #include <sal/log.hxx>
diff --git a/unoxml/source/dom/document.cxx b/unoxml/source/dom/document.cxx
index e84ff5bdc8d3..bcd2e01bac15 100644
--- a/unoxml/source/dom/document.cxx
+++ b/unoxml/source/dom/document.cxx
@@ -41,6 +41,7 @@
 #include <eventdispatcher.hxx>
 
 #include <string.h>
+#include <libxml/xmlIO.h>
 
 #include <osl/diagnose.h>
 
diff --git a/unoxml/source/dom/documentbuilder.cxx 
b/unoxml/source/dom/documentbuilder.cxx
index 5a03cf0bcf2d..7b1d97ac44e4 100644
--- a/unoxml/source/dom/documentbuilder.cxx
+++ b/unoxml/source/dom/documentbuilder.cxx
@@ -25,6 +25,7 @@
 
 #include <libxml/xmlerror.h>
 #include <libxml/tree.h>
+#include <libxml/parser.h>
 
 #include <memory>
 
diff --git a/unoxml/source/dom/entity.cxx b/unoxml/source/dom/entity.cxx
index 74b1faaf7e75..0b8c384ddcc1 100644
--- a/unoxml/source/dom/entity.cxx
+++ b/unoxml/source/dom/entity.cxx
@@ -22,6 +22,7 @@
 #include <osl/diagnose.h>
 
 #include <string.h>
+#include <libxml/entities.h>
 
 using namespace css::uno;
 using namespace css::xml::dom;
diff --git a/unoxml/source/xpath/xpathapi.cxx b/unoxml/source/xpath/xpathapi.cxx
index 5d3e6d8c6189..a87781c57c85 100644
--- a/unoxml/source/xpath/xpathapi.cxx
+++ b/unoxml/source/xpath/xpathapi.cxx
@@ -26,6 +26,7 @@
 #include <libxml/xmlerror.h>
 #include <libxml/xpath.h>
 #include <libxml/xpathInternals.h>
+#include <libxml/xmlIO.h>
 
 #include <rtl/ustrbuf.hxx>
 #include <sal/log.hxx>
@@ -233,7 +234,7 @@ namespace XPath
         return selectSingleNode(contextNode, expr);
     }
 
-    static OUString make_error_message(xmlErrorPtr pError)
+    static OUString make_error_message(const xmlError* pError)
     {
         OUStringBuffer buf;
         if (pError) {
@@ -279,7 +280,11 @@ namespace XPath
             SAL_WARN("unoxml", "libxml2 error: " << str);
         }
 
+#if LIBXML_VERSION >= 21200
+        static void structured_error_func(void *, const xmlError* error)
+#else
         static void structured_error_func(void *, xmlErrorPtr error)
+#endif
         {
             SAL_WARN("unoxml", "libxml2 error: " << make_error_message(error));
         }
diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx
index 13f1415b8cc4..1b2f4bcf8566 100644
--- a/xmloff/source/core/xmltoken.cxx
+++ b/xmloff/source/core/xmltoken.cxx
@@ -707,7 +707,7 @@ namespace xmloff { namespace token {
         TOKEN( "embedded-visible-area",           XML_EMBEDDED_VISIBLE_AREA ),
         TOKEN( "embossed",                        XML_EMBOSSED ),
         TOKEN( "emissive-color",                  XML_EMISSIVE_COLOR ),
-        TOKEN( "empty",                           XML_EMPTY ),
+        TOKEN( "empty",                           XML_TOKEN_EMPTY ),
         TOKEN( "empty-line-refresh",              XML_EMPTY_LINE_REFRESH ),
         TOKEN( "enable-numbering",                XML_ENABLE_NUMBERING ),
         TOKEN( "enabled",                         XML_ENABLED ),
diff --git a/xmloff/source/draw/sdpropls.cxx b/xmloff/source/draw/sdpropls.cxx
index 6a59ac6967e2..378faaca9e68 100644
--- a/xmloff/source/draw/sdpropls.cxx
+++ b/xmloff/source/draw/sdpropls.cxx
@@ -75,7 +75,7 @@ using namespace ::xmloff::token;
 #define DPMAP(name,prefix,token,type,context) 
MAP_(name,prefix,token,type|XML_TYPE_PROP_DRAWING_PAGE,context)
 #define TMAP(name,prefix,token,type,context) 
MAP_(name,prefix,token,type|XML_TYPE_PROP_TEXT,context)
 #define PMAP(name,prefix,token,type,context) 
MAP_(name,prefix,token,type|XML_TYPE_PROP_PARAGRAPH,context)
-#define MAP_END() { nullptr, 0, 0, XML_EMPTY, 0 ,0, 
SvtSaveOptions::ODFVER_010, false }
+#define MAP_END() { nullptr, 0, 0, XML_TOKEN_EMPTY, 0 ,0, 
SvtSaveOptions::ODFVER_010, false }
 
 // entry list for graphic properties
 
diff --git a/xmloff/source/style/PageMasterStyleMap.cxx 
b/xmloff/source/style/PageMasterStyleMap.cxx
index 0faabe8264b2..39bd291d670d 100644
--- a/xmloff/source/style/PageMasterStyleMap.cxx
+++ b/xmloff/source/style/PageMasterStyleMap.cxx
@@ -154,7 +154,7 @@ const XMLPropertyMapEntry aXMLPageMasterStyleMap[] =
     PLMAP( "FootnoteLineRelativeWidth", XML_NAMESPACE_STYLE,    XML__EMPTY,    
 XML_TYPE_PERCENT8|MID_FLAG_SPECIAL_ITEM,    CTF_PM_FTN_LINE_WIDTH ),
     PLMAP( "FootnoteLineTextDistance", XML_NAMESPACE_STYLE,    XML__EMPTY,     
XML_TYPE_MEASURE|MID_FLAG_SPECIAL_ITEM,    CTF_PM_FTN_LINE_DISTANCE ),
     PLMAP( "FootnoteLineWeight",        XML_NAMESPACE_STYLE,    
XML_FOOTNOTE_SEP,    XML_TYPE_MEASURE16|MID_FLAG_ELEMENT_ITEM,    
CTF_PM_FTN_LINE_WEIGHT ),
-    PLMAP( "FootnoteLineStyle",     XML_NAMESPACE_STYLE,    XML_EMPTY,  
XML_TYPE_STRING|MID_FLAG_ELEMENT_ITEM,  CTF_PM_FTN_LINE_STYLE ),
+    PLMAP( "FootnoteLineStyle",     XML_NAMESPACE_STYLE,    XML_TOKEN_EMPTY,  
XML_TYPE_STRING|MID_FLAG_ELEMENT_ITEM,  CTF_PM_FTN_LINE_STYLE ),
 
     //////////////////////////////////////////////////////////////////////////
     //Index 92: Section for 'header-style' own section, all members *have* to 
use CTF_PM_HEADERFLAG in the context entry (the 5th one)
@@ -268,7 +268,7 @@ const XMLPropertyMapEntry aXMLPageMasterStyleMap[] =
     HFMAP( "FooterFillBitmapOffsetX",             XML_NAMESPACE_DRAW,     
XML_TILE_REPEAT_OFFSET,     
XML_SW_TYPE_BITMAPREPOFFSETX|MID_FLAG_MULTI_PROPERTY,   
CTF_PM_FOOTERREPEAT_OFFSET_X ),
     HFMAP( "FooterFillBitmapOffsetY",             XML_NAMESPACE_DRAW,     
XML_TILE_REPEAT_OFFSET,     
XML_SW_TYPE_BITMAPREPOFFSETY|MID_FLAG_MULTI_PROPERTY,   
CTF_PM_FOOTERREPEAT_OFFSET_Y ),
 
-    { nullptr, 0, 0, XML_EMPTY, 0, 0, SvtSaveOptions::ODFVER_010, false } // 
index 190
+    { nullptr, 0, 0, XML_TOKEN_EMPTY, 0, 0, SvtSaveOptions::ODFVER_010, false 
} // index 190
 };
 
 XMLPropertyMapEntry const g_XMLPageMasterDrawingPageStyleMap[] =
@@ -296,7 +296,7 @@ XMLPropertyMapEntry const 
g_XMLPageMasterDrawingPageStyleMap[] =
     DPMAP_IMPORT("FillBitmapOffsetX",            XML_NAMESPACE_DRAW,     
XML_TILE_REPEAT_OFFSET,     
XML_SW_TYPE_BITMAPREPOFFSETX|MID_FLAG_MULTI_PROPERTY, CTF_PM_REPEAT_OFFSET_X),
     DPMAP_IMPORT("FillBitmapOffsetY",            XML_NAMESPACE_DRAW,     
XML_TILE_REPEAT_OFFSET,     
XML_SW_TYPE_BITMAPREPOFFSETY|MID_FLAG_MULTI_PROPERTY, CTF_PM_REPEAT_OFFSET_Y),
 
-    { nullptr, 0, 0, XML_EMPTY, 0, 0, SvtSaveOptions::ODFVER_010, false }
+    { nullptr, 0, 0, XML_TOKEN_EMPTY, 0, 0, SvtSaveOptions::ODFVER_010, false }
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmloff/source/table/XMLTableExport.cxx 
b/xmloff/source/table/XMLTableExport.cxx
index 42d482a1c8a5..4ab8cdb20daf 100644
--- a/xmloff/source/table/XMLTableExport.cxx
+++ b/xmloff/source/table/XMLTableExport.cxx
@@ -61,7 +61,7 @@ using namespace ::com::sun::star::style;
 #define CMAP(name,prefix,token,type,context) 
MAP_(name,prefix,token,type|XML_TYPE_PROP_TABLE_COLUMN,context)
 #define RMAP(name,prefix,token,type,context) 
MAP_(name,prefix,token,type|XML_TYPE_PROP_TABLE_ROW,context)
 #define CELLMAP(name,prefix,token,type,context) 
MAP_(name,prefix,token,type|XML_TYPE_PROP_TABLE_CELL,context)
-#define MAP_END { nullptr, 0, 0, XML_EMPTY, 0, 0, SvtSaveOptions::ODFVER_010, 
false }
+#define MAP_END { nullptr, 0, 0, XML_TOKEN_EMPTY, 0, 0, 
SvtSaveOptions::ODFVER_010, false }
 
 const XMLPropertyMapEntry* getColumnPropertiesMap()
 {
diff --git a/xmlsecurity/inc/xmlsec-wrapper.h b/xmlsecurity/inc/xmlsec-wrapper.h
index 2d06dcfdd549..b5e142015f75 100644
--- a/xmlsecurity/inc/xmlsec-wrapper.h
+++ b/xmlsecurity/inc/xmlsec-wrapper.h
@@ -29,6 +29,7 @@
 #define XMLSEC_NO_SIZE_T
 #endif
 
+#include <libxml/parser.h>
 #include <xmlsec/base64.h>
 #include <xmlsec/bn.h>
 #include <xmlsec/errors.h>
diff --git a/xmlsecurity/inc/xmlsec/saxhelper.hxx 
b/xmlsecurity/inc/xmlsec/saxhelper.hxx
index e1eed377d6fa..5262b52c81e0 100644
--- a/xmlsecurity/inc/xmlsec/saxhelper.hxx
+++ b/xmlsecurity/inc/xmlsec/saxhelper.hxx
@@ -20,6 +20,7 @@
 #ifndef INCLUDED_XMLSECURITY_INC_XMLSEC_SAXHELPER_HXX
 #define INCLUDED_XMLSECURITY_INC_XMLSEC_SAXHELPER_HXX
 
+#include <libxml/parser.h>
 #include <libxml/tree.h>
 
 #include <rtl/ustring.hxx>

Reply via email to