XInterface oObj = null;
XPropertySet PropSet;
XNameAccess PageStyles = null;
XStyle StdStyle = null;
XTextContent oContent = null;
XInterface aField = null;
XStyleFamiliesSupplier StyleFam = (XStyleFamiliesSupplier)
UnoRuntime.queryInterface(
XStyleFamiliesSupplier.class,
xSpreadsheetDoc );
XNameAccess StyleFamNames = StyleFam.getStyleFamilies();
try{
PageStyles = (XNameAccess) AnyConverter.toObject(
new Type(XNameAccess.class),StyleFamNames.getByName("PageStyles"));
StdStyle = (XStyle) AnyConverter.toObject(
new Type(XStyle.class),PageStyles.getByName("Default"));
} catch(com.sun.star.lang.WrappedTargetException e){
e.printStackTrace(log);
throw new StatusException("Couldn't get by name", e);
} catch(com.sun.star.container.NoSuchElementException e){
e.printStackTrace(log);
throw new StatusException("Couldn't get by name", e);
} catch(com.sun.star.lang.IllegalArgumentException e){
e.printStackTrace(log);
throw new StatusException("Couldn't get by name", e);
}
//get the property-set
PropSet = (XPropertySet)
UnoRuntime.queryInterface(XPropertySet.class, StdStyle);
XHeaderFooterContent RPHC = null;
// creation of testobject here
// first we write what we are intend to do to log file
log.println( "creating a test environment" );
try {
RPHC = (XHeaderFooterContent) AnyConverter.toObject(
new Type(XHeaderFooterContent.class),
PropSet.getPropertyValue("RightPageHeaderContent"));
} catch (com.sun.star.lang.WrappedTargetException e) {
e.printStackTrace(log);
throw new StatusException("Couldn't get HeaderContent", e);
} catch (com.sun.star.beans.UnknownPropertyException e) {
e.printStackTrace(log);
throw new StatusException("Couldn't get HeaderContent", e);
} catch (com.sun.star.lang.IllegalArgumentException e) {
e.printStackTrace(log);
throw new StatusException("Couldn't get HeaderContent", e);
}
XText left = RPHC.getLeftText();
XMultiServiceFactory oDocMSF = (XMultiServiceFactory)
UnoRuntime.queryInterface(
XMultiServiceFactory.class,
xSpreadsheetDoc );
XTextContent the_Field = null;
try {
oObj = (XInterface)
oDocMSF.createInstance( "com.sun.star.text.TextField.Time" );
the_Field = (XTextContent)