summaryrefslogtreecommitdiff
path: root/textproc/xqilla/patches/patch-src_dom-api_impl_XPathDocumentImpl.cpp
blob: 2b02aca9d65ecb4e32b2a1f273e4d82c9ac17002 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
$NetBSD: patch-src_dom-api_impl_XPathDocumentImpl.cpp,v 1.1 2017/10/01 09:45:50 wiz Exp $

Xerces-C 3.2.0 removed castToNode (which relied on undefined
behaviour) with a cleaner way of getting information about a node's
containing node: a new fContainingNode member.
https://sourceforge.net/p/xqilla/bugs/48/

--- src/dom-api/impl/XPathDocumentImpl.cpp.orig	2015-05-18 17:38:59.000000000 +0000
+++ src/dom-api/impl/XPathDocumentImpl.cpp
@@ -62,7 +62,11 @@ DOMNode *XPathDocumentImpl::insertBefore
     if (thisNodeImpl->isReadOnly())
         throw DOMException(DOMException::NO_MODIFICATION_ALLOWED_ERR, 0, getMemoryManager());
 
+#if _XERCES_VERSION >= 30200
+    DOMNode* thisNode = fParent.fContainingNode;
+#else
     DOMNode* thisNode = castToNode(&fParent);
+#endif
     if (newChild->getOwnerDocument() != thisNode)
         throw DOMException(DOMException::WRONG_DOCUMENT_ERR, 0, getMemoryManager());