xerces-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amass...@apache.org
Subject svn commit: r657774 - in /xerces/c/trunk/src/xercesc/dom/impl: DOMXPathNSResolverImpl.cpp DOMXPathNSResolverImpl.hpp
Date Mon, 19 May 2008 09:59:33 GMT
Author: amassari
Date: Mon May 19 02:59:33 2008
New Revision: 657774

URL: http://svn.apache.org/viewvc?rev=657774&view=rev
Log:
Use a pointer to store the namespace map, or VC++ will complain about exporting a non-exportable
type

Modified:
    xerces/c/trunk/src/xercesc/dom/impl/DOMXPathNSResolverImpl.cpp
    xerces/c/trunk/src/xercesc/dom/impl/DOMXPathNSResolverImpl.hpp

Modified: xerces/c/trunk/src/xercesc/dom/impl/DOMXPathNSResolverImpl.cpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/dom/impl/DOMXPathNSResolverImpl.cpp?rev=657774&r1=657773&r2=657774&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/dom/impl/DOMXPathNSResolverImpl.cpp (original)
+++ xerces/c/trunk/src/xercesc/dom/impl/DOMXPathNSResolverImpl.cpp Mon May 19 02:59:33 2008
@@ -24,10 +24,16 @@
 XERCES_CPP_NAMESPACE_BEGIN
 
 DOMXPathNSResolverImpl::DOMXPathNSResolverImpl(const DOMNode *nodeResolver, MemoryManager*
const manager) :
-    fNamespaceBindings(7, true, manager),
+    fNamespaceBindings(0),
     fResolverNode(nodeResolver),
     fManager(manager)
 {
+    fNamespaceBindings = new (fManager) RefHashTableOf<KVStringPair>(7, true, fManager);
+}
+
+DOMXPathNSResolverImpl::~DOMXPathNSResolverImpl()
+{
+    delete fNamespaceBindings;
 }
 
 const XMLCh* DOMXPathNSResolverImpl::lookupNamespaceURI(const XMLCh* prefix) const
@@ -35,7 +41,7 @@
     if(XMLString::equals(prefix, XMLUni::fgXMLString))
         return XMLUni::fgXMLURIName;
 
-    const KVStringPair *pair = fNamespaceBindings.get((void*)prefix);
+    const KVStringPair *pair = fNamespaceBindings->get((void*)prefix);
     if(pair) {
         if(*pair->getValue() == 0) return NULL;
         return pair->getValue();
@@ -52,7 +58,7 @@
     if(XMLString::equals(uri, XMLUni::fgXMLURIName))
         return XMLUni::fgXMLString;
 
-    RefHashTableOfEnumerator<KVStringPair> enumerator((RefHashTableOf<KVStringPair>*)&fNamespaceBindings);
+    RefHashTableOfEnumerator<KVStringPair> enumerator((RefHashTableOf<KVStringPair>*)fNamespaceBindings);
     while(enumerator.hasMoreElements()) {
         KVStringPair &pair = enumerator.nextElement();
         if(XMLString::equals(pair.getValue(), uri)) {
@@ -73,7 +79,7 @@
 
     KVStringPair* pair = new (fManager) KVStringPair(prefix, uri, fManager);
 
-    fNamespaceBindings.put((void*)pair->getKey(), pair);
+    fNamespaceBindings->put((void*)pair->getKey(), pair);
 }
 
 void DOMXPathNSResolverImpl::release()

Modified: xerces/c/trunk/src/xercesc/dom/impl/DOMXPathNSResolverImpl.hpp
URL: http://svn.apache.org/viewvc/xerces/c/trunk/src/xercesc/dom/impl/DOMXPathNSResolverImpl.hpp?rev=657774&r1=657773&r2=657774&view=diff
==============================================================================
--- xerces/c/trunk/src/xercesc/dom/impl/DOMXPathNSResolverImpl.hpp (original)
+++ xerces/c/trunk/src/xercesc/dom/impl/DOMXPathNSResolverImpl.hpp Mon May 19 02:59:33 2008
@@ -37,6 +37,7 @@
 {
 public:
     DOMXPathNSResolverImpl(const DOMNode* nodeResolver = 0, MemoryManager* const manager
= XMLPlatformUtils::fgMemoryManager);
+    ~DOMXPathNSResolverImpl();
 
     virtual const XMLCh*          lookupNamespaceURI(const XMLCh* prefix) const;
     virtual const XMLCh*          lookupPrefix(const XMLCh* URI) const;
@@ -45,7 +46,7 @@
     virtual void                  release();
 
 protected:
-    RefHashTableOf<KVStringPair>  fNamespaceBindings;
+    RefHashTableOf<KVStringPair>* fNamespaceBindings;
     const DOMNode*                fResolverNode;
     MemoryManager*                fManager;
 };



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@xerces.apache.org
For additional commands, e-mail: commits-help@xerces.apache.org


Mime
View raw message