} else if (xServiceInfo
.supportsService("com.sun.star.text.GlobalDocument")) {
XTextDocument xTextDocument = (XTextDocument) UnoRuntime
.queryInterface(XTextDocument.class, xComponent);
if (xTextDocument != null) {
GlobalTextDocument document = new GlobalTextDocument(
xTextDocument, intitialProperties);
document.setServiceProvider(serviceProvider);
return document;
}
return null;
} else if (xServiceInfo
.supportsService("com.sun.star.sdb.OfficeDatabaseDocument")) {
XOfficeDatabaseDocument xOfficeDatabaseDocument = (XOfficeDatabaseDocument) UnoRuntime
.queryInterface(XOfficeDatabaseDocument.class, xComponent);
if (xOfficeDatabaseDocument != null) {
DatabaseDocument document = new DatabaseDocument(
xOfficeDatabaseDocument, intitialProperties);
document.setServiceProvider(serviceProvider);
return document;
}
return null;
} else {
return null;