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; 23352c0eacSLiu Zhe 24352c0eacSLiu Zhe import static org.junit.Assert.*; 25352c0eacSLiu Zhe 26352c0eacSLiu Zhe import org.junit.After; 27352c0eacSLiu Zhe import org.junit.Before; 28352c0eacSLiu Zhe import org.junit.Test; 29352c0eacSLiu Zhe import org.openoffice.test.common.FileUtil; 30352c0eacSLiu Zhe import org.openoffice.test.common.Testspace; 31352c0eacSLiu Zhe import org.openoffice.test.uno.UnoApp; 32352c0eacSLiu Zhe //import org.openoffice.test.vcl.Tester.*; 33352c0eacSLiu Zhe import com.sun.star.text.*; 34352c0eacSLiu Zhe import com.sun.star.beans.*; 35352c0eacSLiu Zhe import com.sun.star.frame.XStorable; 36352c0eacSLiu Zhe import com.sun.star.uno.UnoRuntime; 37352c0eacSLiu Zhe 38352c0eacSLiu Zhe public class CharacterChangeCase { 39352c0eacSLiu Zhe private static final UnoApp app = new UnoApp(); 40352c0eacSLiu Zhe XText xText = null; 41352c0eacSLiu Zhe 42352c0eacSLiu Zhe @Before 43352c0eacSLiu Zhe public void setUp() throws Exception { 44352c0eacSLiu Zhe app.start(); 45352c0eacSLiu Zhe 46352c0eacSLiu Zhe } 47352c0eacSLiu Zhe 48352c0eacSLiu Zhe @After 49352c0eacSLiu Zhe public void tearDown() throws Exception { 50352c0eacSLiu Zhe app.close(); 51352c0eacSLiu Zhe } 52352c0eacSLiu Zhe @Test 53352c0eacSLiu Zhe public void testCharacterLowerCaseSetting() throws Exception { 54352c0eacSLiu Zhe XTextDocument xTextDocument = (XTextDocument) UnoRuntime.queryInterface(XTextDocument.class, app.newDocument("swriter"));// new a text document 55352c0eacSLiu Zhe xText = xTextDocument.getText(); 56352c0eacSLiu Zhe // simply set whole text as one string 57352c0eacSLiu Zhe xText.setString("We are Chinese they are American We are all living in one earth " 58352c0eacSLiu Zhe + "And we all love our home very much!!!"); 59352c0eacSLiu Zhe // create text cursor for selecting and formatting text 60352c0eacSLiu Zhe XTextCursor xTextCursor = xText.createTextCursor(); 61352c0eacSLiu Zhe XPropertySet xCursorProps = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xTextCursor); 62352c0eacSLiu Zhe xTextCursor.gotoStart(false); 63352c0eacSLiu Zhe xTextCursor.goRight((short) 102, true); 64352c0eacSLiu Zhe xCursorProps.setPropertyValue("CharCaseMap",new Short(com.sun.star.style.CaseMap.LOWERCASE)); 65352c0eacSLiu Zhe //save to doc 66352c0eacSLiu Zhe XStorable xStorable_doc = (XStorable) UnoRuntime.queryInterface(XStorable.class, xTextDocument); 67352c0eacSLiu Zhe PropertyValue[] aStoreProperties_doc = new PropertyValue[2]; 68352c0eacSLiu Zhe aStoreProperties_doc[0] = new PropertyValue(); 69352c0eacSLiu Zhe aStoreProperties_doc[1] = new PropertyValue(); 70352c0eacSLiu Zhe aStoreProperties_doc[0].Name = "Override"; 71352c0eacSLiu Zhe aStoreProperties_doc[0].Value = true; 72352c0eacSLiu Zhe aStoreProperties_doc[1].Name = "FilterName"; 73352c0eacSLiu Zhe aStoreProperties_doc[1].Value = "MS Word 97"; 74352c0eacSLiu Zhe xStorable_doc.storeToURL(FileUtil.getUrl(Testspace.getPath("output/test.doc")), aStoreProperties_doc); 75352c0eacSLiu Zhe //save to odt 76352c0eacSLiu Zhe XStorable xStorable_odt = (XStorable) UnoRuntime.queryInterface(XStorable.class, xTextDocument); 77352c0eacSLiu Zhe PropertyValue[] aStoreProperties_odt = new PropertyValue[2]; 78352c0eacSLiu Zhe aStoreProperties_odt[0] = new PropertyValue(); 79352c0eacSLiu Zhe aStoreProperties_odt[1] = new PropertyValue(); 80352c0eacSLiu Zhe aStoreProperties_odt[0].Name = "Override"; 81352c0eacSLiu Zhe aStoreProperties_odt[0].Value = true; 82352c0eacSLiu Zhe aStoreProperties_odt[1].Name = "FilterName"; 83352c0eacSLiu Zhe aStoreProperties_odt[1].Value = "StarOffice XML (Writer)"; 84352c0eacSLiu Zhe xStorable_odt.storeToURL(FileUtil.getUrl(Testspace.getPath("output/test.odt")), aStoreProperties_odt); 85352c0eacSLiu Zhe 86352c0eacSLiu Zhe app.closeDocument(xTextDocument); 87352c0eacSLiu Zhe 88352c0eacSLiu Zhe //reopen the document and assert case map 89352c0eacSLiu Zhe XTextDocument assertDocument_odt=(XTextDocument)UnoRuntime.queryInterface(XTextDocument.class, app.loadDocument(Testspace.getPath("output/test.odt"))); 90352c0eacSLiu Zhe XPropertySet xCursorProps_assert_odt = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, assertDocument_odt.getText().createTextCursor()); 91352c0eacSLiu Zhe //verify set property 92352c0eacSLiu Zhe assertEquals("assert character casemap",com.sun.star.style.CaseMap.LOWERCASE,xCursorProps_assert_odt.getPropertyValue("CharCaseMap")); 93352c0eacSLiu Zhe 94352c0eacSLiu Zhe //when save to doc,lower case setting by UNO API lost,change to default. 95352c0eacSLiu Zhe //reopen the document and assert case map 96352c0eacSLiu Zhe XTextDocument assertDocument_doc=(XTextDocument)UnoRuntime.queryInterface(XTextDocument.class, app.loadDocument(Testspace.getPath("output/test.doc"))); 97352c0eacSLiu Zhe XPropertySet xCursorProps_assert_doc = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, assertDocument_doc.getText().createTextCursor()); 98352c0eacSLiu Zhe //verify set property 99352c0eacSLiu Zhe assertEquals("assert character casemap",com.sun.star.style.CaseMap.NONE,xCursorProps_assert_doc.getPropertyValue("CharCaseMap")); 100352c0eacSLiu Zhe } 101352c0eacSLiu Zhe @Test 102352c0eacSLiu Zhe public void testCharacterUpperCaseSetting() throws Exception { 103352c0eacSLiu Zhe XTextDocument xTextDocument = (XTextDocument) UnoRuntime.queryInterface(XTextDocument.class, app.newDocument("swriter"));// new a text document 104352c0eacSLiu Zhe xText = xTextDocument.getText(); 105352c0eacSLiu Zhe // simply set whole text as one string 106352c0eacSLiu Zhe xText.setString("we are Chinese,they are American.We are all living in one earth!" 107352c0eacSLiu Zhe + "and we all love our home very much!!!"); 108352c0eacSLiu Zhe // create text cursor for selecting and formatting text 109352c0eacSLiu Zhe XTextCursor xTextCursor = xText.createTextCursor(); 110352c0eacSLiu Zhe XPropertySet xCursorProps = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xTextCursor); 111352c0eacSLiu Zhe xTextCursor.gotoStart(false); 112352c0eacSLiu Zhe xTextCursor.goRight((short) 102, true); 113352c0eacSLiu Zhe xCursorProps.setPropertyValue("CharCaseMap",com.sun.star.style.CaseMap.UPPERCASE); 114352c0eacSLiu Zhe //save to odt 115352c0eacSLiu Zhe XStorable xStorable_odt = (XStorable) UnoRuntime.queryInterface(XStorable.class, xTextDocument); 116352c0eacSLiu Zhe PropertyValue[] aStoreProperties_odt = new PropertyValue[2]; 117352c0eacSLiu Zhe aStoreProperties_odt[0] = new PropertyValue(); 118352c0eacSLiu Zhe aStoreProperties_odt[1] = new PropertyValue(); 119352c0eacSLiu Zhe aStoreProperties_odt[0].Name = "Override"; 120352c0eacSLiu Zhe aStoreProperties_odt[0].Value = true; 121352c0eacSLiu Zhe aStoreProperties_odt[1].Name = "FilterName"; 122352c0eacSLiu Zhe aStoreProperties_odt[1].Value = "StarOffice XML (Writer)"; 123352c0eacSLiu Zhe xStorable_odt.storeToURL(FileUtil.getUrl(Testspace.getPath("output/test.odt")), aStoreProperties_odt); 124352c0eacSLiu Zhe //save to doc 125352c0eacSLiu Zhe XStorable xStorable_doc = (XStorable) UnoRuntime.queryInterface(XStorable.class, xTextDocument); 126352c0eacSLiu Zhe PropertyValue[] aStoreProperties_doc = new PropertyValue[2]; 127352c0eacSLiu Zhe aStoreProperties_doc[0] = new PropertyValue(); 128352c0eacSLiu Zhe aStoreProperties_doc[1] = new PropertyValue(); 129352c0eacSLiu Zhe aStoreProperties_doc[0].Name = "Override"; 130352c0eacSLiu Zhe aStoreProperties_doc[0].Value = true; 131352c0eacSLiu Zhe aStoreProperties_doc[1].Name = "FilterName"; 132352c0eacSLiu Zhe aStoreProperties_doc[1].Value = "MS Word 97"; 133352c0eacSLiu Zhe xStorable_doc.storeToURL(FileUtil.getUrl(Testspace.getPath("output/test.doc")), aStoreProperties_doc); 134352c0eacSLiu Zhe app.closeDocument(xTextDocument); 135352c0eacSLiu Zhe 136352c0eacSLiu Zhe //reopen the document and assert row height setting 137352c0eacSLiu Zhe XTextDocument assertDocument_odt=(XTextDocument)UnoRuntime.queryInterface(XTextDocument.class, app.loadDocument(Testspace.getPath("output/test.odt"))); 138352c0eacSLiu Zhe XPropertySet xCursorProps_assert_odt = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, assertDocument_odt.getText().createTextCursor()); 139352c0eacSLiu Zhe //verify set property 140352c0eacSLiu Zhe assertEquals("assert character casemap",com.sun.star.style.CaseMap.UPPERCASE,xCursorProps_assert_odt.getPropertyValue("CharCaseMap")); 141352c0eacSLiu Zhe 142352c0eacSLiu Zhe //reopen the document and assert row height setting 143352c0eacSLiu Zhe XTextDocument assertDocument_doc=(XTextDocument)UnoRuntime.queryInterface(XTextDocument.class, app.loadDocument(Testspace.getPath("output/test.doc"))); 144352c0eacSLiu Zhe XPropertySet xCursorProps_assert_doc = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, assertDocument_doc.getText().createTextCursor()); 145352c0eacSLiu Zhe //verify set property 146352c0eacSLiu Zhe assertEquals("assert character casemap",com.sun.star.style.CaseMap.UPPERCASE,xCursorProps_assert_doc.getPropertyValue("CharCaseMap")); 147352c0eacSLiu Zhe } 148352c0eacSLiu Zhe @Test 149352c0eacSLiu Zhe public void testCharacterSmallCapsSetting() throws Exception { 150352c0eacSLiu Zhe XTextDocument xTextDocument = (XTextDocument) UnoRuntime.queryInterface(XTextDocument.class, app.newDocument("swriter"));// new a text document 151352c0eacSLiu Zhe xText = xTextDocument.getText(); 152352c0eacSLiu Zhe // simply set whole text as one string 153352c0eacSLiu Zhe xText.setString("we are Chinese,they are American.We are all living in one earth!" 154352c0eacSLiu Zhe + "and we all love our home very much!!!"); 155352c0eacSLiu Zhe // create text cursor for selecting and formatting text 156352c0eacSLiu Zhe XTextCursor xTextCursor = xText.createTextCursor(); 157352c0eacSLiu Zhe XPropertySet xCursorProps = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xTextCursor); 158352c0eacSLiu Zhe xTextCursor.gotoStart(false); 159352c0eacSLiu Zhe xTextCursor.goRight((short) 102, true); 160352c0eacSLiu Zhe xCursorProps.setPropertyValue("CharCaseMap",com.sun.star.style.CaseMap.SMALLCAPS); 161352c0eacSLiu Zhe //save to odt 162352c0eacSLiu Zhe XStorable xStorable_odt = (XStorable) UnoRuntime.queryInterface(XStorable.class, xTextDocument); 163352c0eacSLiu Zhe PropertyValue[] aStoreProperties_odt = new PropertyValue[2]; 164352c0eacSLiu Zhe aStoreProperties_odt[0] = new PropertyValue(); 165352c0eacSLiu Zhe aStoreProperties_odt[1] = new PropertyValue(); 166352c0eacSLiu Zhe aStoreProperties_odt[0].Name = "Override"; 167352c0eacSLiu Zhe aStoreProperties_odt[0].Value = true; 168352c0eacSLiu Zhe aStoreProperties_odt[1].Name = "FilterName"; 169352c0eacSLiu Zhe aStoreProperties_odt[1].Value = "StarOffice XML (Writer)"; 170352c0eacSLiu Zhe xStorable_odt.storeToURL(FileUtil.getUrl(Testspace.getPath("output/test.odt")), aStoreProperties_odt); 171352c0eacSLiu Zhe //save to doc 172352c0eacSLiu Zhe XStorable xStorable_doc = (XStorable) UnoRuntime.queryInterface(XStorable.class, xTextDocument); 173352c0eacSLiu Zhe PropertyValue[] aStoreProperties_doc = new PropertyValue[2]; 174352c0eacSLiu Zhe aStoreProperties_doc[0] = new PropertyValue(); 175352c0eacSLiu Zhe aStoreProperties_doc[1] = new PropertyValue(); 176352c0eacSLiu Zhe aStoreProperties_doc[0].Name = "Override"; 177352c0eacSLiu Zhe aStoreProperties_doc[0].Value = true; 178352c0eacSLiu Zhe aStoreProperties_doc[1].Name = "FilterName"; 179352c0eacSLiu Zhe aStoreProperties_doc[1].Value = "MS Word 97"; 180352c0eacSLiu Zhe xStorable_doc.storeToURL(FileUtil.getUrl(Testspace.getPath("output/test.doc")), aStoreProperties_doc); 181352c0eacSLiu Zhe app.closeDocument(xTextDocument); 182352c0eacSLiu Zhe 183352c0eacSLiu Zhe //reopen the document and assert row height setting 184352c0eacSLiu Zhe XTextDocument assertDocument_odt=(XTextDocument)UnoRuntime.queryInterface(XTextDocument.class, app.loadDocument(Testspace.getPath("output/test.odt"))); 185352c0eacSLiu Zhe XPropertySet xCursorProps_assert_odt = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, assertDocument_odt.getText().createTextCursor()); 186352c0eacSLiu Zhe //verify set property 187352c0eacSLiu Zhe assertEquals("assert character casemap",com.sun.star.style.CaseMap.SMALLCAPS,xCursorProps_assert_odt.getPropertyValue("CharCaseMap")); 188352c0eacSLiu Zhe 189352c0eacSLiu Zhe //reopen the document and assert row height setting 190352c0eacSLiu Zhe XTextDocument assertDocument_doc=(XTextDocument)UnoRuntime.queryInterface(XTextDocument.class, app.loadDocument(Testspace.getPath("output/test.doc"))); 191352c0eacSLiu Zhe XPropertySet xCursorProps_assert_doc = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, assertDocument_doc.getText().createTextCursor()); 192352c0eacSLiu Zhe //verify set property 193352c0eacSLiu Zhe assertEquals("assert character casemap",com.sun.star.style.CaseMap.SMALLCAPS,xCursorProps_assert_doc.getPropertyValue("CharCaseMap")); 194352c0eacSLiu Zhe } 195352c0eacSLiu Zhe @Test 196352c0eacSLiu Zhe public void testCharacterCapitalEveryWordSetting() throws Exception { 197352c0eacSLiu Zhe XTextDocument xTextDocument = (XTextDocument) UnoRuntime.queryInterface(XTextDocument.class, app.newDocument("swriter"));// new a text document 198352c0eacSLiu Zhe xText = xTextDocument.getText(); 199352c0eacSLiu Zhe // simply set whole text as one string 200352c0eacSLiu Zhe xText.setString("we are Chinese they are American we are all living in one earth " 201352c0eacSLiu Zhe + "and we all love our home very much!!!"); 202352c0eacSLiu Zhe // create text cursor for selecting and formatting text 203352c0eacSLiu Zhe XTextCursor xTextCursor = xText.createTextCursor(); 204352c0eacSLiu Zhe XPropertySet xCursorProps = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xTextCursor); 205352c0eacSLiu Zhe xTextCursor.gotoStart(false); 206352c0eacSLiu Zhe xTextCursor.goRight((short) 110, true); 207352c0eacSLiu Zhe xCursorProps.setPropertyValue("CharCaseMap",new Short(com.sun.star.style.CaseMap.TITLE)); 208352c0eacSLiu Zhe //save to odt 209352c0eacSLiu Zhe XStorable xStorable_odt = (XStorable) UnoRuntime.queryInterface(XStorable.class, xTextDocument); 210352c0eacSLiu Zhe PropertyValue[] aStoreProperties_odt = new PropertyValue[2]; 211352c0eacSLiu Zhe aStoreProperties_odt[0] = new PropertyValue(); 212352c0eacSLiu Zhe aStoreProperties_odt[1] = new PropertyValue(); 213352c0eacSLiu Zhe aStoreProperties_odt[0].Name = "Override"; 214352c0eacSLiu Zhe aStoreProperties_odt[0].Value = true; 215352c0eacSLiu Zhe aStoreProperties_odt[1].Name = "FilterName"; 216352c0eacSLiu Zhe aStoreProperties_odt[1].Value = "StarOffice XML (Writer)"; 217352c0eacSLiu Zhe xStorable_odt.storeToURL(FileUtil.getUrl(Testspace.getPath("output/test.odt")), aStoreProperties_odt); 218352c0eacSLiu Zhe //save to doc 219352c0eacSLiu Zhe XStorable xStorable_doc = (XStorable) UnoRuntime.queryInterface(XStorable.class, xTextDocument); 220352c0eacSLiu Zhe PropertyValue[] aStoreProperties_doc = new PropertyValue[2]; 221352c0eacSLiu Zhe aStoreProperties_doc[0] = new PropertyValue(); 222352c0eacSLiu Zhe aStoreProperties_doc[1] = new PropertyValue(); 223352c0eacSLiu Zhe aStoreProperties_doc[0].Name = "Override"; 224352c0eacSLiu Zhe aStoreProperties_doc[0].Value = true; 225352c0eacSLiu Zhe aStoreProperties_doc[1].Name = "FilterName"; 226352c0eacSLiu Zhe aStoreProperties_doc[1].Value = "MS Word 97"; 227352c0eacSLiu Zhe xStorable_doc.storeToURL(FileUtil.getUrl(Testspace.getPath("output/test.doc")), aStoreProperties_doc); 228352c0eacSLiu Zhe app.closeDocument(xTextDocument); 229352c0eacSLiu Zhe 230352c0eacSLiu Zhe //reopen the document and assert row height setting 231352c0eacSLiu Zhe XTextDocument assertDocument_odt=(XTextDocument)UnoRuntime.queryInterface(XTextDocument.class, app.loadDocument(Testspace.getPath("output/test.odt"))); 232352c0eacSLiu Zhe XPropertySet xCursorProps_assert_odt = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, assertDocument_odt.getText().createTextCursor()); 233352c0eacSLiu Zhe //verify set property 234352c0eacSLiu Zhe assertEquals("assert character casemap",com.sun.star.style.CaseMap.TITLE,xCursorProps_assert_odt.getPropertyValue("CharCaseMap")); 235352c0eacSLiu Zhe 236352c0eacSLiu Zhe //reopen the document and assert row height setting 237352c0eacSLiu Zhe XTextDocument assertDocument_doc=(XTextDocument)UnoRuntime.queryInterface(XTextDocument.class, app.loadDocument(Testspace.getPath("output/test.doc"))); 238352c0eacSLiu Zhe XPropertySet xCursorProps_assert_doc = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, assertDocument_doc.getText().createTextCursor()); 239352c0eacSLiu Zhe //verify set property,when save to doc and reopen,the proeprty value change to default,but display is normally 240352c0eacSLiu Zhe assertEquals("assert character casemap",com.sun.star.style.CaseMap.NONE,xCursorProps_assert_doc.getPropertyValue("CharCaseMap")); 241352c0eacSLiu Zhe } 242352c0eacSLiu Zhe @Test 243352c0eacSLiu Zhe public void testCharacterNoCaseSetting() throws Exception { 244352c0eacSLiu Zhe XTextDocument xTextDocument = (XTextDocument) UnoRuntime.queryInterface(XTextDocument.class, app.newDocument("swriter"));// new a text document 245352c0eacSLiu Zhe xText = xTextDocument.getText(); 246352c0eacSLiu Zhe // simply set whole text as one string 247352c0eacSLiu Zhe xText.setString("we are Chinese they are American we are all living in one earth " 248352c0eacSLiu Zhe + "and we all love our home very much!!!"); 249352c0eacSLiu Zhe // create text cursor for selecting and formatting text 250352c0eacSLiu Zhe XTextCursor xTextCursor = xText.createTextCursor(); 251352c0eacSLiu Zhe XPropertySet xCursorProps = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xTextCursor); 252352c0eacSLiu Zhe xTextCursor.gotoStart(false); 253352c0eacSLiu Zhe xTextCursor.goRight((short) 110, true); 254352c0eacSLiu Zhe xCursorProps.setPropertyValue("CharCaseMap",new Short(com.sun.star.style.CaseMap.NONE)); 255352c0eacSLiu Zhe //save to odt 256352c0eacSLiu Zhe XStorable xStorable_odt = (XStorable) UnoRuntime.queryInterface(XStorable.class, xTextDocument); 257352c0eacSLiu Zhe PropertyValue[] aStoreProperties_odt = new PropertyValue[2]; 258352c0eacSLiu Zhe aStoreProperties_odt[0] = new PropertyValue(); 259352c0eacSLiu Zhe aStoreProperties_odt[1] = new PropertyValue(); 260352c0eacSLiu Zhe aStoreProperties_odt[0].Name = "Override"; 261352c0eacSLiu Zhe aStoreProperties_odt[0].Value = true; 262352c0eacSLiu Zhe aStoreProperties_odt[1].Name = "FilterName"; 263352c0eacSLiu Zhe aStoreProperties_odt[1].Value = "StarOffice XML (Writer)"; 264352c0eacSLiu Zhe xStorable_odt.storeToURL(FileUtil.getUrl(Testspace.getPath("output/test.odt")), aStoreProperties_odt); 265352c0eacSLiu Zhe //save to doc 266352c0eacSLiu Zhe XStorable xStorable_doc = (XStorable) UnoRuntime.queryInterface(XStorable.class, xTextDocument); 267352c0eacSLiu Zhe PropertyValue[] aStoreProperties_doc = new PropertyValue[2]; 268352c0eacSLiu Zhe aStoreProperties_doc[0] = new PropertyValue(); 269352c0eacSLiu Zhe aStoreProperties_doc[1] = new PropertyValue(); 270352c0eacSLiu Zhe aStoreProperties_doc[0].Name = "Override"; 271352c0eacSLiu Zhe aStoreProperties_doc[0].Value = true; 272352c0eacSLiu Zhe aStoreProperties_doc[1].Name = "FilterName"; 273352c0eacSLiu Zhe aStoreProperties_doc[1].Value = "MS Word 97"; 274352c0eacSLiu Zhe xStorable_doc.storeToURL(FileUtil.getUrl(Testspace.getPath("output/test.doc")), aStoreProperties_doc); 275352c0eacSLiu Zhe app.closeDocument(xTextDocument); 276352c0eacSLiu Zhe 277352c0eacSLiu Zhe //reopen the document and assert row height setting 278352c0eacSLiu Zhe XTextDocument assertDocument_odt=(XTextDocument)UnoRuntime.queryInterface(XTextDocument.class, app.loadDocument(Testspace.getPath("output/test.odt"))); 279352c0eacSLiu Zhe XPropertySet xCursorProps_assert_odt = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, assertDocument_odt.getText().createTextCursor()); 280352c0eacSLiu Zhe //verify set property 281352c0eacSLiu Zhe assertEquals("assert character casemap",com.sun.star.style.CaseMap.NONE,xCursorProps_assert_odt.getPropertyValue("CharCaseMap")); 282352c0eacSLiu Zhe 283352c0eacSLiu Zhe //reopen the document and assert row height setting 284352c0eacSLiu Zhe XTextDocument assertDocument_doc=(XTextDocument)UnoRuntime.queryInterface(XTextDocument.class, app.loadDocument(Testspace.getPath("output/test.doc"))); 285352c0eacSLiu Zhe XPropertySet xCursorProps_assert_doc = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, assertDocument_doc.getText().createTextCursor()); 286352c0eacSLiu Zhe //verify set property 287352c0eacSLiu Zhe assertEquals("assert character casemap",com.sun.star.style.CaseMap.NONE,xCursorProps_assert_doc.getPropertyValue("CharCaseMap")); 288352c0eacSLiu Zhe } 289352c0eacSLiu Zhe } 290