}
private synchronized boolean disposeOffice(XMultiServiceFactory msf,
TestParameters param)
{
XDesktop desk = null;
debug = param.getBool(PropertyName.DEBUG_IS_ACTIVE);
boolean result = true;
if (msf != null)
{
// disable QuickStarter
try
{
Object quickStarter = msf.createInstance("com.sun.star.office.Quickstart");
XFastPropertySet fps = (XFastPropertySet) UnoRuntime.queryInterface(XFastPropertySet.class, quickStarter);
fps.setFastPropertyValue(0, false);
}
catch (com.sun.star.uno.Exception ex)
{
dbg("ERROR: Could not disable QuickStarter: " + ex.toString());
}
try
{
desk = (XDesktop) UnoRuntime.queryInterface(XDesktop.class,
msf.createInstance(
"com.sun.star.frame.Desktop"));
msf = null;
if (desk != null)
{
final boolean allClosed = closeAllWindows(desk);
if (!allClosed)
{
dbg("Couldn't close all office windows!");
}
dbg("Trying to terminate the desktop");
desk.terminate();
dbg("Desktop terminated");
try
{
final int closeTime = param.getInt(util.PropertyName.OFFICE_CLOSE_TIME_OUT);