1 '**************************************************************************
2 '* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 '* Copyright 2008 by Sun Microsystems, Inc.
6 '* OpenOffice.org - a multi-platform office productivity suite
8 '* $RCSfile: w_tool2.inc,v $
12 '* last change: $Author: vg $ $Date: 2008-08-18 12:43:13 $
14 '* This file is part of OpenOffice.org.
16 '* OpenOffice.org is free software: you can redistribute it and/or modify
17 '* it under the terms of the GNU Lesser General Public License version 3
18 '* only, as published by the Free Software Foundation.
20 '* OpenOffice.org is distributed in the hope that it will be useful,
21 '* but WITHOUT ANY WARRANTY; without even the implied warranty of
22 '* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 '* GNU Lesser General Public License version 3 for more details
24 '* (a copy is included in the LICENSE file that accompanied this code).
26 '* You should have received a copy of the GNU Lesser General Public License
27 '* version 3 along with OpenOffice.org. If not, see
28 '* <http://www.openoffice.org/license.html>
29 '* for a copy of the LGPLv3 License.
31 '/************************************************************************
33 '* owner : helge.delfs@sun.com **
35 '* short description : Description of file **
37 '*******************************************************************
41 ' #1 UnCheckUeberpruefen
44 '\******************************************************************
46 sub OptionenAufrufen(Seite as string)
47 Dim i as integer, GotItAlready as Boolean
53 if Active.GetRT = 304 then
55 Warnlog Active.Gettext + " Bug#90025"
64 case "TabErsetzung" : active.SetPage TabErsetzung
65 case "TabAusnahmen" : active.SetPage TabAusnahmen
66 case "TabOptionen" : active.SetPage TabOptionen
67 case "TabTypografisch": active.SetPage TabTypografisch
72 if Active.GetRT = 304 then
73 if i = 1 and GotItAlready = False then Warnlog Active.Gettext + " Bug#90025"
83 sub CheckUberpruefen ( Pruefung$ )
84 Call wTypeKeys Pruefung$
86 Call wTypeKeys "<Home><Shift End>"
88 if GetClipboardText = Pruefung$ then Warnlog "Text has not been replaced"
89 Call wTypeKeys "<Home><Shift End><Delete>"
92 sub UnCheckUeberpruefen ( Pruefung$ )
93 Call wTypeKeys Pruefung$
95 Call wTypeKeys "<Home><Shift End>"
97 if GetClipboardText <> Pruefung$ then Warnlog "Text has been replaced"
98 Call wTypeKeys "<Home><Shift End><Delete>"
102 sub WortErgaenzen(Tastaturbefehl as string)
105 Call wTypeKeys Tastaturbefehl
106 Call wTypeKeys "<End><Mod1 Shift Left>"
108 if GetClipBoardtext = "Dies" then Warnlog "Word 'Dies' has been completed!"
109 if Tastaturbefehl = "<Return>" then Call wTypeKeys "<Return>"
111 Call wTypeKeys "auto"
113 Call wTypeKeys Tastaturbefehl
114 Call wTypeKeys "<End><Mod1 Shift Left>"
116 if GetClipBoardtext <> "automatischen" then Warnlog "Word 'automatischen' has not been completed!"
117 if Tastaturbefehl = "<Return>" then Call wTypeKeys "<Return>"
121 Call wTypeKeys Tastaturbefehl
122 Call wTypeKeys "<End><Mod1 Shift Left>"
124 if GetClipBoardtext <> "Worterkennung" then Warnlog "Word 'Worterkennung' has not been completed!"
125 if Tastaturbefehl = "<Return>" then Call wTypeKeys "<Return>"
129 ' -----------------------------------------------------------------------------
131 function wCreateAutotextCategory(vCategoryName as string) as boolean
132 Dim i as integer, bCategoryExist as boolean
133 '/// This function creates an autotext-category
134 '/// requires CategoryName to create
135 '/// returns true if category could be created
136 '/// Attention: Autotext-Dialog leaves open after creating category
138 if Not Autotext.Exists then EditAutotext
141 if Active.Exists then
142 if Active.GetRT = 304 then
143 QAErrorlog Active.Gettext
152 if Active.Exists then
153 if Active.GetRT = 304 then
154 QAErrorlog Active.Gettext
159 Warnlog "Button 'Categories' is disabled!"
163 Kontext "BereicheBearbeitenAutotext"
164 if ( BereicheBearbeitenAutotext.Exists( 1 ) ) then
166 Liste.TypeKeys "<Home>"
167 For i = 1 to Liste.GetItemCount
168 if Liste.GetText = vCategoryName then
169 QAErrorlog "Category " & vCategoryName & " already existing"
170 bCategoryExist = true
175 if bCategoryExist = false then
176 for i = 1 to Pfad.GetItemCount
178 Bereich.Settext vCategoryName
183 if i = Pfad.GetItemCount then
184 Warnlog "Unable to create new category"
185 BereicheBearbeitenAutotext.Close
191 if Liste.GetText <> vCategoryName then
192 Warnlog "New category is not selected after creation"
194 Liste.Select vCategoryName
195 wCreateAutotextCategory = true
200 wCreateAutotextCategory = true
203 wCreateAutotextCategory = true
206 BereicheBearbeitenAutotext.Ok
209 if Active.Exists then
210 if Active.GetRT = 304 then
211 QAErrorlog Active.Gettext
217 warnlog( "Dialog <BereicheBearbeitenAutotext> is not available" )
222 ' -----------------------------------------------------------------------------
224 function wSelectAutotextCategory(vCategoryName as string) as boolean
226 '/// This function selects an autotext-category
227 '/// requires CategoryName to select
228 '/// returns true if category could be selected
229 '/// Attention: Autotext-Dialog leaves open after selecting category
231 if Not Autotext.Exists then EditAutotext
234 if Active.Exists then
235 if Active.GetRT = 304 then
236 QAErrorlog Active.Gettext
240 '/// close all categories
245 Liste.TypeKeys "<Down>"
249 Liste.TypeKeys "<Home>"
251 if Liste.Gettext <> vCategoryName then
252 Liste.TypeKeys "<Down>"
257 if Liste.Gettext = vCategoryName then wSelectAutotextCategory = true
261 ' -----------------------------------------------------------------------------
263 function wDeleteAutotextCategory(vCategoryName as string) as boolean
265 '/// This function deletes an autotext-category
266 '/// requires CategoryName to delete
267 '/// returns true if category could be deleted
268 '/// Attention: Autotext-Dialog leaves open after deleting category
270 if Not Autotext.Exists then EditAutotext
273 if Active.Exists then
274 if Active.GetRT = 304 then
275 QAErrorlog Active.Gettext
285 if Active.Exists then
286 if Active.GetRT = 304 then
287 QAErrorlog Active.Gettext
293 Warnlog "Button 'Categories' is disabled!"
298 Kontext "BereicheBearbeitenAutotext"
299 if Not BereicheBearbeitenAutotext.Exists then exit function
301 Liste.TypeKeys "<Home>"
303 if Liste.Gettext <> vCategoryName then
304 Liste.TypeKeys "<Down>"
309 if Liste.Gettext = vCategoryName then
314 BereicheBearbeitenAutotext.Close
317 BereicheBearbeitenAutotext.Ok
320 if Active.Exists then
321 if Active.GetRT = 304 then
324 wDeleteAutotextCategory = true
333 if Active.Exists then
334 if Active.GetRT = 304 then
335 QAErrorlog Active.Gettext
342 '----------------------------------------------------------------------
344 function wDeleteAutotext(vAutotextName as string) as boolean
345 '/// This function deletes an autotext
346 '/// requires AutotextName to delete
347 '/// returns true if Autotext could be deleted
348 '/// Attention: Autotext-Dialog leaves open after deleting autotext
350 Dim j as integer, sAll as integer
352 if Not Autotext.Exists then EditAutotext
355 if Active.Exists then
356 if Active.GetRT = 304 then
357 QAErrorlog Active.Gettext
366 Liste.TypeKeys "<Down>"
372 sAll = Liste.GetItemCount
374 Liste.TypeKeys "<Down>"
375 if Liste.Gettext = vAutotextName then
379 Call hMenuSelectNr ( 3 )
381 if Active.Exists and Active.GetRT = 304 then
383 wDeleteAutotext = true
385 Warnlog "No messages to confirm deleting the Autotext!"
389 Warnlog "Menu Autotext->'Delete' disabled ! Test failed !"
393 sAll = Liste.GetItemCount