diff options
author | Stef Walter <stef@memberwebs.com> | 2004-07-29 22:52:30 +0000 |
---|---|---|
committer | Stef Walter <stef@memberwebs.com> | 2004-07-29 22:52:30 +0000 |
commit | 740d8a6bcb6521e188361befa7f5636c880bf63b (patch) | |
tree | f269a5d492d712be73d840fdefeb6ad247ee03db /src/xmlfixups.cpp | |
parent | 0105af34f6977c51619bf1060e74e3c249932c68 (diff) |
- Moved to DOMC
Diffstat (limited to 'src/xmlfixups.cpp')
-rw-r--r-- | src/xmlfixups.cpp | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/src/xmlfixups.cpp b/src/xmlfixups.cpp index 3b56f6b..d9bdb0a 100644 --- a/src/xmlfixups.cpp +++ b/src/xmlfixups.cpp @@ -345,7 +345,7 @@ void XmlFixups::breakLists(DOM::Document& doc) DOM::Element list; DOM::Element e; - wstring previd; + string previd; while(child != NULL) { @@ -355,7 +355,7 @@ void XmlFixups::breakLists(DOM::Document& doc) e = (DOM::Element&)child; // ... and has a list attribute - wstring listid = e.getAttribute(kAtList); + string listid = e.getAttribute(kAtList); if(listid.length() > 0) { e.removeAttribute(kAtList); @@ -432,6 +432,7 @@ void XmlFixups::runPassTwo(const DOM::Document& doc) { el = *it; + // Mark each node as we've seen it so we don't // do a given element twice if((int)el.getUserData() == PASS_TWO) @@ -502,8 +503,10 @@ void XmlFixups::runPassTwo(const DOM::Document& doc) continue; // Current element no longer valid } + continue; + // Change id attribute on fonts to name - else if(haveFonts && name == kElFont) + /* else */ if(haveFonts && name == kElFont) { if(el.hasAttribute(kAtId)) { @@ -756,27 +759,14 @@ void XmlFixups::fixBlock(const DOM::Document& doc, DOM::Element& block) { // Okay now change blocks to whatever element they're supposed to be string fix; - wstring val; DOM::Node parent = block.getParentNode(); if(parent != NULL) { // Figure out what kind of element they want block fixed to - val = block.getAttribute(kAtFix); - if(val.length() > 0) - block.removeAttribute(kAtFix); - - // BUG: Sablotron bug work around - if(val.length() == 0) - { - val = block.getAttributeNS("", kAtFix); - if(val.length() > 0) - block.removeAttributeNS("", kAtFix); - } - - if(val.length() > 0) - DOM::transcode16to8(val, fix); + fix = block.getAttribute(kAtFix); + block.removeAttribute(kAtFix); if(fix.length() == 0) fix = kElPara; @@ -789,6 +779,7 @@ void XmlFixups::fixBlock(const DOM::Document& doc, DOM::Element& block) while(block.hasChildNodes()) el.appendChild(block.removeChild(block.getFirstChild())); - parent.replaceChild(el, block); + // parent.replaceChild(el, block); + parent.appendChild(el); } } |