Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
See what's new at GitLab
4
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
O
odfhistory
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
2
Merge Requests
2
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
odfplugfest
odfhistory
Commits
c5bbcc51
Commit
c5bbcc51
authored
Oct 09, 2015
by
Jos van den Oever
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add "missing" styles to text:link.
parent
e513075b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
0 deletions
+16
-0
src/odf/OdfNormalizer.java
src/odf/OdfNormalizer.java
+16
-0
No files found.
src/odf/OdfNormalizer.java
View file @
c5bbcc51
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment