Init.xba 21 KB

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