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) = "calc8" 79 TypeList(1) = "calc_StarOffice_XML_Calc" | 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) = "calc8" 79 TypeList(1) = "calc_StarOffice_XML_Calc" |
80 TypeList(2) = "calc_StarCalc_30" 81 TypeList(3) = "calc_StarCalc_40" 82 TypeList(4) = "calc_StarCalc_50" | |
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) = "writer8" 87 TypeList(6) = "writerglobal8" 88 TypeList(7) = "writer_StarOffice_XML_Writer" 89 TypeList(8) = "writer_globaldocument_StarOffice_XML_Writer_GlobalDocument" 90 TypeList(9) = "writer_StarWriter_30" 91 TypeList(10) = "writer_StarWriter_40" 92 TypeList(11) = "writer_globaldocument_StarWriter_40GlobalDocument" 93 TypeList(12) = "writer_StarWriter_50" 94 TypeList(13) = "writer_globaldocument_StarWriter_50GlobalDocument" | 83 TypeList(2) = "writer8" 84 TypeList(3) = "writerglobal8" 85 TypeList(4) = "writer_StarOffice_XML_Writer" 86 TypeList(5) = "writer_globaldocument_StarOffice_XML_Writer_GlobalDocument" |
95 End If 96 FilesList() = ReadDirectories(SourceDir, bRecursive, True, False, TypeList()) 97 TotDocCount = Ubound(FilesList(),1) + 1 98 End If 99 InitializeProgressPage(DialogModel) 100' ChangeToNextProgressStep() 101 sTotDocCount = CStr(TotDocCount) 102 OpenProperties(0).Name = "Hidden" --- 31 unchanged lines hidden (view full) --- 134 TargetFile = ReplaceString(SourceFile,TargetStemDir,SourceDir) 135 TargetDir = DirectorynameoutofPath(TargetFile, "/") 136 Else 137 SourceFile = Source 138 TargetFile = TargetDir & "/" & FileNameoutofPath(SourceFile, "/") 139 End If 140 If CreateFolder(TargetDir) Then 141 sExtension = GetFileNameExtension(SourceFile, "/") | 87 End If 88 FilesList() = ReadDirectories(SourceDir, bRecursive, True, False, TypeList()) 89 TotDocCount = Ubound(FilesList(),1) + 1 90 End If 91 InitializeProgressPage(DialogModel) 92' ChangeToNextProgressStep() 93 sTotDocCount = CStr(TotDocCount) 94 OpenProperties(0).Name = "Hidden" --- 31 unchanged lines hidden (view full) --- 126 TargetFile = ReplaceString(SourceFile,TargetStemDir,SourceDir) 127 TargetDir = DirectorynameoutofPath(TargetFile, "/") 128 Else 129 SourceFile = Source 130 TargetFile = TargetDir & "/" & FileNameoutofPath(SourceFile, "/") 131 End If 132 If CreateFolder(TargetDir) Then 133 sExtension = GetFileNameExtension(SourceFile, "/") |
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) & "/" & sTotDocCount & " (" & sViewPath & ")" --- 25 unchanged lines hidden (view full) --- 176Dim iOverWrite as Integer 177 If (TargetFile <> "") And (Not bCancelTask) Then 178 On Local Error Goto NOSAVING 179 If oUcb.Exists(TargetFile) Then 180 sCurFileExists = ReplaceString(sMsgFileExists, ConvertFromUrl(TargetFile), "<1>") 181 sCurFileExists = ReplaceString(sCurFileExists, chr(13), "<CR>") 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) & "/" & sTotDocCount & " (" & sViewPath & ")" --- 25 unchanged lines hidden (view full) --- 168Dim iOverWrite as Integer 169 If (TargetFile <> "") And (Not bCancelTask) Then 170 On Local Error Goto NOSAVING 171 If oUcb.Exists(TargetFile) Then 172 sCurFileExists = ReplaceString(sMsgFileExists, ConvertFromUrl(TargetFile), "<1>") 173 sCurFileExists = ReplaceString(sCurFileExists, chr(13), "<CR>") 174 iOverWrite = Msgbox (sCurFileExists, 32 + 3, sMsgDLGTITLE) 175 Select Case iOverWrite |
184 Case 1 ' OK 185 Case 2 ' Abort | 176 Case 1 ' OK 177 Case 2 ' Abort |
186 bCancelTask = True 187 StoreDocument() = False 188 Exit Function | 178 bCancelTask = True 179 StoreDocument() = False 180 Exit Function |
189 Case 7 ' No | 181 Case 7 ' No |
190 StoreDocument() = False 191 Exit Function 192 End Select 193 End If 194 If TargetFile <> SourceFile Then 195 oDocument.StoreAsUrl(TargetFile,NoArgs) 196 Else 197 oDocument.Store --- 50 unchanged lines hidden (view full) --- 248 Else 249 TextBoxText = sSOURCEFILE & " " & ConvertFromUrl(Source) & chr(13) 250 End If 251 TextBoxText = TextBoxText & sTARGETDIR & " " & ConvertFromUrl(TargetDir) & chr(13) 252 If DialogModel.chkProtect.State = 1 Then 253 TextBoxText = TextboxText & sPrgsUNPROTECT 254 End If 255 DialogModel.txtConfig.Text = TextBoxText | 182 StoreDocument() = False 183 Exit Function 184 End Select 185 End If 186 If TargetFile <> SourceFile Then 187 oDocument.StoreAsUrl(TargetFile,NoArgs) 188 Else 189 oDocument.Store --- 50 unchanged lines hidden (view full) --- 240 Else 241 TextBoxText = sSOURCEFILE & " " & ConvertFromUrl(Source) & chr(13) 242 End If 243 TextBoxText = TextBoxText & sTARGETDIR & " " & ConvertFromUrl(TargetDir) & chr(13) 244 If DialogModel.chkProtect.State = 1 Then 245 TextBoxText = TextboxText & 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 ' If the Sub is call by the 'cmdBack' Button then set the 'bMakeVisible' 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 ' If the Sub is call by the 'cmdBack' Button then set the 'bMakeVisible' 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("lblCurrencies").Visible = Not bMakeVisible 276 DialogConvert.GetControl("lstCurrencies").Visible = Not bMakeVisible | 267 DialogConvert.GetControl("lblCurrencies").Visible = Not bMakeVisible 268 DialogConvert.GetControl("lstCurrencies").Visible = Not bMakeVisible |
277 DialogConvert.GetControl("cmdBack").Visible = bMakeVisible | 269 DialogConvert.GetControl("cmdBack").Visible = bMakeVisible |
278 DialogConvert.GetControl("cmdGoOn").Visible = bMakeVisible | 270 DialogConvert.GetControl("cmdGoOn").Visible = bMakeVisible |
279 DialogModel.imgPreview.ImageUrl = BitmapDir & "euro_" & DialogModel.Step & ".png" 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("org.openoffice.TypeDetection.Types") 390 oTypes() = oMasterKey.Types 391 oUIKey = GetRegistryKeyContent("org.openoffice.Office.UI/FilterClassification/LocalFilters") 392 If DialogModel.chkTextDocuments.State = 1 Then | 271 DialogModel.imgPreview.ImageUrl = BitmapDir & "euro_" & DialogModel.Step & ".png" 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("org.openoffice.TypeDetection.Types") 382 oTypes() = oMasterKey.Types 383 oUIKey = GetRegistryKeyContent("org.openoffice.Office.UI/FilterClassification/LocalFilters") 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("writer8").UIName 387 FilterNames(4,1) = "*.odt" 388 FilterNames(5,0) = oTypes.GetByName("writer8_template").UIName 389 FilterNames(5,1) = "*.ott" |
394 FilterNames(6,0) = oTypes.GetByName("writer_StarOffice_XML_Writer").UIName 395 FilterNames(6,1) = "*.sxw" 396 FilterNames(7,0) = oTypes.GetByName("writer_StarOffice_XML_Writer_Template").UIName 397 FilterNames(7,1) = "*.stw" | 390 FilterNames(6,0) = oTypes.GetByName("writer_StarOffice_XML_Writer").UIName 391 FilterNames(6,1) = "*.sxw" 392 FilterNames(7,0) = oTypes.GetByName("writer_StarOffice_XML_Writer_Template").UIName 393 FilterNames(7,1) = "*.stw" |
398 FilterNames(8,0) = oUIKey.Classes.GetByName("sw3to5").DisplayName 399 FilterNames(8,1) = "*.sdw" 400 FilterNames(9,0) = oUIKey.Classes.GetByName("sw3to5templ").DisplayName 401 Filternames(9,1) = "*.vor" 402 FilterNames(10,0) = oTypes.GetByName("writer8").UIName 403 FilterNames(10,1) = "*.odt" 404 FilterNames(11,0) = oTypes.GetByName("writer8_template").UIName 405 FilterNames(11,1) = "*.ott" | |
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("calc_StarOffice_XML_Calc").UIName 410 Filternames(0,1) = "*.sxc" 411 FilterNames(1,0) = oTypes.GetByName("calc_StarOffice_XML_Calc_Template").UIName 412 Filternames(1,1) = "*.stc" 413 FilterNames(2,0) = oUIKey.Classes.GetByName("sc345").DisplayName 414 FilterNames(2,1) = "*.sdc" 415 FilterNames(3,0) = oUIKey.Classes.GetByName("sc345templ").DisplayName 416 Filternames(3,1) = "*.vor" 417 FilterNames(4,0) = oTypes.GetByName("calc8").UIName 418 Filternames(4,1) = "*.ods" 419 FilterNames(5,0) = oTypes.GetByName("calc8_template").UIName 420 Filternames(5,1) = "*.ots" | 397 FilterNames(0,0) = oTypes.GetByName("calc8").UIName 398 Filternames(0,1) = "*.ods" 399 FilterNames(1,0) = oTypes.GetByName("calc8_template").UIName 400 Filternames(1,1) = "*.ots" 401 FilterNames(2,0) = oTypes.GetByName("calc_StarOffice_XML_Calc").UIName 402 Filternames(2,1) = "*.sxc" 403 FilterNames(3,0) = oTypes.GetByName("calc_StarOffice_XML_Calc_Template").UIName 404 Filternames(3,1) = "*.stc" |
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> |