I'm really stuck trying to find out how to force a programmatic refresh of openoffice writer (3.3) cell calculations when the cell values are bookmarks and the bookmarks are updated programmatically (via UNO calls in Java).
Example
| start | stop | duration |
| 9:30 | 11:30 | = <A2>-<B2> | <= cell formula
This works fine when the user is manually editing the table, the value is updated when they move to the next cell. However if I update the values programmatically by inserting text into bookmarks in the cells the calculated cells do not update. They will update if you click in the table but I would like this to be automatic.
Bookmark are in the table like this.
| start | stop | duration |
| <start0> | <stop0> | = <A2>-<B2> |
Example code to update the bookmark:
XBookmarksSupplier xBookmarksSupplier = (XBookmarksSupplier) UnoRuntime.queryInterface(XBookmarksSupplier.class, document);
XNameAccess xNamedBookmarks = xBookmarksSupplier.getBookmarks();
Object bookmark = xNamedBookmarks.getByName("stop0");
XTextContent xBookmarkContent = (XTextContent) UnoRuntime.queryInterface(XTextContent.class, bookmark);
xBookmarkContent.getAnchor().setString("11:30");
// code needed to force calculation of duration cell