优化项目结构、优化 maven 结构

This commit is contained in:
chenkailing
2021-02-10 00:58:13 +08:00
parent 28d3e05ca9
commit 2542a24675
3610 changed files with 77 additions and 180 deletions

View 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 *****
&apos; Column A has the index 1
Public Const SBCOLUMNNAME1 = 3 &apos; Stock names, sheet 1
Public Const SBCOLUMNID1 = 4 &apos; Stock ID, sheet 1
Public Const SBCOLUMNQUANTITY1 = 5 &apos; Stock quantity sheet 1
Public Const SBCOLUMNRATE1 = 7 &apos; Price for stocks, sheet 1
Public Const SBCOLUMNNAME2 = 3 &apos; Stock names, sheet 2
Public Const SBCOLUMNDATE2 = 4 &apos; Transaction dates, sheet 2
Public Const SBCOLUMNQUANTITY2 = 5 &apos; Transaction quantity, sheet 2
Public Const SBCOLUMNRATE2 = 6 &apos; Price for stocks, sheet 2
Public Const SBCOLUMNPROVPERCENT2 = 7 &apos; Provision in %, sheet 2
Public Const SBCOLUMNPROVMIN2 = 8 &apos; Minimum provision, sheet 2
Public Const SBCOLUMNPROVFIX2 = 9 &apos; Fixed provision, sheet 2
Public Const SBCOLUMNPROCEEDS2 = 12 &apos; Profit, sheet 2
Public Const SBCOLUMNQTYSOLD2 = 14 &apos; Quantity sold, sheet 2
Public Const SBCOLUMNQTYREST2 = 15 &apos; Quantity not sold yet, sheet 2
Public Const SBCOLUMNPRCREST2 = 16 &apos; Proportional proce for quantity not sold yet, sheet 2
Public Const SBCOLUMNREALPROC2 = 17 &apos; Realized proceeds, sheet 2
Public Const SBCOLUMNDIVIDEND2 = 18 &apos; Dividend paid, sheet 2
Public Const SBCOLUMNREALPROFIT2 = 19 &apos; Realized profit, sheet 2
Public Const SBROWFIRSTTRANSACT2 = 8 &apos; First data row, sheet 2
Public Const SBROWHEADER1 = 6 &apos; 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 &apos; 0 = no ID, 1 = stocks have an ID
Public Const SBDIALOGSELL = 1 &apos; Step for main dialog
Public Const SBDIALOGBUY = 2 &apos; 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 = &quot;d&quot;
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 &quot;de&quot;
LoadGermanLanguage()
Case &quot;en&quot;
LoadEnglishLanguage()
Case &quot;fr&quot;
LoadFrenchLanguage()
Case &quot;it&quot;
LoadItalianLanguage()
Case &quot;es&quot;
LoadSpanishLanguage()
Case &quot;sv&quot;
LoadSwedishLanguage()
Case &quot;ja&quot;
LoadJapaneseLanguage()
Case &quot;ko&quot;
LoadKoreanLanguage()
Case &quot;zh&quot;
If sDocCountry = &quot;CN&quot; 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,&quot;;&quot;,SBBINARY) = 0 Then
bIsLocale = CheckDocLocale(LocLanguage, LocCountry)
Else
EuroIndex = 0
sLangList() = ArrayoutofString(LocLanguage, &quot;;&quot;, MaxIndex)
sCountryList() = ArrayoutofString(LocCountry, &quot;;&quot;, MaxIndex)
sExtensionList() = ArrayoutofString(sMarket(n,8), &quot;;&quot;, 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) = &quot;Euro&quot;
sCountryMarket(0,1) = chr(8364)
sCountryMarket(0,2) = &quot;Paris&quot;
sCountryMarket(0,3) = &quot;http://fr.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;.PA&amp;f=s4l1t1c1ghov&amp;e=.csv&quot;
sCountryMarket(0,5) = &quot;Code&quot;
sCountryMarket(0,6) = &quot;fr&quot;
sCountryMarket(0,7) = &quot;FR&quot;
sCountryMarket(0,8) = &quot;40C&quot;
sCountryMarket(0,9) = &quot;59/9&quot;
sCountryMarket(0,10) = &quot;1&quot;
sCountryMarket(1,0) = &quot;Euro&quot;
sCountryMarket(1,1) = chr(8364)
sCountryMarket(1,2) = &quot;Milano&quot;
sCountryMarket(1,3) = &quot;http://it.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;.MI&amp;f=sl1d1t1c1ohgv&amp;e=.csv&quot;
sCountryMarket(1,5) = &quot;Codice&quot;
sCountryMarket(1,6) = &quot;it&quot;
sCountryMarket(1,7) = &quot;IT&quot;
sCountryMarket(1,8) = &quot;410&quot;
sCountryMarket(1,9) = &quot;44&quot;
sCountryMarket(1,10) = &quot;1&quot;
sCountryMarket(2,0) = &quot;Euro&quot;
sCountryMarket(2,1) = chr(8364)
sCountryMarket(2,2) = &quot;Madrid&quot;
sCountryMarket(2,3) = &quot;http://es.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;&amp;m=MC&amp;f=sl1d1t1c1ohgv&amp;e=.csv&quot;
sCountryMarket(2,5) = &quot;Simbolo&quot;
sCountryMarket(2,6) = &quot;es&quot;
sCountryMarket(2,7) = &quot;ES&quot;
sCountryMarket(2,8) = &quot;40A&quot;
sCountryMarket(2,9) = &quot;44&quot;
sCountryMarket(2,10) = &quot;1&quot;
sCountryMarket(3,0) = &quot;Dansk krone&quot;
sCountryMarket(3,1) = &quot;kr&quot;
sCountryMarket(3,2) = &quot;København&quot;
sCountryMarket(3,3) = &quot;http://dk.finance.yahoo.com/d/quotes.csv?s=&lt;StockID.CO&amp;f=sl1d1t1c1ohgv&amp;e=.csv&quot;
sCountryMarket(3,5) = &quot;Aktiesymbol&quot;
sCountryMarket(3,6) = &quot;da&quot;
sCountryMarket(3,7) = &quot;DK&quot;
sCountryMarket(3,8) = &quot;406&quot;
sCountryMarket(3,9) = &quot;44&quot;
sCountryMarket(3,10) = &quot;1&quot;
sCountryMarket(4,0) = &quot;Svensk krona&quot;
sCountryMarket(4,1) = &quot;kr&quot;
sCountryMarket(4,2) = &quot;Stockholm&quot;
sCountryMarket(4,3) = &quot;http://se.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;.L&amp;f=sl1d1t1c1ohgv&amp;e=.c&quot;
sCountryMarket(4,5) = &quot;Kod&quot;
sCountryMarket(4,6) = &quot;sv&quot;
sCountryMarket(4,7) = &quot;SE&quot;
sCountryMarket(4,8) = &quot;41D&quot;
sCountryMarket(4,9) = &quot;44&quot;
sCountryMarket(4,10) = &quot;1&quot;
&apos; Taiwan Dollar
sCountryMarket(5,0) = &quot;新臺幣&quot;
sCountryMarket(5,1) = &quot;&quot;
sCountryMarket(5,2) = &quot;代號&quot;
sCountryMarket(5,3) = &quot;http://tw.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;.TW&amp;f=sl1d1t1c1ohgv&amp;e=.csv&quot;
sCountryMarket(5,5) = &quot;代號&quot;
sCountryMarket(5,6) = &quot;zh&quot;
sCountryMarket(5,7) = &quot;TW&quot;
sCountryMarket(5,8) = &quot;404&quot;
sCountryMarket(5,9) = &quot;44&quot;
sCountryMarket(5,10) = &quot;1&quot;
&apos; Chinese Yuan
sCountryMarket(6,0) = &quot;人民币&quot;
sCountryMarket(6,1) = &quot;&quot;
sCountryMarket(6,2) = &quot;代号&quot;
sCountryMarket(6,3) = &quot;http://cn.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;.SS&amp;f=sl1d1t1c1ohgv&amp;e=.csv&quot;
sCountryMarket(6,5) = &quot;代号&quot;
sCountryMarket(6,6) = &quot;zh&quot;
sCountryMarket(6,7) = &quot;CN&quot;
sCountryMarket(6,8) = &quot;804&quot;
sCountryMarket(6,9) = &quot;44&quot;
sCountryMarket(6,10) = &quot;1&quot;
&apos; korean Won
sCountryMarket(7,0) = &quot;한국 원화&quot;
sCountryMarket(7,1) = &quot;&quot;
sCountryMarket(7,2) = &quot;서울&quot;
sCountryMarket(7,3) = &quot;http://kr.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;.KS&amp;f=snl1d1t1c1ohgv&amp;e=.csv&quot;
sCountryMarket(7,5) = &quot;종목 코드&quot;
sCountryMarket(7,6) = &quot;ko&quot;
sCountryMarket(7,7) = &quot;KR&quot;
sCountryMarket(7,8) = &quot;412&quot;
sCountryMarket(7,9) = &quot;44&quot;
sCountryMarket(7,10) = &quot;2&quot;
&apos; sCountryMarket(5,0) = &quot;Российский рубль&quot;
&apos; sCountryMarket(5,1) = &quot;р.&quot;
&apos; sCountryMarket(5,2) = &quot;&quot;
&apos; sCountryMarket(5,3) = &quot;&quot;
&apos; sCountryMarket(5,5) = &quot;&quot;
&apos; sCountryMarket(5,6) = &quot;ru&quot;
&apos; sCountryMarket(5,7) = &quot;RU&quot;
&apos; sCountryMarket(5,8) = &quot;-419&quot;
&apos; sCountryMarket(5,9) = &quot;&quot;
&apos;
&apos; sCountryMarket(6,0) = &quot;Złoty polski&quot;
&apos; sCountryMarket(6,1) = &quot;&quot;
&apos; sCountryMarket(6,2) = &quot;&quot;
&apos; sCountryMarket(6,3) = &quot;&quot;
&apos; sCountryMarket(6,5) = &quot;&quot; &apos;Still Todo!!
&apos; sCountryMarket(6,6) = &quot;pl&quot;
&apos; sCountryMarket(6,7) = &quot;PL&quot;
&apos; sCountryMarket(6,8) = &quot;-415&quot;
&apos; sCountryMarket(6,9) = &quot;&quot;
&apos;
&apos; sCountryMarket(7,0) = &quot;Türkische Lira&quot;
&apos; sCountryMarket(7,1) = &quot;TL&quot;
&apos; sCountryMarket(7,2) = &quot;&quot;
&apos; sCountryMarket(7,3) = &quot;&quot;
&apos; sCountryMarket(7,5) = &quot;&quot; &apos;Still Todo!!
&apos; sCountryMarket(7,6) = &quot;tr&quot;
&apos; sCountryMarket(7,7) = &quot;TR&quot;
&apos; sCountryMarket(7,8) = &quot;-41F&quot;
&apos; sCountryMarket(7,9) = &quot;&quot;
Dim n as Integer
Dim m as Integer
&apos; 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(&quot;Depot&quot;, &quot;Dialog2&quot;)
DlgStockRates = LoadDialog(&quot;Depot&quot;, &quot;Dialog3&quot;)
DlgStartUp = LoadDialog(&quot;Depot&quot;, &quot;Dialog4&quot;)
TransactModel = DlgTransaction.Model
StockRatesModel = DlgStockRates.Model
StartUpModel = DlgStartUp.Model
End Sub
Sub InitializeStartUpModel()
With StartUpModel
.lblWelcome.Label = sStartupWelcome &amp; Chr(13) &amp; chr(13) &amp; sStartUpChooseMarket
sStartUpHint = ReplaceString(sStartUpHint, sHistory, &quot;&lt;History&gt;&quot;)
.lblHint.Label = sStartupHint
&apos; .cmdGoOn.Enabled = Ubound(StartUpModel.lstMarkets.SelectedItems()) &lt;&gt; -1
.cmdGoOn.Label = sOK
.cmdCancel.Label = sCancel
End With
End Sub</script:module>

View 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(&quot;lstMarkets&quot;)
a = 0
For i = 0 To Ubound(sMarket(),1)
ListString = sMarket(i,0)
If sMarket(i,0) &lt;&gt; &quot;&quot; Then
If sMarket(i,3) = &quot;&quot; Then
ListString = ListString &amp; &quot; (&quot; &amp; sNoInternetUpdate &amp; &quot;)&quot;
Else
ListString = ListString &amp; &quot; (&quot; &amp; sMarketplace &amp; &quot; &quot; &amp; sMarket(i,2) &amp; &quot;)&quot;
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(&quot;lstMarkets&quot;).SetFocus()
DlgStartUp.Execute()
DlgStartUp.Dispose()
End Sub
Sub EnableGoOnButton()
StartUpModel.cmdGoOn.Enabled = True
StartUpModel.cmdGoOn.DefaultButton = True
End Sub
Sub CloseStartUpDialog()
DlgStartUp.EndExecute()
&apos; 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), &quot;CmdInternet&quot;)
If Not IsMissing(aEvent) Then
Index = StartupModel.lstMarkets.SelectedItems(0)
oInternetModel.Tag = Index
Else
Index = oInternetModel.Tag
End If
oMarketModel = GetControlModel(oDocument.Sheets(0), &quot;CmdHistory&quot;)
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,&quot;;&quot;) &lt;&gt; 0 Then
&apos; Take the german extension as the stock place is Frankfurt
sCurExtension = &quot;407&quot;
End If
sCurChartSource = sMarket(Index,3)
bIsDocLanguage = Instr(1, sMarket(Index,6), sDocLanguage, SBBINARY) &lt;&gt; 0
bIsDocCountry = Instr(1, sMarket(Index,7), sDocCountry, SBBINARY) &lt;&gt; 0 OR SDocCountry = &quot;&quot;
sCurSeparator = sMarket(Index,9)
TransactModel.txtRate.CurrencySymbol = sCurCurrency
TransactModel.txtFix.CurrencySymbol = sCurCurrency
TransactModel.txtMinimum.CurrencySymbol = sCurCurrency
bEnableMarket = Index = 0
bEnableInternet = sCurChartSource &lt;&gt; &quot;&quot;
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
&apos; Numberformat with the new Symbol as Base for new Format
sSimpleStr = &quot;0 [$&quot; &amp; sNewSymbol &amp; &quot;-&quot; &amp; sNewExtension &amp; &quot;]&quot;
nSimpleKey = Numberformat(oFormats, sSimpleStr, oDocLocale)
On Local Error Resume Next
iNumberFormat = oObject.NumberFormat
If Err &lt;&gt; 0 Then
Msgbox &quot;Error Reading the Number Format&quot;
Resume CLERROR
End If
On Local Error GoTo NOKEY
aFormat() = oFormats.getByKey(iNumberFormat)
On Local Error GoTo 0
&apos; 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 &lt;&gt; 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>

File diff suppressed because it is too large Load Diff

View 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&amp;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&amp;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&amp;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&amp;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&amp;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>

View 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&amp;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&amp;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&amp;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&amp;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&amp;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&amp;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>

View 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&amp;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&amp;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&amp;location=application" script:language="Script"/>
</dlg:menulist>
</dlg:bulletinboard>
</dlg:window>

View 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 &lt;&gt; 0 And LastDate &lt;&gt; 0
If bLocGoOn Then
If FirstDate &gt;= 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 = &quot;d&quot;
iStep = 1
ElseIf StockRatesModel.optWeekly.State = 1 Then
sInterval = &quot;w&quot;
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)
&apos; oDocument.AddActionLock()
UnprotectSheets(oSheets)
InitializeStatusline(&quot;&quot;, 10, 1)
oBackGroundSheet = oSheets.GetbyName(&quot;Background&quot;)
StockName = DlgStockRates.GetControl(&quot;lstStockNames&quot;).GetSelectedItem()
CurRow = GetStockRowIndex(Stockname)
sStockID = oFirstSheet.GetCellByPosition(SBCOLUMNID1, CurRow).String
ChartSource = ReplaceString(HistoryChartSource, sStockID, &quot;&lt;StockID&gt;&quot;)
ChartSource = ReplaceString(ChartSource, iStartDay, &quot;&lt;StartDay&gt;&quot;)
ChartSource = ReplaceString(ChartSource, cStr(iStartMonth-1), &quot;&lt;StartMonth&gt;&quot;)
ChartSource = ReplaceString(ChartSource, iStartYear, &quot;&lt;StartYear&gt;&quot;)
ChartSource = ReplaceString(ChartSource, iEndDay, &quot;&lt;EndDay&gt;&quot;)
ChartSource = ReplaceString(ChartSource, cStr(iEndMonth-1), &quot;&lt;EndMonth&gt;&quot;)
ChartSource = ReplaceString(ChartSource, iEndYear, &quot;&lt;EndYear&gt;&quot;)
ChartSource = ReplaceString(ChartSource, sInterval, &quot;&lt;interval&gt;&quot;)
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 &amp; &quot;: &quot; &amp; sNoInternetDataAvailable &amp; chr(13) &amp; sCheckInternetSettings
Msgbox(sMsgInternetError, 16, sProductname)
End If
ProtectSheets(oSheets)
oStatusLine.End
If oSheets.HasbyName(sNewSheetName) Then
oController.ActiveSheet = oSheets.GetByName(sNewSheetName)
End If
&apos; 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
&apos; oDocument.AddActionLock()
Initialize(True)
UnprotectSheets(oSheets)
StocksCount = GetStocksCount(iStartRow)
InitializeStatusline(&quot;&quot;, 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, &quot;&lt;StockID&gt;&quot;)
If GetCurrentRate(ChartSource, CurRate, 0) Then
InsertCurrentValue(CurRate, i, Now)
Else
sMsgInternetError = Stockname &amp; &quot;: &quot; &amp; sNoInternetDataAvailable &amp; chr(13) &amp; sCheckInternetSettings
Msgbox(sMsgInternetError, 16, sProductname)
End If
oStatusline.SetValue(i - iStartRow + 1)
Next
ProtectSheets(oSheets)
oStatusLine.End
&apos; 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(&quot;Link&quot;) Then
oLinkSheet = oSheets.getByName(&quot;Link&quot;)
Else
oLinkSheet = oDocument.createInstance(&quot;com.sun.star.sheet.Spreadsheet&quot;)
oSheets.insertByName(&quot;Link&quot;, oLinkSheet)
oLinkSheet.IsVisible = False
End If
sFilter = &quot;Text - txt - csv (StarCalc)&quot;
sOptions = sCurSeparator &amp; &quot;,34,SYSTEM,1,1/10/2/10/3/10/4/10/5/10/6/10/7/10/8/10/9/10&quot;
oLinkSheet.LinkMode = com.sun.star.sheet.SheetLinkMode.NONE
oLinkSheet.link(sUrl, &quot;&quot;, 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, &quot;.&quot;,&quot;,&quot;)
fValue = Val(sValue)
End If
GetCurrentRate = fValue &lt;&gt; 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
&apos; Insert Sheet with Company - Chart
sName = CheckNewSheetname(oSheets, sName)
If NOT oSheets.hasByName(sName) Then
oSheets.CopybyName(&quot;Background&quot;, 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(&quot;Link&quot;)
oSheet = oSheets.getByName(sName)
iLastRow = GetLastUsedRow(oSheet)- 2
iLastLinkRow = GetLastUsedRow(oLinkSheet)
iCurRow = iLastRow
bLeaveLoop = False
RemoveCount = 0
&apos; 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 &gt; 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 &gt; 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 &lt; 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) = &quot;Jan&quot;
ShortMonths(1) = &quot;Feb&quot;
ShortMonths(2) = &quot;Mar&quot;
ShortMonths(3) = &quot;Apr&quot;
ShortMonths(4) = &quot;May&quot;
ShortMonths(5) = &quot;Jun&quot;
ShortMonths(6) = &quot;Jul&quot;
ShortMonths(7) = &quot;Aug&quot;
ShortMonths(8) = &quot;Sep&quot;
ShortMonths(9) = &quot;Oct&quot;
ShortMonths(10) = &quot;Nov&quot;
ShortMonths(11) = &quot;Dec&quot;
For i = 0 To 11
DateString = ReplaceString(DateString,CStr(i+1),ShortMonths(i))
Next i
DateString = ReplaceString(DateString, &quot;.&quot;, &quot;-&quot;)
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 = &quot;&quot;
oChart.HasLegend = False
oChart.diagram = oChart.createInstance(&quot;com.sun.star.chart.XYDiagram&quot;)
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, &quot;&quot;)
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>

