diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2012-12-07 12:14:11 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-12-07 12:14:22 +0100 |
commit | 16383552c8477ac4620d6260a2b7981a9a6aaf17 (patch) | |
tree | 33e22d25cf2a8ed2d9c58a34c9261e832f690738 /qadevOOo/tests | |
parent | Unused variables (diff) | |
download | core-16383552c8477ac4620d6260a2b7981a9a6aaf17.tar.gz core-16383552c8477ac4620d6260a2b7981a9a6aaf17.zip |
Use XSynchronousDispatch to avoid races
Change-Id: I517ae0f3a17e769da20219d69d7ff4bac44623cd
Diffstat (limited to 'qadevOOo/tests')
-rw-r--r-- | qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeaderArea.java | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeaderArea.java b/qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeaderArea.java index e1b50192dabb..d58e374caab5 100644 --- a/qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeaderArea.java +++ b/qadevOOo/tests/java/mod/_sc/ScAccessiblePageHeaderArea.java @@ -37,9 +37,9 @@ import com.sun.star.accessibility.XAccessibleStateSet; import com.sun.star.awt.XWindow; import com.sun.star.container.XIndexAccess; import com.sun.star.frame.XController; -import com.sun.star.frame.XDispatch; import com.sun.star.frame.XDispatchProvider; import com.sun.star.frame.XModel; +import com.sun.star.frame.XSynchronousDispatch; import com.sun.star.lang.XMultiServiceFactory; import com.sun.star.sheet.XSpreadsheet; import com.sun.star.sheet.XSpreadsheetDocument; @@ -124,18 +124,15 @@ public class ScAccessiblePageHeaderArea extends TestCase { aParseURL[0].Complete = ".uno:PrintPreview"; xParser.parseStrict(aParseURL); URL aURL = aParseURL[0]; - XDispatch xDispatcher = xDispProv.queryDispatch(aURL, "", 0); - if(xDispatcher != null) - xDispatcher.dispatch( aURL, null ); + XSynchronousDispatch xDispatcher = UnoRuntime.queryInterface( + XSynchronousDispatch.class, + xDispProv.queryDispatch(aURL, "", 0)); + xDispatcher.dispatch( aURL, null ); } catch (com.sun.star.uno.Exception e) { log.println("Couldn't change mode"); throw new StatusException(Status.failed("Couldn't change mode")); } - try { - Thread.sleep(500); - } catch (InterruptedException ex) {} - AccessibilityTools at = new AccessibilityTools(); XWindow xWindow = at.getCurrentContainerWindow( (XMultiServiceFactory) Param.getMSF(), aModel); @@ -213,4 +210,4 @@ public class ScAccessiblePageHeaderArea extends TestCase { throw new StatusException( "Couldn't create document ", e ); } } -}
\ No newline at end of file +} |