Init.xba 21 KB

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