View 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 = &quot;~OK&quot;
sCancel = &quot;Abbrechen&quot;
sColumnHeader = &quot;Spaltenkopf&quot;
sInsertStockName = &quot;Bitte fügen Sie zunächst einige Aktien in Ihr Depot ein!&quot;
sTitle = &quot;&lt;PRODUCTNAME&gt;: Aktienverwaltung&quot;
sTitle = ReplaceString(sTitle, sProductName, &quot;&lt;PRODUCTNAME&gt;&quot;)
sMsgError = &quot;Eingabefehler&quot;
sMsgNoName = sInsertStockname
sMsgNoQuantity = &quot;Bitte geben Sie eine Stückzahl größer als 0 ein&quot;
sMsgNoDividend = &quot;Bitte geben Sie eine Dividende je Stück oder eine Gesamtdividende ein&quot;
sMsgNoExchangeRate = &quot;Bitte geben Sie eine korrekte Umtauschrate ein (alte Aktien -&gt; neue Aktien).&quot;
sMsgNoValidExchangeDate = &quot;Bitte geben Sie ein gültiges Datum für den Aktiensplitt ein.&quot;
sMsgWrongExchangeDate = &quot;Splitt nicht möglich, da bereits Transaktionen nach dem Splitt-Datum existieren.&quot;
sMsgSellTooMuch = &quot;So viele Aktien können Sie nicht verkaufen. Maximum: &quot;
sMsgConfirm = &quot;Bestätigung erforderlich&quot;
sMsgFreeStock = &quot;Beabsichtigen Sie die Eingabe von Gratisaktien?&quot;
sMsgTotalLoss = &quot;Beabsichtigen Sie die Eingabe eines Totalverlustes?&quot;
sMsgAuthorization = &quot;Sicherheitsabfrage&quot;
sMsgDeleteAll = &quot;Wollen Sie alle Bewegungen löschen und die Depotübersicht rücksetzen?&quot;
cSplit = &quot;Aktiensplitt am &quot;
sHistory = &quot;Historie&quot;
TransactTitle(1) = &quot;Aktien verkaufen&quot;
TransactTitle(2) = &quot;Aktien kaufen&quot;
StockRatesTitle(1) = &quot;Dividendenzahlung&quot;
StockRatesTitle(2) = &quot;Aktiensplitt&quot;
StockRatesTitle(3) = sHistory
sDepotCurrency = &quot;Depotwährung&quot;
sStockName = &quot;Aktienname&quot;
TransactMode = LIFO &apos; Possible values: &quot;FIFO&quot; and &quot;LIFO&quot;
DateCellStyle = &quot;Ergebnis Datum&quot;
CurrCellStyle = &quot;Ergebnis Euro mit Dezimalen&quot;
sStartDate = &quot;Startdatum:&quot;
sEndDate = &quot;Enddatum:&quot;
sStartUpWelcome = &quot;Diese Vorlage ermöglicht Ihnen eine effiziente Verwaltung Ihres Aktiendepots&quot;
sStartUpChooseMarket = &quot;Wählen Sie zunächst Ihre Referenz-Währung und damit den Börsenplatz für das Internet Update aus!&quot;
sStartUpHint = &quot;Leider steht Ihnen die &lt;History&gt;- Funktion nur für den amerikanischen Markt zur Verfügung!&quot;
sStartupHint = ReplaceString(sStartUpHint, sHistory, &quot;&lt;History&gt;&quot;)
sNoInternetUpdate = &quot;ohne Internet Update&quot;
sMarketPlace = &quot;Börsenplatz:&quot;
sNoInternetDataAvailable = &quot;Internet-Kurse konnten nicht empfangen werden!&quot;
sCheckInternetSettings = &quot;Mögliche Ursachen sind: &lt;BR&gt; Ihre Internet Einstellungen müssen überprüft werden.&lt;BR&gt; Sie haben eine falsche Kennung (z.B. Symbol, WKN) für die Aktie eingegeben.&quot;
sCheckInternetSettings = ReplaceString(sCheckInternetSettings, chr(13), &quot;&lt;BR&gt;&quot;)
sMsgEndDatebeforeNow = &quot;Das Enddatum muss vor dem heutigen Tag liegen!&quot;
sMsgStartDatebeforeEndDate = &quot;Das Startdatum muss vor dem Enddatum liegen!&quot;
sMarket(0,0) = &quot;Amerikanischer Dollar&quot;
sMarket(0,1) = &quot;$&quot;
sMarket(0,2) = &quot;New York&quot;
sMarket(0,3) = &quot;http://finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;&amp;f=sl1d1t1c1ohgv&amp;e=.csv&quot;
sMarket(0,4) = &quot;http://ichart.finance.yahoo.com/table.csv?&quot; &amp;_
&quot;s=&lt;StockID&gt;&amp;d=&lt;EndMonth&gt;&amp;e=&lt;EndDay&gt;&amp;f=&lt;Endyear&gt;&amp;g=d&amp;&quot; &amp;_
&quot;a=&lt;StartMonth&gt;&amp;b=&lt;StartDay&gt;&amp;c=&lt;Startyear&gt;&amp;ignore=.csv&quot;
sMarket(0,5) = &quot;Symbol&quot;
sMarket(0,6) = &quot;en&quot;
sMarket(0,7) = &quot;US&quot;
sMarket(0,8) = &quot;409&quot;
sMarket(0,9) = &quot;44&quot;
sMarket(0,10) = &quot;1&quot;
sMarket(1,0) = &quot;Euro&quot;
sMarket(1,1) = chr(8364)
sMarket(1,2) = &quot;Frankfurt&quot;
sMarket(1,3) = &quot;http://de.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;.F&amp;f=sl1t1c1ghpv&amp;e=.csv&quot;
sMarket(1,5) = &quot;WKN&quot;
sMarket(1,6) = &quot;de;nl;pt;el&quot;
sMarket(1,7) = &quot;DE;NL;PT;GR&quot;
sMarket(1,8) = &quot;407;413;816;408&quot;
sMarket(1,9) = &quot;59/9&quot;
sMarket(1,10) = &quot;1&quot;
sMarket(2,0) = &quot;Englisches Pfund&quot;
sMarket(2,1) = &quot;£&quot;
sMarket(2,2) = &quot;London&quot;
sMarket(2,3) = &quot;http://uk.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;.L&amp;m=*&amp;f=sl1t1c1ghov&amp;e=.csv&quot;
sMarket(2,5) = &quot;Symbol&quot;
sMarket(2,6) = &quot;en&quot;
sMarket(2,7) = &quot;GB&quot;
sMarket(2,8) = &quot;809&quot;
sMarket(2,9) = &quot;44&quot;
sMarket(2,10) = &quot;1&quot;
sMarket(3,0) = &quot;Japanischer Yen&quot;
sMarket(3,1) = &quot;¥&quot;
sMarket(3,2) = &quot;Tokyo&quot;
sMarket(3,3) = &quot;&quot;
sMarket(3,5) = &quot;Code&quot;
sMarket(3,6) = &quot;ja&quot;
sMarket(3,7) = &quot;JP&quot;
sMarket(3,8) = &quot;411&quot;
sMarket(3,9) = &quot;&quot;
sMarket(3,10) = &quot;&quot;
sMarket(4,0) = &quot;Hongkong Dollar&quot;
sMarket(4,1) = &quot;HK$&quot;
sMarket(4,2) = &quot;Hongkong&quot;
sMarket(4,3) = &quot;http://hk.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;.HK&amp;f=sl1d1t1c1ohgv&amp;e=.csv&quot;
sMarket(4,5) = &quot;Nummer&quot;
sMarket(4,6) = &quot;zh&quot;
sMarket(4,7) = &quot;HK&quot;
sMarket(4,8) = &quot;C04&quot;
sMarket(4,9) = &quot;44&quot;
sMarket(4,10) = &quot;1&quot;
sMarket(5,0) = &quot;Australischer Dollar&quot;
sMarket(5,1) = &quot;$&quot;
sMarket(5,2) = &quot;Sydney&quot;
sMarket(5,3) = &quot;http://au.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;&amp;f=sl1d1t1c1ohgv&amp;e=.csv&quot;
sMarket(5,5) = &quot;Symbol&quot;
sMarket(5,6) = &quot;en&quot;
sMarket(5,7) = &quot;AU&quot;
sMarket(5,8) = &quot;C09&quot;
sMarket(5,9) = &quot;44&quot;
sMarket(5,10) = &quot;1&quot;
&apos; ****************************End of the default subset*********************************
CompleteMarketList()
LocalizedCurrencies()
With TransactModel
.lblStockNames.Label = sStockname
.lblQuantity.Label = &quot;Menge&quot;
.lblRate.Label = &quot;Kurs&quot;
.lblDate.Label = &quot;Transaktionsdatum&quot;
.hlnCommission.Label = &quot;Sonstige Ausgaben&quot;
.lblCommission.Label = &quot;Provision&quot;
.lblMinimum.Label = &quot;Mindestprovision&quot;
.lblFix.Label = &quot;Festbetrag/Spesen&quot;
.cmdGoOn.Label = sOK
.cmdCancel.Label = sCancel
End With
With StockRatesModel
.optPerShare.Label = &quot;Dividende/Aktie&quot;
.optTotal.Label = &quot;Dividende gesamt&quot;
.lblDividend.Label = &quot;Betrag&quot;
.lblExchangeRate.Label = &quot;Umtauschrate (alt-&gt;neu)&quot;
.lblColon.Label = &quot;:&quot;
.lblDate.Label = &quot;Umtauschdatum:&quot;
.lblStockNames.Label = sStockname
.lblStartDate.Label = sStartDate
.lblEndDate.Label = sEndDate
.optDaily.Label = &quot;~Täglich&quot;
.optWeekly.Label = &quot;~Wöchentlich&quot;
.hlnInterval.Label = &quot;Zeitraum&quot;
.cmdGoOn.Label = sOk
.cmdCancel.Label = sCancel
End With
End Sub
</script:module>

View 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 = &quot;~OK&quot;
sCancel = &quot;Cancel&quot;
sColumnHeader = &quot;Column Header&quot;
sInsertStockName = &quot;Please enter shares in your portfolio.&quot;
sTitle = &quot;&lt;PRODUCTNAME&gt;: Stocks Manager&quot;
sTitle = ReplaceString(sTitle, sProductName, &quot;&lt;PRODUCTNAME&gt;&quot;)
sMsgError = &quot;Input Error&quot;
sMsgNoName = sInsertStockname
sMsgNoQuantity = &quot;Please enter a quantity larger than 0&quot;
sMsgNoDividend = &quot;Please enter the dividend per share or the total dividend&quot;
sMsgNoExchangeRate = &quot;Please enter the correct exchange rate (old shares -&gt; new shares)&quot;
sMsgNoValidExchangeDate = &quot;Please enter a valid date for the split.&quot;
sMsgWrongExchangeDate = &quot;Splitting not possible, as transactions already exist after the split date.&quot;
sMsgSellTooMuch = &quot;You cannot sell that many shares. Maximum: &quot;
sMsgConfirm = &quot;Confirmation Required&quot;
sMsgFreeStock = &quot;Do you intend to enter free shares?&quot;
sMsgTotalLoss = &quot;Do you intend to enter a total loss?&quot;
sMsgAuthorization = &quot;Security Query&quot;
sMsgDeleteAll = &quot;Do you want to delete all movements and reset the portfolio overview?&quot;
cSplit = &quot;Stock split on &quot;
sHistory = &quot;History&quot;
TransactTitle(1) = &quot;StarOffice Stocks Manager: Selling Shares&quot;
TransactTitle(2) = &quot;StarOffice Stocks Manager: Buying Shares&quot;
StockRatesTitle(1) = &quot;StarOffice Stocks Manager: Dividend Payment&quot;
StockRatesTitle(2) = &quot;Stock Split&quot;
StockRatesTitle(3) = sHistory
sDepotCurrency = &quot;Portfolio Currency&quot;
sStockName = &quot;Name of Stock&quot;
TransactMode = LIFO &apos; Possible values: &quot;FIFO&quot; and &quot;LIFO&quot;
DateCellStyle = &quot;Result Date&quot;
CurrCellStyle = &quot;1&quot;
sStartDate = &quot;Start date:&quot;
sEndDate = &quot;End date:&quot;
sStartUpWelcome = &quot;This template enables you to manage your stock portfolio efficiently.&quot;
sStartUpChooseMarket = &quot;First, select your reference currency and thus the stock exchange for the Internet update.&quot;
sStartUpHint = &quot;Unfortunately, the only &lt;History&gt; function available to you is that for the American market.&quot;
sStartupHint = ReplaceString(sStartUpHint, sHistory, &quot;&lt;History&gt;&quot;)
sNoInternetUpdate = &quot;without Internet update&quot;
sMarketPlace = &quot;Stock exchange:&quot;
sNoInternetDataAvailable = &quot;No prices could be received from the Internet!&quot;
sCheckInternetSettings = &quot;Possible causes could be: &lt;BR&gt;Your Internet settings have to be modified. &lt;BR&gt;The Symbol (e.g. Code, Ticker Symbol) entered for the stock was incorrect.&quot;
sCheckInternetSettings = ReplaceString(sCheckInternetSettings, chr(13), &quot;&lt;BR&gt;&quot;)
sMsgEndDatebeforeNow = &quot;The end date has to be before today&apos;s date.&quot;
sMsgStartDatebeforeEndDate = &quot;The start date has to be before the end date.&quot;
sMarket(0,0) = &quot;American Dollar&quot;
sMarket(0,1) = &quot;$&quot;
sMarket(0,2) = &quot;New York&quot;
sMarket(0,3) = &quot;http://finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;&amp;f=sl1d1t1c1ohgv&amp;e=.csv&quot;
sMarket(0,4) = &quot;http://ichart.finance.yahoo.com/table.csv?&quot; &amp;_
&quot;s=&lt;StockID&gt;&amp;d=&lt;EndMonth&gt;&amp;e=&lt;EndDay&gt;&amp;f=&lt;Endyear&gt;&amp;g=d&amp;&quot; &amp;_
&quot;a=&lt;StartMonth&gt;&amp;b=&lt;StartDay&gt;&amp;c=&lt;Startyear&gt;&amp;ignore=.csv&quot;
sMarket(0,5) = &quot;Symbol&quot;
sMarket(0,6) = &quot;en&quot;
sMarket(0,7) = &quot;US&quot;
sMarket(0,8) = &quot;409&quot;
sMarket(0,9) = &quot;44&quot;
sMarket(0,10) = &quot;1&quot;
sMarket(1,0) = &quot;Euro&quot;
sMarket(1,1) = chr(8364)
sMarket(1,2) = &quot;Frankfurt&quot;
sMarket(1,3) = &quot;http://de.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;.F&amp;f=sl1t1c1ghpv&amp;e=.csv&quot;
sMarket(1,5) = &quot;Ticker Symbol&quot;
sMarket(1,6) = &quot;de;nl;pt;el&quot;
sMarket(1,7) = &quot;DE;NL;PT;GR&quot;
sMarket(1,8) = &quot;407;413;816;408&quot;
sMarket(1,9) = &quot;59/9&quot;
sMarket(1,10) = &quot;1&quot;
sMarket(2,0) = &quot;British Pound&quot;
sMarket(2,1) = &quot;£&quot;
sMarket(2,2) = &quot;London&quot;
sMarket(2,3) = &quot;http://uk.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;.L&amp;m=*&amp;f=sl1t1c1ghov&amp;e=.csv&quot;
sMarket(2,5) = &quot;Symbol&quot;
sMarket(2,6) = &quot;en&quot;
sMarket(2,7) = &quot;GB&quot;
sMarket(2,8) = &quot;809&quot;
sMarket(2,9) = &quot;44&quot;
sMarket(2,10) = &quot;1&quot;
sMarket(3,0) = &quot;Japanese Yen&quot;
sMarket(3,1) = &quot;¥&quot;
sMarket(3,2) = &quot;Tokyo&quot;
sMarket(3,3) = &quot;&quot;
sMarket(3,5) = &quot;Code&quot;
sMarket(3,6) = &quot;ja&quot;
sMarket(3,7) = &quot;JP&quot;
sMarket(3,8) = &quot;411&quot;
sMarket(3,9) = &quot;&quot;
sMarket(3,10) = &quot;&quot;
sMarket(4,0) = &quot;Hong Kong Dollar&quot;
sMarket(4,1) = &quot;HK$&quot;
sMarket(4,2) = &quot;Hong Kong&quot;
sMarket(4,3) = &quot;http://hk.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;&amp;f=sl1d1t1c1ohgv&amp;e=.csv&quot;
sMarket(4,5) = &quot;Number&quot;
sMarket(4,6) = &quot;zh&quot;
sMarket(4,7) = &quot;HK&quot;
sMarket(4,8) = &quot;C04&quot;
sMarket(4,9) = &quot;44&quot;
sMarket(4,10) = &quot;1&quot;
sMarket(5,0) = &quot;Australian Dollar&quot;
sMarket(5,1) = &quot;$&quot;
sMarket(5,2) = &quot;Sydney&quot;
sMarket(5,3) = &quot;http://au.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;&amp;f=sl1d1t1c1ohgv&amp;e=.csv&quot;
sMarket(5,5) = &quot;Symbol&quot;
sMarket(5,6) = &quot;en&quot;
sMarket(5,7) = &quot;AU&quot;
sMarket(5,8) = &quot;C09&quot;
sMarket(5,9) = &quot;44&quot;
sMarket(5,10) = &quot;1&quot;
&apos; ****************************End of the default subset*********************************
CompleteMarketList()
LocalizedCurrencies()
With TransactModel
.lblStockNames.Label = sStockname
.lblQuantity.Label = &quot;Quantity&quot;
.lblRate.Label = &quot;Price&quot;
.lblDate.Label = &quot;Transaction Date&quot;
.hlnCommission.Label = &quot;Other expenditures&quot;
.lblCommission.Label = &quot;Commission&quot;
.lblMinimum.Label = &quot;Min. Commission&quot;
.lblFix.Label = &quot;Fixed Costs/Charges&quot;
.cmdGoOn.Label = sOK
.cmdCancel.Label = sCancel
End With
With StockRatesModel
.optPerShare.Label = &quot;Dividends/Stocks&quot;
.optTotal.Label = &quot;Total Dividends&quot;
.lblDividend.Label = &quot;Amount&quot;
.lblExchangeRate.Label = &quot;Exchange Rate (old-&gt;new)&quot;
.lblColon.Label = &quot;:&quot;
.lblDate.Label = &quot;Exchange Date:&quot;
.lblStockNames.Label = sStockname
.lblStartDate.Label = sStartDate
.lblEndDate.Label = sEndDate
.optDaily.Label = &quot;~Daily&quot;
.optWeekly.Label = &quot;~Weekly&quot;
.hlnInterval.Label = &quot;Time period&quot;
.cmdGoOn.Label = sOk
.cmdCancel.Label = sCancel
End With
End Sub
</script:module>

View 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 = &quot;~Aceptar&quot;
sCancel = &quot;Cancelar&quot;
sColumnHeader = &quot;Título de columna&quot;
sInsertStockName = &quot;Introduzca primero algunas acciones en su depósito.&quot;
sTitle = &quot;&lt;PRODUCTNAME&gt;: Administración de acciones&quot;
sTitle = ReplaceString(sTitle, sProductName, &quot;&lt;PRODUCTNAME&gt;&quot;)
sMsgError = &quot;Error de entrada&quot;
sMsgNoName = sInsertStockname
sMsgNoQuantity = &quot;Indique una cantidad mayor que 0&quot;
sMsgNoDividend = &quot;Indique un dividendo por unidad o un dividendo total&quot;
sMsgNoExchangeRate = &quot;Indique aquí un cambio correcto (acción vieja -&gt; nueva acción)&quot;
sMsgNoValidExchangeDate = &quot;Indique una fecha correcta para el fraccionamiento de la acción.&quot;
sMsgWrongExchangeDate = &quot;El fraccionamiento no es posible porque existen transacciones después de la fecha de fraccionamiento.&quot;
sMsgSellTooMuch = &quot;No puede vender tantas acciones. Como máximo: &quot;
sMsgConfirm = &quot;Confirmación necesaria&quot;
sMsgFreeStock = &quot;¿Tiene previsto considerar acciones gratis?&quot;
sMsgTotalLoss = &quot;¿Tiene previsto introducir una pérdida total?&quot;
sMsgAuthorization = &quot;Pregunta de seguridad&quot;
sMsgDeleteAll = &quot;¿Desea borrar todos los movimientos y reiniciar el balance de depósito?&quot;
cSplit = &quot;Fraccionamiento el &quot;
sHistory = &quot;Historia&quot;
TransactTitle(1) = &quot;Vender acciones&quot;
TransactTitle(2) = &quot;Comprar acciones&quot;
StockRatesTitle(1) = &quot;Pago de dividendos&quot;
StockRatesTitle(2) = &quot;Fraccionamiento&quot;
StockRatesTitle(3) = sHistory
sDepotCurrency = &quot;Moneda del depósito&quot;
sStockName = &quot;Nombre de la acción&quot;
TransactMode = LIFO &apos; Possible values: &quot;FIFO&quot; and &quot;LIFO&quot;
DateCellStyle = &quot;Resultado Fecha&quot;
CurrCellStyle = &quot;1&quot;
sStartDate = &quot;Fecha de inicio:&quot;
sEndDate = &quot;Fecha final:&quot;
sStartUpWelcome = &quot;Esta plantilla le permite administrar eficientemente su depósito de acciones&quot;
sStartUpChooseMarket = &quot;Seleccione primero la moneda de referencia y la plaza bursátil para la actualización a través de Internet.&quot;
sStartUpHint = &quot;La función &lt;History&gt; está disponible únicamente para el mercado americano.&quot;
sStartupHint = ReplaceString(sStartUpHint, sHistory, &quot;&lt;History&gt;&quot;)
sNoInternetUpdate = &quot;Sin actualización por Internet&quot;
sMarketPlace = &quot;Plaza bursátil:&quot;
sNoInternetDataAvailable = &quot;No se pudieron recibir las cotizaciones por Internet.&quot;
sCheckInternetSettings = &quot;Causas posibles: &lt;BR&gt; Debe comprobar la configuración de Internet.&lt;BR&gt; Ha indicado un código incorrecto (p.ej. número, símbolo, etc.) para la acción.&quot;
sCheckInternetSettings = ReplaceString(sCheckInternetSettings, chr(13), &quot;&lt;BR&gt;&quot;)
sMsgEndDatebeforeNow = &quot;La fecha final debe ser anterior a la fecha de hoy.&quot;
sMsgStartDatebeforeEndDate = &quot;La fecha inicial debe ser anterior a la fecha final.&quot;
sMarket(0,0) = &quot;Dólar estadounidense&quot;
sMarket(0,1) = &quot;$&quot;
sMarket(0,2) = &quot;Nueva York&quot;
sMarket(0,3) = &quot;http://finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;&amp;f=sl1d1t1c1ohgv&amp;e=.csv&quot;
sMarket(0,4) = &quot;http://ichart.finance.yahoo.com/table.csv?&quot; &amp;_
&quot;s=&lt;StockID&gt;&amp;d=&lt;EndMonth&gt;&amp;e=&lt;EndDay&gt;&amp;f=&lt;Endyear&gt;&amp;g=d&amp;&quot; &amp;_
&quot;a=&lt;StartMonth&gt;&amp;b=&lt;StartDay&gt;&amp;c=&lt;Startyear&gt;&amp;ignore=.csv&quot;
sMarket(0,5) = &quot;Símbolo&quot;
sMarket(0,6) = &quot;en&quot;
sMarket(0,7) = &quot;US&quot;
sMarket(0,8) = &quot;409&quot;
sMarket(0,9) = &quot;44&quot;
sMarket(0,10) = &quot;1&quot;
sMarket(1,0) = &quot;Euro&quot;
sMarket(1,1) = chr(8364)
sMarket(1,2) = &quot;Frankfurt&quot;
sMarket(1,3) = &quot;http://de.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;.F&amp;f=sl1t1c1ghpv&amp;e=.csv&quot;
sMarket(1,5) = &quot;Código&quot;
sMarket(1,6) = &quot;de;nl;pt;el&quot;
sMarket(1,7) = &quot;DE;NL;PT;GR&quot;
sMarket(1,8) = &quot;407;413;816;408&quot;
sMarket(1,9) = &quot;59/9&quot;
sMarket(1,10) = &quot;1&quot;
sMarket(2,0) = &quot;Libra esterlina&quot;
sMarket(2,1) = &quot;£&quot;
sMarket(2,2) = &quot;Londres&quot;
sMarket(2,3) = &quot;http://uk.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;.L&amp;m=*&amp;f=sl1t1c1ghov&amp;e=.csv&quot;
sMarket(2,5) = &quot;Símbolo&quot;
sMarket(2,6) = &quot;en&quot;
sMarket(2,7) = &quot;GB&quot;
sMarket(2,8) = &quot;809&quot;
sMarket(2,9) = &quot;44&quot;
sMarket(2,10) = &quot;1&quot;
sMarket(3,0) = &quot;Yen japonés&quot;
sMarket(3,1) = &quot;¥&quot;
sMarket(3,2) = &quot;Tokio&quot;
sMarket(3,3) = &quot;&quot;
sMarket(3,5) = &quot;Código&quot;
sMarket(3,6) = &quot;ja&quot;
sMarket(3,7) = &quot;JP&quot;
sMarket(3,8) = &quot;411&quot;
sMarket(3,9) = &quot;&quot;
sMarket(3,10) = &quot;&quot;
sMarket(4,0) = &quot;Dólar hongkonés&quot;
sMarket(4,1) = &quot;HK$&quot;
sMarket(4,2) = &quot;Hong Kong&quot;
sMarket(4,3) = &quot;http://hk.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;.HK&amp;f=sl1d1t1c1ohgv&amp;e=.csv&quot;
sMarket(4,5) = &quot;Número&quot;
sMarket(4,6) = &quot;zh&quot;
sMarket(4,7) = &quot;HK&quot;
sMarket(4,8) = &quot;C04&quot;
sMarket(4,9) = &quot;44&quot;
sMarket(4,10) = &quot;1&quot;
sMarket(5,0) = &quot;Dólar australiano&quot;
sMarket(5,1) = &quot;$&quot;
sMarket(5,2) = &quot;Sidney&quot;
sMarket(5,3) = &quot;http://au.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;&amp;f=sl1d1t1c1ohgv&amp;e=.csv&quot;
sMarket(5,5) = &quot;Símbolo&quot;
sMarket(5,6) = &quot;en&quot;
sMarket(5,7) = &quot;AU&quot;
sMarket(5,8) = &quot;C09&quot;
sMarket(5,9) = &quot;44&quot;
sMarket(5,10) = &quot;1&quot;
&apos; ****************************End of the default subset*********************************
CompleteMarketList()
LocalizedCurrencies()
With TransactModel
.lblStockNames.Label = sStockname
.lblQuantity.Label = &quot;Cantidad&quot;
.lblRate.Label = &quot;Cotización&quot;
.lblDate.Label = &quot;Fecha de operación&quot;
.hlnCommission.Label = &quot;Otros gastos&quot;
.lblCommission.Label = &quot;Provisión&quot;
.lblMinimum.Label = &quot;Provisión mínima&quot;
.lblFix.Label = &quot;Cantidad fija/comisión&quot;
.cmdGoOn.Label = sOK
.cmdCancel.Label = sCancel
End With
With StockRatesModel
.optPerShare.Label = &quot;Dividendos/Acción&quot;
.optTotal.Label = &quot;Dividendos totales&quot;
.lblDividend.Label = &quot;Importe&quot;
.lblExchangeRate.Label = &quot;Cambio (vieja-&gt;nueva)&quot;
.lblColon.Label = &quot;:&quot;
.lblDate.Label = &quot;Fecha de cambio:&quot;
.lblStockNames.Label = sStockname
.lblStartDate.Label = sStartDate
.lblEndDate.Label = sEndDate
.optDaily.Label = &quot;~Diario&quot;
.optWeekly.Label = &quot;~Semanal&quot;
.hlnInterval.Label = &quot;Periodo&quot;
.cmdGoOn.Label = sOk
.cmdCancel.Label = sCancel
End With
End Sub
</script:module>

