summaryrefslogtreecommitdiff
path: root/src/xmlfixups.cpp
diff options
context:
space:
mode:
authorStef Walter <stef@memberwebs.com>2005-04-19 17:24:24 +0000
committerStef Walter <stef@memberwebs.com>2005-04-19 17:24:24 +0000
commit6fab96c700f8a15b486c292e70c8fdb5d31121b2 (patch)
tree0262fbfd99f0954bed556599a6daaf983c566b6c /src/xmlfixups.cpp
parentc91a548602ca74b5989eb046bc9c906b81e0ae20 (diff)
Added support for character styles.
Diffstat (limited to 'src/xmlfixups.cpp')
-rw-r--r--src/xmlfixups.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/xmlfixups.cpp b/src/xmlfixups.cpp
index eb6fcb7..458798a 100644
--- a/src/xmlfixups.cpp
+++ b/src/xmlfixups.cpp
@@ -42,10 +42,10 @@
#include "tags.h"
static const char* kNoDuplicates[] =
- { kElB, kElU, kElI, kElFont, kElHide, kElSuper, kElSub, NULL };
+ { kElB, kElU, kElI, kElFont, kElHide, kElSuper, kElSub, kElSpan, NULL };
static const char* kRequireAttrs[] =
- { kElFont, NULL };
+ { kElFont, kElSpan, NULL };
static const char* kRemoveTags[] =
{ kElDest, kElListdef, kElListtable, kElFontTable, kElFontDef, NULL };
@@ -503,6 +503,17 @@ void XmlFixups::runPassTwo(const DOM::Document& doc)
continue; // Current element no longer valid
}
+ else if(name == kElSpan)
+ {
+ // Change style attribute on spans to name
+ if(haveStyles && el.hasAttribute(kElStyle))
+ {
+ DOM::Element style = styles.get(el.getAttribute(kElStyle));
+ if(style != NULL)
+ el.setAttribute(kElStyle, style.getAttribute(kAtName));
+ }
+ }
+
// Change id attribute on fonts to name
if(haveFonts && name == kElFont)
{