diff options
Diffstat (limited to 'qadevOOo/tests/java/mod/_sw/SwXAutoTextGroup.java')
-rw-r--r-- | qadevOOo/tests/java/mod/_sw/SwXAutoTextGroup.java | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/qadevOOo/tests/java/mod/_sw/SwXAutoTextGroup.java b/qadevOOo/tests/java/mod/_sw/SwXAutoTextGroup.java index 3e021d7267c9..4095e19e3725 100644 --- a/qadevOOo/tests/java/mod/_sw/SwXAutoTextGroup.java +++ b/qadevOOo/tests/java/mod/_sw/SwXAutoTextGroup.java @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -74,7 +74,7 @@ import util.utils; */ public class SwXAutoTextGroup extends TestCase { XTextDocument xTextDoc; - + /** * Creates text document. */ @@ -88,7 +88,7 @@ public class SwXAutoTextGroup extends TestCase { throw new StatusException( "Couldn't create document", e ); } } - + /** * Disposes text document. */ @@ -96,11 +96,11 @@ public class SwXAutoTextGroup extends TestCase { log.println( " disposing xTextDoc " ); util.DesktopTools.closeDoc(xTextDoc); } - + /** * Creating a Testenvironment for the interfaces to be tested. * Creates an instance of the service - * <code>com.sun.star.text.AutoTextContainer</code>, then creates a new + * <code>com.sun.star.text.AutoTextContainer</code>, then creates a new * group into the container.<p> * Object relations created : * <ul> @@ -109,10 +109,10 @@ public class SwXAutoTextGroup extends TestCase { * </ul> */ protected synchronized TestEnvironment createTestEnvironment(TestParameters Param, PrintWriter log) { - + XInterface oObj = null; XAutoTextContainer oContainer; - + log.println( "creating a test environment" ); try { XMultiServiceFactory myMSF = (XMultiServiceFactory)Param.getMSF(); @@ -123,15 +123,15 @@ public class SwXAutoTextGroup extends TestCase { throw new StatusException("Couldn't create AutoTextContainer", e); } String myGroupName="myNewGroup2*1"; - + XAutoTextContainer xATC = (XAutoTextContainer) UnoRuntime.queryInterface(XAutoTextContainer.class, oContainer); - + try { log.println("removing element with name '" + myGroupName + "'"); xATC.removeByName(myGroupName); } catch (com.sun.star.container.NoSuchElementException e) { } - + try { log.println("adding element with name '" + myGroupName + "'"); xATC.insertNewByName(myGroupName); @@ -142,37 +142,37 @@ public class SwXAutoTextGroup extends TestCase { ex.printStackTrace(log); throw new StatusException("could not insert '"+myGroupName+"' into container",ex); } - - + + XNameAccess oContNames = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class, oContainer); - + if (Param.getBool(util.PropertyName.DEBUG_IS_ACTIVE)){ String contNames[] = oContNames.getElementNames(); for (int i =0; i < contNames.length; i++){ log.println("ContainerNames[ "+ i + "]: " + contNames[i]); } } - + try{ oObj = (XInterface) AnyConverter.toObject(new Type(XInterface.class),oContNames.getByName(myGroupName)); } catch (com.sun.star.uno.Exception e) { e.printStackTrace(log); throw new StatusException("Couldn't get AutoTextGroup '"+myGroupName + "'", e); } - + log.println("ImplementationName " + utils.getImplName(oObj)); - + log.println( "creating a new environment for AutoTextGroup object" ); TestEnvironment tEnv = new TestEnvironment( oObj ); - + XText oText = xTextDoc.getText(); oText.insertString(oText.getStart(), "New AutoText", true); - + log.println( "adding TextRange as mod relation to environment" ); tEnv.addObjRelation("TextRange", oText); - + return tEnv; } // finish method getTestEnvironment - - + + } // finish class SwXAutoTextGroup |