View 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 = &quot;~OK&quot;
sCancel = &quot;Annuler&quot;
sColumnHeader = &quot;En-tête de colonne&quot;
sInsertStockName = &quot;Saisissez quelques actions dans votre portefeuille !&quot;
sTitle = &quot;&lt;PRODUCTNAME&gt; : Gestion d&apos;actions&quot;
sTitle = ReplaceString(sTitle, sProductName, &quot;&lt;PRODUCTNAME&gt;&quot;)
sMsgError = &quot;Erreur de saisie&quot;
sMsgNoName = sInsertStockname
sMsgNoQuantity = &quot;Saisissez une quantité supérieure à 0 !&quot;
sMsgNoDividend = &quot;Vous devez saisir le montant des dividendes perçus (soit les dividendes par action, soit la somme totale perçue).&quot;
sMsgNoExchangeRate = &quot;Saisissez un taux correct de conversion (anciennes actions -&gt; nouvelles actions).&quot;
sMsgNoValidExchangeDate = &quot;Saisissez une date correcte pour le split d&apos;action.&quot;
sMsgWrongExchangeDate = &quot;Split impossible car il y a déjà eu des transactions après la date du split !&quot;
sMsgSellTooMuch = &quot;Impossible de vendre autant d&apos;actions ! Maximum : &quot;
sMsgConfirm = &quot;Confirmation requise&quot;
sMsgFreeStock = &quot;S&apos;agit-il d&apos;actions gratuites ?&quot;
sMsgTotalLoss = &quot;Prévoyez-vous une perte totale ?&quot;
sMsgAuthorization = &quot;Requête de sécurité&quot;
sMsgDeleteAll = &quot;Voulez-vous supprimer tous les mouvements et remettre le portefeuille d&apos;actions à zéro ?&quot;
cSplit = &quot;Split d&apos;action le &quot;
sHistory = &quot;Historique&quot;
TransactTitle(1) = &quot;Vente d&apos;actions&quot;
TransactTitle(2) = &quot;Achat d&apos;actions&quot;
StockRatesTitle(1) = &quot;Versement des dividendes&quot;
StockRatesTitle(2) = &quot;Split d&apos;action&quot;
StockRatesTitle(3) = sHistory
sDepotCurrency = &quot;Monnaie du portefeuille&quot;
sStockName = &quot;Nom de l&apos;action&quot;
TransactMode = LIFO &apos; Possible values: &quot;FIFO&quot; and &quot;LIFO&quot;
DateCellStyle = &quot;Résultat date&quot;
CurrCellStyle = &quot;1&quot;
sStartDate = &quot;Date de début :&quot;
sEndDate = &quot;Date de fin :&quot;
sStartUpWelcome = &quot;Utilisez ce modèle pour une gestion efficiente de votre portefeuille d&apos;actions !&quot;
sStartUpChooseMarket = &quot;Commencez par choisir une monnaie de référence et ainsi la place boursière pour la mise à jour Internet !&quot;
sStartUpHint = &quot;La fonction &lt;History&gt; n&apos;est cependant disponible que pour le marché américain.&quot;
sStartupHint = ReplaceString(sStartUpHint, sHistory, &quot;&lt;History&gt;&quot;)
sNoInternetUpdate = &quot;Sans mise à jour Internet&quot;
sMarketPlace = &quot;Place boursière :&quot;
sNoInternetDataAvailable = &quot;Réception des cours Internet impossible !&quot;
sCheckInternetSettings = &quot;Causes possibles : &lt;BR&gt; Problème de paramétrage Internet : vérifiez les paramètres !&lt;BR&gt; Vous avez saisi un identificateur (par ex. symbole ou code) incorrect pour l&apos;action.&quot;
sCheckInternetSettings = ReplaceString(sCheckInternetSettings, chr(13), &quot;&lt;BR&gt;&quot;)
sMsgEndDatebeforeNow = &quot;La date spécifiée pour la fin doit précéder celle de ce jour !&quot;
sMsgStartDatebeforeEndDate = &quot;La date spécifiée pour le début doit succéder à celle de ce jour !&quot;
sMarket(0,0) = &quot;Dollar Américain&quot;
sMarket(0,1) = &quot;$&quot;
sMarket(0,2) = &quot;New York&quot;
sMarket(0,3) = &quot;http://finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;&amp;f=sl1d1t1c1ohgv&amp;e=.csv&quot;
sMarket(0,4) = &quot;http://ichart.finance.yahoo.com/table.csv?&quot; &amp;_
&quot;s=&lt;StockID&gt;&amp;d=&lt;EndMonth&gt;&amp;e=&lt;EndDay&gt;&amp;f=&lt;Endyear&gt;&amp;g=d&amp;&quot; &amp;_
&quot;a=&lt;StartMonth&gt;&amp;b=&lt;StartDay&gt;&amp;c=&lt;Startyear&gt;&amp;ignore=.csv&quot;
sMarket(0,5) = &quot;Symbole&quot;
sMarket(0,6) = &quot;en&quot;
sMarket(0,7) = &quot;US&quot;
sMarket(0,8) = &quot;409&quot;
sMarket(0,9) = &quot;44&quot;
sMarket(0,10) = &quot;1&quot;
sMarket(1,0) = &quot;Euro&quot;
sMarket(1,1) = chr(8364)
sMarket(1,2) = &quot;Francfort&quot;
sMarket(1,3) = &quot;http://de.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;.F&amp;f=sl1t1c1ghpv&amp;e=.csv&quot;
sMarket(1,5) = &quot;Code&quot;
sMarket(1,6) = &quot;de;nl;pt;el&quot;
sMarket(1,7) = &quot;DE;NL;PT;GR&quot;
sMarket(1,8) = &quot;407;413;816;408&quot;
sMarket(1,9) = &quot;59/9&quot;
sMarket(1,10) = &quot;1&quot;
sMarket(2,0) = &quot;Livre Sterling&quot;
sMarket(2,1) = &quot;£&quot;
sMarket(2,2) = &quot;Londres&quot;
sMarket(2,3) = &quot;http://uk.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;.L&amp;m=*&amp;f=sl1t1c1ghov&amp;e=.csv&quot;
sMarket(2,5) = &quot;Symbole&quot;
sMarket(2,6) = &quot;en&quot;
sMarket(2,7) = &quot;GB&quot;
sMarket(2,8) = &quot;809&quot;
sMarket(2,9) = &quot;44&quot;
sMarket(2,10) = &quot;1&quot;
sMarket(3,0) = &quot;Yen Japonais&quot;
sMarket(3,1) = &quot;¥&quot;
sMarket(3,2) = &quot;Tokyo&quot;
sMarket(3,3) = &quot;&quot;
sMarket(3,5) = &quot;Code&quot;
sMarket(3,6) = &quot;ja&quot;
sMarket(3,7) = &quot;JP&quot;
sMarket(3,8) = &quot;411&quot;
sMarket(3,9) = &quot;&quot;
sMarket(3,10) = &quot;&quot;
sMarket(4,0) = &quot;Dollar de Hong Kong&quot;
sMarket(4,1) = &quot;HK$&quot;
sMarket(4,2) = &quot;Hong Kong&quot;
sMarket(4,3) = &quot;http://hk.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;&amp;f=sl1d1t1c1ohgv&amp;e=.csv&quot;
sMarket(4,5) = &quot;Numéro&quot;
sMarket(4,6) = &quot;zh&quot;
sMarket(4,7) = &quot;HK&quot;
sMarket(4,8) = &quot;C04&quot;
sMarket(4,9) = &quot;44&quot;
sMarket(4,10) = &quot;1&quot;
sMarket(5,0) = &quot;Dollar Australien&quot;
sMarket(5,1) = &quot;$&quot;
sMarket(5,2) = &quot;Sydney&quot;
sMarket(5,3) = &quot;http://au.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;&amp;f=sl1d1t1c1ohgv&amp;e=.csv&quot;
sMarket(5,5) = &quot;Symbole&quot;
sMarket(5,6) = &quot;en&quot;
sMarket(5,7) = &quot;AU&quot;
sMarket(5,8) = &quot;C09&quot;
sMarket(5,9) = &quot;44&quot;
sMarket(5,10) = &quot;1&quot;
&apos; ****************************End of the default subset*********************************
CompleteMarketList()
LocalizedCurrencies()
With TransactModel
.lblStockNames.Label = sStockname
.lblQuantity.Label = &quot;Quantité&quot;
.lblRate.Label = &quot;Cours&quot;
.lblDate.Label = &quot;Date de transaction&quot;
.hlnCommission.Label = &quot;Dépenses diverses&quot;
.lblCommission.Label = &quot;Commission&quot;
.lblMinimum.Label = &quot;Commission minimale&quot;
.lblFix.Label = &quot;Montant fixe/frais&quot;
.cmdGoOn.Label = sOK
.cmdCancel.Label = sCancel
End With
With StockRatesModel
.optPerShare.Label = &quot;Dividende/action&quot;
.optTotal.Label = &quot;Dividende total&quot;
.lblDividend.Label = &quot;Montant&quot;
.lblExchangeRate.Label = &quot;Taux de conversion (ancien-&gt;nouveau)&quot;
.lblColon.Label = &quot;:&quot;
.lblDate.Label = &quot;Date de la conversion:&quot;
.lblStockNames.Label = sStockname
.lblStartDate.Label = sStartDate
.lblEndDate.Label = sEndDate
.optDaily.Label = &quot;~Quotidien&quot;
.optWeekly.Label = &quot;~Hebdomadaire&quot;
.hlnInterval.Label = &quot;Période&quot;
.cmdGoOn.Label = sOk
.cmdCancel.Label = sCancel
End With
End Sub
</script:module>

View 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 = &quot;~OK&quot;
sCancel = &quot;Annulla&quot;
sColumnHeader = &quot;Intestazione colonna&quot;
sInsertStockName = &quot;Inserite un nome di azioni&quot;
sTitle = &quot;&lt;PRODUCTNAME&gt;: Gestione delle azioni&quot;
sTitle = ReplaceString(sTitle, sProductName, &quot;&lt;PRODUCTNAME&gt;&quot;)
sMsgError = &quot;Errore dati immessi&quot;
sMsgNoName = sInsertStockname
sMsgNoQuantity = &quot;Inserite il numero delle azioni&quot;
sMsgNoDividend = &quot;Inserite un dividendo a unità oppure un dividendo totale&quot;
sMsgNoExchangeRate = &quot;Indicate un corretto tasso di cambio (vecchie azioni -&gt; nuove azioni).&quot;
sMsgNoValidExchangeDate = &quot;Indicate la data di frazionamento delle azioni.&quot;
sMsgWrongExchangeDate = &quot;Il frazionamento non è possibile perché sono ancora in atto transazioni dopo la data indicata.&quot;
sMsgSellTooMuch = &quot;Non potete vendere così tante azioni. Massimo: &quot;
sMsgConfirm = &quot;È necessaria una conferma&quot;
sMsgFreeStock = &quot;Confermate la digitazione di azioni gratuite?&quot;
sMsgTotalLoss = &quot;Confermate la digitazione di perdita totale?&quot;
sMsgAuthorization = &quot;Domanda di sicurezza&quot;
sMsgDeleteAll = &quot;Eliminare tutti i movimenti e ripristinare la panoramica dei depositi?&quot;
cSplit = &quot;Frazionamento delle azioni il: &quot;
sHistory = &quot;Cronologia&quot;
TransactTitle(1) = &quot;Vendita di azioni&quot;
TransactTitle(2) = &quot;Acquisto di azioni&quot;
StockRatesTitle(1) = &quot;Pagamento dei dividendi&quot;
StockRatesTitle(2) = &quot;Frazionamento azioni&quot;
StockRatesTitle(3) = sHistory
sDepotCurrency = &quot;Valuta deposito&quot;
sStockName = &quot;Nome delle azioni&quot;
TransactMode = LIFO &apos; Possible values: &quot;FIFO&quot; and &quot;LIFO&quot;
DateCellStyle = &quot;Risultato data&quot;
CurrCellStyle = &quot;1&quot;
sStartDate = &quot;Data d&apos;inizio:&quot;
sEndDate = &quot;Data finale:&quot;
sStartUpWelcome = &quot;Questo modello vi permette una gestione efficace delle vostre azioni.&quot;
sStartUpChooseMarket = &quot;Selezionate la valuta di riferimento e la Borsa per il collegamento Internet.&quot;
sStartUpHint = &quot;La funzione &lt;History&gt; è disponibile solo per il mercato americano.&quot;
sStartupHint = ReplaceString(sStartUpHint, sHistory, &quot;&lt;History&gt;&quot;)
sNoInternetUpdate = &quot;Senza aggiornamento Internet&quot;
sMarketPlace = &quot;Borsa:&quot;
sNoInternetDataAvailable = &quot;Impossibile ricevere le quotazioni Internet&quot;
sCheckInternetSettings = &quot;Possibili cause: &lt;BR&gt; le impostazioni Internet devono essere modificate.&lt;BR&gt; Avete indicato un indice (ad es. simbolo o codice) errato per le azioni.&quot;
sCheckInternetSettings = ReplaceString(sCheckInternetSettings, chr(13), &quot;&lt;BR&gt;&quot;)
sMsgEndDatebeforeNow = &quot;La data finale dev&apos;essere anteriore alla data odierna.&quot;
sMsgStartDatebeforeEndDate = &quot;La data d&apos;inizio deve precedere la data finale.&quot;
sMarket(0,0) = &quot;Dollaro USA&quot;
sMarket(0,1) = &quot;$&quot;
sMarket(0,2) = &quot;New York&quot;
sMarket(0,3) = &quot;http://finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;&amp;f=sl1d1t1c1ohgv&amp;e=.csv&quot;
sMarket(0,4) = &quot;http://ichart.finance.yahoo.com/table.csv?&quot; &amp;_
&quot;s=&lt;StockID&gt;&amp;d=&lt;EndMonth&gt;&amp;e=&lt;EndDay&gt;&amp;f=&lt;Endyear&gt;&amp;g=d&amp;&quot; &amp;_
&quot;a=&lt;StartMonth&gt;&amp;b=&lt;StartDay&gt;&amp;c=&lt;Startyear&gt;&amp;ignore=.csv&quot;
sMarket(0,5) = &quot;Simbolo&quot;
sMarket(0,6) = &quot;en&quot;
sMarket(0,7) = &quot;US&quot;
sMarket(0,8) = &quot;409&quot;
sMarket(0,9) = &quot;44&quot;
sMarket(0,10) = &quot;1&quot;
sMarket(1,0) = &quot;Euro&quot;
sMarket(1,1) = chr(8364)
sMarket(1,2) = &quot;Francoforte&quot;
sMarket(1,3) = &quot;http://de.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;.F&amp;f=sl1t1c1ghpv&amp;e=.csv&quot;
sMarket(1,5) = &quot;Numero identificazione titoli&quot;
sMarket(1,6) = &quot;de;nl;pt;el&quot;
sMarket(1,7) = &quot;DE;NL;PT;GR&quot;
sMarket(1,8) = &quot;407;413;816;408&quot;
sMarket(1,9) = &quot;59/9&quot;
sMarket(1,10) = &quot;1&quot;
sMarket(2,0) = &quot;Sterlina inglese&quot;
sMarket(2,1) = &quot;£&quot;
sMarket(2,2) = &quot;Londra&quot;
sMarket(2,3) = &quot;http://uk.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;.L&amp;m=*&amp;f=sl1t1c1ghov&amp;e=.csv&quot;
sMarket(2,5) = &quot;Simbolo&quot;
sMarket(2,6) = &quot;en&quot;
sMarket(2,7) = &quot;GB&quot;
sMarket(2,8) = &quot;809&quot;
sMarket(2,9) = &quot;44&quot;
sMarket(2,10) = &quot;1&quot;
sMarket(3,0) = &quot;Yen&quot;
sMarket(3,1) = &quot;¥&quot;
sMarket(3,2) = &quot;Tokyo&quot;
sMarket(3,3) = &quot;&quot;
sMarket(3,5) = &quot;Codice&quot;
sMarket(3,6) = &quot;ja&quot;
sMarket(3,7) = &quot;JP&quot;
sMarket(3,8) = &quot;411&quot;
sMarket(3,9) = &quot;&quot;
sMarket(3,10) = &quot;&quot;
sMarket(4,0) = &quot;Dollaro Hong Kong&quot;
sMarket(4,1) = &quot;HK$&quot;
sMarket(4,2) = &quot;Hong Kong&quot;
sMarket(4,3) = &quot;http://hk.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;&amp;f=sl1d1t1c1ohgv&amp;e=.csv&quot;
sMarket(4,5) = &quot;Numero&quot;
sMarket(4,6) = &quot;zh&quot;
sMarket(4,7) = &quot;HK&quot;
sMarket(4,8) = &quot;C04&quot;
sMarket(4,9) = &quot;44&quot;
sMarket(4,10) = &quot;1&quot;
sMarket(5,0) = &quot;Dollaro australiano&quot;
sMarket(5,1) = &quot;$&quot;
sMarket(5,2) = &quot;Sydney&quot;
sMarket(5,3) = &quot;http://au.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;&amp;f=sl1d1t1c1ohgv&amp;e=.csv&quot;
sMarket(5,5) = &quot;Simbolo&quot;
sMarket(5,6) = &quot;en&quot;
sMarket(5,7) = &quot;AU&quot;
sMarket(5,8) = &quot;C09&quot;
sMarket(5,9) = &quot;44&quot;
sMarket(5,10) = &quot;1&quot;
&apos; ****************************End of the default subset*********************************
CompleteMarketList()
LocalizedCurrencies()
With TransactModel
.lblStockNames.Label = sStockname
.lblQuantity.Label = &quot;Quantità&quot;
.lblRate.Label = &quot;Quotazione&quot;
.lblDate.Label = &quot;Data della transazione&quot;
.hlnCommission.Label = &quot;Spese extra&quot;
.lblCommission.Label = &quot;Commissioni&quot;
.lblMinimum.Label = &quot;Commissione minima&quot;
.lblFix.Label = &quot;Importo fisso/Spese&quot;
.cmdGoOn.Label = sOK
.cmdCancel.Label = sCancel
End With
With StockRatesModel
.optPerShare.Label = &quot;Dividendo/Azione&quot;
.optTotal.Label = &quot;Dividendo totale&quot;
.lblDividend.Label = &quot;Importo&quot;
.lblExchangeRate.Label = &quot;Tasso di cambio (vecchio-&gt;nuovo)&quot;
.lblColon.Label = &quot;:&quot;
.lblDate.Label = &quot;Data di cambio:&quot;
.lblStockNames.Label = sStockname
.lblStartDate.Label = sStartDate
.lblEndDate.Label = sEndDate
.optDaily.Label = &quot;~Giornaliero&quot;
.optWeekly.Label = &quot;~Settimanale&quot;
.hlnInterval.Label = &quot;Durata&quot;
.cmdGoOn.Label = sOk
.cmdCancel.Label = sCancel
End With
End Sub
</script:module>

View 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 = &quot;~OK&quot;
sCancel = &quot;キャンセル&quot;
sColumnHeader = &quot;列番号&quot;
sInsertStockName = &quot;最初に株の銘柄を入力してください&quot;
sTitle = &quot;&lt;PRODUCTNAME&gt;: 株管理&quot;
sTitle = ReplaceString(sTitle, sProductName, &quot;&lt;PRODUCTNAME&gt;&quot;)
sMsgError = &quot;入力フィールド&quot;
sMsgNoName = sInsertStockname
sMsgNoQuantity = &quot;0 より大きな額を入力してください&quot;
sMsgNoDividend = &quot;1株当たりの配当金額または総配当金額を入力してください&quot;
sMsgNoExchangeRate = &quot;交換比率旧株-&gt;新株を入力してください&quot;
sMsgNoValidExchangeDate = &quot;株式分割日を入力してください&quot;
sMsgWrongExchangeDate = &quot;分割日以降に取引がすでに存在するので分割できません&quot;
sMsgSellTooMuch = &quot;売却できる株式数を超えています最大値: &quot;
sMsgConfirm = &quot;ご確認ください&quot;
sMsgFreeStock = &quot;無料株式を入力しますか?&quot;
sMsgTotalLoss = &quot;全損の入力を行いますか?&quot;
sMsgAuthorization = &quot;確認ダイアログ&quot;
sMsgDeleteAll = &quot;すべての移動を取り消しポートフォリオの概要をリセットしますか?&quot;
cSplit = &quot;株式分割日 &quot;
sHistory = &quot;履歴&quot;
TransactTitle(1) = &quot;株を買う&quot;
TransactTitle(2) = &quot;株を買う&quot;
StockRatesTitle(1) = &quot;配当額&quot;
StockRatesTitle(2) = &quot;株式分割&quot;
StockRatesTitle(3) = sHistory
sDepotCurrency = &quot;ポートフォリオの通貨&quot;
sStockName = &quot;株式名&quot;
TransactMode = LIFO &apos; Possible values: &quot;FIFO&quot; and &quot;LIFO&quot;
DateCellStyle = &quot;結果日付&quot;
CurrCellStyle = &quot;1&quot;
sStartDate = &quot;開始日:&quot;
sEndDate = &quot;終了日:&quot;
sStartUpWelcome = &quot;このテンプレートを使えば株式のポートフォリオをより効率的に管理できます&quot;
sStartUpChooseMarket = &quot;まずインターネットにより情報を更新する基準通貨と対応する証券取引所を選択します&quot;
sStartUpHint = &quot;残念ながら&lt;History&gt; 機能を使用できるのは米国市場に限られています&quot;
sStartupHint = ReplaceString(sStartUpHint, sHistory, &quot;&lt;History&gt;&quot;)
sNoInternetUpdate = &quot;インターネットによる情報の更新を行いません&quot;
sMarketPlace = &quot;証券取引所:&quot;
sNoInternetDataAvailable = &quot;インターネットから株価情報を受信できない場合があります!&quot;
sCheckInternetSettings = &quot;考えられる原因は次のとおりです&lt;BR&gt;インターネット設定の変更が必要です&lt;BR&gt;入力した株式のが間違っています&quot;
sCheckInternetSettings = ReplaceString(sCheckInternetSettings, chr(13), &quot;&lt;BR&gt;&quot;)
sMsgEndDatebeforeNow = &quot;終了日は今日の日付より前であることが必要です&quot;
sMsgStartDatebeforeEndDate = &quot;開始日は終了日より前であることが必要です&quot;
sMarket(0,0) = &quot;米ドル&quot;
sMarket(0,1) = &quot;$&quot;
sMarket(0,2) = &quot;ニューヨーク&quot;
sMarket(0,3) = &quot;http://finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;&amp;f=sl1d1t1c1ohgv&amp;e=.csv&quot;
sMarket(0,4) = &quot;http://ichart.finance.yahoo.com/table.csv?&quot; &amp;_
&quot;s=&lt;StockID&gt;&amp;d=&lt;EndMonth&gt;&amp;e=&lt;EndDay&gt;&amp;f=&lt;Endyear&gt;&amp;g=d&amp;&quot; &amp;_
&quot;a=&lt;StartMonth&gt;&amp;b=&lt;StartDay&gt;&amp;c=&lt;Startyear&gt;&amp;ignore=.csv&quot;
sMarket(0,5) = &quot;シンボル&quot;
sMarket(0,6) = &quot;en&quot;
sMarket(0,7) = &quot;US&quot;
sMarket(0,8) = &quot;409&quot;
sMarket(0,9) = &quot;44&quot;
sMarket(0,10) = &quot;1&quot;
sMarket(1,0) = &quot;ユーロ&quot;
sMarket(1,1) = chr(8364)
sMarket(1,2) = &quot;フランクフルト&quot;
sMarket(1,3) = &quot;http://de.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;.F&amp;f=sl1t1c1ghpv&amp;e=.csv&quot;
sMarket(1,5) = &quot;銘柄コード&quot;
sMarket(1,6) = &quot;de;nl;pt;el&quot;
sMarket(1,7) = &quot;DE;NL;PT;GR&quot;
sMarket(1,8) = &quot;407;413;816;408&quot;
sMarket(1,9) = &quot;59/9&quot;
sMarket(1,10) = &quot;1&quot;
sMarket(2,0) = &quot;英ポンド&quot;
sMarket(2,1) = &quot;£&quot;
sMarket(2,2) = &quot;ロンドン&quot;
sMarket(2,3) = &quot;http://uk.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;.L&amp;m=*&amp;f=sl1t1c1ghov&amp;e=.csv&quot;
sMarket(2,5) = &quot;シンボル&quot;
sMarket(2,6) = &quot;en&quot;
sMarket(2,7) = &quot;GB&quot;
sMarket(2,8) = &quot;809&quot;
sMarket(2,9) = &quot;44&quot;
sMarket(2,10) = &quot;1&quot;
sMarket(3,0) = &quot;日本円&quot;
sMarket(3,1) = &quot;¥&quot;
sMarket(3,2) = &quot;東京&quot;
sMarket(3,3) = &quot;&quot;
sMarket(3,5) = &quot;コード&quot;
sMarket(3,6) = &quot;ja&quot;
sMarket(3,7) = &quot;JP&quot;
sMarket(3,8) = &quot;411&quot;
sMarket(3,9) = &quot;&quot;
sMarket(3,10) = &quot;&quot;
sMarket(4,0) = &quot;香港ドル&quot;
sMarket(4,1) = &quot;HK$&quot;
sMarket(4,2) = &quot;香港&quot;
sMarket(4,3) = &quot;http://hk.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;.HK&amp;f=sl1d1t1c1ohgv&amp;e=.csv&quot;
sMarket(4,5) = &quot;番号&quot;
sMarket(4,6) = &quot;zh&quot;
sMarket(4,7) = &quot;HK&quot;
sMarket(4,8) = &quot;C04&quot;
sMarket(4,9) = &quot;44&quot;
sMarket(4,10) = &quot;1&quot;
sMarket(5,0) = &quot;オーストリアドル&quot;
sMarket(5,1) = &quot;$&quot;
sMarket(5,2) = &quot;シドニー&quot;
sMarket(5,3) = &quot;http://au.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;&amp;f=sl1d1t1c1ohgv&amp;e=.csv&quot;
sMarket(5,5) = &quot;シンボル&quot;
sMarket(5,6) = &quot;en&quot;
sMarket(5,7) = &quot;AU&quot;
sMarket(5,8) = &quot;C09&quot;
sMarket(5,9) = &quot;44&quot;
sMarket(5,10) = &quot;1&quot;
&apos; ****************************End of the default subset*********************************
CompleteMarketList()
LocalizedCurrencies()
With TransactModel
.lblStockNames.Label = sStockname
.lblQuantity.Label = &quot;株数&quot;
.lblRate.Label = &quot;価格&quot;
.lblDate.Label = &quot;取引日&quot;
.hlnCommission.Label = &quot;その他の経費n&quot;
.lblCommission.Label = &quot;手数料&quot;
.lblMinimum.Label = &quot;最低手数料&quot;
.lblFix.Label = &quot;固定費/諸経費&quot;
.cmdGoOn.Label = sOK
.cmdCancel.Label = sCancel
End With
With StockRatesModel
.optPerShare.Label = &quot;配当金/株式数&quot;
.optTotal.Label = &quot;配当金の総額&quot;
.lblDividend.Label = &quot;金額&quot;
.lblExchangeRate.Label = &quot;交換比率旧株-&gt;新株&quot;
.lblColon.Label = &quot;:&quot;
.lblDate.Label = &quot;交換日:&quot;
.lblStockNames.Label = sStockname
.lblStartDate.Label = sStartDate
.lblEndDate.Label = sEndDate
.optDaily.Label = &quot;~毎日&quot;
.optWeekly.Label = &quot;~毎週&quot;
.hlnInterval.Label = &quot;期間&quot;
.cmdGoOn.Label = sOk
.cmdCancel.Label = sCancel
End With
End Sub
</script:module>

View 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 = &quot;~확인&quot;
sCancel = &quot;취소&quot;
sColumnHeader = &quot; 머리글&quot;
sInsertStockName = &quot;주식 종목을 삽입해주십시오.&quot;
sTitle = &quot;&lt;PRODUCTNAME&gt;: 주식 매수&quot;
sTitle = ReplaceString(sTitle, sProductName, &quot;&lt;PRODUCTNAME&gt;&quot;)
sMsgError = &quot;입력 오류&quot;
sMsgNoName = sInsertStockname
sMsgNoQuantity = &quot;0 이하의 매수를 입력해주십시오.&quot;
sMsgNoDividend = &quot; 주당 배당분 또는 총배당분을 입력해주십시오.&quot;
sMsgNoExchangeRate = &quot;정확한 환율을 입력해주십시오 (구주를 신주로 소급 ).&quot;
sMsgNoValidExchangeDate = &quot;유효한 배당 결제일을 입력해주십시오.&quot;
sMsgWrongExchangeDate = &quot;배당 기준일이 경과하여 배당할 없습니다.&quot;
sMsgSellTooMuch = &quot;이렇게 많은 주식을 없습니다. 최대 매도수: &quot;
sMsgConfirm = &quot;확인 필요&quot;
sMsgFreeStock = &quot;공짜 주식을 입력하시겠습니까?&quot;
sMsgTotalLoss = &quot;주가 폭락세를 입력하시겠습니까?&quot;
sMsgAuthorization = &quot;안정성 조회&quot;
sMsgDeleteAll = &quot;모든 주가 움직임을 삭제하고 계좌 현황을 원래대로 하시겠습니까?&quot;
cSplit = &quot;주식 배당일 &quot;
sHistory = &quot;내역&quot;
TransactTitle(1) = &quot;주식 관리: 주식 매도&quot;
TransactTitle(2) = &quot;주식 관리: 주식 매수&quot;
StockRatesTitle(1) = &quot;주식 관리: 배당금 지불&quot;
StockRatesTitle(2) = &quot;주식 관리: 주식 배분&quot;
StockRatesTitle(3) = sHistory
sDepotCurrency = &quot;주식 계좌 통화&quot;
sStockName = &quot;주식 종목명&quot;
TransactMode = LIFO &apos; Possible values: &quot;FIFO&quot; and &quot;LIFO&quot;
DateCellStyle = &quot;결과, 날짜&quot;
CurrCellStyle = &quot;1&quot;
sStartDate = &quot;매매일:&quot;
sEndDate = &quot;만기일:&quot;
sStartUpWelcome = &quot; 템플릿을 사용하여 주식 투자 관리를 효율적으로 있습니다.&quot;
sStartUpChooseMarket = &quot;인터넷 업데이트를 위해 우선 관련 통화와 증권 장소를 선택하십시오.&quot;
sStartUpHint = &quot;&lt;내역&gt; 기능은 미국 시장용으로만 사용할 있습니다.&quot;
sStartupHint = ReplaceString(sStartUpHint, sHistory, &quot;&lt;History&gt;&quot;)
sNoInternetUpdate = &quot;인터넷 업데이트 없음&quot;
sMarketPlace = &quot;증권 장소:&quot;
sNoInternetDataAvailable = &quot;인터넷 시세는 받을 없었습니다.&quot;
sCheckInternetSettings = &quot;원인: &lt;BR&gt; 인터넷 설정을 점검해야만 합니다.&lt;BR&gt; 옳지 않은 암호&lt;예를 들어 잘못된 문자 또는 종목 코드&gt; 입력했습니다.&quot;
sCheckInternetSettings = ReplaceString(sCheckInternetSettings, chr(13), &quot;&lt;BR&gt;&quot;)
sMsgEndDatebeforeNow = &quot;만기일은 오늘 날짜 전에 기입되어야 합니다.&quot;
sMsgStartDatebeforeEndDate = &quot;매매일은 만기일 전에 기입되어야 합니다.&quot;
sMarket(0,0) = &quot;미국 달러&quot;
sMarket(0,1) = &quot;$&quot;
sMarket(0,2) = &quot;뉴욕&quot;
sMarket(0,3) = &quot;http://finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;&amp;f=sl1d1t1c1ohgv&amp;e=.csv&quot;
sMarket(0,4) = &quot;http://ichart.finance.yahoo.com/table.csv?&quot; &amp;_
&quot;s=&lt;StockID&gt;&amp;d=&lt;EndMonth&gt;&amp;e=&lt;EndDay&gt;&amp;f=&lt;Endyear&gt;&amp;g=d&amp;&quot; &amp;_
&quot;a=&lt;StartMonth&gt;&amp;b=&lt;StartDay&gt;&amp;c=&lt;Startyear&gt;&amp;ignore=.csv&quot;
sMarket(0,5) = &quot;기호&quot;
sMarket(0,6) = &quot;en&quot;
sMarket(0,7) = &quot;US&quot;
sMarket(0,8) = &quot;409&quot;
sMarket(0,9) = &quot;44&quot;
sMarket(0,10) = &quot;1&quot;
sMarket(1,0) = &quot;유로&quot;
sMarket(1,1) = chr(8364)
sMarket(1,2) = &quot;프랑크푸르트&quot;
sMarket(1,3) = &quot;http://de.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;.F&amp;f=sl1t1c1ghpv&amp;e=.csv&quot;
sMarket(1,5) = &quot;WKN&quot;
sMarket(1,6) = &quot;de;nl;pt;el&quot;
sMarket(1,7) = &quot;DE;NL;PT;GR&quot;
sMarket(1,8) = &quot;407;413;816;408&quot;
sMarket(1,9) = &quot;59/9&quot;
sMarket(1,10) = &quot;1&quot;
sMarket(2,0) = &quot;영국 파운드&quot;
sMarket(2,1) = &quot;£&quot;
sMarket(2,2) = &quot;런던&quot;
sMarket(2,3) = &quot;http://uk.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;.L&amp;m=*&amp;f=sl1t1c1ghov&amp;e=.csv&quot;
sMarket(2,5) = &quot;기호&quot;
sMarket(2,6) = &quot;en&quot;
sMarket(2,7) = &quot;GB&quot;
sMarket(2,8) = &quot;809&quot;
sMarket(2,9) = &quot;44&quot;
sMarket(2,10) = &quot;1&quot;
sMarket(3,0) = &quot;엔화&quot;
sMarket(3,1) = &quot;¥&quot;
sMarket(3,2) = &quot;도쿄&quot;
sMarket(3,3) = &quot;&quot;
sMarket(3,5) = &quot;코드&quot;
sMarket(3,6) = &quot;ja&quot;
sMarket(3,7) = &quot;JP&quot;
sMarket(3,8) = &quot;411&quot;
sMarket(3,9) = &quot;&quot;
sMarket(3,10) = &quot;&quot;
sMarket(4,0) = &quot;홍콩 달러&quot;
sMarket(4,1) = &quot;HK$&quot;
sMarket(4,2) = &quot;홍콩&quot;
sMarket(4,3) = &quot;http://hk.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;.HK&amp;f=sl1d1t1c1ohgv&amp;e=.csv&quot;
sMarket(4,5) = &quot;번호&quot;
sMarket(4,6) = &quot;zh&quot;
sMarket(4,7) = &quot;HK&quot;
sMarket(4,8) = &quot;C04&quot;
sMarket(4,9) = &quot;44&quot;
sMarket(4,10) = &quot;1&quot;
sMarket(5,0) = &quot;호주 달러&quot;
sMarket(5,1) = &quot;$&quot;
sMarket(5,2) = &quot;시드니&quot;
sMarket(5,3) = &quot;http://au.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;&amp;f=sl1d1t1c1ohgv&amp;e=.csv&quot;
sMarket(5,5) = &quot;기호&quot;
sMarket(5,6) = &quot;en&quot;
sMarket(5,7) = &quot;AU&quot;
sMarket(5,8) = &quot;C09&quot;
sMarket(5,9) = &quot;44&quot;
sMarket(5,10) = &quot;1&quot;
&apos; ****************************End of the default subset*********************************
CompleteMarketList()
LocalizedCurrencies()
With TransactModel
.lblStockNames.Label = sStockname
.lblQuantity.Label = &quot;수량&quot;
.lblRate.Label = &quot;시세&quot;
.lblDate.Label = &quot;배당 결산일&quot;
.hlnCommission.Label = &quot;기타 지출&quot;
.lblCommission.Label = &quot;수수료&quot;
.lblMinimum.Label = &quot;최저 수수료&quot;
.lblFix.Label = &quot;약정 금액/기타 경비&quot;
.cmdGoOn.Label = sOK
.cmdCancel.Label = sCancel
End With
With StockRatesModel
.optPerShare.Label = &quot;배당분/&quot;
.optTotal.Label = &quot;배당분 합계&quot;
.lblDividend.Label = &quot;금액&quot;
.lblExchangeRate.Label = &quot;환율(구주-&gt;신주)&quot;
.lblColon.Label = &quot;:&quot;
.lblDate.Label = &quot;환율일자&quot;
.lblStockNames.Label = sStockname
.lblStartDate.Label = sStartDate
.lblEndDate.Label = sEndDate
.optDaily.Label = &quot;~매일&quot;
.optWeekly.Label = &quot;~매주&quot;
.hlnInterval.Label = &quot;기간&quot;
.cmdGoOn.Label = sOk
.cmdCancel.Label = sCancel
End With
End Sub
</script:module>

View 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 = &quot;~OK&quot;
sCancel = &quot;Avbryt&quot;
sColumnHeader = &quot;Kolumnhuvud&quot;
sInsertStockName = &quot;Infoga först några aktier i Din portfölj!&quot;
sTitle = &quot;&lt;PRODUCTNAME&gt;: Aktieförvaltning&quot;
sTitle = ReplaceString(sTitle, sProductName, &quot;&lt;PRODUCTNAME&gt;&quot;)
sMsgError = &quot;Inmatningsfel&quot;
sMsgNoName = sInsertStockname
sMsgNoQuantity = &quot;Var vänlig och mata in ett större antal än 0&quot;
sMsgNoDividend = &quot;Var vänlig och mata in utdelning per styck eller den totala utdelningen&quot;
sMsgNoExchangeRate = &quot;Var vänlig och mata in en korrekt omräkningskurs (gamla aktier -&gt; nya aktier).&quot;
sMsgNoValidExchangeDate = &quot;Var vänlig och mata in ett giltigt datum för aktiesplitten.&quot;
sMsgWrongExchangeDate = &quot;Split är inte möjlig eftersom det redan finns transaktioner efter splitdatum.&quot;
sMsgSellTooMuch = &quot; många aktier kan Du inte sälja. Maximum: &quot;
sMsgConfirm = &quot;Bekräftelse krävs&quot;
sMsgFreeStock = &quot;Avser Du att mata in gratisaktier?&quot;
sMsgTotalLoss = &quot;Avser Du att mata in en totalförlust?&quot;
sMsgAuthorization = &quot;Säkerhetskontroll&quot;
sMsgDeleteAll = &quot;Vill Du ta bort alla rörelser och återställa portföljöversikten?&quot;
cSplit = &quot;Aktiesplit den &quot;
sHistory = &quot;Historik&quot;
TransactTitle(1) = &quot;Sälja aktier&quot;
TransactTitle(2) = &quot;Köpa aktier&quot;
StockRatesTitle(1) = &quot;Aktieutdelning&quot;
StockRatesTitle(2) = &quot;Aktiesplit&quot;
StockRatesTitle(3) = sHistory
sDepotCurrency = &quot;Portföljvaluta&quot;
sStockName = &quot;Aktienamn&quot;
TransactMode = LIFO &apos; Possible values: &quot;FIFO&quot; and &quot;LIFO&quot;
DateCellStyle = &quot;Resultat datum&quot;
CurrCellStyle = &quot;1&quot;
sStartDate = &quot;Startdatum:&quot;
sEndDate = &quot;Slutdatum:&quot;
sStartUpWelcome = &quot;Med hjälp av den här mallen kan Du förvalta Din aktieportfölj effektivt&quot;
sStartUpChooseMarket = &quot;Välj först Din referensvaluta och därigenom börs för Internet-uppdateringen!&quot;
sStartUpHint = &quot;Tyvärr är &lt;History&gt;-funktionen bara tillgänglig för den amerikanska marknaden!&quot;
sStartupHint = ReplaceString(sStartUpHint, sHistory, &quot;&lt;History&gt;&quot;)
sNoInternetUpdate = &quot;utan Internet-uppdatering&quot;
sMarketPlace = &quot;Börs:&quot;
sNoInternetDataAvailable = &quot;Det gick inte att ta emot Internet-kurser!&quot;
sCheckInternetSettings = &quot;Detta kan bero att: &lt;BR&gt; Dina Internet-inställningar måste ändras.&lt;BR&gt; Du har angivit ett felaktigt ID (t.ex. symbol, värdepappersnr.) för aktien.&quot;
sCheckInternetSettings = ReplaceString(sCheckInternetSettings, chr(13), &quot;&lt;BR&gt;&quot;)
sMsgEndDatebeforeNow = &quot;Slutdatum måste ligga före idag!&quot;
sMsgStartDatebeforeEndDate = &quot;Startdatum måste ligga före slutdatum!&quot;
sMarket(0,0) = &quot;Amerikansk dollar&quot;
sMarket(0,1) = &quot;$&quot;
sMarket(0,2) = &quot;New York&quot;
sMarket(0,3) = &quot;http://finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;&amp;f=sl1d1t1c1ohgv&amp;e=.csv&quot;
sMarket(0,4) = &quot;http://ichart.finance.yahoo.com/table.csv?&quot; &amp;_
&quot;s=&lt;StockID&gt;&amp;d=&lt;EndMonth&gt;&amp;e=&lt;EndDay&gt;&amp;f=&lt;Endyear&gt;&amp;g=d&amp;&quot; &amp;_
&quot;a=&lt;StartMonth&gt;&amp;b=&lt;StartDay&gt;&amp;c=&lt;Startyear&gt;&amp;ignore=.csv&quot;
sMarket(0,5) = &quot;Symbol&quot;
sMarket(0,6) = &quot;en&quot;
sMarket(0,7) = &quot;US&quot;
sMarket(0,8) = &quot;409&quot;
sMarket(0,9) = &quot;44&quot;
sMarket(0,10) = &quot;1&quot;
sMarket(1,0) = &quot;Euro&quot;
sMarket(1,1) = chr(8364)
sMarket(1,2) = &quot;Frankfurt&quot;
sMarket(1,3) = &quot;http://de.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;.F&amp;f=sl1t1c1ghpv&amp;e=.csv&quot;
sMarket(1,5) = &quot;Värdepappersnr&quot;
sMarket(1,6) = &quot;de;nl;pt;el&quot;
sMarket(1,7) = &quot;DE;NL;PT;GR&quot;
sMarket(1,8) = &quot;407;413;816;408&quot;
sMarket(1,9) = &quot;59/9&quot;
sMarket(1,10) = &quot;1&quot;
sMarket(2,0) = &quot;Engelskt pund&quot;
sMarket(2,1) = &quot;£&quot;
sMarket(2,2) = &quot;London&quot;
sMarket(2,3) = &quot;http://uk.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;.L&amp;m=*&amp;f=sl1t1c1ghov&amp;e=.csv&quot;
sMarket(2,5) = &quot;Symbol&quot;
sMarket(2,6) = &quot;en&quot;
sMarket(2,7) = &quot;GB&quot;
sMarket(2,8) = &quot;809&quot;
sMarket(2,9) = &quot;44&quot;
sMarket(2,10) = &quot;1&quot;
sMarket(3,0) = &quot;Japansk yen&quot;
sMarket(3,1) = &quot;¥&quot;
sMarket(3,2) = &quot;Tokyo&quot;
sMarket(3,3) = &quot;&quot;
sMarket(3,5) = &quot;Kod&quot;
sMarket(3,6) = &quot;ja&quot;
sMarket(3,7) = &quot;JP&quot;
sMarket(3,8) = &quot;411&quot;
sMarket(3,9) = &quot;&quot;
sMarket(3,10) = &quot;&quot;
sMarket(4,0) = &quot;Hongkongdollar&quot;
sMarket(4,1) = &quot;HK$&quot;
sMarket(4,2) = &quot;Hongkong&quot;
sMarket(4,3) = &quot;http://hk.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;&amp;f=sl1d1t1c1ohgv&amp;e=.csv&quot;
sMarket(4,5) = &quot;Nummer&quot;
sMarket(4,6) = &quot;zh&quot;
sMarket(4,7) = &quot;HK&quot;
sMarket(4,8) = &quot;C04&quot;
sMarket(4,9) = &quot;44&quot;
sMarket(4,10) = &quot;1&quot;
sMarket(5,0) = &quot;Australisk dollar&quot;
sMarket(5,1) = &quot;$&quot;
sMarket(5,2) = &quot;Sydney&quot;
sMarket(5,3) = &quot;http://au.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;&amp;f=sl1d1t1c1ohgv&amp;e=.csv&quot;
sMarket(5,5) = &quot;Symbol&quot;
sMarket(5,6) = &quot;en&quot;
sMarket(5,7) = &quot;AU&quot;
sMarket(5,8) = &quot;C09&quot;
sMarket(5,9) = &quot;44&quot;
sMarket(5,10) = &quot;1&quot;
&apos; ****************************End of the default subset*********************************
CompleteMarketList()
LocalizedCurrencies()
With TransactModel
.lblStockNames.Label = sStockname
.lblQuantity.Label = &quot;Antal&quot;
.lblRate.Label = &quot;Kurs&quot;
.lblDate.Label = &quot;Transaktionsdatum&quot;
.hlnCommission.Label = &quot;Övriga utgifter&quot;
.lblCommission.Label = &quot;Provision&quot;
.lblMinimum.Label = &quot;Minimiprovision&quot;
.lblFix.Label = &quot;Fast belopp/omkostnader&quot;
.cmdGoOn.Label = sOK
.cmdCancel.Label = sCancel
End With
With StockRatesModel
.optPerShare.Label = &quot;Utdelning per aktie&quot;
.optTotal.Label = &quot;Utdelning totalt&quot;
.lblDividend.Label = &quot;Belopp&quot;
.lblExchangeRate.Label = &quot;Omräkningskurs (gammal-&gt;ny)&quot;
.lblColon.Label = &quot;:&quot;
.lblDate.Label = &quot;Omräkningsdatum:&quot;
.lblStockNames.Label = sStockname
.lblStartDate.Label = sStartDate
.lblEndDate.Label = sEndDate
.optDaily.Label = &quot;~Dagligen&quot;
.optWeekly.Label = &quot;~Varje vecka&quot;
.hlnInterval.Label = &quot;Period&quot;
.cmdGoOn.Label = sOk
.cmdCancel.Label = sCancel
End With
End Sub
</script:module>

