summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStef Walter <stef@memberwebs.com>2006-02-13 17:59:50 +0000
committerStef Walter <stef@memberwebs.com>2006-02-13 17:59:50 +0000
commit495e29b4d34d2f70ae39029a967d3f1322067de7 (patch)
tree98394a2075f5ac07b02d31357ea0e349db0df08c
parentbf005765a78aa57434119630dfd2351345681478 (diff)
Fix build problems with GCC 4.0
-rw-r--r--ChangeLog1
-rw-r--r--src/domhelpers.cpp7
-rw-r--r--src/rtfparser.h1
-rw-r--r--src/xmlcomposer.cpp6
-rw-r--r--src/xmlfixups.cpp43
5 files changed, 41 insertions, 17 deletions
diff --git a/ChangeLog b/ChangeLog
index 6534f6a..ff6e3b5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -8,6 +8,7 @@ Version 0.9.6
- Displays version with '-v' argument
- Fixed problems with Unicode
- Support for bookmarks and links to bookmarks.
+ - Fix build problems for GCC 4.0
Version 0.9.5
- Allow conversions on stdin and stdout
diff --git a/src/domhelpers.cpp b/src/domhelpers.cpp
index 0efb102..cbe3f55 100644
--- a/src/domhelpers.cpp
+++ b/src/domhelpers.cpp
@@ -52,6 +52,7 @@ bool DOMHelpers::isEqualElement(const DOM::Element& el1, const DOM::Element& el2
{
if(el1.getNodeName() != el2.getNodeName())
return false;
+
// Compare attributes
DOM::NamedNodeMap at1 = el1.getAttributes();
DOM::NamedNodeMap at2 = el2.getAttributes();
@@ -65,11 +66,13 @@ bool DOMHelpers::isEqualElement(const DOM::Element& el1, const DOM::Element& el2
for(int i = 0; i < at1->getLength(); i++)
{
- DOM::Attr attr1 = (const DOM::Attr&)at1->item(i);
+ DOM::Node node = at1->item(0);
+ DOM::Attr attr1 = (DOM::Attr&)node;
if(attr1 == NULL)
return false;
- DOM::Attr attr2 = (const DOM::Attr&)at2->getNamedItem(attr1.getNodeName());
+ node = at2->getNamedItem(attr1.getNodeName());
+ DOM::Attr attr2 = (DOM::Attr&)node;
if(attr2 == NULL)
return false;
diff --git a/src/rtfparser.h b/src/rtfparser.h
index 9f0289e..56e7db3 100644
--- a/src/rtfparser.h
+++ b/src/rtfparser.h
@@ -111,6 +111,7 @@ private:
class RtfHandler
{
public:
+ virtual ~RtfHandler() {};
// Called at the beginning of the document
virtual void startDocument(RtfParser* reader) = 0;
diff --git a/src/xmlcomposer.cpp b/src/xmlcomposer.cpp
index 2f77545..6a731ff 100644
--- a/src/xmlcomposer.cpp
+++ b/src/xmlcomposer.cpp
@@ -1016,10 +1016,12 @@ ON_CONTROLWORD(ListOverrideTable)
// the list node for overriding, using the 'listid' and 'ls' we gathered
if(curList != NULL && lsId != -1)
{
- DOM::Element parent = (const DOM::Element&)curList.getParentNode();
+ DOM::Node node = curList.getParentNode();
+ DOM::Element parent = (DOM::Element&)node;
if(parent != NULL)
{
- curList = (const DOM::Element&)curList.cloneNode(true);
+ node = curList.cloneNode(true);
+ curList = (DOM::Element&)node;
if(curList != NULL)
{
parent.appendChild(curList);
diff --git a/src/xmlfixups.cpp b/src/xmlfixups.cpp
index 2bb52f8..cd271e6 100644
--- a/src/xmlfixups.cpp
+++ b/src/xmlfixups.cpp
@@ -89,7 +89,8 @@ bool XmlFixups::breakElement(const DOM::Element& el, const string& contain)
{
ASSERT(el != NULL);
- DOM::Element parent = (const DOM::Element&)el.getParentNode();
+ DOM::Node node = el.getParentNode();
+ DOM::Element parent = (DOM::Element&)node;
DOM::Element grandparent;
string s = el.getNodeName();
@@ -97,7 +98,10 @@ bool XmlFixups::breakElement(const DOM::Element& el, const string& contain)
// Get the parent node
if(parent != NULL)
- grandparent = (const DOM::Element&)parent.getParentNode();
+ {
+ node = parent.getParentNode();
+ grandparent = (DOM::Element&)node;
+ }
// Make sure we have something to work with before continuing
if(grandparent == NULL || parent == NULL ||
@@ -131,7 +135,8 @@ bool XmlFixups::breakElement(const DOM::Element& el, const string& contain)
else
{
// Clone it but not deep
- DOM::Element parent2 = (const DOM::Element&)parent.cloneNode(false);
+ node = parent.cloneNode(false);
+ DOM::Element parent2 = (DOM::Element&)node;
if(parent2 == NULL)
return false;
@@ -168,7 +173,8 @@ void XmlFixups::breakBlocks(DOM::Document& document)
{
for(int i = 0; i < blocks->getLength(); i++)
{
- DOM::Element block = (const DOM::Element&)blocks->item(i);
+ DOM::Node node = blocks->item(i);
+ DOM::Element block = (DOM::Element&)node;
// If it's the single closed style para then break it
if(block != NULL && !block.hasChildNodes())
@@ -183,7 +189,8 @@ void XmlFixups::breakBlocks(DOM::Document& document)
{
for(int i = 0; i < destinations->getLength(); i++)
{
- DOM::Element dest = (const DOM::Element&)destinations->item(i);
+ DOM::Node node = destinations->item(i);
+ DOM::Element dest = (const DOM::Element&)node;
// Sanity Check
if(dest == NULL || !dest.hasChildNodes())
@@ -235,7 +242,8 @@ void XmlFixups::wrapTags(DOM::Document& doc, const string& tagName,
{
for(int i = 0; i < tags->getLength(); i++)
{
- DOM::Element tag = (const DOM::Element&)tags->item(i);
+ DOM::Node node = tags->item(i);
+ DOM::Element tag = (const DOM::Element&)node;
DOM::Element wrap = doc.createElement(wrapName);
while(tag.hasChildNodes())
@@ -254,7 +262,8 @@ void XmlFixups::breakTags(DOM::Document& doc, const string& parentName,
{
for(int i = 0; i < parents->getLength(); i++)
{
- DOM::Element parent = (const DOM::Element&)parents->item(i);
+ DOM::Node node = parents->item(i);
+ DOM::Element parent = (DOM::Element&)node;
if(!parent.hasChildNodes())
continue;
@@ -264,7 +273,10 @@ void XmlFixups::breakTags(DOM::Document& doc, const string& parentName,
if(tags != NULL)
{
for(int i = 0; i < tags->getLength(); i++)
- breakElement((const DOM::Element&)tags->item(i), parentName);
+ {
+ node = tags->item(i);
+ breakElement((DOM::Element&)node, parentName);
+ }
}
DOM::Node tag = doc.createElement(tagName);
@@ -321,7 +333,8 @@ void XmlFixups::breakTags(DOM::Document& doc, const string& parentName,
{
for(int i = 0; i < tags->getLength(); i++)
{
- DOM::Element tag = (const DOM::Element&)tags->item(i);
+ DOM::Node node = tags->item(i);
+ DOM::Element tag = (DOM::Element&)node;
DOM::Node parent = tag.getParentNode();
if(parent != NULL && !DOMHelpers::isElement(parent, parentName))
@@ -337,7 +350,8 @@ void XmlFixups::breakLists(DOM::Document& doc)
{
for(int i = 0; i < destinations->getLength(); i++)
{
- DOM::Element dest = (const DOM::Element&)destinations->item(i);
+ DOM::Node node = destinations->item(i);
+ DOM::Element dest = (const DOM::Element&)node;
// Sanity Check
if(dest == NULL)
@@ -617,7 +631,8 @@ void XmlFixups::runPassTwo(const DOM::Document& doc)
// Tags for which duplicates need to be combined
if(m_duplicates.find(name) != m_duplicates.end())
{
- DOM::Element parent = (const DOM::Element&)el.getParentNode();
+ DOM::Node node = el.getParentNode();
+ DOM::Element parent = (DOM::Element&)node;
if(parent != NULL)
{
DOM::Node prev = el.getPreviousSibling();
@@ -686,7 +701,8 @@ void XmlFixups::breakTables(DOM::Document& doc)
{
for(int i = 0; i < rows->getLength(); i++)
{
- DOM::Element row = (const DOM::Element&)rows->item(i);
+ DOM::Node node = rows->item(i);
+ DOM::Element row = (DOM::Element&)node;
DOM::Node parent = row.getParentNode();
if(parent == NULL)
@@ -715,7 +731,8 @@ void XmlFixups::breakTables(DOM::Document& doc)
{
for(int i = 0; i < destinations->getLength(); i++)
{
- DOM::Element dest = (const DOM::Element&)destinations->item(i);
+ DOM::Node node = destinations->item(i);
+ DOM::Element dest = (DOM::Element&)node;
// Sanity Check
if(dest == NULL)