AutoPilotRun.xba (79ff0626) AutoPilotRun.xba (e4184268)
1<?xml version="1.0" encoding="UTF-8"?>
2<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
3<!--***********************************************************
4 *
5 * Licensed to the Apache Software Foundation (ASF) under one
6 * or more contributor license agreements. See the NOTICE file
7 * distributed with this work for additional information
8 * regarding copyright ownership. The ASF licenses this file

--- 17 unchanged lines hidden (view full) ---

26Public TargetDir as String
27Public TargetStemDir as String
28Public SourceFile as String
29Public TargetFile as String
30Public Source as String
31Public SubstFile as String
32Public SubstDir as String
33Public NoArgs()
1<?xml version="1.0" encoding="UTF-8"?>
2<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
3<!--***********************************************************
4 *
5 * Licensed to the Apache Software Foundation (ASF) under one
6 * or more contributor license agreements. See the NOTICE file
7 * distributed with this work for additional information
8 * regarding copyright ownership. The ASF licenses this file

--- 17 unchanged lines hidden (view full) ---

26Public TargetDir as String
27Public TargetStemDir as String
28Public SourceFile as String
29Public TargetFile as String
30Public Source as String
31Public SubstFile as String
32Public SubstDir as String
33Public NoArgs()
34Public TypeList(14) as String
34Public TypeList(6) as String
35Public GoOn as Boolean
36Public DoUnprotect as Integer
37Public Password as String
38Public DocIndex as Integer
39Public oPathSettings as Object
40Public oUcb as Object
41Public TotDocCount as Integer
42Public sTotDocCount as String

--- 29 unchanged lines hidden (view full) ---

72 If DialogModel.optSingleFile.State = 1 Then
73 SourceFile = Source
74 TotDocCount = 1
75 Else
76 SourceDir = Source
77 TargetStemDir = TargetDir
78 TypeList(0) = &quot;calc8&quot;
79 TypeList(1) = &quot;calc_StarOffice_XML_Calc&quot;
35Public GoOn as Boolean
36Public DoUnprotect as Integer
37Public Password as String
38Public DocIndex as Integer
39Public oPathSettings as Object
40Public oUcb as Object
41Public TotDocCount as Integer
42Public sTotDocCount as String

--- 29 unchanged lines hidden (view full) ---

72 If DialogModel.optSingleFile.State = 1 Then
73 SourceFile = Source
74 TotDocCount = 1
75 Else
76 SourceDir = Source
77 TargetStemDir = TargetDir
78 TypeList(0) = &quot;calc8&quot;
79 TypeList(1) = &quot;calc_StarOffice_XML_Calc&quot;
80 TypeList(2) = &quot;calc_StarCalc_30&quot;
81 TypeList(3) = &quot;calc_StarCalc_40&quot;
82 TypeList(4) = &quot;calc_StarCalc_50&quot;
83 If DialogModel.chkTextDocuments.State = 1 Then
80 If DialogModel.chkTextDocuments.State = 1 Then
84 ReDim Preserve TypeList(13) as String
81 ReDim Preserve TypeList(5) as String
85
82
86 TypeList(5) = &quot;writer8&quot;
87 TypeList(6) = &quot;writerglobal8&quot;
88 TypeList(7) = &quot;writer_StarOffice_XML_Writer&quot;
89 TypeList(8) = &quot;writer_globaldocument_StarOffice_XML_Writer_GlobalDocument&quot;
90 TypeList(9) = &quot;writer_StarWriter_30&quot;
91 TypeList(10) = &quot;writer_StarWriter_40&quot;
92 TypeList(11) = &quot;writer_globaldocument_StarWriter_40GlobalDocument&quot;
93 TypeList(12) = &quot;writer_StarWriter_50&quot;
94 TypeList(13) = &quot;writer_globaldocument_StarWriter_50GlobalDocument&quot;
83 TypeList(2) = &quot;writer8&quot;
84 TypeList(3) = &quot;writerglobal8&quot;
85 TypeList(4) = &quot;writer_StarOffice_XML_Writer&quot;
86 TypeList(5) = &quot;writer_globaldocument_StarOffice_XML_Writer_GlobalDocument&quot;
95 End If
96 FilesList() = ReadDirectories(SourceDir, bRecursive, True, False, TypeList())
97 TotDocCount = Ubound(FilesList(),1) + 1
98 End If
99 InitializeProgressPage(DialogModel)
100&apos; ChangeToNextProgressStep()
101 sTotDocCount = CStr(TotDocCount)
102 OpenProperties(0).Name = &quot;Hidden&quot;