View 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 = &quot;確定&quot;
sCancel = &quot;取消&quot;
sColumnHeader = &quot;欄標簽&quot;
sInsertStockName = &quot;請先填入股票名稱!&quot;
sTitle = &quot;&lt;PRODUCTNAME&gt;: 股票管理&quot;
sTitle = ReplaceString(sTitle, sProductName, &quot;&lt;PRODUCTNAME&gt;&quot;)
sMsgError = &quot;輸入無效&quot;
sMsgNoName = sInsertStockname
sMsgNoQuantity = &quot;請輸入大於0的交易股數&quot;
sMsgNoDividend = &quot;請輸入每股股息金額或股息總額&quot;
sMsgNoExchangeRate = &quot;請鍵入正確的換算比率(舊股票 -&gt; 新股票)&quot;
sMsgNoValidExchangeDate = &quot;請輸入股票分割的日期&quot;
sMsgWrongExchangeDate = &quot;無法分割股票因為分割日期之後已經買進或賣出股票&quot;
sMsgSellTooMuch = &quot;最多能出售的股票數 &quot;
sMsgConfirm = &quot;需要确認&quot;
sMsgFreeStock = &quot;需要輸入一個贈送的股票&quot;
sMsgTotalLoss = &quot;要輸入一個全部損失的股票&quot;
sMsgAuthorization = &quot;安全詢問&quot;
sMsgDeleteAll = &quot;您要刪除所有的交易資料重新建立一個股票一覽表&quot;
cSplit = &quot;股票分割的日期 &quot;
sHistory = &quot;紀錄&quot;
TransactTitle(1) = &quot;出售股票&quot;
TransactTitle(2) = &quot;購買股票&quot;
StockRatesTitle(1) = &quot;支付股息&quot;
StockRatesTitle(2) = &quot;股票分割&quot;
StockRatesTitle(3) = sHistory
sDepotCurrency = &quot;股票的貨幣&quot;
sStockName = &quot;股票名稱&quot;
TransactMode = LIFO &apos; Possible values: &quot;FIFO&quot; and &quot;LIFO&quot;
DateCellStyle = &quot;結果 日期&quot;
CurrCellStyle = &quot;1&quot;
sStartDate = &quot;交割日期&quot;
sEndDate = &quot;到期日期&quot;
sStartUpWelcome = &quot;這個樣式用於高效能地管理股票交易&quot;
sStartUpChooseMarket = &quot;請先選一個參照的貨幣和一個可直接從 Internet 更新資料的贈券交易所&quot;
sStartUpHint = &quot;很遺憾&lt;History&gt;-功能僅適用於美國的交易所&quot;
sStartupHint = ReplaceString(sStartUpHint, sHistory, &quot;&lt;History&gt;&quot;)
sNoInternetUpdate = &quot;不透過 internet 更新&quot;
sMarketPlace = &quot;證券交易所&quot;
sNoInternetDataAvailable = &quot;無法接受 Internet 股票價格!&quot;
sCheckInternetSettings = &quot;可能的原因&lt;BR&gt;Internet 設定不正確需要重新設定&lt;BR&gt;輸入了一個錯誤的股票代碼&quot;
sCheckInternetSettings = ReplaceString(sCheckInternetSettings, chr(13), &quot;&lt;BR&gt;&quot;)
sMsgEndDatebeforeNow = &quot;到期日期必須是在今日之前&quot;
sMsgStartDatebeforeEndDate = &quot;交割日期必須是在到期日期之前&quot;
sMarket(0,0) = &quot;美元&quot;
sMarket(0,1) = &quot;$&quot;
sMarket(0,2) = &quot;紐約&quot;
sMarket(0,3) = &quot;http://finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;&amp;f=sl1d1t1c1ohgv&amp;e=.csv&quot;
sMarket(0,4) = &quot;http://ichart.finance.yahoo.com/table.csv?&quot; &amp;_
&quot;s=&lt;StockID&gt;&amp;d=&lt;EndMonth&gt;&amp;e=&lt;EndDay&gt;&amp;f=&lt;Endyear&gt;&amp;g=d&amp;&quot; &amp;_
&quot;a=&lt;StartMonth&gt;&amp;b=&lt;StartDay&gt;&amp;c=&lt;Startyear&gt;&amp;ignore=.csv&quot;
sMarket(0,5) = &quot;股票符號&quot;
sMarket(0,6) = &quot;en&quot;
sMarket(0,7) = &quot;US&quot;
sMarket(0,8) = &quot;409&quot;
sMarket(0,9) = &quot;44&quot;
sMarket(0,10) = &quot;1&quot;
sMarket(1,0) = &quot;歐元&quot;
sMarket(1,1) = chr(8364)
sMarket(1,2) = &quot;法蘭克福&quot;
sMarket(1,3) = &quot;http://de.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;.F&amp;f=sl1t1c1ghpv&amp;e=.csv&quot;
sMarket(1,5) = &quot;股代碼&quot;
sMarket(1,6) = &quot;de;nl;pt;el&quot;
sMarket(1,7) = &quot;DE;NL;PT;GR&quot;
sMarket(1,8) = &quot;407;413;816;408&quot;
sMarket(1,9) = &quot;59/9&quot;
sMarket(1,10) = &quot;1&quot;
sMarket(2,0) = &quot;英鎊&quot;
sMarket(2,1) = &quot;£&quot;
sMarket(2,2) = &quot;倫敦&quot;
sMarket(2,3) = &quot;http://uk.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;.L&amp;m=*&amp;f=sl1t1c1ghov&amp;e=.csv&quot;
sMarket(2,5) = &quot;股票符號&quot;
sMarket(2,6) = &quot;en&quot;
sMarket(2,7) = &quot;GB&quot;
sMarket(2,8) = &quot;809&quot;
sMarket(2,9) = &quot;44&quot;
sMarket(2,10) = &quot;1&quot;
sMarket(3,0) = &quot;日元&quot;
sMarket(3,1) = &quot;¥&quot;
sMarket(3,2) = &quot;東京&quot;
sMarket(3,3) = &quot;&quot;
sMarket(3,5) = &quot;代碼&quot;
sMarket(3,6) = &quot;ja&quot;
sMarket(3,7) = &quot;JP&quot;
sMarket(3,8) = &quot;411&quot;
sMarket(3,9) = &quot;&quot;
sMarket(3,10) = &quot;&quot;
sMarket(4,0) = &quot;港幣&quot;
sMarket(4,1) = &quot;HK$&quot;
sMarket(4,2) = &quot;香港&quot;
sMarket(4,3) = &quot;http://hk.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;.HK&amp;f=sl1d1t1c1ohgv&amp;e=.csv&quot;
sMarket(4,5) = &quot;編號&quot;
sMarket(4,6) = &quot;zh&quot;
sMarket(4,7) = &quot;HK&quot;
sMarket(4,8) = &quot;C04&quot;
sMarket(4,9) = &quot;44&quot;
sMarket(4,10) = &quot;1&quot;
sMarket(5,0) = &quot;澳元&quot;
sMarket(5,1) = &quot;$&quot;
sMarket(5,2) = &quot;悉尼&quot;
sMarket(5,3) = &quot;http://au.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;&amp;f=sl1d1t1c1ohgv&amp;e=.csv&quot;
sMarket(5,5) = &quot;股票符號&quot;
sMarket(5,6) = &quot;en&quot;
sMarket(5,7) = &quot;AU&quot;
sMarket(5,8) = &quot;C09&quot;
sMarket(5,9) = &quot;44&quot;
sMarket(5,10) = &quot;1&quot;
&apos; ****************************End of the default subset*********************************
CompleteMarketList()
LocalizedCurrencies()
With TransactModel
.lblStockNames.Label = sStockname
.lblQuantity.Label = &quot;數量&quot;
.lblRate.Label = &quot;股票價格&quot;
.lblDate.Label = &quot;交易日期&quot;
.hlnCommission.Label = &quot;其它的支出費用&quot;
.lblCommission.Label = &quot;手續費&quot;
.lblMinimum.Label = &quot;最低手續費&quot;
.lblFix.Label = &quot;固定金額/費用&quot;
.cmdGoOn.Label = sOK
.cmdCancel.Label = sCancel
End With
With StockRatesModel
.optPerShare.Label = &quot;每股股息&quot;
.optTotal.Label = &quot;股息總計&quot;
.lblDividend.Label = &quot;金額&quot;
.lblExchangeRate.Label = &quot;轉換比率(舊股票 -&gt; 新股票)&quot;
.lblColon.Label = &quot;:&quot;
.lblDate.Label = &quot;轉換日期:&quot;
.lblStockNames.Label = sStockname
.lblStartDate.Label = sStartDate
.lblEndDate.Label = sEndDate
.optDaily.Label = &quot;每日&quot;
.optWeekly.Label = &quot;每週&quot;
.hlnInterval.Label = &quot;時間週期&quot;
.cmdGoOn.Label = sOk
.cmdCancel.Label = sCancel
End With
End Sub
</script:module>

View 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 = &quot;确定&quot;
sCancel = &quot;取消&quot;
sColumnHeader = &quot;列标题&quot;
sInsertStockName = &quot;请首先往您的帐号内输入一些股票名称&quot;
sTitle = &quot;&lt;PRODUCTNAME&gt;股票管理&quot;
sTitle = ReplaceString(sTitle, sProductName, &quot;&lt;PRODUCTNAME&gt;&quot;)
sMsgError = &quot;输入错误&quot;
sMsgNoName = sInsertStockname
sMsgNoQuantity = &quot;请输入大于0的交易股数&quot;
sMsgNoDividend = &quot;请输入每股的红利金额或红利总额&quot;
sMsgNoExchangeRate = &quot;请输入一个正确的兑换率(旧股-&gt; 新股)&quot;
sMsgNoValidExchangeDate = &quot;请输入拆股生效日期&quot;
sMsgWrongExchangeDate = &quot;因为在拆股生效后已经进行了股票交易所以无法拆股&quot;
sMsgSellTooMuch = &quot;您最多能出售的股票数为 &quot;
sMsgConfirm = &quot;需要确认&quot;
sMsgFreeStock = &quot;您想要输入赠送股票&quot;
sMsgTotalLoss = &quot;您想要输入总亏损值&quot;
sMsgAuthorization = &quot;安全查询&quot;
sMsgDeleteAll = &quot;您要删除所有的交易信息并重新建立股票帐号一览表吗&quot;
cSplit = &quot;股票拆股日期 &quot;
sHistory = &quot;记录&quot;
TransactTitle(1) = &quot;出售股票&quot;
TransactTitle(2) = &quot;购买股票&quot;
StockRatesTitle(1) = &quot;支付红利&quot;
StockRatesTitle(2) = &quot;股票拆股&quot;
StockRatesTitle(3) = sHistory
sDepotCurrency = &quot;股票交易的货币&quot;
sStockName = &quot;股票名称&quot;
TransactMode = LIFO &apos; Possible values: &quot;FIFO&quot; and &quot;LIFO&quot;
DateCellStyle = &quot;结果 日期&quot;
CurrCellStyle = &quot;1&quot;
sStartDate = &quot;起始日期&quot;
sEndDate = &quot;终止日期&quot;
sStartUpWelcome = &quot;这个样式能够帮助您有效地管理自己的股票帐号&quot;
sStartUpChooseMarket = &quot;请首先选择采用的参考货币以及要直接用国际互联网来更新资料的证券交易所&quot;
sStartUpHint = &quot;很遗憾&lt;History&gt;功能仅可供美国市场使用&quot;
sStartupHint = ReplaceString(sStartUpHint, sHistory, &quot;&lt;History&gt;&quot;)
sNoInternetUpdate = &quot;不通过国际互联网更新&quot;
sMarketPlace = &quot;交易所&quot;
sNoInternetDataAvailable = &quot;无法获得国际互联网上的行情&quot;
sCheckInternetSettings = &quot;可能的原因是&lt;BR&gt;您的国际互联网设定不正确需要重新设定&lt;BR&gt;输入了一个错误的股票号码&quot;
sCheckInternetSettings = ReplaceString(sCheckInternetSettings, chr(13), &quot;&lt;BR&gt;&quot;)
sMsgEndDatebeforeNow = &quot;终止日期必须在今天之前&quot;
sMsgStartDatebeforeEndDate = &quot;起始日期必须在终止日期之前&quot;
sMarket(0,0) = &quot;美元&quot;
sMarket(0,1) = &quot;$&quot;
sMarket(0,2) = &quot;纽约&quot;
sMarket(0,3) = &quot;http://finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;&amp;f=sl1d1t1c1ohgv&amp;e=.csv&quot;
sMarket(0,4) = &quot;http://ichart.finance.yahoo.com/table.csv?&quot; &amp;_
&quot;s=&lt;StockID&gt;&amp;d=&lt;EndMonth&gt;&amp;e=&lt;EndDay&gt;&amp;f=&lt;Endyear&gt;&amp;g=d&amp;&quot; &amp;_
&quot;a=&lt;StartMonth&gt;&amp;b=&lt;StartDay&gt;&amp;c=&lt;Startyear&gt;&amp;ignore=.csv&quot;
sMarket(0,5) = &quot;图标&quot;
sMarket(0,6) = &quot;en&quot;
sMarket(0,7) = &quot;US&quot;
sMarket(0,8) = &quot;409&quot;
sMarket(0,9) = &quot;44&quot;
sMarket(0,10) = &quot;1&quot;
sMarket(1,0) = &quot;欧元&quot;
sMarket(1,1) = chr(8364)
sMarket(1,2) = &quot;法兰克福&quot;
sMarket(1,3) = &quot;http://de.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;.F&amp;f=sl1t1c1ghpv&amp;e=.csv&quot;
sMarket(1,5) = &quot;代码&quot;
sMarket(1,6) = &quot;de;nl;pt;el&quot;
sMarket(1,7) = &quot;DE;NL;PT;GR&quot;
sMarket(1,8) = &quot;407;413;816;408&quot;
sMarket(1,9) = &quot;59/9&quot;
sMarket(1,10) = &quot;1&quot;
sMarket(2,0) = &quot;英镑&quot;
sMarket(2,1) = &quot;£&quot;
sMarket(2,2) = &quot;伦敦&quot;
sMarket(2,3) = &quot;http://uk.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;.L&amp;m=*&amp;f=sl1t1c1ghov&amp;e=.csv&quot;
sMarket(2,5) = &quot;股票代码&quot;
sMarket(2,6) = &quot;en&quot;
sMarket(2,7) = &quot;GB&quot;
sMarket(2,8) = &quot;809&quot;
sMarket(2,9) = &quot;44&quot;
sMarket(2,10) = &quot;1&quot;
sMarket(3,0) = &quot;日元&quot;
sMarket(3,1) = &quot;¥&quot;
sMarket(3,2) = &quot;东京&quot;
sMarket(3,3) = &quot;&quot;
sMarket(3,5) = &quot;代码&quot;
sMarket(3,6) = &quot;ja&quot;
sMarket(3,7) = &quot;JP&quot;
sMarket(3,8) = &quot;411&quot;
sMarket(3,9) = &quot;&quot;
sMarket(3,10) = &quot;&quot;
sMarket(4,0) = &quot;港币&quot;
sMarket(4,1) = &quot;HK$&quot;
sMarket(4,2) = &quot;香港&quot;
sMarket(4,3) = &quot;http://hk.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;.HK&amp;f=sl1d1t1c1ohgv&amp;e=.csv&quot;
sMarket(4,5) = &quot;编号&quot;
sMarket(4,6) = &quot;zh&quot;
sMarket(4,7) = &quot;HK&quot;
sMarket(4,8) = &quot;C04&quot;
sMarket(4,9) = &quot;44&quot;
sMarket(4,10) = &quot;1&quot;
sMarket(5,0) = &quot;澳元&quot;
sMarket(5,1) = &quot;$&quot;
sMarket(5,2) = &quot;悉尼&quot;
sMarket(5,3) = &quot;http://au.finance.yahoo.com/d/quotes.csv?s=&lt;StockID&gt;&amp;f=sl1d1t1c1ohgv&amp;e=.csv&quot;
sMarket(5,5) = &quot;股票代码&quot;
sMarket(5,6) = &quot;en&quot;
sMarket(5,7) = &quot;AU&quot;
sMarket(5,8) = &quot;C09&quot;
sMarket(5,9) = &quot;44&quot;
sMarket(5,10) = &quot;1&quot;
&apos; ****************************End of the default subset*********************************
CompleteMarketList()
LocalizedCurrencies()
With TransactModel
.lblStockNames.Label = sStockname
.lblQuantity.Label = &quot;数量&quot;
.lblRate.Label = &quot;股票牌价&quot;
.lblDate.Label = &quot;交易日期&quot;
.hlnCommission.Label = &quot;其它支出费用&quot;
.lblCommission.Label = &quot;手续费&quot;
.lblMinimum.Label = &quot;最低手续费&quot;
.lblFix.Label = &quot;固定金额/费用&quot;
.cmdGoOn.Label = sOK
.cmdCancel.Label = sCancel
End With
With StockRatesModel
.optPerShare.Label = &quot;每股红利&quot;
.optTotal.Label = &quot;红利总计&quot;
.lblDividend.Label = &quot;金额&quot;
.lblExchangeRate.Label = &quot;兑换率(-&gt;)&quot;
.lblColon.Label = &quot;:&quot;
.lblDate.Label = &quot;兑换日期:&quot;
.lblStockNames.Label = sStockname
.lblStartDate.Label = sStartDate
.lblEndDate.Label = sEndDate
.optDaily.Label = &quot;每天&quot;
.optWeekly.Label = &quot;每周&quot;
.hlnInterval.Label = &quot;时间周期&quot;
.cmdGoOn.Label = sOk
.cmdCancel.Label = sCancel
End With
End Sub
</script:module>

View File

@@ -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>

View 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>

View 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(&quot;Link&quot;) then
oSheets.RemovebyName(&quot;Link&quot;)
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, &quot;ColumnsToHide&quot;)
iEndRow = GetRowIndex(oMovementSheet, &quot;HiddenRow3&quot; )
GetTransactionCount = iEndRow -iStartRow - 2
End Function
Function GetStocksCount(iStartRow as Integer)
Dim iEndRow as Integer
iStartRow = GetRowIndex(oFirstSheet, &quot;HiddenRow1&quot;)
iEndRow = GetRowIndex(oFirstSheet, &quot;HiddenRow2&quot;)
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
&apos; Add stock names to empty list box
StocksCount = GetStocksCount(iStartRow)
If StocksCount &gt; 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(&quot;EffectiveValue&quot;) Then
oControl.EffectiveValue = oCell.Value
Else
oControl.Value = oCell.Value
End If
&apos; If oCell.FormulaResultType = 1 Then
&apos; StringValue = oNumberFormatter.GetInputString(oCell.NumberFormat, oCell.Value)
&apos; oControl.Text = DeleteStr(StringValue, &quot;%&quot;)
&apos; Else
&apos; oControl.Text = oCell.String
&apos; End If
End Sub
Sub RemoveStockRows(oSheet as Object, iStartRow, RowCount as Integer)
If RowCount &gt; 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(&quot;cmdGoOn&quot;).Model
oRefModel.Enabled = oDateModel.Date &lt;&gt; 0
End Sub
&apos; Updates the cell with the CurrentValue after checking if the
&apos; Newdate is later than the one that is refered to in the annotation
&apos; 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 &gt;= 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 &lt;&gt; &quot;&quot; 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, &quot;HiddenRow1&quot;)
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 &gt; iLastRow Then
GetStockID() = &quot;&quot;
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) &lt;&gt; 0
bIsDocCountry = Instr(1, LocCountry, sDocCountry, SBBINARY) &lt;&gt; 0 OR SDocCountry = &quot;&quot;
CheckDocLocale = (bIsDocLanguage And bIsDocCountry)
End Function
</script:module>

