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_table.bas,v $
12 '* last change: $Author: vg $ $Date: 2008-08-18 12:22:57 $
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 : Writer Table test
37 '\***********************************************************************
39 global mUnit
as string
40 global cDecSep
as string 'Decimal Seperator init in 'sub w_204_'
41 global cSep
as string 'Seperator for numbers formated as text init in 'sub w_204_'
42 global gLocaleDefault
as string
43 global gDocumentLanguage
as string
50 use
"writer\tools\includes\w_tools.inc"
51 use
"writer\tools\includes\w_tool5.inc"
52 use
"writer\tools\includes\w_tool6.inc"
54 use
"writer\optional\includes\table\w_204_.inc"
55 use
"writer\optional\includes\table\w_204a_.inc"
56 use
"writer\optional\includes\table\w_204b_.inc"
58 printlog
Chr(13) & "Loading of Include - Files takes: " & Wielange ( StartZeit
)
61 Printlog
"----------------------------------------------"
62 Printlog
"| Writer Table Test |"
63 Printlog
"----------------------------------------------"
66 'Checking for supported language
67 if fLocaleString("LocaleText") = "Abortion" then
68 warnlog
"This test does not support language " & iSprache
71 'First some settings to verify a stable run
72 Call TableConfiguration
74 Call hStatusIn("writer","w_table.bas","Writer Table test")
80 'Restoring default settings after testrun
83 Printlog
"Duration: "& WieLange ( StartZeit
)
84 Printlog
"Date: " & Date & " Time: " & Time
87 '---------------------------------------------------------------------------------------------------------------------
90 use
"global\system\includes\master.inc"
91 use
"global\system\includes\gvariabl.inc"
92 use
"global\tools\includes\optional\t_locale_strings1.inc"
94 gApplication
= "WRITER"
97 sub TableConfiguration
98 Call wOptionsUndo("Tabelle")
100 if iSprache
= iSystemSprache
then
101 printlog
"Systemlocale matches UI-language"
102 else qaerrorlog
"Systemlocale does not match UI-language, locale settings have to be adjusted"
104 Call hToolsOptions ("LanguageSettings", "Languages")
105 gLocaleDefault
= Gebietsschema
.GetSelText
106 Gebietsschema
.Select(fLocaleString("LocaleLocaleSettings"))
107 Kontext
"ExtrasOptionenDlg"
110 'Verifiing if documentlanguage matches UI language
112 Call hToolsOptions ("LanguageSettings", "Languages")
113 if fLocaleString("LocaleScriptType") = "Western" then
114 gDocumentLanguage
= Westlich
.GetSelText
115 if gDocumentLanguage
<> iSprache
then Westlich
.Select(fLocaleString("LocaleLocaleSettings"))
117 if fLocaleString("LocaleScriptType") = "CJK" then
118 gDocumentLanguage
= Asiatisch
.GetSelText
119 if gDocumentLanguage
<> iSprache
then Asiatisch
.Select(fLocaleString("LocaleLocaleSettings"))
121 if fLocaleString("LocaleScriptType") = "CTL" then
122 gDocumentLanguage
= LanguageComplexScript
.GetSelText
123 if gDocumentLanguage
<> iSprache
then LanguageComplexScript
.Select(fLocaleString("LocaleLocaleSettings"))
125 Kontext
"ExtrasOptionenDlg"
128 mUnit
= fSetMeasurementToCM()
130 Call hToolsOptions ("Writer","GENERAL")
131 cDecSep
= GetDecimalSeperator(Tabulatorenabstand
.GetText
)
132 Kontext
"ExtrasOptionenDlg"
135 ' Seperator to calculate with is not the same as used in UI
136 ' so we can't use GetDecimalSeparator here
137 Call wTypeKeys ("1/2")
138 Call wTypeKeys ("<Shift Home>")
140 if Instr(GetClipBoardtext
, ",") > 0 then cSep
= ","
141 if Instr(GetClipBoardtext
, ".") > 0 then cSep
= "."
145 '---------------------------------------------------------------------------------------------------------------------
148 If iSprache
<> iSystemSprache
then
151 Call hToolsOptions ("LanguageSettings", "Languages")
152 Gebietsschema
.Select(gLocaleDefault
)
153 Kontext
"ExtrasOptionenDlg"
157 Call hToolsOptions ("LanguageSettings", "Languages")
158 if fLocaleString("LocaleScriptType") = "Western" then Westlich
.Select(gDocumentLanguage
)
159 if fLocaleString("LocaleScriptType") = "CJK" then Asiatisch
.Select(gDocumentLanguage
)
160 if fLocaleString("LocaleScriptType") = "CTL" then LanguageComplexScript
.Select(gDocumentLanguage
)
161 Kontext
"ExtrasOptionenDlg"
163 If iSprache
<> iSystemSprache
then