Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -766,6 +766,39 @@ public void setBackColor(long value) {
}
}

public String getHyperlink() {
try {
Hyperlink link = pCells[1].getHyperlink();
if (link != null) {
return link.getAddress();
}
} catch (Exception e) {
m_errAccess.setErrDes("Invalid cell value");
m_errAccess.setErrCod((short) 7);
}
return "";
}

public void setHyperLink(String value) {
if (readonly) {
m_errAccess.setErrDes("Can not modify a readonly document");
m_errAccess.setErrCod((short) 13);
return;
}

try {
CreationHelper createHelper = pWorkbook.getCreationHelper();
Hyperlink link = createHelper.createHyperlink(org.apache.poi.common.usermodel.HyperlinkType.URL);
link.setAddress(value);
for (int i = 1; i <= cntCells; i++) {
pCells[i].setHyperlink(link);
}
} catch (Exception e) {
m_errAccess.setErrDes("Invalid cell value");
m_errAccess.setErrCod((short) 7);
}
}

protected void copyPropertiesStyle(CellStyle dest, CellStyle source) {
dest.cloneStyleFrom(source);
}
Expand Down
Loading