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