View 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(&quot;Tools&quot;)
BasicLibraries.LoadLibrary(&quot;ImportWizard&quot;)
If InitResources(&quot;Euro Converter&quot;, &quot;eur&quot;) Then
oUcb = createUnoService(&quot;com.sun.star.ucb.SimpleFileAccess&quot;)
oLocale = GetStarOfficeLocale()
InitializeConverter(oLocale, 2)
ToggleGoOnButton()
oFactoryKey = GetRegistryKeyContent(&quot;org.openoffice.Setup/Office/Factories&quot;)
DialogModel.chkTextDocuments.Enabled = oFactoryKey.hasbyName(&quot;com.sun.star.text.TextDocument&quot;)
DialogModel.cmdGoOn.DefaultButton = True
DialogModel.lstCurrencies.TabIndex = 12
DialogConvert.GetControl(&quot;optWholeDir&quot;).SetFocus()
DialogConvert.Execute()
DialogConvert.Dispose()
End If
End Sub
Sub ConvertDocuments()
Dim FilesList()
Dim bDisposable as Boolean
If Source &lt;&gt; &quot;&quot; And TargetDir &lt;&gt; &quot;&quot; Then
If DialogModel.optSingleFile.State = 1 Then
SourceFile = Source
TotDocCount = 1
Else
SourceDir = Source
TargetStemDir = TargetDir
TypeList(0) = &quot;calc8&quot;
TypeList(1) = &quot;calc_StarOffice_XML_Calc&quot;
TypeList(2) = &quot;calc_StarCalc_30&quot;
TypeList(3) = &quot;calc_StarCalc_40&quot;
TypeList(4) = &quot;calc_StarCalc_50&quot;
If DialogModel.chkTextDocuments.State = 1 Then
ReDim Preserve TypeList(13) as String
TypeList(5) = &quot;writer8&quot;
TypeList(6) = &quot;writerglobal8&quot;
TypeList(7) = &quot;writer_StarOffice_XML_Writer&quot;
TypeList(8) = &quot;writer_globaldocument_StarOffice_XML_Writer_GlobalDocument&quot;
TypeList(9) = &quot;writer_StarWriter_30&quot;
TypeList(10) = &quot;writer_StarWriter_40&quot;
TypeList(11) = &quot;writer_globaldocument_StarWriter_40GlobalDocument&quot;
TypeList(12) = &quot;writer_StarWriter_50&quot;
TypeList(13) = &quot;writer_globaldocument_StarWriter_50GlobalDocument&quot;
End If
FilesList() = ReadDirectories(SourceDir, bRecursive, True, False, TypeList())
TotDocCount = Ubound(FilesList(),1) + 1
End If
InitializeProgressPage(DialogModel)
&apos; ChangeToNextProgressStep()
sTotDocCount = CStr(TotDocCount)
OpenProperties(0).Name = &quot;Hidden&quot;
OpenProperties(0).Value = True
OpenProperties(1).Name = &quot;AsTemplate&quot;
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
&apos; 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, &quot;/&quot;)
Else
SourceFile = Source
TargetFile = TargetDir &amp; &quot;/&quot; &amp; FileNameoutofPath(SourceFile, &quot;/&quot;)
End If
If CreateFolder(TargetDir) Then
sExtension = GetFileNameExtension(SourceFile, &quot;/&quot;)
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) &amp; &quot;/&quot; &amp; sTotDocCount &amp; &quot; (&quot; &amp; sViewPath &amp; &quot;)&quot;
End If
InitializeDocument() = Not bIsReadOnly
Else
InitializeDocument() = False
End If
Else
InitializeDocument() = False
End If
NEXTFILE:
If Err &lt;&gt; 0 Then
InitializeDocument() = False
Resume LETSGO
LETSGO:
End If
End Function
Sub ChangeToNextProgressStep()
DialogModel.lblCurProgress.FontWeight = com.sun.star.awt.FontWeight.NORMAL
DialogConvert.GetControl(&quot;lblCurProgress&quot;).Visible = True
End Sub
Function StoreDocument() as Boolean
Dim sCurFileExists as String
Dim iOverWrite as Integer
If (TargetFile &lt;&gt; &quot;&quot;) And (Not bCancelTask) Then
On Local Error Goto NOSAVING
If oUcb.Exists(TargetFile) Then
sCurFileExists = ReplaceString(sMsgFileExists, ConvertFromUrl(TargetFile), &quot;&lt;1&gt;&quot;)
sCurFileExists = ReplaceString(sCurFileExists, chr(13), &quot;&lt;CR&gt;&quot;)
iOverWrite = Msgbox (sCurFileExists, 32 + 3, sMsgDLGTITLE)
Select Case iOverWrite
Case 1 &apos; OK
Case 2 &apos; Abort
bCancelTask = True
StoreDocument() = False
Exit Function
Case 7 &apos; No
StoreDocument() = False
Exit Function
End Select
End If
If TargetFile &lt;&gt; SourceFile Then
oDocument.StoreAsUrl(TargetFile,NoArgs)
Else
oDocument.Store
End If
StoreDocument() = True
NOSAVING:
If Err &lt;&gt; 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 = &quot;&quot;
End If
If Source &lt;&gt; &quot;&quot; And TargetDir &lt;&gt; &quot;&quot; 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 &amp; &quot; &quot; &amp; ConvertFromUrl(Source) &amp; chr(13)
If DialogModel.chkRecursive.State = 1 Then
TextBoxText = TextBoxText &amp; DeleteStr(sInclusiveSubDir,&quot;~&quot;) &amp; chr(13)
End If
Else
TextBoxText = sSOURCEFILE &amp; &quot; &quot; &amp; ConvertFromUrl(Source) &amp; chr(13)
End If
TextBoxText = TextBoxText &amp; sTARGETDIR &amp; &quot; &quot; &amp; ConvertFromUrl(TargetDir) &amp; chr(13)
If DialogModel.chkProtect.State = 1 Then
TextBoxText = TextboxText &amp; 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
&apos; If the Sub is call by the &apos;cmdBack&apos; Button then set the &apos;bMakeVisible&apos; variable accordingly
bMakeVisible = IsMissing(aEvent)
If bMakeVisible Then
DialogModel.Step = 3
Else
DialogModel.Step = 2
End If
DialogConvert.GetControl(&quot;lblCurrencies&quot;).Visible = Not bMakeVisible
DialogConvert.GetControl(&quot;lstCurrencies&quot;).Visible = Not bMakeVisible
DialogConvert.GetControl(&quot;cmdBack&quot;).Visible = bMakeVisible
DialogConvert.GetControl(&quot;cmdGoOn&quot;).Visible = bMakeVisible
DialogModel.imgPreview.ImageUrl = BitmapDir &amp; &quot;euro_&quot; &amp; DialogModel.Step &amp; &quot;.bmp&quot;
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(&quot;lblRetrieval&quot;).Visible = False
DialogConvert.GetControl(&quot;lblCurProgress&quot;).Visible = False
DialogModel.lblRetrieval.FontWeight = com.sun.star.awt.FontWeight.NORMAL
DialogModel.lblCurProgress.FontWeight = com.sun.star.awt.FontWeight.BOLD
DialogConvert.GetControl(&quot;lblRetrieval&quot;).Visible = True
DialogConvert.GetControl(&quot;lblCurProgress&quot;).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, &quot;:&quot;)
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, &quot;text&quot;) = 0) And (Instr(1, sLocMimeType, &quot;calc&quot;) = 0) Then
Msgbox(sMsgFileInvalid, 48, sMsgDLGTITLE)
bIsValid = False
End If
Else
If (Instr(1, sLocMimeType, &quot;spreadsheet&quot;) = 0) And (Instr(1, sLocMimeType, &quot;calc&quot;)) = 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,&quot;&lt;1&gt;&quot;)
Msgbox(sNoDirMessage,48, sMsgDLGTITLE)
bIsValid = False
Else
sPath = RTrimStr(sPath,&quot;/&quot;)
sPath = sPath &amp; &quot;/&quot;
End If
End if
Else
Msgbox(HeaderString &amp; &quot; &apos;&quot; &amp; ConvertFromUrl(sPath) &amp; &quot;&apos; &quot; &amp; sMsgNOTTHERE,48, sMsgDLGTITLE)
End If
If bIsValid Then
AssignFileName() = sPath
Else
AssignFilename() = &quot;&quot;
End If
End Function
Sub ToggleGoOnButton()
Dim bDoEnable as Boolean
Dim sLocMimeType as String
Dim sPath as String
bDoEnable = Ubound(DialogModel.lstCurrencies.SelectedItems()) &gt; -1
If bDoEnable Then
&apos; 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(&quot;org.openoffice.TypeDetection.Types&quot;)
oTypes() = oMasterKey.Types
oUIKey = GetRegistryKeyContent(&quot;org.openoffice.Office.UI/FilterClassification/LocalFilters&quot;)
If DialogModel.chkTextDocuments.State = 1 Then
Dim FilterNames(11,1) as String
FilterNames(6,0) = oTypes.GetByName(&quot;writer_StarOffice_XML_Writer&quot;).UIName
FilterNames(6,1) = &quot;*.sxw&quot;
FilterNames(7,0) = oTypes.GetByName(&quot;writer_StarOffice_XML_Writer_Template&quot;).UIName
FilterNames(7,1) = &quot;*.stw&quot;
FilterNames(8,0) = oUIKey.Classes.GetByName(&quot;sw3to5&quot;).DisplayName
FilterNames(8,1) = &quot;*.sdw&quot;
FilterNames(9,0) = oUIKey.Classes.GetByName(&quot;sw3to5templ&quot;).DisplayName
Filternames(9,1) = &quot;*.vor&quot;
FilterNames(10,0) = oTypes.GetByName(&quot;writer8&quot;).UIName
FilterNames(10,1) = &quot;*.odt&quot;
FilterNames(11,0) = oTypes.GetByName(&quot;writer8_template&quot;).UIName
FilterNames(11,1) = &quot;*.ott&quot;
Else
ReDim FilterNames(5,1) as String
End If
FilterNames(0,0) = oTypes.GetByName(&quot;calc_StarOffice_XML_Calc&quot;).UIName
Filternames(0,1) = &quot;*.sxc&quot;
FilterNames(1,0) = oTypes.GetByName(&quot;calc_StarOffice_XML_Calc_Template&quot;).UIName
Filternames(1,1) = &quot;*.stc&quot;
FilterNames(2,0) = oUIKey.Classes.GetByName(&quot;sc345&quot;).DisplayName
FilterNames(2,1) = &quot;*.sdc&quot;
FilterNames(3,0) = oUIKey.Classes.GetByName(&quot;sc345templ&quot;).DisplayName
Filternames(3,1) = &quot;*.vor&quot;
FilterNames(4,0) = oTypes.GetByName(&quot;calc8&quot;).UIName
Filternames(4,1) = &quot;*.ods&quot;
FilterNames(5,0) = oTypes.GetByName(&quot;calc8_template&quot;).UIName
Filternames(5,1) = &quot;*.ots&quot;
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>

View 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, &quot;calc&quot;) &lt;&gt; 0 Then
oSheets = oDocument.Sheets
oSheet = oDocument.Sheets.GetbyIndex(0)
oAddressRanges = oDocument.createInstance(&quot;com.sun.star.sheet.SheetCellRanges&quot;)
End If
&apos; Retrieve the indices for the cellformatations
oFormats = oDocument.NumberFormats
End Sub
Sub CancelTask()
&apos; If Not DocDisposed Then
&apos; ReprotectSheets()
&apos; 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
&apos; DocDisposed = True
InitializeProgressbar()
If Instr(1, CurMimeType, &quot;calc&quot;) &lt;&gt; 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 &gt; -1 Then
ConvertThehardWay(RangeList(), True, False)
MakeStyleEnumeration(True)
oDocument.calculateAll()
End If
ReprotectSheets()
bRangeListDefined = False
End If
Else
DialogModel.ProgressBar.ProgressValue = 10 &apos; oStatusline.SetValue(10)
ConvertTextFields()
DialogModel.ProgressBar.ProgressValue = 80 &apos; 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 = &quot;0 [$EUR]&quot;
Else
aSimpleStr = &quot;0 [$&quot; &amp; sEuroSign &amp; aFormat.CurrencyExtension &amp; &quot;]&quot;
End If
nSimpleKey = Numberformat(oFormats, aSimpleStr, oLocale)
&apos; 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 &lt;&gt; 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
&apos; 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
&apos; If the Currencysymbol of the object ist the one needed, then check the Currency extension
sFormatCurrExt = oFormatofObject.CurrencyExtension
If FieldInList(CurExtension(),2,sFormatCurrExt) Then
&apos; The Currency - extension also fits
CheckFormatType = True
Else
&apos; The Currency - symbol is Euro-conforming (like &apos;DEM&apos;), so there is no Currency-Extension
CheckFormatType = oFormatofObject.CurrencySymbol = CurrsymbolList(2)
End If
Else
&apos; The Currency Symbol of the object is not the desired one
If oFormatofObject.CurrencySymbol = &quot;&quot; Then
&apos; Format is &quot;automatic&quot;
CheckFormatType = CheckLocale(oFormatofObject.Locale)
Else
CheckFormatType = False
End If
End If
NOKEY:
If Err &lt;&gt; 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 &lt;&gt; 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
&apos;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 &gt; -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>

View 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(&quot;Tools&quot;)
If InitResources(&quot;Euro Converter&quot;, &quot;eur&quot;) Then
bDoUnProtect = False
bPreSelected = True
oDocument = ThisComponent
RetrieveDocumentObjects() &apos; Statusline, SheetsCollection etc.
InitializeConverter(oDocument.CharLocale, 1)
GetPreSelectedRange()
If GoOn Then
DialogModel.lstCurrencies.TabIndex = 2
DialogConvert.GetControl(&quot;chkComplete&quot;).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()) &gt; -1 Then
EnableStep1DialogControls(False, False, False)
oSelRanges = oDocument.createInstance(&quot;com.sun.star.sheet.SheetCellRanges&quot;)
&apos; Is the sheet the basis, then the sheetobject has to be created
If DialogModel.optDocRanges.State = 1 Then
&apos; 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(&quot;NumberFormat&quot;) = 1 Then
If oRange.CellStyle = CurStyleName Then
oSelRanges.InsertbyName(&quot;&quot;,oRange)
End If
End If
Wend
Next i
Else
&apos; 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 &gt; MaxIndex Then
Redim Preserve SelRangeList(MaxIndex + SBRANGEUBOUND)
End If
SelRangeList(a) = RangeName
If oListSheet.Name = sCurSheetName Then
oRange = RetrieveRangeoutofRangeName(RangeName)
oSelRanges.InsertbyName(&quot;&quot;,oRange)
End If
Next n
End If
If a &gt; -1 Then
ReDim Preserve SelRangeList(a)
Else
ReDim SelRangeList()
End If
oDocument.CurrentController.Select(oSelRanges)
EnableStep1DialogControls(True, True, True)
End If
End Sub
&apos; 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)
&apos; 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
&apos; The CheckBox has the Value &apos;1&apos; when the Controls in the Frame are disabled
If bButtonsEnabled Then
bCurrIsSelected = Ubound(DialogModel.lstCurrencies.SelectedItems()) &lt;&gt; -1
&apos; Enable GoOnButton only when Currency is selected
DialogModel.cmdGoOn.Enabled = bCurrIsSelected
DialogModel.chkComplete.Enabled = bCurrIsSelected
If bDoEnableFrame AND DialogModel.cmdGoOn.Enabled Then
&apos; If FrameControls are enabled, check if Listbox is Empty
bObjectIsSelected = Ubound(DialogModel.lstSelection.SelectedItems()) &lt;&gt; -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(&quot;lstSelection&quot;).SelectedItems()
If DialogModel.optCellTemplates.State = 1 Then
&apos; Option &apos;Soft&apos; 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
&apos; 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, &quot;;&quot;, MaxIndex)
For i = 0 To MaxIndex
oSelRanges.RemovebyName(EmptySelRangeList(i))
Next i
End If
oDocument.CurrentController.Select(oSelRanges)
Else
oSelRanges = oDocument.createInstance(&quot;com.sun.star.sheet.SheetCellRanges&quot;)
End If
End Sub
Function AddSelectedRangeToSelRangesEnum() as Object
Dim oLocRange as Object
osheet = oDocument.CurrentController.GetActiveSheet
oSelRanges = oDocument.createInstance(&quot;com.sun.star.sheet.SheetCellRanges&quot;)
&apos; Check if a Currency-Range has been selected
oLocRange = oDocument.CurrentController.Selection
bPreSelected = oLocRange.SupportsService(&quot;com.sun.star.sheet.SheetCellRange&quot;)
If bPreSelected Then
oSelRanges.InsertbyName(&quot;&quot;,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)&apos;, 0)
SelectListboxItem(DialogModel.lstCurrencies, CurrIndex)
TotCellCount = CountRangeCells(oLocRange)
End Sub
Sub CheckRangeSelection(Optional oEvent)
EmptySelection()
AddRangeToListbox(oPreSelRange)
oPreSelRange = AddSelectedRangeToSelRangesEnum()
End Sub
&apos; Checks if a Field (LocField) is already defined in an Array
&apos; Returns &apos;True&apos; or &apos;False&apos;
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>

View 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&amp;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&amp;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&amp;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&amp;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&amp;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&amp;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&amp;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&amp;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&amp;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&amp;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&amp;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&amp;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&amp;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&amp;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&amp;location=application" script:language="Script"/>
</dlg:button>
</dlg:bulletinboard>
</dlg:window>

View File

@@ -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&amp;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&amp;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>

View 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 &lt;&gt; 1) Then
&apos; Conversion on a sheet?
SetStatusLineText(sStsRELRANGES)
osheet = oDocument.CurrentController.GetActiveSheet
oRanges = osheet.CellFormatRanges.createEnumeration()
MaxIndex = AddSheetRanges(oRanges, MaxIndex, oSheet, False)
If MaxIndex &gt; -1 Then
ReDim Preserve RangeList(MaxIndex)
End If
Else
CreateRangeEnumeration(False)
bRangeListDefined = True
End If
EnableStep1DialogControls(True, True, True)
SetStatusLineText(&quot;&quot;)
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
&apos; 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),&quot;%1Number%1&quot;)
sStatustext = ReplaceString(sStatusText,oSheets.Count,&quot;%2TotPageCount%2&quot;)
SetStatusLineText(sStatusText)
End If
oRanges = osheet.CellFormatRanges.createEnumeration
MaxIndex = AddSheetRanges(oRanges, MaxIndex, oSheet, bAutopilot)
Next i
Else
If Not bAutoPilot Then
SetStatusLineText(sStsRELRANGES)
&apos; cellranges already defined
For i = 0 To Ubound(RangeList())
If RangeList(i) &lt;&gt; &quot;&quot; Then
AddSingleItemToListBox(DialogModel.lstSelection, RangeList(i))
End If
Next
End If
End If
If MaxIndex &gt; -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
&apos; The Ranges are only passed to an Array when the whole Document is the basis
&apos; Redimension the RangeList Array if necessary
MaxIndex = Ubound(RangeList())
r = r + 1
If r &gt; MaxIndex Then
MaxIndex = MaxIndex + SBRANGEUBOUND
ReDim Preserve RangeList(MaxIndex)
End If
RangeList(r) = RangeName
End If
Wend
AddSheetRanges = r
End Function
&apos; 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)
&apos; Is the Range already included in the collection?
oRange = RetrieveRangeoutOfRangename(SelItem)
TotCellCount = TotCellCount + CountRangeCells(oRange)
DescriptionList() = ArrayOutofString(SelItem,&quot;.&quot;,1)
SheetRangeName = DeleteStr(DescriptionList(0),&quot;&apos;&quot;)
If SheetRangeName = CurSheetName Then
oSelRanges.InsertbyName(&quot;&quot;,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(&quot;lstSelection&quot;)
Lastindex = Ubound(ListboxList())
If TotCellCount &gt; 0 Then
OldStatusValue = StatusValue
&apos; 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(&quot;NumberFormat&quot;) &lt;&gt; 1 Then
&apos; 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 &gt; 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
&apos; 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)= &quot;&quot; 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>

File diff suppressed because it is too large Load Diff

View 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
&apos; 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(&quot;&quot;)
If oListSheet.IsProtected Then
&apos; Sheet is protected by a Password
bOneSheetIsUnProtected = UnprotectSheetWithDialog(oListSheet, ListSheetName)
UnProtectSheet() = bOneSheetIsUnProtected
Else
&apos; The Sheet could be unprotected without a password
AddSheettoUnprotectionlist(ListSheetName,&quot;&quot;)
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,&quot;&apos;&quot; &amp; ListSheetName &amp; &quot;&apos;&quot;, &quot;%1TableName%1&quot;)
&apos;&quot;Please insert the password to unprotect the sheet &apos;&quot; &amp; ListSheetName&apos;&quot;
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
&apos; 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
&apos; Reprotects the previousliy protected sheets
&apos; The passwordinformation is stored in the List &apos;UnProtectList()&apos;
Sub ReprotectSheets()
Dim i as Integer
Dim oProtectSheet as Object
Dim ProtectList() as String
Dim SheetName as String
Dim SheetPassword as String
If PWIndex &gt; -1 Then
SetStatusLineText(sStsREPROTECT)
For i = 0 To PWIndex
ProtectList() = ArrayOutOfString(UnProtectList(i),&quot;;&quot;)
SheetName = ProtectList(0)
If Ubound(ProtectList()) &gt; 0 Then
SheetPassWord = ProtectList(1)
Else
SheetPassword = &quot;&quot;
End If
oProtectSheet = oSheets.GetbyName(SheetName)
If Not oProtectSheet.IsProtected Then
oProtectSheet.Protect(SheetPassWord)
End If
Next i
SetStatusLineText(&quot;&quot;)
End If
PWIndex = -1
ReDim UnProtectList()
End Sub
&apos; Add a Sheet to the list of sheets that finally have to be
&apos; unprotected
Sub AddSheettoUnprotectionlist(ListSheetName as String, Password as String)
Dim MaxIndex as Integer
MaxIndex = Ubound(UnProtectList())
PWIndex = PWIndex + 1
If PWIndex &gt; MaxIndex Then
ReDim Preserve UnprotectList(MaxIndex + SBRANGEUBOUND)
End If
UnprotectList(PWIndex) = ListSheetName &amp; &quot;;&quot; &amp; 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>

View 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 &gt; Ubound(StyleRangeAssignMentList()) Then
Redim Preserve StyleRangeAssignmentList(StyleIndex)
End If
StyleRangeAssignmentList(StyleIndex) = &quot;&lt;STYLENAME&gt;&quot; &amp; Stylename &amp; &quot;&lt;/STYLENAME&gt;&quot; &amp; _
&quot;&lt;DEFINED&gt;FALSE&lt;/DEFINED&gt;&quot; &amp; &quot;&lt;RANGES&gt;&lt;/RANGES&gt;&quot; &amp;_
&quot;&lt;CELLCOUNT&gt;0&lt;/CELLCOUNT&gt;&quot; &amp;_
&quot;&lt;SELECTED&gt;FALSE&lt;/SELECTED&gt;&quot;
End If
Next m
If StyleIndex &gt; -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()) &lt;&gt; -1 Then
&apos; Style is selected
If FindPartString(AssignString, &quot;&lt;DEFINED&gt;&quot;, &quot;&lt;/DEFINED&gt;&quot;, 1) = &quot;FALSE&quot; Then
AssignString = ReplaceString(AssignString, &quot;&lt;SELECTED&gt;TRUE&lt;/SELECTED&gt;&quot;, &quot;&lt;SELECTED&gt;FALSE&lt;/SELECTED&gt;&quot;)
AssignCellFormatRanges(n, AssignString, CurStyleName)
End If
Else
&apos; Style is not selected
If FindPartString(AssignString, &quot;&lt;SELECTED&gt;&quot;, &quot;&lt;/SELECTED&gt;&quot;, 1) = &quot;FALSE&quot; 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 = &quot;&lt;RANGES&gt;&quot;
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(&quot;NumberFormat&quot;) = 1 Then
If oRange.CellStyle = CurStyleName Then
oRangeAddress = oRange.RangeAddress
RangeName = RetrieveRangeNamefromAddress(oRange)
RangeString = RangeString &amp; RangeName &amp; &quot;,&quot;
StyleCellCount = StyleCellCount + CountRangeCells(oRange)
End If
End If
Wend
Next i
If StyleCellCount &gt; 0 Then
TotCellCount = TotCellCount + StyleCellCount
RangeString = RTrimStr(RangeString,&quot;,&quot;)
RangeString = RangeString &amp; &quot;&lt;/RANGES&gt;&quot;
CellCountString = &quot;&lt;CELLCOUNT&gt;&quot; &amp; StyleCellCount &amp; &quot;&lt;/CELLCOUNT&quot;
AssignString = ReplaceString(AssignString, RangeString,&quot;&lt;RANGES&gt;&lt;/RANGES&gt;&quot;)
AssignString = ReplaceString(AssignString, CellCountString,&quot;&lt;CELLCOUNT&gt;0&lt;/CELLCOUNT&gt;&quot;)
End If
AssignString = ReplaceString(AssignString, &quot;&lt;DEFINED&gt;TRUE&lt;/DEFINED&gt;&quot;, &quot;&lt;DEFINED&gt;FALSE&lt;/DEFINED&gt;&quot;)
StyleRangeAssignmentList(n) = AssignString
End Sub
&apos; 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 =&quot;&lt;SELECTED&gt;FALSE&lt;/SELECTED&gt;&quot;
AssignString = StyleRangeAssignmentList(n)
RangeString = FindPartString(AssignString,&quot;&lt;RANGES&gt;&quot;,&quot;&lt;/RANGES&gt;&quot;,1)
StyleRangeList() = ArrayoutofString(RangeString,&quot;,&quot;)
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, &quot;&lt;SELECTED&gt;FALSE&lt;/SELECTED&gt;&quot;, &quot;&lt;SELECTED&gt;TRUE&lt;/SELECTED&gt;&quot;)
StyleRangeAssignmentList(n) = AssignString
End Sub
Function RetrieveRangeNamefromAddress(oRange as Object) as String
Dim Rangename as String
Dim oAddressRanges as Object
oAddressRanges = oDocument.createInstance(&quot;com.sun.star.sheet.SheetCellRanges&quot;)
oAddressRanges.InsertbyName(&quot;&quot;,oRange)
Rangename = oAddressRanges.RangeAddressesasString
&apos; Msgbox &quot;Adresse: &quot; &amp; oRangeAddress.StartColumn &amp; &quot; ; &quot; &amp; oRangeAddress.EndColumn &amp; &quot; ; &quot; &amp; oRangeAddress.StartRow &amp; &quot; ; &quot; &amp; oRangeAddress.EndRow &amp; chr(13) &amp; RangeName
&apos; oAddressRanges.RemovebyName(RangeName)
RetrieveRangeNamefromAddress = Rangename
End Function
&apos; 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
&apos; find out in which sheet the range is
DescriptionList() = ArrayOutofString(TableText,&quot;.&quot;,MaxIndex)
SheetName = DescriptionList(0)
SheetName = DeleteStr(SheetName,&quot;&apos;&quot;)
&apos; set the viewcursor on this sheet
RetrieveSheetoutofRangeName = oSheets.GetbyName(SheetName)
End Function
&apos; 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(&quot;lstSelection&quot;)
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(&quot;NumberFormat&quot;) = 1 Then
&apos; Range is hard formatted
ConvertCellCurrencies(oRange)
CurCellCount = CountRangeCells(oRange)
End If
IncreaseStatusvalue((CurCellCount/TotCellCount)*(95-OldStatusValue))
If bDeSelect Then
&apos; 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) = &quot;&quot;
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 &lt;&gt; -1 Then
AssignString = StyleRangeAssignmentList(n)
RangeString = FindPartString(AssignString,&quot;&lt;RANGES&gt;&quot;, &quot;&lt;/RANGES&gt;&quot;,1)
If RangeString &lt;&gt; &quot;&quot; Then
StyleRangeList() = ArrayoutofString(RangeString,&quot;,&quot;)
End If
End If
GetAssignedRanges() = StyleRangeList()
End Function</script:module>

