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_tool7.inc,v $
13 '* last change: $Author: fredrikh $ $Date: 2008-06-18 09:03:05 $
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 : Functions mostly used for fields
38 '*******************************************************************
48 '\***********************************************************************
50 function fSetLocale(sLocaleSetting as String) as String
52 'This function is set Locale in Tools/Options/Language Settings / Languages
54 Call hToolsOptions("LANGUAGESETTINGS","LANGUAGES")
55 fSetLocale = Gebietsschema.GetSelText
56 Gebietsschema.Select sLocaleSetting
57 Kontext "ExtrasOptionenDlg"
62 '----------------------------------------------------
64 function fSetWestern(sWestern as String) as String
66 'This function is set western language in Tools/Options/Language Settings / Languages
68 Call hToolsOptions("LANGUAGESETTINGS","LANGUAGES")
69 fSetWestern = Westlich.GetSelText
70 if sWestern = "Null" then
74 Westlich.Select sWestern
76 Kontext "ExtrasOptionenDlg"
81 '----------------------------------------------------
83 function fSetAsian(sAsian as String) as String
85 'This function is set CJK language in Tools/Options/Language Settings / Languages
87 Call hToolsOptions("LANGUAGESETTINGS","LANGUAGES")
88 fSetAsian = Asiatisch.GetSelText
89 if sAsian = "Null" then
90 if Asiatisch.IsEnabled then Asiatisch.Select 1
92 if Asiatisch.IsEnabled then Asiatisch.Select sAsian
94 Kontext "ExtrasOptionenDlg"
99 '----------------------------------------------------
101 function fGetType(sType as String) as String
103 'This function will RETURN TYPE
107 case 1: fGetType = "Author"
108 case 7: fGetType = "Автор"
109 case 31: fGetType = "Gebruiker"
110 case 33: fGetType = "Utilisateur"
111 case 34: fGetType = "Autor"
112 case 36: fGetType = "Szerzó"
113 case 39: fGetType = "Autore"
114 case 46: fGetType = "Användare"
115 case 49: fGetType = "Benutzer"
116 case 55: fGetType = "Autor"
117 case 81: fGetType = "ユーザー"
118 case 82: fGetType = "작성�?"
119 case 86: fGetType = "使用者"
120 case 88: fGetType = "使用者"
122 QAErrorLog "Now, the test does not support for the language " +iSprache
127 case 1: fGetType = "Chapter"
128 case 7: fGetType = "Глава"
129 case 31: fGetType = "Hoofdstuk"
130 case 33: fGetType = "Chapitre"
131 case 34: fGetType = "Capítulo"
132 case 36: fGetType = "Fejezet"
133 case 39: fGetType = "Capitolo"
134 case 46: fGetType = "Kapitel"
135 case 49: fGetType = "Kapitel"
136 case 55: fGetType = "Capítulo"
137 case 81: fGetType = "章"
138 case 82: fGetType = "장"
139 case 86: fGetType = "章"
140 case 88: fGetType = "章"
142 QAErrorLog "Now, the test does not support for the language " +iSprache
147 case 1: fGetType = "Date"
148 case 7: fGetTYpe = "Дата"
149 case 31: fGetType = "Datum"
150 case 33: fGetType = "Date"
151 case 34: fGetType = "Fecha"
152 case 36: fGetType = "Dátum"
153 case 39: fGetType = "Data"
154 case 46: fGetType = "Datum"
155 case 49: fGetType = "Datum"
156 case 55: fGetType = "Data"
157 case 81: fGetType = "日付"
158 case 82: fGetType = "날짜"
159 case 86: fGetType = "日期"
160 case 88: fGetType = "日期"
162 QAErrorLog "Now, the test does not support for the language " +iSprache
167 case 1: fGetType = "File name"
168 case 7: fGetType = "Имя файла"
169 case 31: fGetType = "Bestandsnaam"
170 case 33: fGetType = "Nom de fichier"
171 case 34: fGetType = "Nombre del archivo"
172 case 36: fGetType = "Fájlnév"
173 case 39: fGetType = "Nome file"
174 case 46: fGetType = "Filnamn"
175 case 49: fGetType = "Dateiname"
176 case 55: fGetType = "Nome do arquivo"
177 case 81: fGetType = "ファイル�??"
178 case 82: fGetType = "파�?� �?�름"
179 case 86: fGetType = "文件�??"
180 case 88: fGetType = "檔案�??"
182 QAErrorLog "Now, the test does not support for the language " +iSprache
187 case 1: fGetType = "Page"
188 case 7: fGetType = "Страница"
189 case 31: fGetType = "Pagina"
190 case 33: fGetType = "Page"
191 case 34: fGetType = "Página"
192 case 36: fGetType = "Oldal"
193 case 39: fGetType = "Pagina"
194 case 46: fGetType = "Sida"
195 case 49: fGetType = "Seite"
196 case 55: fGetType = "Página"
197 case 81: fGetType = "ページ"
198 case 82: fGetType = "페�?�지"
199 case 86: fGetType = "页"
200 case 88: fGetType = "�?"
202 QAErrorLog "Now, the test does not support for the language " +iSprache
207 case 1: fGetType = "Sender"
208 case 7: fGetType = "Отправитель"
209 case 31: fGetType = "Afzender"
210 case 33: fGetType = "Expéditeur"
211 case 34: fGetType = "Remitente"
212 case 36: fGetType = "Feladó"
213 case 39: fGetType = "Mittente"
214 case 46: fGetType = "Avsändare"
215 case 49: fGetType = "Absender"
216 case 55: fGetType = "Remetente"
217 case 81: fGetType = "差出人"
218 case 82: fGetType = "보낸 사람"
219 case 86: fGetType = "�?�件人"
220 case 88: fGetType = "寄件者"
222 QAErrorLog "Now, the test does not support for the language " +iSprache
227 case 1: fGetType = "Statistics"
228 case 7: fGetType = "Статистика"
229 case 31: fGetType = "Statistiek"
230 case 33: fGetType = "Statistiques"
231 case 34: fGetType = "Estadística"
232 case 36: fGetType = "Statisztika"
233 case 39: fGetType = "Statistiche"
234 case 46: fGetType = "Statistik"
235 case 49: fGetType = "Statistik"
236 case 55: fGetType = "Estatísticas"
237 case 81: fGetType = "統計"
238 case 82: fGetType = "통계"
239 case 86: fGetType = "统计"
240 case 88: fGetType = "統計"
242 QAErrorLog "Now, the test does not support for the language " +iSprache
247 case 1: fGetType = "Templates"
248 case 7: fGetType = "Шаблоны"
249 case 31: fGetType = "Sjablonen"
250 case 33: fGetType = "Modèle de document"
251 case 34: fGetType = "Plantillas"
252 case 36: fGetType = "Sablonok"
253 case 39: fGetType = "Modello"
254 case 46: fGetType = "Dokumentmall"
255 case 49: fGetType = "Dokumentvorlage"
256 case 55: fGetType = "Modelos"
257 case 81: fGetType = "ドキュメントテンプレート"
258 case 82: fGetType = "서�? 파�?�"
259 case 86: fGetType = "文档�?样"
260 case 88: fGetType = "文件樣�?"
262 QAErrorLog "Now, the test does not support for the language " +iSprache
267 case 1: fGetType = "Time"
268 case 7: fGetTYpe = "Время"
269 case 31: fGetType = "Tijd"
270 case 33: fGetType = "Heure"
271 case 34: fGetType = "Hora"
272 case 36: fGetTYpe = "Idó"
273 case 39: fGetType = "Orario"
274 case 46: fGetType = "Klockslag"
275 case 49: fGetType = "Uhrzeit"
276 case 55: fGetType = "Hora"
277 case 81: fGetType = "時刻"
278 case 82: fGetType = "시간"
279 case 86: fGetType = "时间"
280 case 88: fGetType = "時間"
282 QAErrorLog "Now, the test does not support for the language " +iSprache
285 case else : ' Fallback
286 QAErrorLog "Now, the test does not support for the type -- " &sType
292 '----------------------------------------------------
294 function fGetFieldContent( ) as String
296 Call fFormatCharacter("TabHyperlinkZeichen")
297 fGetFieldContent = Hinweis.GetText
298 TabHyperlinkZeichen.Cancel
302 '----------------------------------------------------
304 function fSetToBigSize( )
306 Call fFormatCharacter("TabFont")
308 SizeWest.Select SizeWest.GetItemCount
310 Size.Select Size.GetItemCount
317 '----------------------------------------------------
319 function fGetDirLanguage( ) as String
321 'This function will RETURN language name for
323 'eg . $SO_path/share/template/?? <- What you need to know
325 case 01 : fGetDirLanguage = "en-US" '(English USA)
326 case 31 : fGetDirLanguage = "nl" ' Dutch
327 case 33 : fGetDirLanguage = "fr-FR" '(French)
328 case 34 : fGetDirLanguage = "es-ES" '(Spanish)
329 case 39 : fGetDirLanguage = "it-IT" '(Italian)
330 case 46 : fGetDirLanguage = "sv-SE" '(Swedish)
331 case 49 : fGetDirLanguage = "de-DE" '(German)
332 case 55 : fGetDirLanguage = "pt-BR" '(Portuguese)
333 case 81 : fGetDirLanguage = "ja-JP" '(Japanese)
334 case 82 : fGetDirLanguage = "ko-KR" '(Korean)
335 case 86 : fGetDirLanguage = "zh-CN" '(Simplified Chinese)
336 case 88 : fGetDirLanguage = "zh-TW" '(Traditional Chinese)
337 case else : QAErrorLog "The test does not support the language " + iSprache
338 fGetDirLanguage = "en-US"
343 '----------------------------------------------------
345 function fGetCategory( ) as String
347 'This function will RETURN Category when inserting from template
349 case 01 : fGetCategory = "Education"
350 case 31 : fGetCategory = "Opleiding"
351 case 33 : fGetCategory = "Éducation"
352 case 34 : fGetCategory = "Educación"
353 case 39 : fGetCategory = "Formazione"
354 case 46 : fGetCategory = "Utbildning"
355 case 49 : fGetCategory = "Bildung"
356 case 55 : fGetCategory = "Formação"
357 case 81 : fGetCategory = "教養"
358 case 82 : fGetCategory = "�?사 학위 논문"
359 case 86 : fGetCategory = "教育"
360 case 88 : fGetCategory = "教育"
361 case else : QAErrorLog "The test does not support the language " + iSprache
366 '----------------------------------------------------
368 function fGetStyle( ) as String
370 'This function will RETURN Style when inserting from template
372 case 01 : fGetStyle = "Master's Thesis"
373 case 33 : fGetStyle = "Mémoire"
374 case 34 : fGetStyle = "Trabajo de licenciatura"
375 case 39 : fGetStyle = "Tesi di laurea"
376 case 46 : fGetStyle = "Examensarbete"
377 case 49 : fGetStyle = "Diplomarbeit"
378 case 55 : fGetStyle = "Dissertação de Mestrado"
379 case 81 : fGetStyle = "�?�業論文"
380 case 82 : fGetStyle = "�?육"
381 case 86 : fGetStyle = "硕士论文"
382 case 88 : fGetStyle = "碩士論文"
383 case else : QAErrorLog "The test does not support the language " + iSprache
388 '----------------------------------------------------
390 function fGetDate(sDate as String) as String
392 Dim sMonth , sDay , sYear as String
394 'This function will RETURN Style when inserting from template
396 select case iSystemSprache
398 sMonth = Left (sDate , 2)
399 sDay = Mid (sDate , 4 , 2)
400 sYear = Right(sDate , 2)
402 sMonth = Mid (sDate , 4 , 2)
403 sDay = Left (sDate , 2)
404 sYear = Right(sDate , 2)
406 sMonth = Mid (sDate , 6 , 2)
407 sDay = Right(sDate , 2)
408 sYear = Mid (sDate , 3 , 2)
412 fGetDate = sMonth & "/" & sDay & "/" & sYear
416 '----------------------------------------------------
418 function fGetDate1(sDate as String) as String
420 Dim sMonth , sDay , sYear as String
422 'This function will RETURN Style when inserting from template
424 select case iSystemSprache
426 sMonth = Left (sDate , 2)
427 sDay = Mid (sDate , 4 , 2)
428 sYear = Right(sDate , 4)
430 sMonth = Mid (sDate , 4 , 2)
431 sDay = Left (sDate , 2)
432 sYear = Right(sDate , 4)
434 sMonth = Mid (sDate , 6 , 2)
435 sDay = Right(sDate , 2)
436 sYear = Left (sDate , 4)
440 fGetDate1 = sMonth & "/" & sDay & "/" & sYear
444 '-------------------------------------------------------------------------------------------
446 function fConvertBacklashToSlash (sTest) as String
447 '/// convert all \ to / , return the string with /
448 '///+ eg, \tmp\test\optional\includes\ ==> /tmp/test/optional/includes/
451 Dim s1$ : Dim s2$ : Dim s3$
457 i = InStr( s1$, "\" )
458 if i = 0 then exit do
459 s2$ = Left( s1$ , i-1 )
460 s1$ = Mid( s1$ , i+1 )
461 s3$ = s3$ + s2$ + "/"
463 fConvertBacklashToSlash = s3$ + s1$