Kaydet (Commit) d0f603a8 authored tarafından Oliver Bolte's avatar Oliver Bolte

INTEGRATION: CWS qadev15 (1.3.18); FILE MERGED

2003/12/18 17:20:19 sw 1.3.18.1: #114449#
üst c63761fc
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: UnoControlButton.java,v $ * $RCSfile: UnoControlButton.java,v $
* *
* $Revision: 1.3 $ * $Revision: 1.4 $
* *
* last change:$Date: 2003-09-08 13:03:28 $ * last change:$Date: 2004-01-05 20:42:55 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -60,17 +60,6 @@ ...@@ -60,17 +60,6 @@
************************************************************************/ ************************************************************************/
package mod._toolkit; package mod._toolkit;
import java.io.PrintWriter;
import lib.StatusException;
import lib.TestCase;
import lib.TestEnvironment;
import lib.TestParameters;
import util.FormTools;
import util.SOfficeFactory;
import util.WriterTools;
import util.utils;
import com.sun.star.awt.XControlModel; import com.sun.star.awt.XControlModel;
import com.sun.star.awt.XDevice; import com.sun.star.awt.XDevice;
import com.sun.star.awt.XGraphics; import com.sun.star.awt.XGraphics;
...@@ -88,18 +77,32 @@ import com.sun.star.uno.XInterface; ...@@ -88,18 +77,32 @@ import com.sun.star.uno.XInterface;
import com.sun.star.util.XCloseable; import com.sun.star.util.XCloseable;
import com.sun.star.view.XControlAccess; import com.sun.star.view.XControlAccess;
import java.io.PrintWriter;
import lib.StatusException;
import lib.TestCase;
import lib.TestEnvironment;
import lib.TestParameters;
import util.FormTools;
import util.SOfficeFactory;
import util.WriterTools;
import util.utils;
public class UnoControlButton extends TestCase { public class UnoControlButton extends TestCase {
XTextDocument xTextDoc; XTextDocument xTextDoc;
XTextDocument xTD2; XTextDocument xTD2;
protected void initialize(TestParameters Param, PrintWriter log) { protected void initialize(TestParameters Param, PrintWriter log) {
SOfficeFactory SOF = SOfficeFactory.getFactory( (XMultiServiceFactory) Param.getMSF()); SOfficeFactory SOF = SOfficeFactory.getFactory(
(XMultiServiceFactory) Param.getMSF());
try { try {
log.println("creating a textdocument"); log.println("creating a textdocument");
xTextDoc = SOF.createTextDoc(null); xTextDoc = SOF.createTextDoc(null);
xTD2 = WriterTools.createTextDoc( (XMultiServiceFactory) Param.getMSF()); xTD2 = WriterTools.createTextDoc(
(XMultiServiceFactory) Param.getMSF());
} catch (com.sun.star.uno.Exception e) { } catch (com.sun.star.uno.Exception e) {
// Some exception occures.FAILED // Some exception occures.FAILED
e.printStackTrace(log); e.printStackTrace(log);
...@@ -110,18 +113,8 @@ public class UnoControlButton extends TestCase { ...@@ -110,18 +113,8 @@ public class UnoControlButton extends TestCase {
protected void cleanup(TestParameters tParam, PrintWriter log) { protected void cleanup(TestParameters tParam, PrintWriter log) {
log.println(" disposing xTextDoc "); log.println(" disposing xTextDoc ");
try { util.DesktopTools.closeDoc(xTextDoc);
XCloseable closer = (XCloseable) UnoRuntime.queryInterface( util.DesktopTools.closeDoc(xTD2);
XCloseable.class, xTextDoc);
closer.close(true);
closer = (XCloseable) UnoRuntime.queryInterface(XCloseable.class,
xTD2);
closer.close(true);
} catch (com.sun.star.util.CloseVetoException e) {
log.println("couldn't close document");
} catch (com.sun.star.lang.DisposedException e) {
log.println("couldn't close document");
}
} }
public TestEnvironment createTestEnvironment(TestParameters Param, public TestEnvironment createTestEnvironment(TestParameters Param,
......
...@@ -2,9 +2,9 @@ ...@@ -2,9 +2,9 @@
* *
* $RCSfile: UnoControlButtonModel.java,v $ * $RCSfile: UnoControlButtonModel.java,v $
* *
* $Revision: 1.3 $ * $Revision: 1.4 $
* *
* last change:$Date: 2003-09-08 13:03:40 $ * last change:$Date: 2004-01-05 20:43:27 $
* *
* The Contents of this file are made available subject to the terms of * The Contents of this file are made available subject to the terms of
* either of the following licenses * either of the following licenses
...@@ -60,21 +60,22 @@ ...@@ -60,21 +60,22 @@
************************************************************************/ ************************************************************************/
package mod._toolkit; package mod._toolkit;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.text.XTextDocument;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.XInterface;
import com.sun.star.util.XCloseable;
import java.io.PrintWriter; import java.io.PrintWriter;
import lib.StatusException; import lib.StatusException;
import lib.TestCase; import lib.TestCase;
import lib.TestEnvironment; import lib.TestEnvironment;
import lib.TestParameters; import lib.TestParameters;
import util.WriterTools; import util.WriterTools;
import util.utils; import util.utils;
import com.sun.star.lang.XMultiServiceFactory;
import com.sun.star.text.XTextDocument;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.XInterface;
import com.sun.star.util.XCloseable;
public class UnoControlButtonModel extends TestCase { public class UnoControlButtonModel extends TestCase {
XTextDocument xTextDoc; XTextDocument xTextDoc;
...@@ -84,7 +85,8 @@ public class UnoControlButtonModel extends TestCase { ...@@ -84,7 +85,8 @@ public class UnoControlButtonModel extends TestCase {
*/ */
protected void initialize(TestParameters tParam, PrintWriter log) { protected void initialize(TestParameters tParam, PrintWriter log) {
log.println("creating a textdocument"); log.println("creating a textdocument");
xTextDoc = WriterTools.createTextDoc( (XMultiServiceFactory) tParam.getMSF()); xTextDoc = WriterTools.createTextDoc(
(XMultiServiceFactory) tParam.getMSF());
} }
/** /**
...@@ -93,15 +95,7 @@ public class UnoControlButtonModel extends TestCase { ...@@ -93,15 +95,7 @@ public class UnoControlButtonModel extends TestCase {
protected void cleanup(TestParameters tParam, PrintWriter log) { protected void cleanup(TestParameters tParam, PrintWriter log) {
log.println(" disposing xTextDoc "); log.println(" disposing xTextDoc ");
try { util.DesktopTools.closeDoc(xTextDoc);
XCloseable closer = (XCloseable) UnoRuntime.queryInterface(
XCloseable.class, xTextDoc);
closer.close(true);
} catch (com.sun.star.util.CloseVetoException e) {
log.println("couldn't close document");
} catch (com.sun.star.lang.DisposedException e) {
log.println("couldn't close document");
}
} }
protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, protected synchronized TestEnvironment createTestEnvironment(TestParameters Param,
...@@ -109,8 +103,8 @@ public class UnoControlButtonModel extends TestCase { ...@@ -109,8 +103,8 @@ public class UnoControlButtonModel extends TestCase {
XInterface oObj = null; XInterface oObj = null;
try { try {
oObj = (XInterface) ( (XMultiServiceFactory) Param.getMSF()) oObj = (XInterface) ((XMultiServiceFactory) Param.getMSF()).createInstance(
.createInstance("com.sun.star.awt.UnoControlButtonModel"); "com.sun.star.awt.UnoControlButtonModel");
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(log); e.printStackTrace(log);
throw new StatusException("Couldn't create object", e); throw new StatusException("Couldn't create object", e);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment