diff options
author | Behrend Cornelius <bc@openoffice.org> | 2001-08-09 15:35:42 +0000 |
---|---|---|
committer | Behrend Cornelius <bc@openoffice.org> | 2001-08-09 15:35:42 +0000 |
commit | 8ee9e2cde5843b631a08f225fe786f11c8db74de (patch) | |
tree | 56972a226cd1bb72819db975ec003d6c893353a5 /wizards/source/importwizard/FilesModul.xba | |
parent | 690027fd98952a7eb263651e6cc91285e269834b (diff) |
#90750# Call of ReadDirectoryRoutine adapted; LogFile handling improved
Diffstat (limited to 'wizards/source/importwizard/FilesModul.xba')
-rw-r--r-- | wizards/source/importwizard/FilesModul.xba | 38 |
1 files changed, 17 insertions, 21 deletions
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 > 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) & "/" & MaxFileIndex + 1 & " (" & sViewPath & ")" - If i = 0 Then - CreateLogDocument(OpenProperties()) - End If oDocument = StarDesktop.LoadComponentFromURL(sFullName, "_blank", 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 ' Note: Files are automatically stored in Default format ' FileProperties(0).Name = "FilterName" @@ -205,14 +205,6 @@ Dim MaxFileIndex as Integer ImportDialog.cbGoOn.Label = sReady ImportDialog.cbGoOn.Enabled = True bCallCancelMsg = False -'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("private:factory/swriter", "_blank", 0, NoArgs())' HiddenProperties()) ' HiddenProperties()) + oLogDocument = StarDesktop.LoadComponentFromURL("private:factory/swriter", "_blank", 4, NoArgs())' HiddenProperties()) ' HiddenProperties()) oLogCursor = oLogDocument.Text.CreateTextCursor oLogTable = oLogDocument.CreateInstance("com.sun.star.text.TextTable") 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 & "/Logfile.sxw" Do bLogExists = oUcb.Exists(sLogUrl) @@ -334,32 +327,35 @@ Dim bLogExists as Boolean i = i + 1 End If Loop Until Not bLogExists -' 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 > 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, "/") - oLogTable.GetCellbyPosition(i,iRow).InsertString(oLogCursor, LocFileName,False) + oCell.InsertString(oLogCursor, LocFileName,False) Next i oLogDocument.Store() End If |