diff options
Diffstat (limited to 'wizards')
-rw-r--r-- | wizards/source/importwizard/FilesModul.xba | 17 | ||||
-rw-r--r-- | wizards/source/importwizard/ImportDialog.xdl | 2 | ||||
-rw-r--r-- | wizards/source/importwizard/Main.xba | 43 |
3 files changed, 28 insertions, 34 deletions
diff --git a/wizards/source/importwizard/FilesModul.xba b/wizards/source/importwizard/FilesModul.xba index 2a83b03c2dfc..ad0bb192aed5 100644 --- a/wizards/source/importwizard/FilesModul.xba +++ b/wizards/source/importwizard/FilesModul.xba @@ -97,7 +97,7 @@ Dim oTask as Object Dim oModel as Object Dim oTaskController as Object Dim MaxFileIndex as Integer - + bConversionIsRunnig = True AbsTemplateFound = 0 AbsDocuFound = 0 For i = 0 To ApplCount-1 @@ -116,18 +116,16 @@ Dim MaxFileIndex as Integer TotFound = AbsTemplateFound + AbsDocuFound CreateLogDocument(OpenProperties()) If TotFound > 0 Then - bCallCancelMsg = True InitializeProgressPage(ImportDialog) OpenProperties(0).Name = "Hidden" OpenProperties(0).Value = True MaxFileIndex = Ubound(FilesList(),1) For i = 0 To MaxFileIndex - bDoSave = True If bCancelTask Then - If CancelTask() Then - Exit Sub - End If + bConversionIsRunnig = False + Exit Sub End if + bDoSave = True sFullName = FilesList(i,0) CurFiltername = GetFilterName(FilesList(i,1), sFilterName(), sExtension, FilterIndex) ApplIndex = FilesList(i,2) @@ -167,9 +165,8 @@ Dim MaxFileIndex as Integer ' In the FileProperty-Bean this is already default bDoSave = True Case 2 ' Abort - bCallCancelMsg = False - Exit For -' Call CancelTask() + CancelTask(False) + bDoSave = False Case 7 ' No bDoSave = False End Select @@ -204,7 +201,7 @@ Dim MaxFileIndex as Integer ImportDialog.cbCancel.Label = sCloseButton ImportDialog.cbGoOn.Label = sReady ImportDialog.cbGoOn.Enabled = True - bCallCancelMsg = False + bConversionIsRunnig = False Exit Sub RTError: Msgbox sRTErrorDesc, 16, sRTErrorHeader diff --git a/wizards/source/importwizard/ImportDialog.xdl b/wizards/source/importwizard/ImportDialog.xdl index 5e265290f898..d28cb2f42681 100644 --- a/wizards/source/importwizard/ImportDialog.xdl +++ b/wizards/source/importwizard/ImportDialog.xdl @@ -29,7 +29,7 @@ <dlg:event dlg:listener-type="com.sun.star.awt.XActionListener" dlg:event-method="actionPerformed" dlg:script-type="StarBasic" dlg:script-code="ImportWizard.Main.PrevStep"/> </dlg:button> <dlg:button dlg:id="cbCancel" dlg:tab-index="18" dlg:left="6" dlg:top="190" dlg:width="50" dlg:height="14" dlg:help-url="HID:34572" dlg:value="cbCancel"> - <dlg:event dlg:listener-type="com.sun.star.awt.XActionListener" dlg:event-method="actionPerformed" dlg:script-type="StarBasic" dlg:script-code="ImportWizard.Main.CancelButton"/> + <dlg:event dlg:listener-type="com.sun.star.awt.XActionListener" dlg:event-method="actionPerformed" dlg:script-type="StarBasic" dlg:script-code="ImportWizard.Main.CancelTask"/> </dlg:button> <dlg:button dlg:id="cbHelp" dlg:tab-index="19" dlg:left="65" dlg:top="190" dlg:width="50" dlg:height="14" dlg:tag="34571" dlg:help-url="HID:34571" dlg:value="cbHelp"> <dlg:event dlg:listener-type="com.sun.star.awt.XActionListener" dlg:event-method="actionPerformed" dlg:script-type="StarBasic" dlg:script-code="Tools.Recursive.ShowHelperDialog"/> diff --git a/wizards/source/importwizard/Main.xba b/wizards/source/importwizard/Main.xba index e25df463fc74..3851b1f37d59 100644 --- a/wizards/source/importwizard/Main.xba +++ b/wizards/source/importwizard/Main.xba @@ -11,12 +11,12 @@ Public ImportDialogArea as Object Public bSetFonts as Boolean ' If the ProgressPage ist already on Top The Dialog will be immediately closed when this flag is ' set to False -Public bCallCancelMsg as Boolean +Public bConversionIsRunnig as Boolean Sub Main() BasicLibraries.LoadLibrary("Tools") bSetFonts = False - bCallCancelMsg = False + bConversionIsRunnig = False If bSetFonts Then BasicLibraries.LoadLibrary("Translater") GetFontNames() @@ -63,7 +63,7 @@ Dim iCurStep as Integer If Not bDebugWizard Then On Error Goto RTError End If - bCallCancelMsg = False + bConversionIsRunnig = False iCurStep = ImportDialog.Step Select Case iCurStep Case 1 @@ -103,7 +103,7 @@ Dim iCurStep as Integer If Not bDebugWizard Then On Error Goto RTError End If - bCallCancelMsg = False + bConversionIsRunnig = False iCurStep = ImportDialog.Step Select Case iCurStep Case 4 @@ -129,30 +129,27 @@ RTError: End Sub -Sub CancelButton() - If bCallCancelMsg Then - ' Conversion is already running - CancelTask() -' ImportDialog.cbCancel.Enabled = False -' bCancelTask = True +Sub CancelTask(Optional bCloseDialog) + If bConversionIsRunnig Then + If Msgbox(sConvertError1, 36, sConvertError2) = 6 Then + If IsMissing(bDontCloseDialog) Then + ImportDialogArea.EndExecute + Else + If bCloseDialog Then + ImportDialogArea.EndExecute + End If + End If + bCancelTask = True + Else + bCancelTask = False + ImportDialog.cbCancel.Enabled = True + End If Else - ImportDialogArea.EndExecute() + ImportDialogArea.EndExecute() End If End Sub -Function CancelTask() - If Msgbox(sConvertError1, 36, sConvertError2) = 6 Then - ImportDialogArea.EndExecute 'Visible = False -' CancelTask = True - Else - bCancelTask = False - ImportDialog.cbCancel.Enabled = True - CancelTask = False - End If -End Function - - Sub TemplateDirSearchDialog() CallDirSearchDialog(ImportDialog.TemplateImportPath) |