--- 31 unchanged lines hidden (view full) ---

134 TargetFile = ReplaceString(SourceFile,TargetStemDir,SourceDir)
135 TargetDir = DirectorynameoutofPath(TargetFile, &quot;/&quot;)
136 Else
137 SourceFile = Source
138 TargetFile = TargetDir &amp; &quot;/&quot; &amp; FileNameoutofPath(SourceFile, &quot;/&quot;)
139 End If
140 If CreateFolder(TargetDir) Then
141 sExtension = GetFileNameExtension(SourceFile, &quot;/&quot;)
87 End If
88 FilesList() = ReadDirectories(SourceDir, bRecursive, True, False, TypeList())
89 TotDocCount = Ubound(FilesList(),1) + 1
90 End If
91 InitializeProgressPage(DialogModel)
92&apos; ChangeToNextProgressStep()
93 sTotDocCount = CStr(TotDocCount)
94 OpenProperties(0).Name = &quot;Hidden&quot;

--- 31 unchanged lines hidden (view full) ---

126 TargetFile = ReplaceString(SourceFile,TargetStemDir,SourceDir)
127 TargetDir = DirectorynameoutofPath(TargetFile, &quot;/&quot;)
128 Else
129 SourceFile = Source
130 TargetFile = TargetDir &amp; &quot;/&quot; &amp; FileNameoutofPath(SourceFile, &quot;/&quot;)
131 End If
132 If CreateFolder(TargetDir) Then
133 sExtension = GetFileNameExtension(SourceFile, &quot;/&quot;)
142 oDocument = OpenDocument(SourceFile, OpenProperties(), bDisposable)
134 oDocument = OpenDocument(SourceFile, OpenProperties(), bDisposable)
143 If (oDocument.IsReadOnly) AND (UCase(SourceFile) = UCase(TargetFile)) Then
144 bIsReadOnly = True
145 Msgbox(sMsgDOCISREADONLY, 16, GetProductName())
146 Else
147 bIsReadOnly = False
148 RetrieveDocumentObjects()
149 sViewPath = CutPathView(SourceFile, 60)
150 DialogModel.lblCurDocument.Label = Str(DocIndex+1) &amp; &quot;/&quot; &amp; sTotDocCount &amp; &quot; (&quot; &amp; sViewPath &amp; &quot;)&quot;

--- 25 unchanged lines hidden (view full) ---

176Dim iOverWrite as Integer
177 If (TargetFile &lt;&gt; &quot;&quot;) And (Not bCancelTask) Then
178 On Local Error Goto NOSAVING
179 If oUcb.Exists(TargetFile) Then
180 sCurFileExists = ReplaceString(sMsgFileExists, ConvertFromUrl(TargetFile), &quot;&lt;1&gt;&quot;)
181 sCurFileExists = ReplaceString(sCurFileExists, chr(13), &quot;&lt;CR&gt;&quot;)
182 iOverWrite = Msgbox (sCurFileExists, 32 + 3, sMsgDLGTITLE)
183 Select Case iOverWrite
135 If (oDocument.IsReadOnly) AND (UCase(SourceFile) = UCase(TargetFile)) Then
136 bIsReadOnly = True
137 Msgbox(sMsgDOCISREADONLY, 16, GetProductName())
138 Else
139 bIsReadOnly = False
140 RetrieveDocumentObjects()
141 sViewPath = CutPathView(SourceFile, 60)
142 DialogModel.lblCurDocument.Label = Str(DocIndex+1) &amp; &quot;/&quot; &amp; sTotDocCount &amp; &quot; (&quot; &amp; sViewPath &amp; &quot;)&quot;

--- 25 unchanged lines hidden (view full) ---

168Dim iOverWrite as Integer
169 If (TargetFile &lt;&gt; &quot;&quot;) And (Not bCancelTask) Then
170 On Local Error Goto NOSAVING
171 If oUcb.Exists(TargetFile) Then
172 sCurFileExists = ReplaceString(sMsgFileExists, ConvertFromUrl(TargetFile), &quot;&lt;1&gt;&quot;)
173 sCurFileExists = ReplaceString(sCurFileExists, chr(13), &quot;&lt;CR&gt;&quot;)
174 iOverWrite = Msgbox (sCurFileExists, 32 + 3, sMsgDLGTITLE)
175 Select Case iOverWrite
184 Case 1 &apos; OK
185 Case 2 &apos; Abort
176 Case 1 &apos; OK
177 Case 2 &apos; Abort
186 bCancelTask = True
187 StoreDocument() = False
188 Exit Function
178 bCancelTask = True
179 StoreDocument() = False
180 Exit Function
189 Case 7 &apos; No
181 Case 7 &apos; No
190 StoreDocument() = False
191 Exit Function
192 End Select
193 End If
194 If TargetFile &lt;&gt; SourceFile Then
195 oDocument.StoreAsUrl(TargetFile,NoArgs)
196 Else
197 oDocument.Store

--- 50 unchanged lines hidden (view full) ---

248 Else
249 TextBoxText = sSOURCEFILE &amp; &quot; &quot; &amp; ConvertFromUrl(Source) &amp; chr(13)
250 End If
251 TextBoxText = TextBoxText &amp; sTARGETDIR &amp; &quot; &quot; &amp; ConvertFromUrl(TargetDir) &amp; chr(13)
252 If DialogModel.chkProtect.State = 1 Then
253 TextBoxText = TextboxText &amp; sPrgsUNPROTECT
254 End If
255 DialogModel.txtConfig.Text = TextBoxText
182 StoreDocument() = False
183 Exit Function
184 End Select
185 End If
186 If TargetFile &lt;&gt; SourceFile Then
187 oDocument.StoreAsUrl(TargetFile,NoArgs)
188 Else
189 oDocument.Store

--- 50 unchanged lines hidden (view full) ---

240 Else
241 TextBoxText = sSOURCEFILE &amp; &quot; &quot; &amp; ConvertFromUrl(Source) &amp; chr(13)
242 End If
243 TextBoxText = TextBoxText &amp; sTARGETDIR &amp; &quot; &quot; &amp; ConvertFromUrl(TargetDir) &amp; chr(13)
244 If DialogModel.chkProtect.State = 1 Then
245 TextBoxText = TextboxText &amp; sPrgsUNPROTECT
246 End If
247 DialogModel.txtConfig.Text = TextBoxText
256 ToggleProgressStep()
248 ToggleProgressStep()
257 DialogModel.cmdGoOn.Enabled = False
258 InitializeThirdStep() = True
259 Else
260 InitializeThirdStep() = False
261 End If
262End Function
263
264
265Sub ToggleProgressStep(Optional aEvent as Object)
266Dim bMakeVisible as Boolean
267Dim LocStep as Integer
268 &apos; If the Sub is call by the &apos;cmdBack&apos; Button then set the &apos;bMakeVisible&apos; variable accordingly
269 bMakeVisible = IsMissing(aEvent)
270 If bMakeVisible Then
271 DialogModel.Step = 3
272 Else
273 DialogModel.Step = 2
274 End If
249 DialogModel.cmdGoOn.Enabled = False
250 InitializeThirdStep() = True
251 Else
252 InitializeThirdStep() = False
253 End If
254End Function
255
256
257Sub ToggleProgressStep(Optional aEvent as Object)
258Dim bMakeVisible as Boolean
259Dim LocStep as Integer
260 &apos; If the Sub is call by the &apos;cmdBack&apos; Button then set the &apos;bMakeVisible&apos; variable accordingly
261 bMakeVisible = IsMissing(aEvent)
262 If bMakeVisible Then
263 DialogModel.Step = 3
264 Else
265 DialogModel.Step = 2
266 End If
275 DialogConvert.GetControl(&quot;lblCurrencies&quot;).Visible = Not bMakeVisible
276 DialogConvert.GetControl(&quot;lstCurrencies&quot;).Visible = Not bMakeVisible
267 DialogConvert.GetControl(&quot;lblCurrencies&quot;).Visible = Not bMakeVisible
268 DialogConvert.GetControl(&quot;lstCurrencies&quot;).Visible = Not bMakeVisible
277 DialogConvert.GetControl(&quot;cmdBack&quot;).Visible = bMakeVisible
269 DialogConvert.GetControl(&quot;cmdBack&quot;).Visible = bMakeVisible
278 DialogConvert.GetControl(&quot;cmdGoOn&quot;).Visible = bMakeVisible
270 DialogConvert.GetControl(&quot;cmdGoOn&quot;).Visible = bMakeVisible
279 DialogModel.imgPreview.ImageUrl = BitmapDir &amp; &quot;euro_&quot; &amp; DialogModel.Step &amp; &quot;.png&quot;
280End Sub
281
282
283Sub EnableStep2DialogControls(OnValue as Boolean)
284 With DialogModel
285 .hlnExtent.Enabled = OnValue
286 .optWholeDir.Enabled = OnValue

--- 98 unchanged lines hidden (view full) ---

385 Dim oMasterKey as Object
386 Dim oTypes() as Object
387 Dim oUIKey() as Object
388
389 oMasterKey = GetRegistryKeyContent(&quot;org.openoffice.TypeDetection.Types&quot;)
390 oTypes() = oMasterKey.Types
391 oUIKey = GetRegistryKeyContent(&quot;org.openoffice.Office.UI/FilterClassification/LocalFilters&quot;)
392 If DialogModel.chkTextDocuments.State = 1 Then
271 DialogModel.imgPreview.ImageUrl = BitmapDir &amp; &quot;euro_&quot; &amp; DialogModel.Step &amp; &quot;.png&quot;
272End Sub
273
274
275Sub EnableStep2DialogControls(OnValue as Boolean)
276 With DialogModel
277 .hlnExtent.Enabled = OnValue
278 .optWholeDir.Enabled = OnValue

--- 98 unchanged lines hidden (view full) ---

377 Dim oMasterKey as Object
378 Dim oTypes() as Object
379 Dim oUIKey() as Object
380
381 oMasterKey = GetRegistryKeyContent(&quot;org.openoffice.TypeDetection.Types&quot;)
382 oTypes() = oMasterKey.Types
383 oUIKey = GetRegistryKeyContent(&quot;org.openoffice.Office.UI/FilterClassification/LocalFilters&quot;)
384 If DialogModel.chkTextDocuments.State = 1 Then
393 Dim FilterNames(11,1) as String
385 Dim FilterNames(7,1) as String
386 FilterNames(4,0) = oTypes.GetByName(&quot;writer8&quot;).UIName
387 FilterNames(4,1) = &quot;*.odt&quot;
388 FilterNames(5,0) = oTypes.GetByName(&quot;writer8_template&quot;).UIName
389 FilterNames(5,1) = &quot;*.ott&quot;
394 FilterNames(6,0) = oTypes.GetByName(&quot;writer_StarOffice_XML_Writer&quot;).UIName
395 FilterNames(6,1) = &quot;*.sxw&quot;
396 FilterNames(7,0) = oTypes.GetByName(&quot;writer_StarOffice_XML_Writer_Template&quot;).UIName
397 FilterNames(7,1) = &quot;*.stw&quot;
390 FilterNames(6,0) = oTypes.GetByName(&quot;writer_StarOffice_XML_Writer&quot;).UIName
391 FilterNames(6,1) = &quot;*.sxw&quot;
392 FilterNames(7,0) = oTypes.GetByName(&quot;writer_StarOffice_XML_Writer_Template&quot;).UIName
393 FilterNames(7,1) = &quot;*.stw&quot;
398 FilterNames(8,0) = oUIKey.Classes.GetByName(&quot;sw3to5&quot;).DisplayName
399 FilterNames(8,1) = &quot;*.sdw&quot;
400 FilterNames(9,0) = oUIKey.Classes.GetByName(&quot;sw3to5templ&quot;).DisplayName
401 Filternames(9,1) = &quot;*.vor&quot;
402 FilterNames(10,0) = oTypes.GetByName(&quot;writer8&quot;).UIName
403 FilterNames(10,1) = &quot;*.odt&quot;
404 FilterNames(11,0) = oTypes.GetByName(&quot;writer8_template&quot;).UIName
405 FilterNames(11,1) = &quot;*.ott&quot;
406 Else
394 Else
407 ReDim FilterNames(5,1) as String
395 ReDim FilterNames(3,1) as String
408 End If
396 End If
409 FilterNames(0,0) = oTypes.GetByName(&quot;calc_StarOffice_XML_Calc&quot;).UIName
410 Filternames(0,1) = &quot;*.sxc&quot;
411 FilterNames(1,0) = oTypes.GetByName(&quot;calc_StarOffice_XML_Calc_Template&quot;).UIName
412 Filternames(1,1) = &quot;*.stc&quot;
413 FilterNames(2,0) = oUIKey.Classes.GetByName(&quot;sc345&quot;).DisplayName
414 FilterNames(2,1) = &quot;*.sdc&quot;
415 FilterNames(3,0) = oUIKey.Classes.GetByName(&quot;sc345templ&quot;).DisplayName
416 Filternames(3,1) = &quot;*.vor&quot;
417 FilterNames(4,0) = oTypes.GetByName(&quot;calc8&quot;).UIName
418 Filternames(4,1) = &quot;*.ods&quot;
419 FilterNames(5,0) = oTypes.GetByName(&quot;calc8_template&quot;).UIName
420 Filternames(5,1) = &quot;*.ots&quot;
397 FilterNames(0,0) = oTypes.GetByName(&quot;calc8&quot;).UIName
398 Filternames(0,1) = &quot;*.ods&quot;
399 FilterNames(1,0) = oTypes.GetByName(&quot;calc8_template&quot;).UIName
400 Filternames(1,1) = &quot;*.ots&quot;
401 FilterNames(2,0) = oTypes.GetByName(&quot;calc_StarOffice_XML_Calc&quot;).UIName
402 Filternames(2,1) = &quot;*.sxc&quot;
403 FilterNames(3,0) = oTypes.GetByName(&quot;calc_StarOffice_XML_Calc_Template&quot;).UIName
404 Filternames(3,1) = &quot;*.stc&quot;
421 GetFileName(DialogModel.txtSource, Filternames())
422 Else
423 GetFolderName(DialogModel.txtSource)
424 End If
425 ToggleGoOnButton()
426End Sub
427
428
429Sub PreviousStep()
430 DialogModel.Step = 2
431 DialogModel.cmdGoOn.Label = sGOON
432 DialogModel.cmdCancel.Label = sCANCEL
433End Sub
434</script:module>
405 GetFileName(DialogModel.txtSource, Filternames())
406 Else
407 GetFolderName(DialogModel.txtSource)
408 End If
409 ToggleGoOnButton()
410End Sub
411
412
413Sub PreviousStep()
414 DialogModel.Step = 2
415 DialogModel.cmdGoOn.Label = sGOON
416 DialogModel.cmdCancel.Label = sCANCEL
417End Sub
418</script:module>