diff options
author | Kurt Zenker <kz@openoffice.org> | 2003-11-18 15:24:46 +0000 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2003-11-18 15:24:46 +0000 |
commit | 47bd9ffbd6561739a77494d8214cf24f4d9de993 (patch) | |
tree | 18403d1a4f251ef2f3c7a025d9249be224696f84 /qadevOOo/tests/java/ifc/style/_CharacterProperties.java | |
parent | 7a43235b5000994bbab07c304c1c39fcea537412 (diff) |
INTEGRATION: CWS qadev13 (1.2.6); FILE MERGED
2003/11/04 15:15:25 cn 1.2.6.2: CHG: #i21824# CharStyleNames and CharStyleName needs spcial handling
2003/10/28 15:58:47 cn 1.2.6.1: CHG: #i21824# CharStyleNames needs spcial handling
Diffstat (limited to 'qadevOOo/tests/java/ifc/style/_CharacterProperties.java')
-rw-r--r-- | qadevOOo/tests/java/ifc/style/_CharacterProperties.java | 56 |
1 files changed, 49 insertions, 7 deletions
diff --git a/qadevOOo/tests/java/ifc/style/_CharacterProperties.java b/qadevOOo/tests/java/ifc/style/_CharacterProperties.java index ec8549be55b6..7defa0a4a349 100644 --- a/qadevOOo/tests/java/ifc/style/_CharacterProperties.java +++ b/qadevOOo/tests/java/ifc/style/_CharacterProperties.java @@ -2,9 +2,9 @@ * * $RCSfile: _CharacterProperties.java,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change:$Date: 2003-09-08 11:07:54 $ + * last change:$Date: 2003-11-18 16:24:46 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -61,12 +61,12 @@ package ifc.style; +import com.sun.star.beans.XPropertySet; import lib.MultiPropertyTest; + import util.ValueChanger; import util.utils; -import com.sun.star.beans.XPropertySet; - /** * Testing <code>com.sun.star.style.CharacterProperties</code> @@ -186,18 +186,41 @@ public class _CharacterProperties extends MultiPropertyTest { } /** - * Custom tester for style name properties. Switches between - * 'Citation' and 'Emphasis' names. + * Custom tester for style name properties. If object relations "STYLENAME1" + * and "STYLENAME2" exists, then testing with these strings, else switches + * between 'Citation' and 'Emphasis' names. */ protected PropertyTester StyleTester = new PropertyTester() { protected Object getNewValue(String propName, Object oldValue) { + String oStyleName1 = (String) tEnv.getObjRelation("STYLENAME1"); + String oStyleName2 = (String) tEnv.getObjRelation("STYLENAME2"); + if ((oStyleName1 != null) && (oStyleName2 != null)){ + log.println("use strings given by object relation: '" + + oStyleName1 + "' '" + oStyleName2 +"'"); + if (oldValue.equals( oStyleName1)) + return oStyleName2; + else + return oStyleName1; + } if (utils.isVoid(oldValue) || (oldValue.equals("Standard"))) - return "Citation"; else + return "Example"; else return "Emphasis"; } } ; /** + * Custom tester for style names properties. Switches between + * 'Citation' and 'Emphasis' names. + */ + protected PropertyTester StylesTester = new PropertyTester() { + protected Object getNewValue(String propName, Object oldValue) { + if (utils.isVoid(oldValue) || (oldValue.equals("Standard"))) + return new String[] {"Citation"}; else + return new String[] {"Emphasis"}; + } + } ; + + /** * If relations for paragraph and portion exist, then testing * of this property performed using these objects, else * testing is performed in common way. @@ -219,6 +242,24 @@ public class _CharacterProperties extends MultiPropertyTest { * of this property performed using these objects, else * testing is performed in common way. */ + public void _CharStyleNames() { + log.println("Testing with custom Property tester") ; + Object oPara = tEnv.getObjRelation("PARA"); + Object oPort = tEnv.getObjRelation("PORTION"); + if (oPara == null) { + testProperty("CharStyleNames", StylesTester) ; + } else { + String[] newNames = {"Standard"}; + changeProp((XPropertySet) oPara, + (XPropertySet) oPort,"CharStyleNames",new String[] {"Standard"}); + } + } + + /** + * If relations for paragraph and portion exist, then testing + * of this property performed using these objects, else + * testing is performed in common way. + */ public void _RubyCharStyleName() { log.println("Testing with custom Property tester") ; Object oPara = tEnv.getObjRelation("PARA"); @@ -247,6 +288,7 @@ public class _CharacterProperties extends MultiPropertyTest { changeProp((XPropertySet) oPara, (XPropertySet) oPort,"RubyAdjust", aShort); } + Short aShort = new Short((short) 1); } /** |