xref: /trunk/main/wizards/source/euro/Init.xba (revision 10d685ea)
1<?xml version="1.0" encoding="UTF-8"?>
2<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
3<!--***********************************************************
4 *
5 * Licensed to the Apache Software Foundation (ASF) under one
6 * or more contributor license agreements.  See the NOTICE file
7 * distributed with this work for additional information
8 * regarding copyright ownership.  The ASF licenses this file
9 * to you under the Apache License, Version 2.0 (the
10 * "License"); you may not use this file except in compliance
11 * with the License.  You may obtain a copy of the License at
12 *
13 *   http://www.apache.org/licenses/LICENSE-2.0
14 *
15 * Unless required by applicable law or agreed to in writing,
16 * software distributed under the License is distributed on an
17 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
18 * KIND, either express or implied.  See the License for the
19 * specific language governing permissions and limitations
20 * under the License.
21 *
22 ***********************************************************-->
23<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Init" script:language="StarBasic">Option Explicit
24REM ***** BASIC *****
25
26Public Const SBRANGEUBOUND = 20
27Public StyleRangeAssignmentList(SBRANGEUBOUND)as String
28Public SelRangeList(SBRANGEUBOUND) as String
29Public RangeList(SBRANGEUBOUND) as String
30Public UnprotectList() as String
31Public FilterNames(2,1) as String
32Public bDoUnProtect as Boolean
33Public bCancelTask as Boolean
34
35Public sREADY as String
36Public sPROTECT as String
37Public sCONTINUE as String
38
39Public sSELTEMPL as String
40Public sSELCELL as String
41Public sCURRRANGES as String
42Public sTEMPLATES as String
43
44Public sSOURCEFILE as String
45Public sSOURCEDIR as String
46Public sTARGETDIR as String
47
48Public sStsPROGRESS as String
49Public sStsCELLPROGRSS as String
50Public sStsRELRANGES as String
51Public sStsRELSHEETRANGES as String
52Public sStsREPROTECT as String
53
54Public sMsgSELDIR as String
55Public sMsgSELFILE as String
56Public sMsgTARGETDIR as String
57Public sMsgNOTTHERE as String
58Public sMsgDLGTITLE as String
59Public sMsgUNPROTECT as String
60Public sMsgPWPROTECT as String
61Public sMsgWRONGPW as String
62Public sMsgSHEETPROTECTED as String
63Public sMsgWARNING as String
64Public sMsgSHEETSNOPROTECT as String
65Public sMsgSHEETNOPROTECT as String
66Public sMsgCHOOSECURRENCY as String
67Public sMsgPASSWORD as String
68Public sMsgOK as String
69Public sMsgCANCEL as String
70Public sMsgFileInvalid as String
71Public sMsgNODIRECTORY as String
72Public sMsgDOCISREADONLY as String
73Public sMsgFileExists as String
74Public sMsgCancelConversion as String
75Public sMsgCancelTitle as String
76Public sCurrPORTUGUESE as String
77Public sCurrDUTCH as String
78Public sCurrFRENCH as String
79Public sCurrSPANISH as String
80Public sCurrITALIAN as String
81Public sCurrGERMAN as String
82Public sCurrBELGIAN as String
83Public sCurrIRISH as String
84Public sCurrLUXEMBOURG as String
85Public sCurrAUSTRIAN as String
86Public sCurrFINNISH as String
87Public sCurrGREEK as String
88Public sCurrSLOVENIAN as String
89Public sCurrCYPRIOT as String
90Public sCurrMALTESE as String
91Public sCurrSLOVAK as String
92Public sCurrESTONIAN as String
93Public sCurrLATVIAN as String
94Public sCurrLITHUANIAN as String
95Public sCurrCROATIAN as String
96Public sCurrUNKNOWN as String
97Public sCurrSYSUNKNOWN as String
98
99Public sPrgsRETRIEVAL as String
100Public sPrgsCONVERTING as String
101Public sPrgsUNPROTECT as String
102Public sInclusiveSubDir as String
103
104Public Const SBCOUNTRYCOUNT = 19
105Public CurMimeType as String
106Public CurCellCount as Long
107Public oSheets as Object
108Public oStyles as Object
109Public oStyle as Object
110Public oFormats as Object
111Public aSimpleStr as String
112Public nSimpleKey as Long
113Public aFormat() as Variant
114Public oRanges as Object
115Public oRange as Object
116Public nLanguage as integer
117Public nFormatLanguage as integer
118Public aCellFormat as Variant
119Public oDocument as Object
120Public StartCol, StartRow, EndCol, EndRow as String
121Public oSheet as Object
122Public IntStartCol,	IntStartRow, IntEndCol,	IntEndRow as integer
123Public oSelRanges as Object
124Public nFormatType as Integer
125Public sFormatCurrency as String
126Public sFormatLanguage as String
127Public CurSheetName as String
128Public oStatusLine as Object
129Public Const SBRELGET = 50
130Public StatusValue as Single
131Public TotCellCount as Long
132Public StyleIndex as Integer
133Public RangeIndex as Integer
134Public CurrIndex as Integer
135Public ActLangNumber(1) as Integer
136Public CurExtension(2) as String
137Public Currfactor as Double
138Public CurrSymbolList(2) as String
139Public CurrLanguage as String
140Public CurrValue(19,5)
141Public LangIDValue(19,2,2) as String
142Public PreName as String
143Public Separator as String
144Public BitmapDir as String
145Public TypeIndex as Integer, CSIndex as Integer, LangIndex as Integer, FSIndex as Integer
146Public oLocale as New com.sun.star.lang.Locale
147Public sEuroSign as String
148Public oPointer as Object
149Public sDocType as String
150Public bPreSelected as Boolean
151Public bRecursive as Boolean
152Public bCancelProtection as Boolean
153Public CurrRoundMode as Boolean
154Public bRangeListDefined as Boolean
155Public bDocHasProtectedSheets as Boolean
156Public sGOON as String
157Public sHELP as String
158Public sCANCEL as String
159Dim sEnd as String
160
161Sub InitializeResources()
162Dim LocWorkPath as String
163	With DialogModel
164		&apos; Strings that are also needed by the Password Dialog
165		sGoOn = GetResText(1003)
166		sHelp = GetResText(1001)
167		sCANCEL = GetResText(1418)
168		sEnd = GetResText(1000)
169		sPROTECT = GetResText(1005)
170		sCONTINUE = GetResText(1007)
171		sSELTEMPL = GetResText(1106)
172		sSELCELL = GetResText(1107)
173		sCURRRANGES = GetResText(1108)
174		sTEMPLATES = GetResText(1109)
175		sStsPROGRESS = GetResText(1300)
176		sStsCELLPROGRSS = GetResText(1301)
177		sStsRELSHEETRANGES = GetResText(1302)
178		sStsRELRANGES = GetResText(1303)
179		sStsREPROTECT = GetResText(1304)
180		sREADY = GetResText(1400)
181		sMsgSELDIR = GetResText(1401)
182		sMsgSELFILE = GetResText(1402)
183		sMsgTARGETDIR = GetResText(1403)
184		sMsgNOTTHERE = GetResText(1404)
185		sMsgDLGTITLE = GetResText(1405)
186		sMsgUNPROTECT = GetResText(1406)
187		sMsgPWPROTECT = GetResText(1407)
188		sMsgWRONGPW = GetResText(1408)
189		sMsgSHEETPROTECTED = GetResText(1409)
190		sMsgWARNING = GetResText(1410)
191		sMsgSHEETSNOPROTECT = GetResText(1411)
192		sMsgSHEETNOPROTECT = GetResText(1412)
193		sMsgCHOOSECURRENCY = GetResText(1415)
194		sMsgPASSWORD = GetResText(1416)
195		sMsgOK = GetResText(1417)
196		sMsgCANCEL = GetResText(1418)
197		sMsgFILEINVALID = GetResText(1419)
198		sMsgFILEINVALID = ReplaceString(sMsgFILEINVALID,&quot;%PRODUCTNAME&quot;, GetProductname())
199		SMsgNODIRECTORY = GetResText(1420)
200		sMsgDOCISREADONLY = GetResText(1421)
201		sMsgFileExists = GetResText(1422)
202		sMsgCancelConversion = GetResText(1423)
203		sMsgCancelTitle = GetResText(1424)
204		sCurrPORTUGUESE = GetResText(1500)
205		sCurrDUTCH = GetResText(1501)
206		sCurrFRENCH = GetResText(1502)
207		sCurrSPANISH = GetResText(1503)
208		sCurrITALIAN = GetResText(1504)
209		sCurrGERMAN = GetResText(1505)
210		sCurrBELGIAN = GetResText(1506)
211		sCurrIRISH = GetResText(1507)
212		sCurrLUXEMBOURG = GetResText(1508)
213		sCurrAUSTRIAN = GetResText(1509)
214		sCurrFINNISH = GetResText(1510)
215		sCurrGREEK = GetResText(1511)
216		sCurrSLOVENIAN = GetResText(1512)
217		sCurrCYPRIOT = GetResText(1513)
218		sCurrMALTESE = GetResText(1514)
219		sCurrSLOVAK = GetResText(1515)
220		sCurrESTONIAN = GetResText(1516)
221		sCurrLATVIAN = GetResText(1517)
222		sCurrLITHUANIAN = GetResText(1518)
223		sCurrCROATIAN = GetResText(1519)
224		sCurrUNKNOWN = GetResText(1520)
225		sCurrSYSUNKNOWN = GetResText(1521)
226		.cmdCancel.Label = sCANCEL
227		.cmdHelp.Label = sHELP
228		.cmdBack.Label = GetResText(1002)
229		.cmdGoOn.Label = sGOON
230		.lblHint.Label = GetResText(1004)
231		.lblCurrencies.Label = GetResText(1006)
232		.cmdBack.Enabled = False
233		If .Step = 1 Then
234			.chkComplete.Label = GetResText(1100)
235			.hlnSelection.Label = GetResText(1101)
236			.optCellTemplates.Label = GetResText(1102)
237			.optSheetRanges.Label = GetResText(1103)
238			.optDocRanges.Label = GetResText(1104)
239			.optSelRange.Label = GetResText(1105)
240			sCURRRANGES = GetResText(1108)
241			.lblSelection.Label = sCURRRANGES
242		Else
243			.lblProgress.Label = sStsPROGRESS
244		 	.hlnExtent.Label = GetResText(1200)
245			.optSingleFile.Label = GetResText(1201)
246 			.optWholeDir.Label = GetResText(1202)
247 			.chkProtect.Label = GetResText(1207)
248 			.chkTextDocuments.Label = GetResText(1210)
249
250			sSOURCEFILE = GetResText(1203)
251			sSOURCEDIR = GetResText(1204)
252 			.lblSource.Label = sSOURCEDIR
253 			sInclusiveSubDir = GetResText(1205)
254 			.chkRecursive.Label = sInclusiveSubDir
255			sTARGETDIR = GetResText(1206)
256 			.lblTarget.Label = STARGETDIR
257
258			LocWorkPath = GetPathSettings(&quot;Work&quot;)
259			If Not oUcb.Exists(LocWorkPath) Then
260				ShowNoOfficePathError()
261				Stop
262			End If
263
264			.txtSource.Text = ConvertfromUrl(LocWorkPath)
265
266			SubstDir = .txtSource.Text
267			.txtTarget.Text = .txtSource.Text
268			.hlnProgress.Label = GetResText(1600)
269			.lblConfig.Label = GetResText(1603)
270			sPrgsRETRIEVAL = GetResText(1601)
271			sPrgsCONVERTING = GetResText(1602)
272			sPrgsUNPROTECT = GetResText(1604)
273		End If
274	End With
275End Sub
276
277Sub InitializeLanguages()
278	sEuroSign = chr(8364)
279
280&apos; CURRENCIES_PORTUGUESE
281	LangIDValue(0,0,0) = &quot;pt&quot;
282	LangIDValue(0,0,1) = &quot;&quot;
283	LangIDValue(0,0,2) = &quot;-816&quot;
284
285&apos; CURRENCIES_DUTCH
286	LangIDValue(1,0,0) = &quot;nl&quot;
287	LangIDValue(1,0,1) = &quot;&quot;
288	LangIDValue(1,0,2) = &quot;-413&quot;
289
290&apos; CURRENCIES_FRENCH
291	LangIDValue(2,0,0) = &quot;fr&quot;
292	LangIDValue(2,0,1) = &quot;&quot;
293	LangIDValue(2,0,2) = &quot;-40C&quot;
294
295&apos; CURRENCIES_SPANISH
296	LangIDValue(3,0,0) = &quot;es&quot;
297	LangIDValue(3,0,1) = &quot;&quot;
298	LangIDValue(3,0,2) = &quot;-40A&quot;
299
300	&apos;Spanish modern
301	LangIDValue(3,1,0) = &quot;es&quot;
302	LangIDValue(3,1,1) = &quot;&quot;
303	LangIDValue(3,1,2) = &quot;-C0A&quot;
304
305	&apos;Spanish katalanic
306	LangIDValue(3,2,0) = &quot;es&quot;
307	LangIDValue(3,2,1) = &quot;&quot;
308	LangIDValue(3,2,2) = &quot;-403&quot;
309
310&apos; CURRENCIES_ITALIAN
311	LangIDValue(4,0,0) = &quot;it&quot;
312	LangIDValue(4,0,1) = &quot;&quot;
313	LangIDValue(4,0,2) = &quot;-410&quot;
314
315&apos; CURRENCIES_GERMAN
316	LangIDValue(5,0,0) = &quot;de&quot;
317	LangIDValue(5,0,1) = &quot;DE&quot;
318	LangIDValue(5,0,2) = &quot;-407&quot;
319
320&apos; CURRENCIES_BELGIAN
321	LangIDValue(6,0,0) = &quot;fr&quot;
322	LangIDValue(6,0,1) = &quot;BE&quot;
323	LangIDValue(6,0,2) = &quot;-80C&quot;
324
325	LangIDValue(6,1,0) = &quot;nl&quot;
326	LangIDValue(6,1,1) = &quot;BE&quot;
327	LangIDValue(6,1,2) = &quot;-813&quot;
328
329&apos; CURRENCIES_IRISH
330	LangIDValue(7,0,0) = &quot;en&quot;
331	LangIDValue(7,0,1) = &quot;IE&quot;
332	LangIDValue(7,0,2) = &quot;-1809&quot;
333
334	LangIDValue(7,1,0) = &quot;ga&quot;
335	LangIDValue(7,1,1) = &quot;IE&quot;
336	LangIDValue(7,1,2) = &quot;-83C&quot;
337
338&apos; CURRENCIES_LUXEMBOURG
339	LangIDValue(8,0,0) = &quot;fr&quot;
340	LangIDValue(8,0,1) = &quot;LU&quot;
341	LangIDValue(8,0,2) = &quot;-140C&quot;
342
343	LangIDValue(8,1,0) = &quot;de&quot;
344	LangIDValue(8,1,1) = &quot;LU&quot;
345	LangIDValue(8,1,2) = &quot;-1007&quot;
346
347&apos; CURRENCIES_AUSTRIAN
348	LangIDValue(9,0,0) = &quot;de&quot;
349	LangIDValue(9,0,1) = &quot;AT&quot;
350	LangIDValue(9,0,2) = &quot;-C07&quot;
351
352&apos; CURRENCIES_FINNISH
353	LangIDValue(10,0,0) = &quot;fi&quot;
354	LangIDValue(10,0,1) = &quot;FI&quot;
355	LangIDValue(10,0,2) = &quot;-40B&quot;
356
357	LangIDValue(10,1,0) = &quot;sv&quot;
358	LangIDValue(10,1,1) = &quot;FI&quot;
359	LangIDValue(10,1,2) = &quot;-81D&quot;
360
361&apos; CURRENCIES_GREEK
362	LangIDValue(11,0,0) = &quot;el&quot;
363	LangIDValue(11,0,1) = &quot;GR&quot;
364	LangIDValue(11,0,2) = &quot;-408&quot;
365
366&apos; CURRENCIES_SLOVENIAN
367	LangIDValue(12,0,0) = &quot;sl&quot;
368	LangIDValue(12,0,1) = &quot;SI&quot;
369	LangIDValue(12,0,2) = &quot;-424&quot;
370
371&apos; CURRENCIES_CYPRIOT
372	LangIDValue(13,0,0) = &quot;el&quot;
373	LangIDValue(13,0,1) = &quot;CY&quot;
374	LangIDValue(13,0,2) = &quot;-408&quot;
375
376&apos; CURRENCIES_MALTESE
377	LangIDValue(14,0,0) = &quot;mt&quot;
378	LangIDValue(14,0,1) = &quot;MT&quot;
379	LangIDValue(14,0,2) = &quot;-43A&quot;
380
381&apos; CURRENCIES_SLOVAK
382	LangIDValue(15,0,0) = &quot;sk&quot;
383	LangIDValue(15,0,1) = &quot;SK&quot;
384	LangIDValue(15,0,2) = &quot;-41B&quot;
385
386&apos; CURRENCIES_ESTONIAN
387	LangIDValue(16,0,0) = &quot;et&quot;
388	LangIDValue(16,0,1) = &quot;ET&quot;
389	LangIDValue(16,0,2) = &quot;-425&quot;
390
391&apos; CURRENCIES_LATVIAN
392	LangIDValue(17,0,0) = &quot;lv&quot;
393	LangIDValue(17,0,1) = &quot;LV&quot;
394	LangIDValue(17,0,2) = &quot;-426&quot;
395
396	&apos;Latgalian
397	LangIDValue(17,1,0) = &quot;ltg&quot;
398	LangIDValue(17,1,1) = &quot;LV&quot;
399	LangIDValue(17,1,2) = &quot;-64B&quot;
400
401&apos; CURRENCIES_LITHUANIAN
402	LangIDValue(18,0,0) = &quot;lt&quot;
403	LangIDValue(18,0,1) = &quot;LT&quot;
404	LangIDValue(18,0,2) = &quot;-427&quot;
405
406&apos; CURRENCIES_CROATIAN
407	LangIDValue(19,0,0) = &quot;hr&quot;
408	LangIDValue(19,0,1) = &quot;HR&quot;
409	LangIDValue(19,0,2) = &quot;-41A&quot;
410
411End Sub
412
413
414
415Sub InitializeCurrencies()
416Dim i as Integer
417	GoOn = True
418
419	CurrValue(0,0) = sCurrPORTUGUESE
420	&apos; real conversion rate
421	CurrValue(0,1) = 200.482
422	&apos; rounded conversion rate
423	CurrValue(0,2) = 200
424	CurrValue(0,3) = &quot;Esc.&quot;
425	CurrValue(0,4) = &quot;Esc.&quot;
426	CurrValue(0,5) = &quot;PTE&quot;
427
428	CurrValue(1,0) = sCurrDUTCH
429	&apos; real conversion rate
430	CurrValue(1,1) = 2.20371
431	&apos; rounded conversion rate
432	CurrValue(1,2) = 2
433	CurrValue(1,3) = &quot;F&quot;
434	CurrValue(1,4) = &quot;fl&quot;
435	CurrValue(1,5) = &quot;NLG&quot;
436
437	CurrValue(2,0) = sCurrFRENCH
438	&apos; real conversion rate
439	CurrValue(2,1) = 6.55957
440	&apos; rounded conversion rate
441	CurrValue(2,2) = 7
442	CurrValue(2,3) = &quot;F&quot;
443	CurrValue(2,4) = &quot;F&quot;
444	CurrValue(2,5) = &quot;FRF&quot;
445
446	CurrValue(3,0) = sCurrSPANISH
447	&apos; real conversion rate
448	CurrValue(3,1) = 166.386
449	&apos; rounded conversion rate
450	CurrValue(3,2) = 170
451	CurrValue(3,3) = &quot;Pts&quot;
452	CurrValue(3,4) = &quot;Pts&quot;
453	CurrValue(3,5) = &quot;ESP&quot;
454
455	CurrValue(4,0) = sCurrITALIAN
456	&apos; real conversion rate
457	CurrValue(4,1) = 1936.27
458	&apos; rounded conversion rate
459	CurrValue(4,2) = 2000
460	CurrValue(4,3) = &quot;L.&quot;
461	CurrValue(4,4) = &quot;L.&quot;
462	CurrValue(4,5) = &quot;ITL&quot;
463
464	CurrValue(5,0) = sCurrGERMAN
465	&apos; real conversion rate
466	CurrValue(5,1) = 1.95583
467	&apos; rounded conversion rate
468	CurrValue(5,2) = 2
469	CurrValue(5,3) = &quot;DM&quot;
470	CurrValue(5,4) = &quot;DM&quot;
471	CurrValue(5,5) = &quot;DEM&quot;
472
473	CurrValue(6,0) = sCurrBELGIAN
474	&apos; real conversion rate
475	CurrValue(6,1) = 40.3399
476	&apos; rounded conversion rate
477	CurrValue(6,2) = 40
478	CurrValue(6,3) = &quot;FB&quot;
479	CurrValue(6,4) = &quot;BF&quot;
480	CurrValue(6,5) = &quot;BEF&quot;
481
482	CurrValue(7,0) = sCurrIRISH
483	&apos; real conversion rate
484	CurrValue(7,1) = 0.787564
485	&apos; rounded conversion rate
486	CurrValue(7,2) = 0.8
487	CurrValue(7,3) = &quot;IR£&quot;
488	CurrValue(7,4) = &quot;£&quot;
489	CurrValue(7,5) = &quot;IEP&quot;
490
491	CurrValue(8,0) = sCurrLUXEMBOURG
492	&apos; real conversion rate
493	CurrValue(8,1) = 40.3399
494	&apos; rounded conversion rate
495	CurrValue(8,2) = 40
496	CurrValue(8,3) = &quot;F&quot;
497	CurrValue(8,4) = &quot;F&quot;
498	CurrValue(8,5) = &quot;LUF&quot;
499
500	CurrValue(9,0) = sCurrAUSTRIAN
501	&apos; real conversion rate
502	CurrValue(9,1) = 13.7603
503	&apos; rounded conversion rate
504	CurrValue(9,2) = 15
505	CurrValue(9,3) = &quot;öS&quot;
506	CurrValue(9,4) = &quot;S&quot;
507	CurrValue(9,5) = &quot;ATS&quot;
508
509	CurrValue(10,0) = sCurrFINNISH
510	&apos; real conversion rate
511	CurrValue(10,1) = 5.94573
512	&apos; rounded conversion rate
513	CurrValue(10,2) = 6
514	CurrValue(10,3) = &quot;mk&quot;
515	CurrValue(10,4) = &quot;mk&quot;
516	CurrValue(10,5) = &quot;FIM&quot;
517
518	CurrValue(11,0) = sCurrGREEK
519	&apos; real conversion rate
520	CurrValue(11,1) = 340.750
521	&apos; rounded conversion rate
522	CurrValue(11,2) = 400
523	CurrValue(11,3) = chr(916) &amp; chr(961) &amp; chr(967)
524	CurrValue(11,4) = chr(916) &amp; chr(961) &amp; chr(967)
525	CurrValue(11,5) = &quot;GRD&quot;
526
527	CurrValue(12,0) = sCurrSLOVENIAN
528	&apos; real conversion rate
529	CurrValue(12,1) = 239.64
530	&apos; rounded conversion rate
531	CurrValue(12,2) = 240
532	CurrValue(12,3) = &quot;SIT&quot;
533	CurrValue(12,4) = &quot;SIT&quot;
534	CurrValue(12,5) = &quot;SIT&quot;
535
536	CurrValue(13,0) = sCurrCYPRIOT
537	&apos; real conversion rate
538	CurrValue(13,1) = 0.585274
539	&apos; rounded conversion rate
540	CurrValue(13,2) = 0.6
541	CurrValue(13,3) = &quot;£C&quot;
542	CurrValue(13,4) = &quot;£&quot;
543	CurrValue(13,5) = &quot;CYP&quot;
544
545	CurrValue(14,0) = sCurrMALTESE
546	&apos; real conversion rate
547	CurrValue(14,1) = 0.429300
548	&apos; rounded conversion rate
549	CurrValue(14,2) = 0.4
550	CurrValue(14,3) = chr(8356)
551	CurrValue(14,4) = &quot;Lm&quot;
552	CurrValue(14,5) = &quot;MTL&quot;
553
554	CurrValue(15,0) = sCurrSLOVAK
555	&apos; real conversion rate
556	CurrValue(15,1) = 30.1260
557	&apos; rounded conversion rate
558	CurrValue(15,2) = 30
559	CurrValue(15,3) = &quot;Sk&quot;
560	CurrValue(15,4) = &quot;Sk&quot;
561	CurrValue(15,5) = &quot;SKK&quot;
562
563	CurrValue(16,0) = sCurrESTONIAN
564	&apos; real conversion rate
565	CurrValue(16,1) = 15.6466
566	&apos; rounded conversion rate
567	CurrValue(16,2) = 15
568	CurrValue(16,3) = &quot;kr&quot;
569	CurrValue(16,4) = &quot;kr&quot;
570	CurrValue(16,5) = &quot;EEK&quot;
571
572	CurrValue(17,0) = sCurrLATVIAN
573	&apos; real conversion rate
574	CurrValue(17,1) = 0.702804
575	&apos; rounded conversion rate
576	CurrValue(17,2) = 0.7
577	CurrValue(17,3) = &quot;Ls&quot;
578	CurrValue(17,4) = &quot;Ls&quot;
579	CurrValue(17,5) = &quot;LVL&quot;
580
581	CurrValue(18,0) = sCurrLITHUANIAN
582	&apos; real conversion rate
583	CurrValue(18,1) = 3.45280
584	&apos; rounded conversion rate
585	CurrValue(18,2) = 3.5
586	CurrValue(18,3) = &quot;Lt&quot;
587	CurrValue(18,4) = &quot;Lt&quot;
588	CurrValue(18,5) = &quot;LTL&quot;
589
590	CurrValue(19,0) = sCurrCROATIAN
591	&apos; real conversion rate
592	CurrValue(19,1) = 7.53450
593	&apos; rounded conversion rate
594	CurrValue(19,2) = 7.5
595	CurrValue(19,3) = &quot;kn&quot;
596	CurrValue(19,4) = &quot;kn&quot;
597	CurrValue(19,5) = &quot;HRK&quot;
598
599	i = -1
600	CurrSymbolList(0) = &quot;&quot;
601	CurrSymbolList(1) = &quot;&quot;
602	InitializeCurrencyValues(CurrIndex)
603End Sub
604
605
606Sub InitializeControls()
607	If CurrIndex = -1 Then
608		If DialogModel.Step = 1 Then
609			EnableStep1DialogControls(True, False, False)
610		ElseIf DialogModel.Step = 2 Then
611			EnableStep2DialogControls(True)
612		End If
613	End If
614End Sub
615
616
617Sub InitializeConverter(oLocale, iDialogPage as Integer)
618Dim Isthere as Boolean
619	bCancelProtection = False
620	bRangeListDefined = False
621	PWIndex = -1
622	If iDialogPage = 1 Then
623		ToggleWindow(False)
624		sDocType = Tools.GetDocumentType(ThisComponent)
625		If sDocType = &quot;sCalc&quot; Then
626			bDocHasProtectedSheets = CheckSheetProtection(oSheets)
627		End If
628		oStatusline = ThisComponent.GetCurrentController.GetFrame.CreateStatusIndicator()
629	End If
630	DialogConvert = LoadDialog(&quot;Euro&quot;, &quot;DlgConvert&quot;)
631	DialogModel = DialogConvert.Model
632	DialogPassword = LoadDialog(&quot;Euro&quot;, &quot;DlgPassword&quot;)
633	PasswordModel = DialogPassword.Model
634	DialogModel.Step = iDialogPage
635	InitializeResources()
636	InitializeLanguages()
637	InitializeLocales(oLocale)
638	InitializeCurrencies()
639	InitializeControls()
640	BitmapDir = GetOfficeSubPath(&quot;Template&quot;, &quot;../wizard/bitmap&quot;)
641	If BitmapDir = &quot;&quot; Then
642		Stop
643	End If
644	FillUpCurrencyListbox()
645	DialogModel.imgPreview.ImageUrl = BitmapDir &amp; &quot;euro_&quot; &amp; DialogModel.Step &amp; &quot;.png&quot;
646	DialogConvert.Title = sMsgDLGTITLE
647	DialogModel.cmdGoOn.DefaultButton = True
648	If iDialogPage = 1 Then
649		ToggleWindow(True)
650	End If
651End Sub
652
653
654Sub	InitializeCurrencyValues(CurrIndex)
655	If CurrIndex &lt;&gt; -1 Then
656		CurrLanguage = CurrValue(CurrIndex,0)
657		CurrFactor = CurrValue(CurrIndex,1)
658		CurrSymbolList(0) = CurrValue(CurrIndex,3)
659		CurrSymbolList(1) = CurrValue(CurrIndex,4)
660		CurrSymbolList(2) = CurrValue(CurrIndex,5)
661	End If
662End Sub
663
664
665Function InitializeLocales(oLocale) as Boolean
666Dim i as Integer, n as Integer, m as Integer
667Dim sLanguage as String, sCountry as String
668Dim bTakeThisLocale as Boolean
669	sLanguage = oLocale.Language
670	sCountry = oLocale.Country
671	For n = 0 To SBCOUNTRYCOUNT - 1
672		For m = 0 TO 1
673			If DialogModel.Step = 2 Then
674				bTakeThisLocale = LangIDValue(n,m,0) = sLanguage
675			Else
676				bTakeThisLocale = LangIDValue(n,m,0) = sLanguage
677			End If
678			If bTakeThisLocale Then
679				CurrIndex = n
680				For i = 0 To 2
681					CurExtension(i) = LangIDValue(CurrIndex,i,2)
682				Next i
683				InitializeLocales = True
684				Exit Function
685			End If
686		Next m
687	Next n
688	CurrIndex = -1
689	InitializeLocales = False
690End Function
691</script:module>
692