// to do a change, get an XPropertySet
xProp = (XPropertySet)tEnv.getObjRelation("XChangesBatch.PropertySet"); try { if (originalElement == null && xProp != null)
originalElement = xProp.getPropertyValue(elementName);
} catch(com.sun.star.uno.Exception e) { thrownew StatusException("Could not get property '" + elementName + "'.", e);
}
// or get an XNameReplace
xNameReplace = (XNameReplace)tEnv.getObjRelation("XChangesBatch.NameReplace"); try { if (originalElement == null && xNameReplace != null)
originalElement = xNameReplace.getByName(elementName);
} catch(com.sun.star.uno.Exception e) { thrownew StatusException("Could not get element by name '" + elementName + "'.", e);
}
publicvoid _getPendingChanges() {
requiredMethod("hasPendingChanges()");
ElementChange[]changes = oObj.getPendingChanges(); if (changes == null) {
log.println("Returned changes was 'null'");
log.println("It should have been 1 change.");
tRes.tested("getPendingChanges()", false);
} elseif (changes.length != 1) { int amount = changes.length;
log.println("Found not the right number of changes: " + amount);
log.println("It should have been 1 change."); for (int i=0; i<amount; i++) {
System.out.println("Detailed Change " + i + " -> new Element: '" +
changes[i].Element.toString() + "' ReplacedElement: '" +
changes[i].ReplacedElement.toString() + "'");
}
tRes.tested("getPendingChanges()", false);
} else { boolean result = changes[0].ReplacedElement.equals(originalElement);
result &= changes[0].Element.equals(changeElement);
tRes.tested("getPendingChanges()", result);
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.