View 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(&quot;com.sun.star.text.Paragraph&quot;) Then
&apos; Note: As cells might be splitted or merged
&apos; you cannot refer to them via their indices
sCellNames = oPara.CellNames
For i = 0 To Ubound(sCellNames)
If sCellNames(i) &lt;&gt; &quot;&quot; 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(&quot;NumberFormat&quot;) Then
If CheckFormatType(oTextField) Then
If oTextField.PropertySetInfo.HasPropertybyName(&quot;Value&quot;) Then
If Not oTextField.SupportsService(&quot;com.sun.star.text.TextField.GetExpression&quot;) Then
oTextField.Content = CStr(Round(oTextField.Value/CurrFactor,2))
End If
ElseIf oTextField.TextFieldMaster.PropertySetInfo.HasPropertyByName(&quot;Value&quot;) 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>

View 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>

View 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>

View 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
&apos;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
&apos; If bStartUp Then
&apos; bStartUp = false
&apos; Exit Sub
&apos; End Sub
ToggleDatabasePage(False)
With DialogModel
If GetConnection(sDBName) Then
If GetDBMetaData() Then
LocList() = AddListToList(Array(sSelectDBTable), TableNames())
.lstTables.StringItemList() = AddListToList(LocList(), QueryNames())
&apos; bSelectContent = True
.lstTables.SelectedItems() = Array(0)
iCommandTypes() = CreateCommandTypeList()
EmptyFieldsListboxes()
End If
End If
bEnableBinaryOptionGroup = False
.lstTables.Enabled = True
.lblTables.Enabled = True
&apos; Else
&apos; DialogModel.lstTables.StringItemList = Array(sSelectDBTable)
&apos; EmptyFieldsListboxes()
&apos; 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)
&apos; If Not oDBContext.hasbyName(sDBName) Then
&apos; GetConnection() = False
&apos; Exit Function
&apos; End If
If Not oDataSource.IsPasswordRequired Then
oDBConnection = oDBContext.GetByName(sDBName).GetConnection(&quot;&quot;,&quot;&quot;)
GetConnection() = True
Else
oInteractionHandler = createUnoService(&quot;com.sun.star.task.InteractionHandler&quot;)
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()
&apos; Build a structure which maps the position of a selected field (within the selection) to the the column position within
&apos; 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&lt; 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
&apos; If oField.Description &lt;&gt; &quot;&quot; Then
&apos;&apos; Todo: What&apos;s wrong with this line?
&apos; Msgbox oField.Helptext
&apos; 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()) &gt; -1 Then
FieldNames() = oColumns.GetElementNames()
MaxIndex = Ubound(FieldNames())
If MaxIndex &lt;&gt; -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) &lt;&gt; -1 Then
ResultFieldNames(m) = FieldNames(n)
m = m + 1
End If
If GetIndexInMultiArray(ImgWidthList(), iType, 0) &lt;&gt; -1 Then
ImgFieldNames(s) = FieldNames(n)
s = s + 1
End If
Next n
If s &lt;&gt; 0 Then
Redim Preserve ImgFieldNames(s-1)
bEnableBinaryOptionGroup = True
Else
bEnableBinaryOptionGroup = False
End If
If (DialogModel.optBinariesasGraphics.State = 1) And (s &lt;&gt; 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(&quot;com.sun.star.form.component.Form&quot;)
oDrawpage.Forms.InsertByIndex (0, oDBForm)
Else
oDBForm = oDrawPage.Forms.GetByIndex(0)
End If
oDBForm.Name = &quot;Standard&quot;
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 &lt;&gt; 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 &gt; -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 &gt;= 65535 Then
AssignFieldLength() = -1
Else
AssignFieldLength() = FieldLength
End If
End Function
</script:module>

View File

@@ -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&amp;location=application" script:language="Script"/>
<script:event script:event-name="on-mousedown" script:macro-name="vnd.sun.star.script:FormWizard.FormWizard.DeleteFirstTableListBoxEntry?language=Basic&amp;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&amp;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&amp;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="-&gt;">
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:Tools.Listbox.FormMoveSelected?language=Basic&amp;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="=&gt;&gt;">
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:Tools.Listbox.FormMoveAll?language=Basic&amp;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="&lt;-">
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:Tools.Listbox.FormRemoveSelected?language=Basic&amp;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="&lt;&lt;=">
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:Tools.Listbox.FormRemoveAll?language=Basic&amp;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&amp;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&amp;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&amp;location=application" script:language="Script"/>
<script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.script:Tools.Listbox.FormSetMoveRights?language=Basic&amp;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&amp;location=application" script:language="Script"/>
<script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.script:Tools.Listbox.FormSetMoveRights?language=Basic&amp;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&amp;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&amp;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&amp;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&amp;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&amp;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&amp;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&amp;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&amp;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&amp;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&amp;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&amp;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&amp;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&amp;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>

View File

@@ -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 = &quot;The quick brown fox jumps over the lazy dog. The quick brown fox jumps over the lazy dog.&quot;
Public bDisposeDoc as Boolean
Public bDebug as Boolean
&apos;Public bStartUp as Boolean
Public bConnectionIsovergiven as Boolean
Public FormName As String
Public sFormUrl as String
Public oFormDocuments
&apos; The macro can be called in 4 possible scenarios:
&apos; Scenario 1. No parameters at given
&apos; Scenario 2: Only Datasourcename is given, but no connection and no Content
&apos; Scenario 3: a data source and a connection are given
&apos; Scenario 4: all parameters (data source name, connection, object type and object) are given
Sub Main()
Dim oLocDBContext as Object
Dim oLocConnection as Object
&apos; Scenario 1. No parameters at given
MainWithDefault()
&apos; Scenario 2: Only Datasourcename is given, but no connection and no Content
&apos; MainWithDefault(&quot;Bibliography&quot;)
&apos; Scenario 3: a data source and a connection are given
&apos; oLocDBContext = CreateUnoService(&quot;com.sun.star.sdb.DatabaseContext&quot;)
&apos; oLocConnection = oLocDBContext.GetByName(&quot;Bibliography&quot;).GetConnection(&quot;&quot;,&quot;&quot;)
&apos; MainWithDefault(&quot;Bibliography&quot;, oLocConnection)
&apos; Scenario 4: all parameters (data source name, connection, object type and object) are given
&apos; oLocDBContext = CreateUnoService(&quot;com.sun.star.sdb.DatabaseContext&quot;)
&apos; oLocConnection = oLocDBContext.GetByName(&quot;Bibliography&quot;).GetConnection(&quot;&quot;,&quot;&quot;)
&apos; MainWithDefault(&quot;Bibliography&quot;, oLocConnection, com.sun.star.sdb.CommandType.TABLE, &quot;biblio&quot;)
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(&quot;Tools&quot;)
BasicLibraries.LoadLibrary(&quot;WebWizard&quot;)
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(&quot;Formwizard&quot;,&quot;dbw&quot;) Then
Exit Sub
End If
oDBContext = CreateUnoService(&quot;com.sun.star.sdb.DatabaseContext&quot;)
oUcb = createUnoService(&quot;com.sun.star.ucb.SimpleFileAccess&quot;)
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, &quot;/stl&quot;)
CurIndex = GetCurIndex(DialogModel, Styles(), 2)
oProgressBar.Value = 40
ConfigurePageStyle()
oProgressBar.Value = 50
InitializeLabelValues()
bNeedFieldRefresh = True
SetDialogLanguage()
&apos; 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
&apos; 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
&apos; 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(&quot;lstTables&quot;).SelectItem(sContent, True)
Else
If CommandType = com.sun.star.sdb.CommandType.QUERY Then
SelIndex = IndexInArray(sContent, QueryNames()
DlgFormDB.GetControl(&quot;lstTables&quot;).SelectItemPos(SelIndex, True)
ElseIf CommandType = com.sun.star.sdb.CommandType.TABLE Then
SelIndex = IndexInArray(sContent, TableNames()
DlgFormDB.GetControl(&quot;lstTables&quot;).SelectItemPos(Ubound(QueryNames()+1 + SelIndex, True)
End If
End If
CurCommandType = CommandType
FillUpFieldsListbox(False)
Else
LocList() = AddListToList(Array(sSelectDBTable), LocList())
DialogModel.lstTables.StringItemList() = LocList()
&apos; bSelectContent = True
DialogModel.lstTables.SelectedItems() = Array(0)
End If
End If
Else
&apos; Scenario 2: Only Datasourcename is given, but no connection and no Content
GetSelectedDBMetaData(sDBName)
End If
Else
&apos; 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 &amp; &quot;FormWizard_1.bmp&quot;
DialogModel.imgTheme.BackGroundColor = RGB(0,60,126)
ToggleDatabasePage(True)
oProgressBar.Value = 100
DlgFormDB.GetControl(&quot;lstTables&quot;).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 &amp; &quot;_&quot; &amp; i
End If
Loop Until Not bLinkExists
aPropertyValues(0).Name = &quot;Name&quot;
aPropertyValues(0).Value = FormName
aPropertyValues(1).Name = &quot;Parent&quot;
aPropertyValues(1).Value = oFormDocuments()
aPropertyValues(2).Name = &quot;URL&quot;
aPropertyValues(2).Value = sFormUrl
Dim oDBDocument
oDBDocument = oFormDocuments.createInstanceWithArguments(&quot;com.sun.star.sdb.DocumentDefinition&quot;, 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 &lt;&gt; 0 Then
Msgbox(sMsgErrMsg, 16, GetProductName())
Resume LOCERROR
LOCERROR:
End If
End Sub
Sub FormGetFields()
Dim i as Integer
&apos; If bSelectContent Then
&apos; bSelectContent = False
&apos; Exit Sub
&apos; End If
DeleteFirstListBoxEntry(&quot;lstTables&quot;, 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(&quot;lstTables&quot;).getSelectedItemPos() &apos;.SelectedItems())
If SelIndex &gt; -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() &lt;&gt; -1 Then
ToggleListboxControls(DialogModel, True)
Exit Sub
End If
End If
EmptyFieldsListboxes()
NOFIELDS:
If Err &lt;&gt; 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 &amp; &quot;FormWizard_1.bmp&quot;
End With
FormSetMoveRights()
WIZARDERROR:
If Err &lt;&gt; 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 &amp; &quot;FormWizard_&quot; &amp; DialogModel.Step &amp; &quot;.bmp&quot;
DlgFormDB.Title = WizardTitle(DialogModel.Step)
WIZARDERROR:
If Err &lt;&gt; 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 &lt;&gt; 0 Then
DlgFormDB.GetControl(&quot;optAlign2&quot;).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()) &lt;&gt; -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
&apos; This Sub is called from the Procedure &quot;StoreDocument&quot; in the &quot;Tools&quot; 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 &amp; &quot;_&quot; &amp; 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 = &quot;Form_&quot; &amp; sDBName &amp; &quot;_&quot; &amp; TableName &amp; &quot;.sxw&quot;
sFormUrl = TempPath &amp; &quot;/&quot; &amp; 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(&quot;org.openoffice.TypeDetection.Types/&quot;)
oTypes() = oMasterKey.Types
TypeNames(0,0) = GetFilterName(&quot;StarOffice XML (Writer)&quot;)
TypeNames(0,1) = &quot;*.sxw&quot;
TypeNames(0,2) = &quot;&quot;
StoreFormInDatabase()
&apos; sTargetPath = StoreDocument(oDocument, TypeNames(), &quot;Form_&quot; &amp; sDBName &amp; &quot;_&quot; &amp; TableName &amp; &quot;.sxw&quot;, 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(&quot;lstTables&quot;, 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 &gt; 0 Then
oListBox.selectItemPos(iSelPos-1, True)
End If
End If
End Sub
</script:module>

View 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)
&apos; 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(&quot;FormWizard&quot;, &quot;DlgFormDB&quot;)
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 &amp; &quot; - &quot; &amp; GetResText(RID_FORM + 45)
WizardTitle(2) = sMsgWizardName &amp; &quot; - &quot; &amp; GetResText(RID_FORM + 46)
WizardTitle(3) = sMsgWizardName &amp; &quot; - &quot; &amp; 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 = &quot;&quot;
If isHighContrast(DlgFormDB.getPeer) Then FNameAddOn = &quot;_hc&quot;
IDArray = Array(36, 37, 40, 38, 39)
For i = 1 To 5
ButtonHelpText = GetResText(RID_FORM + IDArray(i-1)
cmdButton = DlgFormDB.getControl(&quot;cmdArrange&quot; &amp; i)
cmdButton.Model.ImageURL = FormPath &amp; &quot;Arrange_&quot; &amp; i &amp; FNameAddOn &amp; &quot;.gif&quot;
cmdButton.Model.HelpText = ButtonHelpText
cmdButton.getPeer().setProperty(&quot;AccessibleName&quot;, ButtonHelpText)
Next i
&apos; .cmdArrange1.ImageURL = FormPath &amp; &quot;Arrange_1&quot; &amp; FNameAddOn &amp; &quot;.gif&quot;
&apos; .cmdArrange1.HelpText = GetResText(RID_FORM + 36)
&apos;
&apos; .cmdArrange2.ImageURL = FormPath &amp; &quot;Arrange_2&quot; &amp; FNameAddOn &amp; &quot;.gif&quot;
&apos; .cmdArrange2.HelpText = GetResText(RID_FORM + 37)
&apos;
&apos; .cmdArrange3.ImageURL = FormPath &amp; &quot;Arrange_3&quot; &amp; FNameAddOn &amp; &quot;.gif&quot;
&apos; .cmdArrange3.HelpText = GetResText(RID_FORM + 40)
&apos;
&apos; .cmdArrange4.ImageURL = FormPath &amp; &quot;Arrange_4&quot; &amp; FNameAddOn &amp; &quot;.gif&quot;
&apos; .cmdArrange4.HelpText = GetResText(RID_FORM + 38)
&apos;
&apos; .cmdArrange5.ImageURL = FormPath &amp; &quot;Arrange_5&quot; &amp; FNameAddOn &amp; &quot;.gif&quot;
&apos; .cmdArrange5.HelpText = GetResText(RID_FORM + 39)
sWriterFilterName = GetResText(RID_FORM + 70)
End With
DlgFormDB.GetControl(&quot;cmdMoveSelected&quot;).getPeer().setProperty(&quot;AccessibleName&quot;, GetResText(RID_COMMON + 39)
DlgFormDB.GetControl(&quot;cmdRemoveSelected&quot;).getPeer().setProperty(&quot;AccessibleName&quot;, GetResText(RID_COMMON + 40)
DlgFormDB.GetControl(&quot;cmdMoveAll&quot;).getPeer().setProperty(&quot;AccessibleName&quot;, GetResText(RID_COMMON + 41)
DlgFormDB.GetControl(&quot;cmdRemoveAll&quot;).getPeer().setProperty(&quot;AccessibleName&quot;, GetResText(RID_COMMON + 42)
DlgFormDB.getControl(&quot;lstFields&quot;).getPeer().setProperty(&quot;AccessibleName&quot;, DeleteStr(slblFields, &quot;~&quot;))
DlgFormDB.getControl(&quot;lstSelFields&quot;).getPeer().setProperty(&quot;AccessibleName&quot;, DeleteStr(slblSelFields, &quot;~&quot;))
sSelectDatasource = GetResText(RID_COMMON + 37)
sSelectDBTable = GetResText(RID_COMMON + 38)
End Sub
Sub InitializeWidthList()
If Ubound(WidthList(),1) &gt; 16 Then
ReDim WidthList(16,4)
End If
WidthList(0,0) = com.sun.star.sdbc.DataType.BIT &apos; = -7;
WidthList(0,1) = cCheckbox
WidthList(0,2) = False
WidthList(0,3) = &quot;CheckBox&quot;
WidthList(1,0) = com.sun.star.sdbc.DataType.TINYINT &apos; = -6;
WidthList(1,1) = cNumericBox
WidthList(1,2) = False
WidthList(1,3) = &quot;FormattedField&quot;
WidthList(2,0) = com.sun.star.sdbc.DataType.SMALLINT &apos; = 5;
WidthList(2,1) = cNumericBox
WidthList(2,2) = False
WidthList(2,3) = &quot;FormattedField&quot;
WidthList(3,0) = com.sun.star.sdbc.DataType.INTEGER &apos; = 4;
WidthList(3,1) = cNumericBox
WidthList(3,2) = False
WidthList(3,3) = &quot;FormattedField&quot;
WidthList(4,0) = com.sun.star.sdbc.DataType.BIGINT &apos; = -5;
WidthList(4,1) = cNumericBox
WidthList(4,2) = False
WidthList(4,3) = &quot;FormattedField&quot;
WidthList(5,0) = com.sun.star.sdbc.DataType.FLOAT &apos; = 6;
WidthList(5,1) = cNumericBox
WidthList(5,2) = False
WidthList(5,3) = &quot;FormattedField&quot;
WidthList(6,0) = com.sun.star.sdbc.DataType.REAL &apos; = 7;
WidthList(6,1) = cNumericBox
WidthList(6,2) = False
WidthList(6,3) = &quot;FormattedField&quot;
WidthList(7,0) = com.sun.star.sdbc.DataType.DOUBLE &apos; = 8;
WidthList(7,1) = cNumericBox
WidthList(7,2) = False
WidthList(7,3) = &quot;FormattedField&quot;
WidthList(8,0) = com.sun.star.sdbc.DataType.NUMERIC &apos; = 2;
WidthList(8,1) = cNumericBox
WidthList(8,2) = False
WidthList(8,3) = &quot;FormattedField&quot;
WidthList(9,0) = com.sun.star.sdbc.DataType.DECIMAL &apos; = 3; (including decimal places)
WidthList(9,1) = cNumericBox
WidthList(9,2) = False
WidthList(9,3) = &quot;FormattedField&quot;
WidthList(10,0) = com.sun.star.sdbc.DataType.CHAR &apos; = 1;
WidthList(10,1) = cTextBox
WidthList(10,2) = False
WidthList(10,3) = &quot;TextField&quot;
WidthList(11,0) = com.sun.star.sdbc.DataType.VARCHAR &apos; = 12;
WidthList(11,1) = cTextBox
WidthList(11,2) = True
WidthList(11,3) = &quot;TextField&quot;
WidthList(12,0) = com.sun.star.sdbc.DataType.LONGVARCHAR &apos; = -1;
WidthList(12,1) = cTextBox
WidthList(12,2) = True
WidthList(12,3) = &quot;TextField&quot;
WidthList(13,0) = com.sun.star.sdbc.DataType.DATE &apos; = 91;
WidthList(13,1) = cDateBox
WidthList(13,2) = False
WidthList(13,3) = &quot;DateField&quot;
WidthList(14,0) = com.sun.star.sdbc.DataType.TIME &apos; = 92;
WidthList(14,1) = cTimeBox
WidthList(14,2) = False
WidthList(14,3) = &quot;TimeField&quot;
WidthList(15,0) = com.sun.star.sdbc.DataType.TIMESTAMP &apos; = 93;
WidthList(15,1) = cDateBox
WidthList(15,2) = False
WidthList(15,3) = &quot;DateField&quot;
WidthList(16,0) = com.sun.star.sdbc.DataType.BOOLEAN &apos; = 16;
WidthList(16,1) = cCheckbox
WidthList(16,2) = False
WidthList(16,3) = &quot;CheckBox&quot;
ImgWidthList(0,0) = com.sun.star.sdbc.DataType.BINARY &apos; = -2;
ImgWidthList(0,1) = cImageControl
ImgWidthList(0,2) = False
ImgWidthList(0,3) = &quot;ImageControl&quot;
ImgWidthList(1,0) = com.sun.star.sdbc.DataType.VARBINARY &apos; = -3;
ImgWidthList(1,1) = cImageControl
ImgWidthList(1,2) = False
ImgWidthList(1,3) = &quot;ImageControl&quot;
ImgWidthList(2,0) = com.sun.star.sdbc.DataType.LONGVARBINARY &apos; = -4;
ImgWidthList(2,1) = cImageControl
ImgWidthList(2,2) = False
ImgWidthList(2,3) = &quot;ImageControl&quot;
ImgWidthList(3,0) = com.sun.star.sdbc.DataType.BLOB &apos; = 2004;
ImgWidthList(3,1) = cImageControl
ImgWidthList(3,2) = False
ImgWidthList(3,3) = &quot;ImageControl&quot;
&apos; Note: the following Fieldtypes are ignored
&apos;ExcludeList(0) = com.sun.star.sdbc.DataType.SQLNULL
&apos;ExcludeList(1) = com.sun.star.sdbc.DataType.OTHER
&apos;ExcludeList(2) = com.sun.star.sdbc.DataType.OBJECT
&apos;ExcludeList(3) = com.sun.star.sdbc.DataType.DISTINCT
&apos;ExcludeList(4) = com.sun.star.sdbc.DataType.STRUCT
&apos;ExcludeList(5) = com.sun.star.sdbc.DataType.ARRAY
&apos;ExcludeList(6) = com.sun.star.sdbc.DataType.CLOB
&apos;ExcludeList(7) = com.sun.star.sdbc.DataType.REF
oModelService(cLabel) = &quot;com.sun.star.form.component.FixedText&quot;
oModelService(cTextBox) = &quot;com.sun.star.form.component.TextField&quot;
oModelService(cCheckBox) = &quot;com.sun.star.form.component.CheckBox&quot;
oModelService(cDateBox) = &quot;com.sun.star.form.component.DateField&quot;
oModelService(cTimeBox) = &quot;com.sun.star.form.component.TimeField&quot;
oModelService(cNumericBox) = &quot;com.sun.star.form.component.FormattedField&quot;
oModelService(cGridControl) = &quot;com.sun.star.form.component.GridControl&quot;
oModelService(cImageControl) = &quot;com.sun.star.form.component.DatabaseImageControl&quot;
End Sub
</script:module>

View 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
&apos; 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)
&apos; Description of this List:
&apos; CurFieldType = FieldMetaValues(Index,0)
&apos; CurFieldLength = FieldMetaValues(Index,1)
&apos; CurControlType = FieldMetaValues(Index,2) (ControlType eg. cLabel, cTextbox usw.)
&apos; CurControlName = FieldMetaValues(Index,3)
&apos; CurFormatKey = FieldMetaValues(Index,4)
&apos; CurDefaultValue = FieldMetaValues(Index,5)
&apos; CurIsCurrency = FieldMetaValues(Index,6)
&apos; CurScale = FieldMetaValues(Index,7)
&apos; 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 (&quot;com.sun.star.drawing.ControlShape&quot;)
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(&quot;&quot;, MaxIndex)
If oDBForm.HasbyName(&quot;Grid1&quot;) 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(&quot;swriter&quot;)
oProgressbar = oDocument.GetCurrentController.GetFrame.CreateStatusIndicator()
oProgressbar.Start(&quot;&quot;, 100)
oDocument.ApplyFormDesignMode = False
oController = oDocument.GetCurrentController
oViewSettings = oDocument.CurrentController.ViewSettings
oViewSettings.ShowTableBoundaries = False
oViewSettings.ShowOnlineLayout = True
oDrawPage = oDocument.DrawPage
oPageStyle = oDocument.StyleFamilies.GetByName(&quot;PageStyles&quot;).GetByName(&quot;Standard&quot;)
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(&quot;com.sun.star.form.component.FixedText&quot;)
oTBModel = CreateUnoService(&quot;com.sun.star.form.component.TextField&quot;)
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, &quot;The quick brown fox...&quot;)
nTCHeight = (aLabelSize.Height+1) * YPixelFactor
aTBSize = GetPeerSize(oTBModel, oLocControl, &quot;The quick brown fox...&quot;)
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
&apos; 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 &lt;&gt; CurBorderType Then
For i = 0 To MaxIndex
If oDBShapeList(i).SupportsService(&quot;com.sun.star.drawing.GroupShape&quot;) Then
oGroupShape = oDBShapeList(i)
For s = 0 To oGroupShape.Count-1
oGroupShape(s).Control.Border = CurBorderType
Next s
Else
If oDBModelList(i).PropertySetInfo.HasPropertyByName(&quot;Border&quot;) Then
oDBModelList(i).Border = CurBorderType
End If
End If
Next i
End If
End If
ToggleLayoutPage(True)
WIZARDERROR:
If Err &lt;&gt; 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 &lt;&gt; 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 &lt;&gt; 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(&quot;cmdArrange&quot; &amp; OldArrangement).Model.State = 0
If CurArrangement &lt;&gt; OldArrangement Then
ArrangeControls()
Select Case CurArrangement
Case cTabled
ToggleBorderGroup(False)
ToggleAlignGroup(False)
Case Else &apos; 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 &lt;&gt; 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 &apos; 0: No border
.optBorder1.Enabled = bDoEnable &apos; 1: 3D border
.optBorder2.Enabled = bDoEnable &apos; 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 = &quot;com.sun.star.drawing.ControlShape&quot; Then
oShape.Dispose()
End If
Next i
End Sub
Sub SwitchArrangementButtons(ByVal LocArrangement as Integer)
OldArrangement = CurArrangement
CurArrangement = LocArrangement
If OldArrangement &lt;&gt; 0 Then
DlgFormDB.GetControl(&quot;cmdArrange&quot; &amp; OldArrangement).Model.State = 0
End If
DlgFormDB.GetControl(&quot;cmdArrange&quot; &amp; 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>

File diff suppressed because it is too large Load Diff

View File

@@ -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>

View File

@@ -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>

View 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
&apos; Label
aPeerSize = GetPeerSize(oModel, oControl, LocText)
ElseIf CurControlType = cImageControl Then
GetPreferredWidth() = 2000
Exit Function
Else
aPeerSize = GetPeerSize(oModel, oControl)
End If
nWidth = aPeerSize.Width
&apos; We increase the preferred Width a bit so that the control does not become too small
&apos; when we change the border from &quot;3D&quot; to &quot;Flat&quot;
GetPreferredWidth = (nWidth + 10) * XPixelFactor &apos; 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
&apos; Label
aPeerSize = GetPeerSize(oModel, oControl, LocText)
ElseIf CurControlType = cImageControl Then
GetPreferredHeight() = 2000
Exit Function
Else
aPeerSize = GetPeerSize(oModel, oControl)
End If
nHeight = aPeerSize.Height
&apos; We increase the preferred Height a bit so that the control does not become too small
&apos; when we change the border from &quot;3D&quot; to &quot;Flat&quot;
GetPreferredHeight = (nHeight+1) * YPixelFactor &apos; 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(&quot;EffectiveMax&quot;) Then
If oControl.Model.EffectiveMax = 0 Then
&apos; 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 &gt; SBMAXTEXTSIZE Then
oControl.Text = Mid(SBSIZETEXT,1, SBMAXTEXTSIZE)
Else
oControl.Text = Mid(SBSIZETEXT,1, oControl.MaxTextLen)
End If
GetPeerSize() = oPeer.PreferredSize()
oControl.Text = &quot;&quot;
End If
End Function
Function TwipToCM(BYVAL nValue as long) as String
TwipToCM = trim(str(nValue / 567)) + &quot;cm&quot;
End function
Function TwipTo100telMM(BYVAL nValue as long) as long
TwipTo100telMM = nValue / 0.567
End function
Function TwipToPixel(BYVAL nValue as long) as long &apos; 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)
&apos; PixelTo100thMM = nValue * 28 &apos; not an exact calculation
End function
Function PixelTo100thMMY(oControl as Object) as long
oPeer = oControl.GetPeer()
PixelTo100mmX = Clng(Peer.GetInfo.PixelPerMeterY/100000)
&apos; PixelTo100thMM = nValue * 28 &apos; 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 &lt;&gt; OldIndex Then
ToggleLayoutPage(False)
Dim sImportPath as String
sImportPath = Styles(CurIndex, 8)
bWithBackGraphic = LoadNewStyles(oDocument, DialogModel, CurIndex, sImportPath, Styles(), TexturePath)
ControlCaptionsToStandardLayout()
ToggleLayoutPage(True, &quot;lstStyles&quot;)
End If
WIZARDERROR:
If Err &lt;&gt; 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)
&apos; 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
&apos;Todo: oLocObject.DecimalAccuracy = ...
oLocObject.EffectiveDefault = CurDefaultValue
&apos; Todo: HelpText???
End Select
If oLocObject.PropertySetinfo.HasPropertyByName(&quot;Width&quot;)Then &apos; Note: an Access AutoincrementField does not provide this property Width
oLocObject.Width = CurFieldLength + CurScale + 1
End If
If CurIsCurrency Then
&apos;Todo: How do you set currencies?
End If
ElseIf CurControlType = cTextBox Then &apos;com.sun.star.sdbc.DataType.CHAR, com.sun.star.sdbc.DataType.VARCHAR, com.sun.star.sdbc.DataType.LONGVARCHAR
If CurFieldLength = 0 Then &apos;Or oLocObject.MaxTextLen &gt; SBMAXTEXTSIZE
oLocObject.MaxTextLen = SBMAXTEXTSIZE
CurFieldLength = SBMAXTEXTSIZE
Else
oLocObject.MaxTextLen = CurFieldLength
End If
oLocObject.DefaultText = CurDefaultValue
ElseIf CurControlType = cDateBox Then
&apos; Todo Why does this not work?: oLocObject.DefaultDate = CurDefaultValue
ElseIf CurControlType = cTimeBox Then &apos; com.sun.star.sdbc.DataType.DATE, com.sun.star.sdbc.DataType.TIME
oLocObject.DefaultTime = CurDefaultValue
&apos; Todo: Property TimeFormat? frome where?
ElseIf CurControlType = cCheckBox Then
&apos; Todo Why does this not work?: oLocObject.DefautState = CurDefaultValue
End If
If oLocObject.PropertySetInfo.HasPropertybyName(&quot;FormatKey&quot;) Then
On Local Error Resume Next
oLocObject.FormatKey = CurFormatKey
End If
End Function
&apos; 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 &gt; -2000 Then
oDrawPage.Remove(oShape)
End If
Next n
End Sub
&apos; 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 &lt; -2000 Then
oDrawPage.Remove(oShape)
End If
Next n
End Sub
&apos; Note: as Shapes cannot be removed from the DrawPage without destroying
&apos; 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 &amp; 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(&quot;Template&quot;,&quot;../wizard/bitmap&quot;)
If FormPath &lt;&gt; &quot;&quot; Then
WebWizardPath = GetOfficeSubPath(&quot;Template&quot;,&quot;wizard/web&quot;)
If WebWizardPath &lt;&gt; &quot;&quot; Then
WizardPath = GetOfficeSubPath(&quot;Template&quot;,&quot;wizard/&quot;)
If Wizardpath &lt;&gt; &quot;&quot; Then
TexturePath = GetOfficeSubPath(&quot;Gallery&quot;, &quot;www-back/&quot;)
If TexturePath &lt;&gt; &quot;&quot; Then
WorkPath = GetPathSettings(&quot;Work&quot;)
If WorkPath &lt;&gt; &quot;&quot; Then
TempPath = GetPathSettings(&quot;Temp&quot;)
If TempPath &lt;&gt; &quot;&quot; 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(&quot;com.sun.star.document.FilterFactory&quot;)
oArgs() = oFactory.getByName(sApplicationKey)
MaxIndex = Ubound(oArgs())
For i = 0 to MaxIndex
If (oArgs(i).Name=&quot;UIName&quot;) Then
UIName = oArgs(i).Value
Exit For
End If
next i
GetFilterName() = UIName
End Function
</script:module>

View 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">&apos; 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(&quot;Tools&quot;)
sDocumentTitle = &quot;Installed AutoTexts&quot;
&apos; Open a new empty document
oDocument = CreateNewDocument(&quot;swriter&quot;)
If Not IsNull(oDocument) Then
oDocument.DocumentProperties.Title = sDocumentTitle
oDocuText = oDocument.Text
&apos; Create The Character-templates
oCharStyles = oDocument.StyleFamilies.GetByName(&quot;CharacterStyles&quot;)
&apos; The Characterstyle for the Header that describes the Title of Autotextgroups
oGroupTitleStyle = oDocument.createInstance(&quot;com.sun.star.style.CharacterStyle&quot;)
oCharStyles.InsertbyName(&quot;AutoTextGroupTitle&quot;, oGroupTitleStyle)
oGroupTitleStyle.CharWeight = com.sun.star.awt.FontWeight.BOLD
oGroupTitleStyle.CharHeight = 14
&apos; The Characterstyle for the Header that describes the Title of Autotextgroups
oHeaderStyle = oDocument.createInstance(&quot;com.sun.star.style.CharacterStyle&quot;)
oCharStyles.InsertbyName(&quot;AutoTextHeading&quot;, oHeaderStyle)
oHeaderStyle.CharWeight = com.sun.star.awt.FontWeight.BOLD
&apos; &quot;Ordinary&quot; Table Content
oContentStyle = oDocument.createInstance(&quot;com.sun.star.style.CharacterStyle&quot;)
oCharStyles.InsertbyName(&quot;TableContent&quot;, oContentStyle)
oAutoTextContainer = CreateUnoService(&quot;com.sun.star.text.AutoTextContainer&quot;)
oAutoTextCursor = oDocuText.CreateTextCursor()
oAutoTextCursor.CharStyleName = &quot;AutoTextGroupTitle&quot;
&apos; 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(&quot;com.sun.star.text.TextTable&quot;)
&apos; Divide the table if necessary
oTable.Split = True
&apos; oTable.KeepTogether = False
oTable.RepeatHeadLine = True
oAutoTextCursor.Text.InsertTextContent(oAutoTextCursor,oTable,False)
InsertStringToCell(&quot;AutoText Name&quot;,oTable.GetCellbyPosition(0,0), &quot;AutoTextHeading&quot;)
InsertStringToCell(&quot;AutoText Shortcut&quot;,oTable.GetCellbyPosition(1,0), &quot;AutoTextHeading&quot;)
&apos; Insert one row at the bottom of the table
oRows = oTable.Rows
iAutoCount = oAutoGroup.Count
For m = 0 To iAutoCount-1
&apos; Insert the name and the title of all Autotexts
oAutoText = oAutoGroup.GetByIndex(m)
InsertStringToCell(oAutoGroup.Titles(m), oTable.GetCellbyPosition(0, m + 1), &quot;TableContent&quot;)
InsertStringToCell(oAutoGroup.ElementNames(m), oTable.GetCellbyPosition(1, m + 1), &quot;TableContent&quot;)
If m &lt; 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>

View File

@@ -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">&apos; This macro replaces all characters in a writer-documet through &quot;x&quot; or &quot;X&quot; signs.
&apos; It works on the currently activated document.
Private const UPPERREPLACECHAR = &quot;X&quot;
Private const LOWERREPLACECHAR = &quot;x&quot;
Private MSGBOXTITLE
Private NOTSAVEDTEXT
Private WARNING
Sub ChangeAllChars &apos; 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(&quot;Tools&quot;)
MSGBOXTITLE = &quot;Change All Characters to an &apos;&quot; &amp; UPPERREPLACECHAR &amp; &quot;&apos;&quot;
NOTSAVEDTEXT = &quot;This document has already been modified: All characters will be changed to an &quot; &amp; UPPERREPLACECHAR &amp; &quot;&apos;. Should the document be saved now?&quot;
WARNING = &quot;This macro changes all characters and numbers to an &apos;&quot; &amp; UPPERREPLACECHAR &amp; &quot;&apos; in this document.&quot;
On Local Error GoTo NODOCUMENT
oDocument = StarDesktop.ActiveFrame.Controller.Model
NODOCUMENT:
If Err &lt;&gt; 0 Then
Msgbox(WARNING &amp; chr(13) &amp; &quot;First, activate a Writer document.&quot; , 16, GetProductName())
Exit Sub
End If
On Local Error Goto 0
sDocType = GetDocumentType(oDocument)
If oDocument.IsModified And oDocument.Url &lt;&gt; &quot;&quot; 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 &apos; No, Abort
End
End If
End If
Select Case sDocType
Case &quot;swriter&quot;
ReplaceAllStrings(oDocument)
Case Else
Msgbox(&quot;This macro only works with Writer documents.&quot;, 16, GetProductName())
End Select
End Sub
Sub ReplaceAllStrings(oContainer as Object)
ReplaceStrings(oContainer, &quot;[a-z]&quot;, LOWERREPLACECHAR)
ReplaceStrings(oContainer, &quot;[à-þ]&quot;, LOWERREPLACECHAR)
ReplaceStrings(oContainer, &quot;[A-Z]&quot;, UPPERREPLACECHAR)
ReplaceStrings(oContainer, &quot;[À-ß]&quot;, UPPERREPLACECHAR)
ReplaceStrings(oContainer, &quot;[0-9]&quot;, 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>

File diff suppressed because it is too large Load Diff

View 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
&apos; 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(&quot;Tools&quot;)
oDocument = CreateNewDocument(&quot;sdraw&quot;)
If Not IsNull(oDocument) Then
oPage = oDocument.DrawPages(0)
oStandardTemplate = oDocument.StyleFamilies.GetByName(&quot;graphics&quot;).GetByName(&quot;standard&quot;)
oStandardTemplate.CharHeight = 10
oStandardTemplate.TextLeftDistance = 100
oStandardTemplate.TextRightDistance = 100
oStandardTemplate.TextUpperDistance = 50
oStandardTemplate.TextLowerDistance = 50
DlgReadDir = LoadDialog(&quot;Gimmicks&quot;,&quot;ReadFolderDlg&quot;)
oProgressBar = DlgReadDir.Model.ProgressBar1
DlgReadDir.Model.TextField1.Text = ConvertFromUrl(GetPathSettings(&quot;Work&quot;))
DlgReadDir.Model.cmdGoOn.DefaultButton = True
DlgReadDir.GetControl(&quot;TextField1&quot;).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, &quot;/&quot;, 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
&apos; The Current TextShape has To be connected with a TextShape one Level higher
&apos; except for a TextShape In Level 0:
If Not bStartUpRun Then
&apos; A leaving Line Is only drawn when level is not 0
If iCurLevel&lt;&gt; 0 Then
&apos; 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)
&apos; 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
&apos; On Level 0 the last Leaving Line&apos;s Endpoint is the upper edge of the TextShape
iLevelPos(nConnectLevel,SBNEWENDY) = oCurTextShape.Position.Y
iLevelPos(nConnectLevel,SBNEWENDX) = iLevelPos(nConnectLevel,SBNEWSTARTX)
End If
&apos; Draw the Connectors To the previous TextShapes
oOldLeavingLine = DrawLine(nConnectLevel, SBNEWSTARTX, SBNEWSTARTY, SBNEWENDX, SBNEWENDY, oPage)
Else
&apos; StartingPoint of the leaving Edge
bStartUpRun = FALSE
End If
&apos; 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
&apos; 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(&quot;com.sun.star.drawing.TextShape&quot;)
oTextShape.LineStyle = 1
oTextShape.Position = aPoint
oPage.add(oTextShape)
oTextShape.TextAutoGrowWidth = TRUE
oTextShape.TextAutoGrowHeight = TRUE
oTextShape.String = FileName
&apos; 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()
&apos; The current level Is lower than the Old one
If (iCurLevel&lt; nOldLevel) And (iCurLevel&lt;&gt; 0) Then
&apos; ClearArray(iLevelPos(),iCurLevel+1)
Elseif iCurLevel= 0 Then
iLevelPos(iCurLevel,SBBASEX) = SBPAGEX
&apos; The current level Is higher than the old one
Elseif iCurLevel&gt; 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(&quot;com.sun.star.drawing.LineShape&quot;)
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(&quot;com.sun.star.ucb.SimpleFileAccess&quot;)
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()) &lt;&gt; -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 &gt; 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 &gt; 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 &gt; (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, &quot;/&quot;, 1) - BaseLevel
If iCurLevel &lt;&gt; 0 Then
nConnectLevel = iCurLevel- 1
Else
nConnectLevel = iCurLevel
End If
If iCurLevel &gt; 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 &gt; 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>

View File

@@ -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&amp;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&amp;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&amp;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>

View File

@@ -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&amp;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&amp;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&amp;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 &lt;PRODUCTNAME&gt; 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&amp;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 &gt;&gt;">
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:Gimmicks.Userfields.StepToRecord?language=Basic&amp;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="&lt;&lt;Previous">
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:Gimmicks.Userfields.StepToRecord?language=Basic&amp;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&amp;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.&#x0a;The user data of several users may be stored in a single file in the directory &lt;ConfigDir&gt;. From there, you can select a particular user whose data is then the current user data in &lt;PRODUCTNAME&gt;." 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&amp;location=application" script:language="Script"/>
</dlg:button>
</dlg:bulletinboard>
</dlg:window>

View 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
&apos;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(&quot;Tools&quot;)
UserFieldDatatype(0,0) = &quot;COMPANY&quot;
UserFieldDatatype(0,1) = &quot;o&quot;
UserFieldDatatype(1,0) = &quot;FIRSTNAME&quot;
UserFieldDatatype(1,1) = &quot;givenname&quot;
UserFieldDatatype(2,0) = &quot;LASTNAME&quot;
UserFieldDatatype(2,1) = &quot;sn&quot;
UserFieldDatatype(3,0) = &quot;INITIALS&quot;
UserFieldDatatype(3,1) = &quot;initials&quot;
UserFieldDatatype(4,0) = &quot;STREET&quot;
UserFieldDatatype(4,1) = &quot;street&quot;
UserFieldDatatype(5,0) = &quot;COUNTRY&quot;
UserFieldDatatype(5,1) = &quot;c&quot;
UserFieldDatatype(6,0) = &quot;ZIP&quot;
UserFieldDatatype(6,1) = &quot;postalcode&quot;
UserFieldDatatype(7,0) = &quot;CITY&quot;
UserFieldDatatype(7,1) = &quot;l&quot;
UserFieldDatatype(8,0) = &quot;TITLE&quot;
UserFieldDatatype(8,1) = &quot;title&quot;
UserFieldDatatype(9,0) = &quot;POSITION&quot;
UserFieldDatatype(9,1) = &quot;position&quot;
UserFieldDatatype(10,0) = &quot;PHONE_HOME&quot;
UserFieldDatatype(10,1) = &quot;homephone&quot;
UserFieldDatatype(11,0) = &quot;PHONE_WORK&quot;
UserFieldDatatype(11,1) = &quot;telephonenumber&quot;
UserFieldDatatype(12,0) = &quot;FAX&quot;
UserFieldDatatype(12,1) = &quot;facsimiletelephonenumber&quot;
UserFieldDatatype(13,0) = &quot;E-MAIL&quot;
UserFieldDatatype(13,1) = &quot;mail&quot;
UserFieldDatatype(14,0) = &quot;STATE&quot;
UserFieldDatatype(14,1) = &quot;st&quot;
FilePath = GetPathSettings(&quot;Config&quot;, False) &amp; &quot;/&quot; &amp; &quot;UserData.dat&quot;
DlgUserFields = LoadDialog(&quot;Gimmicks&quot;,&quot;UserfieldDlg&quot;)
SystemPath = ConvertFromUrl(FilePath)
DlgUserFields.Model.Label10.Label = ReplaceString(DlgUserFields.Model.Label10.Label, &quot;&apos;&quot; &amp; SystemPath &amp; &quot;&apos;&quot;, &quot;&lt;ConfigDir&gt;&quot;)
DlgUserFields.Model.Label10.Label = ReplaceString(DlgUserFields.Model.Label10.Label, GetProductName(), &quot;&lt;PRODUCTNAME&gt;&quot;)
DlgUserFields.Model.cmdSelect.HelpText = ReplaceString(DlgUserFields.Model.cmdSelect.HelpText, GetProductName(), &quot;&lt;PRODUCTNAME&gt;&quot;)
ScrollBarValue = 0
oUserDataAccess = GetRegistryKeyContent(&quot;org.openoffice.UserProfile/Data&quot;, True)
InitializeUserFamily()
FillDialog()
DlgUserFields.Execute
DlgUserFields.Dispose()
End Sub
Sub FillDialog()
Dim a as Integer
With DlgUserFields
For a = 1 To SBTBCount
.GetControl(&quot;Label&quot; &amp; a).Model.Label = UserFieldDataType(a-1,0)
.GetControl(&quot;TextField&quot; &amp; 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) &gt;= 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(&quot;TextField&quot; &amp; 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) = &quot;&quot;
For m = 0 To SBMAXFIELDINDEX
FileStrings(n) = FileStrings(n) &amp; UserFieldFamily(n,m) &amp; &quot;;&quot;
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 &lt;&gt; Ubound(UserFieldFamily(), 1)
DlgUserFields.Model.cmdPrevUser.Enabled = CurFieldIndex &lt;&gt; 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(&quot;Config&quot;, False) &amp; &quot;/&quot; &amp; &quot;UserData.dat&quot;, UserFieldStrings())
If bFileExists Then
FirstIndex = Ubound(UserFieldStrings())
ReDim Preserve UserFieldFamily(FirstIndex, SBMAXFIELDINDEX) as String
For n = 0 To FirstIndex
LocStrings() = ArrayOutofString(UserFieldStrings(n), &quot;;&quot;)
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(&quot;TextField&quot; &amp; i).Model.Text = &quot;&quot;
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(&quot;Label&quot; &amp; a).Model.Label = UserFieldDataType(CurIndex,0)
DlgUserFields.GetControl(&quot;TextField&quot; &amp; 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 &lt; 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>

View 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="Gimmicks" library:readonly="false" library:passwordprotected="false">
<library:element library:name="UserfieldDlg"/>
<library:element library:name="ReadFolderDlg"/>
</library:library>

View File

@@ -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