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