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