summaryrefslogtreecommitdiff
path: root/wizards
diff options
context:
space:
mode:
authorBehrend Cornelius <bc@openoffice.org>2001-08-09 15:35:42 +0000
committerBehrend Cornelius <bc@openoffice.org>2001-08-09 15:35:42 +0000
commit8ee9e2cde5843b631a08f225fe786f11c8db74de (patch)
tree56972a226cd1bb72819db975ec003d6c893353a5 /wizards
parent690027fd98952a7eb263651e6cc91285e269834b (diff)
#90750# Call of ReadDirectoryRoutine adapted; LogFile handling improved
Diffstat (limited to 'wizards')
-rw-r--r--wizards/source/importwizard/DialogModul.xba23
-rw-r--r--wizards/source/importwizard/FilesModul.xba38
-rw-r--r--wizards/source/importwizard/Main.xba23
3 files changed, 31 insertions, 53 deletions
diff --git a/wizards/source/importwizard/DialogModul.xba b/wizards/source/importwizard/DialogModul.xba
index 43c115d0212f..64b7e4068031 100644
--- a/wizards/source/importwizard/DialogModul.xba
+++ b/wizards/source/importwizard/DialogModul.xba
@@ -62,7 +62,7 @@ Public Const SBAPPLKEY = 9
&apos; Applications(X,6) = True/False (Including Subdirectories)
&apos; Applications(X,7) = &quot;File:///...&quot; (SourceUrl of the templates)
&apos; Applications(X,8) = &quot;File:///...&quot; (TargetUrl of the templates)
-&apos; Applications(X,9) = 0 (Key to the original Index of the Applications)
+&apos; Applications(X,9) = 0 (Key to the original Index of the Applications)
Sub FillStep_Welcome()
@@ -288,7 +288,7 @@ End Function
Sub FillStep_Summary()
-&apos; Todo: Angabe über die Vorlagengruppen,bzw. Template-Exportpfad
+&apos; Todo: Angabe über die Vorlagengruppen,bzw. Template-Exportpfad
With ImportDialog
.SummaryTextbox.Text = MakeSummaryString()
.cbGoOn.Enabled = .SummaryTextbox.Text &lt;&gt; &quot;&quot;
@@ -315,25 +315,6 @@ Sub FillStep_Progress()
End Sub
-Sub DocumentDirSearchDialog()
- CallDirSearchDialog(ImportDialog.DocumentImportPath)
-End Sub
-
-
-Sub StarDocumentDirSearchDialog()
- CallDirSearchDialog(ImportDialog.DocumentExportPath)
-End Sub
-
-
-Sub CallDirSearchDialog(oTargetControl as Object)
-Dim sDirName as String
- sDirName = Application.FileDialog(&quot;P&quot;, sPathDialogMessage, oTargetControl.Text)
- If Len(sDirName) &gt; 0 Then
- oTargetControl.Text = sDirName
- End If
-End Sub
-
-
Sub SetupMSConfiguration()
iApplSection = 0
Wizardmode = SBMICROSOFTMODE
diff --git a/wizards/source/importwizard/FilesModul.xba b/wizards/source/importwizard/FilesModul.xba
index 739fcf6d9541..2a83b03c2dfc 100644
--- a/wizards/source/importwizard/FilesModul.xba
+++ b/wizards/source/importwizard/FilesModul.xba
@@ -6,7 +6,7 @@ Public AbsTemplateFound as Integer
Public AbsDocuFound as Integer
Public oLogDocument as Object
Public oLogTable as Object
-
+Public bInsertRow as Boolean
Function ReadApplicationDirectories(ApplIndex as Integer, FilesList(),bIsDocument as Boolean, sFiltername()) as Integer
Dim bCheckDocuType as Boolean
@@ -114,6 +114,7 @@ Dim MaxFileIndex as Integer
ShowCurrentProgress(bIsDocument, CurFound)
Next i
TotFound = AbsTemplateFound + AbsDocuFound
+ CreateLogDocument(OpenProperties())
If TotFound &gt; 0 Then
bCallCancelMsg = True
InitializeProgressPage(ImportDialog)
@@ -123,16 +124,15 @@ Dim MaxFileIndex as Integer
For i = 0 To MaxFileIndex
bDoSave = True
If bCancelTask Then
- Call CancelTask()
+ If CancelTask() Then
+ Exit Sub
+ End If
End if
sFullName = FilesList(i,0)
CurFiltername = GetFilterName(FilesList(i,1), sFilterName(), sExtension, FilterIndex)
ApplIndex = FilesList(i,2)
sViewPath = CutPathView(sFullName, 60)
ImportDialog.LabelCurDocument.Label = Str(i+1) &amp; &quot;/&quot; &amp; MaxFileIndex + 1 &amp; &quot; (&quot; &amp; sViewPath &amp; &quot;)&quot;
- If i = 0 Then
- CreateLogDocument(OpenProperties())
- End If
oDocument = StarDesktop.LoadComponentFromURL(sFullName, &quot;_blank&quot;, 0, OpenProperties())
If bSetFonts Then
CheckScripts(oDocument, 1)
@@ -175,7 +175,7 @@ Dim MaxFileIndex as Integer
End Select
End If
If bDoSave Then
- InsertDocNamesToLogDocument(i+1, sFullName, TargetFile)
+ InsertDocNamesToLogDocument(sFullName, TargetFile)
On Local Error Resume Next
&apos; Note: Files are automatically stored in Default format
&apos; FileProperties(0).Name = &quot;FilterName&quot;
@@ -205,14 +205,6 @@ Dim MaxFileIndex as Integer
ImportDialog.cbGoOn.Label = sReady
ImportDialog.cbGoOn.Enabled = True
bCallCancelMsg = False
-&apos;Todo: Natürlich nur schließen, wenn auch vorhanden!
- If Not IsNull(oLogDocument) Then
- oLogDocument.Dispose()
- End If
- ImportDialogArea.endExecute
- ImportDialogArea.Dispose
- End
-
Exit Sub
RTError:
Msgbox sRTErrorDesc, 16, sRTErrorHeader
@@ -313,7 +305,7 @@ Dim i as Integer
Dim bLogExists as Boolean
If ImportDialog.chkLogfile.State = 1 Then
i = 2
- oLogDocument = StarDesktop.LoadComponentFromURL(&quot;private:factory/swriter&quot;, &quot;_blank&quot;, 0, NoArgs())&apos; HiddenProperties()) &apos; HiddenProperties())
+ oLogDocument = StarDesktop.LoadComponentFromURL(&quot;private:factory/swriter&quot;, &quot;_blank&quot;, 4, NoArgs())&apos; HiddenProperties()) &apos; HiddenProperties())
oLogCursor = oLogDocument.Text.CreateTextCursor
oLogTable = oLogDocument.CreateInstance(&quot;com.sun.star.text.TextTable&quot;)
oLogCursor.Text.InsertTextContent(oLogCursor, oLogTable, True)
@@ -322,6 +314,7 @@ Dim bLogExists as Boolean
oLogCursor.SetString(sSourceDocuments)
oLogCursor = oLogTable.GetCellbyPosition(1,0).createTextCursor
oLogCursor.SetString(sTargetDocuments)
+ bInsertRow = False
sLogUrl = SOWorkPath &amp; &quot;/Logfile.sxw&quot;
Do
bLogExists = oUcb.Exists(sLogUrl)
@@ -334,32 +327,35 @@ Dim bLogExists as Boolean
i = i + 1
End If
Loop Until Not bLogExists
-&apos; Todo Für das Logdokument einen sinnigen Titel festlegen!
- oLogDocument.StoreToUrl(sLogUrl, NoArgs())
+ oLogDocument.StoreAsUrl(sLogUrl, NoArgs())
EndIf
End Sub
-Sub InsertDocNamesToLogDocument(iRow as Integer, SourceUrl as String, TargetUrl as String)
+Sub InsertDocNamesToLogDocument(SourceUrl as String, TargetUrl as String)
+Dim oCell as Object
Dim oLogCursor as Object
Dim UrlList(1) as String
Dim LocFileName as String
Dim LocUrl as String
Dim i as Integer
If ImportDialog.chkLogfile.State = 1 Then
- If iRow &gt; 1 Then
+ If bInsertRow Then
oLogTable.Rows.InsertByIndex(oLogTable.Rows.Count,1)
+ Else
+ bInsertRow = True
End If
UrlList(0) = SourceUrl
UrlList(1) = TargetUrl
For i = 0 To 1
- oLogCursor = oLogTable.GetCellbyPosition(i,iRow).createTextCursor
+ oCell = oLogTable.GetCellbyPosition(i,oLogTable.Rows.Count-1)
+ oLogCursor = oCell.createTextCursor()
LocUrl = UrlList(i)
oLogCursor.HyperLinkURL = LocUrl
oLogCursor.HyperLinkName = LocUrl
oLogCursor.HyperLinkTarget = LocUrl
LocFileName = FileNameOutOfPath(LocUrl, &quot;/&quot;)
- oLogTable.GetCellbyPosition(i,iRow).InsertString(oLogCursor, LocFileName,False)
+ oCell.InsertString(oLogCursor, LocFileName,False)
Next i
oLogDocument.Store()
End If
diff --git a/wizards/source/importwizard/Main.xba b/wizards/source/importwizard/Main.xba
index 9065cd3a5a3c..e25df463fc74 100644
--- a/wizards/source/importwizard/Main.xba
+++ b/wizards/source/importwizard/Main.xba
@@ -16,6 +16,7 @@ Public bCallCancelMsg as Boolean
Sub Main()
BasicLibraries.LoadLibrary(&quot;Tools&quot;)
bSetFonts = False
+ bCallCancelMsg = False
If bSetFonts Then
BasicLibraries.LoadLibrary(&quot;Translater&quot;)
GetFontNames()
@@ -37,11 +38,13 @@ Sub Main()
FillStep_Welcome()
RepaintHeaderPreview()
SetStates()
- ImportDialogArea.Visible = True
ImportDialog.cbGoOn.DefaultButton = True
+ ImportDialogArea.Execute()
+ ImportDialogArea.Dispose()
+ End
Exit Sub
RTError:
- Msgbox sRTErrorDesc, 16, sRTErrorHeader
+&apos; Msgbox sRTErrorDesc, 16, sRTErrorHeader
End Sub
@@ -107,7 +110,6 @@ Dim iCurStep as Integer
ImportDialog.cbCancel.Label = sCancelButton
FillStep_Summary()
Case 3
-&apos;Todo: muessen auch beim Zuruecksteppen wirklich die Importpfade auf ihre Gueltigkeit hin Ueberprueft werden?
FillStep_InputPaths(Applcount-1, False)
Case 2
SaveStep_InputPath
@@ -130,26 +132,25 @@ End Sub
Sub CancelButton()
If bCallCancelMsg Then
&apos; Conversion is already running
- ImportDialog.cbCancel.Enabled = False
- bCancelTask = True
+ CancelTask()
+&apos; ImportDialog.cbCancel.Enabled = False
+&apos; bCancelTask = True
Else
ImportDialogArea.EndExecute()
- ImportDialogArea.Dispose()
- End
End If
End Sub
-Sub CancelTask()
+Function CancelTask()
If Msgbox(sConvertError1, 36, sConvertError2) = 6 Then
ImportDialogArea.EndExecute &apos;Visible = False
- ImportDialogArea.Dispose
- End
+&apos; CancelTask = True
Else
bCancelTask = False
ImportDialog.cbCancel.Enabled = True
+ CancelTask = False
End If
-End Sub
+End Function