if (o != null && ((Boolean)o).booleanValue()) {
mDispose = true;
mbCreateFieldMaster = false;
XCell xCell = (XCell)tEnv.getObjRelation("MAKEENTRYINCELL");
XSpreadsheetDocument xSheetDoc = (XSpreadsheetDocument)tEnv.getObjRelation("SPREADSHEET");
XInterface oObj = null;
XText oText = null;
XTextContent oContent = null;
XInterface aField = null;
try {
// we want to create an instance of ScCellFieldObj.
// to do this we must get an MultiServiceFactory.
XMultiServiceFactory _oMSF = (XMultiServiceFactory)
UnoRuntime.queryInterface(XMultiServiceFactory.class, xSheetDoc);
aField = (XInterface)
_oMSF.createInstance("com.sun.star.text.TextField.URL");
oContent = (XTextContent)
UnoRuntime.queryInterface(XTextContent.class, aField);
XSpreadsheets oSheets = xSheetDoc.getSheets() ;
XIndexAccess oIndexSheets = (XIndexAccess)
UnoRuntime.queryInterface(XIndexAccess.class, oSheets);
XSpreadsheet oSheet = (XSpreadsheet) AnyConverter.toObject(
new Type(XSpreadsheet.class),oIndexSheets.getByIndex(0));