summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBehrend Cornelius <bc@openoffice.org>2001-06-25 07:58:41 +0000
committerBehrend Cornelius <bc@openoffice.org>2001-06-25 07:58:41 +0000
commit96c943c6e3ecdb517893ef1b0472a288b01e8acb (patch)
treed8aa7e5844e2d3e697e9eb0b966d45a97a8e6fc8
parent8c6467719cf27b4d39a56b47785509dc6d566216 (diff)
#88694# Password routines improved, dynamic Arrays
-rw-r--r--wizards/source/euro/AutoPilotRun.xba184
-rw-r--r--wizards/source/euro/Common.xba101
-rw-r--r--wizards/source/euro/ConvertRun.xba190
-rw-r--r--wizards/source/euro/DlgConvert.xdl91
-rw-r--r--wizards/source/euro/DlgPassword.xdl20
-rw-r--r--wizards/source/euro/Hard.xba135
-rw-r--r--wizards/source/euro/Init.xba224
-rw-r--r--wizards/source/euro/Protect.xba170
-rw-r--r--wizards/source/euro/Soft.xba294
-rw-r--r--wizards/source/euro/Writer.xba2
10 files changed, 714 insertions, 697 deletions
diff --git a/wizards/source/euro/AutoPilotRun.xba b/wizards/source/euro/AutoPilotRun.xba
index 42e1df7e500c..bf233abaf7f5 100644
--- a/wizards/source/euro/AutoPilotRun.xba
+++ b/wizards/source/euro/AutoPilotRun.xba
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-
+<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="AutoPilotRun" script:language="StarBasic">Option Explicit
Public SourceDir as String
@@ -7,15 +7,12 @@ Public TargetDir as String
Public TargetStemDir as String
Public SourceFile as String
Public TargetFile as String
-Public EuroStyles(50) as String
-Public EuroBools(50) as Boolean
Public Source as String
Public SubstFile as String
Public SubstDir as String
Public NoArgs()
Public FilterList(6) as String
Public GoOn as Boolean
-Public UnprotectList(50,1) as String
Public DoUnprotect as Integer
Public Password as String
Public DocIndex as Integer
@@ -55,12 +52,12 @@ Dim FilesList()
SourceDir = Source
TargetStemDir = TargetDir
FilesList() = ReadDirectories(SourceDir, bRecursive, True, False, FilterList())
- TotDocCount = CInt(FilesList(0,0))
+ TotDocCount = Ubound(FilesList(),1) + 1
End If
InitializeProgressPage(DialogModel)
&apos; ChangeToNextProgressStep()
sTotDocCount = CStr(TotDocCount)
- For DocIndex = 1 To TotDocCount
+ For DocIndex = 0 To TotDocCount - 1
If InitializeDocument(FilesList()) Then
ConvertDocument()
DocDisposed = StoreDocument()
@@ -160,7 +157,6 @@ Sub SwapExtent()
End Sub
-
Sub SourceSearchDialog()
If DialogModel.optWholeDir.State = 1 Then
&apos;Konvertierung eines gesamten Verzeichnisses
@@ -172,129 +168,12 @@ Sub SourceSearchDialog()
End Sub
-
Sub TargetDirectorySearchDialog()
TargetDir = Application.FileDialog( &quot;P&quot;, sMsgTARGETDIR, DialogModel.txtTarget.Text )
DialogModel.txtTarget.Text = AssignFileName(TargetDir, DialogModel.LblTarget.Label,False)
End Sub
-Function UnprotectSheet(oListSheet as Object)
-Dim PWIsCorrect as Boolean
-&apos;Dim Password as String
-Dim QueryText as String
-Dim ListSheetName as String
-Dim OldDoUnprotect as Integer
-Dim sStatustext as String
- ListSheetName = oListSheet.Name
- If oListSheet.IsProtected Then
- OldDoUnprotect = DoUnprotect
- If DoUnprotect = 0 Then
- &apos; At First query if sheets shall generally be unprotected
- DoUnprotect = Msgbox(sMsgUNPROTECT,36,sMsgDLGTITLE)
- End If
- If DoUnprotect = 6 Then
- &apos;the answer is yes...
- &apos; Try to unprotect the sheet without a Password
- oListSheet.Unprotect(&quot;&quot;)
- If oListSheet.IsProtected Then
- &apos; Sheet is protected by a Password
- oDocument.CurrentController.SetActiveSheet(oListSheet)
-
- QueryText = ReplaceString(sMsgPWPROTECT,&quot;&apos;&quot; &amp; ListSheetName &amp; &quot;&apos;&quot;, &quot;%1TableName%1&quot;)
- &apos;&quot;Geben Sie das Kennwort zum Entschützen der Tabelle &apos;&quot; &amp; ListSheetName &amp; &quot; ein:&apos;&quot;
- Do
- InitializePasswordDialog(QueryText)
- If bCancelProtection Then
- bCancelProtection = False
- Msgbox (sMsgSHEETSNOPROTECT, 64, sMsgDLGTITLE)
- UnprotectSheet() = False &apos;&quot;Tabelle wird nicht entschützt!&quot;
- 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
- UnProtectSheet() = True
- Else
- &apos; The Sheet could be unprotected without a password
- AddSheettoUnprotectionlist(ListSheetName,&quot;&quot;)
- UnprotectSheet() = True
- End If
- Else
- &apos; The Answer is &apos;No&apos; (Tables shall not be unprotected)
- If OldDoUnprotect = 0 Then
- Msgbox (sMsgSHEETSNOPROTECT, 64, sMsgDLGTITLE)
- End If &apos;&quot;Tabellen werden nicht entschützt!&quot;
- Unprotectsheet() = False
- End If
- Else
- UnprotectSheet() = True
- End If
-End Function
-
-
-Sub InitializePasswordDialog(QueryText as String)
- With PasswordModel
- .Title = QueryText
- .frmPassword.Label = sMsgPASSWORD
- .cmdGoOn.Label = sMsgOK
- .cmdCancel.Label = sMsgCANCEL
- .cmdHelp.Label = sHELP
- End With
- DialogPassword.cmdGoOn.DefaultButton = True
- DialogPassword.Execute
-End Sub
-
-Sub ReadPassword()
- Password = DialogPW.TextBox1.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
- If Val(UnProtectList(0,0)) &gt; 0 Then
-&apos; oStatusline.SetText(sStsREPROTECT)
- For i = 1 To Val(UnProtectList(0,0))
- oProtectSheet = oSheets.GetbyName(UnProtectList(i,0)
- If Not oProtectSheet.IsProtected Then
- oProtectSheet.Protect(UnProtectList(i,1))
- End If
- UnprotectList(i,0) = &quot;&quot;
- UnprotectList(i,1) = &quot;&quot;
- Next i
- End If
- UnprotectList(0,0) = &quot;&quot;
-End Sub
-
-
-&apos; Add a Sheet to the list of sheets that finally have to be
-&apos; unprotected
-Sub AddSheettoUnprotectionlist(ListSheetName,Password)
- UnprotectList(Int(UnProtectList(0,0))+ 1,0) = ListSheetName
- UnprotectList(Int(UnProtectList(0,0))+ 1,1) = Password
- &apos; The first Field contains the highest Index of the list
- &apos; and therefor has to be incremented
- UnprotectList(0,0) = Str(Val(UnProtectList(0,0)) + 1)
-End Sub
-
-
Sub HelperDialog()
&apos;Todo: The String &quot;start&quot; can be replaced by a HelpIndex
StarDesktop.LoadComponentfromUrl(&quot;vnd.sun.star.help://&quot; &amp; sDocType &amp; &quot;/start&quot;, &quot;_OFFICE_HELP&quot;, 64, NoArgs())
@@ -341,27 +220,28 @@ End Sub
Sub EnableStep2DialogControls(OnValue as Boolean)
- DialogModel.frmExtent.Enabled = OnValue
- DialogModel.optWholeDir.Enabled = OnValue
- DialogModel.optSingleFile.Enabled = OnValue
- DialogModel.chkProtect.Enabled = OnValue
-&apos; Todo: Aktivieren nicht vergessen!
- DialogModel.cmdCallSourceDialog.Enabled = False
- DialogModel.cmdCallTargetDialog.Enabled = False
- DialogModel.lblSource.Enabled = OnValue
- DialogModel.lblTarget.Enabled = OnValue
- DialogModel.txtSource.Enabled = OnValue
- DialogModel.txtTarget.Enabled = OnValue
- DialogModel.imgPreview.Enabled = OnValue
- DialogModel.lstCurrencies.Enabled = OnValue
- DialogModel.lblCurrencies.Enabled = OnValue
- If OnValue Then
- ToggleGoOnButton()
- DialogModel.chkRecursive.Enabled = DialogModel.optWholeDir.State = 1
- Else
- DialogModel.cmdGoOn.Enabled = False
- DialogModel.chkRecursive.Enabled = False
- End If
+ 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
@@ -429,4 +309,18 @@ Dim sPath as String
bDoEnable = oUcb.Exists(DialogModel.txtTarget.Text)
End If
DialogModel.cmdGoOn.Enabled = bDoEnable
+End Sub
+
+
+Sub CallFolderPicker()
+ GetFolderName(DialogModel.txtTarget)
+End Sub
+
+
+Sub CallFilePicker()
+ If DialogModel.optSingleFile.State = 1 Then
+ GetFileName(DialogModel.txtSource, Filternames())
+ Else
+ GetFolderName(DialogModel.txtSource)
+ End If
End Sub</script:module> \ No newline at end of file
diff --git a/wizards/source/euro/Common.xba b/wizards/source/euro/Common.xba
index 0c3308956eaf..822047a0e57d 100644
--- a/wizards/source/euro/Common.xba
+++ b/wizards/source/euro/Common.xba
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
-
-<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Common" script:language="StarBasic">REM ***** BASIC *****
+<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
+<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
@@ -11,7 +11,7 @@ Sub RetrieveDocumentObjects()
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;)
+&apos; oAddressRanges = oDocument.createInstance(&quot;com.sun.star.sheet.SheetCellRanges&quot;)
End If
oStatusline = oDocument.GetCurrentController.GetFrame.CreateStatusIndicator
&apos; Retrieve the indices for the cellformatations
@@ -22,18 +22,6 @@ End Sub
Sub CloseDialog
Dim n, m as Integer
If Not bMacroStopped Then
- &apos; Die Zuordnungstabelle löschen
-&apos; Todo: Check if Values in the following variables are cleared if the macro is restarted
-&apos; If Not IsNull(oStyles) Then
-&apos; Redim StyleRangeAssignmentList(20,50)as String
-&apos; End If
-&apos; ReDim RangeList(100) as String
-&apos; ReDim SelRangeList(100) as String
-&apos; Redim RangeBools(100) as Boolean
-&apos; ReDim RemoveList(100) as String
-&apos; ClearArray(ListboxItems())
- &apos; Prevent That this Procedure is called again the second time
- &apos; by the Unload Event of the dialog
bMacroStopped = True
DialogConvert.EndExecute
If Not DocDisposed Then
@@ -45,62 +33,30 @@ End Sub
Function ConvertDocument()
-Dim i, a as integer
-Dim CurStylename as String
-Dim DummyList(100) as String
-Dim RangeName as String
-Dim oDummySheet as Object
-Dim AddRange as Boolean
-Dim CurMimeType as String
GoOn = True
DocDisposed = True
- CurCellCount = 0
- StatusValue = 0
- AddRange = True
- oStatusline.Start(sStsPROGRESS,100) &apos;&quot;Konvertierungsfortschritt:&quot;
- StatusValue = 0
+ InitializeProgressbar()
If Instr(1, CurMimeType, &quot;calc&quot;) &lt;&gt; 0 Then
- If Not bRangeListDefined Then
- TotCellCount = 0
- CreateRangeEnumeration(True)
- Else
- IncreaseStatusvalue(SBRelGet/3)
+ bDocHasProtectedSheets = CheckSheetProtection(oSheets)
+ If bDocHasProtectedSheets Then
+ bDocHasProtectedSheets = UnprotectSheetsWithPassword(oSheets)
End If
- &apos; Check protected Areas
- a = 1
- i = 0
- For i = 1 To Val(RangeList(0))
- RangeName = RangeList(i)
- If Rangename &lt;&gt; &quot;&quot; Then
- oDummySheet = RetrieveSheetoutofRangeName(RangeName)
-
- &apos; Unprotect the sheet if necessary
- AddRange = UnprotectSheet(oDummySheet)
- If AddRange Then
-&apos; Todo: Umschreiben mit Redim RangeList(RangeIndex) Preserve
- DummyList(a) = RangeName
- DummyList(0) = Str(a)
- a = a + 1
- Else
- Exit For
- End If
+ If Not bDocHasProtectedSheets Then
+ If Not bRangeListDefined Then
+ TotCellCount = 0
+ CreateRangeEnumeration(True)
+ Else
+ IncreaseStatusvalue(SBRelGet/3)
+ End If
+ RangeIndex = Ubound(RangeList(), 1)
+ If RangeIndex &gt; -1 Then
+ ConvertThehardWay(RangeList(), True, False)
+ MakeStyleEnumeration(True)
+ oDocument.calculateAll()
End If
- Next
- RangeIndex = Val(DummyList(0))
- If AddRange And RangeIndex &gt; 0 Then
- Dim LocRangeList(RangeIndex-1) as String
- Dim LocRangeBools(RangeIndex-1) as String
- For i = 1 To RangeIndex
- LocRangeList(i-1 ) = DummyList(i)
- LocRangeBools(i-1) = True
- Next i
- ConvertThehardWay(LocRangeList(), LocRangeBools(), True, True)
- MakeStyleEnumeration(True)
- oDocument.calculateAll()
+ ReprotectSheets()
+ bRangeListDefined = False
End If
- ReprotectSheets()
- bRangeListDefined = False
- ConvertDocument = AddRange
Else
oStatusline.SetValue(10)
ConvertTextFields()
@@ -108,7 +64,6 @@ Dim CurMimeType as String
ConvertWriterTables()
End If
oStatusline.End
-
On Local Error Goto 0
End Function
@@ -120,6 +75,7 @@ Dim nFormatLeading as Integer
Dim bFormatLeading as Integer
Dim bFormatNegRed as Integer
Dim bFormatThousands as Integer
+Dim aLocLocale As New com.sun.star.lang.Locale
Dim i as Integer
Dim aNewStr as String
Dim iNumberFormat as Long
@@ -144,10 +100,11 @@ Dim AddToList as Boolean
nFormatLeading = aFormat.LeadingZeros
bFormatNegRed = aFormat.NegativeRed
bFormatThousands = aFormat.ThousandsSeparator
- oLocale = aFormat.Locale
+ aLocLocale = aFormat.Locale
aNewStr = oFormats.generateFormat( nSimpleKey, oLocale, _
bFormatThousands, bFormatNegRed, nFormatDecimals, nFormatLeading)
- oObject.NumberFormat = Numberformat(oFormats, aNewStr, oLocale)
+
+ oObject.NumberFormat = Numberformat(oFormats, aNewStr, aLocLocale)
NOKEY:
If Err &lt;&gt; 0 Then
Resume CLERROR
@@ -156,7 +113,7 @@ Dim AddToList as Boolean
End Sub
-Function Numberformat( oFormats as Object, aFormatStr as String, oLocale as Variant )
+Function Numberformat( oFormats as Object, aFormatStr as String, oLocale)
Dim nRetkey
nRetKey = oFormats.queryKey( aFormatStr, oLocale, True )
If nRetKey = -1 Then
@@ -291,4 +248,8 @@ Dim MaxIndex as Integer
End Sub
-</script:module> \ No newline at end of file
+Sub InitializeProgressbar()
+ CurCellCount = 0
+ oStatusline.Start(sStsPROGRESS,100) &apos;&quot;Konvertierungsfortschritt:&quot;
+ StatusValue = 0
+End Sub</script:module> \ No newline at end of file
diff --git a/wizards/source/euro/ConvertRun.xba b/wizards/source/euro/ConvertRun.xba
index 20cdef930e47..c724890c5794 100644
--- a/wizards/source/euro/ConvertRun.xba
+++ b/wizards/source/euro/ConvertRun.xba
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-
+<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="ConvertRun" script:language="StarBasic">Option Explicit
&apos; Todo Den Bug mit der Statuszeilengeschichte überprüfen
&apos; Todo Vorselektion der Listbox
@@ -14,7 +14,7 @@ Sub Main()
bPreSelected = True
DocDisposed = False
oDocument = StarDesktop.CurrentFrame.Controller.Model
- RetrieveDocumentObjects() &apos; Statusline, SheetsCollection etc.
+ RetrieveDocumentObjects() &apos; Statusline, SheetsCollection etc.
InitializeConverter(oDocument.CharLocale, 1)
GetPreSelectedRange()
If GoOn Then
@@ -29,7 +29,6 @@ End Sub
Sub SelectListItem()
Dim Listbox as Object
Dim oListSheet as Object
-Dim AddRange as Boolean
Dim CurStyleName as String
Dim oCursheet as Object
Dim oTempRanges as Object
@@ -38,11 +37,10 @@ Dim RangeName as String
Dim oSheetRanges as Object
Dim ListIndex as Integer
Dim a as Integer
-Dim s as Integer
Dim i as Integer
Dim n as Integer
Dim m as Integer
-Dim AddStyle as Boolean
+Dim MaxIndex as Integer
Listbox = DialogModel.lstSelection
If Ubound(Listbox.SelectedItems()) &gt; -1 Then
&apos; ToggleWindow(False)
@@ -50,7 +48,7 @@ Dim AddStyle as Boolean
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
+ If DialogModel.optDocRanges.State = 1 Then
&apos; Document is the basis for the conversion
ListIndex = Listbox.SelectedItems(0)
oCurSheet = RetrieveSheetoutofRangeName(ListIndex)
@@ -59,57 +57,45 @@ Dim AddStyle as Boolean
oCurSheet = oDocument.CurrentController.ActiveSheet
End If
sCurSheetName = oCurSheet.Name
- AddStyle = True
If DialogModel.optCellTemplates.State = 1 Then
- &apos;Soft formatation is selected
- For s = 0 To oSheets.Count-1
- If oSheets.GetbyIndex(s).IsProtected Then
- AddStyle = UnprotectSheet(oSheets.GetbyIndex(s))
- If Not AddStyle Then
- Exit For
- End If
- End If
- Next s
- If AddStyle 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
+ 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
- Wend
- Next i
- Else
- EmptyListbox(Listbox)
- End If
+ End If
+ Wend
+ Next i
Else
- a = 1
+ a = -1
&apos; Hard Formatation is selected
For n = 0 To Ubound(Listbox.SelectedItems())
m = Listbox.SelectedItems(n)
RangeName = Listbox.StringItemList(m)
oListSheet = RetrieveSheetoutofRangeName(RangeName)
- AddRange = UnprotectSheet(oListSheet)
-&apos; Todo: Klären wie das am besten geht!
- If Not AddRange Then
- DeselectListboxItem(Listbox, n)
- Else
- SelRangeList(a) = RangeName
- SelRangeList(0) = Str(a)
- a = a + 1
- If oListSheet.Name = sCurSheetName Then
- oRange = RetrieveRangeoutofRangeName(RangeName)
- oSelRanges.InsertbyName(&quot;&quot;,oRange)
- End If
+ 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)
&apos; ToggleWindow(True)
@@ -129,17 +115,18 @@ Sub EnableStep1DialogControls(bCurrEnabled as Boolean, bFrameEnabled as Boolean,
Dim bNoComboSelection as Boolean
Dim bNoLBSelection as Boolean
&apos; Controls around the Currency-Listbox
- DialogModel.lblCurrencies.Enabled = bCurrEnabled
- DialogModel.lstCurrencies.Enabled = bCurrEnabled
-
- DialogModel.lstSelection.Enabled = bFrameEnabled
- DialogModel.lblSelection.Enabled = bFrameEnabled
- DialogModel.frmSelection.Enabled = bFrameEnabled
- DialogModel.optCellTemplates.Enabled = bFrameEnabled
- DialogModel.optSheetRanges.Enabled = bFrameEnabled
- DialogModel.optDocRanges.Enabled = bFrameEnabled
- DialogModel.optSelRange.Enabled = bFrameEnabled
-
+ With DialogModel
+ .lblCurrencies.Enabled = bCurrEnabled
+ .lstCurrencies.Enabled = bCurrEnabled
+
+ .lstSelection.Enabled = bFrameEnabled
+ .lblSelection.Enabled = bFrameEnabled
+ .hlnSelection.Enabled = bFrameEnabled
+ .optCellTemplates.Enabled = bFrameEnabled
+ .optSheetRanges.Enabled = bFrameEnabled
+ .optDocRanges.Enabled = bFrameEnabled
+ .optSelRange.Enabled = bFrameEnabled
+ End With
&apos; The CheckBox has the Value &apos;True&apos; when the Controls in the Frame are disabled
If bButtonsEnabled Then
bNoComboSelection = Ubound(DialogModel.lstCurrencies.SelectedItems()) = -1
@@ -160,43 +147,35 @@ End Sub
Sub ConvertRangesOrStylesOfDocument()
Dim i as Integer
-Dim Listbox as Object
Dim ItemName as String
-Dim ThisList() as String
-Dim ThisSel() as Boolean
+Dim SelList() as String
- &apos; Variable, in der der aktuelle Stand der Fortschrittsleiste angzeigt wird
- CurCellCount = 0
- Listbox = DialogModel.lstSelection
- EnableStep1DialogControls(False, False, False)
-
- oStatusline.Start(sStsPROGRESS,100) &apos; &quot;Konvertierungsfortschritt:&quot;
- StatusValue = 0
- If DialogModel.optSelRange.State = 1 Then
- SelectListItem()
+ bDocHasProtectedSheets = CheckSheetProtection(oSheets)
+ If bDocHasProtectedSheets Then
+ bDocHasProtectedSheets = UnprotectSheetsWithPassWord(oSheets)
+ DialogModel.cmdGoOn.Enabled = False
End If
- ThisSel() = GetSelectedListboxItems(Listbox)
- ThisList() = Listbox.StringItemList()
- If DialogModel.optCellTemplates.State &lt;&gt; 1 Then
- &apos; Option &apos;Hard Formatation is selected
- SelectRange()
- ConverttheHardWay(ThisList(), ThisSel(), False, False)
- Else
- &apos; Option &apos;Soft&apos; Formatation is selected
- AssignRangestoStyle(ThisList(), ThisSel())
- ConverttheSoftWay(ThisList(), ThisSel(), False)
+ 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)
+ Else
+ &apos; Option &apos;Hard Formatation is selected
+ SelectRange()
+ ConverttheHardWay(SelList(), False, True)
+ End If
+ oStatusline.End
+ EnableStep1DialogControls(True, False, True)
+ DialogModel.cmdGoOn.Enabled = True
+ oDocument.CurrentController.Select(oSelRanges)
End If
- oStatusline.End
- i = 0
- &apos; Todo: Dieses Array vorab neu dimensionieren und in For - Schleife abarbeiten
- While RemoveList(i) &lt;&gt; &quot;&quot;
- ItemName = RemoveList(i)
- RemoveItemfromListbox(Listbox, ItemName)
- i = i + 1
- Wend
- EnableStep1DialogControls(True, False, True)
- DialogModel.cmdGoOn.Enabled = True
- oDocument.CurrentController.Select(oSelRanges)
End Sub
@@ -220,19 +199,16 @@ End Sub
&apos; Alles was selektiert wurde wird deselektiert
Sub EmptySelection()
Dim RangeName as String
-Dim i, MaxIndex as Integer
-Dim EmptySelRangeList(30) 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)
- i = 0
- Do
- If EmptySelRangeList(i) &lt;&gt; &quot;&quot; Then
- oSelRanges.RemovebyName(EmptySelRangeList(i))
- i = i + 1
- End If
- Loop Until EmptySelRangeList(i) = &quot;&quot;
+ For i = 0 To MaxIndex
+ oSelRanges.RemovebyName(EmptySelRangeList(i))
+ Next i
End If
oDocument.CurrentController.Select(oSelRanges)
Else
@@ -243,7 +219,7 @@ End Sub
Sub AddSelectedRangeToSelRangesEnum()
osheet = oDocument.CurrentController.GetActiveSheet
- oAddressRanges = oDocument.createInstance(&quot;com.sun.star.sheet.SheetCellRanges&quot;)
+&apos; oAddressRanges = oDocument.createInstance(&quot;com.sun.star.sheet.SheetCellRanges&quot;)
oSelRanges = oDocument.createInstance(&quot;com.sun.star.sheet.SheetCellRanges&quot;)
&apos; Check if a Currency-Range has been selected
oRange = oDocument.CurrentController.Selection
@@ -263,7 +239,7 @@ Dim OldCurExtension(1) as String
OldCurrSymbolList() = CurrSymbolList()
OldCurExtension() = CurExtension()
OldCurrIndex = CurrIndex
- For i = 0 To 10
+ For i = 0 To 11
CurrIndex = i
CurExtension(0) = LangIDValue(CurrIndex,0,2)
CurExtension(1) = LangIDValue(CurrIndex,1,2)
@@ -303,7 +279,7 @@ End Sub
Sub AddRangeToListbox()
EmptyListBox(DialogModel.lstSelection)
&apos; Den Namen der Range ermitteln und in ein Array packen
- PreName = RetrieveRangeNamefromAddress(oRange.RangeAddress, oSheet.Name)
+ PreName = RetrieveRangeNamefromAddress(oRange)
AddSingleItemToListbox(DialogModel.lstSelection, Prename)&apos;, 0)
SelectListboxItem(DialogModel.lstCurrencies, CurrIndex)
TotCellCount = CountRangeCells(oRange)
@@ -352,9 +328,11 @@ End Function
Sub SetOptionValuestoNull()
- DialogModel.optCellTemplates.State = 0
- DialogModel.optSheetRanges.State = 0
- DialogModel.optDocRanges.State = 0
- DialogModel.optSelRange.State = 0
+ With DialogModel
+ .optCellTemplates.State = 0
+ .optSheetRanges.State = 0
+ .optDocRanges.State = 0
+ .optSelRange.State = 0
+ End With
End Sub
</script:module> \ No newline at end of file
diff --git a/wizards/source/euro/DlgConvert.xdl b/wizards/source/euro/DlgConvert.xdl
index e6415690d330..145d5414d0ef 100644
--- a/wizards/source/euro/DlgConvert.xdl
+++ b/wizards/source/euro/DlgConvert.xdl
@@ -1,79 +1,78 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE dlg:window PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "dialog.dtd">
-<dlg:window xmlns:dlg="http://openoffice.org/2000/dialog" dlg:id="DialogConvert" dlg:style-id="0" dlg:left="96" dlg:top="28" dlg:width="270" dlg:height="210" dlg:page="3">
+<dlg:window xmlns:dlg="http://openoffice.org/2000/dialog" dlg:id="DialogConvert" dlg:style-id="0" dlg:left="96" dlg:top="28" dlg:width="270" dlg:height="210" dlg:page="2">
<dlg:styles>
<dlg:style dlg:style-id="0"/>
</dlg:styles>
<dlg:bulletinboard>
- <dlg:button dlg:style-id="0" dlg:id="cmdCancel" dlg:tab-index="0" dlg:left="5" dlg:top="190" dlg:width="50" dlg:height="13" dlg:value="cmdCancel">
+ <dlg:button dlg:style-id="0" dlg:id="cmdCancel" dlg:tab-index="0" dlg:left="6" dlg:top="190" dlg:width="53" dlg:height="14" dlg:value="cmdCancel">
<dlg:event dlg:listener-type="com.sun.star.awt.XActionListener" dlg:event-method="actionPerformed" dlg:script-type="StarBasic" dlg:script-code="Euro.Common.CloseDialog"/>
</dlg:button>
- <dlg:button dlg:style-id="0" dlg:id="cmdHelp" dlg:tab-index="1" dlg:left="65" dlg:top="190" dlg:width="50" dlg:height="13" dlg:value="cmdHelp"/>
- <dlg:button dlg:style-id="0" dlg:id="cmdBack" dlg:tab-index="2" dlg:left="155" dlg:top="190" dlg:width="50" dlg:height="13" dlg:value="cmdBack"/>
- <dlg:button dlg:style-id="0" dlg:id="cmdGoOn" dlg:tab-index="3" dlg:left="215" dlg:top="190" dlg:width="50" dlg:height="13" dlg:value="cmdGoOn">
+ <dlg:button dlg:style-id="0" dlg:id="cmdHelp" dlg:tab-index="1" dlg:left="63" dlg:top="190" dlg:width="53" dlg:height="14" dlg:value="cmdHelp"/>
+ <dlg:button dlg:style-id="0" dlg:id="cmdBack" dlg:tab-index="2" dlg:left="155" dlg:top="190" dlg:width="53" dlg:height="14" dlg:value="cmdBack"/>
+ <dlg:button dlg:style-id="0" dlg:id="cmdGoOn" dlg:tab-index="3" dlg:left="211" dlg:top="190" dlg:width="53" dlg:height="14" dlg:value="cmdGoOn">
<dlg:event dlg:listener-type="com.sun.star.awt.XActionListener" dlg:event-method="actionPerformed" dlg:script-type="StarBasic" dlg:script-code="Euro.Common.StartConversion"/>
</dlg:button>
<dlg:radiogroup>
- <dlg:radio dlg:style-id="0" dlg:id="optCellTemplates" dlg:tab-index="4" dlg:left="13" dlg:top="76" dlg:width="129" dlg:height="14" dlg:page="1" dlg:value="optCellTemplates">
- <dlg:event dlg:listener-type="com.sun.star.awt.XMouseListener" dlg:event-method="mouseReleased" dlg:script-type="StarBasic" dlg:script-code="Euro.Soft.CreateStyleEnumeration"/>
+ <dlg:radio dlg:style-id="0" dlg:id="optCellTemplates" dlg:tab-index="4" dlg:left="12" dlg:top="96" dlg:width="129" dlg:height="10" dlg:page="1" dlg:value="optCellTemplates">
+ <dlg:event dlg:listener-type="com.sun.star.awt.XActionListener" dlg:event-method="actionPerformed" dlg:script-type="StarBasic" dlg:script-code="Euro.Soft.CreateStyleEnumeration"/>
</dlg:radio>
- <dlg:radio dlg:style-id="0" dlg:id="optSheetRanges" dlg:tab-index="5" dlg:left="12" dlg:top="94" dlg:width="130" dlg:height="14" dlg:page="1" dlg:value="optSheetRanges">
- <dlg:event dlg:listener-type="com.sun.star.awt.XMouseListener" dlg:event-method="mouseReleased" dlg:script-type="StarBasic" dlg:script-code="Euro.Hard.CreateRangeList"/>
+ <dlg:radio dlg:style-id="0" dlg:id="optSheetRanges" dlg:tab-index="5" dlg:left="12" dlg:top="110" dlg:width="130" dlg:height="10" dlg:page="1" dlg:value="optSheetRanges">
+ <dlg:event dlg:listener-type="com.sun.star.awt.XActionListener" dlg:event-method="actionPerformed" dlg:script-type="StarBasic" dlg:script-code="Euro.Hard.CreateRangeList"/>
</dlg:radio>
- <dlg:radio dlg:style-id="0" dlg:id="optDocRanges" dlg:tab-index="6" dlg:left="12" dlg:top="115" dlg:width="130" dlg:height="14" dlg:page="1" dlg:value="optDocRanges">
- <dlg:event dlg:listener-type="com.sun.star.awt.XMouseListener" dlg:event-method="mouseReleased" dlg:script-type="StarBasic" dlg:script-code="Euro.Hard.CreateRangeList"/>
+ <dlg:radio dlg:style-id="0" dlg:id="optDocRanges" dlg:tab-index="6" dlg:left="12" dlg:top="124" dlg:width="130" dlg:height="10" dlg:page="1" dlg:value="optDocRanges">
+ <dlg:event dlg:listener-type="com.sun.star.awt.XActionListener" dlg:event-method="actionPerformed" dlg:script-type="StarBasic" dlg:script-code="Euro.Hard.CreateRangeList"/>
</dlg:radio>
- <dlg:radio dlg:style-id="0" dlg:id="optSelRange" dlg:tab-index="7" dlg:left="12" dlg:top="134" dlg:width="130" dlg:height="14" dlg:page="1" dlg:value="optSelRange">
- <dlg:event dlg:listener-type="com.sun.star.awt.XMouseListener" dlg:event-method="mouseReleased" dlg:script-type="StarBasic" dlg:script-code="Euro.ConvertRun.CheckRangeSelection"/>
+ <dlg:radio dlg:style-id="0" dlg:id="optSelRange" dlg:tab-index="7" dlg:left="12" dlg:top="138" dlg:width="130" dlg:height="10" dlg:page="1" dlg:value="optSelRange">
+ <dlg:event dlg:listener-type="com.sun.star.awt.XActionListener" dlg:event-method="actionPerformed" dlg:script-type="StarBasic" dlg:script-code="Euro.ConvertRun.CheckRangeSelection"/>
</dlg:radio>
</dlg:radiogroup>
- <dlg:titledbox dlg:style-id="0" dlg:id="frmSelection" dlg:tab-index="8" dlg:left="5" dlg:top="65" dlg:width="260" dlg:height="86" dlg:page="1">
- <dlg:title dlg:value="frmSelection"/>
- </dlg:titledbox>
- <dlg:text dlg:style-id="0" dlg:id="lblSelection" dlg:tab-index="9" dlg:left="170" dlg:top="72" dlg:width="73" dlg:height="9" dlg:page="1" dlg:value="lblSelection"/>
- <dlg:menulist dlg:style-id="0" dlg:id="lstSelection" dlg:tab-index="10" dlg:left="170" dlg:top="82" dlg:width="90" dlg:height="65" dlg:page="1" dlg:multiselection="true">
+ <dlg:text dlg:style-id="0" dlg:id="lblSelection" dlg:tab-index="8" dlg:left="170" dlg:top="84" dlg:width="73" dlg:height="8" dlg:page="1" dlg:value="lblSelection"/>
+ <dlg:menulist dlg:style-id="0" dlg:id="lstSelection" dlg:tab-index="9" dlg:left="170" dlg:top="96" dlg:width="90" dlg:height="52" dlg:page="1" dlg:multiselection="true">
<dlg:event dlg:listener-type="com.sun.star.awt.XItemListener" dlg:event-method="itemStateChanged" dlg:script-type="StarBasic" dlg:script-code="Euro.ConvertRun.SelectListItem"/>
</dlg:menulist>
- <dlg:checkbox dlg:style-id="0" dlg:id="chkComplete" dlg:tab-index="11" dlg:left="12" dlg:top="45" dlg:width="129" dlg:height="13" dlg:page="1" dlg:value="chkComplete">
+ <dlg:checkbox dlg:style-id="0" dlg:id="chkComplete" dlg:tab-index="10" dlg:left="12" dlg:top="43" dlg:width="129" dlg:height="10" dlg:page="1" dlg:value="chkComplete">
<dlg:event dlg:listener-type="com.sun.star.awt.XItemListener" dlg:event-method="itemStateChanged" dlg:script-type="StarBasic" dlg:script-code="Euro.ConvertRun.RetrieveEnableValue"/>
</dlg:checkbox>
- <dlg:text dlg:style-id="0" dlg:id="lblHint" dlg:tab-index="12" dlg:left="5" dlg:top="161" dlg:width="260" dlg:height="26" dlg:value="lblHint" dlg:multiline="true"/>
- <dlg:textfield dlg:style-id="0" dlg:id="txtTarget" dlg:tab-index="13" dlg:left="5" dlg:top="145" dlg:width="240" dlg:height="14" dlg:page="2">
+ <dlg:text dlg:style-id="0" dlg:id="lblHint" dlg:tab-index="11" dlg:left="6" dlg:top="164" dlg:width="258" dlg:height="22" dlg:value="lblHint" dlg:multiline="true"/>
+ <dlg:textfield dlg:style-id="0" dlg:id="txtTarget" dlg:tab-index="12" dlg:left="80" dlg:top="143" dlg:width="165" dlg:height="12" dlg:page="2">
<dlg:event dlg:listener-type="com.sun.star.awt.XTextListener" dlg:event-method="textChanged" dlg:script-type="StarBasic" dlg:script-code="Euro.AutoPilotRun.ToggleGoOnButton"/>
</dlg:textfield>
- <dlg:button dlg:style-id="0" dlg:id="cmdCallTargetDialog" dlg:tab-index="14" dlg:left="250" dlg:top="145" dlg:width="16" dlg:height="14" dlg:page="2" dlg:value="..."/>
- <dlg:text dlg:style-id="0" dlg:id="lblTarget" dlg:tab-index="15" dlg:left="5" dlg:top="135" dlg:width="98" dlg:height="9" dlg:page="2" dlg:value="lblTarget"/>
- <dlg:checkbox dlg:style-id="0" dlg:id="chkProtect" dlg:tab-index="16" dlg:left="12" dlg:top="123" dlg:width="254" dlg:height="10" dlg:page="2" dlg:value="chkProtect"/>
- <dlg:checkbox dlg:style-id="0" dlg:id="chkRecursive" dlg:tab-index="17" dlg:left="12" dlg:top="103" dlg:width="254" dlg:height="10" dlg:page="2" dlg:value="chkRecursive"/>
- <dlg:textfield dlg:style-id="0" dlg:id="txtSource" dlg:tab-index="18" dlg:left="5" dlg:top="87" dlg:width="240" dlg:height="14" dlg:page="2">
+ <dlg:button dlg:style-id="0" dlg:id="cmdCallTargetDialog" dlg:tab-index="13" dlg:left="249" dlg:top="142" dlg:width="15" dlg:height="14" dlg:page="2" dlg:value="...">
+ <dlg:event dlg:listener-type="com.sun.star.awt.XActionListener" dlg:event-method="actionPerformed" dlg:script-type="StarBasic" dlg:script-code="Euro.AutoPilotRun.CallFolderPicker"/>
+ </dlg:button>
+ <dlg:text dlg:style-id="0" dlg:id="lblTarget" dlg:tab-index="14" dlg:left="6" dlg:top="145" dlg:width="73" dlg:height="8" dlg:page="2" dlg:value="lblTarget"/>
+ <dlg:checkbox dlg:style-id="0" dlg:id="chkProtect" dlg:tab-index="15" dlg:left="12" dlg:top="126" dlg:width="251" dlg:height="10" dlg:page="2" dlg:value="chkProtect"/>
+ <dlg:checkbox dlg:style-id="0" dlg:id="chkRecursive" dlg:tab-index="16" dlg:left="12" dlg:top="98" dlg:width="252" dlg:height="10" dlg:page="2" dlg:value="chkRecursive"/>
+ <dlg:textfield dlg:style-id="0" dlg:id="txtSource" dlg:tab-index="17" dlg:left="80" dlg:top="82" dlg:width="165" dlg:height="12" dlg:page="2">
<dlg:event dlg:listener-type="com.sun.star.awt.XTextListener" dlg:event-method="textChanged" dlg:script-type="StarBasic" dlg:script-code="Euro.AutoPilotRun.ToggleGoOnButton"/>
</dlg:textfield>
- <dlg:button dlg:style-id="0" dlg:id="cmdCallSourceDialog" dlg:tab-index="19" dlg:left="250" dlg:top="87" dlg:width="16" dlg:height="14" dlg:page="2" dlg:value="..."/>
- <dlg:text dlg:style-id="0" dlg:id="lblSource" dlg:tab-index="20" dlg:left="5" dlg:top="76" dlg:width="70" dlg:height="9" dlg:page="2" dlg:value="lblSource"/>
- <dlg:titledbox dlg:style-id="0" dlg:id="frmExtent" dlg:tab-index="21" dlg:left="5" dlg:top="39" dlg:width="158" dlg:height="35" dlg:page="2">
- <dlg:title dlg:value="frmExtent"/>
- </dlg:titledbox>
+ <dlg:button dlg:style-id="0" dlg:id="cmdCallSourceDialog" dlg:tab-index="18" dlg:left="249" dlg:top="81" dlg:width="15" dlg:height="14" dlg:page="2" dlg:value="...">
+ <dlg:event dlg:listener-type="com.sun.star.awt.XActionListener" dlg:event-method="actionPerformed" dlg:script-type="StarBasic" dlg:script-code="Euro.AutoPilotRun.CallFilePicker"/>
+ </dlg:button>
+ <dlg:text dlg:style-id="0" dlg:id="lblSource" dlg:tab-index="19" dlg:left="6" dlg:top="84" dlg:width="73" dlg:height="8" dlg:page="2" dlg:value="lblSource"/>
<dlg:radiogroup>
- <dlg:radio dlg:style-id="0" dlg:id="optSingleFile" dlg:tab-index="22" dlg:left="12" dlg:top="48" dlg:width="146" dlg:height="11" dlg:page="2" dlg:value="optSingleFile">
+ <dlg:radio dlg:style-id="0" dlg:id="optSingleFile" dlg:tab-index="20" dlg:left="12" dlg:top="51" dlg:width="146" dlg:height="10" dlg:page="2" dlg:value="optSingleFile">
<dlg:event dlg:listener-type="com.sun.star.awt.XItemListener" dlg:event-method="itemStateChanged" dlg:script-type="StarBasic" dlg:script-code="Euro.AutoPilotRun.SwapExtent"/>
</dlg:radio>
- <dlg:radio dlg:style-id="0" dlg:id="optWholeDir" dlg:tab-index="23" dlg:left="12" dlg:top="59" dlg:width="146" dlg:height="11" dlg:page="2" dlg:value="optWholeDir">
+ <dlg:radio dlg:style-id="0" dlg:id="optWholeDir" dlg:tab-index="21" dlg:left="12" dlg:top="65" dlg:width="146" dlg:height="10" dlg:page="2" dlg:value="optWholeDir">
<dlg:event dlg:listener-type="com.sun.star.awt.XItemListener" dlg:event-method="itemStateChanged" dlg:script-type="StarBasic" dlg:script-code="Euro.AutoPilotRun.SwapExtent"/>
</dlg:radio>
</dlg:radiogroup>
- <dlg:titledbox dlg:style-id="0" dlg:id="frmProgress" dlg:tab-index="24" dlg:left="5" dlg:top="105" dlg:width="260" dlg:height="53" dlg:page="3">
- <dlg:title dlg:value="frmProgress"/>
- </dlg:titledbox>
- <dlg:text dlg:style-id="0" dlg:id="lblCurProgress" dlg:tab-index="25" dlg:left="16" dlg:top="129" dlg:width="181" dlg:height="12" dlg:page="3"/>
- <dlg:text dlg:style-id="0" dlg:id="lblRetrieval" dlg:tab-index="26" dlg:left="9" dlg:top="114" dlg:width="178" dlg:height="15" dlg:page="3" dlg:value="lblRetrieval"/>
- <dlg:textfield dlg:style-id="0" dlg:id="txtConfig" dlg:tab-index="27" dlg:left="5" dlg:top="50" dlg:width="260" dlg:height="55" dlg:page="3" dlg:vscroll="true" dlg:multiline="true"/>
- <dlg:text dlg:style-id="0" dlg:id="lblConfig" dlg:tab-index="28" dlg:left="5" dlg:top="38" dlg:width="94" dlg:height="10" dlg:page="3" dlg:value="lblConfig"/>
- <dlg:text dlg:style-id="0" dlg:id="lblCurDocument" dlg:tab-index="29" dlg:left="16" dlg:top="140" dlg:width="208" dlg:height="15" dlg:page="3"/>
- <dlg:img dlg:id="imgPreview" dlg:tab-index="30" dlg:left="5" dlg:top="5" dlg:width="258" dlg:height="26" dlg:src="file:///D:/office630np/share/template/german/wizard/bitmap/euro_2.bmp"/>
- <dlg:text dlg:style-id="0" dlg:id="lblCurrencies" dlg:tab-index="31" dlg:left="175" dlg:top="38" dlg:width="90" dlg:height="11" dlg:value="lblCurrencies"/>
- <dlg:menulist dlg:style-id="0" dlg:id="lstCurrencies" dlg:tab-index="32" dlg:left="175" dlg:top="49" dlg:width="90" dlg:height="14" dlg:spin="true" dlg:linecount="9">
+ <dlg:text dlg:style-id="0" dlg:id="lblCurProgress" dlg:tab-index="22" dlg:left="16" dlg:top="130" dlg:width="181" dlg:height="8" dlg:page="3"/>
+ <dlg:text dlg:style-id="0" dlg:id="lblRetrieval" dlg:tab-index="23" dlg:left="9" dlg:top="119" dlg:width="178" dlg:height="8" dlg:page="3" dlg:value="lblRetrieval"/>
+ <dlg:textfield dlg:style-id="0" dlg:id="txtConfig" dlg:tab-index="24" dlg:left="6" dlg:top="50" dlg:width="258" dlg:height="55" dlg:page="3" dlg:vscroll="true" dlg:multiline="true"/>
+ <dlg:text dlg:style-id="0" 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:style-id="0" 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:text dlg:style-id="0" dlg:id="lblCurrencies" dlg:tab-index="28" dlg:left="170" dlg:top="39" dlg:width="89" dlg:height="8" dlg:value="lblCurrencies"/>
+ <dlg:menulist dlg:style-id="0" dlg:id="lstCurrencies" dlg:tab-index="29" dlg:left="170" dlg:top="51" dlg:width="90" dlg:height="12" dlg:spin="true" dlg:linecount="9">
<dlg:event dlg:listener-type="com.sun.star.awt.XItemListener" dlg:event-method="itemStateChanged" dlg:script-type="StarBasic" dlg:script-code="Euro.ConvertRun.SelectCurrency"/>
</dlg:menulist>
- <dlg:checkbox dlg:style-id="0" dlg:id="chkTextDocuments" dlg:tab-index="33" dlg:left="12" dlg:top="113" dlg:width="254" dlg:height="10" dlg:page="2" dlg:value="chkTextDocuments"/>
+ <dlg:checkbox dlg:style-id="0" dlg:id="chkTextDocuments" dlg:tab-index="30" dlg:left="12" dlg:top="112" dlg:width="251" dlg:height="10" dlg:page="2" dlg:value="chkTextDocuments"/>
+ <dlg:fixedline dlg:style-id="0" dlg:id="hlnSelection" dlg:tab-index="31" dlg:left="7" dlg:top="72" dlg:width="258" dlg:height="8" dlg:page="1" dlg:value="hlnSelection"/>
+ <dlg:fixedline dlg:style-id="0" dlg:id="hlnExtent" dlg:tab-index="32" dlg:left="6" dlg:top="39" dlg:width="156" dlg:height="8" dlg:page="2" dlg:value="hlnExtent"/>
+ <dlg:fixedline dlg:style-id="0" dlg:id="hlnProgress" dlg:tab-index="33" dlg:left="6" dlg:top="108" dlg:width="258" dlg:height="8" dlg:page="3" dlg:value="hlnProgress"/>
+ <dlg:fixedline dlg:style-id="0" dlg:id="FixedLine1" dlg:tab-index="34" dlg:left="6" dlg:top="152" dlg:width="258" dlg:height="9" dlg:page="1"/>
</dlg:bulletinboard>
-</dlg:window>
+</dlg:window> \ No newline at end of file
diff --git a/wizards/source/euro/DlgPassword.xdl b/wizards/source/euro/DlgPassword.xdl
index 43e094b53d54..aa4bafdc7aed 100644
--- a/wizards/source/euro/DlgPassword.xdl
+++ b/wizards/source/euro/DlgPassword.xdl
@@ -1,16 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
-
-<dlg:window xmlns:dlg="http://openoffice.org/2000/dialog" dlg:id="DlgPassword" dlg:style-id="0" dlg:title="DlgPassword" dlg:left="77" dlg:top="93" dlg:width="313" dlg:height="64">
+<!DOCTYPE dlg:window PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "dialog.dtd">
+<dlg:window xmlns:dlg="http://openoffice.org/2000/dialog" dlg:id="DlgPassword" dlg:style-id="0" dlg:title="DlgPassword" dlg:left="77" dlg:top="93" dlg:width="310" dlg:height="65">
<dlg:styles>
<dlg:style dlg:style-id="0"/>
</dlg:styles>
<dlg:bulletinboard>
- <dlg:titledbox dlg:style-id="0" dlg:id="frmPassword" dlg:tab-index="0" dlg:left="7" dlg:top="5" dlg:width="244" dlg:height="28">
- <dlg:title dlg:value="frmPassword"/>
- </dlg:titledbox>
- <dlg:button dlg:style-id="0" dlg:id="cmdGoOn" dlg:tab-index="1" dlg:left="260" dlg:top="7" dlg:width="47" dlg:height="13" dlg:value="cmdGoOn"/>
- <dlg:button dlg:style-id="0" dlg:id="cmdCancel" dlg:tab-index="2" dlg:left="260" dlg:top="24" dlg:width="47" dlg:height="13" dlg:value="cmdCancel"/>
- <dlg:button dlg:style-id="0" dlg:id="cmdHelp" dlg:tab-index="3" dlg:left="260" dlg:top="47" dlg:width="47" dlg:height="13" dlg:value="cmdHelp"/>
- <dlg:textfield dlg:style-id="0" dlg:id="txtPassword" dlg:tab-index="4" dlg:left="11" dlg:top="15" dlg:width="235" dlg:height="13" dlg:echochar="*"/>
+ <dlg:button dlg:style-id="0" dlg:id="cmdGoOn" dlg:tab-index="0" dlg:left="251" dlg:top="6" dlg:width="53" dlg:height="14" dlg:value="cmdGoOn">
+ <dlg:event dlg:listener-type="com.sun.star.awt.XActionListener" dlg:event-method="actionPerformed" dlg:script-type="StarBasic" dlg:script-code="Euro.Protect.ReadPassword"/>
+ </dlg:button>
+ <dlg:button dlg:style-id="0" dlg:id="cmdCancel" dlg:tab-index="1" dlg:left="251" dlg:top="24" dlg:width="53" dlg:height="14" dlg:value="cmdCancel">
+ <dlg:event dlg:listener-type="com.sun.star.awt.XActionListener" dlg:event-method="actionPerformed" dlg:script-type="StarBasic" dlg:script-code="Euro.Protect.RejectPassword"/>
+ </dlg:button>
+ <dlg:button dlg:style-id="0" dlg:id="cmdHelp" dlg:tab-index="2" dlg:left="251" dlg:top="45" dlg:width="53" dlg:height="14" dlg:value="cmdHelp"/>
+ <dlg:textfield dlg:style-id="0" dlg:id="txtPassword" dlg:tab-index="3" dlg:left="11" dlg:top="18" dlg:width="232" dlg:height="12" dlg:echochar="*"/>
+ <dlg:fixedline dlg:style-id="0" 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> \ No newline at end of file
diff --git a/wizards/source/euro/Hard.xba b/wizards/source/euro/Hard.xba
index 5bf973885277..42a300338de8 100644
--- a/wizards/source/euro/Hard.xba
+++ b/wizards/source/euro/Hard.xba
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-
+<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Hard" script:language="StarBasic">REM ***** BASIC *****
Option Explicit
&apos;ToDo: Währung wechseln und dann sehen, ob die Listbox mit den neuen Ranges aufgefrischt wird
@@ -7,11 +7,11 @@ Option Explicit
Sub CreateRangeList()
Dim MaxIndex as Integer
+ MaxIndex = -1
EnableStep1DialogControls(False, False, False)
EmptySelection()
- DialogModel.lblSelection.Label = sCURRRANGES &apos;&quot;Währungsbereiche:&quot;
+ DialogModel.lblSelection.Label = sCURRRANGES &apos;&quot;Währungsbereiche:&quot;
EmptyListbox(DialogModel.lstSelection)
- Msgbox DialogModel.optCellTemplates.State
oDocument.CurrentController.Select(oSelRanges)
If (DialogModel.optSheetRanges.State = 1) AND (DialogModel.chkComplete.State &lt;&gt; 1) Then
&apos; Ist das Sheet Grundlage für die Bearbeitung?
@@ -19,6 +19,7 @@ Dim MaxIndex as Integer
osheet = oDocument.CurrentController.GetActiveSheet
oRanges = osheet.CellFormatRanges.createEnumeration()
MaxIndex = AddSheetRanges(oRanges, MaxIndex, oSheet, False)
+ ReDim Preserve RangeList(MaxIndex,1)
Else
CreateRangeEnumeration(False)
bRangeListDefined = True
@@ -29,10 +30,10 @@ End Sub
Sub CreateRangeEnumeration(bAutopilot as Boolean)
-Dim i, MaxIndex as integer
+Dim i as Integer
+Dim MaxIndex as integer
Dim sStatustext as String
- MaxIndex = 0
- &apos; oder das Dokument - dann müsssen alle Sheets abgearbeitet werden
+ MaxIndex = -1
If Not bRangeListDefined Then
&apos; Die Ranges sind noch nicht definiert
oSheets = oDocument.Sheets
@@ -46,18 +47,21 @@ Dim sStatustext as String
oStatusline.SetText(sStatusText)
End If
oRanges = osheet.CellFormatRanges.createEnumeration
- RangeList(0) = AddSheetRanges(oRanges, MaxIndex, oSheet, bAutopilot)
+ MaxIndex = AddSheetRanges(oRanges, MaxIndex, oSheet, bAutopilot)
Next i
Else
- oStatusline.SetText(sStsRELRANGES) &apos;&quot;Erfassung der relevanten Bereiche...&quot;
- &apos; Die Ranges sind schon definiert
- For I = 0 To CInt(RangeList(0))
- If RangeList(i) &lt;&gt; &quot;&quot; AND RangeBools(i) = True Then
- If Not bAutoPilot Then
+ If Not bAutoPilot Then
+ oStatusline.SetText(sStsRELRANGES) &apos;&quot;Erfassung der relevanten Bereiche...&quot;
+ &apos; Die Ranges sind schon definiert
+ For i = 0 To Ubound(RangeList(),1)
+ If RangeList(i,0) &lt;&gt; &quot;&quot; AND Rangelist(i,1) = True Then
AddSingleItemToListBox(DialogModel.lstSelection, RangeList(i))
End If
- End If
- Next
+ Next
+ End If
+ End If
+ If MaxIndex &gt; -1 Then
+ ReDim Preserve RangeList(MaxIndex,1)
End If
Rangeindex = MaxIndex
End Sub
@@ -68,54 +72,51 @@ Function AddSheetRanges(oRanges as Object, r as Integer, oSheet as Object, bAuto
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
- &apos; Den Namen der Range ermitteln und in ein Array packen
- RangeName = RetrieveRangeNamefromAddress(oRange.RangeAddress, oSheet.Name)
+ 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(),1)
r = r + 1
- RangeList(r) = RangeName
- RangeBools(r) = True
+ If r &gt; MaxIndex Then
+ MaxIndex = MaxIndex + SBRANGEUBOUND
+ ReDim Preserve RangeList(MaxIndex,1)
+ End If
+ RangeList(r,0) = RangeName
+ RangeList(r,1) = True
End If
Wend
AddSheetRanges = r
End Function
-
&apos; Fügt einen Bereich zur selektierten Kollektion hinzu
Sub SelectRange()
-Dim i, a, s as Integer
-Dim Listbox as Object
+Dim i as Integer
Dim RangeName as String
Dim SelItem as String
-Dim LocRangeList(100) as String
Dim CurRange as String
Dim SheetRangeName as String
-Dim DescriptionList(1) as String
-Dim MaxRangeIndex, StatusValue as Integer
-
+Dim DescriptionList() as String
+Dim MaxRangeIndex as Integer
+Dim StatusValue as Integer
StatusValue = 0
- MaxRangeIndex = Val(SelRangeList(0))
- Listbox = DialogModel.lstSelection
- a = 0
+ MaxRangeIndex = Ubound(SelRangeList())
CurSheetName = oSheet.Name
- For i = 1 To MaxRangeIndex
+ For i = 0 To MaxRangeIndex
SelItem = SelRangeList(i)
&apos; Is the Range already included in the collection?
oRange = RetrieveRangeoutOfRangename(SelItem)
TotCellCount = TotCellCount + CountRangeCells(oRange)
- LocRangeList(a) = SelItem
- a = a + 1
- &apos; Der Listboxeintrag ist frisch selektiert worden und muß der Range - Kollektion
- &apos; hinzugefügt werden
DescriptionList() = ArrayOutofString(SelItem,&quot;.&quot;,1)
SheetRangeName = DeleteStr(DescriptionList(0),&quot;&apos;&quot;)
If SheetRangeName = CurSheetName Then
@@ -123,65 +124,45 @@ Dim MaxRangeIndex, StatusValue as Integer
End If
IncreaseStatusValue(SBRELGET/MaxRangeIndex)
Next i
-
- &apos; Das Array mit den selektierten Listboxeinträgen aktualisieren
- ClearArray(ListboxItems())
- For s = 0 To a - 1
- CurRange = LocRangeList(s)
- ListboxItems(s) = CurRange
- Next s
End Sub
-Sub ConvertThehardWay(ListboxList(), ThisSel(), SwitchFormat as Boolean, bAutopilot as Boolean)
-Dim i, a, r as Integer
+Sub ConvertThehardWay(ListboxList(), SwitchFormat as Boolean, bRemove as Boolean)
+Dim i as Integer &apos; r, a
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
- &apos; Index für die Removelist
- a = 0
OldStatusValue = StatusValue
&apos; Harte Formatierung
For i = 0 To LastIndex
- If ThisSel(i) = True Then
- RangeName = ListboxList(i)
- oRange = RetrieveRangeoutofRangeName(RangeName)
- ConvertCellCurrencies(oRange)
- If NOT bAutoPilot Then
-&apos; The following line has been put beside due to Bug #73157 (Two ranges lying side by side)
-&apos; If oSelRanges.HasbyName(RangeName) Then
+ RangeName = ListboxList(i)
+ oRange = RetrieveRangeoutofRangeName(RangeName)
+ ConvertCellCurrencies(oRange)
+ If bRemove Then
+ If oSelRanges.HasbyName(RangeName) Then
oSelRanges.RemovebyName(RangeName)
- oDocument.CurrentController.Select(oSelRanges)
-&apos; End If
- End If
-
- If SwitchFormat Then
- If oRange.getPropertyState(&quot;NumberFormat&quot;) &lt;&gt; 1 Then
- &apos; Range Ist hart formatiert
- SwitchNumberFormat(oRange, oFormats, sEuroSign)&apos; &quot;€&quot;)
- End If
- Else
- SwitchNumberFormat(oRange, oFormats, sEuroSign) &apos;&quot;€&quot;
+ oDocument.CurrentController.Select(oSelRanges)
End If
- AddCells = CountRangeCells(oRange)
- CurCellCount = AddCells
- IncreaseStatusValue((CurCellCount/TotCellCount)*(100-OldStatusValue))
-
- &apos; Die selektierte Stilvorlage muß zum Schluß aus der Listbox entfernt werden
- If bPreSelected Then
- RemoveList(0) = ListboxList(i)
- Else
- r = IndexinArray(ListboxList(i), RangeList())
- If r &lt;&gt; -1 Then
- RangeBools(r) = False
- RemoveList(a) = RangeList(r)
- a = a + 1
- End If
+ End If
+ If SwitchFormat Then
+ If oRange.getPropertyState(&quot;NumberFormat&quot;) &lt;&gt; 1 Then
+ &apos; Range Ist hart formatiert
+ SwitchNumberFormat(oRange, oFormats, sEuroSign)&apos; &quot;€&quot;)
End If
+ Else
+ SwitchNumberFormat(oRange, oFormats, sEuroSign) &apos;&quot;€&quot;
+ End If
+ AddCells = CountRangeCells(oRange)
+ CurCellCount = AddCells
+ IncreaseStatusValue((CurCellCount/TotCellCount)*(100-OldStatusValue))
+ If bRemove Then
+ RemoveListBoxItemByName(oSelListbox.Model,Rangename)
End If
Next
End If
@@ -192,7 +173,7 @@ 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 )
+ oValues = oRange.queryContentCells(com.sun.star.sheet.CellFlags.VALUE)
If (oValues.Count &gt; 0) Then
oCells = oValues.Cells.createEnumeration
While oCells.hasMoreElements
diff --git a/wizards/source/euro/Init.xba b/wizards/source/euro/Init.xba
index 0e51dc775531..e68ff563caea 100644
--- a/wizards/source/euro/Init.xba
+++ b/wizards/source/euro/Init.xba
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-
+<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Init" script:language="StarBasic">Option Explicit
REM ***** BASIC *****
@@ -12,6 +12,14 @@ REM ***** BASIC *****
&apos; Wir sollten informiert werden, ob und wie oder wann das Standard - Währungsformat für die Euroländer umgesetzt
&apos; wird.
+Public Const SBRANGEUBOUND = 20
+Public StyleRangeAssignmentList(SBRANGEUBOUND)as String
+Public SelRangeList(SBRANGEUBOUND) as String
+Public RangeList(SBRANGEUBOUND, 1) as String
+Public UnprotectList() as String
+Public FilterNames(7,1) as String
+
+
Public sREADY as String
Public sPROTECT as String
Public sCONTINUE as String
@@ -86,7 +94,6 @@ Public oRange as Object
Public nLanguage as integer
Public nFormatLanguage as integer
Public aCellFormat as Variant
-Public StyleRangeAssignmentList(20,50)as String
Public oDocument as Object
Public StartCol, StartRow, EndCol, EndRow as String
Public oSheet as Object
@@ -95,16 +102,12 @@ Public oSelRanges as Object
Public nFormatType as Integer
Public sFormatCurrency as String
Public sFormatLanguage as String
-Public RangeList(200) as String
-Public SelRangeList(200) as String
-Public ListboxItems(200) as String
Public CurSheetName as String
Public oStatusLine as Object
Public Const SBRELGET = 50
Public StatusValue as Single
Public TotCellCount as Long
Public StyleIndex as Integer
-Public RemoveList(100) as String
Public RangeIndex as Integer
Public CurrIndex as Integer
Public ActLangNumber(1) as Integer
@@ -115,15 +118,13 @@ Public CurrLanguage as String
Public CurrValue(11,5)
Public LangIDValue(11,2,2) as String
Public PreName as String
-Public oAddressRanges as Object
Public Separator as String
Public BitmapDir as String
Public TypeIndex as Integer, CSIndex as Integer, LangIndex as Integer, FSIndex as Integer
-Public oLocale as Object
+Public oLocale as New com.sun.star.lang.Locale
Public sEuroSign as String
Public oPointer as Object
Public sDocType as String
-Public RangeBools(100) as Boolean
Public bPreSelected as Boolean
Public DocDisposed as Boolean
Public bMacroStopped as Boolean
@@ -131,101 +132,122 @@ Public bRecursive as Boolean
Public bCancelProtection as Boolean
Public CurrRoundMode as Boolean
Public bRangeListDefined as Boolean
+&apos; Note the variable bDocHasProtectedSheets does not contain information
+&apos; wether sheets have to be reprotected
+Public bDocHasProtectedSheets as Boolean
Public sGOON as String
Public sHELP as String
Public sCANCEL as String
Sub InitializeResources()
- &apos; Strings that are also needed by the Password Dialog
- sGoOn = GetResText(1003)
- sHelp = GetResText(1001)
- sCANCEL = GetResText(1000)
- DialogModel.cmdCancel.Label = sCANCEL
- DialogModel.cmdHelp.Label = sHELP
- DialogModel.cmdBack.Label = GetResText(1002)
- DialogModel.cmdGoOn.Label = sGOON
- DialogModel.lblHint.Label = GetResText(1004)
- DialogModel.lblCurrencies.Label = GetResText(1006)
+ With DialogModel
+ &apos; Strings that are also needed by the Password Dialog
+ sGoOn = GetResText(1003)
+ sHelp = GetResText(1001)
+ sCANCEL = GetResText(1000)
+ .cmdCancel.Label = sCANCEL
+ .cmdHelp.Label = sHELP
+ .cmdBack.Label = GetResText(1002)
+ .cmdGoOn.Label = sGOON
+ .lblHint.Label = GetResText(1004)
+ .lblCurrencies.Label = GetResText(1006)
&apos; Todo: Dieses Model später am Control unsichtbar machen
- If DialogModel.Step = 1 Then
- DialogModel.chkComplete.Label = GetResText(1100)
- DialogModel.frmSelection.Label = GetResText(1101)
- DialogModel.optCellTemplates.Label = GetResText(1102)
- DialogModel.optSheetRanges.Label = GetResText(1103)
- DialogModel.optDocRanges.Label = GetResText(1104)
- DialogModel.optSelRange.Label = GetResText(1105)
+ If .Step = 1 Then
+ .chkComplete.Label = GetResText(1100)
+ .hlnSelection.Label = GetResText(1101)
+ .optCellTemplates.Label = GetResText(1102)
+ .optSheetRanges.Label = GetResText(1103)
+ .optDocRanges.Label = GetResText(1104)
+ .optSelRange.Label = GetResText(1105)
+ sCURRRANGES = GetResText(1108)
+ .lblSelection.Label = sCURRRANGES
+ Else
+ .hlnExtent.Label = GetResText(1200)
+&apos;Todo: Diese Strings in Resourcen!!
+ FilterNames(0,0) = &quot;Calc 6.0&quot;
+ FilterNames(0,1) = &quot;*.sxc&quot;
+ FilterNames(1,0) = &quot;Calc 6.0 Vorlage&quot;
+ FilterNames(1,1) = &quot;*.stc&quot;
+ FilterNames(2,0) = &quot;Star Calc 5.0&quot;
+ FilterNames(2,1) = &quot;*.sdc&quot;
+ FilterNames(3,0) = &quot;Star Calc 5.0 Vorlage&quot;
+ FilterNames(3,1) = &quot;*.vor&quot;
+ FilterNames(4,0) = &quot;Star Calc 4.0&quot;
+ FilterNames(4,1) = &quot;*.sdc&quot;
+ FilterNames(5,0) = &quot;Star Calc 4.0 Vorlage&quot;
+ FilterNames(5,1) = &quot;*.vor&quot;
+ FilterNames(6,0) = &quot;Star Calc 3.0&quot;
+ FilterNames(6,1) = &quot;*.sdc&quot;
+ FilterNames(7,0) = &quot;Star Calc 3.0 Vorlage&quot;
+ FilterNames(7,1) = &quot;*.vor&quot;
+ .optSingleFile.Label = &quot;Einzelnes Tabellen- oder Textdokument&quot;&apos;GetResText(1201)
+ .optWholeDir.Label = GetResText(1202)
+ .chkProtect.Label = GetResText(1207)
+ .chkTextDocuments.Label = &quot;Auch Feldbefehle und Tabellen in Textdokumenten konvertieren&quot;
+ sSOURCEFILE = GetResText(1203)
+ sSOURCEDIR = GetResText(1204)
+ .lblSource.Label = sSOURCEDIR
+ .chkRecursive.Label = GetResText(1205)
+ sTARGETDIR = GetResText(1206)
+ .lblTarget.Label = STARGETDIR
+ .optWholeDir.State = 1
+ .txtSource.Text = ConvertfromUrl(GetPathSettings(&quot;Work&quot;))
+ .txtTarget.Text = .txtSource.Text
+ .hlnProgress.Label = GetResText(1600)
+ .lblConfig.Label = GetResText(1603)
+ sPrgsRETRIEVAL = GetResText(1601)
+ sPrgsCONVERTING = GetResText(1602)
+ sPrgsUNPROTECT = GetResText(1604)
+ End If
+ .cmdBack.Enabled = False
+ sPROTECT = GetResText(1005)
+ sCONTINUE = GetResText(1007)
+ sSELTEMPL = GetResText(1106)
+ sSELCELL = GetResText(1107)
sCURRRANGES = GetResText(1108)
- DialogModel.lblSelection.Label = sCURRRANGES
- Else
- DialogModel.frmExtent.Label = GetResText(1200)
- DialogModel.optSingleFile.Label = &quot;Einzelnes Tabellen- oder Textdokument&quot;&apos;GetResText(1201)
- DialogModel.optWholeDir.Label = GetResText(1202)
- DialogModel.chkProtect.Label = GetResText(1207)
- DialogModel.chkTextDocuments.Label = &quot;Auch Feldbefehle und Tabellen in Textdokumenten konvertieren&quot;
- sSOURCEFILE = GetResText(1203)
- sSOURCEDIR = GetResText(1204)
- DialogModel.lblSource.Label = sSOURCEDIR
- DialogModel.chkRecursive.Label = GetResText(1205)
- sTARGETDIR = GetResText(1206)
- DialogModel.lblTarget.Label = STARGETDIR
- DialogModel.optWholeDir.State = 1
- DialogModel.txtSource.Text = ConvertfromUrl(GetPathSettings(&quot;Work&quot;))
- DialogModel.txtTarget.Text = DialogModel.txtSource.Text
- DialogModel.frmProgress.Label = GetResText(1600)
- DialogModel.lblConfig.Label = GetResText(1603)
- sPrgsRETRIEVAL = GetResText(1601)
- sPrgsCONVERTING = GetResText(1602)
- sPrgsUNPROTECT = GetResText(1604)
- End If
- DialogModel.cmdBack.Enabled = False
- sPROTECT = GetResText(1005)
- sCONTINUE = GetResText(1007)
- sSELTEMPL = GetResText(1106)
- sSELCELL = GetResText(1107)
- sCURRRANGES = GetResText(1108)
- sTEMPLATES = GetResText(1109)
- sStsPROGRESS = GetResText(1300)
- sStsCELLPROGRSS = GetResText(1301)
- sStsRELSHEETRANGES = GetResText(1302)
- sStsRELRANGES = GetResText(1303)
- sStsREPROTECT = GetResText(1304)
-
- sMsgREADY = GetResText(1400)
- sMsgSELDIR = GetResText(1401)
- sMsgSELFILE = GetResText(1402)
- sMsgTARGETDIR = GetResText(1403)
- sMsgNOTTHERE = GetResText(1404)
- sMsgDLGTITLE = GetResText(1405)
- sMsgUNPROTECT = GetResText(1406)
- sMsgPWPROTECT = GetResText(1407)
- sMsgWRONGPW = GetResText(1408)
- sMsgSHEETPROTECTED = GetResText(1409)
- sMsgWARNING = GetResText(1410)
- sMsgSHEETSNOPROTECT = GetResText(1411)
- sMsgSHEETNOPROTECT = GetResText(1412)
- sMsgCHOOSECURRENCY = GetResText(1415)
- sMsgPASSWORD = GetResText(1416)
- sMsgOK = GetResText(1417)
- sMsgCANCEL = GetResText(1418)
- sMsgFILEINVALID = GetResText(1419)
- sMsgFILEINVALID = ReplaceString(sMsgFILEINVALID,&quot;%PRODUCTNAME&quot;, GetProductname())
- SMsgNODIRECTORY = GetResText(1420)
- sMsgDOCISREADONLY = GetResText(1421)
- sCurrPORTUGUESE = GetResText(1500)
- sCurrDUTCH = GetResText(1501)
- sCurrFRENCH = GetResText(1502)
- sCurrSPANISH = GetResText(1503)
- sCurrITALIAN = GetResText(1504)
- sCurrGERMAN = GetResText(1505)
- sCurrBELGIAN = GetResText(1506)
- sCurrIRISH = GetResText(1507)
- sCurrLUXEMBOURG = GetResText(1508)
- sCurrAUSTRIAN = GetResText(1509)
- sCurrFINNISH = GetResText(1510)
- sCurrGREEK = GetResText(1511)
- sCurrUNKNOWN = GetResText(1511)
- sCurrSYSUNKNOWN = GetResText(1512)
+ sTEMPLATES = GetResText(1109)
+ sStsPROGRESS = GetResText(1300)
+ sStsCELLPROGRSS = GetResText(1301)
+ sStsRELSHEETRANGES = GetResText(1302)
+ sStsRELRANGES = GetResText(1303)
+ sStsREPROTECT = GetResText(1304)
+ sMsgREADY = GetResText(1400)
+ sMsgSELDIR = GetResText(1401)
+ sMsgSELFILE = GetResText(1402)
+ sMsgTARGETDIR = GetResText(1403)
+ sMsgNOTTHERE = GetResText(1404)
+ sMsgDLGTITLE = GetResText(1405)
+ sMsgUNPROTECT = GetResText(1406)
+ sMsgPWPROTECT = GetResText(1407)
+ sMsgWRONGPW = GetResText(1408)
+ sMsgSHEETPROTECTED = GetResText(1409)
+ sMsgWARNING = GetResText(1410)
+ sMsgSHEETSNOPROTECT = GetResText(1411)
+ sMsgSHEETNOPROTECT = GetResText(1412)
+ sMsgCHOOSECURRENCY = GetResText(1415)
+ sMsgPASSWORD = GetResText(1416)
+ sMsgOK = GetResText(1417)
+ sMsgCANCEL = GetResText(1418)
+ sMsgFILEINVALID = GetResText(1419)
+ sMsgFILEINVALID = ReplaceString(sMsgFILEINVALID,&quot;%PRODUCTNAME&quot;, GetProductname())
+ SMsgNODIRECTORY = GetResText(1420)
+ sMsgDOCISREADONLY = GetResText(1421)
+ sCurrPORTUGUESE = GetResText(1500)
+ sCurrDUTCH = GetResText(1501)
+ sCurrFRENCH = GetResText(1502)
+ sCurrSPANISH = GetResText(1503)
+ sCurrITALIAN = GetResText(1504)
+ sCurrGERMAN = GetResText(1505)
+ sCurrBELGIAN = GetResText(1506)
+ sCurrIRISH = GetResText(1507)
+ sCurrLUXEMBOURG = GetResText(1508)
+ sCurrAUSTRIAN = GetResText(1509)
+ sCurrFINNISH = GetResText(1510)
+ sCurrGREEK = GetResText(1511)
+ sCurrUNKNOWN = GetResText(1511)
+ sCurrSYSUNKNOWN = GetResText(1512)
+ End With
End Sub
@@ -415,13 +437,14 @@ Dim i as Integer
CurrValue(10,4) = &quot;mk&quot;
CurrValue(10,5) = &quot;FIM&quot;
+&apos; Todo: Werte verlorengegangen?
CurrValue(11,0) = sCurrGREEK
&apos; Wahrer Umrechnungskurs
CurrValue(11,1) = 340.750
&apos; Gerundeter Umrechnungskurs
CurrValue(11,2) = 400
- CurrValue(11,3) = &quot;Δρχ&quot;
- CurrValue(11,4) = &quot;Δρχ&quot;
+ CurrValue(11,3) = chr(916) &amp; chr(961) &amp; chr(967)
+ CurrValue(11,4) = chr(916) &amp; chr(961) &amp; chr(967)
CurrValue(11,5) = &quot;GRD&quot;
i = -1
@@ -447,7 +470,11 @@ Dim Isthere as Boolean
bCancelProtection = False
bMacroStopped = False
bRangeListDefined = False
+ PWIndex = -1
sDocType = GetDocumentType(StarDesktop.ActiveFrame.Controller.Model)
+ If sDocType = &quot;sCalc&quot; Then
+ bDocHasProtectedSheets = CheckSheetProtection(oSheets)
+ End If
DialogConvert = LoadDialog(&quot;Euro&quot;, &quot;DlgConvert&quot;)
DialogModel = DialogConvert.Model
DialogPassword = LoadDialog(&quot;Euro&quot;, &quot;DlgPassword&quot;)
@@ -466,7 +493,6 @@ Dim Isthere as Boolean
FilterList(5) = &quot;application/vnd.sun.xml.calc&quot;
FilterList(6) = &quot;application/vnd.sun.xml.writer&quot;
BitmapDir = GetOfficeSubPath(&quot;Template&quot;, &quot;wizard/bitmap&quot;)
- UnprotectList(0,0) = &quot;0&quot;
FillUpCurrencyListbox()
DialogModel.imgPreview.ImageUrl = BitmapDir &amp; &quot;euro_&quot; &amp; DialogModel.Step &amp; &quot;.bmp&quot;
DialogConvert.Title = sMsgDLGTITLE
diff --git a/wizards/source/euro/Protect.xba b/wizards/source/euro/Protect.xba
new file mode 100644
index 000000000000..86ef4c87cff1
--- /dev/null
+++ b/wizards/source/euro/Protect.xba
@@ -0,0 +1,170 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
+<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Protect" script:language="StarBasic">REM ***** BASIC *****
+Option Explicit
+
+Dim PWIndex as Integer
+
+Function UnprotectSheetsWithPassWord(oSheets as Object)
+Dim i as Integer
+Dim MaxIndex as Integer
+ PWIndex = -1
+ If bDocHasProtectedSheets Then
+ &apos; At First query if sheets shall generally be unprotected
+ DoUnprotect = Msgbox(sMsgUNPROTECT,36,sMsgDLGTITLE)
+ If DoUnProtect = 6 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;Geben Sie das Kennwort zum Entschützen der Tabelle &apos;&quot; &amp; ListSheetName &amp; &quot; ein:&apos;&quot;
+ Do
+ ExecutePasswordDialog(QueryText)
+ If bCancelProtection Then
+ bCancelProtection = False
+ Msgbox (sMsgSHEETSNOPROTECT, 64, sMsgDLGTITLE)
+ UnprotectSheetWithDialog() = False &apos;&quot;Tabelle wird nicht entschützt!&quot;
+ 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 &apos;&quot;Tabelle wird nicht entschützt!&quot;
+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
+ oStatusline.SetText(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
+ oStatusline.SetText(&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> \ No newline at end of file
diff --git a/wizards/source/euro/Soft.xba b/wizards/source/euro/Soft.xba
index 3a078f253554..a18f521d6489 100644
--- a/wizards/source/euro/Soft.xba
+++ b/wizards/source/euro/Soft.xba
@@ -1,13 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
-
+<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Soft" script:language="StarBasic">Option Explicit
REM ***** BASIC *****
-&apos;Assignmentlist:
-
-&apos; Stylename ; Defined ; Selected ; RangeCellCount ; Range No 1 ; Range No 2 ...
-&apos; 0 1 2 3 4
-
Sub CreateStyleEnumeration()
EmptySelection()
@@ -18,138 +13,142 @@ Sub CreateStyleEnumeration()
End Sub
-Sub MakeStyleEnumeration(bAutoPilot as Boolean)
+Sub MakeStyleEnumeration(bAddToListbox as Boolean)
Dim m as integer
Dim aStyleFormat as Object
Dim Stylename as String
-Dim AddToList as Boolean
- StyleIndex = 0
+ StyleIndex = -1
oStyles = oDocument.StyleFamilies.GetbyIndex(0)
For m = 0 To oStyles.count-1
oStyle = oStyles.GetbyIndex(m)
StyleName = oStyle.Name
- AddToList = CheckFormatType(oStyle)
- If AddToList Then
- If Not bAutoPilot Then
+ If CheckFormatType(oStyle) Then
+ If Not bAddToListBox Then
AddSingleItemToListbox(DialogModel.lstSelection, Stylename)
Else
- SwitchNumberFormat(ostyle, oFormats, sEuroSign)&apos; &quot;€&quot;)
- EuroStyles(StyleIndex) = Stylename
- EuroBools(StyleIndex) = True
+ SwitchNumberFormat(ostyle, oFormats, sEuroSign)
End If
- StyleRangeAssignmentList(StyleIndex,0) = Stylename
StyleIndex = StyleIndex + 1
+ 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 CurStyleName as String
-Dim oTempRanges as Object
-Dim i, n, m, t as integer
-Dim Rangename as String
-Dim oRangeAddress as Object
-Dim SheetName as String
-Dim SheetThere as Boolean
-Dim StyleCellCount as Long
-Dim AddRange as Boolean
-Dim oListSheet as Object
-Dim SheetsCount as Integer
+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
- SheetsCount = oSheets.Count
oStatusLine.SetText(sStsRELRANGES) &apos;&quot;Erfassung der relevanten Bereiche...&quot;
- &apos; Zähler für die selektierten Einträge
- StyleCellCount = 0
- TotCellcount = 0
For i = 0 To LastIndex
CurStyleName = StyleList(i)
-
- &apos; Finde den Index in der Zuordnungstabelle
- n = IndexinArray(CurStyleName, StyleRangeAssignmentList())
-
- &apos; Ist der Listboxeintrag selektiert?
- If SelList(i) = True Then
- m = 4
- StyleRangeAssignmentList(n,2) = 1
-
- If StyleRangeAssignmentList(n,1) &lt;&gt; 1 Then
- &apos; Die Ranges für diesen Style sind noch nicht definiert
- StyleCellCount = 0
- For t = 0 To sheetscount - 1
- oSheet = oSheets.GetbyIndex(t)
- SheetName = oSheet.Name
- &apos; Der Listboxeintrag ist frisch selektiert worden und muß der Ranges - Kollektion
- &apos; hinzugefügt werden
-
- &apos; Dem Stylenamen sind keine Ranges zugeordnet
- &apos; Diese holen wir mit der folgenden Schleife nach
- 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(oRangeAddress,SheetName)
- oListSheet = RetrieveSheetoutofRangeName(RangeName)
- AddRange = UnprotectSheet(oListSheet)
- If AddRange Then
- &apos; Jetzt den Index für den Style ermitteln
- StyleRangeAssignmentList(n,m) = RangeName
-
- &apos; Die gesamtZahl der Zellen anpassen
- StyleCellCount = StyleCellCount + CountRangeCells(oRange)
- m = m + 1
- End If
- End If
- End If
- Wend
- Next t
- TotCellCount = TotCellCount + StyleCellCount
- &apos; Die Ranges für den Stil sind jetzt definiert
- StyleRangeAssignmentList(n,1) = &quot;1&quot;
- StyleRangeAssignmentList(n,3) = cStr(StyleCellCount)
+ 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
-&apos; TotCellCount = TotCellCount + Int(StyleRangeAssignmentlist(n,3)
- Else
+ Else
&apos; Style is not selected
- If StyleRangeAssignmentList(n,2) = &quot;1&quot; Then
- StyleRangeAssignmentList(n,2) = &quot;0&quot;
- DeselectStyle(CurStyleName)
+ 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
+End Sub
-&apos; löscht eine Stilvorlage aus der Kollektion, die die Ranges selektiert
-Sub DeselectStyle(DeSelStyleName as String)
-Dim n, m as Integer
+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; Finde den Index in der Zuordnungstabelle
- n = IndexinArray(DeSelStyleName, StyleRangeAssignmentList(), 1)
- m = 4
- Do
- RangeName = StyleRangeAssignmentList(n,m)
- If RangeName &lt;&gt; &quot;&quot; Then
+
+&apos; löscht eine Stilvorlage aus der Kollektion, die die Ranges selektiert
+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)
- m = m + 1
End If
- Loop until RangeName = &quot;&quot;
+ 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(oRangeAddress as Object, Sheetname as String) as String
+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
- oAddressRanges.RemovebyName(RangeName)
+&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
@@ -176,58 +175,65 @@ Function RetrieveRangeoutofRangeName(TableText as String)
End Function
-Sub ConvertTheSoftWay(StyleList() as String, ThisSel() as Boolean, bAutopilot as Boolean)
-Dim a, i, m, n, s as Integer
+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())
- &apos; Index für die Removelist
- a = 0
OldStatusValue = StatusValue
For i = 0 To LastIndex
- If ThisSel(i) = True Then
- CurStyleName = StyleList(i)
- oStyle = oStyles.GetbyName(CurStyleName)
-
- &apos; Jetzt die Ranges abarbeiten, die mit der Vorlage verknüpft sind
- &apos; Gibt es den Listboxeintrag schon in der Zuordnungstabelle?
- n = IndexinArray(CurStyleName, StyleRangeAssignmentList(), 1)
- m = 4
-
- Do
- RangeName = StyleRangeAssignmentList(n,m)
- If RangeName &lt;&gt; &quot;&quot; Then
- oRange = RetrieveRangeoutofRangeName(RangeName)
- If oRange.getPropertyState(&quot;NumberFormat&quot;) = 1 Then
- &apos; Range Ist hart formatiert
- ConvertCellCurrencies(oRange)
- CurCellCount = CountRangeCells(oRange)
- End If
- IncreaseStatusvalue((CurCellCount/TotCellCount)*(95-OldStatusValue))
- If NOT bAutoPilot Then
-&apos; The following line has been put aside due to Bug #73157 (Two ranges lying side by side)
-&apos; They should be reintegrated after the bugfix, as in future versions oSelRangs might throw an exception
-&apos; If oSelRanges.HasbyName(RangeName) Then
- oSelRanges.RemovebyName(RangeName)
- oDocument.CurrentController.Select(oSelRanges)
-&apos; End If
- End If
- m = m + 1
+ 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 Ist hart formatiert
+ 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
- Loop Until RangeName = &quot;&quot;
-
- &apos; Zuletzt das Währungsformat in den Vorlagen anpassen
- SwitchNumberFormat( ostyle, oFormats, sEuroSign)
-&apos; oStatusline.SetValue(100)
- &apos; Die Vorlage wird aus der Zuordnungstabelle gelöscht
- For s = 0 To m - 1
- StyleRangeAssignmentList(n,s) = &quot;&quot;
- Next
- &apos; Die selektierte Stilvorlage muß zum Schluß aus der Listbox entfernt werden
- RemoveList(a) = StyleList(i)
- a = a + 1
- End If
+ End If
+ Next s
+ SwitchNumberFormat( ostyle, oFormats, sEuroSign)
+&apos; oStatusline.SetValue(100)
+ StyleRangeAssignmentList(n) = &quot;&quot;
+ l = GetItemPos(oSelListBox.Model, CurStyleName)
+ oSelListbox.RemoveItems(l,1)
Next
-End Sub</script:module> \ No newline at end of file
+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> \ No newline at end of file
diff --git a/wizards/source/euro/Writer.xba b/wizards/source/euro/Writer.xba
index 8e3409bdd4fd..17978b0402b9 100644
--- a/wizards/source/euro/Writer.xba
+++ b/wizards/source/euro/Writer.xba
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-
+<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Writer" script:language="StarBasic">REM ***** BASIC *****