Hello, we have the following problem using Aspose Cells 18.03 for Java.
Having a simple document (Document.xlsx) with a link, the link is formatted in this example cursive.
After running the application and setting a new text for the link, the formatting is lost (DocumentNew.xlsx).
How do I keep the formatting?
issue4.zip (13.0 KB)
public static void main(String[] args) {
try {
com.aspose.cells.License wordsLicense = new com.aspose.cells.License();
InputStream lisenseStream = new FileInputStream("Aspose.Total.Java.lic");
wordsLicense.setLicense(lisenseStream);
lisenseStream.close();
String base = "issue4/";
InputStream inputStream = new FileInputStream(base + "Document.xlsx");
Workbook document = new Workbook(inputStream);
inputStream.close();
WorksheetCollection worksheets = document.getWorksheets();
for (int i = 0; i < worksheets.getCount(); i++) {
Worksheet worksheet = worksheets.get(i);
HyperlinkCollection hyperlinks = worksheet.getHyperlinks();
for (int a = 0; a < hyperlinks.getCount(); a++) {
Hyperlink hyperlink = hyperlinks.get(a);
hyperlink.setTextToDisplay("NEW TEXT");
}
}
document.save(base + "DocumentNew.xlsx", SaveFormat.XLSX);
} catch (Throwable e) {
e.printStackTrace();
}
}