Skip to content

Commit

Permalink
Fix the correct PPTX handling of hyperlink decoration (#1928)
Browse files Browse the repository at this point in the history
  • Loading branch information
speckyspooky authored Oct 1, 2024
1 parent b092cc2 commit 12e0b7c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,8 @@ private void setTextProperty(String fontName, float fontSize, int fontStyle, Col
}

void setHyperlink(HyperlinkDef link) {// TODO: set links for bookmark
if (link != null) {
// power point doesn't support undecorated hyperlink
if (link != null && link.isHasHyperlinkDecoration()) {
String hyperlink = null;
try {
hyperlink = URLEncoder.encode(link.getLink(), "UTF-8");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -381,9 +381,7 @@ private void setTextProperty(String tag, TextStyle style) {
}
canvas.setBackgroundColor(style.getColor());
setTextFont(info.getFontName());
if (link != null && link.isHasHyperlinkDecoration()) {
canvas.setHyperlink(link);
}
canvas.setHyperlink(link);
canvas.setBookmark(bmk_relationshipid);
writer.closeTag(tag);
}
Expand Down Expand Up @@ -424,9 +422,7 @@ private void startBlockText(int startX, int startY, int width, int height, Conta
writer.attribute("id", shapeId);
writer.attribute("name", "TextBox " + shapeId);
// hyperlink decoration at text area
if (link != null && !link.isHasHyperlinkDecoration()) {
canvas.setHyperlink(link);
}
canvas.setHyperlink(link);
writer.closeTag("p:cNvPr");
writer.openTag("p:cNvSpPr");
writer.attribute("txBox", "1");
Expand Down

0 comments on commit 12e0b7c

Please sign in to comment.