1 'encoding UTF-8 Do not remove or change this line!
2 '**************************************************************************
3 '* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 '* Copyright 2008 by Sun Microsystems, Inc.
7 '* OpenOffice.org - a multi-platform office productivity suite
9 '* $RCSfile: w_undo_history_1.inc,v $
13 '* last change: $Author: rt $ $Date: 2008-09-04 09:20:19 $
15 '* This file is part of OpenOffice.org.
17 '* OpenOffice.org is free software: you can redistribute it and/or modify
18 '* it under the terms of the GNU Lesser General Public License version 3
19 '* only, as published by the Free Software Foundation.
21 '* OpenOffice.org is distributed in the hope that it will be useful,
22 '* but WITHOUT ANY WARRANTY; without even the implied warranty of
23 '* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 '* GNU Lesser General Public License version 3 for more details
25 '* (a copy is included in the LICENSE file that accompanied this code).
27 '* You should have received a copy of the GNU Lesser General Public License
28 '* version 3 along with OpenOffice.org. If not, see
29 '* <http://www.openoffice.org/license.html>
30 '* for a copy of the LGPLv3 License.
32 '/************************************************************************
34 '* owner : helge.delfs@sun.com
36 '* short description : Writer Undo-History - Test ( Typing, Overwrite, Replace, Delete, Sort, Convert To table)
38 '\***********************************************************************
42 ' a < 20 characters long string
43 Call tUndoOverwrite ' Typing & Overwrite
44 Call tUndoFindAndReplace ' Replace
45 Call tUndoReplaceAll ' Replace all & Delete
47 Call tUndoTableConvert ' Text convert to table
51 testcase tUndoOverwrite
55 '/// <U><B>CHECK: Typing</B></U>
57 '/// write a < 20 characters long string: If20CharactersThere
58 Call wTypeKeys "If20CharactersThere"
59 '/// string in Undo list has to be: Typing: If20CharactersThere
60 Call CheckUndoStringInUndoList ( 1, "'If20Char...rsThere'" )
62 '/// <U><B>CHECK: Overwrite</B></U>
63 printlog "- OVERWRITE"
65 Call wTypeKeys "<Home>"
67 Call wTypeKeys "<Insert>"
68 '/// write a < 20 characters long string: IsThatDifferent4You
69 Call wTypeKeys "IsThatDifferent4You"
70 '/// string in Undo list has to be: Overwrite: IsThatDifferent4You
71 Call CheckUndoStringInUndoList ( 2, "'IsThatDifferent4You'" )
77 testcase tUndoFindAndReplace
80 '/// <U><B>CHECK: Replace</B></U>
83 '/// write a < 20 characters long string: If20CharactersThere
84 Call wTypeKeys "If20CharactersThere"
86 Call wTypeKeys "<Shift Home>"
87 '/// Edit / Find and Replace
89 Kontext "FindAndReplace"
90 '/// Type 'ThisReplacementText' in 'Replace with' field
91 ReplaceWith.Settext "ThisReplacementText"
92 '/// Choose Button 'Replace' and close dialog
97 if Active.GetRT = 304 then
105 Kontext "FindAndReplace"
107 Kontext "DocumentWriter"
108 '/// string in Undo list has to be: Replace: 'IsThatDifferent4You' -> 'ThisReplacementText'
109 Call CheckUndoStringInUndoList ( 3, "'If20CharactersThere' -> 'ThisReplacementText'" )
116 testcase tUndoReplaceAll
117 Dim CheckString as string
120 '/// <U><B>CHECK: Replace all</B></U>
121 printlog "- REPLACE ALL"
123 '/// Insert the dummy text and point cursor at the top of the document
124 Call wBlindtextEinfuegen
125 Call wTypeKeys "<Mod1 Home>"
126 '/// Edit / Find and Replace
128 Kontext "FindAndReplace"
129 '/// Type 'and' in 'Search for' field
130 SearchFor.Settext "and"
131 '/// Type 'ThisReplacementText' in 'Replace with' field
132 ReplaceWith.Settext "###"
133 '/// Choose Button 'Replace' and close dialog
137 if Active.Exists then
138 if Active.GetRT = 304 then Active.Ok
140 Kontext "FindAndReplace"
143 Kontext "DocumentWriter"
144 '/// string in Undo list has to be: Replace: '14 occurences of and'
145 Call CheckUndoStringInUndoList ( 5, "14 occurences of 'and'" )
147 '/// <U><B>CHECK: Delete</B></U>
148 '/// Backspace 4 times to delete characters
149 Call wTypeKeys "<Backspace>", 4
150 '/// string in Undo list has to be: Delete: '###'
152 Call CheckUndoStringInUndoList ( 11, "' ###'" )
163 '/// CHECK: Text sort
164 printlog "- TEXT SORT"
165 '/// Enter some text like "This<Return>is a<Return>test<Return>"
166 Call wTypeKeys "This"
167 Call wTypeKeys "<Return>"
168 Call wTypeKeys "is a"
169 Call wTypeKeys "<Return>"
170 Call wTypeKeys "test"
171 Call wTypeKeys "<Return>"
172 '/// Select all and Tools -> Sort
173 Call wTypeKeys "<Mod1 A>"
178 '/// string in Undo list has to be: "Sort text"
179 Call CheckUndoStringInUndoList ( 6, "Sort text" )
186 testcase tUndoTableConvert
190 '/// CHECK: Text convert to table
191 printlog "TEXT CONVERT TO TABLE"
192 '/// Enter some text like "This<Return>is a<Return>test<Return>"
193 Call wTypeKeys "This"
194 Call wTypeKeys "<Return>"
195 Call wTypeKeys "is a"
196 Call wTypeKeys "<Return>"
197 Call wTypeKeys "test"
198 Call wTypeKeys "<Return>"
199 '/// Select all and Tools - Text <> Table
200 Call wTypeKeys "<Mod1 A>"
202 Kontext "TextInTabelleUmwandeln"
204 TextInTabelleUmwandeln.Ok
205 '/// string in Undo list has to be: "Convert text -> table"
206 Call CheckUndoStringInUndoList ( 7, "Convert text -> table" )