1*07d7dbdcSHerbert Dürr /************************************************************** 2*07d7dbdcSHerbert Dürr * 3*07d7dbdcSHerbert Dürr * Licensed to the Apache Software Foundation (ASF) under one 4*07d7dbdcSHerbert Dürr * or more contributor license agreements. See the NOTICE file 5*07d7dbdcSHerbert Dürr * distributed with this work for additional information 6*07d7dbdcSHerbert Dürr * regarding copyright ownership. The ASF licenses this file 7*07d7dbdcSHerbert Dürr * to you under the Apache License, Version 2.0 (the 8*07d7dbdcSHerbert Dürr * "License"); you may not use this file except in compliance 9*07d7dbdcSHerbert Dürr * with the License. You may obtain a copy of the License at 10*07d7dbdcSHerbert Dürr * 11*07d7dbdcSHerbert Dürr * http://www.apache.org/licenses/LICENSE-2.0 12*07d7dbdcSHerbert Dürr * 13*07d7dbdcSHerbert Dürr * Unless required by applicable law or agreed to in writing, 14*07d7dbdcSHerbert Dürr * software distributed under the License is distributed on an 15*07d7dbdcSHerbert Dürr * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*07d7dbdcSHerbert Dürr * KIND, either express or implied. See the License for the 17*07d7dbdcSHerbert Dürr * specific language governing permissions and limitations 18*07d7dbdcSHerbert Dürr * under the License. 19*07d7dbdcSHerbert Dürr * 20*07d7dbdcSHerbert Dürr *************************************************************/ 21*07d7dbdcSHerbert Dürr 22eba4d44aSLiu Zhe package fvt.uno.sw.puretext; 23eba4d44aSLiu Zhe 24eba4d44aSLiu Zhe import static org.junit.Assert.*; 25eba4d44aSLiu Zhe 26eba4d44aSLiu Zhe import org.junit.After; 27eba4d44aSLiu Zhe import org.junit.Before; 28eba4d44aSLiu Zhe import org.junit.Ignore; 29eba4d44aSLiu Zhe import org.junit.Test; 30eba4d44aSLiu Zhe import org.openoffice.test.common.FileUtil; 31eba4d44aSLiu Zhe import org.openoffice.test.common.Testspace; 32eba4d44aSLiu Zhe import org.openoffice.test.uno.UnoApp; 33eba4d44aSLiu Zhe import com.sun.star.text.*; 34eba4d44aSLiu Zhe import com.sun.star.beans.*; 35eba4d44aSLiu Zhe import com.sun.star.frame.XStorable; 36eba4d44aSLiu Zhe import com.sun.star.uno.UnoRuntime; 37eba4d44aSLiu Zhe 38eba4d44aSLiu Zhe 39eba4d44aSLiu Zhe public class CharacterUnderline { 40eba4d44aSLiu Zhe private static final UnoApp app = new UnoApp(); 41eba4d44aSLiu Zhe XText xText = null; 42eba4d44aSLiu Zhe 43eba4d44aSLiu Zhe @Before setUp()44eba4d44aSLiu Zhe public void setUp() throws Exception { 45eba4d44aSLiu Zhe app.start(); 46eba4d44aSLiu Zhe 47eba4d44aSLiu Zhe } 48eba4d44aSLiu Zhe 49eba4d44aSLiu Zhe @After tearDown()50eba4d44aSLiu Zhe public void tearDown() throws Exception { 51eba4d44aSLiu Zhe app.close(); 52eba4d44aSLiu Zhe } 53eba4d44aSLiu Zhe @Test@Ignore("Bug #120657 - [testUNO patch]underline color lost and individual words option disable when save to doc") testCharacterUnderlineSetting()54eba4d44aSLiu Zhe public void testCharacterUnderlineSetting() throws Exception { 55eba4d44aSLiu Zhe XTextDocument xTextDocument = (XTextDocument) UnoRuntime.queryInterface(XTextDocument.class, app.newDocument("swriter"));// new a text document 56eba4d44aSLiu Zhe xText = xTextDocument.getText(); 57eba4d44aSLiu Zhe xText.setString("We are Chinese,they are American. We are all living in one earth!" 58eba4d44aSLiu Zhe + "and we all love our home very much!!!We are Chinese,they are American. " + 59eba4d44aSLiu Zhe "We are all living in one earth!We are Chinese,they are American. " + 60eba4d44aSLiu Zhe "We are all living in one earth!We are Chinese,they are American. " + 61eba4d44aSLiu Zhe "We are all living in one earth!We are Chinese,they are American. " + 62eba4d44aSLiu Zhe "We are all living in one earth!We are Chinese,they are American. " + 63eba4d44aSLiu Zhe "We are all living in one earth!We are Chinese,they are American." + 64eba4d44aSLiu Zhe " We are all living in one earth!We are Chinese,they are American. " + 65eba4d44aSLiu Zhe "We are all living in one earth!We are Chinese,they are American. " + 66eba4d44aSLiu Zhe "We are all living in one earth!We are Chinese,they are American. " + 67eba4d44aSLiu Zhe "We are all living in one earth!We are Chinese,they are American. " + 68eba4d44aSLiu Zhe "We are all living in one earth!We are Chinese,they are American. " + 69eba4d44aSLiu Zhe "We are all living in one earth!We are Chinese,they are American. " + 70eba4d44aSLiu Zhe "We are all living in one earth!We are Chinese,they are American. " + 71eba4d44aSLiu Zhe "We are all living in one earth!We are Chinese,they are American. " + 72eba4d44aSLiu Zhe "We are all living in one earth!We are Chinese,they are American. " + 73eba4d44aSLiu Zhe "We are all living in one earth!We are Chinese,they are American. " + 74eba4d44aSLiu Zhe "We are all living in one earth!We are Chinese,they are American. " + 75eba4d44aSLiu Zhe "We are all living in one earth!We are Chinese,they are American. " + 76eba4d44aSLiu Zhe "We are all living in one earth!We are all living in one earth!We are Chinese,they are American. " + 77eba4d44aSLiu Zhe "We are all living in one earth!We are all living in one earth!We are Chinese,they are American. " + 78eba4d44aSLiu Zhe "We are all living in one earth!We are all living in one earth!We are Chinese,they are American. " + 79eba4d44aSLiu Zhe "We are all living in one earth!We are all living in one earth!We are Chinese,they are American. " + 80eba4d44aSLiu Zhe "We are all living in one earth!We are all living in one earth!We are Chinese,they are American. " + 81eba4d44aSLiu Zhe "We are all living in one earth!We are all living in one earth!We are Chinese,they are American. " + 82eba4d44aSLiu Zhe "We are all living in one earth!"); 83eba4d44aSLiu Zhe // create text cursor for selecting and formatting text 84eba4d44aSLiu Zhe XTextCursor xTextCursor = xText.createTextCursor(); 85eba4d44aSLiu Zhe XPropertySet xCursorProps = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xTextCursor); 86eba4d44aSLiu Zhe xTextCursor.gotoStart(false); 87eba4d44aSLiu Zhe xTextCursor.goRight((short) 100, true); 88eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharWordMode", true); 89eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharUnderline", new Short(com.sun.star.awt.FontUnderline.DOUBLE)); 90eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharUnderlineHasColor", true); 91eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharUnderlineColor", 0x00FF00FF); 92eba4d44aSLiu Zhe xTextCursor.gotoRange(xTextCursor, false); 93eba4d44aSLiu Zhe xTextCursor.goRight((short) 100, true); 94eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharWordMode", false); 95eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharUnderline", new Short(com.sun.star.awt.FontUnderline.WAVE)); 96eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharUnderlineHasColor", true); 97eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharUnderlineColor", 0x00FF00FF); 98eba4d44aSLiu Zhe xTextCursor.gotoRange(xTextCursor, false); 99eba4d44aSLiu Zhe xTextCursor.goRight((short) 100, true); 100eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharWordMode", false); 101eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharUnderline", new Short(com.sun.star.awt.FontUnderline.SMALLWAVE)); 102eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharUnderlineHasColor", true); 103eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharUnderlineColor", 0x00FF00FF); 104eba4d44aSLiu Zhe xTextCursor.gotoRange(xTextCursor, false); 105eba4d44aSLiu Zhe xTextCursor.goRight((short) 100, true); 106eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharWordMode", true); 107eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharUnderline", new Short(com.sun.star.awt.FontUnderline.SINGLE)); 108eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharUnderlineHasColor", true); 109eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharUnderlineColor", 0x0000FF00); 110eba4d44aSLiu Zhe xTextCursor.gotoRange(xTextCursor, false); 111eba4d44aSLiu Zhe xTextCursor.goRight((short) 100, true); 112eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharWordMode", true); 113eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharUnderline", new Short(com.sun.star.awt.FontUnderline.NONE)); 114eba4d44aSLiu Zhe xTextCursor.gotoRange(xTextCursor, false); 115eba4d44aSLiu Zhe xTextCursor.goRight((short) 100, true); 116eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharWordMode", false); 117eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharUnderline", new Short(com.sun.star.awt.FontUnderline.LONGDASH)); 118eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharUnderlineHasColor", true); 119eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharUnderlineColor", 0x0000FF00); 120eba4d44aSLiu Zhe xTextCursor.gotoRange(xTextCursor, false); 121eba4d44aSLiu Zhe xTextCursor.goRight((short) 100, true); 122eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharWordMode", false); 123eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharUnderline", new Short(com.sun.star.awt.FontUnderline.DOUBLEWAVE)); 124eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharUnderlineHasColor", true); 125eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharUnderlineColor", 0x0000FF00); 126eba4d44aSLiu Zhe xTextCursor.gotoRange(xTextCursor, false); 127eba4d44aSLiu Zhe xTextCursor.goRight((short) 100, true); 128eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharWordMode", false); 129eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharUnderline", new Short(com.sun.star.awt.FontUnderline.DONTKNOW)); 130eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharUnderlineHasColor", true); 131eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharUnderlineColor", 0x0000FF00); 132eba4d44aSLiu Zhe xTextCursor.gotoRange(xTextCursor, false); 133eba4d44aSLiu Zhe xTextCursor.goRight((short) 100, true); 134eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharWordMode", false); 135eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharUnderline", new Short(com.sun.star.awt.FontUnderline.DOTTED)); 136eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharUnderlineHasColor", true); 137eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharUnderlineColor", 0x0000FF00); 138eba4d44aSLiu Zhe xTextCursor.gotoRange(xTextCursor, false); 139eba4d44aSLiu Zhe xTextCursor.goRight((short) 100, true); 140eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharWordMode", false); 141eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharUnderline", new Short(com.sun.star.awt.FontUnderline.DASHDOTDOT)); 142eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharUnderlineHasColor", true); 143eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharUnderlineColor", 0x0000FF00); 144eba4d44aSLiu Zhe xTextCursor.gotoRange(xTextCursor, false); 145eba4d44aSLiu Zhe xTextCursor.goRight((short) 100, true); 146eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharWordMode", false); 147eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharUnderline", new Short(com.sun.star.awt.FontUnderline.DASHDOT)); 148eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharUnderlineHasColor", true); 149eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharUnderlineColor", 0x0000FF00); 150eba4d44aSLiu Zhe xTextCursor.gotoRange(xTextCursor, false); 151eba4d44aSLiu Zhe xTextCursor.goRight((short) 100, true); 152eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharWordMode", false); 153eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharUnderline", new Short(com.sun.star.awt.FontUnderline.DASH)); 154eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharUnderlineHasColor", true); 155eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharUnderlineColor", 0x0000FF00); 156eba4d44aSLiu Zhe xTextCursor.gotoRange(xTextCursor, false); 157eba4d44aSLiu Zhe xTextCursor.goRight((short) 100, true); 158eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharWordMode", false); 159eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharUnderline", new Short(com.sun.star.awt.FontUnderline.BOLDWAVE)); 160eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharUnderlineHasColor", true); 161eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharUnderlineColor", 0x0000FF00); 162eba4d44aSLiu Zhe xTextCursor.gotoRange(xTextCursor, false); 163eba4d44aSLiu Zhe xTextCursor.goRight((short) 100, true); 164eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharWordMode", false); 165eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharUnderline", new Short(com.sun.star.awt.FontUnderline.BOLDLONGDASH)); 166eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharUnderlineHasColor", true); 167eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharUnderlineColor", 0x0000FF00); 168eba4d44aSLiu Zhe xTextCursor.gotoRange(xTextCursor, false); 169eba4d44aSLiu Zhe xTextCursor.goRight((short) 100, true); 170eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharWordMode", false); 171eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharUnderline", new Short(com.sun.star.awt.FontUnderline.BOLDDOTTED)); 172eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharUnderlineHasColor", true); 173eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharUnderlineColor", 0x0000FF00); 174eba4d44aSLiu Zhe xTextCursor.gotoRange(xTextCursor, false); 175eba4d44aSLiu Zhe xTextCursor.goRight((short) 100, true); 176eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharWordMode", false); 177eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharUnderline", new Short(com.sun.star.awt.FontUnderline.BOLDDASHDOTDOT)); 178eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharUnderlineHasColor", true); 179eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharUnderlineColor", 0x0000FF00); 180eba4d44aSLiu Zhe xTextCursor.gotoRange(xTextCursor, false); 181eba4d44aSLiu Zhe xTextCursor.goRight((short) 100, true); 182eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharWordMode", false); 183eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharUnderline", new Short(com.sun.star.awt.FontUnderline.BOLDDASHDOT)); 184eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharUnderlineHasColor", true); 185eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharUnderlineColor", 0x0000FF00); 186eba4d44aSLiu Zhe xTextCursor.gotoRange(xTextCursor, false); 187eba4d44aSLiu Zhe xTextCursor.goRight((short) 100, true); 188eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharWordMode", false); 189eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharUnderline", new Short(com.sun.star.awt.FontUnderline.BOLDDASH)); 190eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharUnderlineHasColor", true); 191eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharUnderlineColor", 0x0000FF00); 192eba4d44aSLiu Zhe xTextCursor.gotoRange(xTextCursor, false); 193eba4d44aSLiu Zhe xTextCursor.goRight((short) 100, true); 194eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharWordMode", false); 195eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharUnderline", new Short(com.sun.star.awt.FontUnderline.BOLD)); 196eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharUnderlineHasColor", true); 197eba4d44aSLiu Zhe xCursorProps.setPropertyValue("CharUnderlineColor", 0x0000FF00); 198eba4d44aSLiu Zhe //save to odt 199eba4d44aSLiu Zhe XStorable xStorable_odt = (XStorable) UnoRuntime.queryInterface(XStorable.class, xTextDocument); 200eba4d44aSLiu Zhe PropertyValue[] aStoreProperties_odt = new PropertyValue[2]; 201eba4d44aSLiu Zhe aStoreProperties_odt[0] = new PropertyValue(); 202eba4d44aSLiu Zhe aStoreProperties_odt[1] = new PropertyValue(); 203eba4d44aSLiu Zhe aStoreProperties_odt[0].Name = "Override"; 204eba4d44aSLiu Zhe aStoreProperties_odt[0].Value = true; 205eba4d44aSLiu Zhe aStoreProperties_odt[1].Name = "FilterName"; 206eba4d44aSLiu Zhe aStoreProperties_odt[1].Value = "StarOffice XML (Writer)"; 207eba4d44aSLiu Zhe xStorable_odt.storeToURL(FileUtil.getUrl(Testspace.getPath("output/test.odt")), aStoreProperties_odt); 208eba4d44aSLiu Zhe //save to doc 209eba4d44aSLiu Zhe XStorable xStorable_doc = (XStorable) UnoRuntime.queryInterface(XStorable.class, xTextDocument); 210eba4d44aSLiu Zhe PropertyValue[] aStoreProperties_doc = new PropertyValue[2]; 211eba4d44aSLiu Zhe aStoreProperties_doc[0] = new PropertyValue(); 212eba4d44aSLiu Zhe aStoreProperties_doc[1] = new PropertyValue(); 213eba4d44aSLiu Zhe aStoreProperties_doc[0].Name = "Override"; 214eba4d44aSLiu Zhe aStoreProperties_doc[0].Value = true; 215eba4d44aSLiu Zhe aStoreProperties_doc[1].Name = "FilterName"; 216eba4d44aSLiu Zhe aStoreProperties_doc[1].Value = "MS Word 97"; 217eba4d44aSLiu Zhe xStorable_doc.storeToURL(FileUtil.getUrl(Testspace.getPath("output/test.doc")), aStoreProperties_doc); 218eba4d44aSLiu Zhe app.closeDocument(xTextDocument); 219eba4d44aSLiu Zhe 220eba4d44aSLiu Zhe //reopen the document and assert row height setting 221eba4d44aSLiu Zhe XTextDocument assertDocument_odt=(XTextDocument)UnoRuntime.queryInterface(XTextDocument.class, app.loadDocument(Testspace.getPath("output/test.odt"))); 222eba4d44aSLiu Zhe XTextCursor xTextCursor_assert_odt = assertDocument_odt.getText().createTextCursor(); 223eba4d44aSLiu Zhe XPropertySet xCursorProps_assert_odt = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xTextCursor_assert_odt); 224eba4d44aSLiu Zhe 225eba4d44aSLiu Zhe xTextCursor_assert_odt.gotoStart(false); 226eba4d44aSLiu Zhe xTextCursor_assert_odt.goRight((short) 100, true); 227eba4d44aSLiu Zhe assertEquals("assert individual word setting",true,xCursorProps_assert_odt.getPropertyValue("CharWordMode")); 228eba4d44aSLiu Zhe assertEquals("assert underline is double",com.sun.star.awt.FontUnderline.DOUBLE,xCursorProps_assert_odt.getPropertyValue("CharUnderline")); 229eba4d44aSLiu Zhe assertEquals("assert has underline color is true",true,xCursorProps_assert_odt.getPropertyValue("CharUnderlineHasColor")); 230eba4d44aSLiu Zhe assertEquals("assert underline color",0x00FF00FF,xCursorProps_assert_odt.getPropertyValue("CharUnderlineColor")); 231eba4d44aSLiu Zhe xTextCursor_assert_odt.gotoRange(xTextCursor_assert_odt, false); 232eba4d44aSLiu Zhe xTextCursor_assert_odt.goRight((short) 100, true); 233eba4d44aSLiu Zhe assertEquals("assert individual word setting",false,xCursorProps_assert_odt.getPropertyValue("CharWordMode")); 234eba4d44aSLiu Zhe assertEquals("assert underline is wave",com.sun.star.awt.FontUnderline.WAVE,xCursorProps_assert_odt.getPropertyValue("CharUnderline")); 235eba4d44aSLiu Zhe assertEquals("assert has underline color is true",true,xCursorProps_assert_odt.getPropertyValue("CharUnderlineHasColor")); 236eba4d44aSLiu Zhe assertEquals("assert underline color",0x00FF00FF,xCursorProps_assert_odt.getPropertyValue("CharUnderlineColor")); 237eba4d44aSLiu Zhe xTextCursor_assert_odt.gotoRange(xTextCursor_assert_odt, false); 238eba4d44aSLiu Zhe xTextCursor_assert_odt.goRight((short) 100, true); 239eba4d44aSLiu Zhe assertEquals("assert individual word setting",false,xCursorProps_assert_odt.getPropertyValue("CharWordMode")); 240eba4d44aSLiu Zhe assertEquals("assert underline is smallwave",com.sun.star.awt.FontUnderline.SMALLWAVE,xCursorProps_assert_odt.getPropertyValue("CharUnderline")); 241eba4d44aSLiu Zhe assertEquals("assert has underline color is true",true,xCursorProps_assert_odt.getPropertyValue("CharUnderlineHasColor")); 242eba4d44aSLiu Zhe assertEquals("assert underline color",0x00FF00FF,xCursorProps_assert_odt.getPropertyValue("CharUnderlineColor")); 243eba4d44aSLiu Zhe xTextCursor_assert_odt.gotoRange(xTextCursor_assert_odt, false); 244eba4d44aSLiu Zhe xTextCursor_assert_odt.goRight((short) 100, true); 245eba4d44aSLiu Zhe assertEquals("assert individual word setting",true,xCursorProps_assert_odt.getPropertyValue("CharWordMode")); 246eba4d44aSLiu Zhe assertEquals("assert underline is single",com.sun.star.awt.FontUnderline.SINGLE,xCursorProps_assert_odt.getPropertyValue("CharUnderline")); 247eba4d44aSLiu Zhe assertEquals("assert has underline color is true",true,xCursorProps_assert_odt.getPropertyValue("CharUnderlineHasColor")); 248eba4d44aSLiu Zhe assertEquals("assert underline color",0x0000FF00,xCursorProps_assert_odt.getPropertyValue("CharUnderlineColor")); 249eba4d44aSLiu Zhe xTextCursor_assert_odt.gotoRange(xTextCursor_assert_odt, false); 250eba4d44aSLiu Zhe xTextCursor_assert_odt.goRight((short) 100, true); 251eba4d44aSLiu Zhe assertEquals("assert individual word setting",true,xCursorProps_assert_odt.getPropertyValue("CharWordMode")); 252eba4d44aSLiu Zhe assertEquals("assert underline is without",com.sun.star.awt.FontUnderline.NONE,xCursorProps_assert_odt.getPropertyValue("CharUnderline")); 253eba4d44aSLiu Zhe xTextCursor_assert_odt.gotoRange(xTextCursor_assert_odt, false); 254eba4d44aSLiu Zhe xTextCursor_assert_odt.goRight((short) 100, true); 255eba4d44aSLiu Zhe assertEquals("assert individual word setting",false,xCursorProps_assert_odt.getPropertyValue("CharWordMode")); 256eba4d44aSLiu Zhe assertEquals("assert underline is LONGDASH",com.sun.star.awt.FontUnderline.LONGDASH,xCursorProps_assert_odt.getPropertyValue("CharUnderline")); 257eba4d44aSLiu Zhe assertEquals("assert has underline color is true",true,xCursorProps_assert_odt.getPropertyValue("CharUnderlineHasColor")); 258eba4d44aSLiu Zhe assertEquals("assert underline color",0x0000FF00,xCursorProps_assert_odt.getPropertyValue("CharUnderlineColor")); 259eba4d44aSLiu Zhe xTextCursor_assert_odt.gotoRange(xTextCursor_assert_odt, false); 260eba4d44aSLiu Zhe xTextCursor_assert_odt.goRight((short) 100, true); 261eba4d44aSLiu Zhe assertEquals("assert individual word setting",false,xCursorProps_assert_odt.getPropertyValue("CharWordMode")); 262eba4d44aSLiu Zhe assertEquals("assert underline is DOUBLEWAVE",com.sun.star.awt.FontUnderline.DOUBLEWAVE,xCursorProps_assert_odt.getPropertyValue("CharUnderline")); 263eba4d44aSLiu Zhe assertEquals("assert has underline color",true,xCursorProps_assert_odt.getPropertyValue("CharUnderlineHasColor")); 264eba4d44aSLiu Zhe assertEquals("assert underline color",0x0000FF00,xCursorProps_assert_odt.getPropertyValue("CharUnderlineColor")); 265eba4d44aSLiu Zhe xTextCursor_assert_odt.gotoRange(xTextCursor_assert_odt, false); 266eba4d44aSLiu Zhe xTextCursor_assert_odt.goRight((short) 100, true); 267eba4d44aSLiu Zhe assertEquals("assert individula word setting",false,xCursorProps_assert_odt.getPropertyValue("CharWordMode")); 268eba4d44aSLiu Zhe assertEquals("assert underline is DONTKNOW",com.sun.star.awt.FontUnderline.NONE,xCursorProps_assert_odt.getPropertyValue("CharUnderline")); 269eba4d44aSLiu Zhe xTextCursor_assert_odt.gotoRange(xTextCursor_assert_odt, false); 270eba4d44aSLiu Zhe xTextCursor_assert_odt.goRight((short) 100, true); 271eba4d44aSLiu Zhe assertEquals("assert individula word setting",false,xCursorProps_assert_odt.getPropertyValue("CharWordMode")); 272eba4d44aSLiu Zhe assertEquals("assert underline is DOTTED",com.sun.star.awt.FontUnderline.DOTTED,xCursorProps_assert_odt.getPropertyValue("CharUnderline")); 273eba4d44aSLiu Zhe assertEquals("assert has underline color",true,xCursorProps_assert_odt.getPropertyValue("CharUnderlineHasColor")); 274eba4d44aSLiu Zhe assertEquals("assert underline color",0x0000FF00,xCursorProps_assert_odt.getPropertyValue("CharUnderlineColor")); 275eba4d44aSLiu Zhe xTextCursor_assert_odt.gotoRange(xTextCursor_assert_odt, false); 276eba4d44aSLiu Zhe xTextCursor_assert_odt.goRight((short) 100, true); 277eba4d44aSLiu Zhe assertEquals("assert individula word setting",false,xCursorProps_assert_odt.getPropertyValue("CharWordMode")); 278eba4d44aSLiu Zhe assertEquals("assert underline is DASHDOTDOT",com.sun.star.awt.FontUnderline.DASHDOTDOT,xCursorProps_assert_odt.getPropertyValue("CharUnderline")); 279eba4d44aSLiu Zhe assertEquals("assert has underline color",true,xCursorProps_assert_odt.getPropertyValue("CharUnderlineHasColor")); 280eba4d44aSLiu Zhe assertEquals("assert underline color",0x0000FF00,xCursorProps_assert_odt.getPropertyValue("CharUnderlineColor")); 281eba4d44aSLiu Zhe xTextCursor_assert_odt.gotoRange(xTextCursor_assert_odt, false); 282eba4d44aSLiu Zhe xTextCursor_assert_odt.goRight((short) 100, true); 283eba4d44aSLiu Zhe assertEquals("assert individula word setting",false,xCursorProps_assert_odt.getPropertyValue("CharWordMode")); 284eba4d44aSLiu Zhe assertEquals("assert underline is DASHDOT",com.sun.star.awt.FontUnderline.DASHDOT,xCursorProps_assert_odt.getPropertyValue("CharUnderline")); 285eba4d44aSLiu Zhe assertEquals("assert has underline color",true,xCursorProps_assert_odt.getPropertyValue("CharUnderlineHasColor")); 286eba4d44aSLiu Zhe assertEquals("assert underline color",0x0000FF00,xCursorProps_assert_odt.getPropertyValue("CharUnderlineColor")); 287eba4d44aSLiu Zhe xTextCursor_assert_odt.gotoRange(xTextCursor_assert_odt, false); 288eba4d44aSLiu Zhe xTextCursor_assert_odt.goRight((short) 100, true); 289eba4d44aSLiu Zhe assertEquals("assert individula word setting",false,xCursorProps_assert_odt.getPropertyValue("CharWordMode")); 290eba4d44aSLiu Zhe assertEquals("assert underline is DASH",com.sun.star.awt.FontUnderline.DASH,xCursorProps_assert_odt.getPropertyValue("CharUnderline")); 291eba4d44aSLiu Zhe assertEquals("assert has underline color",true,xCursorProps_assert_odt.getPropertyValue("CharUnderlineHasColor")); 292eba4d44aSLiu Zhe assertEquals("assert underline color",0x0000FF00,xCursorProps_assert_odt.getPropertyValue("CharUnderlineColor")); 293eba4d44aSLiu Zhe xTextCursor_assert_odt.gotoRange(xTextCursor_assert_odt, false); 294eba4d44aSLiu Zhe xTextCursor_assert_odt.goRight((short) 100, true); 295eba4d44aSLiu Zhe assertEquals("assert individula word setting",false,xCursorProps_assert_odt.getPropertyValue("CharWordMode")); 296eba4d44aSLiu Zhe assertEquals("assert underline is BOLDWAVE",com.sun.star.awt.FontUnderline.BOLDWAVE,xCursorProps_assert_odt.getPropertyValue("CharUnderline")); 297eba4d44aSLiu Zhe assertEquals("assert has underline color",true,xCursorProps_assert_odt.getPropertyValue("CharUnderlineHasColor")); 298eba4d44aSLiu Zhe assertEquals("assert underline color",0x0000FF00,xCursorProps_assert_odt.getPropertyValue("CharUnderlineColor")); 299eba4d44aSLiu Zhe xTextCursor_assert_odt.gotoRange(xTextCursor_assert_odt, false); 300eba4d44aSLiu Zhe xTextCursor_assert_odt.goRight((short) 100, true); 301eba4d44aSLiu Zhe assertEquals("assert individula word setting",false,xCursorProps_assert_odt.getPropertyValue("CharWordMode")); 302eba4d44aSLiu Zhe assertEquals("assert underline is BOLDLONGDASH",com.sun.star.awt.FontUnderline.BOLDLONGDASH,xCursorProps_assert_odt.getPropertyValue("CharUnderline")); 303eba4d44aSLiu Zhe assertEquals("assert has underline color",true,xCursorProps_assert_odt.getPropertyValue("CharUnderlineHasColor")); 304eba4d44aSLiu Zhe assertEquals("assert underline color",0x0000FF00,xCursorProps_assert_odt.getPropertyValue("CharUnderlineColor")); 305eba4d44aSLiu Zhe xTextCursor_assert_odt.gotoRange(xTextCursor_assert_odt, false); 306eba4d44aSLiu Zhe xTextCursor_assert_odt.goRight((short) 100, true); 307eba4d44aSLiu Zhe assertEquals("assert individula word setting",false,xCursorProps_assert_odt.getPropertyValue("CharWordMode")); 308eba4d44aSLiu Zhe assertEquals("assert underline is BOLDDOTTED",com.sun.star.awt.FontUnderline.BOLDDOTTED,xCursorProps_assert_odt.getPropertyValue("CharUnderline")); 309eba4d44aSLiu Zhe assertEquals("assert has underline color",true,xCursorProps_assert_odt.getPropertyValue("CharUnderlineHasColor")); 310eba4d44aSLiu Zhe assertEquals("assert underline color",0x0000FF00,xCursorProps_assert_odt.getPropertyValue("CharUnderlineColor")); 311eba4d44aSLiu Zhe xTextCursor_assert_odt.gotoRange(xTextCursor_assert_odt, false); 312eba4d44aSLiu Zhe xTextCursor_assert_odt.goRight((short) 100, true); 313eba4d44aSLiu Zhe assertEquals("assert individula word setting",false,xCursorProps_assert_odt.getPropertyValue("CharWordMode")); 314eba4d44aSLiu Zhe assertEquals("assert underline is BOLDDASHDOTDOT",com.sun.star.awt.FontUnderline.BOLDDASHDOTDOT,xCursorProps_assert_odt.getPropertyValue("CharUnderline")); 315eba4d44aSLiu Zhe assertEquals("assert has underline color",true,xCursorProps_assert_odt.getPropertyValue("CharUnderlineHasColor")); 316eba4d44aSLiu Zhe assertEquals("assert underline color",0x0000FF00,xCursorProps_assert_odt.getPropertyValue("CharUnderlineColor")); 317eba4d44aSLiu Zhe xTextCursor_assert_odt.gotoRange(xTextCursor_assert_odt, false); 318eba4d44aSLiu Zhe xTextCursor_assert_odt.goRight((short) 100, true); 319eba4d44aSLiu Zhe assertEquals("assert individula word setting",false,xCursorProps_assert_odt.getPropertyValue("CharWordMode")); 320eba4d44aSLiu Zhe assertEquals("assert underline is BOLDDASHDOT",com.sun.star.awt.FontUnderline.BOLDDASHDOT,xCursorProps_assert_odt.getPropertyValue("CharUnderline")); 321eba4d44aSLiu Zhe assertEquals("assert has underline color",true,xCursorProps_assert_odt.getPropertyValue("CharUnderlineHasColor")); 322eba4d44aSLiu Zhe assertEquals("assert underline color",0x0000FF00,xCursorProps_assert_odt.getPropertyValue("CharUnderlineColor")); 323eba4d44aSLiu Zhe xTextCursor_assert_odt.gotoRange(xTextCursor_assert_odt, false); 324eba4d44aSLiu Zhe xTextCursor_assert_odt.goRight((short) 100, true); 325eba4d44aSLiu Zhe assertEquals("assert individula word setting",false,xCursorProps_assert_odt.getPropertyValue("CharWordMode")); 326eba4d44aSLiu Zhe assertEquals("assert underline is BOLDDASH",com.sun.star.awt.FontUnderline.BOLDDASH,xCursorProps_assert_odt.getPropertyValue("CharUnderline")); 327eba4d44aSLiu Zhe assertEquals("assert has underline color",true,xCursorProps_assert_odt.getPropertyValue("CharUnderlineHasColor")); 328eba4d44aSLiu Zhe assertEquals("assert underline color",0x0000FF00,xCursorProps_assert_odt.getPropertyValue("CharUnderlineColor")); 329eba4d44aSLiu Zhe xTextCursor_assert_odt.gotoRange(xTextCursor_assert_odt, false); 330eba4d44aSLiu Zhe xTextCursor_assert_odt.goRight((short) 100, true); 331eba4d44aSLiu Zhe assertEquals("assert individula word setting",false,xCursorProps_assert_odt.getPropertyValue("CharWordMode")); 332eba4d44aSLiu Zhe assertEquals("assert underline is bold",com.sun.star.awt.FontUnderline.BOLD,xCursorProps_assert_odt.getPropertyValue("CharUnderline")); 333eba4d44aSLiu Zhe assertEquals("assert has underline color",true,xCursorProps_assert_odt.getPropertyValue("CharUnderlineHasColor")); 334eba4d44aSLiu Zhe assertEquals("assert underline color",0x0000FF00,xCursorProps_assert_odt.getPropertyValue("CharUnderlineColor")); 335eba4d44aSLiu Zhe 336eba4d44aSLiu Zhe //reopen the document and assert row height setting 337eba4d44aSLiu Zhe XTextDocument assertDocument_doc=(XTextDocument)UnoRuntime.queryInterface(XTextDocument.class, app.loadDocument(Testspace.getPath("output/test.doc"))); 338eba4d44aSLiu Zhe XTextCursor xTextCursor_assert_doc = assertDocument_doc.getText().createTextCursor(); 339eba4d44aSLiu Zhe XPropertySet xCursorProps_assert_doc = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xTextCursor_assert_doc); 340eba4d44aSLiu Zhe 341eba4d44aSLiu Zhe xTextCursor_assert_odt.gotoStart(false); 342eba4d44aSLiu Zhe xTextCursor_assert_odt.goRight((short) 100, true); 343eba4d44aSLiu Zhe assertEquals("assert individual word setting",true,xCursorProps_assert_doc.getPropertyValue("CharWordMode")); 344eba4d44aSLiu Zhe assertEquals("assert underline is double",com.sun.star.awt.FontUnderline.DOUBLE,xCursorProps_assert_doc.getPropertyValue("CharUnderline")); 345eba4d44aSLiu Zhe assertEquals("assert has underline color is true",true,xCursorProps_assert_doc.getPropertyValue("CharUnderlineHasColor")); 346eba4d44aSLiu Zhe assertEquals("assert underline color",0x00FF00FF,xCursorProps_assert_doc.getPropertyValue("CharUnderlineColor")); 347eba4d44aSLiu Zhe xTextCursor_assert_doc.gotoRange(xTextCursor_assert_doc, false); 348eba4d44aSLiu Zhe xTextCursor_assert_doc.goRight((short) 100, true); 349eba4d44aSLiu Zhe assertEquals("assert individual word setting",false,xCursorProps_assert_doc.getPropertyValue("CharWordMode")); 350eba4d44aSLiu Zhe assertEquals("assert underline is wave",com.sun.star.awt.FontUnderline.WAVE,xCursorProps_assert_doc.getPropertyValue("CharUnderline")); 351eba4d44aSLiu Zhe assertEquals("assert has underline color is true",true,xCursorProps_assert_doc.getPropertyValue("CharUnderlineHasColor")); 352eba4d44aSLiu Zhe assertEquals("assert underline color",0x00FF00FF,xCursorProps_assert_doc.getPropertyValue("CharUnderlineColor")); 353eba4d44aSLiu Zhe xTextCursor_assert_doc.gotoRange(xTextCursor_assert_doc, false); 354eba4d44aSLiu Zhe xTextCursor_assert_doc.goRight((short) 100, true); 355eba4d44aSLiu Zhe assertEquals("assert individual word setting",false,xCursorProps_assert_doc.getPropertyValue("CharWordMode")); 356eba4d44aSLiu Zhe assertEquals("assert underline is smallwave",com.sun.star.awt.FontUnderline.SMALLWAVE,xCursorProps_assert_doc.getPropertyValue("CharUnderline")); 357eba4d44aSLiu Zhe assertEquals("assert has underline color is true",true,xCursorProps_assert_doc.getPropertyValue("CharUnderlineHasColor")); 358eba4d44aSLiu Zhe assertEquals("assert underline color",0x00FF00FF,xCursorProps_assert_doc.getPropertyValue("CharUnderlineColor")); 359eba4d44aSLiu Zhe xTextCursor_assert_doc.gotoRange(xTextCursor_assert_doc, false); 360eba4d44aSLiu Zhe xTextCursor_assert_doc.goRight((short) 100, true); 361eba4d44aSLiu Zhe assertEquals("assert individual word setting",true,xCursorProps_assert_doc.getPropertyValue("CharWordMode")); 362eba4d44aSLiu Zhe assertEquals("assert underline is single",com.sun.star.awt.FontUnderline.SINGLE,xCursorProps_assert_doc.getPropertyValue("CharUnderline")); 363eba4d44aSLiu Zhe assertEquals("assert has underline color is true",true,xCursorProps_assert_doc.getPropertyValue("CharUnderlineHasColor")); 364eba4d44aSLiu Zhe assertEquals("assert underline color",0x0000FF00,xCursorProps_assert_doc.getPropertyValue("CharUnderlineColor")); 365eba4d44aSLiu Zhe xTextCursor_assert_doc.gotoRange(xTextCursor_assert_doc, false); 366eba4d44aSLiu Zhe xTextCursor_assert_doc.goRight((short) 100, true); 367eba4d44aSLiu Zhe assertEquals("assert individual word setting",true,xCursorProps_assert_doc.getPropertyValue("CharWordMode")); 368eba4d44aSLiu Zhe assertEquals("assert underline is without",com.sun.star.awt.FontUnderline.NONE,xCursorProps_assert_doc.getPropertyValue("CharUnderline")); 369eba4d44aSLiu Zhe xTextCursor_assert_doc.gotoRange(xTextCursor_assert_doc, false); 370eba4d44aSLiu Zhe xTextCursor_assert_doc.goRight((short) 100, true); 371eba4d44aSLiu Zhe assertEquals("assert individual word setting",false,xCursorProps_assert_doc.getPropertyValue("CharWordMode")); 372eba4d44aSLiu Zhe assertEquals("assert underline is LONGDASH",com.sun.star.awt.FontUnderline.LONGDASH,xCursorProps_assert_doc.getPropertyValue("CharUnderline")); 373eba4d44aSLiu Zhe assertEquals("assert has underline color is true",true,xCursorProps_assert_doc.getPropertyValue("CharUnderlineHasColor")); 374eba4d44aSLiu Zhe assertEquals("assert underline color",0x0000FF00,xCursorProps_assert_doc.getPropertyValue("CharUnderlineColor")); 375eba4d44aSLiu Zhe xTextCursor_assert_doc.gotoRange(xTextCursor_assert_doc, false); 376eba4d44aSLiu Zhe xTextCursor_assert_doc.goRight((short) 100, true); 377eba4d44aSLiu Zhe assertEquals("assert individual word setting",false,xCursorProps_assert_doc.getPropertyValue("CharWordMode")); 378eba4d44aSLiu Zhe assertEquals("assert underline is DOUBLEWAVE",com.sun.star.awt.FontUnderline.DOUBLEWAVE,xCursorProps_assert_doc.getPropertyValue("CharUnderline")); 379eba4d44aSLiu Zhe assertEquals("assert has underline color",true,xCursorProps_assert_doc.getPropertyValue("CharUnderlineHasColor")); 380eba4d44aSLiu Zhe assertEquals("assert underline color",0x0000FF00,xCursorProps_assert_doc.getPropertyValue("CharUnderlineColor")); 381eba4d44aSLiu Zhe xTextCursor_assert_doc.gotoRange(xTextCursor_assert_doc, false); 382eba4d44aSLiu Zhe xTextCursor_assert_doc.goRight((short) 100, true); 383eba4d44aSLiu Zhe assertEquals("assert individula word setting",false,xCursorProps_assert_doc.getPropertyValue("CharWordMode")); 384eba4d44aSLiu Zhe assertEquals("assert underline is DONTKNOW",com.sun.star.awt.FontUnderline.NONE,xCursorProps_assert_doc.getPropertyValue("CharUnderline")); 385eba4d44aSLiu Zhe xTextCursor_assert_doc.gotoRange(xTextCursor_assert_doc, false); 386eba4d44aSLiu Zhe xTextCursor_assert_doc.goRight((short) 100, true); 387eba4d44aSLiu Zhe assertEquals("assert individula word setting",false,xCursorProps_assert_doc.getPropertyValue("CharWordMode")); 388eba4d44aSLiu Zhe assertEquals("assert underline is DOTTED",com.sun.star.awt.FontUnderline.DOTTED,xCursorProps_assert_doc.getPropertyValue("CharUnderline")); 389eba4d44aSLiu Zhe assertEquals("assert has underline color",true,xCursorProps_assert_doc.getPropertyValue("CharUnderlineHasColor")); 390eba4d44aSLiu Zhe assertEquals("assert underline color",0x0000FF00,xCursorProps_assert_doc.getPropertyValue("CharUnderlineColor")); 391eba4d44aSLiu Zhe xTextCursor_assert_doc.gotoRange(xTextCursor_assert_doc, false); 392eba4d44aSLiu Zhe xTextCursor_assert_doc.goRight((short) 100, true); 393eba4d44aSLiu Zhe assertEquals("assert individula word setting",false,xCursorProps_assert_doc.getPropertyValue("CharWordMode")); 394eba4d44aSLiu Zhe assertEquals("assert underline is DASHDOTDOT",com.sun.star.awt.FontUnderline.DASHDOTDOT,xCursorProps_assert_doc.getPropertyValue("CharUnderline")); 395eba4d44aSLiu Zhe assertEquals("assert has underline color",true,xCursorProps_assert_doc.getPropertyValue("CharUnderlineHasColor")); 396eba4d44aSLiu Zhe assertEquals("assert underline color",0x0000FF00,xCursorProps_assert_doc.getPropertyValue("CharUnderlineColor")); 397eba4d44aSLiu Zhe xTextCursor_assert_doc.gotoRange(xTextCursor_assert_doc, false); 398eba4d44aSLiu Zhe xTextCursor_assert_doc.goRight((short) 100, true); 399eba4d44aSLiu Zhe assertEquals("assert individula word setting",false,xCursorProps_assert_doc.getPropertyValue("CharWordMode")); 400eba4d44aSLiu Zhe assertEquals("assert underline is DASHDOT",com.sun.star.awt.FontUnderline.DASHDOT,xCursorProps_assert_doc.getPropertyValue("CharUnderline")); 401eba4d44aSLiu Zhe assertEquals("assert has underline color",true,xCursorProps_assert_doc.getPropertyValue("CharUnderlineHasColor")); 402eba4d44aSLiu Zhe assertEquals("assert underline color",0x0000FF00,xCursorProps_assert_doc.getPropertyValue("CharUnderlineColor")); 403eba4d44aSLiu Zhe xTextCursor_assert_doc.gotoRange(xTextCursor_assert_doc, false); 404eba4d44aSLiu Zhe xTextCursor_assert_doc.goRight((short) 100, true); 405eba4d44aSLiu Zhe assertEquals("assert individula word setting",false,xCursorProps_assert_doc.getPropertyValue("CharWordMode")); 406eba4d44aSLiu Zhe assertEquals("assert underline is DASH",com.sun.star.awt.FontUnderline.DASH,xCursorProps_assert_doc.getPropertyValue("CharUnderline")); 407eba4d44aSLiu Zhe assertEquals("assert has underline color",true,xCursorProps_assert_doc.getPropertyValue("CharUnderlineHasColor")); 408eba4d44aSLiu Zhe assertEquals("assert underline color",0x0000FF00,xCursorProps_assert_doc.getPropertyValue("CharUnderlineColor")); 409eba4d44aSLiu Zhe xTextCursor_assert_doc.gotoRange(xTextCursor_assert_doc, false); 410eba4d44aSLiu Zhe xTextCursor_assert_doc.goRight((short) 100, true); 411eba4d44aSLiu Zhe assertEquals("assert individula word setting",false,xCursorProps_assert_doc.getPropertyValue("CharWordMode")); 412eba4d44aSLiu Zhe assertEquals("assert underline is BOLDWAVE",com.sun.star.awt.FontUnderline.BOLDWAVE,xCursorProps_assert_doc.getPropertyValue("CharUnderline")); 413eba4d44aSLiu Zhe assertEquals("assert has underline color",true,xCursorProps_assert_doc.getPropertyValue("CharUnderlineHasColor")); 414eba4d44aSLiu Zhe assertEquals("assert underline color",0x0000FF00,xCursorProps_assert_doc.getPropertyValue("CharUnderlineColor")); 415eba4d44aSLiu Zhe xTextCursor_assert_doc.gotoRange(xTextCursor_assert_doc, false); 416eba4d44aSLiu Zhe xTextCursor_assert_doc.goRight((short) 100, true); 417eba4d44aSLiu Zhe assertEquals("assert individula word setting",false,xCursorProps_assert_doc.getPropertyValue("CharWordMode")); 418eba4d44aSLiu Zhe assertEquals("assert underline is BOLDLONGDASH",com.sun.star.awt.FontUnderline.BOLDLONGDASH,xCursorProps_assert_doc.getPropertyValue("CharUnderline")); 419eba4d44aSLiu Zhe assertEquals("assert has underline color",true,xCursorProps_assert_doc.getPropertyValue("CharUnderlineHasColor")); 420eba4d44aSLiu Zhe assertEquals("assert underline color",0x0000FF00,xCursorProps_assert_doc.getPropertyValue("CharUnderlineColor")); 421eba4d44aSLiu Zhe xTextCursor_assert_doc.gotoRange(xTextCursor_assert_doc, false); 422eba4d44aSLiu Zhe xTextCursor_assert_doc.goRight((short) 100, true); 423eba4d44aSLiu Zhe assertEquals("assert individula word setting",false,xCursorProps_assert_doc.getPropertyValue("CharWordMode")); 424eba4d44aSLiu Zhe assertEquals("assert underline is BOLDDOTTED",com.sun.star.awt.FontUnderline.BOLDDOTTED,xCursorProps_assert_doc.getPropertyValue("CharUnderline")); 425eba4d44aSLiu Zhe assertEquals("assert has underline color",true,xCursorProps_assert_doc.getPropertyValue("CharUnderlineHasColor")); 426eba4d44aSLiu Zhe assertEquals("assert underline color",0x0000FF00,xCursorProps_assert_doc.getPropertyValue("CharUnderlineColor")); 427eba4d44aSLiu Zhe xTextCursor_assert_doc.gotoRange(xTextCursor_assert_doc, false); 428eba4d44aSLiu Zhe xTextCursor_assert_doc.goRight((short) 100, true); 429eba4d44aSLiu Zhe assertEquals("assert individula word setting",false,xCursorProps_assert_doc.getPropertyValue("CharWordMode")); 430eba4d44aSLiu Zhe assertEquals("assert underline is BOLDDASHDOTDOT",com.sun.star.awt.FontUnderline.BOLDDASHDOTDOT,xCursorProps_assert_doc.getPropertyValue("CharUnderline")); 431eba4d44aSLiu Zhe assertEquals("assert has underline color",true,xCursorProps_assert_doc.getPropertyValue("CharUnderlineHasColor")); 432eba4d44aSLiu Zhe assertEquals("assert underline color",0x0000FF00,xCursorProps_assert_doc.getPropertyValue("CharUnderlineColor")); 433eba4d44aSLiu Zhe xTextCursor_assert_doc.gotoRange(xTextCursor_assert_doc, false); 434eba4d44aSLiu Zhe xTextCursor_assert_doc.goRight((short) 100, true); 435eba4d44aSLiu Zhe assertEquals("assert individula word setting",false,xCursorProps_assert_doc.getPropertyValue("CharWordMode")); 436eba4d44aSLiu Zhe assertEquals("assert underline is BOLDDASHDOT",com.sun.star.awt.FontUnderline.BOLDDASHDOT,xCursorProps_assert_doc.getPropertyValue("CharUnderline")); 437eba4d44aSLiu Zhe assertEquals("assert has underline color",true,xCursorProps_assert_doc.getPropertyValue("CharUnderlineHasColor")); 438eba4d44aSLiu Zhe assertEquals("assert underline color",0x0000FF00,xCursorProps_assert_doc.getPropertyValue("CharUnderlineColor")); 439eba4d44aSLiu Zhe xTextCursor_assert_doc.gotoRange(xTextCursor_assert_doc, false); 440eba4d44aSLiu Zhe xTextCursor_assert_doc.goRight((short) 100, true); 441eba4d44aSLiu Zhe assertEquals("assert individula word setting",false,xCursorProps_assert_doc.getPropertyValue("CharWordMode")); 442eba4d44aSLiu Zhe assertEquals("assert underline is BOLDDASH",com.sun.star.awt.FontUnderline.BOLDDASH,xCursorProps_assert_doc.getPropertyValue("CharUnderline")); 443eba4d44aSLiu Zhe assertEquals("assert has underline color",true,xCursorProps_assert_doc.getPropertyValue("CharUnderlineHasColor")); 444eba4d44aSLiu Zhe assertEquals("assert underline color",0x0000FF00,xCursorProps_assert_doc.getPropertyValue("CharUnderlineColor")); 445eba4d44aSLiu Zhe xTextCursor_assert_doc.gotoRange(xTextCursor_assert_doc, false); 446eba4d44aSLiu Zhe xTextCursor_assert_doc.goRight((short) 100, true); 447eba4d44aSLiu Zhe assertEquals("assert individula word setting",false,xCursorProps_assert_doc.getPropertyValue("CharWordMode")); 448eba4d44aSLiu Zhe assertEquals("assert underline is bold",com.sun.star.awt.FontUnderline.BOLD,xCursorProps_assert_doc.getPropertyValue("CharUnderline")); 449eba4d44aSLiu Zhe assertEquals("assert has underline color",true,xCursorProps_assert_doc.getPropertyValue("CharUnderlineHasColor")); 450eba4d44aSLiu Zhe assertEquals("assert underline color",0x0000FF00,xCursorProps_assert_doc.getPropertyValue("CharUnderlineColor")); 451eba4d44aSLiu Zhe } 452eba4d44aSLiu Zhe } 453