mirror of
https://gitee.com/kekingcn/file-online-preview.git
synced 2026-05-09 08:24:02 +00:00
优化项目结构、优化 maven 结构
This commit is contained in:
371
office-plugin/windows-office/share/basic/Depot/CommonLang.xba
Normal file
371
office-plugin/windows-office/share/basic/Depot/CommonLang.xba
Normal file
@@ -0,0 +1,371 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
|
||||
<!--***********************************************************
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
***********************************************************-->
|
||||
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="CommonLang" script:language="StarBasic">REM ***** BASIC *****
|
||||
|
||||
|
||||
' Column A has the index 1
|
||||
Public Const SBCOLUMNNAME1 = 3 ' Stock names, sheet 1
|
||||
Public Const SBCOLUMNID1 = 4 ' Stock ID, sheet 1
|
||||
Public Const SBCOLUMNQUANTITY1 = 5 ' Stock quantity sheet 1
|
||||
Public Const SBCOLUMNRATE1 = 7 ' Price for stocks, sheet 1
|
||||
Public Const SBCOLUMNNAME2 = 3 ' Stock names, sheet 2
|
||||
Public Const SBCOLUMNDATE2 = 4 ' Transaction dates, sheet 2
|
||||
Public Const SBCOLUMNQUANTITY2 = 5 ' Transaction quantity, sheet 2
|
||||
Public Const SBCOLUMNRATE2 = 6 ' Price for stocks, sheet 2
|
||||
Public Const SBCOLUMNPROVPERCENT2 = 7 ' Provision in %, sheet 2
|
||||
Public Const SBCOLUMNPROVMIN2 = 8 ' Minimum provision, sheet 2
|
||||
Public Const SBCOLUMNPROVFIX2 = 9 ' Fixed provision, sheet 2
|
||||
Public Const SBCOLUMNPROCEEDS2 = 12 ' Profit, sheet 2
|
||||
Public Const SBCOLUMNQTYSOLD2 = 14 ' Quantity sold, sheet 2
|
||||
Public Const SBCOLUMNQTYREST2 = 15 ' Quantity not sold yet, sheet 2
|
||||
Public Const SBCOLUMNPRCREST2 = 16 ' Proportional proce for quantity not sold yet, sheet 2
|
||||
Public Const SBCOLUMNREALPROC2 = 17 ' Realized proceeds, sheet 2
|
||||
Public Const SBCOLUMNDIVIDEND2 = 18 ' Dividend paid, sheet 2
|
||||
Public Const SBCOLUMNREALPROFIT2 = 19 ' Realized profit, sheet 2
|
||||
Public Const SBROWFIRSTTRANSACT2 = 8 ' First data row, sheet 2
|
||||
Public Const SBROWHEADER1 = 6 ' Headline, sheet 1
|
||||
Public Const SBMSGOK = 0
|
||||
Public Const SBMSGYESNO = 4
|
||||
Public Const SBMSGSTOP = 16
|
||||
Public Const SBMSGQUESTION = 32
|
||||
Public Const SBMSGDEFAULTBTN2 = 256
|
||||
Public Const SBHASID = 1 ' 0 = no ID, 1 = stocks have an ID
|
||||
Public Const SBDIALOGSELL = 1 ' Step for main dialog
|
||||
Public Const SBDIALOGBUY = 2 ' Step for main dialog
|
||||
Public Const SBBINARY = 0
|
||||
Public TransactMode as Integer
|
||||
Public Const LIFO = -1
|
||||
Public Const FIFO = 1
|
||||
|
||||
Public Const HANDLEDIVIDEND = 1
|
||||
Public Const HANDLESPLIT = 2
|
||||
|
||||
Global oDocument as Object
|
||||
Global oDocFormats() as Object
|
||||
Global oController as Object
|
||||
Global oFirstSheet as Object
|
||||
Global oBankSheet as Object
|
||||
Global oMovementSheet as Object
|
||||
Global sDocLanguage as String
|
||||
Global sDocCountry as String
|
||||
Global oSheets as Object
|
||||
Global oDocLocale as New com.sun.star.lang.Locale
|
||||
Global bEnableMarket as Boolean
|
||||
Global bEnableInternet as Boolean
|
||||
Global oMarketModel as Object
|
||||
Global oInternetModel as Object
|
||||
|
||||
Global sCurCurrency$, sCurExtension$, sCurChartSource$, sCurStockIDLabel$, sCurSeparator$
|
||||
|
||||
Public oNumberFormatter as Object
|
||||
Public bDebugmode as Boolean
|
||||
Global GlobListindex as Integer
|
||||
Public blabla() as String
|
||||
Public SplitDate as Date
|
||||
Public oChartSheet as Object
|
||||
Public oBackgroundSheet as Object
|
||||
Public Const SBDATECOLUMN = 3
|
||||
Public Const SBVALUECOLUMN = 4
|
||||
Public Const SBSTARTROW = 25
|
||||
Public Const SBCHARTPERIOD = 14
|
||||
Public Const SBINTERVAL = "d"
|
||||
Public sColumnHeader as String
|
||||
Public StartDate as Date
|
||||
Public EndDate as Date
|
||||
Public iCurRow as Integer
|
||||
Public iMaxRow as Integer
|
||||
Public iStartDay as Integer
|
||||
Public iStartMonth as Integer
|
||||
Public iStartYear as Integer
|
||||
Public iEndDay as Integer
|
||||
Public iEndMonth as Integer
|
||||
Public iEndYear as Integer
|
||||
Public oStatusLine as Object
|
||||
Public Today as Date
|
||||
Public sInterval as String
|
||||
Public ShortMonths(11,1)
|
||||
Public iStep as Integer
|
||||
Public sDepotCurrency as String
|
||||
Public iValueCol as Integer
|
||||
|
||||
Public DlgReference as Object
|
||||
Public DlgTransaction as Object
|
||||
Public DlgStockRates as Object
|
||||
Public DlgStartUp as Object
|
||||
Public TransactModel as Object
|
||||
Public StockRatesModel as Object
|
||||
Public StartUpModel as Object
|
||||
Public StockRatesTitle(1 To 3)
|
||||
Public TransactTitle(1 To 2)
|
||||
Public NullList()
|
||||
Public sStartupWelcome$, sStartupChooseMarket$, sStartupHint$
|
||||
|
||||
Public sMarket(7,10) as String
|
||||
Public sCountryMarket(7,10) as String
|
||||
|
||||
Public cDlgCaption1$, cDlgCaption2$
|
||||
Public sMsgError$, sMsgNoName$, sMsgNoQuantity$, sMsgNoDividend$, sMsgNoExchangeRate$
|
||||
Public sMsgNoValidExchangeDate$, sMsgWrongExchangeDate$, sMsgSellTooMuch$, sMsgConfirm$
|
||||
Public sMsgFreeStock$, sMsgTotalLoss$, sMsgEndDatebeforeNow$, sMsgStartDatebeforeEndDate$
|
||||
|
||||
Public sOk$, sCancel$
|
||||
Public sMsgAuthorization$, sMsgDeleteAll$
|
||||
Public SellMethod$
|
||||
Public cSplit$
|
||||
Global HistoryChartSource as String
|
||||
Public DateCellStyle as String
|
||||
Public CurrCellStyle as String
|
||||
Public sStartDate$, sEndDate$, sHistory$
|
||||
Public sInsertStockname$
|
||||
Public sProductname$, sTitle$
|
||||
Public sInsertStocks$, sStockname$, sNoInternetUpdate$, sMarketplace$, sNoInternetDataAvailable$
|
||||
Public sCheckInternetSettings as String
|
||||
|
||||
Sub LoadLanguage()
|
||||
LoadDepotDialogs()
|
||||
Select Case sDocLanguage
|
||||
Case "de"
|
||||
LoadGermanLanguage()
|
||||
Case "en"
|
||||
LoadEnglishLanguage()
|
||||
Case "fr"
|
||||
LoadFrenchLanguage()
|
||||
Case "it"
|
||||
LoadItalianLanguage()
|
||||
Case "es"
|
||||
LoadSpanishLanguage()
|
||||
Case "sv"
|
||||
LoadSwedishLanguage()
|
||||
Case "ja"
|
||||
LoadJapaneseLanguage()
|
||||
Case "ko"
|
||||
LoadKoreanLanguage()
|
||||
Case "zh"
|
||||
If sDocCountry = "CN" Then
|
||||
LoadChineseSimpleLanguage()
|
||||
Else
|
||||
LoadChineseTradLanguage()
|
||||
End If
|
||||
End Select
|
||||
InitializeStartUpModel()
|
||||
End Sub
|
||||
|
||||
Sub CompleteMarketList()
|
||||
Dim EuroIndex as Integer
|
||||
Dim LocCountry as String
|
||||
Dim LocLanguage as String
|
||||
Dim sLangList() as String
|
||||
Dim sCountryList() as String
|
||||
Dim sExtensionList() as String
|
||||
Dim MaxIndex as Integer
|
||||
Dim bIsLocale as Boolean
|
||||
|
||||
GlobListIndex = -1
|
||||
For n = 0 To 5
|
||||
LocLanguage = sMarket(n,6)
|
||||
LocCountry = sMarket(n,7)
|
||||
If Instr(1,LocLanguage,";",SBBINARY) = 0 Then
|
||||
bIsLocale = CheckDocLocale(LocLanguage, LocCountry)
|
||||
Else
|
||||
EuroIndex = 0
|
||||
sLangList() = ArrayoutofString(LocLanguage, ";", MaxIndex)
|
||||
sCountryList() = ArrayoutofString(LocCountry, ";", MaxIndex)
|
||||
sExtensionList() = ArrayoutofString(sMarket(n,8), ";", MaxIndex)
|
||||
For m = 0 To MaxIndex
|
||||
bIsLocale = CheckDocLocale(sLangList(m), sCountryList(m))
|
||||
If bIsLocale Then
|
||||
EuroIndex = m
|
||||
Exit For
|
||||
End If
|
||||
Next m
|
||||
sMarket(n,6) = sLangList(EuroIndex)
|
||||
sMarket(n,7) = sCountryList(EuroIndex)
|
||||
sMarket(n,8) = sExtensionList(EuroIndex)
|
||||
End If
|
||||
If bIsLocale Then
|
||||
GlobListIndex = n
|
||||
Exit For
|
||||
End If
|
||||
Next n
|
||||
End Sub
|
||||
|
||||
Sub LocalizedCurrencies()
|
||||
If GlobListIndex = -1 Then
|
||||
sCountryMarket(0,0) = "Euro"
|
||||
sCountryMarket(0,1) = chr(8364)
|
||||
sCountryMarket(0,2) = "Paris"
|
||||
sCountryMarket(0,3) = "http://fr.finance.yahoo.com/d/quotes.csv?s=<StockID>.PA&f=s4l1t1c1ghov&e=.csv"
|
||||
sCountryMarket(0,5) = "Code"
|
||||
sCountryMarket(0,6) = "fr"
|
||||
sCountryMarket(0,7) = "FR"
|
||||
sCountryMarket(0,8) = "40C"
|
||||
sCountryMarket(0,9) = "59/9"
|
||||
sCountryMarket(0,10) = "1"
|
||||
|
||||
sCountryMarket(1,0) = "Euro"
|
||||
sCountryMarket(1,1) = chr(8364)
|
||||
sCountryMarket(1,2) = "Milano"
|
||||
sCountryMarket(1,3) = "http://it.finance.yahoo.com/d/quotes.csv?s=<StockID>.MI&f=sl1d1t1c1ohgv&e=.csv"
|
||||
sCountryMarket(1,5) = "Codice"
|
||||
sCountryMarket(1,6) = "it"
|
||||
sCountryMarket(1,7) = "IT"
|
||||
sCountryMarket(1,8) = "410"
|
||||
sCountryMarket(1,9) = "44"
|
||||
sCountryMarket(1,10) = "1"
|
||||
|
||||
sCountryMarket(2,0) = "Euro"
|
||||
sCountryMarket(2,1) = chr(8364)
|
||||
sCountryMarket(2,2) = "Madrid"
|
||||
sCountryMarket(2,3) = "http://es.finance.yahoo.com/d/quotes.csv?s=<StockID>&m=MC&f=sl1d1t1c1ohgv&e=.csv"
|
||||
sCountryMarket(2,5) = "Simbolo"
|
||||
sCountryMarket(2,6) = "es"
|
||||
sCountryMarket(2,7) = "ES"
|
||||
sCountryMarket(2,8) = "40A"
|
||||
sCountryMarket(2,9) = "44"
|
||||
sCountryMarket(2,10) = "1"
|
||||
|
||||
sCountryMarket(3,0) = "Dansk krone"
|
||||
sCountryMarket(3,1) = "kr"
|
||||
sCountryMarket(3,2) = "København"
|
||||
sCountryMarket(3,3) = "http://dk.finance.yahoo.com/d/quotes.csv?s=<StockID.CO&f=sl1d1t1c1ohgv&e=.csv"
|
||||
sCountryMarket(3,5) = "Aktiesymbol"
|
||||
sCountryMarket(3,6) = "da"
|
||||
sCountryMarket(3,7) = "DK"
|
||||
sCountryMarket(3,8) = "406"
|
||||
sCountryMarket(3,9) = "44"
|
||||
sCountryMarket(3,10) = "1"
|
||||
|
||||
sCountryMarket(4,0) = "Svensk krona"
|
||||
sCountryMarket(4,1) = "kr"
|
||||
sCountryMarket(4,2) = "Stockholm"
|
||||
sCountryMarket(4,3) = "http://se.finance.yahoo.com/d/quotes.csv?s=<StockID>.L&f=sl1d1t1c1ohgv&e=.c"
|
||||
sCountryMarket(4,5) = "Kod"
|
||||
sCountryMarket(4,6) = "sv"
|
||||
sCountryMarket(4,7) = "SE"
|
||||
sCountryMarket(4,8) = "41D"
|
||||
sCountryMarket(4,9) = "44"
|
||||
sCountryMarket(4,10) = "1"
|
||||
|
||||
' Taiwan Dollar
|
||||
sCountryMarket(5,0) = "新臺幣"
|
||||
sCountryMarket(5,1) = "¥"
|
||||
sCountryMarket(5,2) = "代號"
|
||||
sCountryMarket(5,3) = "http://tw.finance.yahoo.com/d/quotes.csv?s=<StockID>.TW&f=sl1d1t1c1ohgv&e=.csv"
|
||||
sCountryMarket(5,5) = "代號"
|
||||
sCountryMarket(5,6) = "zh"
|
||||
sCountryMarket(5,7) = "TW"
|
||||
sCountryMarket(5,8) = "404"
|
||||
sCountryMarket(5,9) = "44"
|
||||
sCountryMarket(5,10) = "1"
|
||||
|
||||
' Chinese Yuan
|
||||
sCountryMarket(6,0) = "人民币"
|
||||
sCountryMarket(6,1) = "¥"
|
||||
sCountryMarket(6,2) = "代号"
|
||||
sCountryMarket(6,3) = "http://cn.finance.yahoo.com/d/quotes.csv?s=<StockID>.SS&f=sl1d1t1c1ohgv&e=.csv"
|
||||
sCountryMarket(6,5) = "代号"
|
||||
sCountryMarket(6,6) = "zh"
|
||||
sCountryMarket(6,7) = "CN"
|
||||
sCountryMarket(6,8) = "804"
|
||||
sCountryMarket(6,9) = "44"
|
||||
sCountryMarket(6,10) = "1"
|
||||
|
||||
' korean Won
|
||||
sCountryMarket(7,0) = "한국 원화"
|
||||
sCountryMarket(7,1) = "₩"
|
||||
sCountryMarket(7,2) = "서울"
|
||||
sCountryMarket(7,3) = "http://kr.finance.yahoo.com/d/quotes.csv?s=<StockID>.KS&f=snl1d1t1c1ohgv&e=.csv"
|
||||
sCountryMarket(7,5) = "종목 코드"
|
||||
sCountryMarket(7,6) = "ko"
|
||||
sCountryMarket(7,7) = "KR"
|
||||
sCountryMarket(7,8) = "412"
|
||||
sCountryMarket(7,9) = "44"
|
||||
sCountryMarket(7,10) = "2"
|
||||
|
||||
|
||||
' sCountryMarket(5,0) = "Российский рубль"
|
||||
' sCountryMarket(5,1) = "р."
|
||||
' sCountryMarket(5,2) = ""
|
||||
' sCountryMarket(5,3) = ""
|
||||
' sCountryMarket(5,5) = ""
|
||||
' sCountryMarket(5,6) = "ru"
|
||||
' sCountryMarket(5,7) = "RU"
|
||||
' sCountryMarket(5,8) = "-419"
|
||||
' sCountryMarket(5,9) = ""
|
||||
'
|
||||
' sCountryMarket(6,0) = "Złoty polski"
|
||||
' sCountryMarket(6,1) = "zł"
|
||||
' sCountryMarket(6,2) = ""
|
||||
' sCountryMarket(6,3) = ""
|
||||
' sCountryMarket(6,5) = "" 'Still Todo!!
|
||||
' sCountryMarket(6,6) = "pl"
|
||||
' sCountryMarket(6,7) = "PL"
|
||||
' sCountryMarket(6,8) = "-415"
|
||||
' sCountryMarket(6,9) = ""
|
||||
'
|
||||
' sCountryMarket(7,0) = "Türkische Lira"
|
||||
' sCountryMarket(7,1) = "TL"
|
||||
' sCountryMarket(7,2) = ""
|
||||
' sCountryMarket(7,3) = ""
|
||||
' sCountryMarket(7,5) = "" 'Still Todo!!
|
||||
' sCountryMarket(7,6) = "tr"
|
||||
' sCountryMarket(7,7) = "TR"
|
||||
' sCountryMarket(7,8) = "-41F"
|
||||
' sCountryMarket(7,9) = ""
|
||||
|
||||
Dim n as Integer
|
||||
Dim m as Integer
|
||||
' Dim sCountryMarket(6,9) as String
|
||||
|
||||
For n = 0 To Ubound(sCountryMarket(),1)
|
||||
If sDocLanguage = sCountryMarket(n,6) and sDocCountry = sCountryMarket(n,7) Then
|
||||
GlobListIndex = 6
|
||||
For m = 0 To 10
|
||||
sMarket(6,m) = sCountryMarket(n,m)
|
||||
Next m
|
||||
Exit For
|
||||
End If
|
||||
Next n
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Sub LoadDepotDialogs()
|
||||
DlgTransaction = LoadDialog("Depot", "Dialog2")
|
||||
DlgStockRates = LoadDialog("Depot", "Dialog3")
|
||||
DlgStartUp = LoadDialog("Depot", "Dialog4")
|
||||
TransactModel = DlgTransaction.Model
|
||||
StockRatesModel = DlgStockRates.Model
|
||||
StartUpModel = DlgStartUp.Model
|
||||
End Sub
|
||||
|
||||
|
||||
Sub InitializeStartUpModel()
|
||||
With StartUpModel
|
||||
.lblWelcome.Label = sStartupWelcome & Chr(13) & chr(13) & sStartUpChooseMarket
|
||||
sStartUpHint = ReplaceString(sStartUpHint, sHistory, "<History>")
|
||||
.lblHint.Label = sStartupHint
|
||||
' .cmdGoOn.Enabled = Ubound(StartUpModel.lstMarkets.SelectedItems()) <> -1
|
||||
.cmdGoOn.Label = sOK
|
||||
.cmdCancel.Label = sCancel
|
||||
End With
|
||||
End Sub</script:module>
|
||||
198
office-plugin/windows-office/share/basic/Depot/Currency.xba
Normal file
198
office-plugin/windows-office/share/basic/Depot/Currency.xba
Normal file
@@ -0,0 +1,198 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
|
||||
<!--***********************************************************
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
***********************************************************-->
|
||||
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Currency" script:language="StarBasic">REM ***** BASIC *****
|
||||
Option Explicit
|
||||
|
||||
Dim bDoUnLoad as Boolean
|
||||
|
||||
|
||||
Sub Startup()
|
||||
Dim i as Integer
|
||||
Dim a as Integer
|
||||
Dim ListString as String
|
||||
Dim MarketListBoxControl as Object
|
||||
Initialize(False)
|
||||
MarketListBoxControl = DlgStartUp.GetControl("lstMarkets")
|
||||
a = 0
|
||||
For i = 0 To Ubound(sMarket(),1)
|
||||
ListString = sMarket(i,0)
|
||||
If sMarket(i,0) <> "" Then
|
||||
If sMarket(i,3) = "" Then
|
||||
ListString = ListString & " (" & sNoInternetUpdate & ")"
|
||||
Else
|
||||
ListString = ListString & " (" & sMarketplace & " " & sMarket(i,2) & ")"
|
||||
End If
|
||||
MarketListBoxControl.AddItem(ListString, a)
|
||||
a = a + 1
|
||||
End If
|
||||
Next i
|
||||
MarketListBoxControl.SelectItemPos(GlobListIndex, True)
|
||||
DlgStartUp.Title = sDepotCurrency
|
||||
DlgStartUp.Model.cmdGoOn.DefaultButton = True
|
||||
DlgStartUp.GetControl("lstMarkets").SetFocus()
|
||||
DlgStartUp.Execute()
|
||||
DlgStartUp.Dispose()
|
||||
End Sub
|
||||
|
||||
|
||||
Sub EnableGoOnButton()
|
||||
StartUpModel.cmdGoOn.Enabled = True
|
||||
StartUpModel.cmdGoOn.DefaultButton = True
|
||||
End Sub
|
||||
|
||||
|
||||
Sub CloseStartUpDialog()
|
||||
DlgStartUp.EndExecute()
|
||||
' oDocument.Dispose()
|
||||
End Sub
|
||||
|
||||
|
||||
Sub DisposeDocument()
|
||||
If bDoUnload Then
|
||||
oDocument.Dispose()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Sub ChooseMarket(Optional aEvent)
|
||||
Dim Index as Integer
|
||||
Dim bIsDocLanguage as Boolean
|
||||
Dim bIsDocCountry as Boolean
|
||||
oInternetModel = GetControlModel(oDocument.Sheets(0), "CmdInternet")
|
||||
If Not IsMissing(aEvent) Then
|
||||
Index = StartupModel.lstMarkets.SelectedItems(0)
|
||||
oInternetModel.Tag = Index
|
||||
Else
|
||||
Index = oInternetModel.Tag
|
||||
End If
|
||||
oMarketModel = GetControlModel(oDocument.Sheets(0), "CmdHistory")
|
||||
sCurCurrency = sMarket(Index,1)
|
||||
If Index = 0 Then
|
||||
HistoryChartSource = sMarket(Index,4)
|
||||
End If
|
||||
sCurStockIDLabel = sMarket(Index,5)
|
||||
sCurExtension = sMarket(Index,8)
|
||||
iValueCol = Val(sMarket(Index,10)
|
||||
If Instr(sCurExtension,";") <> 0 Then
|
||||
' Take the german extension as the stock place is Frankfurt
|
||||
sCurExtension = "407"
|
||||
End If
|
||||
sCurChartSource = sMarket(Index,3)
|
||||
bIsDocLanguage = Instr(1, sMarket(Index,6), sDocLanguage, SBBINARY) <> 0
|
||||
bIsDocCountry = Instr(1, sMarket(Index,7), sDocCountry, SBBINARY) <> 0 OR SDocCountry = ""
|
||||
sCurSeparator = sMarket(Index,9)
|
||||
TransactModel.txtRate.CurrencySymbol = sCurCurrency
|
||||
TransactModel.txtFix.CurrencySymbol = sCurCurrency
|
||||
TransactModel.txtMinimum.CurrencySymbol = sCurCurrency
|
||||
bEnableMarket = Index = 0
|
||||
bEnableInternet = sCurChartSource <> ""
|
||||
oMarketModel.Enabled = bEnableMarket
|
||||
oInternetModel.Enabled = bEnableInternet
|
||||
If Not IsMissing(aEvent) Then
|
||||
ConvertStylesCurrencies()
|
||||
bDoUnload = False
|
||||
DlgStartUp.EndExecute()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Sub ConvertStylesCurrencies()
|
||||
Dim m as integer
|
||||
Dim aStyleFormat as Object
|
||||
Dim StyleName as String
|
||||
Dim bAddToList as Boolean
|
||||
Dim oStyle as Object
|
||||
Dim oStyles as Object
|
||||
UnprotectSheets(oSheets)
|
||||
oFirstSheet.GetCellByPosition(SBCOLUMNID1, SBROWHEADER1).SetString(sCurStockIDLabel)
|
||||
oStyles = oDocument.StyleFamilies.GetbyIndex(0)
|
||||
For m = 0 To oStyles.count-1
|
||||
oStyle = oStyles.GetbyIndex(m)
|
||||
StyleName = oStyle.Name
|
||||
bAddToList = CheckFormatType(oStyle)
|
||||
If bAddToList Then
|
||||
SwitchNumberFormat(ostyle, oDocFormats, sCurCurrency, sCurExtension)
|
||||
End If
|
||||
Next m
|
||||
ProtectSheets(oSheets)
|
||||
End Sub
|
||||
|
||||
|
||||
Sub SwitchNumberFormat(oObject as Object, oFormats as object, sNewSymbol as String, sNewExtension as String)
|
||||
Dim nFormatLanguage as Integer
|
||||
Dim nFormatDecimals as Integer
|
||||
Dim nFormatLeading as Integer
|
||||
Dim bFormatLeading as Integer
|
||||
Dim bFormatNegRed as Integer
|
||||
Dim bFormatThousands as Integer
|
||||
Dim aNewStr as String
|
||||
Dim iNumberFormat as Long
|
||||
Dim sSimpleStr as String
|
||||
Dim nSimpleKey as Long
|
||||
Dim aFormat()
|
||||
Dim oLocale as New com.sun.star.lang.Locale
|
||||
' Numberformat with the new Symbol as Base for new Format
|
||||
sSimpleStr = "0 [$" & sNewSymbol & "-" & sNewExtension & "]"
|
||||
nSimpleKey = Numberformat(oFormats, sSimpleStr, oDocLocale)
|
||||
On Local Error Resume Next
|
||||
iNumberFormat = oObject.NumberFormat
|
||||
If Err <> 0 Then
|
||||
Msgbox "Error Reading the Number Format"
|
||||
Resume CLERROR
|
||||
End If
|
||||
|
||||
On Local Error GoTo NOKEY
|
||||
aFormat() = oFormats.getByKey(iNumberFormat)
|
||||
On Local Error GoTo 0
|
||||
' set new currency format with according settings
|
||||
nFormatDecimals = aFormat.Decimals
|
||||
nFormatLeading = aFormat.LeadingZeros
|
||||
bFormatNegRed = aFormat.NegativeRed
|
||||
bFormatThousands = aFormat.ThousandsSeparator
|
||||
oLocale = aFormat.Locale
|
||||
aNewStr = oFormats.generateFormat(nSimpleKey, oLocale, bFormatThousands, bFormatNegRed, nFormatDecimals, nFormatLeading)
|
||||
oObject.NumberFormat = Numberformat(oFormats, aNewStr, oLocale)
|
||||
NOKEY:
|
||||
If Err <> 0 Then
|
||||
Resume CLERROR
|
||||
End If
|
||||
CLERROR:
|
||||
End Sub
|
||||
|
||||
|
||||
Function Numberformat( oFormats as Object, aFormatStr as String, oLocale as Variant )
|
||||
Dim nRetkey
|
||||
nRetKey = oFormats.queryKey(aFormatStr, oLocale, True)
|
||||
If nRetKey = -1 Then
|
||||
nRetKey = oFormats.addNew( aFormatStr, oLocale )
|
||||
If nRetKey = -1 Then nRetKey = 0
|
||||
End If
|
||||
Numberformat = nRetKey
|
||||
End Function
|
||||
|
||||
|
||||
Function CheckFormatType(oStyle as Object)
|
||||
Dim oFormatofObject as Object
|
||||
oFormatofObject = oDocFormats.getByKey(oStyle.NumberFormat)
|
||||
CheckFormatType = INT(oFormatOfObject.Type) AND com.sun.star.util.NumberFormat.CURRENCY
|
||||
End Function</script:module>
|
||||
520
office-plugin/windows-office/share/basic/Depot/Depot.xba
Normal file
520
office-plugin/windows-office/share/basic/Depot/Depot.xba
Normal file
File diff suppressed because it is too large
Load Diff
56
office-plugin/windows-office/share/basic/Depot/Dialog2.xdl
Normal file
56
office-plugin/windows-office/share/basic/Depot/Dialog2.xdl
Normal file
@@ -0,0 +1,56 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE dlg:window PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "dialog.dtd">
|
||||
<!--***********************************************************
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
***********************************************************-->
|
||||
<dlg:window xmlns:dlg="http://openoffice.org/2000/dialog" xmlns:script="http://openoffice.org/2000/script" dlg:id="Dialog2" dlg:tab-index="0" dlg:left="91" dlg:top="24" dlg:width="220" dlg:height="128" dlg:page="1" dlg:help-url="HID:WIZARDS_HID_DLGDEPOT_DIALOG_SELLBUY" dlg:closeable="true" dlg:moveable="true">
|
||||
<dlg:bulletinboard>
|
||||
<dlg:text dlg:id="lblStockNames" dlg:tab-index="0" dlg:left="6" dlg:top="6" dlg:width="102" dlg:height="8" dlg:value="lblStockNames"/>
|
||||
<dlg:menulist dlg:id="lstSellStocks" dlg:tab-index="1" dlg:left="6" dlg:top="17" dlg:width="102" dlg:height="12" dlg:page="1" dlg:help-url="HID:WIZARDS_HID_DLGDEPOT_1_LSTSELLSTOCKS" dlg:spin="true">
|
||||
<script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.script:Depot.Depot.SelectStockname?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:menulist>
|
||||
<dlg:combobox dlg:id="lstBuyStocks" dlg:tab-index="2" dlg:left="6" dlg:top="17" dlg:width="102" dlg:height="12" dlg:page="2" dlg:help-url="HID:WIZARDS_HID_DLGDEPOT_2_LSTBUYSTOCKS" dlg:spin="true">
|
||||
<script:event script:event-name="on-textchange" script:macro-name="vnd.sun.star.script:Depot.Depot.SelectStockname?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:combobox>
|
||||
<dlg:text dlg:id="lblStockID" dlg:tab-index="3" dlg:left="150" dlg:top="6" dlg:width="66" dlg:height="8" dlg:value="lblStockID"/>
|
||||
<dlg:textfield dlg:id="txtStockID" dlg:tab-index="4" dlg:left="150" dlg:top="17" dlg:width="40" dlg:height="12" dlg:help-url="HID:WIZARDS_HID_DLGDEPOT_0_TXTSTOCKID_SELLBUY"/>
|
||||
<dlg:text dlg:id="lblQuantity" dlg:tab-index="5" dlg:left="6" dlg:top="36" dlg:width="57" dlg:height="8" dlg:value="lblQuantity"/>
|
||||
<dlg:numericfield dlg:id="txtQuantity" dlg:tab-index="6" dlg:left="6" dlg:top="47" dlg:width="46" dlg:height="12" dlg:help-url="HID:WIZARDS_HID_DLGDEPOT_0_TXTQUANTITY" dlg:decimal-accuracy="0" dlg:value-min="1"/>
|
||||
<dlg:currencyfield dlg:id="txtRate" dlg:tab-index="7" dlg:left="68" dlg:top="47" dlg:width="40" dlg:height="12" dlg:help-url="HID:WIZARDS_HID_DLGDEPOT_0_TXTRATE" dlg:value-min="0"/>
|
||||
<dlg:datefield dlg:id="txtDate" dlg:tab-index="8" dlg:left="150" dlg:top="47" dlg:width="50" dlg:height="12" dlg:tag="Dialog2" dlg:help-url="HID:WIZARDS_HID_DLGDEPOT_0_TXTDATE" dlg:strict-format="true" dlg:spin="true">
|
||||
<script:event script:event-name="on-textchange" script:macro-name="vnd.sun.star.script:Depot.tools.CheckInputDate?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:datefield>
|
||||
<dlg:text dlg:id="lblRate" dlg:tab-index="9" dlg:left="68" dlg:top="36" dlg:width="77" dlg:height="8" dlg:value="lblRate"/>
|
||||
<dlg:text dlg:id="lblDate" dlg:tab-index="10" dlg:left="150" dlg:top="37" dlg:width="66" dlg:height="8" dlg:value="lblDate"/>
|
||||
<dlg:formattedfield dlg:id="txtCommission" dlg:tab-index="11" dlg:left="6" dlg:top="90" dlg:width="40" dlg:height="12" dlg:help-url="HID:WIZARDS_HID_DLGDEPOT_0_TXTCOMMISSION" dlg:format-code="0,00%" dlg:format-locale="de;DE"/>
|
||||
<dlg:text dlg:id="lblCommission" dlg:tab-index="12" dlg:left="6" dlg:top="79" dlg:width="60" dlg:height="8" dlg:value="lblCommission"/>
|
||||
<dlg:currencyfield dlg:id="txtFix" dlg:tab-index="13" dlg:left="68" dlg:top="90" dlg:width="40" dlg:height="12" dlg:help-url="HID:WIZARDS_HID_DLGDEPOT_0_TXTFIX" dlg:value-min="0"/>
|
||||
<dlg:currencyfield dlg:id="txtMinimum" dlg:tab-index="14" dlg:left="150" dlg:top="90" dlg:width="40" dlg:height="12" dlg:help-url="HID:WIZARDS_HID_DLGDEPOT_0_TXTMINIMUM" dlg:value-min="0"/>
|
||||
<dlg:text dlg:id="lblFix" dlg:tab-index="15" dlg:left="68" dlg:top="79" dlg:width="71" dlg:height="8" dlg:value="lblFix"/>
|
||||
<dlg:text dlg:id="lblMinimum" dlg:tab-index="16" dlg:left="150" dlg:top="79" dlg:width="66" dlg:height="8" dlg:value="lblMinimum"/>
|
||||
<dlg:button dlg:id="cmdCancel" dlg:tab-index="17" dlg:left="58" dlg:top="109" dlg:width="50" dlg:height="14" dlg:help-url="HID:WIZARDS_HID_DLGDEPOT_0_CMDCANCEL_SELLBUY" dlg:value="cmdCancel">
|
||||
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:Depot.Depot.CancelTransaction?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:button>
|
||||
<dlg:button dlg:id="cmdGoOn" dlg:tab-index="18" dlg:left="111" dlg:top="109" dlg:width="50" dlg:height="14" dlg:help-url="HID:WIZARDS_HID_DLGDEPOT_0_CMDGOON_SELLBUY" dlg:value="cmdGoOn">
|
||||
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:Depot.Depot.TransactionOk?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:button>
|
||||
<dlg:fixedline dlg:id="hlnCommission" dlg:tab-index="19" dlg:left="6" dlg:top="66" dlg:width="210" dlg:height="8" dlg:value="hlnCommission"/>
|
||||
</dlg:bulletinboard>
|
||||
</dlg:window>
|
||||
65
office-plugin/windows-office/share/basic/Depot/Dialog3.xdl
Normal file
65
office-plugin/windows-office/share/basic/Depot/Dialog3.xdl
Normal file
@@ -0,0 +1,65 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE dlg:window PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "dialog.dtd">
|
||||
<!--***********************************************************
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
***********************************************************-->
|
||||
<dlg:window xmlns:dlg="http://openoffice.org/2000/dialog" xmlns:script="http://openoffice.org/2000/script" dlg:id="Dialog3" dlg:left="161" dlg:top="81" dlg:width="176" dlg:height="119" dlg:page="3" dlg:help-url="HID:WIZARDS_HID_DLGDEPOT_DIALOG_SPLIT" dlg:closeable="true" dlg:moveable="true">
|
||||
<dlg:bulletinboard>
|
||||
<dlg:text dlg:id="lblStockNames" dlg:tab-index="0" dlg:left="6" dlg:top="6" dlg:width="98" dlg:height="8" dlg:value="lblStockNames"/>
|
||||
<dlg:menulist dlg:id="lstStockNames" dlg:tab-index="1" dlg:left="5" dlg:top="17" dlg:width="102" dlg:height="12" dlg:help-url="HID:WIZARDS_HID_DLGDEPOT_0_LSTSTOCKNAMES" dlg:spin="true">
|
||||
<script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.script:Depot.Depot.SelectStockNameForRates?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:menulist>
|
||||
<dlg:textfield dlg:id="txtStockID" dlg:tab-index="2" dlg:left="120" dlg:top="17" dlg:width="50" dlg:height="12" dlg:help-url="HID:WIZARDS_HID_DLGDEPOT_0_TXTSTOCKID_SPLIT"/>
|
||||
<dlg:datefield dlg:id="txtStartDate" dlg:tab-index="3" dlg:left="63" dlg:top="37" dlg:width="50" dlg:height="12" dlg:page="3" dlg:help-url="HID:WIZARDS_HID_DLGDEPOT_3_TXTSTARTDATE" dlg:spin="true">
|
||||
<script:event script:event-name="on-textchange" script:macro-name="vnd.sun.star.script:Depot.tools.CheckInputDate?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:datefield>
|
||||
<dlg:datefield dlg:id="txtEndDate" dlg:tab-index="4" dlg:left="63" dlg:top="53" dlg:width="50" dlg:height="12" dlg:page="3" dlg:help-url="HID:WIZARDS_HID_DLGDEPOT_3_TXTENDDATE" dlg:spin="true">
|
||||
<script:event script:event-name="on-textchange" script:macro-name="vnd.sun.star.script:Depot.tools.CheckInputDate?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:datefield>
|
||||
<dlg:radiogroup>
|
||||
<dlg:radio dlg:id="optDaily" dlg:tab-index="5" dlg:left="12" dlg:top="83" dlg:width="75" dlg:height="10" dlg:page="3" dlg:help-url="HID:WIZARDS_HID_DLGDEPOT_3_OPTDAILY" dlg:value="optDaily"/>
|
||||
<dlg:radio dlg:id="optWeekly" dlg:tab-index="6" dlg:left="101" dlg:top="83" dlg:width="69" dlg:height="10" dlg:page="3" dlg:help-url="HID:WIZARDS_HID_DLGDEPOT_3_OPTWEEKLY" dlg:value="optWeekly"/>
|
||||
</dlg:radiogroup>
|
||||
<dlg:datefield dlg:id="txtDate" dlg:tab-index="7" dlg:left="71" dlg:top="73" dlg:width="50" dlg:height="12" dlg:page="2" dlg:help-url="HID:WIZARDS_HID_DLGDEPOT_2_TXTDATE" dlg:spin="true">
|
||||
<script:event script:event-name="on-textchange" script:macro-name="vnd.sun.star.script:Depot.tools.CheckInputDate?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:datefield>
|
||||
<dlg:radiogroup>
|
||||
<dlg:radio dlg:id="optPerShare" dlg:tab-index="8" dlg:left="6" dlg:top="37" dlg:width="69" dlg:height="10" dlg:page="1" dlg:help-url="HID:WIZARDS_HID_DLGDEPOT_1_OPTPERSHARE" dlg:value="optPerShare"/>
|
||||
<dlg:radio dlg:id="optTotal" dlg:tab-index="9" dlg:left="6" dlg:top="51" dlg:width="69" dlg:height="10" dlg:page="1" dlg:help-url="HID:WIZARDS_HID_DLGDEPOT_1_OPTTOTAL" dlg:value="optTotal"/>
|
||||
</dlg:radiogroup>
|
||||
<dlg:currencyfield dlg:id="txtDividend" dlg:tab-index="10" dlg:left="6" dlg:top="80" dlg:width="50" dlg:height="12" dlg:page="1" dlg:help-url="HID:WIZARDS_HID_DLGDEPOT_1_TXTDIVIDEND" dlg:value-min="0" dlg:spin="true"/>
|
||||
<dlg:button dlg:id="cmdCancel" dlg:tab-index="11" dlg:left="41" dlg:top="98" dlg:width="50" dlg:height="14" dlg:help-url="HID:WIZARDS_HID_DLGDEPOT_0_CMDCANCEL_SPLIT" dlg:value="cmdCancel">
|
||||
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:Depot.Depot.CancelStockRate?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:button>
|
||||
<dlg:button dlg:id="cmdGoOn" dlg:tab-index="12" dlg:left="94" dlg:top="98" dlg:width="50" dlg:height="14" dlg:help-url="HID:WIZARDS_HID_DLGDEPOT_0_CMDGOON_SPLIT" dlg:value="cmdGoOn">
|
||||
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:Depot.Depot.CommitStockRate?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:button>
|
||||
<dlg:text dlg:id="lblStockID" dlg:tab-index="13" dlg:left="120" dlg:top="6" dlg:width="50" dlg:height="8" dlg:value="lblStockID"/>
|
||||
<dlg:text dlg:id="lblDividend" dlg:tab-index="14" dlg:left="6" dlg:top="68" dlg:width="73" dlg:height="8" dlg:page="1" dlg:value="lblDividend"/>
|
||||
<dlg:text dlg:id="lblExchangeRate" dlg:tab-index="15" dlg:left="6" dlg:top="39" dlg:width="92" dlg:height="8" dlg:page="2" dlg:value="lblExchangeRate"/>
|
||||
<dlg:text dlg:id="lblColon" dlg:tab-index="16" dlg:left="40" dlg:top="55" dlg:width="5" dlg:height="8" dlg:page="2" dlg:value=" :"/>
|
||||
<dlg:text dlg:id="lblDate" dlg:tab-index="17" dlg:left="5" dlg:top="75" dlg:width="66" dlg:height="8" dlg:page="2" dlg:value="lblDate"/>
|
||||
<dlg:fixedline dlg:id="hlnInterval" dlg:tab-index="18" dlg:left="6" dlg:top="72" dlg:width="164" dlg:height="8" dlg:page="3" dlg:value="hlnInterval"/>
|
||||
<dlg:text dlg:id="lblStartDate" dlg:tab-index="19" dlg:left="6" dlg:top="39" dlg:width="53" dlg:height="8" dlg:page="3" dlg:value="lblStartDate"/>
|
||||
<dlg:text dlg:id="lblEndDate" dlg:tab-index="20" dlg:left="6" dlg:top="55" dlg:width="53" dlg:height="8" dlg:page="3" dlg:value="lblEndDate"/>
|
||||
<dlg:numericfield dlg:id="txtOldRate" dlg:tab-index="21" dlg:left="6" dlg:top="53" dlg:width="30" dlg:height="12" dlg:page="2" dlg:help-url="HID:WIZARDS_HID_DLGDEPOT_2_TXTOLDRATE" dlg:decimal-accuracy="0" dlg:value-min="1" dlg:spin="true"/>
|
||||
<dlg:numericfield dlg:id="txtNewRate" dlg:tab-index="22" dlg:left="50" dlg:top="53" dlg:width="30" dlg:height="12" dlg:page="2" dlg:help-url="HID:WIZARDS_HID_DLGDEPOT_2_TXTNEWRATE" dlg:decimal-accuracy="0" dlg:value-min="1" dlg:spin="true"/>
|
||||
</dlg:bulletinboard>
|
||||
</dlg:window>
|
||||
37
office-plugin/windows-office/share/basic/Depot/Dialog4.xdl
Normal file
37
office-plugin/windows-office/share/basic/Depot/Dialog4.xdl
Normal file
@@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE dlg:window PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "dialog.dtd">
|
||||
<!--***********************************************************
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
***********************************************************-->
|
||||
<dlg:window xmlns:dlg="http://openoffice.org/2000/dialog" xmlns:script="http://openoffice.org/2000/script" dlg:id="Dialog4" dlg:left="161" dlg:top="81" dlg:width="160" dlg:height="120" dlg:page="1" dlg:help-url="HID:WIZARDS_HID_DLGDEPOT_DIALOG_HISTORY" dlg:closeable="true" dlg:moveable="true">
|
||||
<dlg:bulletinboard>
|
||||
<dlg:text dlg:id="lblWelcome" dlg:tab-index="0" dlg:left="6" dlg:top="6" dlg:width="148" dlg:height="49" dlg:value="lblWelcome" dlg:multiline="true"/>
|
||||
<dlg:text dlg:id="lblHint" dlg:tab-index="1" dlg:left="6" dlg:top="73" dlg:width="148" dlg:height="26" dlg:value="lblHint" dlg:multiline="true"/>
|
||||
<dlg:button dlg:id="cmdCancel" dlg:tab-index="2" dlg:left="28" dlg:top="100" dlg:width="50" dlg:height="14" dlg:help-url="HID:WIZARDS_HID_DLGDEPOT_0_CMDCANCEL_HISTORY" dlg:value="cmdCancel">
|
||||
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:Depot.Currency.CloseStartUpDialog?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:button>
|
||||
<dlg:button dlg:id="cmdGoOn" dlg:tab-index="3" dlg:left="84" dlg:top="100" dlg:width="52" dlg:height="14" dlg:help-url="HID:WIZARDS_HID_DLGDEPOT_0_CMDGOON_HISTORY" dlg:value="cmdGoOn">
|
||||
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:Depot.Currency.ChooseMarket?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:button>
|
||||
<dlg:menulist dlg:id="lstMarkets" dlg:tab-index="4" dlg:left="6" dlg:top="57" dlg:width="148" dlg:height="12" dlg:help-url="HID:WIZARDS_HID_DLGDEPOT_LSTMARKETS" dlg:spin="true">
|
||||
<script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.script:Depot.Currency.EnableGoOnButton?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:menulist>
|
||||
</dlg:bulletinboard>
|
||||
</dlg:window>
|
||||
359
office-plugin/windows-office/share/basic/Depot/Internet.xba
Normal file
359
office-plugin/windows-office/share/basic/Depot/Internet.xba
Normal file
@@ -0,0 +1,359 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
|
||||
<!--***********************************************************
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
***********************************************************-->
|
||||
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Internet" script:language="StarBasic">REM ***** BASIC *****
|
||||
Option Explicit
|
||||
Public sNewSheetName as String
|
||||
|
||||
Function CheckHistoryControls()
|
||||
Dim bLocGoOn as Boolean
|
||||
Dim Firstdate as Date
|
||||
Dim LastDate as Date
|
||||
LastDate = CDateFromISO(StockRatesModel.txtEndDate.Date)
|
||||
FirstDate = CDateFromISO(StockRatesModel.txtStartDate.Date)
|
||||
bLocGoOn = FirstDate <> 0 And LastDate <> 0
|
||||
If bLocGoOn Then
|
||||
If FirstDate >= LastDate Then
|
||||
Msgbox(sMsgStartDatebeforeEndDate,16, sProductname)
|
||||
bLocGoOn = False
|
||||
End If
|
||||
End If
|
||||
CheckHistoryControls = bLocGoon
|
||||
End Function
|
||||
|
||||
|
||||
Sub InsertCompanyHistory()
|
||||
Dim StockName as String
|
||||
Dim CurRow as Integer
|
||||
Dim sMsgInternetError as String
|
||||
Dim CurRate as Double
|
||||
Dim oCell as Object
|
||||
Dim sStockID as String
|
||||
Dim ChartSource as String
|
||||
If CheckHistoryControls() Then
|
||||
StartDate = CDateFromISO(StockRatesModel.txtStartDate.Date)
|
||||
EndDate = CDateFromISO(StockRatesModel.txtEndDate.Date)
|
||||
DlgStockRates.EndExecute()
|
||||
If StockRatesModel.optDaily.State = 1 Then
|
||||
sInterval = "d"
|
||||
iStep = 1
|
||||
ElseIf StockRatesModel.optWeekly.State = 1 Then
|
||||
sInterval = "w"
|
||||
iStep = 7
|
||||
StartDate = StartDate - WeekDay(StartDate) + 2
|
||||
EndDate = EndDate - WeekDay(EndDate) + 2
|
||||
End If
|
||||
iEndDay = Day(EndDate)
|
||||
iEndMonth = Month(EndDate)
|
||||
iEndYear = Year(EndDate)
|
||||
iStartDay = Day(StartDate)
|
||||
iStartMonth = Month(StartDate)
|
||||
iStartYear = Year(StartDate)
|
||||
' oDocument.AddActionLock()
|
||||
UnprotectSheets(oSheets)
|
||||
InitializeStatusline("", 10, 1)
|
||||
oBackGroundSheet = oSheets.GetbyName("Background")
|
||||
StockName = DlgStockRates.GetControl("lstStockNames").GetSelectedItem()
|
||||
CurRow = GetStockRowIndex(Stockname)
|
||||
sStockID = oFirstSheet.GetCellByPosition(SBCOLUMNID1, CurRow).String
|
||||
ChartSource = ReplaceString(HistoryChartSource, sStockID, "<StockID>")
|
||||
ChartSource = ReplaceString(ChartSource, iStartDay, "<StartDay>")
|
||||
ChartSource = ReplaceString(ChartSource, cStr(iStartMonth-1), "<StartMonth>")
|
||||
ChartSource = ReplaceString(ChartSource, iStartYear, "<StartYear>")
|
||||
ChartSource = ReplaceString(ChartSource, iEndDay, "<EndDay>")
|
||||
ChartSource = ReplaceString(ChartSource, cStr(iEndMonth-1), "<EndMonth>")
|
||||
ChartSource = ReplaceString(ChartSource, iEndYear, "<EndYear>")
|
||||
ChartSource = ReplaceString(ChartSource, sInterval, "<interval>")
|
||||
oStatusLine.SetValue(2)
|
||||
If GetCurrentRate(ChartSource, CurRate, 1) Then
|
||||
oStatusLine.SetValue(8)
|
||||
UpdateValue(StockName, Today, CurRate)
|
||||
oStatusLine.SetValue(9)
|
||||
UpdateChart(StockName)
|
||||
oStatusLine.SetValue(10)
|
||||
Else
|
||||
sMsgInternetError = Stockname & ": " & sNoInternetDataAvailable & chr(13) & sCheckInternetSettings
|
||||
Msgbox(sMsgInternetError, 16, sProductname)
|
||||
End If
|
||||
ProtectSheets(oSheets)
|
||||
oStatusLine.End
|
||||
If oSheets.HasbyName(sNewSheetName) Then
|
||||
oController.ActiveSheet = oSheets.GetByName(sNewSheetName)
|
||||
End If
|
||||
' oDocument.RemoveActionLock()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Sub InternetUpdate()
|
||||
Dim i as Integer
|
||||
Dim StocksCount as Integer
|
||||
Dim iStartRow as Integer
|
||||
Dim sUrl as String
|
||||
Dim StockName as String
|
||||
Dim CurRate as Double
|
||||
Dim oCell as Object
|
||||
Dim sMsgInternetError as String
|
||||
Dim sStockID as String
|
||||
Dim ChartSource as String
|
||||
' oDocument.AddActionLock()
|
||||
Initialize(True)
|
||||
UnprotectSheets(oSheets)
|
||||
StocksCount = GetStocksCount(iStartRow)
|
||||
InitializeStatusline("", StocksCount + 1, 1)
|
||||
Today = CDate(Date)
|
||||
For i = iStartRow + 1 To iStartRow + StocksCount
|
||||
StockName = oFirstSheet.GetCellbyPosition(SBCOLUMNNAME1, i).String
|
||||
sStockID = oFirstSheet.GetCellByPosition(SBCOLUMNID1, i).String
|
||||
ChartSource = ReplaceString(sCurChartSource, sStockID, "<StockID>")
|
||||
If GetCurrentRate(ChartSource, CurRate, 0) Then
|
||||
InsertCurrentValue(CurRate, i, Now)
|
||||
Else
|
||||
sMsgInternetError = Stockname & ": " & sNoInternetDataAvailable & chr(13) & sCheckInternetSettings
|
||||
Msgbox(sMsgInternetError, 16, sProductname)
|
||||
End If
|
||||
oStatusline.SetValue(i - iStartRow + 1)
|
||||
Next
|
||||
ProtectSheets(oSheets)
|
||||
oStatusLine.End
|
||||
' oDocument.RemoveActionLock
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Function GetCurrentRate(sUrl as String, fValue As Double, iValueRow as Integer) as Boolean
|
||||
Dim sFilter As String
|
||||
Dim sOptions As String
|
||||
Dim oLinkSheet As Object
|
||||
Dim sDate as String
|
||||
If oSheets.hasByName("Link") Then
|
||||
oLinkSheet = oSheets.getByName("Link")
|
||||
Else
|
||||
oLinkSheet = oDocument.createInstance("com.sun.star.sheet.Spreadsheet")
|
||||
oSheets.insertByName("Link", oLinkSheet)
|
||||
oLinkSheet.IsVisible = False
|
||||
End If
|
||||
|
||||
sFilter = "Text - txt - csv (StarCalc)"
|
||||
sOptions = sCurSeparator & ",34,SYSTEM,1,1/10/2/10/3/10/4/10/5/10/6/10/7/10/8/10/9/10"
|
||||
|
||||
oLinkSheet.LinkMode = com.sun.star.sheet.SheetLinkMode.NONE
|
||||
oLinkSheet.link(sUrl, "", sFilter, sOptions, 1 )
|
||||
fValue = oLinkSheet.getCellByPosition(iValueCol, iValueRow).Value
|
||||
If fValue = 0 Then
|
||||
Dim sValue as String
|
||||
sValue = oLinkSheet.getCellByPosition(1, iValueRow).String
|
||||
sValue = ReplaceString(sValue, ".",",")
|
||||
fValue = Val(sValue)
|
||||
End If
|
||||
GetCurrentRate = fValue <> 0
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
Sub UpdateValue(ByVal sName As String, fDate As Double, fValue As Double )
|
||||
Dim oSheet As Object
|
||||
Dim iColumn As Long
|
||||
Dim iRow As Long
|
||||
Dim i as Integer
|
||||
Dim oCell As Object
|
||||
Dim LastDate as Date
|
||||
Dim bLeaveLoop as Boolean
|
||||
Dim RemoveCount as Integer
|
||||
Dim iLastRow as Integer
|
||||
Dim iLastLinkRow as Integer
|
||||
Dim dDate as Date
|
||||
Dim CurDate as Date
|
||||
Dim oLinkSheet as Object
|
||||
Dim StartIndex as Integer
|
||||
Dim iCellValue as Long
|
||||
' Insert Sheet with Company - Chart
|
||||
sName = CheckNewSheetname(oSheets, sName)
|
||||
If NOT oSheets.hasByName(sName) Then
|
||||
oSheets.CopybyName("Background", sName, oSheets.Count)
|
||||
oSheet = oSheets.getByName(sName)
|
||||
iCurRow = SBSTARTROW
|
||||
iMaxRow = iCurRow
|
||||
oCell = oSheet.getCellByPosition(SBDATECOLUMN, iCurRow)
|
||||
oCell.Value = fDate
|
||||
End If
|
||||
sNewSheetName = sName
|
||||
oLinkSheet = oSheets.GetByName("Link")
|
||||
oSheet = oSheets.getByName(sName)
|
||||
iLastRow = GetLastUsedRow(oSheet)- 2
|
||||
iLastLinkRow = GetLastUsedRow(oLinkSheet)
|
||||
iCurRow = iLastRow
|
||||
bLeaveLoop = False
|
||||
RemoveCount = 0
|
||||
' Delete all Cells in Date Area
|
||||
Do
|
||||
oCell = oSheet.GetCellbyPosition(SBDATECOLUMN,iCurRow)
|
||||
If oCell.CellStyle = sColumnHeader Then
|
||||
bLeaveLoop = True
|
||||
StartIndex = iCurRow
|
||||
iCurRow = iCurRow + 1
|
||||
Else
|
||||
RemoveCount = RemoveCount + 1
|
||||
iCurRow = iCurRow - 1
|
||||
End If
|
||||
Loop Until bLeaveLoop
|
||||
If RemoveCount > 1 Then
|
||||
oSheet.Rows.RemoveByIndex(iCurRow, RemoveCount-1)
|
||||
End If
|
||||
For i = 1 To iLastLinkRow
|
||||
oCell = oSheet.GetCellbyPosition(SBDATECOLUMN,iCurRow)
|
||||
iCellValue = oLinkSheet.GetCellByPosition(0,i).Value
|
||||
If iCellValue > 0 Then
|
||||
oCell.SetValue(oLinkSheet.GetCellByPosition(0,i).Value)
|
||||
Else
|
||||
oCell.SetValue(StringToDate(oLinkSheet.GetCellByPosition(0,i).String)
|
||||
End If
|
||||
oCell = oSheet.GetCellbyPosition(SBVALUECOLUMN,iCurRow)
|
||||
oCell.SetValue(oLinkSheet.GetCellByPosition(4,i).Value)
|
||||
If i < iLastLinkRow Then
|
||||
iCurRow = iCurRow + 1
|
||||
oSheet.Rows.InsertByIndex(iCurRow,1)
|
||||
End If
|
||||
Next i
|
||||
iMaxRow = iCurRow
|
||||
End Sub
|
||||
|
||||
|
||||
Function StringToDate(DateString as String) as Date
|
||||
Dim ShortMonths(11)
|
||||
Dim DateList() as String
|
||||
Dim MaxIndex as Integer
|
||||
Dim i as Integer
|
||||
ShortMonths(0) = "Jan"
|
||||
ShortMonths(1) = "Feb"
|
||||
ShortMonths(2) = "Mar"
|
||||
ShortMonths(3) = "Apr"
|
||||
ShortMonths(4) = "May"
|
||||
ShortMonths(5) = "Jun"
|
||||
ShortMonths(6) = "Jul"
|
||||
ShortMonths(7) = "Aug"
|
||||
ShortMonths(8) = "Sep"
|
||||
ShortMonths(9) = "Oct"
|
||||
ShortMonths(10) = "Nov"
|
||||
ShortMonths(11) = "Dec"
|
||||
For i = 0 To 11
|
||||
DateString = ReplaceString(DateString,CStr(i+1),ShortMonths(i))
|
||||
Next i
|
||||
DateString = ReplaceString(DateString, ".", "-")
|
||||
StringToDate = CDate(DateString)
|
||||
End Function
|
||||
|
||||
|
||||
Sub UpdateChart(sName As String)
|
||||
Dim oSheet As Object
|
||||
Dim oCell As Object, oCursor As Object
|
||||
Dim oChartRange As Object
|
||||
Dim oEmbeddedChart As Object, oCharts As Object
|
||||
Dim oChart As Object, oDiagram As Object
|
||||
Dim oYAxis As Object, oXAxis As Object
|
||||
Dim fMin As Double, fMax As Double
|
||||
Dim nDateFormat As Long
|
||||
Dim aPos As Variant
|
||||
Dim aSize As Variant
|
||||
Dim oContainerChart as Object
|
||||
Dim mRangeAddresses(0) as New com.sun.star.table.CellRangeAddress
|
||||
mRangeAddresses(0).Sheet = GetSheetIndex(oSheets, sNewSheetName)
|
||||
mRangeAddresses(0).StartColumn = SBDATECOLUMN
|
||||
mRangeAddresses(0).StartRow = SBSTARTROW-1
|
||||
mRangeAddresses(0).EndColumn = SBVALUECOLUMN
|
||||
mRangeAddresses(0).EndRow = iMaxRow
|
||||
|
||||
oSheet = oDocument.Sheets.getByName(sNewSheetName)
|
||||
oCharts = oSheet.Charts
|
||||
|
||||
If Not oCharts.hasElements Then
|
||||
oSheet.GetCellbyPosition(2,2).SetString(sName)
|
||||
oChartRange = oSheet.getCellRangeByPosition(SBDATECOLUMN,6,5,SBSTARTROW-3)
|
||||
aPos = oChartRange.Position
|
||||
aSize = oChartRange.Size
|
||||
|
||||
Dim oRectangleShape As New com.sun.star.awt.Rectangle
|
||||
oRectangleShape.X = aPos.X
|
||||
oRectangleShape.Y = aPos.Y
|
||||
oRectangleShape.Width = aSize.Width
|
||||
oRectangleShape.Height = aSize.Height
|
||||
oCharts.addNewByName(sName, oRectangleShape, mRangeAddresses(), True, False)
|
||||
oContainerChart = oCharts.getByName(sName)
|
||||
oChart = oContainerChart.EmbeddedObject
|
||||
oChart.Title.String = ""
|
||||
oChart.HasLegend = False
|
||||
oChart.diagram = oChart.createInstance("com.sun.star.chart.XYDiagram")
|
||||
oDiagram = oChart.Diagram
|
||||
oDiagram.DataRowSource = com.sun.star.chart.ChartDataRowSource.COLUMNS
|
||||
oChart.Area.LineStyle = com.sun.star.drawing.LineStyle.SOLID
|
||||
oXAxis = oDiagram.XAxis
|
||||
oXAxis.TextBreak = False
|
||||
nDateFormat = oXAxis.NumberFormats.getStandardFormat(com.sun.star.util.NumberFormat.DATE, oDocLocale)
|
||||
|
||||
oYAxis = oDiagram.getYAxis()
|
||||
oYAxis.AutoOrigin = True
|
||||
Else
|
||||
oChart = oCharts(0)
|
||||
oChart.Ranges = mRangeAddresses()
|
||||
oChart.HasRowHeaders = False
|
||||
oEmbeddedChart = oChart.EmbeddedObject
|
||||
oDiagram = oEmbeddedChart.Diagram
|
||||
oXAxis = oDiagram.XAxis
|
||||
End If
|
||||
oXAxis.AutoStepMain = False
|
||||
oXAxis.AutoStepHelp = False
|
||||
oXAxis.StepMain = iStep
|
||||
oXAxis.StepHelp = iStep
|
||||
fMin = oSheet.getCellByPosition(SBDATECOLUMN,SBSTARTROW).Value
|
||||
fMax = oSheet.getCellByPosition(SBDATECOLUMN,iMaxRow).Value
|
||||
oXAxis.Min = fMin
|
||||
oXAxis.Max = fMax
|
||||
oXAxis.AutoMin = False
|
||||
oXAxis.AutoMax = False
|
||||
End Sub
|
||||
|
||||
|
||||
Sub CalculateChartafterSplit(SheetName, NewNumber, OldNumber, NoteText, SplitDate)
|
||||
Dim oSheet as Object
|
||||
Dim i as Integer
|
||||
Dim oValueCell as Object
|
||||
Dim oDateCell as Object
|
||||
Dim bLeaveLoop as Boolean
|
||||
If oSheets.HasbyName(SheetName) Then
|
||||
oSheet = oSheets.GetbyName(SheetName)
|
||||
i = 0
|
||||
bLeaveLoop = False
|
||||
Do
|
||||
oValueCell = oSheet.GetCellbyPosition(SBVALUECOLUMN, SBSTARTROW + i)
|
||||
If oValueCell.CellStyle = CurrCellStyle Then
|
||||
SplitCellValue(oSheet, OldNumber, NewNumber, SBVALUECOLUMN, SBSTARTROW + i, "")
|
||||
i = i + 1
|
||||
Else
|
||||
bLeaveLoop = True
|
||||
End If
|
||||
Loop Until bLeaveLoop
|
||||
oDateCell = oSheet.GetCellbyPosition(SBDATECOLUMN, SBSTARTROW + i-1)
|
||||
oDateCell.Annotation.SetString(NoteText)
|
||||
End If
|
||||
End Sub
|
||||
</script:module>
|
||||
178
office-plugin/windows-office/share/basic/Depot/Lang_de.xba
Normal file
178
office-plugin/windows-office/share/basic/Depot/Lang_de.xba
Normal file
@@ -0,0 +1,178 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
|
||||
<!--***********************************************************
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
***********************************************************-->
|
||||
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Lang_de" script:language="StarBasic">Option Explicit
|
||||
|
||||
Sub LoadGermanLanguage()
|
||||
|
||||
sProductname = GetProductname
|
||||
sOK = "~OK"
|
||||
sCancel = "Abbrechen"
|
||||
sColumnHeader = "Spaltenkopf"
|
||||
sInsertStockName = "Bitte fügen Sie zunächst einige Aktien in Ihr Depot ein!"
|
||||
sTitle = "<PRODUCTNAME>: Aktienverwaltung"
|
||||
sTitle = ReplaceString(sTitle, sProductName, "<PRODUCTNAME>")
|
||||
sMsgError = "Eingabefehler"
|
||||
sMsgNoName = sInsertStockname
|
||||
sMsgNoQuantity = "Bitte geben Sie eine Stückzahl größer als 0 ein"
|
||||
sMsgNoDividend = "Bitte geben Sie eine Dividende je Stück oder eine Gesamtdividende ein"
|
||||
sMsgNoExchangeRate = "Bitte geben Sie eine korrekte Umtauschrate ein (alte Aktien -> neue Aktien)."
|
||||
sMsgNoValidExchangeDate = "Bitte geben Sie ein gültiges Datum für den Aktiensplitt ein."
|
||||
sMsgWrongExchangeDate = "Splitt nicht möglich, da bereits Transaktionen nach dem Splitt-Datum existieren."
|
||||
sMsgSellTooMuch = "So viele Aktien können Sie nicht verkaufen. Maximum: "
|
||||
sMsgConfirm = "Bestätigung erforderlich"
|
||||
sMsgFreeStock = "Beabsichtigen Sie die Eingabe von Gratisaktien?"
|
||||
sMsgTotalLoss = "Beabsichtigen Sie die Eingabe eines Totalverlustes?"
|
||||
sMsgAuthorization = "Sicherheitsabfrage"
|
||||
sMsgDeleteAll = "Wollen Sie alle Bewegungen löschen und die Depotübersicht rücksetzen?"
|
||||
cSplit = "Aktiensplitt am "
|
||||
sHistory = "Historie"
|
||||
TransactTitle(1) = "Aktien verkaufen"
|
||||
TransactTitle(2) = "Aktien kaufen"
|
||||
StockRatesTitle(1) = "Dividendenzahlung"
|
||||
StockRatesTitle(2) = "Aktiensplitt"
|
||||
StockRatesTitle(3) = sHistory
|
||||
sDepotCurrency = "Depotwährung"
|
||||
sStockName = "Aktienname"
|
||||
TransactMode = LIFO ' Possible values: "FIFO" and "LIFO"
|
||||
DateCellStyle = "Ergebnis Datum"
|
||||
CurrCellStyle = "Ergebnis Euro mit Dezimalen"
|
||||
sStartDate = "Startdatum:"
|
||||
sEndDate = "Enddatum:"
|
||||
sStartUpWelcome = "Diese Vorlage ermöglicht Ihnen eine effiziente Verwaltung Ihres Aktiendepots"
|
||||
sStartUpChooseMarket = "Wählen Sie zunächst Ihre Referenz-Währung und damit den Börsenplatz für das Internet Update aus!"
|
||||
sStartUpHint = "Leider steht Ihnen die <History>- Funktion nur für den amerikanischen Markt zur Verfügung!"
|
||||
sStartupHint = ReplaceString(sStartUpHint, sHistory, "<History>")
|
||||
sNoInternetUpdate = "ohne Internet Update"
|
||||
sMarketPlace = "Börsenplatz:"
|
||||
sNoInternetDataAvailable = "Internet-Kurse konnten nicht empfangen werden!"
|
||||
sCheckInternetSettings = "Mögliche Ursachen sind: <BR> Ihre Internet Einstellungen müssen überprüft werden.<BR> Sie haben eine falsche Kennung (z.B. Symbol, WKN) für die Aktie eingegeben."
|
||||
sCheckInternetSettings = ReplaceString(sCheckInternetSettings, chr(13), "<BR>")
|
||||
|
||||
sMsgEndDatebeforeNow = "Das Enddatum muss vor dem heutigen Tag liegen!"
|
||||
sMsgStartDatebeforeEndDate = "Das Startdatum muss vor dem Enddatum liegen!"
|
||||
|
||||
sMarket(0,0) = "Amerikanischer Dollar"
|
||||
sMarket(0,1) = "$"
|
||||
sMarket(0,2) = "New York"
|
||||
sMarket(0,3) = "http://finance.yahoo.com/d/quotes.csv?s=<StockID>&f=sl1d1t1c1ohgv&e=.csv"
|
||||
sMarket(0,4) = "http://ichart.finance.yahoo.com/table.csv?" &_
|
||||
"s=<StockID>&d=<EndMonth>&e=<EndDay>&f=<Endyear>&g=d&" &_
|
||||
"a=<StartMonth>&b=<StartDay>&c=<Startyear>&ignore=.csv"
|
||||
sMarket(0,5) = "Symbol"
|
||||
sMarket(0,6) = "en"
|
||||
sMarket(0,7) = "US"
|
||||
sMarket(0,8) = "409"
|
||||
sMarket(0,9) = "44"
|
||||
sMarket(0,10) = "1"
|
||||
|
||||
sMarket(1,0) = "Euro"
|
||||
sMarket(1,1) = chr(8364)
|
||||
sMarket(1,2) = "Frankfurt"
|
||||
sMarket(1,3) = "http://de.finance.yahoo.com/d/quotes.csv?s=<StockID>.F&f=sl1t1c1ghpv&e=.csv"
|
||||
sMarket(1,5) = "WKN"
|
||||
sMarket(1,6) = "de;nl;pt;el"
|
||||
sMarket(1,7) = "DE;NL;PT;GR"
|
||||
sMarket(1,8) = "407;413;816;408"
|
||||
sMarket(1,9) = "59/9"
|
||||
sMarket(1,10) = "1"
|
||||
|
||||
sMarket(2,0) = "Englisches Pfund"
|
||||
sMarket(2,1) = "£"
|
||||
sMarket(2,2) = "London"
|
||||
sMarket(2,3) = "http://uk.finance.yahoo.com/d/quotes.csv?s=<StockID>.L&m=*&f=sl1t1c1ghov&e=.csv"
|
||||
sMarket(2,5) = "Symbol"
|
||||
sMarket(2,6) = "en"
|
||||
sMarket(2,7) = "GB"
|
||||
sMarket(2,8) = "809"
|
||||
sMarket(2,9) = "44"
|
||||
sMarket(2,10) = "1"
|
||||
|
||||
sMarket(3,0) = "Japanischer Yen"
|
||||
sMarket(3,1) = "¥"
|
||||
sMarket(3,2) = "Tokyo"
|
||||
sMarket(3,3) = ""
|
||||
sMarket(3,5) = "Code"
|
||||
sMarket(3,6) = "ja"
|
||||
sMarket(3,7) = "JP"
|
||||
sMarket(3,8) = "411"
|
||||
sMarket(3,9) = ""
|
||||
sMarket(3,10) = ""
|
||||
|
||||
sMarket(4,0) = "Hongkong Dollar"
|
||||
sMarket(4,1) = "HK$"
|
||||
sMarket(4,2) = "Hongkong"
|
||||
sMarket(4,3) = "http://hk.finance.yahoo.com/d/quotes.csv?s=<StockID>.HK&f=sl1d1t1c1ohgv&e=.csv"
|
||||
sMarket(4,5) = "Nummer"
|
||||
sMarket(4,6) = "zh"
|
||||
sMarket(4,7) = "HK"
|
||||
sMarket(4,8) = "C04"
|
||||
sMarket(4,9) = "44"
|
||||
sMarket(4,10) = "1"
|
||||
|
||||
sMarket(5,0) = "Australischer Dollar"
|
||||
sMarket(5,1) = "$"
|
||||
sMarket(5,2) = "Sydney"
|
||||
sMarket(5,3) = "http://au.finance.yahoo.com/d/quotes.csv?s=<StockID>&f=sl1d1t1c1ohgv&e=.csv"
|
||||
sMarket(5,5) = "Symbol"
|
||||
sMarket(5,6) = "en"
|
||||
sMarket(5,7) = "AU"
|
||||
sMarket(5,8) = "C09"
|
||||
sMarket(5,9) = "44"
|
||||
sMarket(5,10) = "1"
|
||||
|
||||
' ****************************End of the default subset*********************************
|
||||
CompleteMarketList()
|
||||
|
||||
LocalizedCurrencies()
|
||||
|
||||
With TransactModel
|
||||
.lblStockNames.Label = sStockname
|
||||
.lblQuantity.Label = "Menge"
|
||||
.lblRate.Label = "Kurs"
|
||||
.lblDate.Label = "Transaktionsdatum"
|
||||
.hlnCommission.Label = "Sonstige Ausgaben"
|
||||
.lblCommission.Label = "Provision"
|
||||
.lblMinimum.Label = "Mindestprovision"
|
||||
.lblFix.Label = "Festbetrag/Spesen"
|
||||
.cmdGoOn.Label = sOK
|
||||
.cmdCancel.Label = sCancel
|
||||
End With
|
||||
|
||||
With StockRatesModel
|
||||
.optPerShare.Label = "Dividende/Aktie"
|
||||
.optTotal.Label = "Dividende gesamt"
|
||||
.lblDividend.Label = "Betrag"
|
||||
.lblExchangeRate.Label = "Umtauschrate (alt->neu)"
|
||||
.lblColon.Label = ":"
|
||||
.lblDate.Label = "Umtauschdatum:"
|
||||
.lblStockNames.Label = sStockname
|
||||
.lblStartDate.Label = sStartDate
|
||||
.lblEndDate.Label = sEndDate
|
||||
.optDaily.Label = "~Täglich"
|
||||
.optWeekly.Label = "~Wöchentlich"
|
||||
.hlnInterval.Label = "Zeitraum"
|
||||
.cmdGoOn.Label = sOk
|
||||
.cmdCancel.Label = sCancel
|
||||
End With
|
||||
End Sub
|
||||
</script:module>
|
||||
178
office-plugin/windows-office/share/basic/Depot/Lang_en.xba
Normal file
178
office-plugin/windows-office/share/basic/Depot/Lang_en.xba
Normal file
@@ -0,0 +1,178 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
|
||||
<!--***********************************************************
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
***********************************************************-->
|
||||
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Lang_en" script:language="StarBasic">Option Explicit
|
||||
|
||||
Sub LoadEnglishLanguage()
|
||||
|
||||
sProductname = GetProductname
|
||||
sOK = "~OK"
|
||||
sCancel = "Cancel"
|
||||
sColumnHeader = "Column Header"
|
||||
sInsertStockName = "Please enter shares in your portfolio."
|
||||
sTitle = "<PRODUCTNAME>: Stocks Manager"
|
||||
sTitle = ReplaceString(sTitle, sProductName, "<PRODUCTNAME>")
|
||||
sMsgError = "Input Error"
|
||||
sMsgNoName = sInsertStockname
|
||||
sMsgNoQuantity = "Please enter a quantity larger than 0"
|
||||
sMsgNoDividend = "Please enter the dividend per share or the total dividend"
|
||||
sMsgNoExchangeRate = "Please enter the correct exchange rate (old shares -> new shares)"
|
||||
sMsgNoValidExchangeDate = "Please enter a valid date for the split."
|
||||
sMsgWrongExchangeDate = "Splitting not possible, as transactions already exist after the split date."
|
||||
sMsgSellTooMuch = "You cannot sell that many shares. Maximum: "
|
||||
sMsgConfirm = "Confirmation Required"
|
||||
sMsgFreeStock = "Do you intend to enter free shares?"
|
||||
sMsgTotalLoss = "Do you intend to enter a total loss?"
|
||||
sMsgAuthorization = "Security Query"
|
||||
sMsgDeleteAll = "Do you want to delete all movements and reset the portfolio overview?"
|
||||
cSplit = "Stock split on "
|
||||
sHistory = "History"
|
||||
TransactTitle(1) = "StarOffice Stocks Manager: Selling Shares"
|
||||
TransactTitle(2) = "StarOffice Stocks Manager: Buying Shares"
|
||||
StockRatesTitle(1) = "StarOffice Stocks Manager: Dividend Payment"
|
||||
StockRatesTitle(2) = "Stock Split"
|
||||
StockRatesTitle(3) = sHistory
|
||||
sDepotCurrency = "Portfolio Currency"
|
||||
sStockName = "Name of Stock"
|
||||
TransactMode = LIFO ' Possible values: "FIFO" and "LIFO"
|
||||
DateCellStyle = "Result Date"
|
||||
CurrCellStyle = "1"
|
||||
sStartDate = "Start date:"
|
||||
sEndDate = "End date:"
|
||||
sStartUpWelcome = "This template enables you to manage your stock portfolio efficiently."
|
||||
sStartUpChooseMarket = "First, select your reference currency and thus the stock exchange for the Internet update."
|
||||
sStartUpHint = "Unfortunately, the only <History> function available to you is that for the American market."
|
||||
sStartupHint = ReplaceString(sStartUpHint, sHistory, "<History>")
|
||||
sNoInternetUpdate = "without Internet update"
|
||||
sMarketPlace = "Stock exchange:"
|
||||
sNoInternetDataAvailable = "No prices could be received from the Internet!"
|
||||
sCheckInternetSettings = "Possible causes could be: <BR>Your Internet settings have to be modified. <BR>The Symbol (e.g. Code, Ticker Symbol) entered for the stock was incorrect."
|
||||
sCheckInternetSettings = ReplaceString(sCheckInternetSettings, chr(13), "<BR>")
|
||||
|
||||
sMsgEndDatebeforeNow = "The end date has to be before today's date."
|
||||
sMsgStartDatebeforeEndDate = "The start date has to be before the end date."
|
||||
|
||||
sMarket(0,0) = "American Dollar"
|
||||
sMarket(0,1) = "$"
|
||||
sMarket(0,2) = "New York"
|
||||
sMarket(0,3) = "http://finance.yahoo.com/d/quotes.csv?s=<StockID>&f=sl1d1t1c1ohgv&e=.csv"
|
||||
sMarket(0,4) = "http://ichart.finance.yahoo.com/table.csv?" &_
|
||||
"s=<StockID>&d=<EndMonth>&e=<EndDay>&f=<Endyear>&g=d&" &_
|
||||
"a=<StartMonth>&b=<StartDay>&c=<Startyear>&ignore=.csv"
|
||||
sMarket(0,5) = "Symbol"
|
||||
sMarket(0,6) = "en"
|
||||
sMarket(0,7) = "US"
|
||||
sMarket(0,8) = "409"
|
||||
sMarket(0,9) = "44"
|
||||
sMarket(0,10) = "1"
|
||||
|
||||
sMarket(1,0) = "Euro"
|
||||
sMarket(1,1) = chr(8364)
|
||||
sMarket(1,2) = "Frankfurt"
|
||||
sMarket(1,3) = "http://de.finance.yahoo.com/d/quotes.csv?s=<StockID>.F&f=sl1t1c1ghpv&e=.csv"
|
||||
sMarket(1,5) = "Ticker Symbol"
|
||||
sMarket(1,6) = "de;nl;pt;el"
|
||||
sMarket(1,7) = "DE;NL;PT;GR"
|
||||
sMarket(1,8) = "407;413;816;408"
|
||||
sMarket(1,9) = "59/9"
|
||||
sMarket(1,10) = "1"
|
||||
|
||||
sMarket(2,0) = "British Pound"
|
||||
sMarket(2,1) = "£"
|
||||
sMarket(2,2) = "London"
|
||||
sMarket(2,3) = "http://uk.finance.yahoo.com/d/quotes.csv?s=<StockID>.L&m=*&f=sl1t1c1ghov&e=.csv"
|
||||
sMarket(2,5) = "Symbol"
|
||||
sMarket(2,6) = "en"
|
||||
sMarket(2,7) = "GB"
|
||||
sMarket(2,8) = "809"
|
||||
sMarket(2,9) = "44"
|
||||
sMarket(2,10) = "1"
|
||||
|
||||
sMarket(3,0) = "Japanese Yen"
|
||||
sMarket(3,1) = "¥"
|
||||
sMarket(3,2) = "Tokyo"
|
||||
sMarket(3,3) = ""
|
||||
sMarket(3,5) = "Code"
|
||||
sMarket(3,6) = "ja"
|
||||
sMarket(3,7) = "JP"
|
||||
sMarket(3,8) = "411"
|
||||
sMarket(3,9) = ""
|
||||
sMarket(3,10) = ""
|
||||
|
||||
sMarket(4,0) = "Hong Kong Dollar"
|
||||
sMarket(4,1) = "HK$"
|
||||
sMarket(4,2) = "Hong Kong"
|
||||
sMarket(4,3) = "http://hk.finance.yahoo.com/d/quotes.csv?s=<StockID>&f=sl1d1t1c1ohgv&e=.csv"
|
||||
sMarket(4,5) = "Number"
|
||||
sMarket(4,6) = "zh"
|
||||
sMarket(4,7) = "HK"
|
||||
sMarket(4,8) = "C04"
|
||||
sMarket(4,9) = "44"
|
||||
sMarket(4,10) = "1"
|
||||
|
||||
sMarket(5,0) = "Australian Dollar"
|
||||
sMarket(5,1) = "$"
|
||||
sMarket(5,2) = "Sydney"
|
||||
sMarket(5,3) = "http://au.finance.yahoo.com/d/quotes.csv?s=<StockID>&f=sl1d1t1c1ohgv&e=.csv"
|
||||
sMarket(5,5) = "Symbol"
|
||||
sMarket(5,6) = "en"
|
||||
sMarket(5,7) = "AU"
|
||||
sMarket(5,8) = "C09"
|
||||
sMarket(5,9) = "44"
|
||||
sMarket(5,10) = "1"
|
||||
|
||||
' ****************************End of the default subset*********************************
|
||||
CompleteMarketList()
|
||||
|
||||
LocalizedCurrencies()
|
||||
|
||||
With TransactModel
|
||||
.lblStockNames.Label = sStockname
|
||||
.lblQuantity.Label = "Quantity"
|
||||
.lblRate.Label = "Price"
|
||||
.lblDate.Label = "Transaction Date"
|
||||
.hlnCommission.Label = "Other expenditures"
|
||||
.lblCommission.Label = "Commission"
|
||||
.lblMinimum.Label = "Min. Commission"
|
||||
.lblFix.Label = "Fixed Costs/Charges"
|
||||
.cmdGoOn.Label = sOK
|
||||
.cmdCancel.Label = sCancel
|
||||
End With
|
||||
|
||||
With StockRatesModel
|
||||
.optPerShare.Label = "Dividends/Stocks"
|
||||
.optTotal.Label = "Total Dividends"
|
||||
.lblDividend.Label = "Amount"
|
||||
.lblExchangeRate.Label = "Exchange Rate (old->new)"
|
||||
.lblColon.Label = ":"
|
||||
.lblDate.Label = "Exchange Date:"
|
||||
.lblStockNames.Label = sStockname
|
||||
.lblStartDate.Label = sStartDate
|
||||
.lblEndDate.Label = sEndDate
|
||||
.optDaily.Label = "~Daily"
|
||||
.optWeekly.Label = "~Weekly"
|
||||
.hlnInterval.Label = "Time period"
|
||||
.cmdGoOn.Label = sOk
|
||||
.cmdCancel.Label = sCancel
|
||||
End With
|
||||
End Sub
|
||||
</script:module>
|
||||
178
office-plugin/windows-office/share/basic/Depot/Lang_es.xba
Normal file
178
office-plugin/windows-office/share/basic/Depot/Lang_es.xba
Normal file
@@ -0,0 +1,178 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
|
||||
<!--***********************************************************
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
***********************************************************-->
|
||||
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Lang_es" script:language="StarBasic">Option Explicit
|
||||
|
||||
Sub LoadSpanishLanguage()
|
||||
|
||||
sProductname = GetProductname
|
||||
sOK = "~Aceptar"
|
||||
sCancel = "Cancelar"
|
||||
sColumnHeader = "Título de columna"
|
||||
sInsertStockName = "Introduzca primero algunas acciones en su depósito."
|
||||
sTitle = "<PRODUCTNAME>: Administración de acciones"
|
||||
sTitle = ReplaceString(sTitle, sProductName, "<PRODUCTNAME>")
|
||||
sMsgError = "Error de entrada"
|
||||
sMsgNoName = sInsertStockname
|
||||
sMsgNoQuantity = "Indique una cantidad mayor que 0"
|
||||
sMsgNoDividend = "Indique un dividendo por unidad o un dividendo total"
|
||||
sMsgNoExchangeRate = "Indique aquí un cambio correcto (acción vieja -> nueva acción)"
|
||||
sMsgNoValidExchangeDate = "Indique una fecha correcta para el fraccionamiento de la acción."
|
||||
sMsgWrongExchangeDate = "El fraccionamiento no es posible porque existen transacciones después de la fecha de fraccionamiento."
|
||||
sMsgSellTooMuch = "No puede vender tantas acciones. Como máximo: "
|
||||
sMsgConfirm = "Confirmación necesaria"
|
||||
sMsgFreeStock = "¿Tiene previsto considerar acciones gratis?"
|
||||
sMsgTotalLoss = "¿Tiene previsto introducir una pérdida total?"
|
||||
sMsgAuthorization = "Pregunta de seguridad"
|
||||
sMsgDeleteAll = "¿Desea borrar todos los movimientos y reiniciar el balance de depósito?"
|
||||
cSplit = "Fraccionamiento el "
|
||||
sHistory = "Historia"
|
||||
TransactTitle(1) = "Vender acciones"
|
||||
TransactTitle(2) = "Comprar acciones"
|
||||
StockRatesTitle(1) = "Pago de dividendos"
|
||||
StockRatesTitle(2) = "Fraccionamiento"
|
||||
StockRatesTitle(3) = sHistory
|
||||
sDepotCurrency = "Moneda del depósito"
|
||||
sStockName = "Nombre de la acción"
|
||||
TransactMode = LIFO ' Possible values: "FIFO" and "LIFO"
|
||||
DateCellStyle = "Resultado Fecha"
|
||||
CurrCellStyle = "1"
|
||||
sStartDate = "Fecha de inicio:"
|
||||
sEndDate = "Fecha final:"
|
||||
sStartUpWelcome = "Esta plantilla le permite administrar eficientemente su depósito de acciones"
|
||||
sStartUpChooseMarket = "Seleccione primero la moneda de referencia y la plaza bursátil para la actualización a través de Internet."
|
||||
sStartUpHint = "La función <History> está disponible únicamente para el mercado americano."
|
||||
sStartupHint = ReplaceString(sStartUpHint, sHistory, "<History>")
|
||||
sNoInternetUpdate = "Sin actualización por Internet"
|
||||
sMarketPlace = "Plaza bursátil:"
|
||||
sNoInternetDataAvailable = "No se pudieron recibir las cotizaciones por Internet."
|
||||
sCheckInternetSettings = "Causas posibles: <BR> Debe comprobar la configuración de Internet.<BR> Ha indicado un código incorrecto (p.ej. número, símbolo, etc.) para la acción."
|
||||
sCheckInternetSettings = ReplaceString(sCheckInternetSettings, chr(13), "<BR>")
|
||||
|
||||
sMsgEndDatebeforeNow = "La fecha final debe ser anterior a la fecha de hoy."
|
||||
sMsgStartDatebeforeEndDate = "La fecha inicial debe ser anterior a la fecha final."
|
||||
|
||||
sMarket(0,0) = "Dólar estadounidense"
|
||||
sMarket(0,1) = "$"
|
||||
sMarket(0,2) = "Nueva York"
|
||||
sMarket(0,3) = "http://finance.yahoo.com/d/quotes.csv?s=<StockID>&f=sl1d1t1c1ohgv&e=.csv"
|
||||
sMarket(0,4) = "http://ichart.finance.yahoo.com/table.csv?" &_
|
||||
"s=<StockID>&d=<EndMonth>&e=<EndDay>&f=<Endyear>&g=d&" &_
|
||||
"a=<StartMonth>&b=<StartDay>&c=<Startyear>&ignore=.csv"
|
||||
sMarket(0,5) = "Símbolo"
|
||||
sMarket(0,6) = "en"
|
||||
sMarket(0,7) = "US"
|
||||
sMarket(0,8) = "409"
|
||||
sMarket(0,9) = "44"
|
||||
sMarket(0,10) = "1"
|
||||
|
||||
sMarket(1,0) = "Euro"
|
||||
sMarket(1,1) = chr(8364)
|
||||
sMarket(1,2) = "Frankfurt"
|
||||
sMarket(1,3) = "http://de.finance.yahoo.com/d/quotes.csv?s=<StockID>.F&f=sl1t1c1ghpv&e=.csv"
|
||||
sMarket(1,5) = "Código"
|
||||
sMarket(1,6) = "de;nl;pt;el"
|
||||
sMarket(1,7) = "DE;NL;PT;GR"
|
||||
sMarket(1,8) = "407;413;816;408"
|
||||
sMarket(1,9) = "59/9"
|
||||
sMarket(1,10) = "1"
|
||||
|
||||
sMarket(2,0) = "Libra esterlina"
|
||||
sMarket(2,1) = "£"
|
||||
sMarket(2,2) = "Londres"
|
||||
sMarket(2,3) = "http://uk.finance.yahoo.com/d/quotes.csv?s=<StockID>.L&m=*&f=sl1t1c1ghov&e=.csv"
|
||||
sMarket(2,5) = "Símbolo"
|
||||
sMarket(2,6) = "en"
|
||||
sMarket(2,7) = "GB"
|
||||
sMarket(2,8) = "809"
|
||||
sMarket(2,9) = "44"
|
||||
sMarket(2,10) = "1"
|
||||
|
||||
sMarket(3,0) = "Yen japonés"
|
||||
sMarket(3,1) = "¥"
|
||||
sMarket(3,2) = "Tokio"
|
||||
sMarket(3,3) = ""
|
||||
sMarket(3,5) = "Código"
|
||||
sMarket(3,6) = "ja"
|
||||
sMarket(3,7) = "JP"
|
||||
sMarket(3,8) = "411"
|
||||
sMarket(3,9) = ""
|
||||
sMarket(3,10) = ""
|
||||
|
||||
sMarket(4,0) = "Dólar hongkonés"
|
||||
sMarket(4,1) = "HK$"
|
||||
sMarket(4,2) = "Hong Kong"
|
||||
sMarket(4,3) = "http://hk.finance.yahoo.com/d/quotes.csv?s=<StockID>.HK&f=sl1d1t1c1ohgv&e=.csv"
|
||||
sMarket(4,5) = "Número"
|
||||
sMarket(4,6) = "zh"
|
||||
sMarket(4,7) = "HK"
|
||||
sMarket(4,8) = "C04"
|
||||
sMarket(4,9) = "44"
|
||||
sMarket(4,10) = "1"
|
||||
|
||||
sMarket(5,0) = "Dólar australiano"
|
||||
sMarket(5,1) = "$"
|
||||
sMarket(5,2) = "Sidney"
|
||||
sMarket(5,3) = "http://au.finance.yahoo.com/d/quotes.csv?s=<StockID>&f=sl1d1t1c1ohgv&e=.csv"
|
||||
sMarket(5,5) = "Símbolo"
|
||||
sMarket(5,6) = "en"
|
||||
sMarket(5,7) = "AU"
|
||||
sMarket(5,8) = "C09"
|
||||
sMarket(5,9) = "44"
|
||||
sMarket(5,10) = "1"
|
||||
|
||||
' ****************************End of the default subset*********************************
|
||||
CompleteMarketList()
|
||||
|
||||
LocalizedCurrencies()
|
||||
|
||||
With TransactModel
|
||||
.lblStockNames.Label = sStockname
|
||||
.lblQuantity.Label = "Cantidad"
|
||||
.lblRate.Label = "Cotización"
|
||||
.lblDate.Label = "Fecha de operación"
|
||||
.hlnCommission.Label = "Otros gastos"
|
||||
.lblCommission.Label = "Provisión"
|
||||
.lblMinimum.Label = "Provisión mínima"
|
||||
.lblFix.Label = "Cantidad fija/comisión"
|
||||
.cmdGoOn.Label = sOK
|
||||
.cmdCancel.Label = sCancel
|
||||
End With
|
||||
|
||||
With StockRatesModel
|
||||
.optPerShare.Label = "Dividendos/Acción"
|
||||
.optTotal.Label = "Dividendos totales"
|
||||
.lblDividend.Label = "Importe"
|
||||
.lblExchangeRate.Label = "Cambio (vieja->nueva)"
|
||||
.lblColon.Label = ":"
|
||||
.lblDate.Label = "Fecha de cambio:"
|
||||
.lblStockNames.Label = sStockname
|
||||
.lblStartDate.Label = sStartDate
|
||||
.lblEndDate.Label = sEndDate
|
||||
.optDaily.Label = "~Diario"
|
||||
.optWeekly.Label = "~Semanal"
|
||||
.hlnInterval.Label = "Periodo"
|
||||
.cmdGoOn.Label = sOk
|
||||
.cmdCancel.Label = sCancel
|
||||
End With
|
||||
End Sub
|
||||
</script:module>
|
||||
178
office-plugin/windows-office/share/basic/Depot/Lang_fr.xba
Normal file
178
office-plugin/windows-office/share/basic/Depot/Lang_fr.xba
Normal file
@@ -0,0 +1,178 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
|
||||
<!--***********************************************************
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
***********************************************************-->
|
||||
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Lang_fr" script:language="StarBasic">Option Explicit
|
||||
|
||||
Sub LoadFrenchLanguage()
|
||||
|
||||
sProductname = GetProductname
|
||||
sOK = "~OK"
|
||||
sCancel = "Annuler"
|
||||
sColumnHeader = "En-tête de colonne"
|
||||
sInsertStockName = "Saisissez quelques actions dans votre portefeuille !"
|
||||
sTitle = "<PRODUCTNAME> : Gestion d'actions"
|
||||
sTitle = ReplaceString(sTitle, sProductName, "<PRODUCTNAME>")
|
||||
sMsgError = "Erreur de saisie"
|
||||
sMsgNoName = sInsertStockname
|
||||
sMsgNoQuantity = "Saisissez une quantité supérieure à 0 !"
|
||||
sMsgNoDividend = "Vous devez saisir le montant des dividendes perçus (soit les dividendes par action, soit la somme totale perçue)."
|
||||
sMsgNoExchangeRate = "Saisissez un taux correct de conversion (anciennes actions -> nouvelles actions)."
|
||||
sMsgNoValidExchangeDate = "Saisissez une date correcte pour le split d'action."
|
||||
sMsgWrongExchangeDate = "Split impossible car il y a déjà eu des transactions après la date du split !"
|
||||
sMsgSellTooMuch = "Impossible de vendre autant d'actions ! Maximum : "
|
||||
sMsgConfirm = "Confirmation requise"
|
||||
sMsgFreeStock = "S'agit-il d'actions gratuites ?"
|
||||
sMsgTotalLoss = "Prévoyez-vous une perte totale ?"
|
||||
sMsgAuthorization = "Requête de sécurité"
|
||||
sMsgDeleteAll = "Voulez-vous supprimer tous les mouvements et remettre le portefeuille d'actions à zéro ?"
|
||||
cSplit = "Split d'action le "
|
||||
sHistory = "Historique"
|
||||
TransactTitle(1) = "Vente d'actions"
|
||||
TransactTitle(2) = "Achat d'actions"
|
||||
StockRatesTitle(1) = "Versement des dividendes"
|
||||
StockRatesTitle(2) = "Split d'action"
|
||||
StockRatesTitle(3) = sHistory
|
||||
sDepotCurrency = "Monnaie du portefeuille"
|
||||
sStockName = "Nom de l'action"
|
||||
TransactMode = LIFO ' Possible values: "FIFO" and "LIFO"
|
||||
DateCellStyle = "Résultat date"
|
||||
CurrCellStyle = "1"
|
||||
sStartDate = "Date de début :"
|
||||
sEndDate = "Date de fin :"
|
||||
sStartUpWelcome = "Utilisez ce modèle pour une gestion efficiente de votre portefeuille d'actions !"
|
||||
sStartUpChooseMarket = "Commencez par choisir une monnaie de référence et ainsi la place boursière pour la mise à jour Internet !"
|
||||
sStartUpHint = "La fonction <History> n'est cependant disponible que pour le marché américain."
|
||||
sStartupHint = ReplaceString(sStartUpHint, sHistory, "<History>")
|
||||
sNoInternetUpdate = "Sans mise à jour Internet"
|
||||
sMarketPlace = "Place boursière :"
|
||||
sNoInternetDataAvailable = "Réception des cours Internet impossible !"
|
||||
sCheckInternetSettings = "Causes possibles : <BR> Problème de paramétrage Internet : vérifiez les paramètres !<BR> Vous avez saisi un identificateur (par ex. symbole ou code) incorrect pour l'action."
|
||||
sCheckInternetSettings = ReplaceString(sCheckInternetSettings, chr(13), "<BR>")
|
||||
|
||||
sMsgEndDatebeforeNow = "La date spécifiée pour la fin doit précéder celle de ce jour !"
|
||||
sMsgStartDatebeforeEndDate = "La date spécifiée pour le début doit succéder à celle de ce jour !"
|
||||
|
||||
sMarket(0,0) = "Dollar Américain"
|
||||
sMarket(0,1) = "$"
|
||||
sMarket(0,2) = "New York"
|
||||
sMarket(0,3) = "http://finance.yahoo.com/d/quotes.csv?s=<StockID>&f=sl1d1t1c1ohgv&e=.csv"
|
||||
sMarket(0,4) = "http://ichart.finance.yahoo.com/table.csv?" &_
|
||||
"s=<StockID>&d=<EndMonth>&e=<EndDay>&f=<Endyear>&g=d&" &_
|
||||
"a=<StartMonth>&b=<StartDay>&c=<Startyear>&ignore=.csv"
|
||||
sMarket(0,5) = "Symbole"
|
||||
sMarket(0,6) = "en"
|
||||
sMarket(0,7) = "US"
|
||||
sMarket(0,8) = "409"
|
||||
sMarket(0,9) = "44"
|
||||
sMarket(0,10) = "1"
|
||||
|
||||
sMarket(1,0) = "Euro"
|
||||
sMarket(1,1) = chr(8364)
|
||||
sMarket(1,2) = "Francfort"
|
||||
sMarket(1,3) = "http://de.finance.yahoo.com/d/quotes.csv?s=<StockID>.F&f=sl1t1c1ghpv&e=.csv"
|
||||
sMarket(1,5) = "Code"
|
||||
sMarket(1,6) = "de;nl;pt;el"
|
||||
sMarket(1,7) = "DE;NL;PT;GR"
|
||||
sMarket(1,8) = "407;413;816;408"
|
||||
sMarket(1,9) = "59/9"
|
||||
sMarket(1,10) = "1"
|
||||
|
||||
sMarket(2,0) = "Livre Sterling"
|
||||
sMarket(2,1) = "£"
|
||||
sMarket(2,2) = "Londres"
|
||||
sMarket(2,3) = "http://uk.finance.yahoo.com/d/quotes.csv?s=<StockID>.L&m=*&f=sl1t1c1ghov&e=.csv"
|
||||
sMarket(2,5) = "Symbole"
|
||||
sMarket(2,6) = "en"
|
||||
sMarket(2,7) = "GB"
|
||||
sMarket(2,8) = "809"
|
||||
sMarket(2,9) = "44"
|
||||
sMarket(2,10) = "1"
|
||||
|
||||
sMarket(3,0) = "Yen Japonais"
|
||||
sMarket(3,1) = "¥"
|
||||
sMarket(3,2) = "Tokyo"
|
||||
sMarket(3,3) = ""
|
||||
sMarket(3,5) = "Code"
|
||||
sMarket(3,6) = "ja"
|
||||
sMarket(3,7) = "JP"
|
||||
sMarket(3,8) = "411"
|
||||
sMarket(3,9) = ""
|
||||
sMarket(3,10) = ""
|
||||
|
||||
sMarket(4,0) = "Dollar de Hong Kong"
|
||||
sMarket(4,1) = "HK$"
|
||||
sMarket(4,2) = "Hong Kong"
|
||||
sMarket(4,3) = "http://hk.finance.yahoo.com/d/quotes.csv?s=<StockID>&f=sl1d1t1c1ohgv&e=.csv"
|
||||
sMarket(4,5) = "Numéro"
|
||||
sMarket(4,6) = "zh"
|
||||
sMarket(4,7) = "HK"
|
||||
sMarket(4,8) = "C04"
|
||||
sMarket(4,9) = "44"
|
||||
sMarket(4,10) = "1"
|
||||
|
||||
sMarket(5,0) = "Dollar Australien"
|
||||
sMarket(5,1) = "$"
|
||||
sMarket(5,2) = "Sydney"
|
||||
sMarket(5,3) = "http://au.finance.yahoo.com/d/quotes.csv?s=<StockID>&f=sl1d1t1c1ohgv&e=.csv"
|
||||
sMarket(5,5) = "Symbole"
|
||||
sMarket(5,6) = "en"
|
||||
sMarket(5,7) = "AU"
|
||||
sMarket(5,8) = "C09"
|
||||
sMarket(5,9) = "44"
|
||||
sMarket(5,10) = "1"
|
||||
|
||||
' ****************************End of the default subset*********************************
|
||||
CompleteMarketList()
|
||||
|
||||
LocalizedCurrencies()
|
||||
|
||||
With TransactModel
|
||||
.lblStockNames.Label = sStockname
|
||||
.lblQuantity.Label = "Quantité"
|
||||
.lblRate.Label = "Cours"
|
||||
.lblDate.Label = "Date de transaction"
|
||||
.hlnCommission.Label = "Dépenses diverses"
|
||||
.lblCommission.Label = "Commission"
|
||||
.lblMinimum.Label = "Commission minimale"
|
||||
.lblFix.Label = "Montant fixe/frais"
|
||||
.cmdGoOn.Label = sOK
|
||||
.cmdCancel.Label = sCancel
|
||||
End With
|
||||
|
||||
With StockRatesModel
|
||||
.optPerShare.Label = "Dividende/action"
|
||||
.optTotal.Label = "Dividende total"
|
||||
.lblDividend.Label = "Montant"
|
||||
.lblExchangeRate.Label = "Taux de conversion (ancien->nouveau)"
|
||||
.lblColon.Label = ":"
|
||||
.lblDate.Label = "Date de la conversion:"
|
||||
.lblStockNames.Label = sStockname
|
||||
.lblStartDate.Label = sStartDate
|
||||
.lblEndDate.Label = sEndDate
|
||||
.optDaily.Label = "~Quotidien"
|
||||
.optWeekly.Label = "~Hebdomadaire"
|
||||
.hlnInterval.Label = "Période"
|
||||
.cmdGoOn.Label = sOk
|
||||
.cmdCancel.Label = sCancel
|
||||
End With
|
||||
End Sub
|
||||
</script:module>
|
||||
178
office-plugin/windows-office/share/basic/Depot/Lang_it.xba
Normal file
178
office-plugin/windows-office/share/basic/Depot/Lang_it.xba
Normal file
@@ -0,0 +1,178 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
|
||||
<!--***********************************************************
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
***********************************************************-->
|
||||
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Lang_it" script:language="StarBasic">Option Explicit
|
||||
|
||||
Sub LoadItalianLanguage()
|
||||
|
||||
sProductname = GetProductname
|
||||
sOK = "~OK"
|
||||
sCancel = "Annulla"
|
||||
sColumnHeader = "Intestazione colonna"
|
||||
sInsertStockName = "Inserite un nome di azioni"
|
||||
sTitle = "<PRODUCTNAME>: Gestione delle azioni"
|
||||
sTitle = ReplaceString(sTitle, sProductName, "<PRODUCTNAME>")
|
||||
sMsgError = "Errore dati immessi"
|
||||
sMsgNoName = sInsertStockname
|
||||
sMsgNoQuantity = "Inserite il numero delle azioni"
|
||||
sMsgNoDividend = "Inserite un dividendo a unità oppure un dividendo totale"
|
||||
sMsgNoExchangeRate = "Indicate un corretto tasso di cambio (vecchie azioni -> nuove azioni)."
|
||||
sMsgNoValidExchangeDate = "Indicate la data di frazionamento delle azioni."
|
||||
sMsgWrongExchangeDate = "Il frazionamento non è possibile perché sono ancora in atto transazioni dopo la data indicata."
|
||||
sMsgSellTooMuch = "Non potete vendere così tante azioni. Massimo: "
|
||||
sMsgConfirm = "È necessaria una conferma"
|
||||
sMsgFreeStock = "Confermate la digitazione di azioni gratuite?"
|
||||
sMsgTotalLoss = "Confermate la digitazione di perdita totale?"
|
||||
sMsgAuthorization = "Domanda di sicurezza"
|
||||
sMsgDeleteAll = "Eliminare tutti i movimenti e ripristinare la panoramica dei depositi?"
|
||||
cSplit = "Frazionamento delle azioni il: "
|
||||
sHistory = "Cronologia"
|
||||
TransactTitle(1) = "Vendita di azioni"
|
||||
TransactTitle(2) = "Acquisto di azioni"
|
||||
StockRatesTitle(1) = "Pagamento dei dividendi"
|
||||
StockRatesTitle(2) = "Frazionamento azioni"
|
||||
StockRatesTitle(3) = sHistory
|
||||
sDepotCurrency = "Valuta deposito"
|
||||
sStockName = "Nome delle azioni"
|
||||
TransactMode = LIFO ' Possible values: "FIFO" and "LIFO"
|
||||
DateCellStyle = "Risultato data"
|
||||
CurrCellStyle = "1"
|
||||
sStartDate = "Data d'inizio:"
|
||||
sEndDate = "Data finale:"
|
||||
sStartUpWelcome = "Questo modello vi permette una gestione efficace delle vostre azioni."
|
||||
sStartUpChooseMarket = "Selezionate la valuta di riferimento e la Borsa per il collegamento Internet."
|
||||
sStartUpHint = "La funzione <History> è disponibile solo per il mercato americano."
|
||||
sStartupHint = ReplaceString(sStartUpHint, sHistory, "<History>")
|
||||
sNoInternetUpdate = "Senza aggiornamento Internet"
|
||||
sMarketPlace = "Borsa:"
|
||||
sNoInternetDataAvailable = "Impossibile ricevere le quotazioni Internet"
|
||||
sCheckInternetSettings = "Possibili cause: <BR> le impostazioni Internet devono essere modificate.<BR> Avete indicato un indice (ad es. simbolo o codice) errato per le azioni."
|
||||
sCheckInternetSettings = ReplaceString(sCheckInternetSettings, chr(13), "<BR>")
|
||||
|
||||
sMsgEndDatebeforeNow = "La data finale dev'essere anteriore alla data odierna."
|
||||
sMsgStartDatebeforeEndDate = "La data d'inizio deve precedere la data finale."
|
||||
|
||||
sMarket(0,0) = "Dollaro USA"
|
||||
sMarket(0,1) = "$"
|
||||
sMarket(0,2) = "New York"
|
||||
sMarket(0,3) = "http://finance.yahoo.com/d/quotes.csv?s=<StockID>&f=sl1d1t1c1ohgv&e=.csv"
|
||||
sMarket(0,4) = "http://ichart.finance.yahoo.com/table.csv?" &_
|
||||
"s=<StockID>&d=<EndMonth>&e=<EndDay>&f=<Endyear>&g=d&" &_
|
||||
"a=<StartMonth>&b=<StartDay>&c=<Startyear>&ignore=.csv"
|
||||
sMarket(0,5) = "Simbolo"
|
||||
sMarket(0,6) = "en"
|
||||
sMarket(0,7) = "US"
|
||||
sMarket(0,8) = "409"
|
||||
sMarket(0,9) = "44"
|
||||
sMarket(0,10) = "1"
|
||||
|
||||
sMarket(1,0) = "Euro"
|
||||
sMarket(1,1) = chr(8364)
|
||||
sMarket(1,2) = "Francoforte"
|
||||
sMarket(1,3) = "http://de.finance.yahoo.com/d/quotes.csv?s=<StockID>.F&f=sl1t1c1ghpv&e=.csv"
|
||||
sMarket(1,5) = "Numero identificazione titoli"
|
||||
sMarket(1,6) = "de;nl;pt;el"
|
||||
sMarket(1,7) = "DE;NL;PT;GR"
|
||||
sMarket(1,8) = "407;413;816;408"
|
||||
sMarket(1,9) = "59/9"
|
||||
sMarket(1,10) = "1"
|
||||
|
||||
sMarket(2,0) = "Sterlina inglese"
|
||||
sMarket(2,1) = "£"
|
||||
sMarket(2,2) = "Londra"
|
||||
sMarket(2,3) = "http://uk.finance.yahoo.com/d/quotes.csv?s=<StockID>.L&m=*&f=sl1t1c1ghov&e=.csv"
|
||||
sMarket(2,5) = "Simbolo"
|
||||
sMarket(2,6) = "en"
|
||||
sMarket(2,7) = "GB"
|
||||
sMarket(2,8) = "809"
|
||||
sMarket(2,9) = "44"
|
||||
sMarket(2,10) = "1"
|
||||
|
||||
sMarket(3,0) = "Yen"
|
||||
sMarket(3,1) = "¥"
|
||||
sMarket(3,2) = "Tokyo"
|
||||
sMarket(3,3) = ""
|
||||
sMarket(3,5) = "Codice"
|
||||
sMarket(3,6) = "ja"
|
||||
sMarket(3,7) = "JP"
|
||||
sMarket(3,8) = "411"
|
||||
sMarket(3,9) = ""
|
||||
sMarket(3,10) = ""
|
||||
|
||||
sMarket(4,0) = "Dollaro Hong Kong"
|
||||
sMarket(4,1) = "HK$"
|
||||
sMarket(4,2) = "Hong Kong"
|
||||
sMarket(4,3) = "http://hk.finance.yahoo.com/d/quotes.csv?s=<StockID>&f=sl1d1t1c1ohgv&e=.csv"
|
||||
sMarket(4,5) = "Numero"
|
||||
sMarket(4,6) = "zh"
|
||||
sMarket(4,7) = "HK"
|
||||
sMarket(4,8) = "C04"
|
||||
sMarket(4,9) = "44"
|
||||
sMarket(4,10) = "1"
|
||||
|
||||
sMarket(5,0) = "Dollaro australiano"
|
||||
sMarket(5,1) = "$"
|
||||
sMarket(5,2) = "Sydney"
|
||||
sMarket(5,3) = "http://au.finance.yahoo.com/d/quotes.csv?s=<StockID>&f=sl1d1t1c1ohgv&e=.csv"
|
||||
sMarket(5,5) = "Simbolo"
|
||||
sMarket(5,6) = "en"
|
||||
sMarket(5,7) = "AU"
|
||||
sMarket(5,8) = "C09"
|
||||
sMarket(5,9) = "44"
|
||||
sMarket(5,10) = "1"
|
||||
|
||||
' ****************************End of the default subset*********************************
|
||||
CompleteMarketList()
|
||||
|
||||
LocalizedCurrencies()
|
||||
|
||||
With TransactModel
|
||||
.lblStockNames.Label = sStockname
|
||||
.lblQuantity.Label = "Quantità"
|
||||
.lblRate.Label = "Quotazione"
|
||||
.lblDate.Label = "Data della transazione"
|
||||
.hlnCommission.Label = "Spese extra"
|
||||
.lblCommission.Label = "Commissioni"
|
||||
.lblMinimum.Label = "Commissione minima"
|
||||
.lblFix.Label = "Importo fisso/Spese"
|
||||
.cmdGoOn.Label = sOK
|
||||
.cmdCancel.Label = sCancel
|
||||
End With
|
||||
|
||||
With StockRatesModel
|
||||
.optPerShare.Label = "Dividendo/Azione"
|
||||
.optTotal.Label = "Dividendo totale"
|
||||
.lblDividend.Label = "Importo"
|
||||
.lblExchangeRate.Label = "Tasso di cambio (vecchio->nuovo)"
|
||||
.lblColon.Label = ":"
|
||||
.lblDate.Label = "Data di cambio:"
|
||||
.lblStockNames.Label = sStockname
|
||||
.lblStartDate.Label = sStartDate
|
||||
.lblEndDate.Label = sEndDate
|
||||
.optDaily.Label = "~Giornaliero"
|
||||
.optWeekly.Label = "~Settimanale"
|
||||
.hlnInterval.Label = "Durata"
|
||||
.cmdGoOn.Label = sOk
|
||||
.cmdCancel.Label = sCancel
|
||||
End With
|
||||
End Sub
|
||||
</script:module>
|
||||
178
office-plugin/windows-office/share/basic/Depot/Lang_ja.xba
Normal file
178
office-plugin/windows-office/share/basic/Depot/Lang_ja.xba
Normal file
@@ -0,0 +1,178 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
|
||||
<!--***********************************************************
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
***********************************************************-->
|
||||
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Lang_ja" script:language="StarBasic">Option Explicit
|
||||
|
||||
Sub LoadJapaneseLanguage()
|
||||
|
||||
sProductname = GetProductname
|
||||
sOK = "~OK"
|
||||
sCancel = "キャンセル"
|
||||
sColumnHeader = "列番号"
|
||||
sInsertStockName = "最初に株の銘柄を入力してください。"
|
||||
sTitle = "<PRODUCTNAME>: 株管理"
|
||||
sTitle = ReplaceString(sTitle, sProductName, "<PRODUCTNAME>")
|
||||
sMsgError = "入力フィールド"
|
||||
sMsgNoName = sInsertStockname
|
||||
sMsgNoQuantity = "0 より大きな額を入力してください。"
|
||||
sMsgNoDividend = "1株当たりの配当金額または総配当金額を入力してください。"
|
||||
sMsgNoExchangeRate = "交換比率(旧株->新株)を入力してください。"
|
||||
sMsgNoValidExchangeDate = "株式分割日を入力してください。"
|
||||
sMsgWrongExchangeDate = "分割日以降に取引がすでに存在するので、分割できません。"
|
||||
sMsgSellTooMuch = "売却できる株式数を超えています。最大値: "
|
||||
sMsgConfirm = "ご確認ください"
|
||||
sMsgFreeStock = "無料株式を入力しますか?"
|
||||
sMsgTotalLoss = "全損の入力を行いますか?"
|
||||
sMsgAuthorization = "確認ダイアログ"
|
||||
sMsgDeleteAll = "すべての移動を取り消し、ポートフォリオの概要をリセットしますか?"
|
||||
cSplit = "株式分割日 "
|
||||
sHistory = "履歴"
|
||||
TransactTitle(1) = "株を買う"
|
||||
TransactTitle(2) = "株を買う"
|
||||
StockRatesTitle(1) = "配当額"
|
||||
StockRatesTitle(2) = "株式分割"
|
||||
StockRatesTitle(3) = sHistory
|
||||
sDepotCurrency = "ポートフォリオの通貨"
|
||||
sStockName = "株式名"
|
||||
TransactMode = LIFO ' Possible values: "FIFO" and "LIFO"
|
||||
DateCellStyle = "結果(日付)"
|
||||
CurrCellStyle = "1"
|
||||
sStartDate = "開始日:"
|
||||
sEndDate = "終了日:"
|
||||
sStartUpWelcome = "このテンプレートを使えば、株式のポートフォリオをより効率的に管理できます。"
|
||||
sStartUpChooseMarket = "まず、インターネットにより情報を更新する基準通貨と、対応する証券取引所を選択します。"
|
||||
sStartUpHint = "残念ながら、<History> 機能を使用できるのは米国市場に限られています。"
|
||||
sStartupHint = ReplaceString(sStartUpHint, sHistory, "<History>")
|
||||
sNoInternetUpdate = "インターネットによる情報の更新を行いません"
|
||||
sMarketPlace = "証券取引所:"
|
||||
sNoInternetDataAvailable = "インターネットから株価情報を受信できない場合があります!"
|
||||
sCheckInternetSettings = "考えられる原因は次のとおりです。<BR>インターネット設定の変更が必要です。<BR>入力した株式のが間違っています。"
|
||||
sCheckInternetSettings = ReplaceString(sCheckInternetSettings, chr(13), "<BR>")
|
||||
|
||||
sMsgEndDatebeforeNow = "終了日は、今日の日付より前であることが必要です。"
|
||||
sMsgStartDatebeforeEndDate = "開始日は、終了日より前であることが必要です。"
|
||||
|
||||
sMarket(0,0) = "米ドル"
|
||||
sMarket(0,1) = "$"
|
||||
sMarket(0,2) = "ニューヨーク"
|
||||
sMarket(0,3) = "http://finance.yahoo.com/d/quotes.csv?s=<StockID>&f=sl1d1t1c1ohgv&e=.csv"
|
||||
sMarket(0,4) = "http://ichart.finance.yahoo.com/table.csv?" &_
|
||||
"s=<StockID>&d=<EndMonth>&e=<EndDay>&f=<Endyear>&g=d&" &_
|
||||
"a=<StartMonth>&b=<StartDay>&c=<Startyear>&ignore=.csv"
|
||||
sMarket(0,5) = "シンボル"
|
||||
sMarket(0,6) = "en"
|
||||
sMarket(0,7) = "US"
|
||||
sMarket(0,8) = "409"
|
||||
sMarket(0,9) = "44"
|
||||
sMarket(0,10) = "1"
|
||||
|
||||
sMarket(1,0) = "ユーロ"
|
||||
sMarket(1,1) = chr(8364)
|
||||
sMarket(1,2) = "フランクフルト"
|
||||
sMarket(1,3) = "http://de.finance.yahoo.com/d/quotes.csv?s=<StockID>.F&f=sl1t1c1ghpv&e=.csv"
|
||||
sMarket(1,5) = "銘柄コード"
|
||||
sMarket(1,6) = "de;nl;pt;el"
|
||||
sMarket(1,7) = "DE;NL;PT;GR"
|
||||
sMarket(1,8) = "407;413;816;408"
|
||||
sMarket(1,9) = "59/9"
|
||||
sMarket(1,10) = "1"
|
||||
|
||||
sMarket(2,0) = "英ポンド"
|
||||
sMarket(2,1) = "£"
|
||||
sMarket(2,2) = "ロンドン"
|
||||
sMarket(2,3) = "http://uk.finance.yahoo.com/d/quotes.csv?s=<StockID>.L&m=*&f=sl1t1c1ghov&e=.csv"
|
||||
sMarket(2,5) = "シンボル"
|
||||
sMarket(2,6) = "en"
|
||||
sMarket(2,7) = "GB"
|
||||
sMarket(2,8) = "809"
|
||||
sMarket(2,9) = "44"
|
||||
sMarket(2,10) = "1"
|
||||
|
||||
sMarket(3,0) = "日本円"
|
||||
sMarket(3,1) = "¥"
|
||||
sMarket(3,2) = "東京"
|
||||
sMarket(3,3) = ""
|
||||
sMarket(3,5) = "コード"
|
||||
sMarket(3,6) = "ja"
|
||||
sMarket(3,7) = "JP"
|
||||
sMarket(3,8) = "411"
|
||||
sMarket(3,9) = ""
|
||||
sMarket(3,10) = ""
|
||||
|
||||
sMarket(4,0) = "香港ドル"
|
||||
sMarket(4,1) = "HK$"
|
||||
sMarket(4,2) = "香港"
|
||||
sMarket(4,3) = "http://hk.finance.yahoo.com/d/quotes.csv?s=<StockID>.HK&f=sl1d1t1c1ohgv&e=.csv"
|
||||
sMarket(4,5) = "番号"
|
||||
sMarket(4,6) = "zh"
|
||||
sMarket(4,7) = "HK"
|
||||
sMarket(4,8) = "C04"
|
||||
sMarket(4,9) = "44"
|
||||
sMarket(4,10) = "1"
|
||||
|
||||
sMarket(5,0) = "オーストリア・ドル"
|
||||
sMarket(5,1) = "$"
|
||||
sMarket(5,2) = "シドニー"
|
||||
sMarket(5,3) = "http://au.finance.yahoo.com/d/quotes.csv?s=<StockID>&f=sl1d1t1c1ohgv&e=.csv"
|
||||
sMarket(5,5) = "シンボル"
|
||||
sMarket(5,6) = "en"
|
||||
sMarket(5,7) = "AU"
|
||||
sMarket(5,8) = "C09"
|
||||
sMarket(5,9) = "44"
|
||||
sMarket(5,10) = "1"
|
||||
|
||||
' ****************************End of the default subset*********************************
|
||||
CompleteMarketList()
|
||||
|
||||
LocalizedCurrencies()
|
||||
|
||||
With TransactModel
|
||||
.lblStockNames.Label = sStockname
|
||||
.lblQuantity.Label = "株数"
|
||||
.lblRate.Label = "価格"
|
||||
.lblDate.Label = "取引日"
|
||||
.hlnCommission.Label = "その他の経費n"
|
||||
.lblCommission.Label = "手数料"
|
||||
.lblMinimum.Label = "最低手数料"
|
||||
.lblFix.Label = "固定費/諸経費"
|
||||
.cmdGoOn.Label = sOK
|
||||
.cmdCancel.Label = sCancel
|
||||
End With
|
||||
|
||||
With StockRatesModel
|
||||
.optPerShare.Label = "配当金/株式数"
|
||||
.optTotal.Label = "配当金の総額"
|
||||
.lblDividend.Label = "金額"
|
||||
.lblExchangeRate.Label = "交換比率(旧株->新株)"
|
||||
.lblColon.Label = ":"
|
||||
.lblDate.Label = "交換日:"
|
||||
.lblStockNames.Label = sStockname
|
||||
.lblStartDate.Label = sStartDate
|
||||
.lblEndDate.Label = sEndDate
|
||||
.optDaily.Label = "~毎日"
|
||||
.optWeekly.Label = "~毎週"
|
||||
.hlnInterval.Label = "期間"
|
||||
.cmdGoOn.Label = sOk
|
||||
.cmdCancel.Label = sCancel
|
||||
End With
|
||||
End Sub
|
||||
</script:module>
|
||||
178
office-plugin/windows-office/share/basic/Depot/Lang_ko.xba
Normal file
178
office-plugin/windows-office/share/basic/Depot/Lang_ko.xba
Normal file
@@ -0,0 +1,178 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
|
||||
<!--***********************************************************
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
***********************************************************-->
|
||||
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Lang_ko" script:language="StarBasic">Option Explicit
|
||||
|
||||
Sub LoadKoreanLanguage()
|
||||
|
||||
sProductname = GetProductname
|
||||
sOK = "~확인"
|
||||
sCancel = "취소"
|
||||
sColumnHeader = "열 머리글"
|
||||
sInsertStockName = "주식 종목을 삽입해주십시오."
|
||||
sTitle = "<PRODUCTNAME>: 주식 매수"
|
||||
sTitle = ReplaceString(sTitle, sProductName, "<PRODUCTNAME>")
|
||||
sMsgError = "입력 오류"
|
||||
sMsgNoName = sInsertStockname
|
||||
sMsgNoQuantity = "0 이하의 매수를 입력해주십시오."
|
||||
sMsgNoDividend = "한 주당 배당분 또는 총배당분을 입력해주십시오."
|
||||
sMsgNoExchangeRate = "정확한 환율을 입력해주십시오 (구주를 신주로 소급 시)."
|
||||
sMsgNoValidExchangeDate = "유효한 배당 결제일을 입력해주십시오."
|
||||
sMsgWrongExchangeDate = "배당 기준일이 경과하여 배당할 수 없습니다."
|
||||
sMsgSellTooMuch = "이렇게 많은 주식을 팔 수 없습니다. 최대 매도수: "
|
||||
sMsgConfirm = "확인 필요"
|
||||
sMsgFreeStock = "공짜 주식을 입력하시겠습니까?"
|
||||
sMsgTotalLoss = "주가 폭락세를 입력하시겠습니까?"
|
||||
sMsgAuthorization = "안정성 조회"
|
||||
sMsgDeleteAll = "모든 주가 움직임을 삭제하고 계좌 현황을 원래대로 하시겠습니까?"
|
||||
cSplit = "주식 배당일 "
|
||||
sHistory = "내역"
|
||||
TransactTitle(1) = "주식 관리: 주식 매도"
|
||||
TransactTitle(2) = "주식 관리: 주식 매수"
|
||||
StockRatesTitle(1) = "주식 관리: 배당금 지불"
|
||||
StockRatesTitle(2) = "주식 관리: 주식 배분"
|
||||
StockRatesTitle(3) = sHistory
|
||||
sDepotCurrency = "주식 계좌 통화"
|
||||
sStockName = "주식 종목명"
|
||||
TransactMode = LIFO ' Possible values: "FIFO" and "LIFO"
|
||||
DateCellStyle = "결과, 날짜"
|
||||
CurrCellStyle = "1"
|
||||
sStartDate = "매매일:"
|
||||
sEndDate = "만기일:"
|
||||
sStartUpWelcome = "이 템플릿을 사용하여 주식 투자 관리를 효율적으로 할 수 있습니다."
|
||||
sStartUpChooseMarket = "인터넷 업데이트를 위해 우선 관련 통화와 증권 장소를 선택하십시오."
|
||||
sStartUpHint = "<내역> 기능은 미국 시장용으로만 사용할 수 있습니다."
|
||||
sStartupHint = ReplaceString(sStartUpHint, sHistory, "<History>")
|
||||
sNoInternetUpdate = "인터넷 업데이트 없음"
|
||||
sMarketPlace = "증권 장소:"
|
||||
sNoInternetDataAvailable = "인터넷 시세는 받을 수 없었습니다."
|
||||
sCheckInternetSettings = "원인: <BR> 인터넷 설정을 점검해야만 합니다.<BR> 옳지 않은 암호<예를 들어 잘못된 문자 또는 종목 코드>를 입력했습니다."
|
||||
sCheckInternetSettings = ReplaceString(sCheckInternetSettings, chr(13), "<BR>")
|
||||
|
||||
sMsgEndDatebeforeNow = "만기일은 오늘 날짜 전에 기입되어야 합니다."
|
||||
sMsgStartDatebeforeEndDate = "매매일은 만기일 전에 기입되어야 합니다."
|
||||
|
||||
sMarket(0,0) = "미국 달러"
|
||||
sMarket(0,1) = "$"
|
||||
sMarket(0,2) = "뉴욕"
|
||||
sMarket(0,3) = "http://finance.yahoo.com/d/quotes.csv?s=<StockID>&f=sl1d1t1c1ohgv&e=.csv"
|
||||
sMarket(0,4) = "http://ichart.finance.yahoo.com/table.csv?" &_
|
||||
"s=<StockID>&d=<EndMonth>&e=<EndDay>&f=<Endyear>&g=d&" &_
|
||||
"a=<StartMonth>&b=<StartDay>&c=<Startyear>&ignore=.csv"
|
||||
sMarket(0,5) = "기호"
|
||||
sMarket(0,6) = "en"
|
||||
sMarket(0,7) = "US"
|
||||
sMarket(0,8) = "409"
|
||||
sMarket(0,9) = "44"
|
||||
sMarket(0,10) = "1"
|
||||
|
||||
sMarket(1,0) = "유로"
|
||||
sMarket(1,1) = chr(8364)
|
||||
sMarket(1,2) = "프랑크푸르트"
|
||||
sMarket(1,3) = "http://de.finance.yahoo.com/d/quotes.csv?s=<StockID>.F&f=sl1t1c1ghpv&e=.csv"
|
||||
sMarket(1,5) = "WKN"
|
||||
sMarket(1,6) = "de;nl;pt;el"
|
||||
sMarket(1,7) = "DE;NL;PT;GR"
|
||||
sMarket(1,8) = "407;413;816;408"
|
||||
sMarket(1,9) = "59/9"
|
||||
sMarket(1,10) = "1"
|
||||
|
||||
sMarket(2,0) = "영국 파운드"
|
||||
sMarket(2,1) = "£"
|
||||
sMarket(2,2) = "런던"
|
||||
sMarket(2,3) = "http://uk.finance.yahoo.com/d/quotes.csv?s=<StockID>.L&m=*&f=sl1t1c1ghov&e=.csv"
|
||||
sMarket(2,5) = "기호"
|
||||
sMarket(2,6) = "en"
|
||||
sMarket(2,7) = "GB"
|
||||
sMarket(2,8) = "809"
|
||||
sMarket(2,9) = "44"
|
||||
sMarket(2,10) = "1"
|
||||
|
||||
sMarket(3,0) = "엔화"
|
||||
sMarket(3,1) = "¥"
|
||||
sMarket(3,2) = "도쿄"
|
||||
sMarket(3,3) = ""
|
||||
sMarket(3,5) = "코드"
|
||||
sMarket(3,6) = "ja"
|
||||
sMarket(3,7) = "JP"
|
||||
sMarket(3,8) = "411"
|
||||
sMarket(3,9) = ""
|
||||
sMarket(3,10) = ""
|
||||
|
||||
sMarket(4,0) = "홍콩 달러"
|
||||
sMarket(4,1) = "HK$"
|
||||
sMarket(4,2) = "홍콩"
|
||||
sMarket(4,3) = "http://hk.finance.yahoo.com/d/quotes.csv?s=<StockID>.HK&f=sl1d1t1c1ohgv&e=.csv"
|
||||
sMarket(4,5) = "번호"
|
||||
sMarket(4,6) = "zh"
|
||||
sMarket(4,7) = "HK"
|
||||
sMarket(4,8) = "C04"
|
||||
sMarket(4,9) = "44"
|
||||
sMarket(4,10) = "1"
|
||||
|
||||
sMarket(5,0) = "호주 달러"
|
||||
sMarket(5,1) = "$"
|
||||
sMarket(5,2) = "시드니"
|
||||
sMarket(5,3) = "http://au.finance.yahoo.com/d/quotes.csv?s=<StockID>&f=sl1d1t1c1ohgv&e=.csv"
|
||||
sMarket(5,5) = "기호"
|
||||
sMarket(5,6) = "en"
|
||||
sMarket(5,7) = "AU"
|
||||
sMarket(5,8) = "C09"
|
||||
sMarket(5,9) = "44"
|
||||
sMarket(5,10) = "1"
|
||||
|
||||
' ****************************End of the default subset*********************************
|
||||
CompleteMarketList()
|
||||
|
||||
LocalizedCurrencies()
|
||||
|
||||
With TransactModel
|
||||
.lblStockNames.Label = sStockname
|
||||
.lblQuantity.Label = "수량"
|
||||
.lblRate.Label = "시세"
|
||||
.lblDate.Label = "배당 결산일"
|
||||
.hlnCommission.Label = "기타 지출"
|
||||
.lblCommission.Label = "수수료"
|
||||
.lblMinimum.Label = "최저 수수료"
|
||||
.lblFix.Label = "약정 금액/기타 경비"
|
||||
.cmdGoOn.Label = sOK
|
||||
.cmdCancel.Label = sCancel
|
||||
End With
|
||||
|
||||
With StockRatesModel
|
||||
.optPerShare.Label = "배당분/주"
|
||||
.optTotal.Label = "배당분 합계"
|
||||
.lblDividend.Label = "금액"
|
||||
.lblExchangeRate.Label = "환율(구주->신주)"
|
||||
.lblColon.Label = ":"
|
||||
.lblDate.Label = "환율일자"
|
||||
.lblStockNames.Label = sStockname
|
||||
.lblStartDate.Label = sStartDate
|
||||
.lblEndDate.Label = sEndDate
|
||||
.optDaily.Label = "~매일"
|
||||
.optWeekly.Label = "~매주"
|
||||
.hlnInterval.Label = "기간"
|
||||
.cmdGoOn.Label = sOk
|
||||
.cmdCancel.Label = sCancel
|
||||
End With
|
||||
End Sub
|
||||
</script:module>
|
||||
177
office-plugin/windows-office/share/basic/Depot/Lang_sv.xba
Normal file
177
office-plugin/windows-office/share/basic/Depot/Lang_sv.xba
Normal file
@@ -0,0 +1,177 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
|
||||
<!--***********************************************************
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
***********************************************************-->
|
||||
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Lang_sv" script:language="StarBasic">Option Explicit
|
||||
|
||||
Sub LoadSwedishLanguage()
|
||||
sProductname = GetProductname
|
||||
sOK = "~OK"
|
||||
sCancel = "Avbryt"
|
||||
sColumnHeader = "Kolumnhuvud"
|
||||
sInsertStockName = "Infoga först några aktier i Din portfölj!"
|
||||
sTitle = "<PRODUCTNAME>: Aktieförvaltning"
|
||||
sTitle = ReplaceString(sTitle, sProductName, "<PRODUCTNAME>")
|
||||
sMsgError = "Inmatningsfel"
|
||||
sMsgNoName = sInsertStockname
|
||||
sMsgNoQuantity = "Var vänlig och mata in ett större antal än 0"
|
||||
sMsgNoDividend = "Var vänlig och mata in utdelning per styck eller den totala utdelningen"
|
||||
sMsgNoExchangeRate = "Var vänlig och mata in en korrekt omräkningskurs (gamla aktier -> nya aktier)."
|
||||
sMsgNoValidExchangeDate = "Var vänlig och mata in ett giltigt datum för aktiesplitten."
|
||||
sMsgWrongExchangeDate = "Split är inte möjlig eftersom det redan finns transaktioner efter splitdatum."
|
||||
sMsgSellTooMuch = "Så många aktier kan Du inte sälja. Maximum: "
|
||||
sMsgConfirm = "Bekräftelse krävs"
|
||||
sMsgFreeStock = "Avser Du att mata in gratisaktier?"
|
||||
sMsgTotalLoss = "Avser Du att mata in en totalförlust?"
|
||||
sMsgAuthorization = "Säkerhetskontroll"
|
||||
sMsgDeleteAll = "Vill Du ta bort alla rörelser och återställa portföljöversikten?"
|
||||
cSplit = "Aktiesplit den "
|
||||
sHistory = "Historik"
|
||||
TransactTitle(1) = "Sälja aktier"
|
||||
TransactTitle(2) = "Köpa aktier"
|
||||
StockRatesTitle(1) = "Aktieutdelning"
|
||||
StockRatesTitle(2) = "Aktiesplit"
|
||||
StockRatesTitle(3) = sHistory
|
||||
sDepotCurrency = "Portföljvaluta"
|
||||
sStockName = "Aktienamn"
|
||||
TransactMode = LIFO ' Possible values: "FIFO" and "LIFO"
|
||||
DateCellStyle = "Resultat datum"
|
||||
CurrCellStyle = "1"
|
||||
sStartDate = "Startdatum:"
|
||||
sEndDate = "Slutdatum:"
|
||||
sStartUpWelcome = "Med hjälp av den här mallen kan Du förvalta Din aktieportfölj effektivt"
|
||||
sStartUpChooseMarket = "Välj först Din referensvaluta och därigenom börs för Internet-uppdateringen!"
|
||||
sStartUpHint = "Tyvärr är <History>-funktionen bara tillgänglig för den amerikanska marknaden!"
|
||||
sStartupHint = ReplaceString(sStartUpHint, sHistory, "<History>")
|
||||
sNoInternetUpdate = "utan Internet-uppdatering"
|
||||
sMarketPlace = "Börs:"
|
||||
sNoInternetDataAvailable = "Det gick inte att ta emot Internet-kurser!"
|
||||
sCheckInternetSettings = "Detta kan bero på att: <BR> Dina Internet-inställningar måste ändras.<BR> Du har angivit ett felaktigt ID (t.ex. symbol, värdepappersnr.) för aktien."
|
||||
sCheckInternetSettings = ReplaceString(sCheckInternetSettings, chr(13), "<BR>")
|
||||
|
||||
sMsgEndDatebeforeNow = "Slutdatum måste ligga före idag!"
|
||||
sMsgStartDatebeforeEndDate = "Startdatum måste ligga före slutdatum!"
|
||||
|
||||
sMarket(0,0) = "Amerikansk dollar"
|
||||
sMarket(0,1) = "$"
|
||||
sMarket(0,2) = "New York"
|
||||
sMarket(0,3) = "http://finance.yahoo.com/d/quotes.csv?s=<StockID>&f=sl1d1t1c1ohgv&e=.csv"
|
||||
sMarket(0,4) = "http://ichart.finance.yahoo.com/table.csv?" &_
|
||||
"s=<StockID>&d=<EndMonth>&e=<EndDay>&f=<Endyear>&g=d&" &_
|
||||
"a=<StartMonth>&b=<StartDay>&c=<Startyear>&ignore=.csv"
|
||||
sMarket(0,5) = "Symbol"
|
||||
sMarket(0,6) = "en"
|
||||
sMarket(0,7) = "US"
|
||||
sMarket(0,8) = "409"
|
||||
sMarket(0,9) = "44"
|
||||
sMarket(0,10) = "1"
|
||||
|
||||
sMarket(1,0) = "Euro"
|
||||
sMarket(1,1) = chr(8364)
|
||||
sMarket(1,2) = "Frankfurt"
|
||||
sMarket(1,3) = "http://de.finance.yahoo.com/d/quotes.csv?s=<StockID>.F&f=sl1t1c1ghpv&e=.csv"
|
||||
sMarket(1,5) = "Värdepappersnr"
|
||||
sMarket(1,6) = "de;nl;pt;el"
|
||||
sMarket(1,7) = "DE;NL;PT;GR"
|
||||
sMarket(1,8) = "407;413;816;408"
|
||||
sMarket(1,9) = "59/9"
|
||||
sMarket(1,10) = "1"
|
||||
|
||||
sMarket(2,0) = "Engelskt pund"
|
||||
sMarket(2,1) = "£"
|
||||
sMarket(2,2) = "London"
|
||||
sMarket(2,3) = "http://uk.finance.yahoo.com/d/quotes.csv?s=<StockID>.L&m=*&f=sl1t1c1ghov&e=.csv"
|
||||
sMarket(2,5) = "Symbol"
|
||||
sMarket(2,6) = "en"
|
||||
sMarket(2,7) = "GB"
|
||||
sMarket(2,8) = "809"
|
||||
sMarket(2,9) = "44"
|
||||
sMarket(2,10) = "1"
|
||||
|
||||
sMarket(3,0) = "Japansk yen"
|
||||
sMarket(3,1) = "¥"
|
||||
sMarket(3,2) = "Tokyo"
|
||||
sMarket(3,3) = ""
|
||||
sMarket(3,5) = "Kod"
|
||||
sMarket(3,6) = "ja"
|
||||
sMarket(3,7) = "JP"
|
||||
sMarket(3,8) = "411"
|
||||
sMarket(3,9) = ""
|
||||
sMarket(3,10) = ""
|
||||
|
||||
sMarket(4,0) = "Hongkongdollar"
|
||||
sMarket(4,1) = "HK$"
|
||||
sMarket(4,2) = "Hongkong"
|
||||
sMarket(4,3) = "http://hk.finance.yahoo.com/d/quotes.csv?s=<StockID>&f=sl1d1t1c1ohgv&e=.csv"
|
||||
sMarket(4,5) = "Nummer"
|
||||
sMarket(4,6) = "zh"
|
||||
sMarket(4,7) = "HK"
|
||||
sMarket(4,8) = "C04"
|
||||
sMarket(4,9) = "44"
|
||||
sMarket(4,10) = "1"
|
||||
|
||||
sMarket(5,0) = "Australisk dollar"
|
||||
sMarket(5,1) = "$"
|
||||
sMarket(5,2) = "Sydney"
|
||||
sMarket(5,3) = "http://au.finance.yahoo.com/d/quotes.csv?s=<StockID>&f=sl1d1t1c1ohgv&e=.csv"
|
||||
sMarket(5,5) = "Symbol"
|
||||
sMarket(5,6) = "en"
|
||||
sMarket(5,7) = "AU"
|
||||
sMarket(5,8) = "C09"
|
||||
sMarket(5,9) = "44"
|
||||
sMarket(5,10) = "1"
|
||||
|
||||
' ****************************End of the default subset*********************************
|
||||
CompleteMarketList()
|
||||
|
||||
LocalizedCurrencies()
|
||||
|
||||
With TransactModel
|
||||
.lblStockNames.Label = sStockname
|
||||
.lblQuantity.Label = "Antal"
|
||||
.lblRate.Label = "Kurs"
|
||||
.lblDate.Label = "Transaktionsdatum"
|
||||
.hlnCommission.Label = "Övriga utgifter"
|
||||
.lblCommission.Label = "Provision"
|
||||
.lblMinimum.Label = "Minimiprovision"
|
||||
.lblFix.Label = "Fast belopp/omkostnader"
|
||||
.cmdGoOn.Label = sOK
|
||||
.cmdCancel.Label = sCancel
|
||||
End With
|
||||
|
||||
With StockRatesModel
|
||||
.optPerShare.Label = "Utdelning per aktie"
|
||||
.optTotal.Label = "Utdelning totalt"
|
||||
.lblDividend.Label = "Belopp"
|
||||
.lblExchangeRate.Label = "Omräkningskurs (gammal->ny)"
|
||||
.lblColon.Label = ":"
|
||||
.lblDate.Label = "Omräkningsdatum:"
|
||||
.lblStockNames.Label = sStockname
|
||||
.lblStartDate.Label = sStartDate
|
||||
.lblEndDate.Label = sEndDate
|
||||
.optDaily.Label = "~Dagligen"
|
||||
.optWeekly.Label = "~Varje vecka"
|
||||
.hlnInterval.Label = "Period"
|
||||
.cmdGoOn.Label = sOk
|
||||
.cmdCancel.Label = sCancel
|
||||
End With
|
||||
End Sub
|
||||
</script:module>
|
||||
178
office-plugin/windows-office/share/basic/Depot/Lang_tw.xba
Normal file
178
office-plugin/windows-office/share/basic/Depot/Lang_tw.xba
Normal file
@@ -0,0 +1,178 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
|
||||
<!--***********************************************************
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
***********************************************************-->
|
||||
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Lang_tw" script:language="StarBasic">Option Explicit
|
||||
|
||||
Sub LoadChineseTradLanguage()
|
||||
|
||||
sProductname = GetProductname
|
||||
sOK = "確定"
|
||||
sCancel = "取消"
|
||||
sColumnHeader = "欄標簽"
|
||||
sInsertStockName = "請先填入股票名稱!"
|
||||
sTitle = "<PRODUCTNAME>: 股票管理"
|
||||
sTitle = ReplaceString(sTitle, sProductName, "<PRODUCTNAME>")
|
||||
sMsgError = "輸入無效"
|
||||
sMsgNoName = sInsertStockname
|
||||
sMsgNoQuantity = "請輸入大於0的交易股數"
|
||||
sMsgNoDividend = "請輸入每股股息金額或股息總額"
|
||||
sMsgNoExchangeRate = "請鍵入正確的換算比率(舊股票 -> 新股票)。"
|
||||
sMsgNoValidExchangeDate = "請輸入股票分割的日期。"
|
||||
sMsgWrongExchangeDate = "無法分割股票,因為分割日期之後已經買進或賣出股票。"
|
||||
sMsgSellTooMuch = "最多能出售的股票數: "
|
||||
sMsgConfirm = "需要确認"
|
||||
sMsgFreeStock = "需要輸入一個贈送的股票?"
|
||||
sMsgTotalLoss = "要輸入一個全部損失的股票?"
|
||||
sMsgAuthorization = "安全詢問"
|
||||
sMsgDeleteAll = "您要刪除所有的交易資料,重新建立一個股票一覽表?"
|
||||
cSplit = "股票分割的日期 "
|
||||
sHistory = "紀錄"
|
||||
TransactTitle(1) = "出售股票"
|
||||
TransactTitle(2) = "購買股票"
|
||||
StockRatesTitle(1) = "支付股息"
|
||||
StockRatesTitle(2) = "股票分割"
|
||||
StockRatesTitle(3) = sHistory
|
||||
sDepotCurrency = "股票的貨幣"
|
||||
sStockName = "股票名稱"
|
||||
TransactMode = LIFO ' Possible values: "FIFO" and "LIFO"
|
||||
DateCellStyle = "結果 日期"
|
||||
CurrCellStyle = "1"
|
||||
sStartDate = "交割日期:"
|
||||
sEndDate = "到期日期:"
|
||||
sStartUpWelcome = "這個樣式用於高效能地管理股票交易。"
|
||||
sStartUpChooseMarket = "請先選一個參照的貨幣和一個可直接從 Internet 更新資料的贈券交易所。"
|
||||
sStartUpHint = "很遺憾,<History>-功能僅適用於美國的交易所。"
|
||||
sStartupHint = ReplaceString(sStartUpHint, sHistory, "<History>")
|
||||
sNoInternetUpdate = "不透過 internet 更新"
|
||||
sMarketPlace = "證券交易所:"
|
||||
sNoInternetDataAvailable = "無法接受 Internet 股票價格!"
|
||||
sCheckInternetSettings = "可能的原因:<BR>Internet 設定不正確,需要重新設定。<BR>輸入了一個錯誤的股票代碼。"
|
||||
sCheckInternetSettings = ReplaceString(sCheckInternetSettings, chr(13), "<BR>")
|
||||
|
||||
sMsgEndDatebeforeNow = "到期日期必須是在今日之前!"
|
||||
sMsgStartDatebeforeEndDate = "交割日期必須是在到期日期之前!"
|
||||
|
||||
sMarket(0,0) = "美元"
|
||||
sMarket(0,1) = "$"
|
||||
sMarket(0,2) = "紐約"
|
||||
sMarket(0,3) = "http://finance.yahoo.com/d/quotes.csv?s=<StockID>&f=sl1d1t1c1ohgv&e=.csv"
|
||||
sMarket(0,4) = "http://ichart.finance.yahoo.com/table.csv?" &_
|
||||
"s=<StockID>&d=<EndMonth>&e=<EndDay>&f=<Endyear>&g=d&" &_
|
||||
"a=<StartMonth>&b=<StartDay>&c=<Startyear>&ignore=.csv"
|
||||
sMarket(0,5) = "股票符號"
|
||||
sMarket(0,6) = "en"
|
||||
sMarket(0,7) = "US"
|
||||
sMarket(0,8) = "409"
|
||||
sMarket(0,9) = "44"
|
||||
sMarket(0,10) = "1"
|
||||
|
||||
sMarket(1,0) = "歐元"
|
||||
sMarket(1,1) = chr(8364)
|
||||
sMarket(1,2) = "法蘭克福"
|
||||
sMarket(1,3) = "http://de.finance.yahoo.com/d/quotes.csv?s=<StockID>.F&f=sl1t1c1ghpv&e=.csv"
|
||||
sMarket(1,5) = "股代碼"
|
||||
sMarket(1,6) = "de;nl;pt;el"
|
||||
sMarket(1,7) = "DE;NL;PT;GR"
|
||||
sMarket(1,8) = "407;413;816;408"
|
||||
sMarket(1,9) = "59/9"
|
||||
sMarket(1,10) = "1"
|
||||
|
||||
sMarket(2,0) = "英鎊"
|
||||
sMarket(2,1) = "£"
|
||||
sMarket(2,2) = "倫敦"
|
||||
sMarket(2,3) = "http://uk.finance.yahoo.com/d/quotes.csv?s=<StockID>.L&m=*&f=sl1t1c1ghov&e=.csv"
|
||||
sMarket(2,5) = "股票符號"
|
||||
sMarket(2,6) = "en"
|
||||
sMarket(2,7) = "GB"
|
||||
sMarket(2,8) = "809"
|
||||
sMarket(2,9) = "44"
|
||||
sMarket(2,10) = "1"
|
||||
|
||||
sMarket(3,0) = "日元"
|
||||
sMarket(3,1) = "¥"
|
||||
sMarket(3,2) = "東京"
|
||||
sMarket(3,3) = ""
|
||||
sMarket(3,5) = "代碼"
|
||||
sMarket(3,6) = "ja"
|
||||
sMarket(3,7) = "JP"
|
||||
sMarket(3,8) = "411"
|
||||
sMarket(3,9) = ""
|
||||
sMarket(3,10) = ""
|
||||
|
||||
sMarket(4,0) = "港幣"
|
||||
sMarket(4,1) = "HK$"
|
||||
sMarket(4,2) = "香港"
|
||||
sMarket(4,3) = "http://hk.finance.yahoo.com/d/quotes.csv?s=<StockID>.HK&f=sl1d1t1c1ohgv&e=.csv"
|
||||
sMarket(4,5) = "編號"
|
||||
sMarket(4,6) = "zh"
|
||||
sMarket(4,7) = "HK"
|
||||
sMarket(4,8) = "C04"
|
||||
sMarket(4,9) = "44"
|
||||
sMarket(4,10) = "1"
|
||||
|
||||
sMarket(5,0) = "澳元"
|
||||
sMarket(5,1) = "$"
|
||||
sMarket(5,2) = "悉尼"
|
||||
sMarket(5,3) = "http://au.finance.yahoo.com/d/quotes.csv?s=<StockID>&f=sl1d1t1c1ohgv&e=.csv"
|
||||
sMarket(5,5) = "股票符號"
|
||||
sMarket(5,6) = "en"
|
||||
sMarket(5,7) = "AU"
|
||||
sMarket(5,8) = "C09"
|
||||
sMarket(5,9) = "44"
|
||||
sMarket(5,10) = "1"
|
||||
|
||||
' ****************************End of the default subset*********************************
|
||||
CompleteMarketList()
|
||||
|
||||
LocalizedCurrencies()
|
||||
|
||||
With TransactModel
|
||||
.lblStockNames.Label = sStockname
|
||||
.lblQuantity.Label = "數量"
|
||||
.lblRate.Label = "股票價格"
|
||||
.lblDate.Label = "交易日期"
|
||||
.hlnCommission.Label = "其它的支出費用"
|
||||
.lblCommission.Label = "手續費"
|
||||
.lblMinimum.Label = "最低手續費"
|
||||
.lblFix.Label = "固定金額/費用"
|
||||
.cmdGoOn.Label = sOK
|
||||
.cmdCancel.Label = sCancel
|
||||
End With
|
||||
|
||||
With StockRatesModel
|
||||
.optPerShare.Label = "每股股息"
|
||||
.optTotal.Label = "股息總計"
|
||||
.lblDividend.Label = "金額"
|
||||
.lblExchangeRate.Label = "轉換比率(舊股票 -> 新股票)"
|
||||
.lblColon.Label = ":"
|
||||
.lblDate.Label = "轉換日期:"
|
||||
.lblStockNames.Label = sStockname
|
||||
.lblStartDate.Label = sStartDate
|
||||
.lblEndDate.Label = sEndDate
|
||||
.optDaily.Label = "每日"
|
||||
.optWeekly.Label = "每週"
|
||||
.hlnInterval.Label = "時間週期"
|
||||
.cmdGoOn.Label = sOk
|
||||
.cmdCancel.Label = sCancel
|
||||
End With
|
||||
End Sub
|
||||
</script:module>
|
||||
178
office-plugin/windows-office/share/basic/Depot/Lang_zh.xba
Normal file
178
office-plugin/windows-office/share/basic/Depot/Lang_zh.xba
Normal file
@@ -0,0 +1,178 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
|
||||
<!--***********************************************************
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
***********************************************************-->
|
||||
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Lang_zh" script:language="StarBasic">Option Explicit
|
||||
|
||||
Sub LoadChineseSimpleLanguage()
|
||||
|
||||
sProductname = GetProductname
|
||||
sOK = "确定"
|
||||
sCancel = "取消"
|
||||
sColumnHeader = "列标题"
|
||||
sInsertStockName = "请首先往您的帐号内输入一些股票名称!"
|
||||
sTitle = "<PRODUCTNAME>:股票管理"
|
||||
sTitle = ReplaceString(sTitle, sProductName, "<PRODUCTNAME>")
|
||||
sMsgError = "输入错误"
|
||||
sMsgNoName = sInsertStockname
|
||||
sMsgNoQuantity = "请输入大于0的交易股数"
|
||||
sMsgNoDividend = "请输入每股的红利金额或红利总额"
|
||||
sMsgNoExchangeRate = "请输入一个正确的兑换率(旧股-> 新股)。"
|
||||
sMsgNoValidExchangeDate = "请输入拆股生效日期。"
|
||||
sMsgWrongExchangeDate = "因为在拆股生效后已经进行了股票交易,所以无法拆股。"
|
||||
sMsgSellTooMuch = "您最多能出售的股票数为: "
|
||||
sMsgConfirm = "需要确认"
|
||||
sMsgFreeStock = "您想要输入赠送股票?"
|
||||
sMsgTotalLoss = "您想要输入总亏损值?"
|
||||
sMsgAuthorization = "安全查询"
|
||||
sMsgDeleteAll = "您要删除所有的交易信息并重新建立股票帐号一览表吗?"
|
||||
cSplit = "股票拆股日期 "
|
||||
sHistory = "记录"
|
||||
TransactTitle(1) = "出售股票"
|
||||
TransactTitle(2) = "购买股票"
|
||||
StockRatesTitle(1) = "支付红利"
|
||||
StockRatesTitle(2) = "股票拆股"
|
||||
StockRatesTitle(3) = sHistory
|
||||
sDepotCurrency = "股票交易的货币"
|
||||
sStockName = "股票名称"
|
||||
TransactMode = LIFO ' Possible values: "FIFO" and "LIFO"
|
||||
DateCellStyle = "结果 日期"
|
||||
CurrCellStyle = "1"
|
||||
sStartDate = "起始日期:"
|
||||
sEndDate = "终止日期:"
|
||||
sStartUpWelcome = "这个样式能够帮助您有效地管理自己的股票帐号"
|
||||
sStartUpChooseMarket = "请首先选择采用的参考货币以及要直接用国际互联网来更新资料的证券交易所!"
|
||||
sStartUpHint = "很遗憾,<History>功能仅可供美国市场使用!"
|
||||
sStartupHint = ReplaceString(sStartUpHint, sHistory, "<History>")
|
||||
sNoInternetUpdate = "不通过国际互联网更新"
|
||||
sMarketPlace = "交易所:"
|
||||
sNoInternetDataAvailable = "无法获得国际互联网上的行情!"
|
||||
sCheckInternetSettings = "可能的原因是:<BR>您的国际互联网设定不正确,需要重新设定。<BR>输入了一个错误的股票号码。"
|
||||
sCheckInternetSettings = ReplaceString(sCheckInternetSettings, chr(13), "<BR>")
|
||||
|
||||
sMsgEndDatebeforeNow = "终止日期必须在今天之前!"
|
||||
sMsgStartDatebeforeEndDate = "起始日期必须在终止日期之前!"
|
||||
|
||||
sMarket(0,0) = "美元"
|
||||
sMarket(0,1) = "$"
|
||||
sMarket(0,2) = "纽约"
|
||||
sMarket(0,3) = "http://finance.yahoo.com/d/quotes.csv?s=<StockID>&f=sl1d1t1c1ohgv&e=.csv"
|
||||
sMarket(0,4) = "http://ichart.finance.yahoo.com/table.csv?" &_
|
||||
"s=<StockID>&d=<EndMonth>&e=<EndDay>&f=<Endyear>&g=d&" &_
|
||||
"a=<StartMonth>&b=<StartDay>&c=<Startyear>&ignore=.csv"
|
||||
sMarket(0,5) = "图标"
|
||||
sMarket(0,6) = "en"
|
||||
sMarket(0,7) = "US"
|
||||
sMarket(0,8) = "409"
|
||||
sMarket(0,9) = "44"
|
||||
sMarket(0,10) = "1"
|
||||
|
||||
sMarket(1,0) = "欧元"
|
||||
sMarket(1,1) = chr(8364)
|
||||
sMarket(1,2) = "法兰克福"
|
||||
sMarket(1,3) = "http://de.finance.yahoo.com/d/quotes.csv?s=<StockID>.F&f=sl1t1c1ghpv&e=.csv"
|
||||
sMarket(1,5) = "代码"
|
||||
sMarket(1,6) = "de;nl;pt;el"
|
||||
sMarket(1,7) = "DE;NL;PT;GR"
|
||||
sMarket(1,8) = "407;413;816;408"
|
||||
sMarket(1,9) = "59/9"
|
||||
sMarket(1,10) = "1"
|
||||
|
||||
sMarket(2,0) = "英镑"
|
||||
sMarket(2,1) = "£"
|
||||
sMarket(2,2) = "伦敦"
|
||||
sMarket(2,3) = "http://uk.finance.yahoo.com/d/quotes.csv?s=<StockID>.L&m=*&f=sl1t1c1ghov&e=.csv"
|
||||
sMarket(2,5) = "股票代码"
|
||||
sMarket(2,6) = "en"
|
||||
sMarket(2,7) = "GB"
|
||||
sMarket(2,8) = "809"
|
||||
sMarket(2,9) = "44"
|
||||
sMarket(2,10) = "1"
|
||||
|
||||
sMarket(3,0) = "日元"
|
||||
sMarket(3,1) = "¥"
|
||||
sMarket(3,2) = "东京"
|
||||
sMarket(3,3) = ""
|
||||
sMarket(3,5) = "代码"
|
||||
sMarket(3,6) = "ja"
|
||||
sMarket(3,7) = "JP"
|
||||
sMarket(3,8) = "411"
|
||||
sMarket(3,9) = ""
|
||||
sMarket(3,10) = ""
|
||||
|
||||
sMarket(4,0) = "港币"
|
||||
sMarket(4,1) = "HK$"
|
||||
sMarket(4,2) = "香港"
|
||||
sMarket(4,3) = "http://hk.finance.yahoo.com/d/quotes.csv?s=<StockID>.HK&f=sl1d1t1c1ohgv&e=.csv"
|
||||
sMarket(4,5) = "编号"
|
||||
sMarket(4,6) = "zh"
|
||||
sMarket(4,7) = "HK"
|
||||
sMarket(4,8) = "C04"
|
||||
sMarket(4,9) = "44"
|
||||
sMarket(4,10) = "1"
|
||||
|
||||
sMarket(5,0) = "澳元"
|
||||
sMarket(5,1) = "$"
|
||||
sMarket(5,2) = "悉尼"
|
||||
sMarket(5,3) = "http://au.finance.yahoo.com/d/quotes.csv?s=<StockID>&f=sl1d1t1c1ohgv&e=.csv"
|
||||
sMarket(5,5) = "股票代码"
|
||||
sMarket(5,6) = "en"
|
||||
sMarket(5,7) = "AU"
|
||||
sMarket(5,8) = "C09"
|
||||
sMarket(5,9) = "44"
|
||||
sMarket(5,10) = "1"
|
||||
|
||||
' ****************************End of the default subset*********************************
|
||||
CompleteMarketList()
|
||||
|
||||
LocalizedCurrencies()
|
||||
|
||||
With TransactModel
|
||||
.lblStockNames.Label = sStockname
|
||||
.lblQuantity.Label = "数量"
|
||||
.lblRate.Label = "股票牌价"
|
||||
.lblDate.Label = "交易日期"
|
||||
.hlnCommission.Label = "其它支出费用"
|
||||
.lblCommission.Label = "手续费"
|
||||
.lblMinimum.Label = "最低手续费"
|
||||
.lblFix.Label = "固定金额/费用"
|
||||
.cmdGoOn.Label = sOK
|
||||
.cmdCancel.Label = sCancel
|
||||
End With
|
||||
|
||||
With StockRatesModel
|
||||
.optPerShare.Label = "每股红利"
|
||||
.optTotal.Label = "红利总计"
|
||||
.lblDividend.Label = "金额"
|
||||
.lblExchangeRate.Label = "兑换率(旧->新)"
|
||||
.lblColon.Label = ":"
|
||||
.lblDate.Label = "兑换日期:"
|
||||
.lblStockNames.Label = sStockname
|
||||
.lblStartDate.Label = sStartDate
|
||||
.lblEndDate.Label = sEndDate
|
||||
.optDaily.Label = "每天"
|
||||
.optWeekly.Label = "每周"
|
||||
.hlnInterval.Label = "时间周期"
|
||||
.cmdGoOn.Label = sOk
|
||||
.cmdCancel.Label = sCancel
|
||||
End With
|
||||
End Sub
|
||||
</script:module>
|
||||
@@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
|
||||
<library:library xmlns:library="http://openoffice.org/2000/library" library:name="Depot" library:readonly="true" library:passwordprotected="false">
|
||||
<library:element library:name="Dialog2"/>
|
||||
<library:element library:name="Dialog3"/>
|
||||
<library:element library:name="Dialog4"/>
|
||||
</library:library>
|
||||
19
office-plugin/windows-office/share/basic/Depot/script.xlb
Normal file
19
office-plugin/windows-office/share/basic/Depot/script.xlb
Normal file
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
|
||||
<library:library xmlns:library="http://openoffice.org/2000/library" library:name="Depot" library:readonly="true" library:passwordprotected="false">
|
||||
<library:element library:name="Depot"/>
|
||||
<library:element library:name="CommonLang"/>
|
||||
<library:element library:name="Currency"/>
|
||||
<library:element library:name="Internet"/>
|
||||
<library:element library:name="Lang_de"/>
|
||||
<library:element library:name="tools"/>
|
||||
<library:element library:name="Lang_en"/>
|
||||
<library:element library:name="Lang_fr"/>
|
||||
<library:element library:name="Lang_it"/>
|
||||
<library:element library:name="Lang_es"/>
|
||||
<library:element library:name="Lang_sv"/>
|
||||
<library:element library:name="Lang_zh"/>
|
||||
<library:element library:name="Lang_tw"/>
|
||||
<library:element library:name="Lang_ko"/>
|
||||
<library:element library:name="Lang_ja"/>
|
||||
</library:library>
|
||||
220
office-plugin/windows-office/share/basic/Depot/tools.xba
Normal file
220
office-plugin/windows-office/share/basic/Depot/tools.xba
Normal file
@@ -0,0 +1,220 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
|
||||
<!--***********************************************************
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
***********************************************************-->
|
||||
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="tools" script:language="StarBasic">REM ***** BASIC *****
|
||||
Option Explicit
|
||||
|
||||
Sub RemoveSheet()
|
||||
If oSheets.HasbyName("Link") then
|
||||
oSheets.RemovebyName("Link")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Sub InitializeStatusLine(StatusText as String, MaxValue as Integer, FirstValue as Integer)
|
||||
oStatusline = oDocument.GetCurrentController.GetFrame.CreateStatusIndicator()
|
||||
oStatusLine.Start(StatusText, MaxValue)
|
||||
oStatusline.SetValue(FirstValue)
|
||||
End Sub
|
||||
|
||||
|
||||
Sub MakeRangeVisible(oSheet as Object, RangeName as String, BIsVisible as Boolean)
|
||||
Dim oRangeAddress, oColumns as Object
|
||||
Dim i, iStartColumn, iEndColumn as Integer
|
||||
oRangeAddress = oSheet.GetCellRangeByName(RangeName).RangeAddress
|
||||
iStartColumn = oRangeAddress.StartColumn
|
||||
iEndColumn = oRangeAddress.EndColumn
|
||||
oColumns = oSheet.Columns
|
||||
For i = iStartColumn To iEndColumn
|
||||
oSheet.Columns(i).IsVisible = bIsVisible
|
||||
Next i
|
||||
End Sub
|
||||
|
||||
|
||||
Function GetRowIndex(oSheet as Object, RowName as String)
|
||||
Dim oRange as Object
|
||||
oRange = oSheet.GetCellRangeByName(RowName)
|
||||
GetRowIndex = oRange.RangeAddress.StartRow
|
||||
End Function
|
||||
|
||||
|
||||
Function GetTransactionCount(iStartRow as Integer)
|
||||
Dim iEndRow as Integer
|
||||
iStartRow = GetRowIndex(oMovementSheet, "ColumnsToHide")
|
||||
iEndRow = GetRowIndex(oMovementSheet, "HiddenRow3" )
|
||||
GetTransactionCount = iEndRow -iStartRow - 2
|
||||
End Function
|
||||
|
||||
|
||||
Function GetStocksCount(iStartRow as Integer)
|
||||
Dim iEndRow as Integer
|
||||
iStartRow = GetRowIndex(oFirstSheet, "HiddenRow1")
|
||||
iEndRow = GetRowIndex(oFirstSheet, "HiddenRow2")
|
||||
GetStocksCount = iEndRow -iStartRow - 1
|
||||
End Function
|
||||
|
||||
|
||||
Function FillListbox(ListboxControl as Object, MsgTitle as String, bShowMessage) as Boolean
|
||||
Dim i, StocksCount as Integer
|
||||
Dim iStartRow as Integer
|
||||
Dim oCell as Object
|
||||
' Add stock names to empty list box
|
||||
StocksCount = GetStocksCount(iStartRow)
|
||||
If StocksCount > 0 Then
|
||||
ListboxControl.Model.StringItemList() = NullList()
|
||||
For i = 1 To StocksCount
|
||||
oCell = oFirstSheet.GetCellByPosition(SBCOLUMNNAME1,iStartRow + i)
|
||||
ListboxControl.AddItem(oCell.String, i-1)
|
||||
Next
|
||||
FillListbox() = True
|
||||
Else
|
||||
If bShowMessage Then
|
||||
Msgbox(sInsertStockName, 16, MsgTitle)
|
||||
FillListbox() = False
|
||||
End If
|
||||
End If
|
||||
End Function
|
||||
|
||||
|
||||
Sub CellValuetoControl(oSheet, oControl as Object, CellName as String)
|
||||
Dim oCell as Object
|
||||
Dim StringValue
|
||||
oCell = GetCellByName(oSheet, CellName)
|
||||
If oControl.PropertySetInfo.HasPropertyByName("EffectiveValue") Then
|
||||
oControl.EffectiveValue = oCell.Value
|
||||
Else
|
||||
oControl.Value = oCell.Value
|
||||
End If
|
||||
' If oCell.FormulaResultType = 1 Then
|
||||
' StringValue = oNumberFormatter.GetInputString(oCell.NumberFormat, oCell.Value)
|
||||
' oControl.Text = DeleteStr(StringValue, "%")
|
||||
' Else
|
||||
' oControl.Text = oCell.String
|
||||
' End If
|
||||
End Sub
|
||||
|
||||
|
||||
Sub RemoveStockRows(oSheet as Object, iStartRow, RowCount as Integer)
|
||||
If RowCount > 0 Then
|
||||
oSheet.Rows.RemoveByIndex(iStartRow, RowCount)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Sub AddValueToCellContent(iCellCol, iCellRow as Integer, AddValue)
|
||||
Dim oCell as Object
|
||||
Dim OldValue
|
||||
oCell = oMovementSheet.GetCellByPosition(iCellCol, iCellRow)
|
||||
OldValue = oCell.Value
|
||||
oCell.Value = OldValue + AddValue
|
||||
End Sub
|
||||
|
||||
|
||||
Sub CheckInputDate(aEvent as Object)
|
||||
Dim oRefDialog as Object
|
||||
Dim oRefModel as Object
|
||||
Dim oDateModel as Object
|
||||
oDateModel = aEvent.Source.Model
|
||||
oRefModel = DlgReference.GetControl("cmdGoOn").Model
|
||||
oRefModel.Enabled = oDateModel.Date <> 0
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
' Updates the cell with the CurrentValue after checking if the
|
||||
' Newdate is later than the one that is refered to in the annotation
|
||||
' of the cell
|
||||
Sub InsertCurrentValue(CurValue as Double, iRow as Integer, Newdate as Date)
|
||||
Dim oCell as Object
|
||||
Dim OldDate as Date
|
||||
oCell = oFirstSheet.GetCellByPosition(SBCOLUMNRATE1, iRow)
|
||||
OldDate = CDate(oCell.Annotation.Text.String)
|
||||
If NewDate >= OldDate Then
|
||||
oCell.SetValue(CurValue)
|
||||
oCell.Annotation.Text.SetString(CStr(NewDate))
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Sub SplitCellValue(oSheet, FirstNumber, SecondNumber, iCol, iRow, NoteText)
|
||||
Dim oCell as Object
|
||||
Dim OldValue
|
||||
oCell = oSheet.GetCellByPosition(iCol, iRow)
|
||||
OldValue = oCell.Value
|
||||
oCell.Value = OldValue * FirstNumber / SecondNumber
|
||||
If NoteText <> "" Then
|
||||
oCell.Annotation.SetString(NoteText)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Function GetStockRowIndex(ByVal Stockname) as Integer
|
||||
Dim i, StocksCount as Integer
|
||||
Dim iStartRow as Integer
|
||||
Dim oCell as Object
|
||||
StocksCount = GetStocksCount(iStartRow)
|
||||
For i = 1 To StocksCount
|
||||
oCell = oFirstSheet.GetCellByPosition(SBCOLUMNNAME1,iStartRow + i)
|
||||
If oCell.String = Stockname Then
|
||||
GetStockRowIndex = iStartRow + i
|
||||
Exit Function
|
||||
End If
|
||||
Next
|
||||
GetStockRowIndex = -1
|
||||
End Function
|
||||
|
||||
|
||||
Function GetStockID(StockName as String, Optional iFirstRow as Integer) as String
|
||||
Dim CellStockName as String
|
||||
Dim i as Integer
|
||||
Dim iCount as Integer
|
||||
Dim iLastRow as Integer
|
||||
If IsMissing(iFirstRow) Then
|
||||
iFirstRow = GetRowIndex(oFirstSheet, "HiddenRow1")
|
||||
End If
|
||||
iCount = GetStocksCount(iFirstRow)
|
||||
iLastRow = iFirstRow + iCount
|
||||
For i = iFirstRow To iLastRow
|
||||
CellStockName = oFirstSheet.GetCellByPosition(SBCOLUMNNAME1, i).String
|
||||
If CellStockname = StockName Then
|
||||
Exit For
|
||||
End If
|
||||
Next i
|
||||
If i > iLastRow Then
|
||||
GetStockID() = ""
|
||||
Else
|
||||
If Not IsMissing(iFirstRow) Then
|
||||
iFirstRow = i
|
||||
End If
|
||||
GetStockID() = oFirstSheet.GetCellByPosition(SBCOLUMNID1, i).String
|
||||
End If
|
||||
End Function
|
||||
|
||||
|
||||
Function CheckDocLocale(LocLanguage as String, LocCountry as String)
|
||||
Dim bIsDocLanguage as Boolean
|
||||
Dim bIsDocCountry as Boolean
|
||||
bIsDocLanguage = Instr(1, LocLanguage, sDocLanguage, SBBINARY) <> 0
|
||||
bIsDocCountry = Instr(1, LocCountry, sDocCountry, SBBINARY) <> 0 OR SDocCountry = ""
|
||||
CheckDocLocale = (bIsDocLanguage And bIsDocCountry)
|
||||
End Function
|
||||
</script:module>
|
||||
434
office-plugin/windows-office/share/basic/Euro/AutoPilotRun.xba
Normal file
434
office-plugin/windows-office/share/basic/Euro/AutoPilotRun.xba
Normal file
@@ -0,0 +1,434 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
|
||||
<!--***********************************************************
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
***********************************************************-->
|
||||
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="AutoPilotRun" script:language="StarBasic">Option Explicit
|
||||
|
||||
Public SourceDir as String
|
||||
Public TargetDir as String
|
||||
Public TargetStemDir as String
|
||||
Public SourceFile as String
|
||||
Public TargetFile as String
|
||||
Public Source as String
|
||||
Public SubstFile as String
|
||||
Public SubstDir as String
|
||||
Public NoArgs()
|
||||
Public TypeList(14) as String
|
||||
Public GoOn as Boolean
|
||||
Public DoUnprotect as Integer
|
||||
Public Password as String
|
||||
Public DocIndex as Integer
|
||||
Public oPathSettings as Object
|
||||
Public oUcb as Object
|
||||
Public TotDocCount as Integer
|
||||
Public sTotDocCount as String
|
||||
Public OpenProperties(1) as New com.sun.star.beans.PropertyValue
|
||||
|
||||
|
||||
Sub StartAutoPilot()
|
||||
Dim i As Integer
|
||||
Dim oFactoryKey as Object
|
||||
BasicLibraries.LoadLibrary("Tools")
|
||||
BasicLibraries.LoadLibrary("ImportWizard")
|
||||
If InitResources("Euro Converter", "eur") Then
|
||||
oUcb = createUnoService("com.sun.star.ucb.SimpleFileAccess")
|
||||
oLocale = GetStarOfficeLocale()
|
||||
InitializeConverter(oLocale, 2)
|
||||
ToggleGoOnButton()
|
||||
oFactoryKey = GetRegistryKeyContent("org.openoffice.Setup/Office/Factories")
|
||||
DialogModel.chkTextDocuments.Enabled = oFactoryKey.hasbyName("com.sun.star.text.TextDocument")
|
||||
DialogModel.cmdGoOn.DefaultButton = True
|
||||
DialogModel.lstCurrencies.TabIndex = 12
|
||||
DialogConvert.GetControl("optWholeDir").SetFocus()
|
||||
DialogConvert.Execute()
|
||||
DialogConvert.Dispose()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Sub ConvertDocuments()
|
||||
Dim FilesList()
|
||||
Dim bDisposable as Boolean
|
||||
|
||||
If Source <> "" And TargetDir <> "" Then
|
||||
If DialogModel.optSingleFile.State = 1 Then
|
||||
SourceFile = Source
|
||||
TotDocCount = 1
|
||||
Else
|
||||
SourceDir = Source
|
||||
TargetStemDir = TargetDir
|
||||
TypeList(0) = "calc8"
|
||||
TypeList(1) = "calc_StarOffice_XML_Calc"
|
||||
TypeList(2) = "calc_StarCalc_30"
|
||||
TypeList(3) = "calc_StarCalc_40"
|
||||
TypeList(4) = "calc_StarCalc_50"
|
||||
If DialogModel.chkTextDocuments.State = 1 Then
|
||||
ReDim Preserve TypeList(13) as String
|
||||
|
||||
TypeList(5) = "writer8"
|
||||
TypeList(6) = "writerglobal8"
|
||||
TypeList(7) = "writer_StarOffice_XML_Writer"
|
||||
TypeList(8) = "writer_globaldocument_StarOffice_XML_Writer_GlobalDocument"
|
||||
TypeList(9) = "writer_StarWriter_30"
|
||||
TypeList(10) = "writer_StarWriter_40"
|
||||
TypeList(11) = "writer_globaldocument_StarWriter_40GlobalDocument"
|
||||
TypeList(12) = "writer_StarWriter_50"
|
||||
TypeList(13) = "writer_globaldocument_StarWriter_50GlobalDocument"
|
||||
End If
|
||||
FilesList() = ReadDirectories(SourceDir, bRecursive, True, False, TypeList())
|
||||
TotDocCount = Ubound(FilesList(),1) + 1
|
||||
End If
|
||||
InitializeProgressPage(DialogModel)
|
||||
' ChangeToNextProgressStep()
|
||||
sTotDocCount = CStr(TotDocCount)
|
||||
OpenProperties(0).Name = "Hidden"
|
||||
OpenProperties(0).Value = True
|
||||
OpenProperties(1).Name = "AsTemplate"
|
||||
OpenProperties(1).Value = False
|
||||
For DocIndex = 0 To TotDocCount - 1
|
||||
If InitializeDocument(FilesList(), bDisposable) Then
|
||||
If StoreDocument() Then
|
||||
ConvertDocument()
|
||||
oDocument.Store
|
||||
End If
|
||||
If bDisposable Then
|
||||
oDocument.Dispose()
|
||||
End If
|
||||
End If
|
||||
Next DocIndex
|
||||
DialogModel.cmdBack.Enabled = True
|
||||
DialogModel.cmdGoOn.Enabled = True
|
||||
DialogModel.cmdGoOn.Label = sReady
|
||||
DialogModel.cmdCancel.Label = sEnd
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Function InitializeDocument(FilesList(), bDisposable as Boolean) as Boolean
|
||||
' The Autopilot is started from step No. 2
|
||||
Dim sViewPath as String
|
||||
Dim bIsReadOnly as Boolean
|
||||
Dim sExtension as String
|
||||
On Local Error Goto NEXTFILE
|
||||
If Not bCancelTask Then
|
||||
If DialogModel.optWholeDir.State = 1 Then
|
||||
SourceFile = FilesList(DocIndex,0)
|
||||
TargetFile = ReplaceString(SourceFile,TargetStemDir,SourceDir)
|
||||
TargetDir = DirectorynameoutofPath(TargetFile, "/")
|
||||
Else
|
||||
SourceFile = Source
|
||||
TargetFile = TargetDir & "/" & FileNameoutofPath(SourceFile, "/")
|
||||
End If
|
||||
If CreateFolder(TargetDir) Then
|
||||
sExtension = GetFileNameExtension(SourceFile, "/")
|
||||
oDocument = OpenDocument(SourceFile, OpenProperties(), bDisposable)
|
||||
If (oDocument.IsReadOnly) AND (UCase(SourceFile) = UCase(TargetFile)) Then
|
||||
bIsReadOnly = True
|
||||
Msgbox(sMsgDOCISREADONLY, 16, GetProductName())
|
||||
Else
|
||||
bIsReadOnly = False
|
||||
RetrieveDocumentObjects()
|
||||
sViewPath = CutPathView(SourceFile, 60)
|
||||
DialogModel.lblCurDocument.Label = Str(DocIndex+1) & "/" & sTotDocCount & " (" & sViewPath & ")"
|
||||
End If
|
||||
InitializeDocument() = Not bIsReadOnly
|
||||
Else
|
||||
InitializeDocument() = False
|
||||
End If
|
||||
Else
|
||||
InitializeDocument() = False
|
||||
End If
|
||||
NEXTFILE:
|
||||
If Err <> 0 Then
|
||||
InitializeDocument() = False
|
||||
Resume LETSGO
|
||||
LETSGO:
|
||||
End If
|
||||
End Function
|
||||
|
||||
|
||||
Sub ChangeToNextProgressStep()
|
||||
DialogModel.lblCurProgress.FontWeight = com.sun.star.awt.FontWeight.NORMAL
|
||||
DialogConvert.GetControl("lblCurProgress").Visible = True
|
||||
End Sub
|
||||
|
||||
|
||||
Function StoreDocument() as Boolean
|
||||
Dim sCurFileExists as String
|
||||
Dim iOverWrite as Integer
|
||||
If (TargetFile <> "") And (Not bCancelTask) Then
|
||||
On Local Error Goto NOSAVING
|
||||
If oUcb.Exists(TargetFile) Then
|
||||
sCurFileExists = ReplaceString(sMsgFileExists, ConvertFromUrl(TargetFile), "<1>")
|
||||
sCurFileExists = ReplaceString(sCurFileExists, chr(13), "<CR>")
|
||||
iOverWrite = Msgbox (sCurFileExists, 32 + 3, sMsgDLGTITLE)
|
||||
Select Case iOverWrite
|
||||
Case 1 ' OK
|
||||
Case 2 ' Abort
|
||||
bCancelTask = True
|
||||
StoreDocument() = False
|
||||
Exit Function
|
||||
Case 7 ' No
|
||||
StoreDocument() = False
|
||||
Exit Function
|
||||
End Select
|
||||
End If
|
||||
If TargetFile <> SourceFile Then
|
||||
oDocument.StoreAsUrl(TargetFile,NoArgs)
|
||||
Else
|
||||
oDocument.Store
|
||||
End If
|
||||
StoreDocument() = True
|
||||
NOSAVING:
|
||||
If Err <> 0 Then
|
||||
StoreDocument() = False
|
||||
Resume CLERROR
|
||||
End If
|
||||
CLERROR:
|
||||
End If
|
||||
End Function
|
||||
|
||||
|
||||
Sub SwapExtent()
|
||||
DialogModel.chkRecursive.Enabled = DialogModel.optWholeDir.State = 1
|
||||
If DialogModel.optWholeDir.State = 1 Then
|
||||
DialogModel.lblSource.Label = sSOURCEDIR
|
||||
If Not IsNull(SubstFile) Then
|
||||
SubstFile = DialogModel.txtSource.Text
|
||||
DialogModel.txtSource.Text = SubstDir
|
||||
End If
|
||||
Else
|
||||
DialogModel.LblSource.Label = sSOURCEFILE
|
||||
If Not IsNull(SubstDir) Then
|
||||
SubstDir = DialogModel.txtSource.Text
|
||||
DialogModel.txtSource.Text = SubstFile
|
||||
End If
|
||||
End If
|
||||
ToggleGoOnButton()
|
||||
End Sub
|
||||
|
||||
|
||||
Function InitializeThirdStep() as Boolean
|
||||
Dim TextBoxText as String
|
||||
Source = AssignFileName(DialogModel.txtSource.Text, DialogModel.lblSource.Label, True)
|
||||
If CheckTextBoxPath(DialogModel.txtTarget, True, True, sMsgDLGTITLE, True) Then
|
||||
TargetDir = AssignFileName(DialogModel.txtTarget.Text, DialogModel.lblTarget.Label, False)
|
||||
Else
|
||||
TargetDir = ""
|
||||
End If
|
||||
If Source <> "" And TargetDir <> "" Then
|
||||
bRecursive = DialogModel.chkRecursive.State = 1
|
||||
bDoUnprotect = DialogModel.chkProtect.State = 1
|
||||
DialogModel.lblRetrieval.FontWeight = com.sun.star.awt.FontWeight.BOLD
|
||||
DialogModel.lblRetrieval.Label = sPrgsRETRIEVAL
|
||||
DialogModel.lblCurProgress.Label = sPrgsCONVERTING
|
||||
If DialogModel.optWholeDir.State = 1 Then
|
||||
TextBoxText = sSOURCEDIR & " " & ConvertFromUrl(Source) & chr(13)
|
||||
If DialogModel.chkRecursive.State = 1 Then
|
||||
TextBoxText = TextBoxText & DeleteStr(sInclusiveSubDir,"~") & chr(13)
|
||||
End If
|
||||
Else
|
||||
TextBoxText = sSOURCEFILE & " " & ConvertFromUrl(Source) & chr(13)
|
||||
End If
|
||||
TextBoxText = TextBoxText & sTARGETDIR & " " & ConvertFromUrl(TargetDir) & chr(13)
|
||||
If DialogModel.chkProtect.State = 1 Then
|
||||
TextBoxText = TextboxText & sPrgsUNPROTECT
|
||||
End If
|
||||
DialogModel.txtConfig.Text = TextBoxText
|
||||
ToggleProgressStep()
|
||||
DialogModel.cmdGoOn.Enabled = False
|
||||
InitializeThirdStep() = True
|
||||
Else
|
||||
InitializeThirdStep() = False
|
||||
End If
|
||||
End Function
|
||||
|
||||
|
||||
Sub ToggleProgressStep(Optional aEvent as Object)
|
||||
Dim bMakeVisible as Boolean
|
||||
Dim LocStep as Integer
|
||||
' If the Sub is call by the 'cmdBack' Button then set the 'bMakeVisible' variable accordingly
|
||||
bMakeVisible = IsMissing(aEvent)
|
||||
If bMakeVisible Then
|
||||
DialogModel.Step = 3
|
||||
Else
|
||||
DialogModel.Step = 2
|
||||
End If
|
||||
DialogConvert.GetControl("lblCurrencies").Visible = Not bMakeVisible
|
||||
DialogConvert.GetControl("lstCurrencies").Visible = Not bMakeVisible
|
||||
DialogConvert.GetControl("cmdBack").Visible = bMakeVisible
|
||||
DialogConvert.GetControl("cmdGoOn").Visible = bMakeVisible
|
||||
DialogModel.imgPreview.ImageUrl = BitmapDir & "euro_" & DialogModel.Step & ".bmp"
|
||||
End Sub
|
||||
|
||||
|
||||
Sub EnableStep2DialogControls(OnValue as Boolean)
|
||||
With DialogModel
|
||||
.hlnExtent.Enabled = OnValue
|
||||
.optWholeDir.Enabled = OnValue
|
||||
.optSingleFile.Enabled = OnValue
|
||||
.chkProtect.Enabled = OnValue
|
||||
.cmdCallSourceDialog.Enabled = OnValue
|
||||
.cmdCallTargetDialog.Enabled = OnValue
|
||||
.lblSource.Enabled = OnValue
|
||||
.lblTarget.Enabled = OnValue
|
||||
.txtSource.Enabled = OnValue
|
||||
.txtTarget.Enabled = OnValue
|
||||
.imgPreview.Enabled = OnValue
|
||||
.lstCurrencies.Enabled = OnValue
|
||||
.lblCurrencies.Enabled = OnValue
|
||||
If OnValue Then
|
||||
ToggleGoOnButton()
|
||||
.chkRecursive.Enabled = .optWholeDir.State = 1
|
||||
Else
|
||||
.cmdGoOn.Enabled = False
|
||||
.chkRecursive.Enabled = False
|
||||
End If
|
||||
End With
|
||||
End Sub
|
||||
|
||||
|
||||
Sub InitializeProgressPage()
|
||||
DialogConvert.GetControl("lblRetrieval").Visible = False
|
||||
DialogConvert.GetControl("lblCurProgress").Visible = False
|
||||
DialogModel.lblRetrieval.FontWeight = com.sun.star.awt.FontWeight.NORMAL
|
||||
DialogModel.lblCurProgress.FontWeight = com.sun.star.awt.FontWeight.BOLD
|
||||
DialogConvert.GetControl("lblRetrieval").Visible = True
|
||||
DialogConvert.GetControl("lblCurProgress").Visible = True
|
||||
End Sub
|
||||
|
||||
|
||||
Function AssignFileName(sPath as String, ByVal HeaderString, bCheckFileType as Boolean) as String
|
||||
Dim bIsValid as Boolean
|
||||
Dim sLocMimeType as String
|
||||
Dim sNoDirMessage as String
|
||||
HeaderString = DeleteStr(HeaderString, ":")
|
||||
sPath = ConvertToUrl(Trim(sPath))
|
||||
bIsValid = oUcb.Exists(sPath)
|
||||
If bIsValid Then
|
||||
If DialogModel.optSingleFile.State = 1 Then
|
||||
If bCheckFileType Then
|
||||
sLocMimeType = GetRealFileContent(sPath)
|
||||
If DialogModel.chkTextDocuments.State = 1 Then
|
||||
If (Instr(1, sLocMimeType, "text") = 0) And (Instr(1, sLocMimeType, "calc") = 0) Then
|
||||
Msgbox(sMsgFileInvalid, 48, sMsgDLGTITLE)
|
||||
bIsValid = False
|
||||
End If
|
||||
Else
|
||||
If (Instr(1, sLocMimeType, "spreadsheet") = 0) And (Instr(1, sLocMimeType, "calc")) = 0 Then
|
||||
Msgbox(sMsgFileInvalid, 48, sMsgDLGTITLE)
|
||||
bIsValid = False
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
If Not oUcb.IsFolder(sPath) Then
|
||||
sNoDirMessage = ReplaceString(sMsgNODIRECTORY,sPath,"<1>")
|
||||
Msgbox(sNoDirMessage,48, sMsgDLGTITLE)
|
||||
bIsValid = False
|
||||
Else
|
||||
sPath = RTrimStr(sPath,"/")
|
||||
sPath = sPath & "/"
|
||||
End If
|
||||
End if
|
||||
Else
|
||||
Msgbox(HeaderString & " '" & ConvertFromUrl(sPath) & "' " & sMsgNOTTHERE,48, sMsgDLGTITLE)
|
||||
End If
|
||||
If bIsValid Then
|
||||
AssignFileName() = sPath
|
||||
Else
|
||||
AssignFilename() = ""
|
||||
End If
|
||||
End Function
|
||||
|
||||
|
||||
Sub ToggleGoOnButton()
|
||||
Dim bDoEnable as Boolean
|
||||
Dim sLocMimeType as String
|
||||
Dim sPath as String
|
||||
bDoEnable = Ubound(DialogModel.lstCurrencies.SelectedItems()) > -1
|
||||
If bDoEnable Then
|
||||
' Check if Source is set correctly
|
||||
sPath = ConvertToUrl(Trim(DialogModel.txtSource.Text))
|
||||
bDoEnable = oUcb.Exists(sPath)
|
||||
End If
|
||||
DialogModel.cmdGoOn.Enabled = bDoEnable
|
||||
End Sub
|
||||
|
||||
|
||||
Sub CallFolderPicker()
|
||||
GetFolderName(DialogModel.txtTarget)
|
||||
ToggleGoOnButton()
|
||||
End Sub
|
||||
|
||||
|
||||
Sub CallFilePicker()
|
||||
If DialogModel.optSingleFile.State = 1 Then
|
||||
Dim oMasterKey as Object
|
||||
Dim oTypes() as Object
|
||||
Dim oUIKey() as Object
|
||||
|
||||
oMasterKey = GetRegistryKeyContent("org.openoffice.TypeDetection.Types")
|
||||
oTypes() = oMasterKey.Types
|
||||
oUIKey = GetRegistryKeyContent("org.openoffice.Office.UI/FilterClassification/LocalFilters")
|
||||
If DialogModel.chkTextDocuments.State = 1 Then
|
||||
Dim FilterNames(11,1) as String
|
||||
FilterNames(6,0) = oTypes.GetByName("writer_StarOffice_XML_Writer").UIName
|
||||
FilterNames(6,1) = "*.sxw"
|
||||
FilterNames(7,0) = oTypes.GetByName("writer_StarOffice_XML_Writer_Template").UIName
|
||||
FilterNames(7,1) = "*.stw"
|
||||
FilterNames(8,0) = oUIKey.Classes.GetByName("sw3to5").DisplayName
|
||||
FilterNames(8,1) = "*.sdw"
|
||||
FilterNames(9,0) = oUIKey.Classes.GetByName("sw3to5templ").DisplayName
|
||||
Filternames(9,1) = "*.vor"
|
||||
FilterNames(10,0) = oTypes.GetByName("writer8").UIName
|
||||
FilterNames(10,1) = "*.odt"
|
||||
FilterNames(11,0) = oTypes.GetByName("writer8_template").UIName
|
||||
FilterNames(11,1) = "*.ott"
|
||||
Else
|
||||
ReDim FilterNames(5,1) as String
|
||||
End If
|
||||
FilterNames(0,0) = oTypes.GetByName("calc_StarOffice_XML_Calc").UIName
|
||||
Filternames(0,1) = "*.sxc"
|
||||
FilterNames(1,0) = oTypes.GetByName("calc_StarOffice_XML_Calc_Template").UIName
|
||||
Filternames(1,1) = "*.stc"
|
||||
FilterNames(2,0) = oUIKey.Classes.GetByName("sc345").DisplayName
|
||||
FilterNames(2,1) = "*.sdc"
|
||||
FilterNames(3,0) = oUIKey.Classes.GetByName("sc345templ").DisplayName
|
||||
Filternames(3,1) = "*.vor"
|
||||
FilterNames(4,0) = oTypes.GetByName("calc8").UIName
|
||||
Filternames(4,1) = "*.ods"
|
||||
FilterNames(5,0) = oTypes.GetByName("calc8_template").UIName
|
||||
Filternames(5,1) = "*.ots"
|
||||
GetFileName(DialogModel.txtSource, Filternames())
|
||||
Else
|
||||
GetFolderName(DialogModel.txtSource)
|
||||
End If
|
||||
ToggleGoOnButton()
|
||||
End Sub
|
||||
|
||||
|
||||
Sub PreviousStep()
|
||||
DialogModel.Step = 2
|
||||
DialogModel.cmdGoOn.Label = sGOON
|
||||
DialogModel.cmdCancel.Label = sCANCEL
|
||||
End Sub
|
||||
</script:module>
|
||||
292
office-plugin/windows-office/share/basic/Euro/Common.xba
Normal file
292
office-plugin/windows-office/share/basic/Euro/Common.xba
Normal file
@@ -0,0 +1,292 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
|
||||
<!--***********************************************************
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
***********************************************************-->
|
||||
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Common" script:language="StarBasic"> REM ***** BASIC *****
|
||||
Public DialogModel as Object
|
||||
Public DialogConvert as Object
|
||||
Public DialogPassword as Object
|
||||
Public PasswordModel as Object
|
||||
|
||||
Sub RetrieveDocumentObjects()
|
||||
CurMimeType = Tools.GetDocumentType(oDocument)
|
||||
If Instr(1, CurMimeType, "calc") <> 0 Then
|
||||
oSheets = oDocument.Sheets
|
||||
oSheet = oDocument.Sheets.GetbyIndex(0)
|
||||
oAddressRanges = oDocument.createInstance("com.sun.star.sheet.SheetCellRanges")
|
||||
End If
|
||||
' Retrieve the indices for the cellformatations
|
||||
oFormats = oDocument.NumberFormats
|
||||
End Sub
|
||||
|
||||
|
||||
Sub CancelTask()
|
||||
' If Not DocDisposed Then
|
||||
' ReprotectSheets()
|
||||
' End If
|
||||
If DialogModel.Step = 3 And (Not bCancelTask) Then
|
||||
If Msgbox(sMsgCancelConversion, 36, sMsgCancelTitle) = 6 Then
|
||||
bCancelTask = True
|
||||
DialogConvert.EndExecute
|
||||
Else
|
||||
bCancelTask = False
|
||||
End If
|
||||
Else
|
||||
DialogConvert.EndExecute()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Function ConvertDocument()
|
||||
GoOn = True
|
||||
' DocDisposed = True
|
||||
InitializeProgressbar()
|
||||
If Instr(1, CurMimeType, "calc") <> 0 Then
|
||||
bDocHasProtectedSheets = CheckSheetProtection(oSheets)
|
||||
If bDocHasProtectedSheets Then
|
||||
bDocHasProtectedSheets = UnprotectSheetsWithPassword(oSheets, bDoUnProtect)
|
||||
End If
|
||||
If Not bDocHasProtectedSheets Then
|
||||
If Not bRangeListDefined Then
|
||||
TotCellCount = 0
|
||||
CreateRangeEnumeration(True)
|
||||
Else
|
||||
IncreaseStatusvalue(SBRelGet/3)
|
||||
End If
|
||||
RangeIndex = Ubound(RangeList())
|
||||
If RangeIndex > -1 Then
|
||||
ConvertThehardWay(RangeList(), True, False)
|
||||
MakeStyleEnumeration(True)
|
||||
oDocument.calculateAll()
|
||||
End If
|
||||
ReprotectSheets()
|
||||
bRangeListDefined = False
|
||||
End If
|
||||
Else
|
||||
DialogModel.ProgressBar.ProgressValue = 10 ' oStatusline.SetValue(10)
|
||||
ConvertTextFields()
|
||||
DialogModel.ProgressBar.ProgressValue = 80 ' oStatusline.SetValue(80)
|
||||
ConvertWriterTables()
|
||||
End If
|
||||
EndStatusLine()
|
||||
On Local Error Goto 0
|
||||
End Function
|
||||
|
||||
|
||||
Sub SwitchNumberFormat(oObject as Object, oFormats as object)
|
||||
Dim nFormatLanguage as Integer
|
||||
Dim nFormatDecimals as Integer
|
||||
Dim nFormatLeading as Integer
|
||||
Dim bFormatLeading as Integer
|
||||
Dim bFormatNegRed as Integer
|
||||
Dim bFormatThousands as Integer
|
||||
Dim i as Integer
|
||||
Dim aNewStr as String
|
||||
Dim iNumberFormat as Long
|
||||
Dim AddToList as Boolean
|
||||
Dim sOldCurrSymbol as String
|
||||
On Local Error Resume Next
|
||||
iNumberFormat = oObject.NumberFormat
|
||||
On Local Error GoTo NOKEY
|
||||
aFormat() = oFormats.getByKey(iNumberFormat)
|
||||
On Local Error GoTo 0
|
||||
sOldCurrSymbol = aFormat.CurrencySymbol
|
||||
If sOldCurrSymbol = CurrValue(CurrIndex,5) Then
|
||||
aSimpleStr = "0 [$EUR]"
|
||||
Else
|
||||
aSimpleStr = "0 [$" & sEuroSign & aFormat.CurrencyExtension & "]"
|
||||
End If
|
||||
|
||||
nSimpleKey = Numberformat(oFormats, aSimpleStr, oLocale)
|
||||
' set new Currency format with according settings
|
||||
nFormatDecimals = 2
|
||||
nFormatLeading = aFormat.LeadingZeros
|
||||
bFormatNegRed = aFormat.NegativeRed
|
||||
bFormatThousands = aFormat.ThousandsSeparator
|
||||
aNewStr = oFormats.generateFormat( nSimpleKey, aFormat.Locale, bFormatThousands, bFormatNegRed, nFormatDecimals, nFormatLeading)
|
||||
oObject.NumberFormat = Numberformat(oFormats, aNewStr, aFormat.Locale)
|
||||
NOKEY:
|
||||
If Err <> 0 Then
|
||||
Resume CLERROR
|
||||
End If
|
||||
CLERROR:
|
||||
End Sub
|
||||
|
||||
|
||||
Function Numberformat( oFormats as Object, aFormatStr as String, oLocale as Object)
|
||||
Dim nRetkey
|
||||
Dim l as String
|
||||
Dim c as String
|
||||
nRetKey = oFormats.queryKey( aFormatStr, oLocale, True )
|
||||
If nRetKey = -1 Then
|
||||
l = oLocale.Language
|
||||
c = oLocale.Country
|
||||
nRetKey = oFormats.addNew( aFormatStr, oLocale )
|
||||
If nRetKey = -1 Then nRetKey = 0
|
||||
End If
|
||||
Numberformat = nRetKey
|
||||
End Function
|
||||
|
||||
|
||||
Function CheckFormatType( FormatObject as object)
|
||||
Dim i as Integer
|
||||
Dim LocCurrIndex as Integer
|
||||
Dim nFormatFormatString as String
|
||||
Dim FormatLangID as Integer
|
||||
Dim sFormatCurrExt as String
|
||||
Dim oFormatofObject() as Object
|
||||
|
||||
' Retrieve the Format of the Object
|
||||
On Local Error GoTo NOKEY
|
||||
oFormatofObject = oFormats.getByKey(FormatObject.NumberFormat)
|
||||
On Local Error GoTo 0
|
||||
If NOT INT(oFormatofObject.Type) AND com.sun.star.util.NumberFormat.CURRENCY Then
|
||||
CheckFormatType = False
|
||||
Exit Function
|
||||
End If
|
||||
If FieldinArray(CurrSymbolList(),2,oFormatofObject.CurrencySymbol) Then
|
||||
' If the Currencysymbol of the object ist the one needed, then check the Currency extension
|
||||
sFormatCurrExt = oFormatofObject.CurrencyExtension
|
||||
|
||||
If FieldInList(CurExtension(),2,sFormatCurrExt) Then
|
||||
' The Currency - extension also fits
|
||||
CheckFormatType = True
|
||||
Else
|
||||
' The Currency - symbol is Euro-conforming (like 'DEM'), so there is no Currency-Extension
|
||||
CheckFormatType = oFormatofObject.CurrencySymbol = CurrsymbolList(2)
|
||||
End If
|
||||
Else
|
||||
' The Currency Symbol of the object is not the desired one
|
||||
If oFormatofObject.CurrencySymbol = "" Then
|
||||
' Format is "automatic"
|
||||
CheckFormatType = CheckLocale(oFormatofObject.Locale)
|
||||
Else
|
||||
CheckFormatType = False
|
||||
End If
|
||||
End If
|
||||
|
||||
NOKEY:
|
||||
If Err <> 0 Then
|
||||
CheckFormatType = False
|
||||
Resume CLERROR
|
||||
End If
|
||||
CLERROR:
|
||||
End Function
|
||||
|
||||
|
||||
Sub StartConversion()
|
||||
GoOn = True
|
||||
Select Case DialogModel.Step
|
||||
Case 1
|
||||
If DialogModel.chkComplete.State = 1 Then
|
||||
ConvertWholeDocument()
|
||||
Else
|
||||
ConvertRangesorStylesofDocument()
|
||||
End If
|
||||
Case 2
|
||||
bCancelTask = False
|
||||
If InitializeThirdStep() Then
|
||||
ConvertDocuments()
|
||||
bCancelTask = True
|
||||
End If
|
||||
Case 3
|
||||
DialogConvert.EndExecute()
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
|
||||
Sub IncreaseStatusValue(AddStatusValue as Integer)
|
||||
StatusValue = Int(StatusValue + AddStatusValue)
|
||||
If DialogModel.Step = 3 Then
|
||||
DialogModel.ProgressBar.ProgressValue = StatusValue
|
||||
Else
|
||||
oStatusline.SetValue(StatusValue)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Sub SelectCurrency()
|
||||
Dim AddtoList as Boolean
|
||||
Dim NullList()
|
||||
Dim OldCurrIndex as Integer
|
||||
bRangeListDefined = False
|
||||
OldCurrIndex = CurrIndex
|
||||
CurrIndex = DialogModel.lstCurrencies.SelectedItems(0)
|
||||
If OldCurrIndex <> CurrIndex Then
|
||||
InitializeCurrencyValues(CurrIndex)
|
||||
CurExtension(0) = LangIDValue(CurrIndex,0,2)
|
||||
CurExtension(1) = LangIDValue(CurrIndex,1,2)
|
||||
CurExtension(2) = LangIDValue(CurrIndex,2,2)
|
||||
If DialogModel.Step = 1 Then
|
||||
EnableStep1DialogControls(False,False, False)
|
||||
If DialogModel.optCellTemplates.State = 1 Then
|
||||
EnableStep1DialogControls(False, False, False)
|
||||
CreateStyleEnumeration()
|
||||
ElseIf ((DialogModel.optSheetRanges.State = 1) OR (DialogModel.optDocRanges.State = 1)) AND (DialogModel.Step = 1) Then
|
||||
CreateRangeEnumeration(False)
|
||||
If Ubound(RangeList()) = -1 Then
|
||||
DialogModel.lstSelection.StringItemList() = NullList()
|
||||
End If
|
||||
ElseIf DialogModel.optSelRange.State= 1 Then
|
||||
'Preselected Range
|
||||
End If
|
||||
EnableStep1DialogControls(True, True, True)
|
||||
ElseIf DialogModel.Step = 2 Then
|
||||
EnableStep2DialogControls(True)
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Sub FillUpCurrencyListbox()
|
||||
Dim i as Integer
|
||||
Dim MaxIndex as Integer
|
||||
MaxIndex = Ubound(CurrValue(),1)
|
||||
Dim LocList(MaxIndex) as String
|
||||
For i = 0 To MaxIndex
|
||||
LocList(i) = CurrValue(i,0)
|
||||
Next i
|
||||
DialogModel.lstCurrencies.StringItemList() = LocList()
|
||||
If CurrIndex > -1 Then
|
||||
SelectListboxItem(DialogModel.lstCurrencies, CurrIndex)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Sub InitializeProgressbar()
|
||||
CurCellCount = 0
|
||||
If Not IsNull(oStatusLine) Then
|
||||
oStatusline.Start(sStsPROGRESS, 100)
|
||||
Else
|
||||
DialogModel.ProgressBar.ProgressValue = 0
|
||||
End If
|
||||
StatusValue = 0
|
||||
End Sub
|
||||
|
||||
|
||||
Sub EndStatusLine()
|
||||
If Not IsNull(oStatusLine) Then
|
||||
oStatusline.End
|
||||
Else
|
||||
DialogModel.ProgressBar.ProgressValue = 100
|
||||
End If
|
||||
End Sub
|
||||
</script:module>
|
||||
337
office-plugin/windows-office/share/basic/Euro/ConvertRun.xba
Normal file
337
office-plugin/windows-office/share/basic/Euro/ConvertRun.xba
Normal file
@@ -0,0 +1,337 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
|
||||
<!--***********************************************************
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
***********************************************************-->
|
||||
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="ConvertRun" script:language="StarBasic">Option Explicit
|
||||
|
||||
Public oPreSelRange as Object
|
||||
|
||||
Sub Main()
|
||||
BasicLibraries.LoadLibrary("Tools")
|
||||
If InitResources("Euro Converter", "eur") Then
|
||||
bDoUnProtect = False
|
||||
bPreSelected = True
|
||||
oDocument = ThisComponent
|
||||
RetrieveDocumentObjects() ' Statusline, SheetsCollection etc.
|
||||
InitializeConverter(oDocument.CharLocale, 1)
|
||||
GetPreSelectedRange()
|
||||
If GoOn Then
|
||||
DialogModel.lstCurrencies.TabIndex = 2
|
||||
DialogConvert.GetControl("chkComplete").SetFocus()
|
||||
DialogConvert.Execute
|
||||
End If
|
||||
DialogConvert.Dispose
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Sub SelectListItem()
|
||||
Dim Listbox as Object
|
||||
Dim oListSheet as Object
|
||||
Dim CurStyleName as String
|
||||
Dim oCursheet as Object
|
||||
Dim oTempRanges as Object
|
||||
Dim sCurSheetName as String
|
||||
Dim RangeName as String
|
||||
Dim oSheetRanges as Object
|
||||
Dim ListIndex as Integer
|
||||
Dim a as Integer
|
||||
Dim i as Integer
|
||||
Dim n as Integer
|
||||
Dim m as Integer
|
||||
Dim MaxIndex as Integer
|
||||
Listbox = DialogModel.lstSelection
|
||||
If Ubound(Listbox.SelectedItems()) > -1 Then
|
||||
EnableStep1DialogControls(False, False, False)
|
||||
oSelRanges = oDocument.createInstance("com.sun.star.sheet.SheetCellRanges")
|
||||
|
||||
' Is the sheet the basis, then the sheetobject has to be created
|
||||
If DialogModel.optDocRanges.State = 1 Then
|
||||
' Document is the basis for the conversion
|
||||
ListIndex = Listbox.SelectedItems(0)
|
||||
oCurSheet = RetrieveSheetoutofRangeName(Listbox.StringItemList(ListIndex))
|
||||
oDocument.CurrentController.SetActiveSheet(oCurSheet)
|
||||
Else
|
||||
oCurSheet = oDocument.CurrentController.ActiveSheet
|
||||
End If
|
||||
sCurSheetName = oCurSheet.Name
|
||||
If DialogModel.optCellTemplates.State = 1 Then
|
||||
Dim CurIndex as Integer
|
||||
For i = 0 To Ubound(Listbox.SelectedItems())
|
||||
CurIndex = Listbox.SelectedItems(i)
|
||||
CurStylename = Listbox.StringItemList(CurIndex)
|
||||
oSheetRanges = oCursheet.CellFormatRanges.createEnumeration
|
||||
While oSheetRanges.hasMoreElements
|
||||
oRange = oSheetRanges.NextElement
|
||||
If oRange.getPropertyState("NumberFormat") = 1 Then
|
||||
If oRange.CellStyle = CurStyleName Then
|
||||
oSelRanges.InsertbyName("",oRange)
|
||||
End If
|
||||
End If
|
||||
Wend
|
||||
Next i
|
||||
Else
|
||||
' Hard Formatation is selected
|
||||
a = -1
|
||||
For n = 0 To Ubound(Listbox.SelectedItems())
|
||||
m = Listbox.SelectedItems(n)
|
||||
RangeName = Listbox.StringItemList(m)
|
||||
oListSheet = RetrieveSheetoutofRangeName(RangeName)
|
||||
a = a + 1
|
||||
MaxIndex = Ubound(SelRangeList())
|
||||
If a > MaxIndex Then
|
||||
Redim Preserve SelRangeList(MaxIndex + SBRANGEUBOUND)
|
||||
End If
|
||||
SelRangeList(a) = RangeName
|
||||
If oListSheet.Name = sCurSheetName Then
|
||||
oRange = RetrieveRangeoutofRangeName(RangeName)
|
||||
oSelRanges.InsertbyName("",oRange)
|
||||
End If
|
||||
Next n
|
||||
End If
|
||||
If a > -1 Then
|
||||
ReDim Preserve SelRangeList(a)
|
||||
Else
|
||||
ReDim SelRangeList()
|
||||
End If
|
||||
oDocument.CurrentController.Select(oSelRanges)
|
||||
EnableStep1DialogControls(True, True, True)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
' Procedure that is called by an event
|
||||
Sub RetrieveEnableValue()
|
||||
Dim EnableValue as Boolean
|
||||
EnableValue = Not DialogModel.lstSelection.Enabled
|
||||
EnableStep1DialogControls(True, EnableValue, True)
|
||||
End Sub
|
||||
|
||||
|
||||
Sub EnableStep1DialogControls(bCurrEnabled as Boolean, bFrameEnabled as Boolean, bButtonsEnabled as Boolean)
|
||||
Dim bCurrIsSelected as Boolean
|
||||
Dim bObjectIsSelected as Boolean
|
||||
Dim bConvertWholeDoc as Boolean
|
||||
Dim bDoEnableFrame as Boolean
|
||||
bConvertWholeDoc = DialogModel.chkComplete.State = 1
|
||||
bDoEnableFrame = bFrameEnabled And (NOT bConvertWholeDoc)
|
||||
|
||||
' Controls around the Selection Listbox
|
||||
With DialogModel
|
||||
.lblCurrencies.Enabled = bCurrEnabled
|
||||
.lstCurrencies.Enabled = bCurrEnabled
|
||||
.lstSelection.Enabled = bDoEnableFrame
|
||||
.lblSelection.Enabled = bDoEnableFrame
|
||||
.hlnSelection.Enabled = bDoEnableFrame
|
||||
.optCellTemplates.Enabled = bDoEnableFrame
|
||||
.optSheetRanges.Enabled = bDoEnableFrame
|
||||
.optDocRanges.Enabled = bDoEnableFrame
|
||||
.optSelRange.Enabled = bDoEnableFrame
|
||||
End With
|
||||
' The CheckBox has the Value '1' when the Controls in the Frame are disabled
|
||||
If bButtonsEnabled Then
|
||||
bCurrIsSelected = Ubound(DialogModel.lstCurrencies.SelectedItems()) <> -1
|
||||
' Enable GoOnButton only when Currency is selected
|
||||
DialogModel.cmdGoOn.Enabled = bCurrIsSelected
|
||||
DialogModel.chkComplete.Enabled = bCurrIsSelected
|
||||
If bDoEnableFrame AND DialogModel.cmdGoOn.Enabled Then
|
||||
' If FrameControls are enabled, check if Listbox is Empty
|
||||
bObjectIsSelected = Ubound(DialogModel.lstSelection.SelectedItems()) <> -1
|
||||
DialogModel.cmdGoOn.Enabled = bObjectIsSelected
|
||||
End If
|
||||
Else
|
||||
DialogModel.cmdGoOn.Enabled = False
|
||||
DialogModel.chkComplete.Enabled = False
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Sub ConvertRangesOrStylesOfDocument()
|
||||
Dim i as Integer
|
||||
Dim ItemName as String
|
||||
Dim SelList() as String
|
||||
Dim oSheetRanges as Object
|
||||
|
||||
bDocHasProtectedSheets = CheckSheetProtection(oSheets)
|
||||
If bDocHasProtectedSheets Then
|
||||
bDocHasProtectedSheets = UnprotectSheetsWithPassWord(oSheets, bDoUnProtect)
|
||||
DialogModel.cmdGoOn.Enabled = False
|
||||
End If
|
||||
If Not bDocHasProtectedSheets Then
|
||||
EnableStep1DialogControls(False, False, False)
|
||||
InitializeProgressBar()
|
||||
If DialogModel.optSelRange.State = 1 Then
|
||||
SelectListItem()
|
||||
End If
|
||||
SelList() = DialogConvert.GetControl("lstSelection").SelectedItems()
|
||||
If DialogModel.optCellTemplates.State = 1 Then
|
||||
' Option 'Soft' Formatation is selected
|
||||
AssignRangestoStyle(DialogModel.lstSelection.StringItemList(), SelList())
|
||||
ConverttheSoftWay(SelList(), True)
|
||||
ElseIf DialogModel.optSelRange.State = 1 Then
|
||||
oSheetRanges = oPreSelRange.CellFormatRanges.createEnumeration
|
||||
While oSheetRanges.hasMoreElements
|
||||
oRange = oSheetRanges.NextElement
|
||||
If CheckFormatType(oRange) Then
|
||||
ConvertCellCurrencies(oRange)
|
||||
SwitchNumberFormat(oRange, oFormats, sEuroSign)
|
||||
End If
|
||||
Wend
|
||||
Else
|
||||
ConverttheHardWay(SelList(), False, True)
|
||||
End If
|
||||
oStatusline.End
|
||||
EnableStep1DialogControls(True, False, True)
|
||||
DialogModel.cmdGoOn.Enabled = True
|
||||
oDocument.CurrentController.Select(oSelRanges)
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Sub ConvertWholeDocument()
|
||||
Dim s as Integer
|
||||
DialogModel.cmdGoOn.Enabled = False
|
||||
DialogModel.chkComplete.Enabled = False
|
||||
GoOn = ConvertDocument()
|
||||
EmptyListbox(DialogModel.lstSelection())
|
||||
EnableStep1DialogControls(True, True, True)
|
||||
End Sub
|
||||
|
||||
|
||||
' Everything previously selected will be deselected
|
||||
Sub EmptySelection()
|
||||
Dim RangeName as String
|
||||
Dim i as Integer
|
||||
Dim MaxIndex as Integer
|
||||
Dim EmptySelRangeList() as String
|
||||
|
||||
If Not IsNull(oSelRanges) Then
|
||||
If oSelRanges.HasElements Then
|
||||
EmptySelRangeList() = ArrayOutofString(oSelRanges.RangeAddressesasString, ";", MaxIndex)
|
||||
For i = 0 To MaxIndex
|
||||
oSelRanges.RemovebyName(EmptySelRangeList(i))
|
||||
Next i
|
||||
End If
|
||||
oDocument.CurrentController.Select(oSelRanges)
|
||||
Else
|
||||
oSelRanges = oDocument.createInstance("com.sun.star.sheet.SheetCellRanges")
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Function AddSelectedRangeToSelRangesEnum() as Object
|
||||
Dim oLocRange as Object
|
||||
osheet = oDocument.CurrentController.GetActiveSheet
|
||||
oSelRanges = oDocument.createInstance("com.sun.star.sheet.SheetCellRanges")
|
||||
' Check if a Currency-Range has been selected
|
||||
oLocRange = oDocument.CurrentController.Selection
|
||||
bPreSelected = oLocRange.SupportsService("com.sun.star.sheet.SheetCellRange")
|
||||
If bPreSelected Then
|
||||
oSelRanges.InsertbyName("",oLocRange)
|
||||
AddSelectedRangeToSelRangesEnum() = oLocRange
|
||||
End If
|
||||
End Function
|
||||
|
||||
|
||||
Sub GetPreSelectedRange()
|
||||
Dim i as Integer
|
||||
Dim OldCurrSymbolList(2) as String
|
||||
Dim OldCurrIndex as Integer
|
||||
Dim OldCurExtension(2) as String
|
||||
oPreSelRange = AddSelectedRangeToSelRangesEnum()
|
||||
|
||||
DialogModel.chkComplete.State = Abs(Not(bPreSelected))
|
||||
If bPreSelected Then
|
||||
DialogModel.optSelRange.State = 1
|
||||
AddRangeToListbox(oPreSelRange)
|
||||
Else
|
||||
DialogModel.optCellTemplates.State = 1
|
||||
CreateStyleEnumeration()
|
||||
End If
|
||||
EnableStep1DialogControls(True, bPreSelected, True)
|
||||
DialogModel.optSelRange.Enabled = bPreSelected
|
||||
End Sub
|
||||
|
||||
|
||||
Sub AddRangeToListbox(oLocRange as Object)
|
||||
EmptyListBox(DialogModel.lstSelection)
|
||||
PreName = RetrieveRangeNamefromAddress(oLocRange)
|
||||
AddSingleItemToListbox(DialogModel.lstSelection, Prename)', 0)
|
||||
SelectListboxItem(DialogModel.lstCurrencies, CurrIndex)
|
||||
TotCellCount = CountRangeCells(oLocRange)
|
||||
End Sub
|
||||
|
||||
|
||||
Sub CheckRangeSelection(Optional oEvent)
|
||||
EmptySelection()
|
||||
AddRangeToListbox(oPreSelRange)
|
||||
oPreSelRange = AddSelectedRangeToSelRangesEnum()
|
||||
End Sub
|
||||
|
||||
|
||||
' Checks if a Field (LocField) is already defined in an Array
|
||||
' Returns 'True' or 'False'
|
||||
Function FieldinList(LocList(), MaxIndex as integer, ByVal LocField ) As Boolean
|
||||
Dim i as integer
|
||||
LocField = Ucase(LocField)
|
||||
For i = Lbound(LocList()) to MaxIndex
|
||||
If Ucase(LocList(i)) = LocField then
|
||||
FieldInList = True
|
||||
Exit Function
|
||||
End if
|
||||
Next
|
||||
FieldInList = False
|
||||
End Function
|
||||
|
||||
|
||||
Function CheckLocale(oLocale) as Boolean
|
||||
Dim i as Integer
|
||||
Dim LocCountry as String
|
||||
Dim LocLanguage as String
|
||||
LocCountry = oLocale.Country
|
||||
LocLanguage = oLocale.Language
|
||||
For i = 0 To 1
|
||||
If LocLanguage = LangIDValue(CurrIndex,i,0) AND LocCountry = LangIDValue(CurrIndex,i,1) Then
|
||||
CheckLocale = True
|
||||
Exit Function
|
||||
End If
|
||||
Next i
|
||||
CheckLocale = False
|
||||
End Function
|
||||
|
||||
|
||||
Sub SetOptionValuestoNull()
|
||||
With DialogModel
|
||||
.optCellTemplates.State = 0
|
||||
.optSheetRanges.State = 0
|
||||
.optDocRanges.State = 0
|
||||
.optSelRange.State = 0
|
||||
End With
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Sub SetStatusLineText(sStsREPROTECT as String)
|
||||
If Not IsNull(oStatusLine) Then
|
||||
oStatusline.SetText(sStsREPROTECT)
|
||||
End If
|
||||
End Sub
|
||||
</script:module>
|
||||
97
office-plugin/windows-office/share/basic/Euro/DlgConvert.xdl
Normal file
97
office-plugin/windows-office/share/basic/Euro/DlgConvert.xdl
Normal file
@@ -0,0 +1,97 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE dlg:window PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "dialog.dtd">
|
||||
<!--***********************************************************
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
***********************************************************-->
|
||||
<dlg:window xmlns:dlg="http://openoffice.org/2000/dialog" xmlns:script="http://openoffice.org/2000/script" dlg:id="DialogConvert" dlg:left="96" dlg:top="28" dlg:width="270" dlg:height="210" dlg:page="2" dlg:help-url="HID:WIZARDS_HID_DLGCONVERT_DIALOG" dlg:closeable="true" dlg:moveable="true">
|
||||
<dlg:bulletinboard>
|
||||
<dlg:text dlg:id="lblCurrencies" dlg:tab-index="1" dlg:left="170" dlg:top="39" dlg:width="89" dlg:height="8" dlg:value="lblCurrencies"/>
|
||||
<dlg:checkbox dlg:id="chkComplete" dlg:tab-index="0" dlg:left="12" dlg:top="43" dlg:width="129" dlg:height="10" dlg:page="1" dlg:help-url="HID:WIZARDS_HID_DLGCONVERT_CHECKBOX1" dlg:value="chkComplete" dlg:checked="true">
|
||||
<script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.script:Euro.ConvertRun.RetrieveEnableValue?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:checkbox>
|
||||
<dlg:menulist dlg:id="lstCurrencies" dlg:tab-index="2" dlg:left="170" dlg:top="51" dlg:width="90" dlg:height="12" dlg:help-url="HID:WIZARDS_HID_DLGCONVERT_COMBOBOX1" dlg:spin="true" dlg:linecount="12">
|
||||
<script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.script:Euro.Common.SelectCurrency?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:menulist>
|
||||
<dlg:radiogroup>
|
||||
<dlg:radio dlg:id="optCellTemplates" dlg:tab-index="3" dlg:left="12" dlg:top="96" dlg:width="129" dlg:height="10" dlg:page="1" dlg:help-url="HID:WIZARDS_HID_DLGCONVERT_OPTIONBUTTON1" dlg:value="optCellTemplates">
|
||||
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:Euro.Soft.CreateStyleEnumeration?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:radio>
|
||||
<dlg:radio dlg:id="optSheetRanges" dlg:tab-index="4" dlg:left="12" dlg:top="110" dlg:width="130" dlg:height="10" dlg:page="1" dlg:help-url="HID:WIZARDS_HID_DLGCONVERT_OPTIONBUTTON2" dlg:value="optSheetRanges">
|
||||
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:Euro.Hard.CreateRangeList?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:radio>
|
||||
<dlg:radio dlg:id="optDocRanges" dlg:tab-index="5" dlg:left="12" dlg:top="124" dlg:width="130" dlg:height="10" dlg:page="1" dlg:help-url="HID:WIZARDS_HID_DLGCONVERT_OPTIONBUTTON3" dlg:value="optDocRanges">
|
||||
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:Euro.Hard.CreateRangeList?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:radio>
|
||||
<dlg:radio dlg:id="optSelRange" dlg:tab-index="6" dlg:left="12" dlg:top="138" dlg:width="130" dlg:height="10" dlg:page="1" dlg:help-url="HID:WIZARDS_HID_DLGCONVERT_OPTIONBUTTON4" dlg:value="optSelRange">
|
||||
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:Euro.ConvertRun.CheckRangeSelection?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:radio>
|
||||
</dlg:radiogroup>
|
||||
<dlg:text dlg:id="lblSelection" dlg:tab-index="7" dlg:left="170" dlg:top="84" dlg:width="73" dlg:height="8" dlg:page="1" dlg:value="lblSelection"/>
|
||||
<dlg:menulist dlg:id="lstSelection" dlg:tab-index="8" dlg:left="170" dlg:top="96" dlg:width="90" dlg:height="52" dlg:page="1" dlg:help-url="HID:WIZARDS_HID_DLGCONVERT_LISTBOX1" dlg:multiselection="true">
|
||||
<script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.script:Euro.ConvertRun.SelectListItem?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:menulist>
|
||||
<dlg:radiogroup>
|
||||
<dlg:radio dlg:id="optSingleFile" dlg:tab-index="9" dlg:left="12" dlg:top="51" dlg:width="146" dlg:height="10" dlg:page="2" dlg:help-url="HID:WIZARDS_HID_DLGCONVERT_OBFILE" dlg:value="optSingleFile">
|
||||
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:Euro.AutoPilotRun.SwapExtent?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:radio>
|
||||
<dlg:radio dlg:id="optWholeDir" dlg:tab-index="10" dlg:left="12" dlg:top="65" dlg:width="146" dlg:height="10" dlg:page="2" dlg:help-url="HID:WIZARDS_HID_DLGCONVERT_OBDIR" dlg:value="optWholeDir" dlg:checked="true">
|
||||
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:Euro.AutoPilotRun.SwapExtent?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:radio>
|
||||
</dlg:radiogroup>
|
||||
<dlg:textfield dlg:id="txtConfig" dlg:tab-index="11" dlg:left="6" dlg:top="50" dlg:width="258" dlg:height="55" dlg:page="3" dlg:vscroll="true" dlg:multiline="true" dlg:readonly="true"/>
|
||||
<dlg:textfield dlg:id="txtSource" dlg:tab-index="12" dlg:left="80" dlg:top="82" dlg:width="165" dlg:height="12" dlg:page="2" dlg:help-url="HID:WIZARDS_HID_DLGCONVERT_TBSOURCE">
|
||||
<script:event script:event-name="on-textchange" script:macro-name="vnd.sun.star.script:Euro.AutoPilotRun.ToggleGoOnButton?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:textfield>
|
||||
<dlg:button dlg:id="cmdCallSourceDialog" dlg:tab-index="13" dlg:left="249" dlg:top="81" dlg:width="15" dlg:height="14" dlg:page="2" dlg:help-url="HID:WIZARDS_HID_DLGCONVERT_CBSOURCEOPEN" dlg:value="...">
|
||||
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:Euro.AutoPilotRun.CallFilePicker?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:button>
|
||||
<dlg:checkbox dlg:id="chkRecursive" dlg:tab-index="14" dlg:left="12" dlg:top="98" dlg:width="252" dlg:height="10" dlg:page="2" dlg:help-url="HID:WIZARDS_HID_DLGCONVERT_CHECKRECURSIVE" dlg:value="chkRecursive" dlg:checked="false"/>
|
||||
<dlg:checkbox dlg:id="chkTextDocuments" dlg:tab-index="15" dlg:left="12" dlg:top="112" dlg:width="251" dlg:height="10" dlg:page="2" dlg:help-url="HID:WIZARDS_HID_DLGCONVERT_CHKTEXTDOCUMENTS" dlg:value="chkTextDocuments" dlg:checked="false"/>
|
||||
<dlg:checkbox dlg:id="chkProtect" dlg:tab-index="16" dlg:left="12" dlg:top="126" dlg:width="251" dlg:height="10" dlg:page="2" dlg:help-url="HID:WIZARDS_HID_DLGCONVERT_CHKPROTECT" dlg:value="chkProtect" dlg:checked="false"/>
|
||||
<dlg:textfield dlg:id="txtTarget" dlg:tab-index="17" dlg:left="80" dlg:top="143" dlg:width="165" dlg:height="12" dlg:page="2" dlg:help-url="HID:WIZARDS_HID_DLGCONVERT_TBTARGET"/>
|
||||
<dlg:button dlg:id="cmdCallTargetDialog" dlg:tab-index="18" dlg:left="249" dlg:top="142" dlg:width="15" dlg:height="14" dlg:page="2" dlg:help-url="HID:WIZARDS_HID_DLGCONVERT_CBTARGETOPEN" dlg:value="...">
|
||||
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:Euro.AutoPilotRun.CallFolderPicker?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:button>
|
||||
<dlg:progressmeter dlg:id="ProgressBar" dlg:tab-index="19" dlg:left="85" dlg:top="152" dlg:width="179" dlg:height="10" dlg:page="3"/>
|
||||
<dlg:text dlg:id="lblHint" dlg:tab-index="20" dlg:left="6" dlg:top="166" dlg:width="258" dlg:height="20" dlg:value="lblHint" dlg:multiline="true"/>
|
||||
<dlg:text dlg:id="lblTarget" dlg:tab-index="21" dlg:left="6" dlg:top="145" dlg:width="73" dlg:height="8" dlg:page="2" dlg:value="lblTarget"/>
|
||||
<dlg:text dlg:id="lblSource" dlg:tab-index="22" dlg:left="6" dlg:top="84" dlg:width="73" dlg:height="8" dlg:page="2" dlg:value="lblSource"/>
|
||||
<dlg:text dlg:id="lblCurProgress" dlg:tab-index="23" dlg:left="16" dlg:top="130" dlg:width="208" dlg:height="8" dlg:page="3"/>
|
||||
<dlg:text dlg:id="lblRetrieval" dlg:tab-index="24" dlg:left="9" dlg:top="119" dlg:width="216" dlg:height="8" dlg:page="3" dlg:value="lblRetrieval"/>
|
||||
<dlg:text dlg:id="lblConfig" dlg:tab-index="25" dlg:left="6" dlg:top="39" dlg:width="94" dlg:height="8" dlg:page="3" dlg:value="lblConfig"/>
|
||||
<dlg:text dlg:id="lblCurDocument" dlg:tab-index="26" dlg:left="16" dlg:top="141" dlg:width="208" dlg:height="8" dlg:page="3"/>
|
||||
<dlg:img dlg:id="imgPreview" dlg:tab-index="27" dlg:left="6" dlg:top="6" dlg:width="258" dlg:height="26" dlg:src="file:///D:/office630np/share/template/german/wizard/bitmap/euro_2.bmp"/>
|
||||
<dlg:fixedline dlg:id="hlnSelection" dlg:tab-index="28" dlg:left="7" dlg:top="72" dlg:width="258" dlg:height="8" dlg:page="1" dlg:value="hlnSelection"/>
|
||||
<dlg:fixedline dlg:id="hlnExtent" dlg:tab-index="29" dlg:left="6" dlg:top="39" dlg:width="156" dlg:height="8" dlg:page="2" dlg:value="hlnExtent"/>
|
||||
<dlg:fixedline dlg:id="hlnProgress" dlg:tab-index="30" dlg:left="6" dlg:top="108" dlg:width="258" dlg:height="8" dlg:page="3" dlg:value="hlnProgress"/>
|
||||
<dlg:fixedline dlg:id="FixedLine1" dlg:tab-index="31" dlg:left="6" dlg:top="152" dlg:width="258" dlg:height="9" dlg:page="1"/>
|
||||
<dlg:text dlg:id="lblProgress" dlg:tab-index="32" dlg:left="6" dlg:top="153" dlg:width="79" dlg:height="8" dlg:page="3" dlg:value="lblProgress"/>
|
||||
<dlg:button dlg:id="cmdCancel" dlg:tab-index="33" dlg:left="6" dlg:top="190" dlg:width="53" dlg:height="14" dlg:help-url="HID:WIZARDS_HID_DLGCONVERT_CBCANCEL" dlg:value="cmdCancel">
|
||||
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:Euro.Common.CancelTask?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:button>
|
||||
<dlg:button dlg:id="cmdHelp" dlg:tab-index="34" dlg:left="63" dlg:top="190" dlg:width="53" dlg:height="14" dlg:value="cmdHelp" dlg:button-type="help"/>
|
||||
<dlg:button dlg:id="cmdBack" dlg:tab-index="35" dlg:left="155" dlg:top="190" dlg:width="53" dlg:height="14" dlg:help-url="HID:WIZARDS_HID_DLGCONVERT_CBBACK" dlg:value="cmdBack">
|
||||
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:Euro.AutoPilotRun.PreviousStep?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:button>
|
||||
<dlg:button dlg:id="cmdGoOn" dlg:tab-index="36" dlg:left="211" dlg:top="190" dlg:width="53" dlg:height="14" dlg:help-url="HID:WIZARDS_HID_DLGCONVERT_CBGOON" dlg:value="cmdGoOn">
|
||||
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:Euro.Common.StartConversion?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:button>
|
||||
</dlg:bulletinboard>
|
||||
</dlg:window>
|
||||
@@ -0,0 +1,35 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE dlg:window PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "dialog.dtd">
|
||||
<!--***********************************************************
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
***********************************************************-->
|
||||
<dlg:window xmlns:dlg="http://openoffice.org/2000/dialog" xmlns:script="http://openoffice.org/2000/script" dlg:id="DlgPassword" dlg:left="77" dlg:top="93" dlg:width="310" dlg:height="65" dlg:closeable="true" dlg:moveable="true" dlg:title="DlgPassword">
|
||||
<dlg:bulletinboard>
|
||||
<dlg:button dlg:id="cmdGoOn" dlg:tab-index="0" dlg:left="251" dlg:top="6" dlg:width="53" dlg:height="14" dlg:help-url="HID:WIZARDS_HID_DLGPASSWORD_CMDGOON" dlg:value="cmdGoOn">
|
||||
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:Euro.Protect.ReadPassword?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:button>
|
||||
<dlg:button dlg:id="cmdCancel" dlg:tab-index="1" dlg:left="251" dlg:top="24" dlg:width="53" dlg:height="14" dlg:help-url="HID:WIZARDS_HID_DLGPASSWORD_CMDCANCEL" dlg:value="cmdCancel">
|
||||
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:Euro.Protect.RejectPassword?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:button>
|
||||
<dlg:button dlg:id="cmdHelp" dlg:tab-index="2" dlg:left="251" dlg:top="45" dlg:width="53" dlg:height="14" dlg:tag="34692" dlg:value="cmdHelp" dlg:button-type="help"/>
|
||||
<dlg:textfield dlg:id="txtPassword" dlg:tab-index="3" dlg:left="11" dlg:top="18" dlg:width="232" dlg:height="12" dlg:help-url="HID:WIZARDS_HID_DLGPASSWORD_TXTPASSWORD" dlg:echochar="*"/>
|
||||
<dlg:fixedline dlg:id="hlnPassword" dlg:tab-index="4" dlg:left="6" dlg:top="6" dlg:width="238" dlg:height="8" dlg:value="hlnPassword"/>
|
||||
</dlg:bulletinboard>
|
||||
</dlg:window>
|
||||
249
office-plugin/windows-office/share/basic/Euro/Hard.xba
Normal file
249
office-plugin/windows-office/share/basic/Euro/Hard.xba
Normal file
@@ -0,0 +1,249 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
|
||||
<!--***********************************************************
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
***********************************************************-->
|
||||
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Hard" script:language="StarBasic">REM ***** BASIC *****
|
||||
Option Explicit
|
||||
|
||||
|
||||
Sub CreateRangeList()
|
||||
Dim MaxIndex as Integer
|
||||
MaxIndex = -1
|
||||
EnableStep1DialogControls(False, False, False)
|
||||
EmptySelection()
|
||||
DialogModel.lblSelection.Label = sCURRRANGES
|
||||
EmptyListbox(DialogModel.lstSelection)
|
||||
oDocument.CurrentController.Select(oSelRanges)
|
||||
If (DialogModel.optSheetRanges.State = 1) AND (DialogModel.chkComplete.State <> 1) Then
|
||||
' Conversion on a sheet?
|
||||
SetStatusLineText(sStsRELRANGES)
|
||||
osheet = oDocument.CurrentController.GetActiveSheet
|
||||
oRanges = osheet.CellFormatRanges.createEnumeration()
|
||||
MaxIndex = AddSheetRanges(oRanges, MaxIndex, oSheet, False)
|
||||
If MaxIndex > -1 Then
|
||||
ReDim Preserve RangeList(MaxIndex)
|
||||
End If
|
||||
Else
|
||||
CreateRangeEnumeration(False)
|
||||
bRangeListDefined = True
|
||||
End If
|
||||
EnableStep1DialogControls(True, True, True)
|
||||
SetStatusLineText("")
|
||||
End Sub
|
||||
|
||||
|
||||
Sub CreateRangeEnumeration(bAutopilot as Boolean)
|
||||
Dim i as Integer
|
||||
Dim MaxIndex as integer
|
||||
Dim sStatustext as String
|
||||
MaxIndex = -1
|
||||
If Not bRangeListDefined Then
|
||||
' Cellranges are not yet defined
|
||||
oSheets = oDocument.Sheets
|
||||
For i = 0 To oSheets.Count-1
|
||||
oSheet = oSheets.GetbyIndex(i)
|
||||
If bAutopilot Then
|
||||
IncreaseStatusValue(SBRELGET/osheets.Count)
|
||||
Else
|
||||
sStatustext = ReplaceString(sStsRELSHEETRANGES,Str(i+1),"%1Number%1")
|
||||
sStatustext = ReplaceString(sStatusText,oSheets.Count,"%2TotPageCount%2")
|
||||
SetStatusLineText(sStatusText)
|
||||
End If
|
||||
oRanges = osheet.CellFormatRanges.createEnumeration
|
||||
MaxIndex = AddSheetRanges(oRanges, MaxIndex, oSheet, bAutopilot)
|
||||
Next i
|
||||
Else
|
||||
If Not bAutoPilot Then
|
||||
SetStatusLineText(sStsRELRANGES)
|
||||
' cellranges already defined
|
||||
For i = 0 To Ubound(RangeList())
|
||||
If RangeList(i) <> "" Then
|
||||
AddSingleItemToListBox(DialogModel.lstSelection, RangeList(i))
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
End If
|
||||
If MaxIndex > -1 Then
|
||||
ReDim Preserve RangeList(MaxIndex)
|
||||
Else
|
||||
ReDim RangeList()
|
||||
End If
|
||||
Rangeindex = MaxIndex
|
||||
End Sub
|
||||
|
||||
|
||||
Function AddSheetRanges(oRanges as Object, r as Integer, oSheet as Object, bAutopilot)
|
||||
Dim RangeName as String
|
||||
Dim AddtoList as Boolean
|
||||
Dim iCurStep as Integer
|
||||
Dim MaxIndex as Integer
|
||||
iCurStep = DialogModel.Step
|
||||
While oRanges.hasMoreElements
|
||||
oRange = oRanges.NextElement
|
||||
AddToList = CheckFormatType(oRange)
|
||||
If AddToList Then
|
||||
RangeName = RetrieveRangeNamefromAddress(oRange)
|
||||
TotCellCount = TotCellCount + CountRangeCells(oRange)
|
||||
If Not bAutoPilot Then
|
||||
AddSingleItemToListbox(DialogModel.lstSelection, RangeName)
|
||||
End If
|
||||
' The Ranges are only passed to an Array when the whole Document is the basis
|
||||
' Redimension the RangeList Array if necessary
|
||||
MaxIndex = Ubound(RangeList())
|
||||
r = r + 1
|
||||
If r > MaxIndex Then
|
||||
MaxIndex = MaxIndex + SBRANGEUBOUND
|
||||
ReDim Preserve RangeList(MaxIndex)
|
||||
End If
|
||||
RangeList(r) = RangeName
|
||||
End If
|
||||
Wend
|
||||
AddSheetRanges = r
|
||||
End Function
|
||||
|
||||
|
||||
' adds a section to the collection
|
||||
Sub SelectRange()
|
||||
Dim i as Integer
|
||||
Dim RangeName as String
|
||||
Dim SelItem as String
|
||||
Dim CurRange as String
|
||||
Dim SheetRangeName as String
|
||||
Dim DescriptionList() as String
|
||||
Dim MaxRangeIndex as Integer
|
||||
Dim StatusValue as Integer
|
||||
StatusValue = 0
|
||||
MaxRangeIndex = Ubound(SelRangeList())
|
||||
CurSheetName = oSheet.Name
|
||||
For i = 0 To MaxRangeIndex
|
||||
SelItem = SelRangeList(i)
|
||||
' Is the Range already included in the collection?
|
||||
oRange = RetrieveRangeoutOfRangename(SelItem)
|
||||
TotCellCount = TotCellCount + CountRangeCells(oRange)
|
||||
DescriptionList() = ArrayOutofString(SelItem,".",1)
|
||||
SheetRangeName = DeleteStr(DescriptionList(0),"'")
|
||||
If SheetRangeName = CurSheetName Then
|
||||
oSelRanges.InsertbyName("",oRange)
|
||||
End If
|
||||
IncreaseStatusValue(SBRELGET/MaxRangeIndex)
|
||||
Next i
|
||||
End Sub
|
||||
|
||||
|
||||
Sub ConvertThehardWay(ListboxList(), SwitchFormat as Boolean, bRemove as Boolean)
|
||||
Dim i as Integer
|
||||
Dim AddCells as Long
|
||||
Dim OldStatusValue as Single
|
||||
Dim RangeName as String
|
||||
Dim LastIndex as Integer
|
||||
Dim oSelListbox as Object
|
||||
|
||||
oSelListbox = DialogConvert.GetControl("lstSelection")
|
||||
Lastindex = Ubound(ListboxList())
|
||||
If TotCellCount > 0 Then
|
||||
OldStatusValue = StatusValue
|
||||
' hard format
|
||||
For i = 0 To LastIndex
|
||||
RangeName = ListboxList(i)
|
||||
oRange = RetrieveRangeoutofRangeName(RangeName)
|
||||
ConvertCellCurrencies(oRange)
|
||||
If bRemove Then
|
||||
If oSelRanges.HasbyName(RangeName) Then
|
||||
oSelRanges.RemovebyName(RangeName)
|
||||
oDocument.CurrentController.Select(oSelRanges)
|
||||
End If
|
||||
End If
|
||||
If SwitchFormat Then
|
||||
If oRange.getPropertyState("NumberFormat") <> 1 Then
|
||||
' Range is hard formatted
|
||||
SwitchNumberFormat(oRange, oFormats, sEuroSign)
|
||||
End If
|
||||
Else
|
||||
SwitchNumberFormat(oRange, oFormats, sEuroSign)
|
||||
End If
|
||||
AddCells = CountRangeCells(oRange)
|
||||
CurCellCount = AddCells
|
||||
IncreaseStatusValue((CurCellCount/TotCellCount)*(100-OldStatusValue))
|
||||
If bRemove Then
|
||||
RemoveListBoxItemByName(oSelListbox.Model,Rangename)
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Sub ConvertCellCurrencies(oRange as Object)
|
||||
Dim oValues as Object
|
||||
Dim oCells as Object
|
||||
Dim oCell as Object
|
||||
oValues = oRange.queryContentCells(com.sun.star.sheet.CellFlags.VALUE)
|
||||
If (oValues.Count > 0) Then
|
||||
oCells = oValues.Cells.createEnumeration
|
||||
While oCells.hasMoreElements
|
||||
oCell = oCells.nextElement
|
||||
ModifyObjectValuewithCurrFactor(oCell)
|
||||
Wend
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Sub ModifyObjectValuewithCurrFactor(oDocObject as Object)
|
||||
Dim oDocObjectValue as double
|
||||
oDocObjectValue = oDocObject.Value
|
||||
oDocObject.Value = Round(oDocObjectValue/CurrFactor, 2)
|
||||
End Sub
|
||||
|
||||
|
||||
Function CheckIfRangeisCurrency(FormatObject as Object)
|
||||
Dim oFormatofObject() as Object
|
||||
' Retrieve the Format of the Object
|
||||
On Local Error GoTo NOKEY
|
||||
oFormatofObject() = oFormats.getByKey(FormatObject.NumberFormat)
|
||||
On Local Error GoTo 0
|
||||
CheckIfRangeIsCurrency = INT(oFormatofObject.Type) AND com.sun.star.util.NumberFormat.CURRENCY
|
||||
Exit Function
|
||||
NOKEY:
|
||||
CheckIfRangeisCurrency = False
|
||||
Resume CLERROR
|
||||
CLERROR:
|
||||
End Function
|
||||
|
||||
|
||||
Function CountColumnsForRow(IndexArray() as String, Row as Integer)
|
||||
Dim i as Integer
|
||||
Dim NoNulls as Boolean
|
||||
For i = 1 To Ubound(IndexArray,2)
|
||||
If IndexArray(Row,i)= "" Then
|
||||
NoNulls = False
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
CountColumnsForRow = i
|
||||
End Function
|
||||
|
||||
|
||||
Function CountRangeCells(oRange as Object) As Long
|
||||
Dim oRangeAddress as Object
|
||||
Dim LocCellCount as Long
|
||||
oRangeAddress = oRange.RangeAddress
|
||||
LocCellCount = (oRangeAddress.EndColumn - oRangeAddress.StartColumn + 1) * (oRangeAddress.EndRow - oRangeAddress.StartRow + 1)
|
||||
CountRangeCells = LocCellCount
|
||||
End Function</script:module>
|
||||
624
office-plugin/windows-office/share/basic/Euro/Init.xba
Normal file
624
office-plugin/windows-office/share/basic/Euro/Init.xba
Normal file
File diff suppressed because it is too large
Load Diff
195
office-plugin/windows-office/share/basic/Euro/Protect.xba
Normal file
195
office-plugin/windows-office/share/basic/Euro/Protect.xba
Normal file
@@ -0,0 +1,195 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
|
||||
<!--***********************************************************
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
***********************************************************-->
|
||||
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Protect" script:language="StarBasic">REM ***** BASIC *****
|
||||
Option Explicit
|
||||
|
||||
Public PWIndex as Integer
|
||||
|
||||
|
||||
Function UnprotectSheetsWithPassWord(oSheets as Object, bDoUnProtect as Boolean)
|
||||
Dim i as Integer
|
||||
Dim MaxIndex as Integer
|
||||
Dim iMsgResult as Integer
|
||||
PWIndex = -1
|
||||
If bDocHasProtectedSheets Then
|
||||
If Not bDoUnprotect Then
|
||||
' At First query if sheets shall generally be unprotected
|
||||
iMsgResult = Msgbox(sMsgUNPROTECT,36,sMsgDLGTITLE)
|
||||
bDoUnProtect = iMsgResult = 6
|
||||
End If
|
||||
If bDoUnProtect Then
|
||||
MaxIndex = oSheets.Count-1
|
||||
For i = 0 To MaxIndex
|
||||
bDocHasProtectedSheets = Not UnprotectSheet(oSheets(i))
|
||||
If bDocHasProtectedSheets Then
|
||||
ReprotectSheets()
|
||||
Exit For
|
||||
End If
|
||||
Next i
|
||||
If PWIndex = -1 Then
|
||||
ReDim UnProtectList() as String
|
||||
Else
|
||||
ReDim Preserve UnProtectList(PWIndex) as String
|
||||
End If
|
||||
Else
|
||||
Msgbox (sMsgSHEETSNOPROTECT, 64, sMsgDLGTITLE)
|
||||
End If
|
||||
End If
|
||||
UnProtectSheetsWithPassword = bDocHasProtectedSheets
|
||||
End Function
|
||||
|
||||
|
||||
Function UnprotectSheet(oListSheet as Object)
|
||||
Dim ListSheetName as String
|
||||
Dim sStatustext as String
|
||||
Dim i as Integer
|
||||
Dim bOneSheetIsUnprotected as Boolean
|
||||
i = -1
|
||||
ListSheetName = oListSheet.Name
|
||||
If oListSheet.IsProtected Then
|
||||
oListSheet.Unprotect("")
|
||||
If oListSheet.IsProtected Then
|
||||
' Sheet is protected by a Password
|
||||
bOneSheetIsUnProtected = UnprotectSheetWithDialog(oListSheet, ListSheetName)
|
||||
UnProtectSheet() = bOneSheetIsUnProtected
|
||||
Else
|
||||
' The Sheet could be unprotected without a password
|
||||
AddSheettoUnprotectionlist(ListSheetName,"")
|
||||
UnprotectSheet() = True
|
||||
End If
|
||||
Else
|
||||
UnprotectSheet() = True
|
||||
End If
|
||||
End Function
|
||||
|
||||
|
||||
Function UnprotectSheetWithDialog(oListSheet as Object, ListSheetName as String) as Boolean
|
||||
Dim PWIsCorrect as Boolean
|
||||
Dim QueryText as String
|
||||
oDocument.CurrentController.SetActiveSheet(oListSheet)
|
||||
QueryText = ReplaceString(sMsgPWPROTECT,"'" & ListSheetName & "'", "%1TableName%1")
|
||||
'"Please insert the password to unprotect the sheet '" & ListSheetName'"
|
||||
Do
|
||||
ExecutePasswordDialog(QueryText)
|
||||
If bCancelProtection Then
|
||||
bCancelProtection = False
|
||||
Msgbox (sMsgSHEETSNOPROTECT, 64, sMsgDLGTITLE)
|
||||
UnprotectSheetWithDialog() = False
|
||||
exit Function
|
||||
End If
|
||||
oListSheet.Unprotect(Password)
|
||||
If oListSheet.IsProtected Then
|
||||
PWIsCorrect = False
|
||||
Msgbox (sMsgWRONGPW, 64, sMsgDLGTITLE)
|
||||
Else
|
||||
' Sheet could be unprotected
|
||||
AddSheettoUnprotectionlist(ListSheetName,Password)
|
||||
PWIsCorrect = True
|
||||
End If
|
||||
Loop Until PWIsCorrect
|
||||
UnprotectSheetWithDialog() = True
|
||||
End Function
|
||||
|
||||
|
||||
Sub ExecutePasswordDialog(QueryText as String)
|
||||
With PasswordModel
|
||||
.Title = QueryText
|
||||
.hlnPassword.Label = sMsgPASSWORD
|
||||
.cmdCancel.Label = sMsgCANCEL
|
||||
.cmdHelp.Label = sHELP
|
||||
.cmdGoOn.Label = sMsgOK
|
||||
.cmdGoOn.DefaultButton = True
|
||||
End With
|
||||
DialogPassword.Execute
|
||||
End Sub
|
||||
|
||||
Sub ReadPassword()
|
||||
Password = PasswordModel.txtPassword.Text
|
||||
DialogPassword.EndExecute
|
||||
End Sub
|
||||
|
||||
|
||||
Sub RejectPassword()
|
||||
bCancelProtection = True
|
||||
DialogPassword.EndExecute
|
||||
End Sub
|
||||
|
||||
|
||||
' Reprotects the previousliy protected sheets
|
||||
' The passwordinformation is stored in the List 'UnProtectList()'
|
||||
Sub ReprotectSheets()
|
||||
Dim i as Integer
|
||||
Dim oProtectSheet as Object
|
||||
Dim ProtectList() as String
|
||||
Dim SheetName as String
|
||||
Dim SheetPassword as String
|
||||
If PWIndex > -1 Then
|
||||
SetStatusLineText(sStsREPROTECT)
|
||||
For i = 0 To PWIndex
|
||||
ProtectList() = ArrayOutOfString(UnProtectList(i),";")
|
||||
SheetName = ProtectList(0)
|
||||
If Ubound(ProtectList()) > 0 Then
|
||||
SheetPassWord = ProtectList(1)
|
||||
Else
|
||||
SheetPassword = ""
|
||||
End If
|
||||
oProtectSheet = oSheets.GetbyName(SheetName)
|
||||
If Not oProtectSheet.IsProtected Then
|
||||
oProtectSheet.Protect(SheetPassWord)
|
||||
End If
|
||||
Next i
|
||||
SetStatusLineText("")
|
||||
End If
|
||||
PWIndex = -1
|
||||
ReDim UnProtectList()
|
||||
End Sub
|
||||
|
||||
|
||||
' Add a Sheet to the list of sheets that finally have to be
|
||||
' unprotected
|
||||
Sub AddSheettoUnprotectionlist(ListSheetName as String, Password as String)
|
||||
Dim MaxIndex as Integer
|
||||
MaxIndex = Ubound(UnProtectList())
|
||||
PWIndex = PWIndex + 1
|
||||
If PWIndex > MaxIndex Then
|
||||
ReDim Preserve UnprotectList(MaxIndex + SBRANGEUBOUND)
|
||||
End If
|
||||
UnprotectList(PWIndex) = ListSheetName & ";" & Password
|
||||
End Sub
|
||||
|
||||
|
||||
Function CheckSheetProtection(oSheets as Object) as Boolean
|
||||
Dim MaxIndex as Integer
|
||||
Dim i as Integer
|
||||
Dim bProtectedSheets as Boolean
|
||||
bProtectedSheets = False
|
||||
MaxIndex = oSheets.Count-1
|
||||
For i = 0 To MaxIndex
|
||||
bProtectedSheets = oSheets(i).IsProtected
|
||||
If bProtectedSheets Then
|
||||
CheckSheetProtection() = True
|
||||
Exit Function
|
||||
End If
|
||||
Next i
|
||||
CheckSheetProtection() = False
|
||||
End Function</script:module>
|
||||
259
office-plugin/windows-office/share/basic/Euro/Soft.xba
Normal file
259
office-plugin/windows-office/share/basic/Euro/Soft.xba
Normal file
@@ -0,0 +1,259 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
|
||||
<!--***********************************************************
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
***********************************************************-->
|
||||
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Soft" script:language="StarBasic">Option Explicit
|
||||
REM ***** BASIC *****
|
||||
|
||||
|
||||
Sub CreateStyleEnumeration()
|
||||
EmptySelection()
|
||||
EmptyListbox(DialogModel.lstSelection)
|
||||
CurSheetName = oDocument.CurrentController.GetActiveSheet.Name
|
||||
MakeStyleEnumeration(False)
|
||||
DialogModel.lblSelection.Label = sTEMPLATES
|
||||
End Sub
|
||||
|
||||
|
||||
Sub MakeStyleEnumeration(bAddToListbox as Boolean)
|
||||
Dim m as integer
|
||||
Dim aStyleFormat as Object
|
||||
Dim Stylename as String
|
||||
StyleIndex = -1
|
||||
oStyles = oDocument.StyleFamilies.GetbyIndex(0)
|
||||
For m = 0 To oStyles.count-1
|
||||
oStyle = oStyles.GetbyIndex(m)
|
||||
StyleName = oStyle.Name
|
||||
If CheckFormatType(oStyle) Then
|
||||
If Not bAddToListBox Then
|
||||
AddSingleItemToListbox(DialogModel.lstSelection, Stylename)
|
||||
Else
|
||||
SwitchNumberFormat(ostyle, oFormats, sEuroSign)
|
||||
End If
|
||||
StyleIndex = StyleIndex + 1
|
||||
If StyleIndex > Ubound(StyleRangeAssignMentList()) Then
|
||||
Redim Preserve StyleRangeAssignmentList(StyleIndex)
|
||||
End If
|
||||
StyleRangeAssignmentList(StyleIndex) = "<STYLENAME>" & Stylename & "</STYLENAME>" & _
|
||||
"<DEFINED>FALSE</DEFINED>" & "<RANGES></RANGES>" &_
|
||||
"<CELLCOUNT>0</CELLCOUNT>" &_
|
||||
"<SELECTED>FALSE</SELECTED>"
|
||||
End If
|
||||
Next m
|
||||
If StyleIndex > -1 Then
|
||||
Redim Preserve StyleRangeAssignmentList(StyleIndex)
|
||||
Else
|
||||
ReDim StyleRangeAssignmentList()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Sub AssignRangestoStyle(StyleList(), SelList())
|
||||
Dim i as Integer
|
||||
Dim n as integer
|
||||
Dim LastIndex as Integer
|
||||
Dim CurStyleName as String
|
||||
Dim AssignString as String
|
||||
LastIndex = Ubound(StyleList())
|
||||
StatusValue = 0
|
||||
SetStatusLineText(sStsRELRANGES)
|
||||
For i = 0 To LastIndex
|
||||
CurStyleName = StyleList(i)
|
||||
n = PartStringInArray(StyleRangeAssignmentList(), CurStyleName, 0)
|
||||
AssignString = StyleRangeAssignmentlist(n)
|
||||
If IndexInArray(CurStyleName, SelList()) <> -1 Then
|
||||
' Style is selected
|
||||
If FindPartString(AssignString, "<DEFINED>", "</DEFINED>", 1) = "FALSE" Then
|
||||
AssignString = ReplaceString(AssignString, "<SELECTED>TRUE</SELECTED>", "<SELECTED>FALSE</SELECTED>")
|
||||
AssignCellFormatRanges(n, AssignString, CurStyleName)
|
||||
End If
|
||||
Else
|
||||
' Style is not selected
|
||||
If FindPartString(AssignString, "<SELECTED>", "</SELECTED>", 1) = "FALSE" Then
|
||||
DeselectStyle(CurStyleName, n)
|
||||
End If
|
||||
End If
|
||||
IncreaseStatusvalue(SBRELGET/(LastIndex+1))
|
||||
Next i
|
||||
End Sub
|
||||
|
||||
|
||||
Sub AssignCellFormatRanges(n as Integer, AssignString as String, CurStyleName as String)
|
||||
Dim oRanges() as Object
|
||||
Dim oRange as Object
|
||||
Dim oRangeAddress
|
||||
Dim oSheet as Object
|
||||
Dim StyleCellCount as Long
|
||||
Dim i as Integer
|
||||
Dim MaxIndex as Integer
|
||||
Dim RangeString as String
|
||||
Dim SheetName as String
|
||||
Dim RangeName as String
|
||||
Dim CellCountString as String
|
||||
StyleCellCount = 0
|
||||
RangeString = "<RANGES>"
|
||||
MaxIndex = oSheets.Count-1
|
||||
For i = 0 To MaxIndex
|
||||
oSheet = oSheets(i)
|
||||
SheetName = oSheet.Name
|
||||
oRanges = osheet.CellFormatRanges.CreateEnumeration
|
||||
While oRanges.hasMoreElements
|
||||
oRange = oRanges.NextElement
|
||||
If oRange.getPropertyState("NumberFormat") = 1 Then
|
||||
If oRange.CellStyle = CurStyleName Then
|
||||
oRangeAddress = oRange.RangeAddress
|
||||
RangeName = RetrieveRangeNamefromAddress(oRange)
|
||||
RangeString = RangeString & RangeName & ","
|
||||
StyleCellCount = StyleCellCount + CountRangeCells(oRange)
|
||||
End If
|
||||
End If
|
||||
Wend
|
||||
Next i
|
||||
If StyleCellCount > 0 Then
|
||||
TotCellCount = TotCellCount + StyleCellCount
|
||||
RangeString = RTrimStr(RangeString,",")
|
||||
RangeString = RangeString & "</RANGES>"
|
||||
CellCountString = "<CELLCOUNT>" & StyleCellCount & "</CELLCOUNT"
|
||||
AssignString = ReplaceString(AssignString, RangeString,"<RANGES></RANGES>")
|
||||
AssignString = ReplaceString(AssignString, CellCountString,"<CELLCOUNT>0</CELLCOUNT>")
|
||||
End If
|
||||
AssignString = ReplaceString(AssignString, "<DEFINED>TRUE</DEFINED>", "<DEFINED>FALSE</DEFINED>")
|
||||
StyleRangeAssignmentList(n) = AssignString
|
||||
End Sub
|
||||
|
||||
|
||||
' deletes a styletemplate from the Collection that selects the ranges
|
||||
Sub DeselectStyle(DeSelStyleName as String, n as Integer)
|
||||
Dim i as Integer
|
||||
Dim RangeName as String
|
||||
Dim SelectString as String
|
||||
Dim AssignString as String
|
||||
Dim StyleRangeList() as String
|
||||
Dim MaxIndex as Integer
|
||||
SelectString ="<SELECTED>FALSE</SELECTED>"
|
||||
AssignString = StyleRangeAssignmentList(n)
|
||||
RangeString = FindPartString(AssignString,"<RANGES>","</RANGES>",1)
|
||||
StyleRangeList() = ArrayoutofString(RangeString,",")
|
||||
MaxIndex = Ubound(StyleRangeList())
|
||||
For i = 0 To MaxIndex
|
||||
RangeName = StyleRangeList(i)
|
||||
If oSelRanges.HasbyName(RangeName) Then
|
||||
oSelRanges.RemovebyName(RangeName)
|
||||
End If
|
||||
Next i
|
||||
AssignString = ReplaceString(AssignString, "<SELECTED>FALSE</SELECTED>", "<SELECTED>TRUE</SELECTED>")
|
||||
StyleRangeAssignmentList(n) = AssignString
|
||||
End Sub
|
||||
|
||||
|
||||
Function RetrieveRangeNamefromAddress(oRange as Object) as String
|
||||
Dim Rangename as String
|
||||
Dim oAddressRanges as Object
|
||||
oAddressRanges = oDocument.createInstance("com.sun.star.sheet.SheetCellRanges")
|
||||
oAddressRanges.InsertbyName("",oRange)
|
||||
Rangename = oAddressRanges.RangeAddressesasString
|
||||
' Msgbox "Adresse: " & oRangeAddress.StartColumn & " ; " & oRangeAddress.EndColumn & " ; " & oRangeAddress.StartRow & " ; " & oRangeAddress.EndRow & chr(13) & RangeName
|
||||
' oAddressRanges.RemovebyName(RangeName)
|
||||
RetrieveRangeNamefromAddress = Rangename
|
||||
End Function
|
||||
|
||||
|
||||
' creates a sheet object from an according sectionname
|
||||
Function RetrieveSheetoutofRangeName(TableText as String)
|
||||
Dim DescriptionList() as String
|
||||
Dim SheetName as String
|
||||
Dim MaxIndex as integer
|
||||
' find out in which sheet the range is
|
||||
DescriptionList() = ArrayOutofString(TableText,".",MaxIndex)
|
||||
SheetName = DescriptionList(0)
|
||||
SheetName = DeleteStr(SheetName,"'")
|
||||
' set the viewcursor on this sheet
|
||||
RetrieveSheetoutofRangeName = oSheets.GetbyName(SheetName)
|
||||
End Function
|
||||
|
||||
|
||||
' creates a rangeobject from an according rangename
|
||||
Function RetrieveRangeoutofRangeName(TableText as String)
|
||||
oSheet = RetrieveSheetoutofRangeName(TableText)
|
||||
oRange = oSheet.GetCellRangebyName(TableText)
|
||||
RetrieveRangeoutofRangeName = oRange
|
||||
End Function
|
||||
|
||||
|
||||
Sub ConvertTheSoftWay(StyleList(), bDeSelect as Boolean)
|
||||
Dim i as Integer
|
||||
Dim l as Integer
|
||||
Dim s as Integer
|
||||
Dim n as Integer
|
||||
Dim CurStyleName as String
|
||||
Dim RangeName as String
|
||||
Dim OldStatusValue as Integer
|
||||
Dim LastIndex as Integer
|
||||
Dim oSelListbox as Object
|
||||
Dim StyleRangeList() as String
|
||||
Dim MaxIndex as Integer
|
||||
oSelListbox = DialogConvert.GetControl("lstSelection")
|
||||
LastIndex = Ubound(StyleList())
|
||||
OldStatusValue = StatusValue
|
||||
For i = 0 To LastIndex
|
||||
CurStyleName = StyleList(i)
|
||||
oStyle = oStyles.GetbyName(CurStyleName)
|
||||
StyleRangeList() = GetAssignedRanges(CurStyleName, n)
|
||||
MaxIndex = Ubound(StyleRangeList())
|
||||
For s = 0 To MaxIndex
|
||||
RangeName = StyleRangeList(s)
|
||||
oRange = RetrieveRangeoutofRangeName(RangeName)
|
||||
If oRange.getPropertyState("NumberFormat") = 1 Then
|
||||
' Range is hard formatted
|
||||
ConvertCellCurrencies(oRange)
|
||||
CurCellCount = CountRangeCells(oRange)
|
||||
End If
|
||||
IncreaseStatusvalue((CurCellCount/TotCellCount)*(95-OldStatusValue))
|
||||
If bDeSelect Then
|
||||
' Note: On Problems see Bug #73157
|
||||
If oSelRanges.HasbyName(RangeName) Then
|
||||
oSelRanges.RemovebyName(RangeName)
|
||||
oDocument.CurrentController.Select(oSelRanges)
|
||||
End If
|
||||
End If
|
||||
Next s
|
||||
SwitchNumberFormat(ostyle, oFormats, sEuroSign)
|
||||
StyleRangeAssignmentList(n) = ""
|
||||
l = GetItemPos(oSelListBox.Model, CurStyleName)
|
||||
oSelListbox.RemoveItems(l,1)
|
||||
Next
|
||||
End Sub
|
||||
|
||||
|
||||
Function GetAssignedRanges(CurStyleName as String, n as Integer)
|
||||
Dim StyleRangeList() as String
|
||||
Dim RangeString as String
|
||||
Dim AssignString as String
|
||||
n = PartStringInArray(StyleRangeAssignmentList(), CurStyleName, 0)
|
||||
If n <> -1 Then
|
||||
AssignString = StyleRangeAssignmentList(n)
|
||||
RangeString = FindPartString(AssignString,"<RANGES>", "</RANGES>",1)
|
||||
If RangeString <> "" Then
|
||||
StyleRangeList() = ArrayoutofString(RangeString,",")
|
||||
End If
|
||||
End If
|
||||
GetAssignedRanges() = StyleRangeList()
|
||||
End Function</script:module>
|
||||
92
office-plugin/windows-office/share/basic/Euro/Writer.xba
Normal file
92
office-plugin/windows-office/share/basic/Euro/Writer.xba
Normal file
@@ -0,0 +1,92 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
|
||||
<!--***********************************************************
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
***********************************************************-->
|
||||
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Writer" script:language="StarBasic">REM ***** BASIC *****
|
||||
|
||||
|
||||
Sub ConvertWriterTables()
|
||||
Dim CellString as String
|
||||
Dim oParagraphs as Object
|
||||
Dim oPara as Object
|
||||
Dim i as integer
|
||||
Dim sCellNames()
|
||||
Dim oCell as Object
|
||||
oParagraphs = oDocument.Text.CreateEnumeration
|
||||
While oParagraphs.HasMoreElements
|
||||
oPara = oParagraphs.NextElement
|
||||
If NOT oPara.supportsService("com.sun.star.text.Paragraph") Then
|
||||
' Note: As cells might be splitted or merged
|
||||
' you cannot refer to them via their indices
|
||||
sCellNames = oPara.CellNames
|
||||
For i = 0 To Ubound(sCellNames)
|
||||
If sCellNames(i) <> "" Then
|
||||
oCell = oPara.getCellByName(sCellNames(i))
|
||||
If CheckFormatType(oCell) Then
|
||||
SwitchNumberFormat(oCell, oFormats, sEuroSign)
|
||||
ModifyObjectValuewithCurrFactor(oCell)
|
||||
End If
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
Wend
|
||||
End Sub
|
||||
|
||||
|
||||
Sub ModifyObjectValuewithCurrFactor(oDocObject as Object)
|
||||
oDocObjectValue = oDocObject.Value
|
||||
oDocObject.Value = oDocObjectValue/CurrFactor
|
||||
End Sub
|
||||
|
||||
|
||||
Sub ConvertTextFields()
|
||||
Dim oTextFields as Object
|
||||
Dim oTextField as Object
|
||||
Dim FieldValue
|
||||
Dim oDocObjectValue as double
|
||||
Dim InstanceNames(500) as String
|
||||
Dim CurInstanceName as String
|
||||
Dim MaxIndex as Integer
|
||||
MaxIndex = 0
|
||||
oTextfields = oDocument.getTextfields.CreateEnumeration
|
||||
While oTextFields.hasmoreElements
|
||||
oTextField = oTextFields.NextElement
|
||||
If oTextField.PropertySetInfo.HasPropertybyName("NumberFormat") Then
|
||||
If CheckFormatType(oTextField) Then
|
||||
If oTextField.PropertySetInfo.HasPropertybyName("Value") Then
|
||||
If Not oTextField.SupportsService("com.sun.star.text.TextField.GetExpression") Then
|
||||
oTextField.Content = CStr(Round(oTextField.Value/CurrFactor,2))
|
||||
End If
|
||||
ElseIf oTextField.TextFieldMaster.PropertySetInfo.HasPropertyByName("Value") Then
|
||||
CurInstanceName = oTextField.TextFieldMaster.InstanceName
|
||||
If Not FieldinArray(InstanceNames(), MaxIndex, CurInstanceName) Then
|
||||
oTextField.TextFieldMaster.Content = CStr(Round(oTextField.TextFieldMaster.Value/CurrFactor,2))
|
||||
InstanceNames(MaxIndex) = CurInstanceName
|
||||
MaxIndex = MaxIndex + 1
|
||||
End If
|
||||
End If
|
||||
SwitchNumberFormat(oTextField, oFormats, sEuroSign)
|
||||
End If
|
||||
End If
|
||||
Wend
|
||||
oDocument.GetTextFields.refresh()
|
||||
End Sub
|
||||
</script:module>
|
||||
6
office-plugin/windows-office/share/basic/Euro/dialog.xlb
Normal file
6
office-plugin/windows-office/share/basic/Euro/dialog.xlb
Normal file
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
|
||||
<library:library xmlns:library="http://openoffice.org/2000/library" library:name="Euro" library:readonly="true" library:passwordprotected="false">
|
||||
<library:element library:name="DlgConvert"/>
|
||||
<library:element library:name="DlgPassword"/>
|
||||
</library:library>
|
||||
12
office-plugin/windows-office/share/basic/Euro/script.xlb
Normal file
12
office-plugin/windows-office/share/basic/Euro/script.xlb
Normal file
@@ -0,0 +1,12 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
|
||||
<library:library xmlns:library="http://openoffice.org/2000/library" library:name="Euro" library:readonly="true" library:passwordprotected="false">
|
||||
<library:element library:name="ConvertRun"/>
|
||||
<library:element library:name="AutoPilotRun"/>
|
||||
<library:element library:name="Hard"/>
|
||||
<library:element library:name="Soft"/>
|
||||
<library:element library:name="Init"/>
|
||||
<library:element library:name="Common"/>
|
||||
<library:element library:name="Writer"/>
|
||||
<library:element library:name="Protect"/>
|
||||
</library:library>
|
||||
350
office-plugin/windows-office/share/basic/FormWizard/DBMeta.xba
Normal file
350
office-plugin/windows-office/share/basic/FormWizard/DBMeta.xba
Normal file
@@ -0,0 +1,350 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
|
||||
<!--***********************************************************
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
***********************************************************-->
|
||||
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="DBMeta" script:language="StarBasic">REM ***** BASIC *****
|
||||
Option Explicit
|
||||
|
||||
|
||||
Public iCommandTypes() as Integer
|
||||
Public CurCommandType as Integer
|
||||
Public oDataSource as Object
|
||||
Public bEnableBinaryOptionGroup as Boolean
|
||||
'Public bSelectContent as Boolean
|
||||
|
||||
|
||||
Function GetDatabaseNames(baddFirstListItem as Boolean)
|
||||
Dim sDatabaseList()
|
||||
If oDBContext.HasElements Then
|
||||
Dim LocDBList() as String
|
||||
Dim MaxIndex as Integer
|
||||
Dim i as Integer
|
||||
LocDBList = oDBContext.ElementNames()
|
||||
MaxIndex = Ubound(LocDBList())
|
||||
If baddfirstListItem Then
|
||||
ReDim Preserve sDatabaseList(MaxIndex + 1)
|
||||
sDatabaseList(0) = sSelectDatasource
|
||||
a = 1
|
||||
Else
|
||||
ReDim Preserve sDatabaseList(MaxIndex)
|
||||
a = 0
|
||||
End If
|
||||
For i = 0 To MaxIndex
|
||||
sDatabaseList(a) = oDBContext.ElementNames(i)
|
||||
a = a + 1
|
||||
Next i
|
||||
End If
|
||||
GetDatabaseNames() = sDatabaseList()
|
||||
End Function
|
||||
|
||||
|
||||
Sub GetSelectedDBMetaData(sDBName as String)
|
||||
Dim OldsDBname as String
|
||||
Dim DBIndex as Integer
|
||||
Dim LocList() as String
|
||||
' If bStartUp Then
|
||||
' bStartUp = false
|
||||
' Exit Sub
|
||||
' End Sub
|
||||
ToggleDatabasePage(False)
|
||||
With DialogModel
|
||||
If GetConnection(sDBName) Then
|
||||
If GetDBMetaData() Then
|
||||
LocList() = AddListToList(Array(sSelectDBTable), TableNames())
|
||||
.lstTables.StringItemList() = AddListToList(LocList(), QueryNames())
|
||||
' bSelectContent = True
|
||||
.lstTables.SelectedItems() = Array(0)
|
||||
iCommandTypes() = CreateCommandTypeList()
|
||||
EmptyFieldsListboxes()
|
||||
End If
|
||||
End If
|
||||
bEnableBinaryOptionGroup = False
|
||||
.lstTables.Enabled = True
|
||||
.lblTables.Enabled = True
|
||||
' Else
|
||||
' DialogModel.lstTables.StringItemList = Array(sSelectDBTable)
|
||||
' EmptyFieldsListboxes()
|
||||
' End If
|
||||
ToggleDatabasePage(True)
|
||||
End With
|
||||
End Sub
|
||||
|
||||
|
||||
Function GetConnection(sDBName as String)
|
||||
Dim oInteractionHandler as Object
|
||||
Dim bExitLoop as Boolean
|
||||
Dim bGetConnection as Boolean
|
||||
Dim iMsg as Integer
|
||||
Dim Nulllist()
|
||||
If Not IsNull(oDBConnection) Then
|
||||
oDBConnection.Dispose()
|
||||
End If
|
||||
oDataSource = oDBContext.GetByName(sDBName)
|
||||
' If Not oDBContext.hasbyName(sDBName) Then
|
||||
' GetConnection() = False
|
||||
' Exit Function
|
||||
' End If
|
||||
If Not oDataSource.IsPasswordRequired Then
|
||||
oDBConnection = oDBContext.GetByName(sDBName).GetConnection("","")
|
||||
GetConnection() = True
|
||||
Else
|
||||
oInteractionHandler = createUnoService("com.sun.star.task.InteractionHandler")
|
||||
oDataSource = oDBContext.GetByName(sDBName)
|
||||
On Local Error Goto NOCONNECTION
|
||||
Do
|
||||
bExitLoop = True
|
||||
oDBConnection = oDataSource.ConnectWithCompletion(oInteractionHandler)
|
||||
NOCONNECTION:
|
||||
bGetConnection = Err = 0
|
||||
If bGetConnection Then
|
||||
bGetConnection = Not IsNull(oDBConnection)
|
||||
If Not bGetConnection Then
|
||||
Exit Do
|
||||
End If
|
||||
End If
|
||||
If Not bGetConnection Then
|
||||
iMsg = Msgbox (sMsgNoConnection,32 + 2, sMsgWizardName)
|
||||
bExitLoop = iMsg = SBCANCEL
|
||||
Resume CLERROR
|
||||
CLERROR:
|
||||
End If
|
||||
Loop Until bExitLoop
|
||||
On Local Error Goto 0
|
||||
If Not bGetConnection Then
|
||||
DialogModel.lstTables.StringItemList() = Array(sSelectDBTable)
|
||||
DialogModel.lstFields.StringItemList() = NullList()
|
||||
DialogModel.lstSelFields.StringItemList() = NullList()
|
||||
End If
|
||||
GetConnection() = bGetConnection
|
||||
End If
|
||||
End Function
|
||||
|
||||
|
||||
Function GetDBMetaData()
|
||||
If oDBContext.HasElements Then
|
||||
Tablenames() = oDBConnection.Tables.ElementNames()
|
||||
Querynames() = oDBConnection.Queries.ElementNames()
|
||||
GetDBMetaData = True
|
||||
Else
|
||||
MsgBox(sMsgErrNoDatabase, 64, sMsgWizardName)
|
||||
GetDBMetaData = False
|
||||
End If
|
||||
End Function
|
||||
|
||||
|
||||
Sub GetTableMetaData()
|
||||
Dim iType as Long
|
||||
Dim m as Integer
|
||||
Dim Found as Boolean
|
||||
Dim i as Integer
|
||||
Dim sFieldName as String
|
||||
Dim n as Integer
|
||||
Dim WidthIndex as Integer
|
||||
Dim oField as Object
|
||||
MaxIndex = Ubound(DialogModel.lstSelFields.StringItemList())
|
||||
Dim ColumnMap(MaxIndex)as Integer
|
||||
FieldNames() = DialogModel.lstSelFields.StringItemList()
|
||||
' Build a structure which maps the position of a selected field (within the selection) to the the column position within
|
||||
' the table. So we ensure that the controls are placed in the same order the according fields are selected.
|
||||
For i = 0 To Ubound(FieldNames())
|
||||
sFieldName = FieldNames(i)
|
||||
Found = False
|
||||
n = 0
|
||||
While (n< MaxIndex And (Not Found))
|
||||
If (FieldNames(n) = sFieldName) Then
|
||||
Found = True
|
||||
ColumnMap(n) = i
|
||||
End If
|
||||
n = n + 1
|
||||
Wend
|
||||
Next i
|
||||
For n = 0 to MaxIndex
|
||||
sFieldname = FieldNames(n)
|
||||
oField = oColumns.GetByName(sFieldName)
|
||||
iType = oField.Type
|
||||
FieldMetaValues(n,0) = oField.Type
|
||||
FieldMetaValues(n,1) = AssignFieldLength(oField.Precision)
|
||||
FieldMetaValues(n,2) = GetValueoutofList(iType, WidthList(),1, WidthIndex)
|
||||
FieldMetaValues(n,3) = WidthList(WidthIndex,3)
|
||||
FieldMetaValues(n,4) = oField.FormatKey
|
||||
FieldMetaValues(n,5) = oField.DefaultValue
|
||||
FieldMetaValues(n,6) = oField.IsCurrency
|
||||
FieldMetaValues(n,7) = oField.Scale
|
||||
' If oField.Description <> "" Then
|
||||
'' Todo: What's wrong with this line?
|
||||
' Msgbox oField.Helptext
|
||||
' End If
|
||||
FieldMetaValues(n,8) = oField.Description
|
||||
Next
|
||||
ReDim oDBShapeList(MaxIndex) as Object
|
||||
ReDim oTCShapeList(MaxIndex) as Object
|
||||
ReDim oDBModelList(MaxIndex) as Object
|
||||
ReDim oGroupShapeList(MaxIndex) as Object
|
||||
End Sub
|
||||
|
||||
|
||||
Function GetSpecificFieldNames() as Integer
|
||||
Dim n as Integer
|
||||
Dim m as Integer
|
||||
Dim s as Integer
|
||||
Dim iType as Integer
|
||||
Dim oField as Object
|
||||
Dim MaxIndex as Integer
|
||||
Dim EmptyList()
|
||||
If Ubound(DialogModel.lstTables.StringItemList()) > -1 Then
|
||||
FieldNames() = oColumns.GetElementNames()
|
||||
MaxIndex = Ubound(FieldNames())
|
||||
If MaxIndex <> -1 Then
|
||||
Dim ResultFieldNames(MaxIndex)
|
||||
ReDim ImgFieldNames(MaxIndex)
|
||||
m = 0
|
||||
For n = 0 To MaxIndex
|
||||
oField = oColumns.GetByName(FieldNames(n))
|
||||
iType = oField.Type
|
||||
If GetIndexInMultiArray(WidthList(), iType, 0) <> -1 Then
|
||||
ResultFieldNames(m) = FieldNames(n)
|
||||
m = m + 1
|
||||
End If
|
||||
If GetIndexInMultiArray(ImgWidthList(), iType, 0) <> -1 Then
|
||||
ImgFieldNames(s) = FieldNames(n)
|
||||
s = s + 1
|
||||
End If
|
||||
Next n
|
||||
If s <> 0 Then
|
||||
Redim Preserve ImgFieldNames(s-1)
|
||||
bEnableBinaryOptionGroup = True
|
||||
Else
|
||||
bEnableBinaryOptionGroup = False
|
||||
End If
|
||||
If (DialogModel.optBinariesasGraphics.State = 1) And (s <> 0) Then
|
||||
ResultFieldNames() = AddListToList(ResultFieldNames(), ImgFieldNames())
|
||||
Else
|
||||
Redim Preserve ResultFieldNames(m-1)
|
||||
End If
|
||||
FieldNames() = ResultFieldNames()
|
||||
DialogModel.lstFields.StringItemList = FieldNames()
|
||||
InitializeListboxProcedures(DialogModel, DialogModel.lstFields, DialogModel.lstSelFields)
|
||||
End If
|
||||
GetSpecificFieldNames = MaxIndex
|
||||
Else
|
||||
GetSpecificFieldNames = -1
|
||||
End If
|
||||
End Function
|
||||
|
||||
|
||||
Sub CreateDBForm()
|
||||
If oDrawPage.Forms.Count = 0 Then
|
||||
oDBForm = oDocument.CreateInstance("com.sun.star.form.component.Form")
|
||||
oDrawpage.Forms.InsertByIndex (0, oDBForm)
|
||||
Else
|
||||
oDBForm = oDrawPage.Forms.GetByIndex(0)
|
||||
End If
|
||||
oDBForm.Name = "Standard"
|
||||
oDBForm.DataSourceName = sDBName
|
||||
oDBForm.Command = TableName
|
||||
oDBForm.CommandType = CurCommandType
|
||||
End Sub
|
||||
|
||||
|
||||
Sub AddOrRemoveBinaryFieldsToWidthList()
|
||||
Dim LocWidthList()
|
||||
Dim MaxIndex as Integer
|
||||
Dim OldMaxIndex as Integer
|
||||
Dim s as Integer
|
||||
Dim n as Integer
|
||||
Dim m as Integer
|
||||
If Not bDebug Then
|
||||
On Local Error GoTo WIZARDERROR
|
||||
End If
|
||||
If DialogModel.optBinariesasGraphics.State = 1 Then
|
||||
OldMaxIndex = Ubound(WidthList(),1)
|
||||
If OldMaxIndex = 15 Then
|
||||
MaxIndex = Ubound(WidthList(),1) + Ubound(ImgWidthList(),1) + 1
|
||||
ReDim Preserve WidthList(MaxIndex,4)
|
||||
s = 0
|
||||
For n = OldMaxIndex + 1 To MaxIndex
|
||||
For m = 0 To 3
|
||||
WidthList(n,m) = ImgWidthList(s,m)
|
||||
Next m
|
||||
s = s + 1
|
||||
Next n
|
||||
MergeList(DialogModel.lstFields, ImgFieldNames())
|
||||
End If
|
||||
Else
|
||||
ReDim Preserve WidthList(15, 4)
|
||||
RemoveListItems(DialogModel.lstFields(), DialogModel.lstSelFields(), ImgFieldNames())
|
||||
End If
|
||||
DialogModel.lstSelFields.Tag = True
|
||||
WIZARDERROR:
|
||||
If Err <> 0 Then
|
||||
Msgbox(sMsgErrMsg, 16, GetProductName())
|
||||
Resume LOCERROR
|
||||
LOCERROR:
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Function CreateCommandTypeList()
|
||||
Dim MaxTableIndex as Integer
|
||||
Dim MaxQueryIndex as Integer
|
||||
Dim MaxIndex as Integer
|
||||
Dim i as Integer
|
||||
Dim a as Integer
|
||||
MaxTableIndex = Ubound(TableNames()
|
||||
MaxQueryIndex = Ubound(QueryNames()
|
||||
MaxIndex = MaxTableIndex + MaxQueryIndex + 1
|
||||
If MaxIndex > -1 Then
|
||||
Dim LocCommandTypes(MaxIndex) as Integer
|
||||
For i = 0 To MaxTableIndex
|
||||
LocCommandTypes(i) = com.sun.star.sdb.CommandType.TABLE
|
||||
Next i
|
||||
a = i
|
||||
For i = 0 To MaxQueryIndex
|
||||
LocCommandTypes(a) = com.sun.star.sdb.CommandType.QUERY
|
||||
a = a + 1
|
||||
Next i
|
||||
End If
|
||||
CreateCommandTypeList() = LocCommandTypes()
|
||||
End Function
|
||||
|
||||
|
||||
Sub GetCurrentMetaValues(Index as Integer)
|
||||
CurFieldType = FieldMetaValues(Index,0)
|
||||
CurFieldLength = FieldMetaValues(Index,1)
|
||||
CurControlType = FieldMetaValues(Index,2)
|
||||
CurControlName = FieldMetaValues(Index,3)
|
||||
CurFormatKey = FieldMetaValues(Index,4)
|
||||
CurDefaultValue = FieldMetaValues(Index,5)
|
||||
CurIsCurrency = FieldMetaValues(Index,6)
|
||||
CurScale = FieldMetaValues(Index,7)
|
||||
CurHelpText = FieldMetaValues(Index,8)
|
||||
CurFieldName = FieldNames(Index)
|
||||
End Sub
|
||||
|
||||
|
||||
Function AssignFieldLength(FieldLength as Long) as Integer
|
||||
If FieldLength >= 65535 Then
|
||||
AssignFieldLength() = -1
|
||||
Else
|
||||
AssignFieldLength() = FieldLength
|
||||
End If
|
||||
End Function
|
||||
</script:module>
|
||||
@@ -0,0 +1,122 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE dlg:window PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "dialog.dtd">
|
||||
<!--***********************************************************
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
***********************************************************-->
|
||||
<dlg:window xmlns:dlg="http://openoffice.org/2000/dialog" xmlns:script="http://openoffice.org/2000/script" dlg:id="DlgFormDB" dlg:left="96" dlg:top="28" dlg:width="270" dlg:height="210" dlg:page="1" dlg:help-url="HID:WIZARDS_HID_DLGFORM_DIALOG" dlg:closeable="true" dlg:moveable="true">
|
||||
<dlg:bulletinboard>
|
||||
<dlg:text dlg:id="lblSelFields" dlg:tab-index="10" dlg:left="154" dlg:top="70" dlg:width="110" dlg:height="8" dlg:page="1" dlg:value="lblSelFields"/>
|
||||
<dlg:menulist dlg:id="lstTables" dlg:tab-index="3" dlg:left="6" dlg:top="51" dlg:width="110" dlg:height="12" dlg:page="1" dlg:help-url="HID:WIZARDS_HID_DLGFORM_MASTER_LBTABLES" dlg:spin="true">
|
||||
<script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.script:FormWizard.FormWizard.FormGetFields?language=Basic&location=application" script:language="Script"/>
|
||||
<script:event script:event-name="on-mousedown" script:macro-name="vnd.sun.star.script:FormWizard.FormWizard.DeleteFirstTableListBoxEntry?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:menulist>
|
||||
<dlg:img dlg:id="imgTheme" dlg:tab-index="1" dlg:left="6" dlg:top="6" dlg:width="258" dlg:height="26" dlg:scale-image="false"/>
|
||||
<dlg:button dlg:id="cmdCancel" dlg:tab-index="33" dlg:left="6" dlg:top="190" dlg:width="53" dlg:height="14" dlg:help-url="HID:34401" dlg:value="cmdCancel" dlg:button-type="cancel"/>
|
||||
<dlg:button dlg:id="cmdHelp" dlg:tab-index="34" dlg:left="63" dlg:top="190" dlg:width="53" dlg:height="14" dlg:tag="34400" dlg:value="cmdHelp" dlg:button-type="help"/>
|
||||
<dlg:button dlg:id="cmdBack" dlg:tab-index="35" dlg:left="155" dlg:top="190" dlg:width="53" dlg:height="14" dlg:help-url="HID:WIZARDS_HID_DLGFORM_CMDPREV" dlg:value="cmdBack">
|
||||
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:FormWizard.FormWizard.PreviousStep?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:button>
|
||||
<dlg:button dlg:id="cmdGoOn" dlg:tab-index="36" dlg:left="211" dlg:top="190" dlg:width="53" dlg:height="14" dlg:help-url="HID:WIZARDS_HID_DLGFORM_CMDNEXT" dlg:value="cmdGoOn">
|
||||
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:FormWizard.FormWizard.NextStep?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:button>
|
||||
<dlg:text dlg:id="lblTables" dlg:tab-index="2" dlg:left="6" dlg:top="40" dlg:width="72" dlg:height="8" dlg:page="1" dlg:value="lblTables"/>
|
||||
<dlg:text dlg:id="lblFields" dlg:tab-index="4" dlg:left="6" dlg:top="70" dlg:width="109" dlg:height="8" dlg:page="1" dlg:value="lblFields"/>
|
||||
<dlg:button dlg:id="cmdMoveSelected" dlg:tab-index="6" dlg:left="122" dlg:top="84" dlg:width="25" dlg:height="14" dlg:page="1" dlg:help-url="HID:WIZARDS_HID_DLGFORM_OPTONEXISTINGRELATION" dlg:value="->">
|
||||
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:Tools.Listbox.FormMoveSelected?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:button>
|
||||
<dlg:button dlg:id="cmdMoveAll" dlg:tab-index="7" dlg:left="122" dlg:top="101" dlg:width="25" dlg:height="14" dlg:page="1" dlg:help-url="HID:WIZARDS_HID_DLGFORM_OPTSELECTMANUALLY" dlg:value="=>>">
|
||||
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:Tools.Listbox.FormMoveAll?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:button>
|
||||
<dlg:button dlg:id="cmdRemoveSelected" dlg:tab-index="8" dlg:left="122" dlg:top="118" dlg:width="25" dlg:height="14" dlg:page="1" dlg:help-url="HID:WIZARDS_HID_DLGFORM_lstRELATIONS" dlg:value="<-">
|
||||
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:Tools.Listbox.FormRemoveSelected?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:button>
|
||||
<dlg:button dlg:id="cmdRemoveAll" dlg:tab-index="9" dlg:left="122" dlg:top="135" dlg:width="25" dlg:height="14" dlg:page="1" dlg:help-url="HID:34425" dlg:value="<<=">
|
||||
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:Tools.Listbox.FormRemoveAll?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:button>
|
||||
<dlg:radiogroup>
|
||||
<dlg:radio dlg:id="optIgnoreBinaries" dlg:tab-index="14" dlg:left="122" dlg:top="169" dlg:width="104" dlg:height="10" dlg:page="1" dlg:help-url="HID:34427" dlg:value="optIgnoreBinaries" dlg:checked="true">
|
||||
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:FormWizard.DBMeta.AddOrRemoveBinaryFieldsToWidthList?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:radio>
|
||||
<dlg:radio dlg:id="optBinariesasGraphics" dlg:tab-index="13" dlg:left="12" dlg:top="169" dlg:width="104" dlg:height="10" dlg:page="1" dlg:help-url="HID:34426" dlg:value="optBinariesasGraphics">
|
||||
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:FormWizard.DBMeta.AddOrRemoveBinaryFieldsToWidthList?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:radio>
|
||||
</dlg:radiogroup>
|
||||
<dlg:menulist dlg:id="lstFields" dlg:tab-index="5" dlg:left="6" dlg:top="81" dlg:width="110" dlg:height="70" dlg:page="1" dlg:help-url="HID:34420" dlg:multiselection="true">
|
||||
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:Tools.Listbox.FormMoveSelected?language=Basic&location=application" script:language="Script"/>
|
||||
<script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.script:Tools.Listbox.FormSetMoveRights?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:menulist>
|
||||
<dlg:menulist dlg:id="lstSelFields" dlg:tab-index="11" dlg:left="154" dlg:top="81" dlg:width="110" dlg:height="70" dlg:page="1" dlg:help-url="HID:WIZARDS_HID_DLGFORM_CHKCREATESUBFORM" dlg:multiselection="true">
|
||||
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:Tools.Listbox.FormRemoveSelected?language=Basic&location=application" script:language="Script"/>
|
||||
<script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.script:Tools.Listbox.FormSetMoveRights?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:menulist>
|
||||
<dlg:text dlg:id="lblStyles" dlg:tab-index="25" dlg:left="150" dlg:top="39" dlg:width="114" dlg:height="8" dlg:page="2" dlg:value="lblStyles"/>
|
||||
<dlg:button dlg:id="cmdArrange1" dlg:tab-index="16" dlg:left="12" dlg:top="50" dlg:width="23" dlg:height="25" dlg:page="2" dlg:tag="1" dlg:help-url="HID:WIZARDS_HID_DLGFORM_SUB_LBTABLES">
|
||||
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:FormWizard.Layouter.ChangeArrangemode?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:button>
|
||||
<dlg:button dlg:id="cmdArrange2" dlg:tab-index="17" dlg:left="39" dlg:top="50" dlg:width="23" dlg:height="25" dlg:page="2" dlg:tag="2" dlg:help-url="HID:WIZARDS_HID_DLGFORM_SUB_FIELDSAVAILABLE">
|
||||
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:FormWizard.Layouter.ChangeArrangemode?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:button>
|
||||
<dlg:button dlg:id="cmdArrange3" dlg:tab-index="18" dlg:left="66" dlg:top="50" dlg:width="23" dlg:height="25" dlg:page="2" dlg:tag="3" dlg:help-url="HID:WIZARDS_HID_DLGFORM_SUB_CMDMOVESELECTED">
|
||||
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:FormWizard.Layouter.ChangeArrangemode?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:button>
|
||||
<dlg:button dlg:id="cmdArrange4" dlg:tab-index="19" dlg:left="93" dlg:top="50" dlg:width="23" dlg:height="25" dlg:page="2" dlg:tag="4" dlg:help-url="HID:WIZARDS_HID_DLGFORM_SUB_CMDMOVEALL">
|
||||
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:FormWizard.Layouter.ChangeArrangemode?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:button>
|
||||
<dlg:button dlg:id="cmdArrange5" dlg:tab-index="20" dlg:left="120" dlg:top="50" dlg:width="23" dlg:height="25" dlg:page="2" dlg:tag="5" dlg:help-url="HID:WIZARDS_HID_DLGFORM_SUB_CMDREMOVESELECTED">
|
||||
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:FormWizard.Layouter.ChangeArrangemode?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:button>
|
||||
<dlg:menulist dlg:id="lstStyles" dlg:tab-index="26" dlg:left="150" dlg:top="50" dlg:width="114" dlg:height="86" dlg:page="2" dlg:help-url="HID:WIZARDS_HID_DLGFORM_LINKER_LSTSLAVELINK2">
|
||||
<script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.script:FormWizard.tools.ImportStyles?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:menulist>
|
||||
<dlg:radiogroup>
|
||||
<dlg:radio dlg:id="optBorder0" dlg:tab-index="22" dlg:left="12" dlg:top="95" dlg:width="131" dlg:height="10" dlg:page="2" dlg:help-url="HID:WIZARDS_HID_DLGFORM_SUB_CMDMOVEUP" dlg:value="optBorder0">
|
||||
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:FormWizard.Layouter.ChangeBorderLayouts?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:radio>
|
||||
<dlg:radio dlg:id="optBorder1" dlg:tab-index="23" dlg:left="12" dlg:top="109" dlg:width="131" dlg:height="10" dlg:page="2" dlg:help-url="HID:WIZARDS_HID_DLGFORM_SUB_CMDMOVEDOWN" dlg:value="optBorder1">
|
||||
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:FormWizard.Layouter.ChangeBorderLayouts?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:radio>
|
||||
<dlg:radio dlg:id="optBorder2" dlg:tab-index="24" dlg:left="12" dlg:top="123" dlg:width="131" dlg:height="10" dlg:page="2" dlg:help-url="HID:34440" dlg:value="optBorder2">
|
||||
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:FormWizard.Layouter.ChangeBorderLayouts?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:radio>
|
||||
</dlg:radiogroup>
|
||||
<dlg:fixedline dlg:id="hlnBinaries" dlg:tab-index="12" dlg:left="6" dlg:top="158" dlg:width="258" dlg:height="8" dlg:page="1" dlg:value="hlnBinaries"/>
|
||||
<dlg:radiogroup>
|
||||
<dlg:radio dlg:id="optTiled" dlg:tab-index="31" dlg:left="156" dlg:top="154" dlg:width="81" dlg:height="10" dlg:page="2" dlg:tag="11" dlg:help-url="HID:WIZARDS_HID_DLGFORM_LINKER_LSTMASTERLINK2" dlg:value="optTiled" dlg:checked="true">
|
||||
<script:event script:event-name="on-mouseup" script:macro-name="vnd.sun.star.script:WebWizard.Common.SetBackGraphicStyle?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:radio>
|
||||
<dlg:radio dlg:id="optArea" dlg:tab-index="32" dlg:left="156" dlg:top="168" dlg:width="81" dlg:height="10" dlg:page="2" dlg:tag="10" dlg:help-url="HID:WIZARDS_HID_DLGFORM_LINKER_LSTSLAVELINK3" dlg:value="optArea">
|
||||
<script:event script:event-name="on-mouseup" script:macro-name="vnd.sun.star.script:WebWizard.Common.SetBackGraphicStyle?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:radio>
|
||||
</dlg:radiogroup>
|
||||
<dlg:fixedline dlg:id="hlnBackground" dlg:tab-index="30" dlg:left="150" dlg:top="143" dlg:width="114" dlg:height="8" dlg:page="2" dlg:value="hlnBackground"/>
|
||||
<dlg:fixedline dlg:id="hlnAlign" dlg:tab-index="27" dlg:left="6" dlg:top="143" dlg:width="137" dlg:height="8" dlg:page="2" dlg:value="hlnAlign"/>
|
||||
<dlg:fixedline dlg:id="hlnBorderLayout" dlg:tab-index="21" dlg:left="6" dlg:top="83" dlg:width="137" dlg:height="8" dlg:page="2" dlg:value="hlnBorderLayout"/>
|
||||
<dlg:fixedline dlg:id="hlnArrangements" dlg:tab-index="15" dlg:left="6" dlg:top="39" dlg:width="137" dlg:height="8" dlg:page="2" dlg:value="hlnArrangements"/>
|
||||
<dlg:radiogroup>
|
||||
<dlg:radio dlg:id="optAlign0" dlg:tab-index="28" dlg:left="12" dlg:top="154" dlg:width="131" dlg:height="10" dlg:page="2" dlg:help-url="HID:WIZARDS_HID_DLGFORM_LINKER_LSTSLAVELINK1" dlg:value="optAlign0">
|
||||
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:FormWizard.Layouter.ChangeLabelAlignments?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:radio>
|
||||
<dlg:radio dlg:id="optAlign2" dlg:tab-index="29" dlg:left="12" dlg:top="168" dlg:width="131" dlg:height="10" dlg:page="2" dlg:help-url="HID:WIZARDS_HID_DLGFORM_LINKER_LSTMASTERLINK1" dlg:value="optAlign2">
|
||||
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:FormWizard.Layouter.ChangeLabelAlignments?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:radio>
|
||||
</dlg:radiogroup>
|
||||
<dlg:fixedline dlg:id="FixedLine1" dlg:tab-index="0" dlg:left="6" dlg:top="180" dlg:width="258" dlg:height="6"/>
|
||||
</dlg:bulletinboard>
|
||||
</dlg:window>
|
||||
@@ -0,0 +1,447 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
|
||||
<!--***********************************************************
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
***********************************************************-->
|
||||
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="FormWizard" script:language="StarBasic">Option Explicit
|
||||
|
||||
Public DocumentName as String
|
||||
Public FormPath as String
|
||||
Public WizardPath as String
|
||||
Public WebWizardPath as String
|
||||
Public WorkPath as String
|
||||
Public TempPath as String
|
||||
Public TexturePath as String
|
||||
Public sQueryName as String
|
||||
Public oDBConnection as Object
|
||||
Public bWithBackGraphic as Boolean
|
||||
Public bNeedFieldRefresh as Boolean
|
||||
Public oDBForm as Object
|
||||
Public oColumns() as Object
|
||||
Public sDatabaseList() as String
|
||||
Public TableNames() as String
|
||||
Public QueryNames() as String
|
||||
Public FieldNames() as String
|
||||
Public ImgFieldNames() as String
|
||||
Public oDBContext as Object
|
||||
Public oUcb as Object
|
||||
Public oDocInfo as Object
|
||||
Public WidthList(15,3)
|
||||
Public ImgWidthList(3,3)
|
||||
Public sDBName as String
|
||||
Public Tablename as String
|
||||
Public Const SBSIZETEXT = "The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog."
|
||||
Public bDisposeDoc as Boolean
|
||||
Public bDebug as Boolean
|
||||
'Public bStartUp as Boolean
|
||||
Public bConnectionIsovergiven as Boolean
|
||||
Public FormName As String
|
||||
Public sFormUrl as String
|
||||
Public oFormDocuments
|
||||
|
||||
|
||||
' The macro can be called in 4 possible scenarios:
|
||||
' Scenario 1. No parameters at given
|
||||
' Scenario 2: Only Datasourcename is given, but no connection and no Content
|
||||
' Scenario 3: a data source and a connection are given
|
||||
' Scenario 4: all parameters (data source name, connection, object type and object) are given
|
||||
|
||||
Sub Main()
|
||||
Dim oLocDBContext as Object
|
||||
Dim oLocConnection as Object
|
||||
|
||||
' Scenario 1. No parameters at given
|
||||
MainWithDefault()
|
||||
|
||||
' Scenario 2: Only Datasourcename is given, but no connection and no Content
|
||||
' MainWithDefault("Bibliography")
|
||||
|
||||
' Scenario 3: a data source and a connection are given
|
||||
' oLocDBContext = CreateUnoService("com.sun.star.sdb.DatabaseContext")
|
||||
' oLocConnection = oLocDBContext.GetByName("Bibliography").GetConnection("","")
|
||||
' MainWithDefault("Bibliography", oLocConnection)
|
||||
|
||||
' Scenario 4: all parameters (data source name, connection, object type and object) are given
|
||||
' oLocDBContext = CreateUnoService("com.sun.star.sdb.DatabaseContext")
|
||||
' oLocConnection = oLocDBContext.GetByName("Bibliography").GetConnection("","")
|
||||
' MainWithDefault("Bibliography", oLocConnection, com.sun.star.sdb.CommandType.TABLE, "biblio")
|
||||
End Sub
|
||||
|
||||
|
||||
Sub MainWithDefault(Optional DatasourceName as String, Optional oConnection as Object, Optional CommandType as Integer, Optional sContent as String)
|
||||
Dim i as Integer
|
||||
Dim SelCount as Integer
|
||||
Dim RetValue as Integer
|
||||
Dim SelList(0) as Integer
|
||||
Dim LocList() as String
|
||||
SelList(0) = 0
|
||||
BasicLibraries.LoadLibrary("Tools")
|
||||
BasicLibraries.LoadLibrary("WebWizard")
|
||||
bDebug = False
|
||||
If Not bDebug Then
|
||||
On Local Error GoTo WIZARDERROR
|
||||
End If
|
||||
OpenFormDocument()
|
||||
CurArrangement = 0
|
||||
bControlsareCreated = False
|
||||
bEnableBinaryOptionGroup = False
|
||||
bDisposeDoc = True
|
||||
MaxIndex = -1
|
||||
If Not InitResources("Formwizard","dbw") Then
|
||||
Exit Sub
|
||||
End If
|
||||
oDBContext = CreateUnoService("com.sun.star.sdb.DatabaseContext")
|
||||
oUcb = createUnoService("com.sun.star.ucb.SimpleFileAccess")
|
||||
If GetFormWizardPaths() = False Then
|
||||
Exit Sub
|
||||
End If
|
||||
oDocument.GetCurrentController().Frame.ComponentWindow.Enable = False
|
||||
oProgressBar.Value = 10
|
||||
LoadLanguage()
|
||||
oProgressBar.Value = 20
|
||||
InitializeWidthList()
|
||||
oProgressBar.Value = 30
|
||||
Styles() = getListBoxArrays(oUcb, "/stl")
|
||||
CurIndex = GetCurIndex(DialogModel, Styles(), 2)
|
||||
oProgressBar.Value = 40
|
||||
ConfigurePageStyle()
|
||||
oProgressBar.Value = 50
|
||||
InitializeLabelValues()
|
||||
bNeedFieldRefresh = True
|
||||
SetDialogLanguage()
|
||||
' bStartUp = true
|
||||
With DialogModel
|
||||
.cmdBack.Enabled = False
|
||||
.cmdGoOn.Enabled = False
|
||||
.lblTables.Enabled = False
|
||||
.lstSelFields.Tag = False
|
||||
.Step = 1
|
||||
End With
|
||||
oProgressBar.Value = 60
|
||||
bConnectionIsovergiven = Not IsMissing(oConnection)
|
||||
If Not IsMissing(DataSourceName) Then
|
||||
sDBName = DataSourceName
|
||||
If Not IsMissing(oConnection) Then
|
||||
' Scenario 3: a data source and a connection are given
|
||||
Set oDBConnection = oConnection
|
||||
oDataSource = oDBContext.GetByName(DataSourceName)
|
||||
DialogModel.lstTables.Enabled = True
|
||||
DialogModel.lblTables.Enabled = True
|
||||
If GetDBMetaData() Then
|
||||
LocList() = AddListToList(TableNames(), QueryNames())
|
||||
iCommandTypes = CreateCommandTypeList()
|
||||
If Not IsMissing(sContent) Then
|
||||
' Scenario 4: all parameters (data source name, connection, object type and object) are given
|
||||
DialogModel.lstTables.StringItemList() = LocList()
|
||||
iCommandTypes() = CreateCommandTypeList()
|
||||
SelCount = CountItemsInArray(DialogModel.lstTables.StringItemList(), sContent)
|
||||
If SelCount = 1 Then
|
||||
DlgFormDB.GetControl("lstTables").SelectItem(sContent, True)
|
||||
Else
|
||||
If CommandType = com.sun.star.sdb.CommandType.QUERY Then
|
||||
SelIndex = IndexInArray(sContent, QueryNames()
|
||||
DlgFormDB.GetControl("lstTables").SelectItemPos(SelIndex, True)
|
||||
ElseIf CommandType = com.sun.star.sdb.CommandType.TABLE Then
|
||||
SelIndex = IndexInArray(sContent, TableNames()
|
||||
DlgFormDB.GetControl("lstTables").SelectItemPos(Ubound(QueryNames()+1 + SelIndex, True)
|
||||
End If
|
||||
End If
|
||||
CurCommandType = CommandType
|
||||
FillUpFieldsListbox(False)
|
||||
Else
|
||||
LocList() = AddListToList(Array(sSelectDBTable), LocList())
|
||||
DialogModel.lstTables.StringItemList() = LocList()
|
||||
' bSelectContent = True
|
||||
DialogModel.lstTables.SelectedItems() = Array(0)
|
||||
|
||||
End If
|
||||
End If
|
||||
Else
|
||||
' Scenario 2: Only Datasourcename is given, but no connection and no Content
|
||||
GetSelectedDBMetaData(sDBName)
|
||||
End If
|
||||
Else
|
||||
' Scenario 1: No parameters are given
|
||||
ToggleListboxControls(DialogModel, False)
|
||||
End If
|
||||
oProgressBar.Value = 80
|
||||
bWithBackGraphic = LoadNewStyles(oDocument, DialogModel, CurIndex, Styles(CurIndex, 8), Styles(), TexturePath)
|
||||
DlgFormDB.Title = WizardTitle(1)
|
||||
DialogModel.lstStyles.StringItemList() = ArrayfromMultiArray(Styles, 1)
|
||||
DialogModel.lstStyles.SelectedItems() = SelList()
|
||||
ControlCaptionsToStandardLayout()
|
||||
oDocument.GetCurrentController().Frame.ComponentWindow.Enable = True
|
||||
oProgressBar.Value = 90
|
||||
DialogModel.imgTheme.ImageURL = FormPath & "FormWizard_1.bmp"
|
||||
DialogModel.imgTheme.BackGroundColor = RGB(0,60,126)
|
||||
ToggleDatabasePage(True)
|
||||
oProgressBar.Value = 100
|
||||
DlgFormDB.GetControl("lstTables").SetFocus()
|
||||
oProgressbar.End
|
||||
RetValue = DlgFormDB.Execute()
|
||||
DlgFormDB.Dispose()
|
||||
If bDisposeDoc Then
|
||||
Dim aPropertyValues(2) as new com.sun.star.beans.PropertyValue
|
||||
oFormDocuments = oDataSource.getFormDocuments()
|
||||
DlgFormDB.Dispose()
|
||||
oDocument.dispose()
|
||||
Dim bLinkExists as Boolean
|
||||
i = 1
|
||||
Dim FormBaseName as String
|
||||
FormBaseName = FormName
|
||||
Do
|
||||
bLinkExists = oFormDocuments.HasbyHierarchicalName(FormName)
|
||||
If bLinkExists Then
|
||||
i = i + 1
|
||||
FormName = FormBaseName & "_" & i
|
||||
End If
|
||||
Loop Until Not bLinkExists
|
||||
aPropertyValues(0).Name = "Name"
|
||||
aPropertyValues(0).Value = FormName
|
||||
aPropertyValues(1).Name = "Parent"
|
||||
aPropertyValues(1).Value = oFormDocuments()
|
||||
aPropertyValues(2).Name = "URL"
|
||||
aPropertyValues(2).Value = sFormUrl
|
||||
Dim oDBDocument
|
||||
oDBDocument = oFormDocuments.createInstanceWithArguments("com.sun.star.sdb.DocumentDefinition", aPropertyValues())
|
||||
oFormDocuments.insertbyName(FormName, oDBDocument)
|
||||
ElseIf RetValue = 0 Then
|
||||
RemoveNirwanaShapes()
|
||||
End If
|
||||
If ((Not IsNull(oDBConnection)) And (Not bConnectionIsovergiven)) Then
|
||||
oDBConnection.Dispose()
|
||||
End If
|
||||
WIZARDERROR:
|
||||
If Err <> 0 Then
|
||||
Msgbox(sMsgErrMsg, 16, GetProductName())
|
||||
Resume LOCERROR
|
||||
LOCERROR:
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Sub FormGetFields()
|
||||
Dim i as Integer
|
||||
' If bSelectContent Then
|
||||
' bSelectContent = False
|
||||
' Exit Sub
|
||||
' End If
|
||||
DeleteFirstListBoxEntry("lstTables", sSelectDBTable)
|
||||
ToggleDatabasePage(False)
|
||||
FillUpFieldsListbox(True)
|
||||
ToggleDatabasePage(True)
|
||||
End Sub
|
||||
|
||||
|
||||
Sub FillUpFieldsListbox(bGetCommandType as Boolean)
|
||||
Dim SelIndex as Integer
|
||||
Dim QueryIndex as Integer
|
||||
If Not bDebug Then
|
||||
On Local Error GoTo NOFIELDS
|
||||
End If
|
||||
SelIndex = DlgFormDB.GetControl("lstTables").getSelectedItemPos() '.SelectedItems())
|
||||
If SelIndex > -1 Then
|
||||
If bGetCommandType Then
|
||||
CurCommandType = iCommandTypes(SelIndex)
|
||||
End If
|
||||
If CurCommandType = com.sun.star.sdb.CommandType.QUERY Then
|
||||
QueryIndex = SelIndex - Ubound(Tablenames()) - 1
|
||||
Tablename = QueryNames(QueryIndex)
|
||||
oColumns = oDBConnection.Queries.GetByName(TableName).Columns
|
||||
Else
|
||||
Tablename = Tablenames(SelIndex)
|
||||
oColumns = oDBConnection.Tables.GetByName(Tablename).Columns
|
||||
End If
|
||||
If GetSpecificFieldNames() <> -1 Then
|
||||
ToggleListboxControls(DialogModel, True)
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
EmptyFieldsListboxes()
|
||||
NOFIELDS:
|
||||
If Err <> 0 Then
|
||||
MsgBox sMsgErrCouldNotOpenObject, 16, sMsgWizardName
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Sub PreviousStep()
|
||||
If Not bDebug Then
|
||||
On Local Error GoTo WIZARDERROR
|
||||
End If
|
||||
With DialogModel
|
||||
.Step = 1
|
||||
.cmdBack.Enabled = False
|
||||
.cmdGoOn.Enabled = True
|
||||
.lstSelFields.Tag = Not bControlsareCreated
|
||||
.cmdGoOn.Label = sGoOn
|
||||
.imgTheme.ImageUrl = FormPath & "FormWizard_1.bmp"
|
||||
End With
|
||||
FormSetMoveRights()
|
||||
WIZARDERROR:
|
||||
If Err <> 0 Then
|
||||
Msgbox(sMsgErrMsg, 16, GetProductName())
|
||||
Resume LOCERROR
|
||||
LOCERROR:
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Sub NextStep()
|
||||
If Not bDebug Then
|
||||
On Local Error GoTo WIZARDERROR
|
||||
End If
|
||||
Select Case DialogModel.Step
|
||||
Case 1
|
||||
bControlsAreCreated = Not (cBool(DialogModel.lstSelFields.Tag))
|
||||
If Not bControlsAreCreated Then
|
||||
GetTableMetaData()
|
||||
CreateDBForm()
|
||||
RemoveShapes()
|
||||
InitializeLayoutSettings()
|
||||
oDBForm.Load
|
||||
End If
|
||||
DialogModel.cmdGoOn.Label = sReady
|
||||
DialogModel.cmdBack.Enabled = True
|
||||
DialogModel.Step = 2
|
||||
bDisposeDoc = False
|
||||
Case 2
|
||||
StoreForm()
|
||||
DlgFormDB.EndExecute()
|
||||
exit Sub
|
||||
End Select
|
||||
DialogModel.imgTheme.ImageUrl = FormPath & "FormWizard_" & DialogModel.Step & ".bmp"
|
||||
DlgFormDB.Title = WizardTitle(DialogModel.Step)
|
||||
WIZARDERROR:
|
||||
If Err <> 0 Then
|
||||
Msgbox(sMsgErrMsg, 16, GetProductName())
|
||||
Resume LOCERROR
|
||||
LOCERROR:
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Sub InitializeLayoutSettings()
|
||||
SwitchArrangementButtons(cTabled)
|
||||
SwitchAlignMode(SBALIGNLEFT)
|
||||
SwitchBorderMode(SB3DBORDER)
|
||||
ToggleBorderGroup(bControlsAreCreated)
|
||||
ToggleAlignGroup(bControlsAreCreated)
|
||||
ArrangeControls()
|
||||
If OldAlignMode <> 0 Then
|
||||
DlgFormDB.GetControl("optAlign2").Model.State = 0
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Sub ToggleDatabasePage(bDoEnable as Boolean)
|
||||
With DialogModel
|
||||
.cmdBack.Enabled = False
|
||||
.cmdHelp.Enabled = bDoEnable
|
||||
.cmdGoOn.Enabled = Ubound(DialogModel.lstSelFields.StringItemList()) <> -1
|
||||
.hlnBinaries.Enabled = ((bDoEnable = True) And (bEnableBinaryOptionGroup = True))
|
||||
.optIgnoreBinaries.Enabled = ((bDoEnable = True) And (bEnableBinaryOptionGroup = True))
|
||||
.optBinariesasGraphics.Enabled = ((bDoEnable = True) And (bEnableBinaryOptionGroup = True))
|
||||
End With
|
||||
End Sub
|
||||
|
||||
|
||||
' This Sub is called from the Procedure "StoreDocument" in the "Tools" Library
|
||||
Sub CommitLastDocumentChanges(sTargetPath as String)
|
||||
Dim i as Integer
|
||||
Dim sBookmarkName as String
|
||||
Dim oDBBookmarks as Object
|
||||
Dim bLinkExists as Boolean
|
||||
Dim sBaseBookmarkName as String
|
||||
sBookmarkName = GetFileNamewithoutExtension(FileNameoutofPath(sTargetPath))
|
||||
sBaseBookmarkName = sBookmarkName
|
||||
oDBBookmarks = oDataSource.GetBookmarks()
|
||||
i = 1
|
||||
Do
|
||||
bLinkExists = oDBBookmarks.HasbyName(sBookmarkName)
|
||||
If bLinkExists Then
|
||||
i = i + 1
|
||||
sBookmarkName = sBaseBookmarkName & "_" & i
|
||||
Else
|
||||
oDBBookmarks.insertByName(sBookmarkName, sTargetPath)
|
||||
End If
|
||||
Loop Until Not bLinkExists
|
||||
bDisposeDoc = False
|
||||
GroupShapesTogether()
|
||||
ToggleDesignMode(oDocument)
|
||||
oDBForm.Reload()
|
||||
End Sub
|
||||
|
||||
|
||||
Sub StoreFormInDatabase()
|
||||
Dim NoArgs() as new com.sun.star.beans.PropertyValue
|
||||
FormName = "Form_" & sDBName & "_" & TableName & ".sxw"
|
||||
sFormUrl = TempPath & "/" & FormName
|
||||
oDocument.StoreAsUrl(sFormUrl, NoArgs())
|
||||
bdisposeDoc = true
|
||||
DlgFormDB.Endexecute()
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Sub StoreForm()
|
||||
Dim sTargetPath as String
|
||||
Dim TypeNames(0,2) as String
|
||||
Dim oMasterKey as Object
|
||||
Dim oTypes() as Object
|
||||
oMasterKey = GetRegistryKeyContent("org.openoffice.TypeDetection.Types/")
|
||||
oTypes() = oMasterKey.Types
|
||||
TypeNames(0,0) = GetFilterName("StarOffice XML (Writer)")
|
||||
TypeNames(0,1) = "*.sxw"
|
||||
TypeNames(0,2) = ""
|
||||
StoreFormInDatabase()
|
||||
' sTargetPath = StoreDocument(oDocument, TypeNames(), "Form_" & sDBName & "_" & TableName & ".sxw", WorkPath, 1)
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Sub EmptyFieldsListboxes()
|
||||
Dim NullList() as String
|
||||
ToggleListboxControls(DialogModel, False)
|
||||
DialogModel.lstFields.StringItemList() = NullList()
|
||||
DialogModel.lstSelFields.StringItemList() = NullList()
|
||||
bEnableBinaryOptionGroup = False
|
||||
End Sub
|
||||
|
||||
|
||||
Sub DeleteFirstTableListBoxEntry()
|
||||
DeleteFirstListBoxEntry("lstTables", sSelectDBTable)
|
||||
End Sub
|
||||
|
||||
Sub DeleteFirstListboxEntry(ListBoxName as String, DelEntryName as String)
|
||||
Dim oListbox as Object
|
||||
Dim sFirstItem as String
|
||||
dim iSelPos as Integer
|
||||
oListBox = DlgFormDB.getControl(ListBoxName)
|
||||
sFirstItem = oListBox.getItem(0)
|
||||
If sFirstItem = DelEntryName Then
|
||||
iSelPos = oListBox.getSelectedItemPos()
|
||||
oListBox.removeItems(0, 1)
|
||||
If iSelPos > 0 Then
|
||||
oListBox.selectItemPos(iSelPos-1, True)
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
</script:module>
|
||||
305
office-plugin/windows-office/share/basic/FormWizard/Language.xba
Normal file
305
office-plugin/windows-office/share/basic/FormWizard/Language.xba
Normal file
@@ -0,0 +1,305 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
|
||||
<!--***********************************************************
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
***********************************************************-->
|
||||
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Language" script:language="StarBasic">Option Explicit
|
||||
|
||||
|
||||
Global Const RID_COMMON = 1000
|
||||
Global Const RID_FORM = 2200
|
||||
|
||||
Public Const SBCANCEL = 2
|
||||
Public Const SBREPEAT = 4
|
||||
Public LabelDiffHeight as Long
|
||||
Public BasicLabelDiffHeight as Long
|
||||
|
||||
Public WizardTitle(1 To 3) as String
|
||||
Public DlgFormDB as Object
|
||||
Public DialogModel as Object
|
||||
|
||||
Dim sMsgWizardName as String
|
||||
Dim sMsgErrMsg as String
|
||||
Dim sMsgErrNoDatabase as String
|
||||
Dim sMsgErrNoTableInDatabase as String
|
||||
Dim sMsgErrTitleSuggestedExist as String
|
||||
Dim sMsgErrTitleSyntaxError as String
|
||||
Dim sMsgErrTitleAsTableExist as String
|
||||
Dim sMsgProgressText as String
|
||||
Dim sMsgCreatedForm as String
|
||||
Dim sMsgErrCouldNotOpenObject as String
|
||||
Dim sMsgErrNameToLong as String
|
||||
Dim sTimeAppendix as String
|
||||
Dim sDateAppendix as String
|
||||
Public sGoOn as String
|
||||
Public sReady as String
|
||||
Public sMsgNoConnection as String
|
||||
Public sWriterFilterName as String
|
||||
Public XPixelFactor as Long
|
||||
Public YPixelFactor as Long
|
||||
Public sSelectDatasource as String
|
||||
Public sSelectDBTable as String
|
||||
|
||||
|
||||
|
||||
Sub LoadLanguage ()
|
||||
sMsgWizardName = GetResText(RID_FORM + 0)
|
||||
sMsgErrMsg = GetResText(RID_COMMON + 6)
|
||||
sMsgErrNoDatabase = GetResText(RID_COMMON + 8)
|
||||
sMsgErrNoTableInDatabase = GetResText(RID_COMMON + 9)
|
||||
sMsgErrTitleSuggestedExist = GetResText(RID_COMMON + 10)
|
||||
sMsgErrTitleAsTableExist = GetResText(RID_COMMON + 10)
|
||||
sMsgErrTitleSyntaxError = GetResText(RID_COMMON + 11)
|
||||
sMsgNoConnection = GetResText(RID_COMMON + 14
|
||||
sMsgProgressText = GetResText(RID_FORM + 2)
|
||||
sMsgCreatedForm = GetResText(RID_FORM + 26)
|
||||
sMsgErrNameToLong = GetResText (RID_FORM + 27)
|
||||
sMsgErrCouldNotOpenObject = GetResText (RID_COMMON + 13)
|
||||
|
||||
' Internal Logic
|
||||
sDateAppendix = GetResText(RID_FORM + 4)
|
||||
sTimeAppendix = GetResText(RID_FORM + 5)
|
||||
|
||||
sReady = GetResText(RID_COMMON + 0)
|
||||
End Sub
|
||||
|
||||
|
||||
Sub SetDialogLanguage ()
|
||||
Dim i as Integer
|
||||
Dim ButtonHelpText as String
|
||||
Dim CmdButton as Object
|
||||
Dim IDArray as Variant
|
||||
Dim FNameAddOn as String
|
||||
Dim slblSelFields as String
|
||||
Dim slblFields as String
|
||||
|
||||
DlgFormDB = LoadDialog("FormWizard", "DlgFormDB")
|
||||
DialogModel = DlgFormDB.Model
|
||||
|
||||
With DialogModel
|
||||
.cmdCancel.Label = GetResText(RID_COMMON + 1)
|
||||
.cmdBack.Label = GetResText(RID_COMMON + 2)
|
||||
.cmdHelp.Label = GetResText(RID_COMMON + 20)
|
||||
sGoOn = GetResText(RID_COMMON + 3)
|
||||
.cmdGoOn.Label = sGoOn
|
||||
.lblTables.Label = GetResText(RID_FORM + 6)
|
||||
|
||||
slblFields = GetResText(RID_FORM + 12)
|
||||
slblSelFields = GetResText(RID_FORM + 13)
|
||||
.lblFields.Label = slblFields
|
||||
.lblSelFields.Label = slblSelFields
|
||||
|
||||
.lblStyles.Label = GetResText(RID_FORM + 21)
|
||||
.hlnBorderLayout.Label = GetResText(RID_FORM + 28)
|
||||
.hlnAlign.Label = GetResText(RID_FORM + 32)
|
||||
.hlnArrangements.Label = GetResText(RID_FORM + 35)
|
||||
|
||||
WizardTitle(1) = sMsgWizardName & " - " & GetResText(RID_FORM + 45)
|
||||
WizardTitle(2) = sMsgWizardName & " - " & GetResText(RID_FORM + 46)
|
||||
WizardTitle(3) = sMsgWizardName & " - " & GetResText(RID_FORM + 47)
|
||||
|
||||
.hlnBinaries.Label = GetResText(RID_FORM + 50)
|
||||
.optIgnoreBinaries.Label = GetResText(RID_FORM + 51)
|
||||
.optBinariesasGraphics.Label = GetResText(RID_FORM + 52)
|
||||
|
||||
.hlnBackground.Label = GetResText(RID_FORM + 55)
|
||||
.optTiled.Label = GetResText(RID_FORM + 56)
|
||||
.optArea.Label = GetResText(RID_FORM + 57)
|
||||
|
||||
.optBorder0.Label = GetResText(RID_FORM + 29)
|
||||
.optBorder1.Label = GetResText(RID_FORM + 30)
|
||||
.optBorder2.Label = GetResText(RID_FORM + 31)
|
||||
.optBorder1.State = 1
|
||||
|
||||
.optAlign0.Label = GetResText(RID_FORM + 33)
|
||||
.optAlign2.Label = GetResText(RID_FORM + 34)
|
||||
.optAlign0.State = 1
|
||||
|
||||
FNameAddOn = ""
|
||||
If isHighContrast(DlgFormDB.getPeer) Then FNameAddOn = "_hc"
|
||||
|
||||
IDArray = Array(36, 37, 40, 38, 39)
|
||||
For i = 1 To 5
|
||||
ButtonHelpText = GetResText(RID_FORM + IDArray(i-1)
|
||||
cmdButton = DlgFormDB.getControl("cmdArrange" & i)
|
||||
cmdButton.Model.ImageURL = FormPath & "Arrange_" & i & FNameAddOn & ".gif"
|
||||
cmdButton.Model.HelpText = ButtonHelpText
|
||||
cmdButton.getPeer().setProperty("AccessibleName", ButtonHelpText)
|
||||
Next i
|
||||
' .cmdArrange1.ImageURL = FormPath & "Arrange_1" & FNameAddOn & ".gif"
|
||||
' .cmdArrange1.HelpText = GetResText(RID_FORM + 36)
|
||||
'
|
||||
' .cmdArrange2.ImageURL = FormPath & "Arrange_2" & FNameAddOn & ".gif"
|
||||
' .cmdArrange2.HelpText = GetResText(RID_FORM + 37)
|
||||
'
|
||||
' .cmdArrange3.ImageURL = FormPath & "Arrange_3" & FNameAddOn & ".gif"
|
||||
' .cmdArrange3.HelpText = GetResText(RID_FORM + 40)
|
||||
'
|
||||
' .cmdArrange4.ImageURL = FormPath & "Arrange_4" & FNameAddOn & ".gif"
|
||||
' .cmdArrange4.HelpText = GetResText(RID_FORM + 38)
|
||||
'
|
||||
' .cmdArrange5.ImageURL = FormPath & "Arrange_5" & FNameAddOn & ".gif"
|
||||
' .cmdArrange5.HelpText = GetResText(RID_FORM + 39)
|
||||
sWriterFilterName = GetResText(RID_FORM + 70)
|
||||
End With
|
||||
DlgFormDB.GetControl("cmdMoveSelected").getPeer().setProperty("AccessibleName", GetResText(RID_COMMON + 39)
|
||||
DlgFormDB.GetControl("cmdRemoveSelected").getPeer().setProperty("AccessibleName", GetResText(RID_COMMON + 40)
|
||||
DlgFormDB.GetControl("cmdMoveAll").getPeer().setProperty("AccessibleName", GetResText(RID_COMMON + 41)
|
||||
DlgFormDB.GetControl("cmdRemoveAll").getPeer().setProperty("AccessibleName", GetResText(RID_COMMON + 42)
|
||||
DlgFormDB.getControl("lstFields").getPeer().setProperty("AccessibleName", DeleteStr(slblFields, "~"))
|
||||
DlgFormDB.getControl("lstSelFields").getPeer().setProperty("AccessibleName", DeleteStr(slblSelFields, "~"))
|
||||
|
||||
sSelectDatasource = GetResText(RID_COMMON + 37)
|
||||
sSelectDBTable = GetResText(RID_COMMON + 38)
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Sub InitializeWidthList()
|
||||
|
||||
If Ubound(WidthList(),1) > 16 Then
|
||||
ReDim WidthList(16,4)
|
||||
End If
|
||||
|
||||
WidthList(0,0) = com.sun.star.sdbc.DataType.BIT ' = -7;
|
||||
WidthList(0,1) = cCheckbox
|
||||
WidthList(0,2) = False
|
||||
WidthList(0,3) = "CheckBox"
|
||||
|
||||
WidthList(1,0) = com.sun.star.sdbc.DataType.TINYINT ' = -6;
|
||||
WidthList(1,1) = cNumericBox
|
||||
WidthList(1,2) = False
|
||||
WidthList(1,3) = "FormattedField"
|
||||
|
||||
WidthList(2,0) = com.sun.star.sdbc.DataType.SMALLINT ' = 5;
|
||||
WidthList(2,1) = cNumericBox
|
||||
WidthList(2,2) = False
|
||||
WidthList(2,3) = "FormattedField"
|
||||
|
||||
WidthList(3,0) = com.sun.star.sdbc.DataType.INTEGER ' = 4;
|
||||
WidthList(3,1) = cNumericBox
|
||||
WidthList(3,2) = False
|
||||
WidthList(3,3) = "FormattedField"
|
||||
|
||||
WidthList(4,0) = com.sun.star.sdbc.DataType.BIGINT ' = -5;
|
||||
WidthList(4,1) = cNumericBox
|
||||
WidthList(4,2) = False
|
||||
WidthList(4,3) = "FormattedField"
|
||||
|
||||
WidthList(5,0) = com.sun.star.sdbc.DataType.FLOAT ' = 6;
|
||||
WidthList(5,1) = cNumericBox
|
||||
WidthList(5,2) = False
|
||||
WidthList(5,3) = "FormattedField"
|
||||
|
||||
WidthList(6,0) = com.sun.star.sdbc.DataType.REAL ' = 7;
|
||||
WidthList(6,1) = cNumericBox
|
||||
WidthList(6,2) = False
|
||||
WidthList(6,3) = "FormattedField"
|
||||
|
||||
WidthList(7,0) = com.sun.star.sdbc.DataType.DOUBLE ' = 8;
|
||||
WidthList(7,1) = cNumericBox
|
||||
WidthList(7,2) = False
|
||||
WidthList(7,3) = "FormattedField"
|
||||
|
||||
WidthList(8,0) = com.sun.star.sdbc.DataType.NUMERIC ' = 2;
|
||||
WidthList(8,1) = cNumericBox
|
||||
WidthList(8,2) = False
|
||||
WidthList(8,3) = "FormattedField"
|
||||
|
||||
WidthList(9,0) = com.sun.star.sdbc.DataType.DECIMAL ' = 3; (including decimal places)
|
||||
WidthList(9,1) = cNumericBox
|
||||
WidthList(9,2) = False
|
||||
WidthList(9,3) = "FormattedField"
|
||||
|
||||
WidthList(10,0) = com.sun.star.sdbc.DataType.CHAR ' = 1;
|
||||
WidthList(10,1) = cTextBox
|
||||
WidthList(10,2) = False
|
||||
WidthList(10,3) = "TextField"
|
||||
|
||||
WidthList(11,0) = com.sun.star.sdbc.DataType.VARCHAR ' = 12;
|
||||
WidthList(11,1) = cTextBox
|
||||
WidthList(11,2) = True
|
||||
WidthList(11,3) = "TextField"
|
||||
|
||||
WidthList(12,0) = com.sun.star.sdbc.DataType.LONGVARCHAR ' = -1;
|
||||
WidthList(12,1) = cTextBox
|
||||
WidthList(12,2) = True
|
||||
WidthList(12,3) = "TextField"
|
||||
|
||||
WidthList(13,0) = com.sun.star.sdbc.DataType.DATE ' = 91;
|
||||
WidthList(13,1) = cDateBox
|
||||
WidthList(13,2) = False
|
||||
WidthList(13,3) = "DateField"
|
||||
|
||||
WidthList(14,0) = com.sun.star.sdbc.DataType.TIME ' = 92;
|
||||
WidthList(14,1) = cTimeBox
|
||||
WidthList(14,2) = False
|
||||
WidthList(14,3) = "TimeField"
|
||||
|
||||
WidthList(15,0) = com.sun.star.sdbc.DataType.TIMESTAMP ' = 93;
|
||||
WidthList(15,1) = cDateBox
|
||||
WidthList(15,2) = False
|
||||
WidthList(15,3) = "DateField"
|
||||
|
||||
WidthList(16,0) = com.sun.star.sdbc.DataType.BOOLEAN ' = 16;
|
||||
WidthList(16,1) = cCheckbox
|
||||
WidthList(16,2) = False
|
||||
WidthList(16,3) = "CheckBox"
|
||||
|
||||
ImgWidthList(0,0) = com.sun.star.sdbc.DataType.BINARY ' = -2;
|
||||
ImgWidthList(0,1) = cImageControl
|
||||
ImgWidthList(0,2) = False
|
||||
ImgWidthList(0,3) = "ImageControl"
|
||||
|
||||
ImgWidthList(1,0) = com.sun.star.sdbc.DataType.VARBINARY ' = -3;
|
||||
ImgWidthList(1,1) = cImageControl
|
||||
ImgWidthList(1,2) = False
|
||||
ImgWidthList(1,3) = "ImageControl"
|
||||
|
||||
ImgWidthList(2,0) = com.sun.star.sdbc.DataType.LONGVARBINARY ' = -4;
|
||||
ImgWidthList(2,1) = cImageControl
|
||||
ImgWidthList(2,2) = False
|
||||
ImgWidthList(2,3) = "ImageControl"
|
||||
|
||||
ImgWidthList(3,0) = com.sun.star.sdbc.DataType.BLOB ' = 2004;
|
||||
ImgWidthList(3,1) = cImageControl
|
||||
ImgWidthList(3,2) = False
|
||||
ImgWidthList(3,3) = "ImageControl"
|
||||
|
||||
' Note: the following Fieldtypes are ignored
|
||||
'ExcludeList(0) = com.sun.star.sdbc.DataType.SQLNULL
|
||||
'ExcludeList(1) = com.sun.star.sdbc.DataType.OTHER
|
||||
'ExcludeList(2) = com.sun.star.sdbc.DataType.OBJECT
|
||||
'ExcludeList(3) = com.sun.star.sdbc.DataType.DISTINCT
|
||||
'ExcludeList(4) = com.sun.star.sdbc.DataType.STRUCT
|
||||
'ExcludeList(5) = com.sun.star.sdbc.DataType.ARRAY
|
||||
'ExcludeList(6) = com.sun.star.sdbc.DataType.CLOB
|
||||
'ExcludeList(7) = com.sun.star.sdbc.DataType.REF
|
||||
|
||||
oModelService(cLabel) = "com.sun.star.form.component.FixedText"
|
||||
oModelService(cTextBox) = "com.sun.star.form.component.TextField"
|
||||
oModelService(cCheckBox) = "com.sun.star.form.component.CheckBox"
|
||||
oModelService(cDateBox) = "com.sun.star.form.component.DateField"
|
||||
oModelService(cTimeBox) = "com.sun.star.form.component.TimeField"
|
||||
oModelService(cNumericBox) = "com.sun.star.form.component.FormattedField"
|
||||
oModelService(cGridControl) = "com.sun.star.form.component.GridControl"
|
||||
oModelService(cImageControl) = "com.sun.star.form.component.DatabaseImageControl"
|
||||
End Sub
|
||||
</script:module>
|
||||
400
office-plugin/windows-office/share/basic/FormWizard/Layouter.xba
Normal file
400
office-plugin/windows-office/share/basic/FormWizard/Layouter.xba
Normal file
@@ -0,0 +1,400 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
|
||||
<!--***********************************************************
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
***********************************************************-->
|
||||
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Layouter" script:language="StarBasic">Option Explicit
|
||||
|
||||
Public oProgressbar as Object
|
||||
Public ProgressValue as Integer
|
||||
Public oDocument as Object
|
||||
Public oController as Object
|
||||
Public oForm as Object
|
||||
Public oDrawPage as Object
|
||||
Public oPageStyle as Object
|
||||
|
||||
Public nMaxColRightX as Long
|
||||
Public nMaxTCWidth as Long
|
||||
Public nMaxRowRightX as Long
|
||||
Public nMaxRowY as Long
|
||||
Public nSecMaxRowY as Long
|
||||
Public MaxIndex as Integer
|
||||
Public CurIndex as Integer
|
||||
|
||||
Public Const cVertDistance = 200
|
||||
Public Const cHoriDistance = 300
|
||||
|
||||
Public nPageWidth as Long
|
||||
Public nPageHeight as Long
|
||||
Public nFormWidth as Long
|
||||
Public nFormHeight as Long
|
||||
Public nMaxHoriPos as Long
|
||||
Public nMaxVertPos as Long
|
||||
|
||||
Public CONST SBALIGNLEFT = 0
|
||||
Public CONST SBALIGNRIGHT = 2
|
||||
|
||||
Public Const SBNOBORDER = 0
|
||||
Public Const SB3DBORDER = 1
|
||||
Public Const SBSIMPLEBORDER = 2
|
||||
|
||||
Public CurArrangement as Integer
|
||||
Public CurBorderType as Integer
|
||||
Public CurAlignmode as Integer
|
||||
|
||||
Public OldAlignMode as Integer
|
||||
Public OldBorderType as Integer
|
||||
Public OldArrangement as Integer
|
||||
|
||||
Public Const cColumnarLeft = 1
|
||||
Public Const cColumnarTop = 2
|
||||
Public Const cTabled = 3
|
||||
Public Const cLeftJustified = 4
|
||||
Public Const cTopJustified = 5
|
||||
|
||||
Public Const cXOffset = 1000
|
||||
Public Const cYOffset = 700
|
||||
' This is the viewed space that we lose because of the symbol bars
|
||||
Public Const cSymbolMargin = 2000
|
||||
Public Const MaxFieldIndex = 200
|
||||
|
||||
Public Const cControlCollectionCount = 9
|
||||
Public Const cLabel = 1
|
||||
Public Const cTextBox = 2
|
||||
Public Const cCheckBox = 3
|
||||
Public Const cDateBox = 4
|
||||
Public Const cTimeBox = 5
|
||||
Public Const cNumericBox = 6
|
||||
Public Const cCurrencyBox = 7
|
||||
Public Const cGridControl = 8
|
||||
Public Const cImageControl = 9
|
||||
|
||||
Public Styles(100, 8) as String
|
||||
|
||||
Public CurControlType as Integer
|
||||
Public CurFieldlength as Double
|
||||
Public CurFieldType as Integer
|
||||
Public CurFieldName as String
|
||||
Public CurControlName as String
|
||||
Public CurFormatKey as Long
|
||||
Public CurDefaultValue
|
||||
Public CurIsCurrency as Boolean
|
||||
Public CurScale as Integer
|
||||
Public CurHelpText as String
|
||||
|
||||
Public FieldMetaValues(MaxFieldIndex, 8)
|
||||
' Description of this List:
|
||||
' CurFieldType = FieldMetaValues(Index,0)
|
||||
' CurFieldLength = FieldMetaValues(Index,1)
|
||||
' CurControlType = FieldMetaValues(Index,2) (ControlType eg. cLabel, cTextbox usw.)
|
||||
' CurControlName = FieldMetaValues(Index,3)
|
||||
' CurFormatKey = FieldMetaValues(Index,4)
|
||||
' CurDefaultValue = FieldMetaValues(Index,5)
|
||||
' CurIsCurrency = FieldMetaValues(Index,6)
|
||||
' CurScale = FieldMetaValues(Index,7)
|
||||
' CurHelpText = FieldMetaValues(Index,8)
|
||||
|
||||
Public FieldNames(MaxFieldIndex) as string
|
||||
Public oModelService(cControlCollectionCount) as String
|
||||
Public oGridModel as Object
|
||||
|
||||
|
||||
Function InsertControl(oContainer as Object, oControlObject as object, aPoint as Object, aSize as Object)
|
||||
Dim oShape as object
|
||||
oShape = oDocument.CreateInstance ("com.sun.star.drawing.ControlShape")
|
||||
oShape.Size = aSize
|
||||
oShape.Position = aPoint
|
||||
oShape.AnchorType = com.sun.star.text.TextContentAnchorType.AT_PARAGRAPH
|
||||
oShape.control = oControlObject
|
||||
oContainer.Add(oShape)
|
||||
InsertControl() = oShape
|
||||
End Function
|
||||
|
||||
|
||||
Function ArrangeControls()
|
||||
Dim oShape as Object
|
||||
Dim i as Integer
|
||||
oProgressbar = oDocument.GetCurrentController.GetFrame.CreateStatusIndicator
|
||||
oProgressbar.Start("", MaxIndex)
|
||||
If oDBForm.HasbyName("Grid1") Then
|
||||
RemoveShapes()
|
||||
End If
|
||||
ToggleLayoutPage(False)
|
||||
Select Case CurArrangement
|
||||
Case cTabled
|
||||
PositionGridControl(MaxIndex)
|
||||
Case Else
|
||||
PositionControls(MaxIndex)
|
||||
End Select
|
||||
ToggleLayoutPage(True)
|
||||
oProgressbar.End
|
||||
End Function
|
||||
|
||||
|
||||
Sub OpenFormDocument()
|
||||
Dim NoArgs() as new com.sun.star.beans.PropertyValue
|
||||
Dim oViewSettings as Object
|
||||
oDocument = CreateNewDocument("swriter")
|
||||
oProgressbar = oDocument.GetCurrentController.GetFrame.CreateStatusIndicator()
|
||||
oProgressbar.Start("", 100)
|
||||
oDocument.ApplyFormDesignMode = False
|
||||
oController = oDocument.GetCurrentController
|
||||
oViewSettings = oDocument.CurrentController.ViewSettings
|
||||
oViewSettings.ShowTableBoundaries = False
|
||||
oViewSettings.ShowOnlineLayout = True
|
||||
oDrawPage = oDocument.DrawPage
|
||||
oPageStyle = oDocument.StyleFamilies.GetByName("PageStyles").GetByName("Standard")
|
||||
End Sub
|
||||
|
||||
|
||||
Sub InitializeLabelValues()
|
||||
Dim oLabelModel as Object
|
||||
Dim oTBModel as Object
|
||||
Dim oLabelShape as Object
|
||||
Dim oTBShape as Object
|
||||
Dim aTBSize As New com.sun.star.awt.Size
|
||||
Dim aLabelSize As New com.sun.star.awt.Size
|
||||
Dim aPoint As New com.sun.star.awt.Point
|
||||
Dim aSize As New com.sun.star.awt.Size
|
||||
Dim oLocControl as Object
|
||||
Dim oLocPeer as Object
|
||||
oLabelModel = CreateUnoService("com.sun.star.form.component.FixedText")
|
||||
oTBModel = CreateUnoService("com.sun.star.form.component.TextField")
|
||||
|
||||
Set oLabelShape = InsertControl(oDrawPage, oLabelModel, aPoint, aLabelSize)
|
||||
Set oTBShape = InsertControl(oDrawPage, oTBModel, aPoint, aSize)
|
||||
|
||||
oLocPeer = oController.GetControl(oLabelModel).Peer
|
||||
XPixelFactor = 100000/oLocPeer.GetInfo.PixelPerMeterX
|
||||
YPixelFactor = 100000/oLocPeer.GetInfo.PixelPerMeterY
|
||||
aLabelSize = GetPeerSize(oLabelModel, oLocControl, "The quick brown fox...")
|
||||
nTCHeight = (aLabelSize.Height+1) * YPixelFactor
|
||||
aTBSize = GetPeerSize(oTBModel, oLocControl, "The quick brown fox...")
|
||||
nDBRefHeight = (aTBSize.Height+1) * YPixelFactor
|
||||
BasicLabelDiffHeight = Clng((nDBRefHeight - nTCHeight)/2)
|
||||
oDrawPage.Remove(oLabelShape)
|
||||
oDrawPage.Remove(oTBShape)
|
||||
End Sub
|
||||
|
||||
|
||||
Sub ConfigurePageStyle()
|
||||
Dim aPageSize As New com.sun.star.awt.Size
|
||||
Dim aSize As New com.sun.star.awt.Size
|
||||
oPageStyle.IsLandscape = True
|
||||
aPageSize = oPageStyle.Size
|
||||
nPageWidth = aPageSize.Width
|
||||
nPageHeight = aPageSize.Height
|
||||
aSize.Width = nPageHeight
|
||||
aSize.Height = nPageWidth
|
||||
oPageStyle.Size = aSize
|
||||
nPageWidth = nPageHeight
|
||||
nPageHeight = oPageStyle.Size.Height
|
||||
nFormWidth = nPageWidth - oPageStyle.RightMargin - oPageStyle.LeftMargin - 2 * cXOffset
|
||||
nFormHeight = nPageHeight - oPageStyle.TopMargin - oPageStyle.BottomMargin - 2 * cYOffset - cSymbolMargin
|
||||
End Sub
|
||||
|
||||
|
||||
' Modify the Borders of the Controls
|
||||
Sub ChangeBorderLayouts(oEvent as Object)
|
||||
Dim oModel as Object
|
||||
Dim i as Integer
|
||||
Dim oCurModel as Object
|
||||
Dim sLocText as String
|
||||
Dim oGroupShape as Object
|
||||
Dim s as Integer
|
||||
If Not bDebug Then
|
||||
On Local Error GoTo WIZARDERROR
|
||||
End If
|
||||
oModel = oEvent.Source.Model
|
||||
SwitchBorderMode(Val(Right(oModel.Name,1)))
|
||||
ToggleLayoutPage(False)
|
||||
If CurArrangement = cTabled Then
|
||||
oGridModel.Border = CurBorderType
|
||||
Else
|
||||
If OldBorderType <> CurBorderType Then
|
||||
For i = 0 To MaxIndex
|
||||
If oDBShapeList(i).SupportsService("com.sun.star.drawing.GroupShape") Then
|
||||
oGroupShape = oDBShapeList(i)
|
||||
For s = 0 To oGroupShape.Count-1
|
||||
oGroupShape(s).Control.Border = CurBorderType
|
||||
Next s
|
||||
Else
|
||||
If oDBModelList(i).PropertySetInfo.HasPropertyByName("Border") Then
|
||||
oDBModelList(i).Border = CurBorderType
|
||||
End If
|
||||
End If
|
||||
Next i
|
||||
End If
|
||||
End If
|
||||
ToggleLayoutPage(True)
|
||||
WIZARDERROR:
|
||||
If Err <> 0 Then
|
||||
Msgbox(sMsgErrMsg, 16, GetProductName())
|
||||
Resume LOCERROR
|
||||
LOCERROR:
|
||||
DlgFormDB.Dispose()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Sub ChangeLabelAlignments(oEvent as Object)
|
||||
Dim i as Integer
|
||||
Dim oSize as New com.sun.star.awt.Size
|
||||
Dim oModel as Object
|
||||
If Not bDebug Then
|
||||
On Local Error GoTo WIZARDERROR
|
||||
End If
|
||||
oModel = oEvent.Source.Model
|
||||
SwitchAlignMode(Val(Right(oModel.Name,1)))
|
||||
ToggleLayoutPage(False)
|
||||
If OldAlignMode <> CurAlignMode Then
|
||||
For i = 0 To MaxIndex
|
||||
oTCShapeList(i).GetControl.Align = CurAlignmode
|
||||
Next i
|
||||
End If
|
||||
If CurAlignmode = com.sun.star.awt.TextAlign.RIGHT Then
|
||||
For i = 0 To Ubound(oTCShapeList())
|
||||
oSize = oTCShapeList(i).Size
|
||||
oSize.Width = oDBShapeList(i).Position.X - oTCShapeList(i).Position.X - cHoriDistance
|
||||
oTCShapeList(i).Size = oSize
|
||||
Next i
|
||||
End If
|
||||
|
||||
WIZARDERROR:
|
||||
If Err <> 0 Then
|
||||
Msgbox(sMsgErrMsg, 16, GetProductName())
|
||||
Resume LOCERROR
|
||||
LOCERROR:
|
||||
End If
|
||||
ToggleLayoutPage(True)
|
||||
End Sub
|
||||
|
||||
|
||||
Sub ChangeArrangemode(oEvent as Object)
|
||||
Dim oModel as Object
|
||||
If Not bDebug Then
|
||||
On Local Error GoTo WIZARDERROR
|
||||
End If
|
||||
oModel = oEvent.Source.Model
|
||||
SwitchArrangementButtons(Val(Right(oModel.Name,1)))
|
||||
oModel.State = 1
|
||||
DlgFormDB.GetControl("cmdArrange" & OldArrangement).Model.State = 0
|
||||
If CurArrangement <> OldArrangement Then
|
||||
ArrangeControls()
|
||||
Select Case CurArrangement
|
||||
Case cTabled
|
||||
ToggleBorderGroup(False)
|
||||
ToggleAlignGroup(False)
|
||||
Case Else ' cColumnarTop,cLeftJustified, cTopJustified
|
||||
ToggleAlignGroup(CurArrangement = cColumnarLeft)
|
||||
If CurArrangement = cColumnarTop Then
|
||||
If CurAlignMode = com.sun.star.awt.TextAlign.RIGHT Then
|
||||
DialogModel.optAlign0.State = 1
|
||||
CurAlignMode = com.sun.star.awt.TextAlign.LEFT
|
||||
OldAlignMode = com.sun.star.awt.TextAlign.RIGHT
|
||||
End If
|
||||
End If
|
||||
ControlCaptionstoStandardLayout()
|
||||
oDBForm.Load
|
||||
End Select
|
||||
End If
|
||||
WIZARDERROR:
|
||||
If Err <> 0 Then
|
||||
Msgbox(sMsgErrMsg, 16, GetProductName())
|
||||
Resume LOCERROR
|
||||
LOCERROR:
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Sub ToggleBorderGroup(bDoEnable as Boolean)
|
||||
With DialogModel
|
||||
.hlnBorderLayout.Enabled = bDoEnable
|
||||
.optBorder0.Enabled = bDoEnable ' 0: No border
|
||||
.optBorder1.Enabled = bDoEnable ' 1: 3D border
|
||||
.optBorder2.Enabled = bDoEnable ' 2: simple border
|
||||
End With
|
||||
End Sub
|
||||
|
||||
|
||||
Sub ToggleAlignGroup(ByVal bDoEnable as Boolean)
|
||||
With DialogModel
|
||||
If bDoEnable Then
|
||||
bDoEnable = CurArrangement = cColumnarLeft
|
||||
End If
|
||||
.hlnAlign.Enabled = bDoEnable
|
||||
.optAlign0.Enabled = bDoEnable
|
||||
.optAlign2.Enabled = bDoEnable
|
||||
End With
|
||||
End Sub
|
||||
|
||||
|
||||
Sub ToggleLayoutPage(bDoEnable as Boolean, Optional FocusControlName as String)
|
||||
DialogModel.Enabled = bDoEnable
|
||||
If bDoEnable Then
|
||||
If Not bDebug Then
|
||||
oDocument.UnlockControllers()
|
||||
End If
|
||||
ToggleOptionButtons(DialogModel,(bWithBackGraphic = True))
|
||||
ToggleAlignGroup(bDoEnable)
|
||||
ToggleBorderGroup(bDoEnable)
|
||||
Else
|
||||
If Not bDebug Then
|
||||
oDocument.LockControllers()
|
||||
End If
|
||||
End If
|
||||
If Not IsMissing(FocusControlName) Then
|
||||
DlgFormDB.GetControl(FocusControlName).SetFocus()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Sub DestroyControlShapes(oDrawPage as Object)
|
||||
Dim i as Integer
|
||||
Dim oShape as Object
|
||||
For i = oDrawPage.Count-1 To 0 Step -1
|
||||
oShape = oDrawPage.GetByIndex(i)
|
||||
If oShape.ShapeType = "com.sun.star.drawing.ControlShape" Then
|
||||
oShape.Dispose()
|
||||
End If
|
||||
Next i
|
||||
End Sub
|
||||
|
||||
|
||||
Sub SwitchArrangementButtons(ByVal LocArrangement as Integer)
|
||||
OldArrangement = CurArrangement
|
||||
CurArrangement = LocArrangement
|
||||
If OldArrangement <> 0 Then
|
||||
DlgFormDB.GetControl("cmdArrange" & OldArrangement).Model.State = 0
|
||||
End If
|
||||
DlgFormDB.GetControl("cmdArrange" & CurArrangement).Model.State = 1
|
||||
End Sub
|
||||
|
||||
|
||||
Sub SwitchBorderMode(ByVal LocBorderType as Integer)
|
||||
OldBorderType = CurBorderType
|
||||
CurBorderType = LocBorderType
|
||||
End Sub
|
||||
|
||||
|
||||
Sub SwitchAlignMode(ByVal LocAlignMode as Integer)
|
||||
OldAlignMode = CurAlignMode
|
||||
CurAlignMode = LocAlignMode
|
||||
End Sub</script:module>
|
||||
553
office-plugin/windows-office/share/basic/FormWizard/develop.xba
Normal file
553
office-plugin/windows-office/share/basic/FormWizard/develop.xba
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
|
||||
<library:library xmlns:library="http://openoffice.org/2000/library" library:name="FormWizard" library:readonly="true" library:passwordprotected="false">
|
||||
<library:element library:name="DlgFormDB"/>
|
||||
</library:library>
|
||||
@@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
|
||||
<library:library xmlns:library="http://openoffice.org/2000/library" library:name="FormWizard" library:readonly="true" library:passwordprotected="false">
|
||||
<library:element library:name="FormWizard"/>
|
||||
<library:element library:name="Layouter"/>
|
||||
<library:element library:name="Language"/>
|
||||
<library:element library:name="DBMeta"/>
|
||||
<library:element library:name="tools"/>
|
||||
<library:element library:name="develop"/>
|
||||
</library:library>
|
||||
369
office-plugin/windows-office/share/basic/FormWizard/tools.xba
Normal file
369
office-plugin/windows-office/share/basic/FormWizard/tools.xba
Normal file
@@ -0,0 +1,369 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
|
||||
<!--***********************************************************
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
***********************************************************-->
|
||||
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="tools" script:language="StarBasic">REM ***** BASIC *****
|
||||
Option Explicit
|
||||
Public Const SBMAXTEXTSIZE = 50
|
||||
|
||||
|
||||
Function SetProgressValue(iValue as Integer)
|
||||
If iValue = 0 Then
|
||||
oProgressbar.End
|
||||
End If
|
||||
ProgressValue = iValue
|
||||
oProgressbar.Value = iValue
|
||||
End Function
|
||||
|
||||
|
||||
Function GetPreferredWidth(oModel as Object, bGetMaxWidth as Boolean, Optional LocText)
|
||||
Dim aPeerSize as new com.sun.star.awt.Size
|
||||
Dim nWidth as Integer
|
||||
Dim oControl as Object
|
||||
If Not IsMissing(LocText) Then
|
||||
' Label
|
||||
aPeerSize = GetPeerSize(oModel, oControl, LocText)
|
||||
ElseIf CurControlType = cImageControl Then
|
||||
GetPreferredWidth() = 2000
|
||||
Exit Function
|
||||
Else
|
||||
aPeerSize = GetPeerSize(oModel, oControl)
|
||||
End If
|
||||
nWidth = aPeerSize.Width
|
||||
' We increase the preferred Width a bit so that the control does not become too small
|
||||
' when we change the border from "3D" to "Flat"
|
||||
GetPreferredWidth = (nWidth + 10) * XPixelFactor ' PixelTo100thmm(nWidth)
|
||||
End Function
|
||||
|
||||
|
||||
Function GetPreferredHeight(oModel as Object, Optional LocText)
|
||||
Dim aPeerSize as new com.sun.star.awt.Size
|
||||
Dim nHeight as Integer
|
||||
Dim oControl as Object
|
||||
If Not IsMissing(LocText) Then
|
||||
' Label
|
||||
aPeerSize = GetPeerSize(oModel, oControl, LocText)
|
||||
ElseIf CurControlType = cImageControl Then
|
||||
GetPreferredHeight() = 2000
|
||||
Exit Function
|
||||
Else
|
||||
aPeerSize = GetPeerSize(oModel, oControl)
|
||||
End If
|
||||
nHeight = aPeerSize.Height
|
||||
' We increase the preferred Height a bit so that the control does not become too small
|
||||
' when we change the border from "3D" to "Flat"
|
||||
GetPreferredHeight = (nHeight+1) * YPixelFactor ' PixelTo100thmm(nHeight)
|
||||
End Function
|
||||
|
||||
|
||||
Function GetPeerSize(oModel as Object, oControl as Object, Optional LocText)
|
||||
Dim oPeer as Object
|
||||
Dim aPeerSize as new com.sun.star.awt.Size
|
||||
Dim NullValue
|
||||
oControl = oController.GetControl(oModel)
|
||||
oPeer = oControl.GetPeer()
|
||||
If oControl.Model.PropertySetInfo.HasPropertybyName("EffectiveMax") Then
|
||||
If oControl.Model.EffectiveMax = 0 Then
|
||||
' This is relevant for decimal fields
|
||||
oControl.Model.EffectiveValue = 999.9999
|
||||
Else
|
||||
oControl.Model.EffectiveValue = oControl.Model.EffectiveMax
|
||||
End If
|
||||
GetPeerSize() = oPeer.PreferredSize()
|
||||
oControl.Model.EffectiveValue = NullValue
|
||||
ElseIf Not IsMissing(LocText) Then
|
||||
oControl.Text = LocText
|
||||
GetPeerSize() = oPeer.PreferredSize()
|
||||
ElseIf CurFieldType = com.sun.star.sdbc.DataType.BIT Then
|
||||
GetPeerSize() = oPeer.PreferredSize()
|
||||
ElseIf CurFieldType = com.sun.star.sdbc.DataType.BOOLEAN Then
|
||||
GetPeerSize() = oPeer.PreferredSize()
|
||||
ElseIf CurFieldType = com.sun.star.sdbc.DataType.DATE Then
|
||||
oControl.Model.Date = Date
|
||||
GetPeerSize() = oPeer.PreferredSize()
|
||||
oControl.Model.Date = NullValue
|
||||
ElseIf CurFieldType = com.sun.star.sdbc.DataType.TIME Then
|
||||
oControl.Time = Time
|
||||
GetPeerSize() = oPeer.PreferredSize()
|
||||
oControl.Time = NullValue
|
||||
Else
|
||||
If oControl.MaxTextLen > SBMAXTEXTSIZE Then
|
||||
oControl.Text = Mid(SBSIZETEXT,1, SBMAXTEXTSIZE)
|
||||
Else
|
||||
oControl.Text = Mid(SBSIZETEXT,1, oControl.MaxTextLen)
|
||||
End If
|
||||
GetPeerSize() = oPeer.PreferredSize()
|
||||
oControl.Text = ""
|
||||
End If
|
||||
End Function
|
||||
|
||||
|
||||
Function TwipToCM(BYVAL nValue as long) as String
|
||||
TwipToCM = trim(str(nValue / 567)) + "cm"
|
||||
End function
|
||||
|
||||
|
||||
Function TwipTo100telMM(BYVAL nValue as long) as long
|
||||
TwipTo100telMM = nValue / 0.567
|
||||
End function
|
||||
|
||||
|
||||
Function TwipToPixel(BYVAL nValue as long) as long ' not an exact calculation
|
||||
TwipToPixel = nValue / 15
|
||||
End function
|
||||
|
||||
|
||||
Function PixelTo100thMMX(oControl as Object) as long
|
||||
oPeer = oControl.GetPeer()
|
||||
PixelTo100mmX = Clng(Peer.GetInfo.PixelPerMeterX/100000)
|
||||
|
||||
' PixelTo100thMM = nValue * 28 ' not an exact calculation
|
||||
End function
|
||||
|
||||
|
||||
Function PixelTo100thMMY(oControl as Object) as long
|
||||
oPeer = oControl.GetPeer()
|
||||
PixelTo100mmX = Clng(Peer.GetInfo.PixelPerMeterY/100000)
|
||||
|
||||
' PixelTo100thMM = nValue * 28 ' not an exact calculation
|
||||
End function
|
||||
|
||||
|
||||
Function GetPoint(xPos, YPos) as New com.sun.star.awt.Point
|
||||
Dim aPoint as New com.sun.star.awt.Point
|
||||
aPoint.X = xPos
|
||||
aPoint.Y = yPos
|
||||
GetPoint() = aPoint
|
||||
End Function
|
||||
|
||||
|
||||
Function GetSize(iWidth, iHeight) As New com.sun.star.awt.Size
|
||||
Dim aSize As New com.sun.star.awt.Size
|
||||
aSize.Width = iWidth
|
||||
aSize.Height = iHeight
|
||||
GetSize() = aSize
|
||||
End Function
|
||||
|
||||
|
||||
Sub ImportStyles()
|
||||
Dim OldIndex as Integer
|
||||
If Not bDebug Then
|
||||
On Local Error GoTo WIZARDERROR
|
||||
End If
|
||||
OldIndex = CurIndex
|
||||
CurIndex = GetCurIndex(DialogModel.lstStyles, Styles(),8)
|
||||
If CurIndex <> OldIndex Then
|
||||
ToggleLayoutPage(False)
|
||||
Dim sImportPath as String
|
||||
sImportPath = Styles(CurIndex, 8)
|
||||
bWithBackGraphic = LoadNewStyles(oDocument, DialogModel, CurIndex, sImportPath, Styles(), TexturePath)
|
||||
ControlCaptionsToStandardLayout()
|
||||
ToggleLayoutPage(True, "lstStyles")
|
||||
End If
|
||||
WIZARDERROR:
|
||||
If Err <> 0 Then
|
||||
Msgbox(sMsgErrMsg, 16, GetProductName())
|
||||
Resume LOCERROR
|
||||
LOCERROR:
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Function SetNumerics(ByVal oLocObject as Object, iLocFieldType as Integer) as Object
|
||||
If CurControlType = cNumericBox Then
|
||||
oLocObject.TreatAsNumber = True
|
||||
Select Case iLocFieldType
|
||||
Case com.sun.star.sdbc.DataType.BIGINT
|
||||
oLocObject.EffectiveMax = 2147483647 * 2147483647
|
||||
oLocObject.EffectiveMin = -(-2147483648 * -2147483648)
|
||||
' oLocObject.DecimalAccuracy = 0
|
||||
Case com.sun.star.sdbc.DataType.INTEGER
|
||||
oLocObject.EffectiveMax = 2147483647
|
||||
oLocObject.EffectiveMin = -2147483648
|
||||
Case com.sun.star.sdbc.DataType.SMALLINT
|
||||
oLocObject.EffectiveMax = 32767
|
||||
oLocObject.EffectiveMin = -32768
|
||||
Case com.sun.star.sdbc.DataType.TINYINT
|
||||
oLocObject.EffectiveMax = 127
|
||||
oLocObject.EffectiveMin = -128
|
||||
Case com.sun.star.sdbc.DataType.FLOAT, com.sun.star.sdbc.DataType.REAL, com.sun.star.sdbc.DataType.DOUBLE, com.sun.star.sdbc.DataType.DECIMAL, com.sun.star.sdbc.DataType.NUMERIC
|
||||
'Todo: oLocObject.DecimalAccuracy = ...
|
||||
oLocObject.EffectiveDefault = CurDefaultValue
|
||||
' Todo: HelpText???
|
||||
End Select
|
||||
If oLocObject.PropertySetinfo.HasPropertyByName("Width")Then ' Note: an Access AutoincrementField does not provide this property Width
|
||||
oLocObject.Width = CurFieldLength + CurScale + 1
|
||||
End If
|
||||
If CurIsCurrency Then
|
||||
'Todo: How do you set currencies?
|
||||
End If
|
||||
ElseIf CurControlType = cTextBox Then 'com.sun.star.sdbc.DataType.CHAR, com.sun.star.sdbc.DataType.VARCHAR, com.sun.star.sdbc.DataType.LONGVARCHAR
|
||||
If CurFieldLength = 0 Then 'Or oLocObject.MaxTextLen > SBMAXTEXTSIZE
|
||||
oLocObject.MaxTextLen = SBMAXTEXTSIZE
|
||||
CurFieldLength = SBMAXTEXTSIZE
|
||||
Else
|
||||
oLocObject.MaxTextLen = CurFieldLength
|
||||
End If
|
||||
oLocObject.DefaultText = CurDefaultValue
|
||||
ElseIf CurControlType = cDateBox Then
|
||||
' Todo Why does this not work?: oLocObject.DefaultDate = CurDefaultValue
|
||||
ElseIf CurControlType = cTimeBox Then ' com.sun.star.sdbc.DataType.DATE, com.sun.star.sdbc.DataType.TIME
|
||||
oLocObject.DefaultTime = CurDefaultValue
|
||||
' Todo: Property TimeFormat? frome where?
|
||||
ElseIf CurControlType = cCheckBox Then
|
||||
' Todo Why does this not work?: oLocObject.DefautState = CurDefaultValue
|
||||
End If
|
||||
If oLocObject.PropertySetInfo.HasPropertybyName("FormatKey") Then
|
||||
On Local Error Resume Next
|
||||
oLocObject.FormatKey = CurFormatKey
|
||||
End If
|
||||
End Function
|
||||
|
||||
|
||||
' Destroy all Shapes in Nirwana
|
||||
Sub RemoveShapes()
|
||||
Dim n as Integer
|
||||
Dim oControl as Object
|
||||
Dim oShape as Object
|
||||
For n = oDrawPage.Count-1 To 0 Step -1
|
||||
oShape = oDrawPage(n)
|
||||
If oShape.Position.Y > -2000 Then
|
||||
oDrawPage.Remove(oShape)
|
||||
End If
|
||||
Next n
|
||||
End Sub
|
||||
|
||||
|
||||
' Destroy all Shapes in Nirwana
|
||||
Sub RemoveNirwanaShapes()
|
||||
Dim n as Integer
|
||||
Dim oControl as Object
|
||||
Dim oShape as Object
|
||||
For n = oDrawPage.Count-1 To 0 Step -1
|
||||
oShape = oDrawPage(n)
|
||||
If oShape.Position.Y < -2000 Then
|
||||
oDrawPage.Remove(oShape)
|
||||
End If
|
||||
Next n
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
' Note: as Shapes cannot be removed from the DrawPage without destroying
|
||||
' the object we have to park them somewhere beyond the visible area of the page
|
||||
Sub ShapesToNirwana()
|
||||
Dim n as Integer
|
||||
Dim oControl as Object
|
||||
For n = 0 To oDrawPage.Count-1
|
||||
oDrawPage(n).Position = GetPoint(-20, -10000)
|
||||
Next n
|
||||
End Sub
|
||||
|
||||
|
||||
Function CalcUniqueContentName(BYVAL oContainer as Object, sBaseName as String) as String
|
||||
|
||||
Dim nPostfix as Integer
|
||||
Dim sReturn as String
|
||||
nPostfix = 2
|
||||
sReturn = sBaseName
|
||||
while (oContainer.hasByName(sReturn))
|
||||
sReturn = sBaseName & nPostfix
|
||||
nPostfix = nPostfix + 1
|
||||
Wend
|
||||
CalcUniqueContentName = sReturn
|
||||
End Function
|
||||
|
||||
|
||||
Function CountItemsInArray(BigArray(), SearchItem)
|
||||
Dim i as Integer
|
||||
Dim MaxIndex as Integer
|
||||
Dim ResCount as Integer
|
||||
ResCount = 0
|
||||
MaxIndex = Ubound(BigArray())
|
||||
For i = 0 To MaxIndex
|
||||
If SearchItem = BigArray(i) Then
|
||||
ResCount = ResCount + 1
|
||||
End If
|
||||
Next i
|
||||
CountItemsInArray() = ResCount
|
||||
End Function
|
||||
|
||||
|
||||
Function GetDBHeight(oDBModel as Object)
|
||||
If CurControlType = cImageControl Then
|
||||
nDBHeight = 2000
|
||||
Else
|
||||
If CurFieldType = com.sun.star.sdbc.DataType.LONGVARCHAR Then
|
||||
oDBModel.MultiLine = True
|
||||
nDBHeight = nDBRefHeight * 4
|
||||
Else
|
||||
nDBHeight = nDBRefHeight
|
||||
End If
|
||||
End If
|
||||
GetDBHeight() = nDBHeight
|
||||
End Function
|
||||
|
||||
|
||||
Function GetFormWizardPaths() as Boolean
|
||||
FormPath = GetOfficeSubPath("Template","../wizard/bitmap")
|
||||
If FormPath <> "" Then
|
||||
WebWizardPath = GetOfficeSubPath("Template","wizard/web")
|
||||
If WebWizardPath <> "" Then
|
||||
WizardPath = GetOfficeSubPath("Template","wizard/")
|
||||
If Wizardpath <> "" Then
|
||||
TexturePath = GetOfficeSubPath("Gallery", "www-back/")
|
||||
If TexturePath <> "" Then
|
||||
WorkPath = GetPathSettings("Work")
|
||||
If WorkPath <> "" Then
|
||||
TempPath = GetPathSettings("Temp")
|
||||
If TempPath <> "" Then
|
||||
GetFormWizardPaths = True
|
||||
Exit Function
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
DisposeDocument(oDocument)
|
||||
GetFormWizardPaths() = False
|
||||
End Function
|
||||
|
||||
|
||||
Function GetFilterName(sApplicationKey as String) as String
|
||||
Dim oArgs()
|
||||
Dim oFactory
|
||||
Dim i as Integer
|
||||
Dim Maxindex as Integer
|
||||
Dim UIName as String
|
||||
oFactory = createUnoService("com.sun.star.document.FilterFactory")
|
||||
oArgs() = oFactory.getByName(sApplicationKey)
|
||||
MaxIndex = Ubound(oArgs())
|
||||
For i = 0 to MaxIndex
|
||||
If (oArgs(i).Name="UIName") Then
|
||||
UIName = oArgs(i).Value
|
||||
Exit For
|
||||
End If
|
||||
next i
|
||||
GetFilterName() = UIName
|
||||
End Function
|
||||
</script:module>
|
||||
117
office-plugin/windows-office/share/basic/Gimmicks/AutoText.xba
Normal file
117
office-plugin/windows-office/share/basic/Gimmicks/AutoText.xba
Normal file
@@ -0,0 +1,117 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
|
||||
<!--***********************************************************
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
***********************************************************-->
|
||||
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="AutoText" script:language="StarBasic">' BASIC
|
||||
Option Explicit
|
||||
Dim oDocument as Object
|
||||
Dim sDocumentTitle as String
|
||||
|
||||
|
||||
Sub Main()
|
||||
Dim oTable as Object
|
||||
Dim oRows as Object
|
||||
Dim oDocuText as Object
|
||||
Dim oAutoTextCursor as Object
|
||||
Dim oAutoTextContainer as Object
|
||||
Dim oAutogroup as Object
|
||||
Dim oAutoText as Object
|
||||
Dim oCharStyles as Object
|
||||
Dim oContentStyle as Object
|
||||
Dim oHeaderStyle as Object
|
||||
Dim oGroupTitleStyle as Object
|
||||
Dim n, m, iAutoCount as Integer
|
||||
BasicLibraries.LoadLibrary("Tools")
|
||||
sDocumentTitle = "Installed AutoTexts"
|
||||
|
||||
' Open a new empty document
|
||||
oDocument = CreateNewDocument("swriter")
|
||||
If Not IsNull(oDocument) Then
|
||||
oDocument.DocumentProperties.Title = sDocumentTitle
|
||||
oDocuText = oDocument.Text
|
||||
|
||||
' Create The Character-templates
|
||||
oCharStyles = oDocument.StyleFamilies.GetByName("CharacterStyles")
|
||||
|
||||
' The Characterstyle for the Header that describes the Title of Autotextgroups
|
||||
oGroupTitleStyle = oDocument.createInstance("com.sun.star.style.CharacterStyle")
|
||||
oCharStyles.InsertbyName("AutoTextGroupTitle", oGroupTitleStyle)
|
||||
|
||||
oGroupTitleStyle.CharWeight = com.sun.star.awt.FontWeight.BOLD
|
||||
oGroupTitleStyle.CharHeight = 14
|
||||
|
||||
' The Characterstyle for the Header that describes the Title of Autotextgroups
|
||||
oHeaderStyle = oDocument.createInstance("com.sun.star.style.CharacterStyle")
|
||||
oCharStyles.InsertbyName("AutoTextHeading", oHeaderStyle)
|
||||
oHeaderStyle.CharWeight = com.sun.star.awt.FontWeight.BOLD
|
||||
|
||||
' "Ordinary" Table Content
|
||||
oContentStyle = oDocument.createInstance("com.sun.star.style.CharacterStyle")
|
||||
oCharStyles.InsertbyName("TableContent", oContentStyle)
|
||||
|
||||
oAutoTextContainer = CreateUnoService("com.sun.star.text.AutoTextContainer")
|
||||
|
||||
oAutoTextCursor = oDocuText.CreateTextCursor()
|
||||
|
||||
oAutoTextCursor.CharStyleName = "AutoTextGroupTitle"
|
||||
' Link the Title with the following table
|
||||
oAutoTextCursor.ParaKeepTogether = True
|
||||
|
||||
For n = 0 To oAutoTextContainer.Count - 1
|
||||
oAutoGroup = oAutoTextContainer.GetByIndex(n)
|
||||
|
||||
oAutoTextCursor.SetString(oAutoGroup.Title)
|
||||
oAutoTextCursor.CollapseToEnd()
|
||||
oDocuText.insertControlCharacter(oAutoTextCursor,com.sun.star.text.ControlCharacter.PARAGRAPH_BREAK,False)
|
||||
oTable = oDocument.CreateInstance("com.sun.star.text.TextTable")
|
||||
' Divide the table if necessary
|
||||
oTable.Split = True
|
||||
' oTable.KeepTogether = False
|
||||
oTable.RepeatHeadLine = True
|
||||
oAutoTextCursor.Text.InsertTextContent(oAutoTextCursor,oTable,False)
|
||||
InsertStringToCell("AutoText Name",oTable.GetCellbyPosition(0,0), "AutoTextHeading")
|
||||
InsertStringToCell("AutoText Shortcut",oTable.GetCellbyPosition(1,0), "AutoTextHeading")
|
||||
' Insert one row at the bottom of the table
|
||||
oRows = oTable.Rows
|
||||
iAutoCount = oAutoGroup.Count
|
||||
For m = 0 To iAutoCount-1
|
||||
' Insert the name and the title of all Autotexts
|
||||
oAutoText = oAutoGroup.GetByIndex(m)
|
||||
InsertStringToCell(oAutoGroup.Titles(m), oTable.GetCellbyPosition(0, m + 1), "TableContent")
|
||||
InsertStringToCell(oAutoGroup.ElementNames(m), oTable.GetCellbyPosition(1, m + 1), "TableContent")
|
||||
If m < iAutoCount-1 Then
|
||||
oRows.InsertbyIndex(m + 2,1)
|
||||
End If
|
||||
Next m
|
||||
oDocuText.insertControlCharacter(oAutoTextCursor,com.sun.star.text.ControlCharacter.PARAGRAPH_BREAK,False)
|
||||
oAutoTextCursor.CollapseToEnd()
|
||||
Next n
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Sub InsertStringToCell(sCellString as String, oCell as Object, sCellStyle as String)
|
||||
Dim oCellCursor as Object
|
||||
oCellCursor = oCell.CreateTextCursor()
|
||||
oCellCursor.CharStyleName = sCellStyle
|
||||
oCell.Text.insertString(oCellCursor,sCellString,False)
|
||||
oDocument.CurrentController.Select(oCellCursor)
|
||||
End Sub</script:module>
|
||||
@@ -0,0 +1,95 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
|
||||
<!--***********************************************************
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
***********************************************************-->
|
||||
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="ChangeAllChars" script:language="StarBasic">' This macro replaces all characters in a writer-documet through "x" or "X" signs.
|
||||
' It works on the currently activated document.
|
||||
Private const UPPERREPLACECHAR = "X"
|
||||
Private const LOWERREPLACECHAR = "x"
|
||||
|
||||
Private MSGBOXTITLE
|
||||
Private NOTSAVEDTEXT
|
||||
Private WARNING
|
||||
|
||||
Sub ChangeAllChars ' Change all chars in the active document
|
||||
Dim oSheets, oPages as Object
|
||||
Dim i as Integer
|
||||
Const MBYES = 6
|
||||
Const MBABORT = 2
|
||||
Const MBNO = 7
|
||||
BasicLibraries.LoadLibrary("Tools")
|
||||
MSGBOXTITLE = "Change All Characters to an '" & UPPERREPLACECHAR & "'"
|
||||
NOTSAVEDTEXT = "This document has already been modified: All characters will be changed to an " & UPPERREPLACECHAR & "'. Should the document be saved now?"
|
||||
WARNING = "This macro changes all characters and numbers to an '" & UPPERREPLACECHAR & "' in this document."
|
||||
|
||||
On Local Error GoTo NODOCUMENT
|
||||
oDocument = StarDesktop.ActiveFrame.Controller.Model
|
||||
NODOCUMENT:
|
||||
If Err <> 0 Then
|
||||
Msgbox(WARNING & chr(13) & "First, activate a Writer document." , 16, GetProductName())
|
||||
Exit Sub
|
||||
End If
|
||||
On Local Error Goto 0
|
||||
|
||||
sDocType = GetDocumentType(oDocument)
|
||||
|
||||
If oDocument.IsModified And oDocument.Url <> "" Then
|
||||
Status = MsgBox(NOTSAVEDTEXT, 3+32, MSGBOXTITLE)
|
||||
Select Case Status
|
||||
Case MBYES
|
||||
oDocument.Store
|
||||
Case MBABORT, MBNO
|
||||
End
|
||||
End Select
|
||||
Else
|
||||
Status = MsgBox(WARNING, 3+32, MSGBOXTITLE)
|
||||
If Status = MBNO Or Status = MBABORT Then ' No, Abort
|
||||
End
|
||||
End If
|
||||
End If
|
||||
|
||||
Select Case sDocType
|
||||
Case "swriter"
|
||||
ReplaceAllStrings(oDocument)
|
||||
|
||||
Case Else
|
||||
Msgbox("This macro only works with Writer documents.", 16, GetProductName())
|
||||
End Select
|
||||
End Sub
|
||||
|
||||
|
||||
Sub ReplaceAllStrings(oContainer as Object)
|
||||
ReplaceStrings(oContainer, "[a-z]", LOWERREPLACECHAR)
|
||||
ReplaceStrings(oContainer, "[à-þ]", LOWERREPLACECHAR)
|
||||
ReplaceStrings(oContainer, "[A-Z]", UPPERREPLACECHAR)
|
||||
ReplaceStrings(oContainer, "[À-ß]", UPPERREPLACECHAR)
|
||||
ReplaceStrings(oContainer, "[0-9]", UPPERREPLACECHAR)
|
||||
End Sub
|
||||
|
||||
|
||||
Sub ReplaceStrings(oContainer as Object, sSearchString, sReplaceString as String)
|
||||
oReplaceDesc = oContainer.createReplaceDescriptor()
|
||||
oReplaceDesc.SearchCaseSensitive = True
|
||||
oReplaceDesc.SearchRegularExpression = True
|
||||
oReplaceDesc.Searchstring = sSearchString
|
||||
oReplaceDesc.ReplaceString = sReplaceString
|
||||
oReplCount = oContainer.ReplaceAll(oReplaceDesc)
|
||||
End Sub</script:module>
|
||||
542
office-plugin/windows-office/share/basic/Gimmicks/GetTexts.xba
Normal file
542
office-plugin/windows-office/share/basic/Gimmicks/GetTexts.xba
Normal file
File diff suppressed because it is too large
Load Diff
325
office-plugin/windows-office/share/basic/Gimmicks/ReadDir.xba
Normal file
325
office-plugin/windows-office/share/basic/Gimmicks/ReadDir.xba
Normal file
@@ -0,0 +1,325 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
|
||||
<!--***********************************************************
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
***********************************************************-->
|
||||
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="ReadDir" script:language="StarBasic">Option Explicit
|
||||
Public Const SBPAGEX = 800
|
||||
Public Const SBPAGEY = 800
|
||||
Public Const SBRELDIST = 1.3
|
||||
|
||||
' Names of the second Dimension of the Array iLevelPos
|
||||
Public Const SBBASEX = 0
|
||||
Public Const SBBASEY = 1
|
||||
|
||||
Public Const SBOLDSTARTX = 2
|
||||
Public Const SBOLDSTARTY = 3
|
||||
|
||||
Public Const SBOLDENDX = 4
|
||||
Public Const SBOLDENDY = 5
|
||||
|
||||
Public Const SBNEWSTARTX = 6
|
||||
Public Const SBNEWSTARTY = 7
|
||||
|
||||
Public Const SBNEWENDX = 8
|
||||
Public Const SBNEWENDY = 9
|
||||
|
||||
Public ConnectLevel As Integer
|
||||
Public iLevelPos(1,9) As Long
|
||||
Public Source as String
|
||||
Public iCurLevel as Integer
|
||||
Public nConnectLevel as Integer
|
||||
Public nOldWidth, nOldHeight As Long
|
||||
Public nOldX, nOldY, nOldLevel As Integer
|
||||
Public oOldLeavingLine As Object
|
||||
Public oOldArrivingLine As Object
|
||||
Public DlgReadDir as Object
|
||||
Dim oProgressBar as Object
|
||||
Dim oDocument As Object
|
||||
Dim oPage As Object
|
||||
|
||||
|
||||
Sub Main()
|
||||
Dim oStandardTemplate as Object
|
||||
BasicLibraries.LoadLibrary("Tools")
|
||||
oDocument = CreateNewDocument("sdraw")
|
||||
If Not IsNull(oDocument) Then
|
||||
oPage = oDocument.DrawPages(0)
|
||||
oStandardTemplate = oDocument.StyleFamilies.GetByName("graphics").GetByName("standard")
|
||||
oStandardTemplate.CharHeight = 10
|
||||
oStandardTemplate.TextLeftDistance = 100
|
||||
oStandardTemplate.TextRightDistance = 100
|
||||
oStandardTemplate.TextUpperDistance = 50
|
||||
oStandardTemplate.TextLowerDistance = 50
|
||||
DlgReadDir = LoadDialog("Gimmicks","ReadFolderDlg")
|
||||
oProgressBar = DlgReadDir.Model.ProgressBar1
|
||||
DlgReadDir.Model.TextField1.Text = ConvertFromUrl(GetPathSettings("Work"))
|
||||
DlgReadDir.Model.cmdGoOn.DefaultButton = True
|
||||
DlgReadDir.GetControl("TextField1").SetFocus()
|
||||
DlgReadDir.Execute
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Sub TreeInfo()
|
||||
Dim oCurTextShape As Object
|
||||
Dim i as Integer
|
||||
Dim bStartUpRun As Boolean
|
||||
Dim CurFilename as String
|
||||
Dim BaseLevel as Integer
|
||||
Dim oController as Object
|
||||
Dim MaxFileIndex as Integer
|
||||
Dim FileNames() as String
|
||||
ToggleDialogControls(False)
|
||||
oProgressBar.ProgressValueMin = 0
|
||||
oProgressBar.ProgressValueMax = 100
|
||||
bStartUpRun = True
|
||||
nOldHeight = 200
|
||||
nOldY = SBPAGEY
|
||||
nOldX = SBPAGEX
|
||||
nOldWidth = SBPAGEX
|
||||
oController = oDocument.GetCurrentController
|
||||
Source = ConvertToURL(DlgReadDir.Model.TextField1.Text)
|
||||
BaseLevel = CountCharsInString(Source, "/", 1)
|
||||
oProgressBar.ProgressValue = 5
|
||||
DlgReadDir.Model.Label3.Enabled = True
|
||||
FileNames() = ReadSourceDirectory(Source)
|
||||
DlgReadDir.Model.Label4.Enabled = True
|
||||
DlgReadDir.Model.Label3.Enabled = False
|
||||
oProgressBar.ProgressValue = 12
|
||||
FileNames() = BubbleSortList(FileNames())
|
||||
DlgReadDir.Model.Label5.Enabled = True
|
||||
DlgReadDir.Model.Label4.Enabled = False
|
||||
oProgressBar.ProgressValue = 20
|
||||
MaxFileIndex = Ubound(FileNames(),1)
|
||||
For i = 0 To MaxFileIndex
|
||||
oProgressBar.ProgressValue = 20 + (i/MaxFileIndex * 80)
|
||||
CurFilename = FileNames(i,1)
|
||||
SetNewLevels(FileNames(i,0), BaseLevel)
|
||||
oCurTextShape = CreateTextShape(oPage, CurFilename)
|
||||
CheckPageWidth(oCurTextShape.Size.Width)
|
||||
iLevelPos(iCurLevel,SBBASEY) = oCurTextShape.Position.Y
|
||||
If i = 0 Then
|
||||
AdjustPageHeight(oCurTextShape.Size.Height, MaxFileIndex + 1)
|
||||
End If
|
||||
' The Current TextShape has To be connected with a TextShape one Level higher
|
||||
' except for a TextShape In Level 0:
|
||||
If Not bStartUpRun Then
|
||||
' A leaving Line Is only drawn when level is not 0
|
||||
If iCurLevel<> 0 Then
|
||||
' Determine the Coordinates of the arriving Line
|
||||
iLevelPos(iCurLevel,SBOLDSTARTX) = iLevelPos(nConnectLevel,SBNEWSTARTX)
|
||||
iLevelPos(iCurLevel,SBOLDSTARTY) = oCurTextShape.Position.Y + 0.5 * oCurTextShape.Size.Height
|
||||
|
||||
iLevelPos(iCurLevel,SBOLDENDX) = iLevelPos(iCurLevel,SBBASEX)
|
||||
iLevelPos(iCurLevel,SBOLDENDY) = oCurTextShape.Position.Y + 0.5 * oCurTextShape.Size.Height
|
||||
|
||||
oOldArrivingLine = DrawLine(iCurLevel, SBOLDSTARTX, SBOLDSTARTY, SBOLDENDX, SBOLDENDY, oPage)
|
||||
|
||||
' Determine the End-Coordinates of the last leaving Line
|
||||
iLevelPos(nConnectLevel,SBNEWENDX) = iLevelPos(nConnectLevel,SBNEWSTARTX)
|
||||
iLevelPos(nConnectLevel,SBNEWENDY) = oCurTextShape.Position.Y + 0.5 * oCurTextShape.Size.Height
|
||||
Else
|
||||
' On Level 0 the last Leaving Line's Endpoint is the upper edge of the TextShape
|
||||
iLevelPos(nConnectLevel,SBNEWENDY) = oCurTextShape.Position.Y
|
||||
iLevelPos(nConnectLevel,SBNEWENDX) = iLevelPos(nConnectLevel,SBNEWSTARTX)
|
||||
End If
|
||||
' Draw the Connectors To the previous TextShapes
|
||||
oOldLeavingLine = DrawLine(nConnectLevel, SBNEWSTARTX, SBNEWSTARTY, SBNEWENDX, SBNEWENDY, oPage)
|
||||
Else
|
||||
' StartingPoint of the leaving Edge
|
||||
bStartUpRun = FALSE
|
||||
End If
|
||||
|
||||
' Determine the beginning Coordinates of the leaving Line
|
||||
iLevelPos(iCurLevel,SBNEWSTARTX) = iLevelPos(iCurLevel,SBBASEX) + 0.5 * oCurTextShape.Size.Width
|
||||
iLevelPos(iCurLevel,SBNEWSTARTY) = iLevelPos(iCurLevel,SBBASEY) + oCurTextShape.Size.Height
|
||||
|
||||
' Save the values For the Next run
|
||||
nOldHeight = oCurTextShape.Size.Height
|
||||
nOldX = oCurTextShape.Position.X
|
||||
nOldWidth = oCurTextShape.Size.Width
|
||||
nOldLevel = iCurLevel
|
||||
Next i
|
||||
ToggleDialogControls(True)
|
||||
DlgReadDir.Model.cmdGoOn.Enabled = False
|
||||
End Sub
|
||||
|
||||
|
||||
Function CreateTextShape(oPage as Object, Filename as String)
|
||||
Dim oTextShape As Object
|
||||
Dim aPoint As New com.sun.star.awt.Point
|
||||
|
||||
aPoint.X = CalculateXPoint()
|
||||
aPoint.Y = nOldY + SBRELDIST * nOldHeight
|
||||
nOldY = aPoint.Y
|
||||
|
||||
oTextShape = oDocument.createInstance("com.sun.star.drawing.TextShape")
|
||||
oTextShape.LineStyle = 1
|
||||
oTextShape.Position = aPoint
|
||||
|
||||
oPage.add(oTextShape)
|
||||
oTextShape.TextAutoGrowWidth = TRUE
|
||||
oTextShape.TextAutoGrowHeight = TRUE
|
||||
oTextShape.String = FileName
|
||||
|
||||
' Configure Size And Position of the TextShape according to its Scripting
|
||||
aPoint.X = iLevelPos(iCurLevel,SBBASEX)
|
||||
oTextShape.Position = aPoint
|
||||
CreateTextShape() = oTextShape
|
||||
End Function
|
||||
|
||||
|
||||
Function CalculateXPoint()
|
||||
' The current level Is lower than the Old one
|
||||
If (iCurLevel< nOldLevel) And (iCurLevel<> 0) Then
|
||||
' ClearArray(iLevelPos(),iCurLevel+1)
|
||||
Elseif iCurLevel= 0 Then
|
||||
iLevelPos(iCurLevel,SBBASEX) = SBPAGEX
|
||||
' The current level Is higher than the old one
|
||||
Elseif iCurLevel> nOldLevel Then
|
||||
iLevelPos(iCurLevel,SBBASEX) = iLevelPos(iCurLevel-1,SBBASEX) + nOldWidth + 100
|
||||
End If
|
||||
CalculateXPoint = iLevelPos(iCurLevel,SBBASEX)
|
||||
End Function
|
||||
|
||||
|
||||
Function DrawLine(nLevel, nStartX, nStartY, nEndX, nEndY As Integer, oPage as Object)
|
||||
Dim oConnect As Object
|
||||
Dim aPoint As New com.sun.star.awt.Point
|
||||
Dim aSize As New com.sun.star.awt.Size
|
||||
aPoint.X = iLevelPos(nLevel,nStartX)
|
||||
aPoint.Y = iLevelPos(nLevel,nStartY)
|
||||
aSize.Width = iLevelPos(nLevel,nEndX) - iLevelPos(nLevel,nStartX)
|
||||
aSize.Height = iLevelPos(nLevel,nEndY) - iLevelPos(nLevel,nStartY)
|
||||
oConnect = oDocument.createInstance("com.sun.star.drawing.LineShape")
|
||||
oConnect.Position = aPoint
|
||||
oConnect.Size = aSize
|
||||
oPage.Add(oConnect)
|
||||
DrawLine() = oConnect
|
||||
End Function
|
||||
|
||||
|
||||
Sub GetSourceDirectory()
|
||||
GetFolderName(DlgReadDir.Model.TextField1)
|
||||
End Sub
|
||||
|
||||
|
||||
Function ReadSourceDirectory(ByVal Source As String)
|
||||
Dim i as Integer
|
||||
Dim m as Integer
|
||||
Dim n as Integer
|
||||
Dim s as integer
|
||||
Dim FileName as string
|
||||
Dim FileNameList(100,1) as String
|
||||
Dim DirList(0) as String
|
||||
Dim oUCBobject as Object
|
||||
Dim DirContent() as String
|
||||
Dim SystemPath as String
|
||||
Dim PathSeparator as String
|
||||
Dim MaxFileIndex as Integer
|
||||
PathSeparator = GetPathSeparator()
|
||||
oUcbobject = createUnoService("com.sun.star.ucb.SimpleFileAccess")
|
||||
m = 0
|
||||
s = 0
|
||||
DirList(0) = Source
|
||||
FileNameList(n,0) = Source
|
||||
SystemPath = ConvertFromUrl(Source)
|
||||
FileNameList(n,1) = FileNameoutofPath(SystemPath, PathSeparator)
|
||||
n = 1
|
||||
Do
|
||||
Source = DirList(m)
|
||||
m = m + 1
|
||||
DirContent() = oUcbObject.GetFolderContents(Source,True)
|
||||
If Ubound(DirContent()) <> -1 Then
|
||||
MaxFileIndex = Ubound(DirContent())
|
||||
For i = 0 to MaxFileIndex
|
||||
FileName = DirContent(i)
|
||||
FileNameList(n,0) = FileName
|
||||
SystemPath = ConvertFromUrl(FileName)
|
||||
FileNameList(n,1) = FileNameOutofPath(SystemPath, PathSeparator)
|
||||
n = n + 1
|
||||
If n > Ubound(FileNameList(),1) Then
|
||||
ReDim Preserve FileNameList(n + 10,1) as String
|
||||
End If
|
||||
If oUcbObject.IsFolder(FileName) Then
|
||||
s = s + 1
|
||||
ReDim Preserve DirList(s) as String
|
||||
DirList(s) = FileName
|
||||
End If
|
||||
Next i
|
||||
End If
|
||||
Loop Until m > Ubound(DirList()
|
||||
ReDim Preserve FileNameList(n-1,1) as String
|
||||
ReadSourceDirectory() = FileNameList()
|
||||
End Function
|
||||
|
||||
|
||||
Sub CloseDialog
|
||||
DlgReadDir.EndExecute
|
||||
End Sub
|
||||
|
||||
|
||||
Sub AdjustPageHeight(lShapeHeight, FileCount)
|
||||
Dim lNecHeight as Long
|
||||
Dim lBorders as Long
|
||||
oDocument.LockControllers
|
||||
lBorders = oPage.BorderTop + oPage.BorderBottom
|
||||
lNecHeight = SBPAGEY + (FileCount * SBRELDIST * lShapeHeight)
|
||||
If lNecHeight > (oPage.Height - lBorders) Then
|
||||
oPage.Height = lNecHeight + lBorders + 500
|
||||
End If
|
||||
oDocument.UnlockControllers
|
||||
End Sub
|
||||
|
||||
|
||||
Sub SetNewLevels(FileName as String, BaseLevel as Integer)
|
||||
iCurLevel= CountCharsInString(FileName, "/", 1) - BaseLevel
|
||||
If iCurLevel <> 0 Then
|
||||
nConnectLevel = iCurLevel- 1
|
||||
Else
|
||||
nConnectLevel = iCurLevel
|
||||
End If
|
||||
If iCurLevel > Ubound(iLevelPos(),1) Then
|
||||
ReDim Preserve iLevelPos(iCurLevel,9) as Long
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Sub CheckPageWidth(TextWidth as Long)
|
||||
Dim PageWidth as Long
|
||||
Dim BaseX as Long
|
||||
PageWidth = oPage.Width
|
||||
BaseX = iLevelPos(iCurLevel,SBBASEX)
|
||||
If BaseX + TextWidth > PageWidth - 1000 Then
|
||||
oPage.Width = 1000 + BaseX + TextWidth
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Sub ToggleDialogControls(bDoEnable as Boolean)
|
||||
With DlgReadDir.Model
|
||||
.cmdGoOn.Enabled = bDoEnable
|
||||
.cmdGetDir.Enabled = bDoEnable
|
||||
.Label1.Enabled = bDoEnable
|
||||
.Label2.Enabled = bDoEnable
|
||||
.TextField1.Enabled = bDoEnable
|
||||
End With
|
||||
End Sub</script:module>
|
||||
@@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE dlg:window PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "dialog.dtd">
|
||||
<!--***********************************************************
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
***********************************************************-->
|
||||
<dlg:window xmlns:dlg="http://openoffice.org/2000/dialog" xmlns:script="http://openoffice.org/2000/script" dlg:id="ReadFolderDlg" dlg:left="161" dlg:top="81" dlg:width="180" dlg:height="136" dlg:closeable="true" dlg:moveable="true" dlg:title="Read and Design Recursively">
|
||||
<dlg:bulletinboard>
|
||||
<dlg:button dlg:id="cmdGetDir" dlg:tab-index="0" dlg:left="161" dlg:top="49" dlg:width="14" dlg:height="14" dlg:value="...">
|
||||
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:Gimmicks.ReadDir.GetSourceDirectory?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:button>
|
||||
<dlg:textfield dlg:id="TextField1" dlg:tab-index="1" dlg:left="6" dlg:top="50" dlg:width="147" dlg:height="12"/>
|
||||
<dlg:button dlg:id="cmdCancel" dlg:tab-index="2" dlg:left="49" dlg:top="115" dlg:width="35" dlg:height="14" dlg:value="~Cancel">
|
||||
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:Gimmicks.ReadDir.CloseDialog?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:button>
|
||||
<dlg:button dlg:id="cmdGoOn" dlg:tab-index="3" dlg:left="95" dlg:top="115" dlg:width="35" dlg:height="14" dlg:value="~GoOn">
|
||||
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:Gimmicks.ReadDir.TreeInfo?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:button>
|
||||
<dlg:text dlg:id="Label1" dlg:tab-index="4" dlg:left="6" dlg:top="38" dlg:width="122" dlg:height="8" dlg:value="Top level path"/>
|
||||
<dlg:text dlg:id="Label2" dlg:tab-index="5" dlg:left="6" dlg:top="4" dlg:width="168" dlg:height="26" dlg:value="This macro will create a drawing document and design a complete tree view of all subdirectories from a given path." dlg:multiline="true"/>
|
||||
<dlg:progressmeter dlg:id="ProgressBar1" dlg:tab-index="6" dlg:left="6" dlg:top="101" dlg:width="170" dlg:height="10"/>
|
||||
<dlg:text dlg:id="Label3" dlg:tab-index="7" dlg:disabled="true" dlg:left="6" dlg:top="69" dlg:width="170" dlg:height="8" dlg:value="Getting the files and subdirectories..."/>
|
||||
<dlg:text dlg:id="Label4" dlg:tab-index="8" dlg:disabled="true" dlg:left="6" dlg:top="80" dlg:width="170" dlg:height="8" dlg:value="Sorting the files and subdirectories..."/>
|
||||
<dlg:text dlg:id="Label5" dlg:tab-index="9" dlg:disabled="true" dlg:left="6" dlg:top="91" dlg:width="170" dlg:height="8" dlg:value="Drawing the filestructure..."/>
|
||||
</dlg:bulletinboard>
|
||||
</dlg:window>
|
||||
@@ -0,0 +1,69 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE dlg:window PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "dialog.dtd">
|
||||
<!--***********************************************************
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
***********************************************************-->
|
||||
<dlg:window xmlns:dlg="http://openoffice.org/2000/dialog" xmlns:script="http://openoffice.org/2000/script" dlg:id="UserfieldDlg" dlg:left="161" dlg:top="57" dlg:width="281" dlg:height="214" dlg:closeable="true" dlg:moveable="true" dlg:title="Modify User Data">
|
||||
<dlg:bulletinboard>
|
||||
<dlg:text dlg:id="Label1" dlg:tab-index="0" dlg:left="6" dlg:top="48" dlg:width="57" dlg:height="8" dlg:value="Label1"/>
|
||||
<dlg:text dlg:id="Label2" dlg:tab-index="1" dlg:left="6" dlg:top="64" dlg:width="57" dlg:height="8" dlg:value="Label2"/>
|
||||
<dlg:text dlg:id="Label3" dlg:tab-index="2" dlg:left="6" dlg:top="80" dlg:width="57" dlg:height="8" dlg:value="Label3"/>
|
||||
<dlg:text dlg:id="Label4" dlg:tab-index="3" dlg:left="6" dlg:top="96" dlg:width="57" dlg:height="8" dlg:value="Label4"/>
|
||||
<dlg:text dlg:id="Label5" dlg:tab-index="4" dlg:left="6" dlg:top="112" dlg:width="57" dlg:height="8" dlg:value="Label5"/>
|
||||
<dlg:text dlg:id="Label6" dlg:tab-index="5" dlg:left="6" dlg:top="128" dlg:width="57" dlg:height="8" dlg:value="Label6"/>
|
||||
<dlg:text dlg:id="Label7" dlg:tab-index="6" dlg:left="6" dlg:top="144" dlg:width="57" dlg:height="8" dlg:value="Label7"/>
|
||||
<dlg:text dlg:id="Label8" dlg:tab-index="7" dlg:left="6" dlg:top="160" dlg:width="57" dlg:height="8" dlg:value="Label8"/>
|
||||
<dlg:text dlg:id="Label9" dlg:tab-index="8" dlg:left="6" dlg:top="176" dlg:width="57" dlg:height="8" dlg:value="Label9"/>
|
||||
<dlg:textfield dlg:id="TextField1" dlg:tab-index="9" dlg:left="65" dlg:top="46" dlg:width="193" dlg:height="12"/>
|
||||
<dlg:textfield dlg:id="TextField2" dlg:tab-index="10" dlg:left="65" dlg:top="62" dlg:width="193" dlg:height="12"/>
|
||||
<dlg:textfield dlg:id="TextField3" dlg:tab-index="11" dlg:left="65" dlg:top="78" dlg:width="193" dlg:height="12"/>
|
||||
<dlg:textfield dlg:id="TextField4" dlg:tab-index="12" dlg:left="65" dlg:top="94" dlg:width="193" dlg:height="12"/>
|
||||
<dlg:textfield dlg:id="TextField5" dlg:tab-index="13" dlg:left="65" dlg:top="110" dlg:width="193" dlg:height="12"/>
|
||||
<dlg:textfield dlg:id="TextField6" dlg:tab-index="14" dlg:left="65" dlg:top="126" dlg:width="193" dlg:height="12"/>
|
||||
<dlg:textfield dlg:id="TextField7" dlg:tab-index="15" dlg:left="65" dlg:top="142" dlg:width="193" dlg:height="12"/>
|
||||
<dlg:textfield dlg:id="TextField8" dlg:tab-index="16" dlg:left="65" dlg:top="158" dlg:width="193" dlg:height="12"/>
|
||||
<dlg:textfield dlg:id="TextField9" dlg:tab-index="17" dlg:left="65" dlg:top="174" dlg:width="193" dlg:height="12"/>
|
||||
<dlg:scrollbar dlg:id="ScrollBar1" dlg:tab-index="18" dlg:left="263" dlg:top="46" dlg:width="12" dlg:height="140" dlg:align="vertical">
|
||||
<script:event script:event-name="on-adjustmentvaluechange" script:macro-name="vnd.sun.star.script:Gimmicks.Userfields.ScrollControls?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:scrollbar>
|
||||
<dlg:button dlg:id="cmdQuit" dlg:tab-index="19" dlg:left="6" dlg:top="193" dlg:width="35" dlg:height="14" dlg:help-text="Exit Macro" dlg:value="Exit">
|
||||
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:Gimmicks.Userfields.StopMacro?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:button>
|
||||
<dlg:button dlg:id="cmdSave" dlg:tab-index="20" dlg:left="45" dlg:top="193" dlg:width="35" dlg:height="14" dlg:help-text="Save All Data of All Users to File" dlg:value="~Save">
|
||||
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:Gimmicks.Userfields.SaveSettings?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:button>
|
||||
<dlg:button dlg:id="cmdSelect" dlg:tab-index="21" dlg:left="84" dlg:top="193" dlg:width="35" dlg:height="14" dlg:help-text="Replace the User Data in <PRODUCTNAME> With the User Data Above" dlg:value="Se~lect">
|
||||
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:Gimmicks.Userfields.SelectCurrentFields?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:button>
|
||||
<dlg:button dlg:id="cmdNextUser" dlg:tab-index="22" dlg:left="162" dlg:top="193" dlg:width="35" dlg:height="14" dlg:tag="1" dlg:help-text="Show Data of Next User" dlg:value="Next >>">
|
||||
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:Gimmicks.Userfields.StepToRecord?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:button>
|
||||
<dlg:button dlg:id="cmdPrevUser" dlg:tab-index="23" dlg:left="123" dlg:top="193" dlg:width="35" dlg:height="14" dlg:tag="-1" dlg:help-text="Show Data of Previous User" dlg:value="<<Previous">
|
||||
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:Gimmicks.Userfields.StepToRecord?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:button>
|
||||
<dlg:button dlg:id="CommandButton1" dlg:tab-index="24" dlg:left="201" dlg:top="193" dlg:width="35" dlg:height="14" dlg:help-text="Add Data for New User" dlg:value="~New">
|
||||
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:Gimmicks.Userfields.AddRecord?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:button>
|
||||
<dlg:text dlg:id="Label10" dlg:tab-index="25" dlg:left="6" dlg:top="6" dlg:width="269" dlg:height="34" dlg:value="This macro lets you easily administrate several user profiles.
The user data of several users may be stored in a single file in the directory <ConfigDir>. From there, you can select a particular user whose data is then the current user data in <PRODUCTNAME>." dlg:multiline="true"/>
|
||||
<dlg:button dlg:id="cmdDelete" dlg:tab-index="26" dlg:left="240" dlg:top="193" dlg:width="35" dlg:height="14" dlg:help-text="Delete Data of Current User" dlg:value="Delete">
|
||||
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:Gimmicks.Userfields.DeleteCurrentSettings?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:button>
|
||||
</dlg:bulletinboard>
|
||||
</dlg:window>
|
||||
239
office-plugin/windows-office/share/basic/Gimmicks/Userfields.xba
Normal file
239
office-plugin/windows-office/share/basic/Gimmicks/Userfields.xba
Normal file
@@ -0,0 +1,239 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
|
||||
<!--***********************************************************
|
||||
*
|
||||
* 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
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
***********************************************************-->
|
||||
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Userfields" script:language="StarBasic">Option Explicit
|
||||
'Todo: Controlling Scrollbar via Keyboard
|
||||
|
||||
Public Const SBMAXFIELDINDEX = 14
|
||||
|
||||
Public DlgUserFields as Object
|
||||
Public oDocument as Object
|
||||
Public UserFieldDataType(SBMAXFIELDINDEX,1) as String
|
||||
Public ScrollBarValue as Integer
|
||||
Public UserFieldFamily(0, SBMAXfIELDINDEX) as String
|
||||
Public Const SBTBCOUNT = 9
|
||||
Public oUserDataAccess as Object
|
||||
Public CurFieldIndex as Integer
|
||||
Public FilePath as String
|
||||
|
||||
Sub StartChangesUserfields
|
||||
Dim SystemPath as String
|
||||
BasicLibraries.LoadLibrary("Tools")
|
||||
UserFieldDatatype(0,0) = "COMPANY"
|
||||
UserFieldDatatype(0,1) = "o"
|
||||
UserFieldDatatype(1,0) = "FIRSTNAME"
|
||||
UserFieldDatatype(1,1) = "givenname"
|
||||
UserFieldDatatype(2,0) = "LASTNAME"
|
||||
UserFieldDatatype(2,1) = "sn"
|
||||
UserFieldDatatype(3,0) = "INITIALS"
|
||||
UserFieldDatatype(3,1) = "initials"
|
||||
UserFieldDatatype(4,0) = "STREET"
|
||||
UserFieldDatatype(4,1) = "street"
|
||||
UserFieldDatatype(5,0) = "COUNTRY"
|
||||
UserFieldDatatype(5,1) = "c"
|
||||
UserFieldDatatype(6,0) = "ZIP"
|
||||
UserFieldDatatype(6,1) = "postalcode"
|
||||
UserFieldDatatype(7,0) = "CITY"
|
||||
UserFieldDatatype(7,1) = "l"
|
||||
UserFieldDatatype(8,0) = "TITLE"
|
||||
UserFieldDatatype(8,1) = "title"
|
||||
UserFieldDatatype(9,0) = "POSITION"
|
||||
UserFieldDatatype(9,1) = "position"
|
||||
UserFieldDatatype(10,0) = "PHONE_HOME"
|
||||
UserFieldDatatype(10,1) = "homephone"
|
||||
UserFieldDatatype(11,0) = "PHONE_WORK"
|
||||
UserFieldDatatype(11,1) = "telephonenumber"
|
||||
UserFieldDatatype(12,0) = "FAX"
|
||||
UserFieldDatatype(12,1) = "facsimiletelephonenumber"
|
||||
UserFieldDatatype(13,0) = "E-MAIL"
|
||||
UserFieldDatatype(13,1) = "mail"
|
||||
UserFieldDatatype(14,0) = "STATE"
|
||||
UserFieldDatatype(14,1) = "st"
|
||||
FilePath = GetPathSettings("Config", False) & "/" & "UserData.dat"
|
||||
DlgUserFields = LoadDialog("Gimmicks","UserfieldDlg")
|
||||
SystemPath = ConvertFromUrl(FilePath)
|
||||
DlgUserFields.Model.Label10.Label = ReplaceString(DlgUserFields.Model.Label10.Label, "'" & SystemPath & "'", "<ConfigDir>")
|
||||
DlgUserFields.Model.Label10.Label = ReplaceString(DlgUserFields.Model.Label10.Label, GetProductName(), "<PRODUCTNAME>")
|
||||
DlgUserFields.Model.cmdSelect.HelpText = ReplaceString(DlgUserFields.Model.cmdSelect.HelpText, GetProductName(), "<PRODUCTNAME>")
|
||||
ScrollBarValue = 0
|
||||
oUserDataAccess = GetRegistryKeyContent("org.openoffice.UserProfile/Data", True)
|
||||
InitializeUserFamily()
|
||||
FillDialog()
|
||||
DlgUserFields.Execute
|
||||
DlgUserFields.Dispose()
|
||||
End Sub
|
||||
|
||||
|
||||
Sub FillDialog()
|
||||
Dim a as Integer
|
||||
With DlgUserFields
|
||||
For a = 1 To SBTBCount
|
||||
.GetControl("Label" & a).Model.Label = UserFieldDataType(a-1,0)
|
||||
.GetControl("TextField" & a).Model.Text = UserFieldFamily(CurFieldIndex, a-1)
|
||||
Next a
|
||||
.Model.ScrollBar1.ScrollValueMax = (SBMAXFIELDINDEX+1) - SBTBCOUNT
|
||||
.Model.ScrollBar1.BlockIncrement = SBTBCOUNT
|
||||
.Model.ScrollBar1.LineIncrement = 1
|
||||
.Model.ScrollBar1.ScrollValue = ScrollBarValue
|
||||
End With
|
||||
End Sub
|
||||
|
||||
|
||||
Sub ScrollControls()
|
||||
ScrollTextFieldInfo(ScrollBarValue)
|
||||
ScrollBarValue = DlgUserFields.Model.ScrollBar1.ScrollValue
|
||||
If (ScrollBarValue + SBTBCOUNT) >= SBMAXFIELDINDEX + 1 Then
|
||||
ScrollBarValue = (SBMAXFIELDINDEX + 1) - SBTBCOUNT
|
||||
End If
|
||||
FillupTextFields()
|
||||
End Sub
|
||||
|
||||
|
||||
Sub ScrollTextFieldInfo(ByVal iScrollValue as Integer)
|
||||
Dim a as Integer
|
||||
Dim CurIndex as Integer
|
||||
For a = 1 To SBTBCOUNT
|
||||
CurIndex = (a-1) + iScrollValue
|
||||
UserFieldFamily(CurFieldIndex,CurIndex) = DlgUserFields.GetControl("TextField" & a).Model.Text
|
||||
Next a
|
||||
End Sub
|
||||
|
||||
|
||||
Sub StopMacro()
|
||||
DlgUserFields.EndExecute
|
||||
End Sub
|
||||
|
||||
|
||||
Sub SaveSettings()
|
||||
Dim n as Integer
|
||||
Dim m as Integer
|
||||
Dim MaxIndex as Integer
|
||||
ScrollTextFieldInfo(DlgUserFields.Model.ScrollBar1.ScrollValue)
|
||||
MaxIndex = Ubound(UserFieldFamily(), 1)
|
||||
Dim FileStrings(MaxIndex) as String
|
||||
For n = 0 To MaxIndex
|
||||
FileStrings(n) = ""
|
||||
For m = 0 To SBMAXFIELDINDEX
|
||||
FileStrings(n) = FileStrings(n) & UserFieldFamily(n,m) & ";"
|
||||
Next m
|
||||
Next n
|
||||
SaveDataToFile(FilePath, FileStrings(), True)
|
||||
End Sub
|
||||
|
||||
|
||||
Sub ToggleButtons(ByVal Index as Integer)
|
||||
Dim i as Integer
|
||||
CurFieldIndex = Index
|
||||
DlgUserFields.Model.cmdNextUser.Enabled = CurFieldIndex <> Ubound(UserFieldFamily(), 1)
|
||||
DlgUserFields.Model.cmdPrevUser.Enabled = CurFieldIndex <> 0
|
||||
End Sub
|
||||
|
||||
|
||||
Sub InitializeUserFamily()
|
||||
Dim FirstIndex as Integer
|
||||
Dim UserFieldstrings() as String
|
||||
Dim LocStrings() as String
|
||||
Dim bFileExists as Boolean
|
||||
Dim n as Integer
|
||||
Dim m as Integer
|
||||
bFileExists = LoadDataFromFile(GetPathSettings("Config", False) & "/" & "UserData.dat", UserFieldStrings())
|
||||
If bFileExists Then
|
||||
FirstIndex = Ubound(UserFieldStrings())
|
||||
ReDim Preserve UserFieldFamily(FirstIndex, SBMAXFIELDINDEX) as String
|
||||
For n = 0 To FirstIndex
|
||||
LocStrings() = ArrayOutofString(UserFieldStrings(n), ";")
|
||||
For m = 0 To SBMAXFIELDINDEX
|
||||
UserFieldFamily(n,m) = LocStrings(m)
|
||||
Next m
|
||||
Next n
|
||||
Else
|
||||
ReDim Preserve UserFieldFamily(0,SBMAXFIELDINDEX) as String
|
||||
For m = 0 To SBMAXFIELDINDEX
|
||||
UserFieldFamily(0,m) = oUserDataAccess.GetByName(UserFieldDataType(m,1))
|
||||
Next m
|
||||
End If
|
||||
ToggleButtons(0)
|
||||
End Sub
|
||||
|
||||
|
||||
Sub AddRecord()
|
||||
Dim i as Integer
|
||||
Dim MaxIndex as Integer
|
||||
For i = 1 To SBTBCount
|
||||
DlgUserFields.GetControl("TextField" & i).Model.Text = ""
|
||||
Next i
|
||||
MaxIndex = Ubound(UserFieldFamily(),1)
|
||||
ReDim Preserve UserFieldFamily(MaxIndex + 1, SBMAXFIELDINDEX) as String
|
||||
ToggleButtons(MaxIndex + 1, 1)
|
||||
End Sub
|
||||
|
||||
|
||||
Sub FillupTextFields()
|
||||
Dim a as Integer
|
||||
Dim CurIndex as Integer
|
||||
For a = 1 To SBTBCOUNT
|
||||
CurIndex = (a-1) + ScrollBarValue
|
||||
DlgUserFields.GetControl("Label" & a).Model.Label = UserFieldDataType(CurIndex,0)
|
||||
DlgUserFields.GetControl("TextField" & a).Model.Text = UserFieldFamily(CurFieldIndex, CurIndex)
|
||||
Next a
|
||||
End Sub
|
||||
|
||||
|
||||
Sub StepToRecord(aEvent as Object)
|
||||
Dim iStep as Integer
|
||||
iStep = CInt(aEvent.Source.Model.Tag)
|
||||
ScrollTextFieldInfo(ScrollBarValue)
|
||||
ToggleButtons(CurFieldIndex + iStep)
|
||||
FillUpTextFields()
|
||||
End Sub
|
||||
|
||||
|
||||
Sub SelectCurrentFields()
|
||||
Dim MaxIndex as Integer
|
||||
Dim i as Integer
|
||||
ScrollTextFieldInfo(ScrollBarValue)
|
||||
MaxIndex = Ubound(UserFieldFamily(),2)
|
||||
For i = 0 To MaxIndex
|
||||
oUserDataAccess.ReplaceByName(UserFieldDataType(i,1), UserFieldFamily(CurFieldIndex, i))
|
||||
Next i
|
||||
oUserDataAccess.commitChanges()
|
||||
End Sub
|
||||
|
||||
|
||||
Sub DeleteCurrentSettings()
|
||||
Dim n as Integer
|
||||
Dim m as Integer
|
||||
Dim MaxIndex as Integer
|
||||
MaxIndex = Ubound(UserFieldFamily(),1)
|
||||
If CurFieldIndex < MaxIndex Then
|
||||
For n = CurFieldIndex To MaxIndex - 1
|
||||
For m = 0 To SBMAXFIELDINDEX
|
||||
UserFieldFamily(n,m) = UserFieldFamily(n + 1,m)
|
||||
Next m
|
||||
Next n
|
||||
Else
|
||||
CurFieldIndex = MaxIndex - 1
|
||||
End If
|
||||
ReDim Preserve UserFieldFamily(MaxIndex-1, SBMAXfIELDINDEX) as String
|
||||
FillupTextFields()
|
||||
ToggleButtons(CurFieldIndex)
|
||||
End Sub</script:module>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
|
||||
<library:library xmlns:library="http://openoffice.org/2000/library" library:name="Gimmicks" library:readonly="false" library:passwordprotected="false">
|
||||
<library:element library:name="UserfieldDlg"/>
|
||||
<library:element library:name="ReadFolderDlg"/>
|
||||
</library:library>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
|
||||
<library:library xmlns:library="http://openoffice.org/2000/library" library:name="Gimmicks" library:readonly="false" library:passwordprotected="false">
|
||||
<library:element library:name="GetTexts"/>
|
||||
<library:element library:name="Userfields"/>
|
||||
<library:element library:name="ChangeAllChars"/>
|
||||
<library:element library:name="AutoText"/>
|
||||
<library:element library:name="ReadDir"/>
|
||||
</library:library>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user