Commit c5bbcc51 authored by Jos van den Oever's avatar Jos van den Oever

Add "missing" styles to text:link.

parent e513075b
......@@ -386,6 +386,7 @@ public class OdfNormalizer {
removeUnneededFontAttributes(doc);
fixBibliographyStyles(doc);
setLinkStyle(doc);
IdAndReferenceNormalizer n = new IdAndReferenceNormalizer(doc);
// fonts
......@@ -683,6 +684,21 @@ public class OdfNormalizer {
}
}
// workaround for LO behaviour where text:a without a style gets a default
// style
private void setLinkStyle(Document doc) {
XPathResult<Element> es = XPath.elementIterator(doc, "//text:a");
for (Element e : es) {
if (!e.hasAttributeNS(NC.text, "style-name")) {
e.setAttributeNS(NC.text, "text:style-name", "Internet_20_link");
}
if (!e.hasAttributeNS(NC.text, "visited-style-name")) {
e.setAttributeNS(NC.text, "text:visited-style-name",
"Visited_20_Internet_20_Link");
}
}
}
static private void fixBookmarkStart(Document document) {
// replace each text:bookmark that has a corresponding text:bookmark-end
// by text:bookmark-start
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment