2001-04-23 04:46:42 -05:00
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
2001-06-25 02:58:41 -05:00
|
|
|
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
|
2002-01-11 06:30:59 -06:00
|
|
|
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="AutoPilotRun" script:language="StarBasic">Option Explicit
|
2001-04-23 04:46:42 -05:00
|
|
|
|
|
|
|
Public SourceDir as String
|
|
|
|
Public TargetDir as String
|
|
|
|
Public TargetStemDir as String
|
|
|
|
Public SourceFile as String
|
|
|
|
Public TargetFile as String
|
|
|
|
Public Source as String
|
|
|
|
Public SubstFile as String
|
|
|
|
Public SubstDir as String
|
|
|
|
Public NoArgs()
|
2001-05-11 09:26:22 -05:00
|
|
|
Public FilterList(6) as String
|
2001-04-23 04:46:42 -05:00
|
|
|
Public GoOn as Boolean
|
|
|
|
Public DoUnprotect as Integer
|
|
|
|
Public Password as String
|
|
|
|
Public DocIndex as Integer
|
2001-04-25 04:10:51 -05:00
|
|
|
Public oPathSettings as Object
|
2001-04-23 04:46:42 -05:00
|
|
|
Public oDocInfo as Object
|
|
|
|
Public oUcb as Object
|
|
|
|
Public TotDocCount as Integer
|
|
|
|
Public sTotDocCount as String
|
2001-10-31 06:33:17 -06:00
|
|
|
Public OpenProperties(1) as New com.sun.star.beans.PropertyValue
|
|
|
|
|
2001-04-23 04:46:42 -05:00
|
|
|
|
|
|
|
Sub StartAutoPilot()
|
|
|
|
Dim i As Integer
|
2001-05-04 09:11:48 -05:00
|
|
|
BasicLibraries.LoadLibrary("Tools")
|
2001-11-30 09:58:48 -06:00
|
|
|
BasicLibraries.LoadLibrary("ImportWizard")
|
2001-04-23 04:46:42 -05:00
|
|
|
If InitResources("Euro Converter", "eur") Then
|
2001-06-26 12:58:56 -05:00
|
|
|
oDocInfo = CreateUnoService("com.sun.star.document.DocumentProperties")
|
2001-04-23 04:46:42 -05:00
|
|
|
oUcb = createUnoService("com.sun.star.ucb.SimpleFileAccess")
|
|
|
|
oLocale = GetStarOfficeLocale()
|
|
|
|
InitializeConverter(oLocale, 2)
|
2001-05-04 09:11:48 -05:00
|
|
|
ToggleGoOnButton()
|
|
|
|
DialogModel.cmdGoOn.DefaultButton = True
|
2001-10-31 09:24:41 -06:00
|
|
|
DialogConvert.GetControl("optWholeDir").SetFocus()
|
2002-07-11 09:36:57 -05:00
|
|
|
DialogConvert.Execute()
|
2001-12-07 04:15:28 -06:00
|
|
|
DialogConvert.Dispose()
|
2001-04-23 04:46:42 -05:00
|
|
|
End If
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
2001-04-25 04:10:51 -05:00
|
|
|
Sub ConvertDocuments()
|
2001-04-23 04:46:42 -05:00
|
|
|
Dim FilesList()
|
2001-11-19 09:24:29 -06:00
|
|
|
Dim bDisposable as Boolean
|
|
|
|
|
2001-04-23 04:46:42 -05:00
|
|
|
If Source <> "" And TargetDir <> "" Then
|
|
|
|
If DialogModel.optSingleFile.State = 1 Then
|
|
|
|
SourceFile = Source
|
|
|
|
TotDocCount = 1
|
|
|
|
Else
|
|
|
|
SourceDir = Source
|
|
|
|
TargetStemDir = TargetDir
|
2001-06-25 13:03:49 -05:00
|
|
|
FilterList(0) = "application/x-starcalc"
|
|
|
|
FilterList(1) = "application/vnd.stardivision.calc"
|
|
|
|
FilterList(2) = "application/vnd.sun.xml.calc"
|
|
|
|
If DialogModel.chkTextDocuments.State = 1 Then
|
|
|
|
ReDim Preserve FilterList(6) as String
|
|
|
|
FilterList(3) = "application/x-starwriter"
|
|
|
|
FilterList(4) = "application/vnd.stardivision.writer"
|
|
|
|
FilterList(5) = "application/vnd.stardivision.writer/web"
|
|
|
|
FilterList(6) = "application/vnd.sun.xml.writer"
|
2001-10-31 06:33:17 -06:00
|
|
|
End If
|
2001-04-23 04:46:42 -05:00
|
|
|
FilesList() = ReadDirectories(SourceDir, bRecursive, True, False, FilterList())
|
2001-06-25 02:58:41 -05:00
|
|
|
TotDocCount = Ubound(FilesList(),1) + 1
|
2001-04-23 04:46:42 -05:00
|
|
|
End If
|
|
|
|
InitializeProgressPage(DialogModel)
|
|
|
|
' ChangeToNextProgressStep()
|
|
|
|
sTotDocCount = CStr(TotDocCount)
|
2001-10-31 06:33:17 -06:00
|
|
|
OpenProperties(0).Name = "Hidden"
|
2001-11-19 09:24:29 -06:00
|
|
|
OpenProperties(0).Value = True
|
2001-10-31 06:33:17 -06:00
|
|
|
OpenProperties(1).Name = "AsTemplate"
|
2001-11-19 09:24:29 -06:00
|
|
|
OpenProperties(1).Value = False
|
2001-06-25 02:58:41 -05:00
|
|
|
For DocIndex = 0 To TotDocCount - 1
|
2001-11-19 09:24:29 -06:00
|
|
|
If InitializeDocument(FilesList(), bDisposable) Then
|
2001-09-12 06:30:01 -05:00
|
|
|
If StoreDocument() Then
|
|
|
|
ConvertDocument()
|
|
|
|
oDocument.Store
|
|
|
|
End If
|
2001-10-31 06:33:17 -06:00
|
|
|
If bDisposable Then
|
|
|
|
oDocument.Dispose()
|
|
|
|
End If
|
2001-04-23 04:46:42 -05:00
|
|
|
End If
|
|
|
|
Next DocIndex
|
2001-11-12 10:33:21 -06:00
|
|
|
DialogModel.cmdBack.Enabled = True
|
2001-06-26 12:58:56 -05:00
|
|
|
DialogModel.cmdGoOn.Enabled = True
|
2001-07-12 06:28:36 -05:00
|
|
|
DialogModel.cmdGoOn.Label = sReady
|
2001-09-12 06:30:01 -05:00
|
|
|
DialogModel.cmdCancel.Label = sEnd
|
2001-04-23 04:46:42 -05:00
|
|
|
End If
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
2001-11-19 09:24:29 -06:00
|
|
|
Function InitializeDocument(FilesList(), bDisposable as Boolean) as Boolean
|
2001-05-04 09:11:48 -05:00
|
|
|
' The Autopilot is started from step No. 2
|
2001-04-23 04:46:42 -05:00
|
|
|
Dim sViewPath as String
|
2001-05-04 09:11:48 -05:00
|
|
|
Dim bIsReadOnly as Boolean
|
2001-10-31 06:33:17 -06:00
|
|
|
Dim sExtension as String
|
2001-05-04 09:11:48 -05:00
|
|
|
On Local Error Goto NEXTFILE
|
2001-09-12 06:30:01 -05:00
|
|
|
If Not bCancelTask Then
|
|
|
|
If DialogModel.optWholeDir.State = 1 Then
|
|
|
|
SourceFile = FilesList(DocIndex,0)
|
|
|
|
TargetFile = ReplaceString(SourceFile,TargetStemDir,SourceDir)
|
|
|
|
TargetDir = DirectorynameoutofPath(TargetFile, "/")
|
|
|
|
Else
|
|
|
|
SourceFile = Source
|
|
|
|
TargetFile = TargetDir & "/" & FileNameoutofPath(SourceFile, "/")
|
|
|
|
End If
|
2001-11-12 10:33:21 -06:00
|
|
|
If CreateFolder(TargetDir) Then
|
|
|
|
sExtension = GetFileNameExtension(SourceFile, "/")
|
|
|
|
oDocument = OpenDocument(SourceFile, OpenProperties(), bDisposable)
|
|
|
|
If (oDocument.IsReadOnly) AND (UCase(SourceFile) = UCase(TargetFile)) Then
|
|
|
|
bIsReadOnly = True
|
|
|
|
Msgbox(sMsgDOCISREADONLY, 16, GetProductName())
|
|
|
|
Else
|
|
|
|
bIsReadOnly = False
|
|
|
|
RetrieveDocumentObjects()
|
|
|
|
sViewPath = CutPathView(SourceFile, 60)
|
|
|
|
DialogModel.lblCurDocument.Label = Str(DocIndex+1) & "/" & sTotDocCount & " (" & sViewPath & ")"
|
|
|
|
End If
|
|
|
|
InitializeDocument() = Not bIsReadOnly
|
2001-09-12 06:30:01 -05:00
|
|
|
Else
|
2001-11-12 10:33:21 -06:00
|
|
|
InitializeDocument() = False
|
2001-09-12 06:30:01 -05:00
|
|
|
End If
|
2001-04-23 04:46:42 -05:00
|
|
|
Else
|
2001-10-31 06:33:17 -06:00
|
|
|
InitializeDocument() = False
|
2001-04-23 04:46:42 -05:00
|
|
|
End If
|
2001-05-04 09:11:48 -05:00
|
|
|
NEXTFILE:
|
|
|
|
If Err <> 0 Then
|
|
|
|
InitializeDocument() = False
|
|
|
|
Resume LETSGO
|
2001-10-31 06:33:17 -06:00
|
|
|
LETSGO:
|
|
|
|
End If
|
2001-04-23 04:46:42 -05:00
|
|
|
End Function
|
|
|
|
|
|
|
|
|
|
|
|
Sub ChangeToNextProgressStep()
|
2001-05-04 09:11:48 -05:00
|
|
|
DialogModel.lblCurProgress.FontWeight = com.sun.star.awt.FontWeight.NORMAL
|
|
|
|
DialogConvert.GetControl("lblCurProgress").Visible = True
|
2001-04-23 04:46:42 -05:00
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
2001-09-12 06:30:01 -05:00
|
|
|
Function StoreDocument() as Boolean
|
|
|
|
Dim sCurFileExists as String
|
|
|
|
Dim iOverWrite as Integer
|
|
|
|
If (TargetFile <> "") And (Not bCancelTask) Then
|
2001-04-23 04:46:42 -05:00
|
|
|
On Local Error Goto NOSAVING
|
2001-09-12 06:30:01 -05:00
|
|
|
If oUcb.Exists(TargetFile) Then
|
|
|
|
sCurFileExists = ReplaceString(sMsgFileExists, ConvertFromUrl(TargetFile), "<1>")
|
|
|
|
sCurFileExists = ReplaceString(sCurFileExists, chr(13), "<CR>")
|
|
|
|
iOverWrite = Msgbox (sCurFileExists, 32 + 3, sMsgDLGTITLE)
|
|
|
|
Select Case iOverWrite
|
|
|
|
Case 1 ' OK
|
|
|
|
Case 2 ' Abort
|
|
|
|
bCancelTask = True
|
|
|
|
StoreDocument() = False
|
|
|
|
Exit Function
|
|
|
|
Case 7 ' No
|
|
|
|
StoreDocument() = False
|
|
|
|
Exit Function
|
|
|
|
End Select
|
|
|
|
End If
|
2001-04-23 04:46:42 -05:00
|
|
|
If TargetFile <> SourceFile Then
|
2001-09-12 06:30:01 -05:00
|
|
|
oDocument.StoreAsUrl(TargetFile,NoArgs)
|
2001-04-23 04:46:42 -05:00
|
|
|
Else
|
|
|
|
oDocument.Store
|
|
|
|
End If
|
|
|
|
StoreDocument() = True
|
|
|
|
NOSAVING:
|
|
|
|
If Err <> 0 Then
|
|
|
|
StoreDocument() = False
|
|
|
|
Resume CLERROR
|
|
|
|
End If
|
|
|
|
CLERROR:
|
|
|
|
End If
|
|
|
|
End Function
|
|
|
|
|
|
|
|
|
|
|
|
Sub SwapExtent()
|
|
|
|
DialogModel.chkRecursive.Enabled = DialogModel.optWholeDir.State = 1
|
|
|
|
If DialogModel.optWholeDir.State = 1 Then
|
|
|
|
DialogModel.lblSource.Label = sSOURCEDIR '"Quellverzeichnis:"
|
|
|
|
If Not IsNull(SubstFile) Then
|
|
|
|
SubstFile = DialogModel.txtSource.Text
|
2001-06-26 12:58:56 -05:00
|
|
|
DialogModel.txtSource.Text = SubstDir
|
2001-04-23 04:46:42 -05:00
|
|
|
End If
|
|
|
|
Else
|
|
|
|
DialogModel.LblSource.Label = sSOURCEFILE '"Quelldatei:"
|
|
|
|
If Not IsNull(SubstDir) Then
|
|
|
|
SubstDir = DialogModel.txtSource.Text
|
2001-06-26 12:58:56 -05:00
|
|
|
DialogModel.txtSource.Text = SubstFile
|
2001-04-23 04:46:42 -05:00
|
|
|
End If
|
|
|
|
End If
|
2001-05-04 09:11:48 -05:00
|
|
|
ToggleGoOnButton()
|
2001-04-23 04:46:42 -05:00
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
2001-11-30 09:58:48 -06:00
|
|
|
Function InitializeThirdStep() as Boolean
|
2001-04-23 04:46:42 -05:00
|
|
|
Dim TextBoxText as String
|
2001-06-25 13:03:49 -05:00
|
|
|
Source = AssignFileName(DialogModel.txtSource.Text, DialogModel.lblSource.Label, True)
|
2001-11-30 09:58:48 -06:00
|
|
|
If CheckTextBoxPath(DialogModel.txtTarget, True, True, sMsgDLGTITLE, True) Then
|
|
|
|
TargetDir = AssignFileName(DialogModel.txtTarget.Text, DialogModel.lblTarget.Label, False)
|
|
|
|
Else
|
|
|
|
TargetDir = ""
|
|
|
|
End If
|
2001-06-26 12:58:56 -05:00
|
|
|
If Source <> "" And TargetDir <> "" Then
|
|
|
|
bRecursive = DialogModel.chkRecursive.State = 1
|
|
|
|
bDoUnprotect = DialogModel.chkProtect.State = 1
|
|
|
|
DialogModel.lblRetrieval.FontWeight = com.sun.star.awt.FontWeight.BOLD
|
|
|
|
DialogModel.lblRetrieval.Label = sPrgsRETRIEVAL
|
|
|
|
DialogModel.lblCurProgress.Label = sPrgsCONVERTING
|
|
|
|
If DialogModel.optWholeDir.State = 1 Then
|
2001-09-12 06:30:01 -05:00
|
|
|
TextBoxText = sSOURCEDIR & " " & ConvertFromUrl(Source) & chr(13) '& " "
|
2001-06-26 12:58:56 -05:00
|
|
|
If DialogModel.chkRecursive.State = 1 Then
|
|
|
|
TextBoxText = TextBoxText & DeleteStr(sInclusiveSubDir,"~") & chr(13)
|
|
|
|
End If
|
|
|
|
Else
|
2001-09-12 06:30:01 -05:00
|
|
|
TextBoxText = sSOURCEFILE & " " & ConvertFromUrl(Source) & chr(13)
|
2001-04-23 04:46:42 -05:00
|
|
|
End If
|
2001-09-12 06:30:01 -05:00
|
|
|
TextBoxText = TextBoxText & sTARGETDIR & " " & ConvertFromUrl(TargetDir) & chr(13)
|
2001-06-26 12:58:56 -05:00
|
|
|
If DialogModel.chkProtect.State = 1 Then
|
|
|
|
TextBoxText = TextboxText & sPrgsUNPROTECT
|
|
|
|
End If
|
|
|
|
DialogModel.txtConfig.Text = TextBoxText
|
|
|
|
ToggleProgressStep()
|
2001-10-31 06:33:17 -06:00
|
|
|
DialogModel.cmdGoOn.Enabled = False
|
2001-11-30 09:58:48 -06:00
|
|
|
InitializeThirdStep() = True
|
|
|
|
Else
|
|
|
|
InitializeThirdStep() = False
|
|
|
|
End If
|
|
|
|
End Function
|
2001-04-23 04:46:42 -05:00
|
|
|
|
|
|
|
|
2001-05-04 09:11:48 -05:00
|
|
|
Sub ToggleProgressStep(Optional aEvent as Object)
|
|
|
|
Dim bMakeVisible as Boolean
|
|
|
|
Dim LocStep as Integer
|
2001-06-25 13:03:49 -05:00
|
|
|
' If the Sub is call by the 'cmdBack' Button then set the 'bMakeVisible' variable accordingly
|
2001-05-04 09:11:48 -05:00
|
|
|
bMakeVisible = IsMissing(aEvent)
|
|
|
|
If bMakeVisible Then
|
2001-10-31 06:33:17 -06:00
|
|
|
DialogModel.Step = 3
|
2001-05-04 09:11:48 -05:00
|
|
|
Else
|
|
|
|
DialogModel.Step = 2
|
|
|
|
End If
|
2001-07-12 06:28:36 -05:00
|
|
|
DialogConvert.GetControl("lblCurrencies").Visible = Not bMakeVisible
|
|
|
|
DialogConvert.GetControl("lstCurrencies").Visible = Not bMakeVisible
|
|
|
|
DialogConvert.GetControl("cmdBack").Visible = bMakeVisible
|
|
|
|
DialogConvert.GetControl("cmdGoOn").Visible = bMakeVisible
|
2001-05-04 09:11:48 -05:00
|
|
|
DialogModel.imgPreview.ImageUrl = BitmapDir & "euro_" & DialogModel.Step & ".bmp"
|
2001-04-23 04:46:42 -05:00
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
|
|
Sub EnableStep2DialogControls(OnValue as Boolean)
|
2001-06-25 02:58:41 -05:00
|
|
|
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
|
2001-04-23 04:46:42 -05:00
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
|
|
Sub InitializeProgressPage()
|
2001-05-04 09:11:48 -05:00
|
|
|
DialogConvert.GetControl("lblRetrieval").Visible = False
|
|
|
|
DialogConvert.GetControl("lblCurProgress").Visible = False
|
|
|
|
DialogModel.lblRetrieval.FontWeight = com.sun.star.awt.FontWeight.NORMAL
|
|
|
|
DialogModel.lblCurProgress.FontWeight = com.sun.star.awt.FontWeight.BOLD
|
|
|
|
DialogConvert.GetControl("lblRetrieval").Visible = True
|
|
|
|
DialogConvert.GetControl("lblCurProgress").Visible = True
|
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
|
|
Function AssignFileName(sPath as String, ByVal HeaderString, bCheckFileType as Boolean) as String
|
|
|
|
Dim bIsValid as Boolean
|
|
|
|
Dim sLocMimeType as String
|
|
|
|
Dim sNoDirMessage as String
|
|
|
|
HeaderString = DeleteStr(HeaderString, ":")
|
|
|
|
sPath = ConvertToUrl(Trim(sPath))
|
|
|
|
bIsValid = oUcb.Exists(sPath)
|
|
|
|
If bIsValid Then
|
|
|
|
If DialogModel.optSingleFile.State = 1 Then
|
|
|
|
If bCheckFileType Then
|
|
|
|
sLocMimeType = GetRealFileContent(oDocInfo, sPath)
|
2001-06-26 12:58:56 -05:00
|
|
|
If DialogModel.chkTextDocuments.State = 1 Then
|
|
|
|
If (Instr(1, sLocMimeType, "writer") = 0) And (Instr(1, sLocMimeType, "calc") = 0) Then
|
|
|
|
Msgbox(sMsgFileInvalid, 48, sMsgDLGTITLE)
|
|
|
|
bIsValid = False
|
|
|
|
End If
|
|
|
|
Else
|
|
|
|
If Instr(1, sLocMimeType, "calc") = 0 Then
|
|
|
|
Msgbox(sMsgFileInvalid, 48, sMsgDLGTITLE)
|
|
|
|
bIsValid = False
|
|
|
|
End If
|
2001-05-04 09:11:48 -05:00
|
|
|
End If
|
|
|
|
End If
|
|
|
|
Else
|
|
|
|
If Not oUcb.IsFolder(sPath) Then
|
|
|
|
sNoDirMessage = ReplaceString(sMsgNODIRECTORY,sPath,"<1>")
|
|
|
|
Msgbox(sNoDirMessage,48, sMsgDLGTITLE)
|
|
|
|
bIsValid = False
|
|
|
|
Else
|
|
|
|
sPath = RTrimStr(sPath,"/")
|
|
|
|
sPath = sPath & "/"
|
|
|
|
End If
|
|
|
|
End if
|
|
|
|
Else
|
|
|
|
Msgbox(HeaderString & " '" & ConvertFromUrl(sPath) & "' " & sMsgNOTTHERE,48, sMsgDLGTITLE)
|
|
|
|
End If
|
|
|
|
If bIsValid Then
|
|
|
|
AssignFileName() = sPath
|
|
|
|
Else
|
|
|
|
AssignFilename() = ""
|
|
|
|
End If
|
|
|
|
End Function
|
|
|
|
|
|
|
|
|
|
|
|
Sub ToggleGoOnButton()
|
|
|
|
Dim bDoEnable as Boolean
|
|
|
|
Dim sLocMimeType as String
|
|
|
|
Dim sPath as String
|
|
|
|
bDoEnable = Ubound(DialogModel.lstCurrencies.SelectedItems()) > -1
|
|
|
|
If bDoEnable Then
|
|
|
|
' Check if Source is set correctly
|
|
|
|
sPath = ConvertToUrl(Trim(DialogModel.txtSource.Text))
|
|
|
|
bDoEnable = oUcb.Exists(sPath)
|
|
|
|
End If
|
|
|
|
DialogModel.cmdGoOn.Enabled = bDoEnable
|
2001-06-25 02:58:41 -05:00
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
|
|
Sub CallFolderPicker()
|
|
|
|
GetFolderName(DialogModel.txtTarget)
|
2001-09-12 06:30:01 -05:00
|
|
|
ToggleGoOnButton()
|
2001-06-25 02:58:41 -05:00
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
|
|
Sub CallFilePicker()
|
|
|
|
If DialogModel.optSingleFile.State = 1 Then
|
2001-06-25 13:03:49 -05:00
|
|
|
Dim oMasterKey as Object
|
2001-11-19 09:24:29 -06:00
|
|
|
Dim oTypes() as Object
|
|
|
|
Dim oUIKey() as Object
|
2001-06-25 13:03:49 -05:00
|
|
|
|
|
|
|
oMasterKey = GetRegistryKeyContent("org.openoffice.Office.TypeDetection/")
|
2001-11-19 09:24:29 -06:00
|
|
|
oTypes() = oMasterKey.Types
|
|
|
|
oUIKey = GetRegistryKeyContent("org.openoffice.Office.UI/FilterClassification/LocalFilters")
|
2001-06-25 13:03:49 -05:00
|
|
|
If DialogModel.chkTextDocuments.State = 1 Then
|
2001-11-19 09:24:29 -06:00
|
|
|
Dim FilterNames(7,1) as String
|
|
|
|
FilterNames(4,0) = oTypes.GetByName("writer_StarOffice_XML_Writer").UIName
|
|
|
|
FilterNames(4,1) = "*.sxw"
|
|
|
|
FilterNames(5,0) = oTypes.GetByName("writer_StarOffice_XML_Writer_Template").UIName
|
|
|
|
FilterNames(5,1) = "*.stw"
|
|
|
|
FilterNames(6,0) = oUIKey.Classes.GetByName("sw3to5").DisplayName
|
|
|
|
FilterNames(6,1) = "*.sdw"
|
|
|
|
FilterNames(7,0) = oUIKey.Classes.GetByName("sw3to5templ").DisplayName
|
|
|
|
Filternames(7,1) = "*.vor"
|
2001-06-25 13:03:49 -05:00
|
|
|
Else
|
2001-11-19 09:24:29 -06:00
|
|
|
ReDim FilterNames(3,1) as String
|
2001-06-25 13:03:49 -05:00
|
|
|
End If
|
2001-11-19 09:24:29 -06:00
|
|
|
FilterNames(0,0) = oTypes.GetByName("calc_StarOffice_XML_Calc").UIName
|
2001-06-25 13:03:49 -05:00
|
|
|
Filternames(0,1) = "*.sxc"
|
2001-11-19 09:24:29 -06:00
|
|
|
FilterNames(1,0) = oTypes.GetByName("calc_StarOffice_XML_Calc_Template").UIName
|
|
|
|
Filternames(1,1) = "*.stc"
|
|
|
|
FilterNames(2,0) = oUIKey.Classes.GetByName("sc345").DisplayName
|
|
|
|
FilterNames(2,1) = "*.sdc"
|
|
|
|
FilterNames(3,0) = oUIKey.Classes.GetByName("sc345templ").DisplayName
|
|
|
|
Filternames(3,1) = "*.vor"
|
2001-06-25 02:58:41 -05:00
|
|
|
GetFileName(DialogModel.txtSource, Filternames())
|
|
|
|
Else
|
|
|
|
GetFolderName(DialogModel.txtSource)
|
|
|
|
End If
|
2001-09-12 06:30:01 -05:00
|
|
|
ToggleGoOnButton()
|
2001-11-12 10:33:21 -06:00
|
|
|
End Sub
|
|
|
|
|
|
|
|
|
|
|
|
Sub PreviousStep()
|
|
|
|
DialogModel.Step = 2
|
|
|
|
DialogModel.cmdGoOn.Label = sGOON
|
|
|
|
DialogModel.cmdCancel.Label = sCANCEL
|
2001-05-04 09:11:48 -05:00
|
|
|
End Sub</script:module>
|