summaryrefslogtreecommitdiff
path: root/wizards/source/importwizard
diff options
context:
space:
mode:
Diffstat (limited to 'wizards/source/importwizard')
-rw-r--r--wizards/source/importwizard/API.xba208
-rw-r--r--wizards/source/importwizard/DialogModul.xba657
-rw-r--r--wizards/source/importwizard/FilesModul.xba824
-rw-r--r--wizards/source/importwizard/ImportDialog.xdl96
-rw-r--r--wizards/source/importwizard/Language.xba157
-rw-r--r--wizards/source/importwizard/Main.xba290
-rw-r--r--wizards/source/importwizard/delzip0
-rw-r--r--wizards/source/importwizard/dialog.xlb5
-rw-r--r--wizards/source/importwizard/importwi.src677
-rw-r--r--wizards/source/importwizard/makefile.mk57
-rw-r--r--wizards/source/importwizard/script.xlb9
11 files changed, 2980 insertions, 0 deletions
diff --git a/wizards/source/importwizard/API.xba b/wizards/source/importwizard/API.xba
new file mode 100644
index 000000000000..d38ba68d832d
--- /dev/null
+++ b/wizards/source/importwizard/API.xba
@@ -0,0 +1,208 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
+<script:module xmlns:script="http://openoffice.org/2000/script" script:name="API" script:language="StarBasic">Declare Function RegOpenKeyEx Lib &quot;advapi32.dll&quot; Alias &quot;RegOpenKeyExA&quot; _
+ (ByVal hKey As Long, _
+ ByVal lpSubKey As String, _
+ ByVal ulOptions As Long, _
+ ByVal samDesired As Long, _
+ phkResult As Long) As Long
+
+Declare Function RegQueryValueExString Lib &quot;advapi32.dll&quot; Alias &quot;RegQueryValueExA&quot; _
+ (ByVal hKey As Long, _
+ ByVal lpValueName As String, _
+ ByVal lpReserved As Long, _
+ lpType As Long, _
+ lpData As String, _
+ lpcbData As Long) As Long
+
+Declare Function RegQueryValueExLong Lib &quot;advapi32.dll&quot; Alias &quot;RegQueryValueExA&quot; _
+ (ByVal hKey As Long, _
+ ByVal lpValueName As String, _
+ ByVal lpReserved As Long, _
+ lpType As Long, _
+ lpData As Long, _
+ lpcbData As Long) As Long
+
+Declare Function RegQueryValueExNULL Lib &quot;advapi32.dll&quot; Alias &quot;RegQueryValueExA&quot; _
+ (ByVal hKey As Long, _
+ ByVal lpValueName As String, _
+ ByVal lpReserved As Long, _
+ lpType As Long, _
+ ByVal lpData As Long, _
+ lpcbData As Long) As Long
+
+Declare Function RegCloseKeyA Lib &quot;advapi32.dll&quot; Alias &quot;RegCloseKey&quot; _
+ (ByVal hKey As Long) As Long
+
+
+Public Const HKEY_CLASSES_ROOT = &amp;H80000000
+Public Const HKEY_CURRENT_USER = &amp;H80000001
+Public Const HKEY_LOCAL_MACHINE = &amp;H80000002
+Public Const HKEY_USERS = &amp;H80000003
+Public Const KEY_ALL_ACCESS = &amp;H3F
+Public Const REG_OPTION_NON_VOLATILE = 0
+Public Const REG_SZ As Long = 1
+Public Const REG_DWORD As Long = 4
+Public Const ERROR_NONE = 0
+Public Const ERROR_BADDB = 1
+Public Const ERROR_BADKEY = 2
+Public Const ERROR_CANTOPEN = 3
+Public Const ERROR_CANTREAD = 4
+Public Const ERROR_CANTWRITE = 5
+Public Const ERROR_OUTOFMEMORY = 6
+Public Const ERROR_INVALID_PARAMETER = 7
+Public Const ERROR_ACCESS_DENIED = 8
+Public Const ERROR_INVALID_PARAMETERS = 87
+Public Const ERROR_NO_MORE_ITEMS = 259
+&apos;Public Const KEY_READ = &amp;H20019
+
+
+Function OpenRegKey(lBaseKey As Long, sKeyName As String) As Variant
+Dim LocKeyValue
+Dim hKey as Long
+Dim lRetValue as Long
+ lRetValue = RegOpenKeyEx(lBaseKey, sKeyName, 0, KEY_ALL_ACCESS, hKey)
+&apos; lRetValue = QueryValue(HKEY_LOCAL_MACHINE, &quot;SOFTWARE\Microsoft\Outlook Express\5.0\Default Settings&quot;, &quot;Revocation Checking&quot;)
+ If hKey &lt;&gt; 0 Then
+ RegCloseKeyA (hKey)
+ End If
+ OpenRegKey() = lRetValue
+End Function
+
+
+Function GetDefaultPath(CurOffice as Integer) As String
+Dim sPath as String
+Dim Index as Integer
+ Select Case Wizardmode
+ Case SBMICROSOFTMODE
+ Index = Applications(CurOffice,SBAPPLKEY)
+ If GetGUIType = 1 Then &apos; Windows
+ sPath = QueryValue(HKEY_LOCAL_MACHINE, sKeyName(Index), sValueName(Index))
+ Else
+ sPath = &quot;&quot;
+ End If
+ If sPath = &quot;&quot; Then
+ sPath = SOWorkPath
+ End If
+ GetDefaultPath = sPath
+ Case SBXMLMODE
+ GetDefaultPath = SOWorkPath
+ End Select
+End Function
+
+
+Function GetTemplateDefaultPath(Index as Integer) As String
+Dim sLocTemplatePath as String
+Dim sLocProgrampath as String
+Dim Progstring as String
+Dim PathList()as String
+Dim Maxindex as Integer
+Dim OldsLocTemplatePath
+Dim sTemplateKeyName as String
+Dim sTemplateValueName as String
+ On Local Error Goto NOVAlIDSYSTEMPATH
+ Select Case WizardMode
+ Case SBMICROSOFTMODE
+ If GetGUIType = 1 Then &apos; Windows
+ &apos; Template directory of Office 97
+ sTemplateKeyName = &quot;Software\Microsoft\Office\8.0\Common\FileNew\LocalTemplates&quot;
+ sTemplateValueName = &quot;&quot;
+ sLocTemplatePath = QueryValue(HKEY_LOCAL_MACHINE, sTemplateKeyName, sTemplateValueName)
+
+ If sLocTemplatePath = &quot;&quot; Then
+ &apos; Retrieve the template directory of Office 2000
+ &apos; Unfortunately there is no existing note about the template directory in
+ &apos; the whole registry.
+
+ &apos; Programdirectory of Office 2000
+ sTemplateKeyName = &quot;Software\Microsoft\Office\9.0\Common\InstallRoot&quot;
+ sTemplateValueName = &quot;Path&quot;
+ sLocProgrampath = QueryValue(HKEY_LOCAL_MACHINE, sTemplateKeyName, sTemplateValueName)
+ If sLocProgrampath &lt;&gt; &quot;&quot; Then
+ If Right(sLocProgrampath, 1) &lt;&gt; &quot;\&quot; Then
+ sLocProgrampath = sLocProgrampath &amp; &quot;\&quot;
+ End If
+ PathList() = ArrayoutofString(sLocProgrampath,&quot;\&quot;,Maxindex)
+ Progstring = &quot;\&quot; &amp; PathList(Maxindex-1) &amp; &quot;\&quot;
+ OldsLocTemplatePath = DeleteStr(sLocProgramPath,Progstring)
+
+ sLocTemplatePath = OldsLocTemplatePath &amp; &quot;\&quot; &amp; &quot;Templates&quot;
+
+ &apos; Does this subdirectory &quot;templates&quot; exist at all
+ If oUcb.Exists(sLocTemplatePath) Then
+ &apos; If Not the main directory of the office is the base
+ sLocTemplatePath = OldsLocTemplatePath
+ End If
+ Else
+ sLocTemplatePath = SOWorkPath
+ End If
+ End If
+ GetTemplateDefaultPath = ConvertToUrl(sLocTemplatePath)
+ Else
+ GetTemplateDefaultPath = SOWorkPath
+ End If
+ Case SBXMLMODE
+ If Index = 3 Then
+ &apos; Helper Application with no templates
+ GetTemplateDefaultPath = SOWorkPath
+ Else
+ GetTemplateDefaultPath = SOTemplatePath
+ End If
+ End Select
+NOVALIDSYSTEMPATH:
+ If Err &lt;&gt; 0 Then
+ GetTemplateDefaultPath() = SOWorkPath
+ Resume ONITGOES
+ ONITGOES:
+ End If
+End Function
+
+
+Function QueryValueEx(ByVal lhKey, ByVal szValueName As String, vValue As String) As Long
+Dim cch As Long
+Dim lrc As Long
+Dim lType As Long
+Dim lValue As Long
+Dim sValue As String
+Dim Empty
+
+ On Error GoTo QueryValueExError
+
+ lrc = RegQueryValueExNULL(lhKey, szValueName, 0&amp;, lType, 0&amp;, cch)
+ If lrc &lt;&gt; ERROR_NONE Then Error 5
+ Select Case lType
+ Case REG_SZ:
+ sValue = String(cch, 0)
+ lrc = RegQueryValueExString(lhKey, szValueName, 0&amp;, lType, sValue, cch)
+ If lrc = ERROR_NONE Then
+ vValue = Left$(sValue, cch)
+ Else
+ vValue = Empty
+ End If
+ Case REG_DWORD:
+ lrc = RegQueryValueExLong(lhKey, szValueName, 0&amp;, lType, lValue, cch)
+ If lrc = ERROR_NONE Then
+ vValue = lValue
+ End If
+ Case Else
+ lrc = -1
+ End Select
+QueryValueExExit:
+ QueryValueEx = lrc
+ Exit Function
+QueryValueExError:
+ Resume QueryValueExExit
+End Function
+
+
+Function QueryValue(BaseKey As Long, sKeyName As String, sValueName As String) As Variant
+Dim lRetVal As Long &apos; Returnvalue API-Call
+Dim hKey As Long &apos; Onen key handle
+Dim vValue As String &apos; Key value
+
+ lRetVal = RegOpenKeyEx(BaseKey, sKeyName, 0, KEY_ALL_ACCESS, hKey)
+ lRetVal = QueryValueEx(hKey, sValueName, vValue)
+ RegCloseKeyA (hKey)
+ QueryValue = vValue
+End Function
+</script:module> \ No newline at end of file
diff --git a/wizards/source/importwizard/DialogModul.xba b/wizards/source/importwizard/DialogModul.xba
new file mode 100644
index 000000000000..d323ba7ed711
--- /dev/null
+++ b/wizards/source/importwizard/DialogModul.xba
@@ -0,0 +1,657 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
+<script:module xmlns:script="http://openoffice.org/2000/script" script:name="DialogModul" script:language="StarBasic">Option Explicit
+
+Public Const bDebugWizard = True
+
+Public Const SBFIRSTAPPLCHECKED = 0
+Public Const SBSECONDAPPLCHECKED = 1
+Public Const SBTHIRDAPPLCHECKED = 2
+Public Const SBFOURTHAPPLCHECKED = 3
+Public bFilterTracingAvailable as Boolean
+Public WizardMode as String
+Public Const SBMICROSOFTMODE = &quot;MS&quot;
+Public Const SBXMLMODE = &quot;SO&quot;
+&apos; The absolute maximal Number of possible Applications
+Public Const Twip = 425
+Public Const SBMAXAPPLCOUNT = 4
+Public MaxApplCount as Integer
+Public CurOffice As Integer
+Public SOBitmapPath As String
+Public SOWorkPath As String
+Public SOTemplatePath as String
+Public bCancelTask As Boolean
+Public bDoKeepApplValues as Boolean
+Public iApplSection as Integer
+Public oUcb as Object
+Public PathSeparator as String
+
+Public ApplCount as Integer
+Public sKeyName(SBMAXAPPLCOUNT-1) as String
+Public sValueName(SBMAXAPPLCOUNT-1) as String
+Public sCRLF as String
+Public MSFilterName(5,4) as String
+Public XMLFilterName(7,3) as String &apos;Number of different formats
+Public FilterTracingLogPath(2) as String
+Public bMSApplFilterTracingAvailable(2) as String
+Public bTakeOverTargetName(2) as Boolean
+Public bTakeOverPathName(2) as Boolean
+
+&apos; e.g.:
+&apos; XMLFilterName(x,0) = &quot;sdw&quot; &apos; in documents we take the extensions; in SO-templates the appropriate Filtername
+&apos; XMLFilterName(x,1) = &quot;swriter: StarWriter 5.0&quot; &apos; the filtername of the target-format
+&apos; XMLFilterName(x,2) = &quot;sxw&quot; &apos; the target extension
+
+Public Applications(SBMAXAPPLCOUNT-1,9)
+
+Public Const SBAPPLCONVERT = 0
+Public Const SBDOCCONVERT = 1
+Public Const SBDOCRECURSIVE = 2
+Public Const SBDOCSOURCE = 3
+Public Const SBDOCTARGET = 4
+Public Const SBTEMPLCONVERT = 5
+Public Const SBTEMPLRECURSIVE = 6
+Public Const SBTEMPLSOURCE = 7
+Public Const SBTEMPLTARGET = 8
+Public Const SBAPPLKEY = 9
+Public XMLTemplateList()
+
+&apos; Application-relating Data are stored in this Array
+&apos; according to the following structure:
+&apos; Applications(X,0) = True/False (Application is to be converted)
+&apos; Applications(X,1) = True/False (Documents are to be converted)
+&apos; Applications(X,2) = True/False (Including Subdirectories)
+&apos; Applications(X,3) = &quot;File:///...&quot; (SourceUrl of the documents)
+&apos; Applications(X,4) = &quot;File///:...&quot; (TargetUrl of the documents)
+&apos; Applications(X,5) = True/False (Templates are to be converted)
+&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)
+
+Public Const SBMAXEXTENSIONLENGTH = 15
+
+
+Sub FillStep_Welcome()
+Dim i as Integer
+&apos; bDoKeepApplValues = False
+ ImportDialogArea.Title = sTitle
+ With ImportDialog
+ .cmdHelp.Label = sHelpButton
+ .cmdCancel.Label = sCancelButton
+ .cmdBack.Label = sBackButton
+ .cmdGoOn.Label = sNextButton
+ .WelcomeTextLabel.Label = sWelcomeTextLabel1
+ .WelcomeTextLabel2.Label = sWelcomeTextLabel2
+ .WelcomeTextLabel3.Label = sWelcomeTextLabel3
+
+ .optMSDocuments.Label = sContainerName(0)
+ .chkMSApplication1.Label = sMsDocumentCheckbox(0)
+ .chkMSApplication2.Label = sMsDocumentCheckbox(1)
+ .chkMSApplication3.Label = sMsDocumentCheckbox(2)
+
+ .optSODocuments.Label = sContainerName(1)
+ .chkSOApplication1.Label = sSODocumentCheckbox(0)
+ .chkSOApplication2.Label = sSODocumentCheckbox(1)
+ .chkSOApplication3.Label = sSODocumentCheckbox(2)
+ .chkSOApplication4.Label = sSODocumentCheckbox(3)
+ .cmdBack.Enabled = False
+ .Step = 1
+
+ If Not oFactoryKey.hasbyName(&quot;com.sun.star.text.TextDocument&quot;) Then
+ .chkLogfile.State = 0
+ .chkLogfile.Enabled = False
+ End If
+ End With
+ CheckModuleInstallation()
+ ToggleNextButton()
+End Sub
+
+
+Sub FillStep_InputPaths(OfficeIndex as Integer, bStartup as Boolean)
+Dim Index as Integer
+Dim oNullObject as Object
+ If bStartup And Not bDoKeepApplValues Then
+ If ImportDialog.optMSDocuments.State = 1 Then
+ SetupMSConfiguration()
+ Else
+ SetupXMLConfiguration()
+ End If
+ FillUpApplicationList()
+ End If
+ CurOffice = OfficeIndex
+ Index = Applications(CurOffice,SBAPPLKEY)
+ InitializePathsforCurrentApplication(Index)
+ With ImportDialog
+ .chkTemplatePath.Label = sTemplateCheckbox(Index)
+ .chkDocumentPath.State = Abs(Applications(CurOffice,SBDOCCONVERT))
+ .chkDocumentSearchSubDir.State = Abs(Applications(CurOffice,SBDOCRECURSIVE))
+ .txtDocumentImportPath.Text = ConvertFromUrl(Applications(CurOffice,SBDOCSOURCE))
+ .txtDocumentExportPath.Text = ConvertFromUrl(Applications(CurOffice,SBDOCTARGET))
+ .hlnDocuments.Label = sProgressMoreDocs
+ If WizardMode = SBXMLMODE Then
+ ImportDialogArea.Title = sTitle &amp; &quot; - &quot; &amp; sSODocumentCheckBox(Index)
+ Else
+ ImportDialogArea.Title = sTitle &amp; &quot; - &quot; &amp; sMSDocumentCheckBox(Index)
+ End If
+ If WizardMode = SBXMLMODE AND Index = 3 Then
+ &apos; Note: SO-Helper Applications are partly treated like templates although they only have documents
+ .hlnTemplates.Label = sProgressMoreDocs
+ .chkTemplatePath.Label = sSOHelperDocuments(0,0)
+ .chkTemplatePath.Enabled = oFactoryKey.HasByName(sSOHelperDocuments(0,1))
+ .chkDocumentPath.Label = sSOHelperDocuments(1,0)
+ .chkDocumentPath.Enabled = oFactoryKey.HasByName(sSOHelperDocuments(1,1))
+ Else
+ .chkTemplatePath.Enabled = True
+ .chkDocumentPath.Enabled = True
+ .chkTemplatePath.Label = sTemplateCheckbox(Index)
+ .chkDocumentPath.Label = sDocumentCheckbox(Index)
+ .hlnTemplates.Label = sProgressMoreTemplates
+ End If
+ .chkTemplatePath.State = Abs(Applications(CurOffice,SBTEMPLCONVERT))
+ ToggleInputPaths(oNullObject,&quot;Template&quot;)
+ ToggleInputPaths(oNullObject,&quot;Document&quot;)
+ .chkTemplateSearchSubDir.State = Abs(Applications(CurOffice,SBTEMPLRECURSIVE))
+ .txtTemplateImportPath.Text = ConvertFromUrl(Applications(CurOffice,SBTEMPLSOURCE))
+ .txtTemplateExportPath.Text = ConvertFromUrl(Applications(CurOffice,SBTEMPLTARGET))
+ .cmdGoOn.Label = sNextButton
+ .cmdBack.Enabled = True
+ ImportDialog.Step = 2
+ End With
+ ImportDialogArea.GetControl(&quot;chkTemplatePath&quot;).SetFocus()
+ ToggleNextButton()
+End Sub
+
+
+Sub FillUpApplicationList()
+Dim i as Integer
+Dim a as Integer
+Dim BoolValue as Boolean
+ If Not bDoKeepApplValues Then
+ a = 0
+ For i = 1 To ApplCount
+ If ImportDialog.optMSDocuments.State = 1 Then
+ BoolValue = ImportDialogArea.GetControl(&quot;chkMSApplication&quot; &amp; i).Model.State = 1
+ Else
+ BoolValue = ImportDialogArea.GetControl(&quot;chkSOApplication&quot; &amp; i).Model.State = 1
+ End If
+ Applications(a,SBAPPLCONVERT) = BoolValue
+ Applications(a,SBDOCCONVERT) = BoolValue
+ Applications(a,SBDOCRECURSIVE) = BoolValue
+ Applications(a,SBDOCSOURCE) = &quot;&quot; &apos; GetDefaultPath(i)
+ Applications(a,SBDOCTARGET) = &quot;&quot; &apos; SOWorkPath
+ Applications(a,SBTEMPLCONVERT) = BoolValue
+ Applications(a,SBTEMPLRECURSIVE) = BoolValue
+ Applications(a,SBTEMPLSOURCE) = &quot;&quot; &apos; GetTemplateDefaultPath(i)
+ Applications(a,SBTEMPLTARGET) = &quot;&quot; &apos; GetTargetTemplatePath(i)
+ Applications(a,SBAPPLKEY) = i-1
+ If BoolValue Then
+ a = a + 1
+ End If
+ Next i
+ ApplCount = a
+ End If
+End Sub
+
+
+Sub InitializePathsforCurrentApplication(i as Integer)
+ AssignPathToCurrentApplication(SBDOCSOURCE, GetDefaultPath(i))
+ AssignPathToCurrentApplication(SBDOCTARGET, SOWorkPath)
+ AssignPathToCurrentApplication(SBTEMPLSOURCE, GetTemplateDefaultPath(i))
+ AssignPathToCurrentApplication(SBTEMPLTARGET, GetTargetTemplatePath(i))
+End Sub
+
+
+Sub AssignPathToCurrentApplication(Index as Integer, NewPath as String)
+ If Applications(CurOffice,Index) = &quot;&quot; Then
+ If CurOffice &gt; 0 Then
+ Applications(CurOffice,Index) = Applications(CurOffice-1,Index)
+ Else
+ Applications(CurOffice,Index) = NewPath
+ End If
+ End If
+End Sub
+
+
+Sub SaveStep_InputPath()
+ Applications(CurOffice,SBDOCCONVERT) = ImportDialog.chkDocumentPath.State = 1
+ Applications(CurOffice,SBDOCRECURSIVE) = ImportDialog.chkDocumentSearchSubDir.State = 1
+ Applications(CurOffice,SBDOCSOURCE) = ConvertToURL(ImportDialog.txtDocumentImportPath.Text)
+ Applications(CurOffice,SBDOCTARGET) = ConvertToUrl(ImportDialog.txtDocumentExportPath.Text)
+ Applications(CurOffice,SBTEMPLCONVERT) = ImportDialog.chkTemplatePath.State = 1
+ Applications(CurOffice,SBTEMPLRECURSIVE) = ImportDialog.chkTemplateSearchSubDir.State = 1
+ Applications(CurOffice,SBTEMPLSOURCE) = ConvertToURL(ImportDialog.txtTemplateImportPath.Text)
+ Applications(CurOffice,SBTEMPLTARGET) = ConvertToURL(ImportDialog.txtTemplateExportPath.Text)
+End Sub
+
+
+Sub ToggleInputPaths(aEvent as Object, Optional sDocType)
+Dim bDoEnable as Boolean
+Dim sLocDocType as String
+Dim oCheckBox as Object
+ If Not IsNull(aEvent) Then
+ sLocDocType = aEvent.Source.Model.Tag
+ Else
+ sLocDocType = sDocType
+ End If
+ With ImportDialogArea
+ oCheckBox = .GetControl(&quot;chk&quot; &amp; sLocDocType &amp; &quot;Path&quot;).Model
+ bDoEnable = oCheckBox.State = 1 And oCheckBox.Enabled
+ .GetControl(&quot;lbl&quot; &amp; sLocDocType &amp; &quot;Import&quot;).Model.Enabled = bDoEnable
+ .GetControl(&quot;lbl&quot; &amp; sLocDocType &amp; &quot;Export&quot;).Model.Enabled = bDoEnable
+ .GetControl(&quot;txt&quot; &amp; sLocDocType &amp; &quot;ImportPath&quot;).Model.Enabled = bDoEnable
+ .GetControl(&quot;txt&quot; &amp; sLocDocType &amp; &quot;ExportPath&quot;).Model.Enabled = bDoEnable
+ .GetControl(&quot;chk&quot; &amp; sLocDocType &amp; &quot;SearchSubDir&quot;).Model.Enabled = bDoEnable
+ .GetControl(&quot;cmd&quot; &amp; sLocDocType &amp; &quot;Import&quot;).Model.Enabled = bDoEnable
+ .GetControl(&quot;cmd&quot; &amp; sLocDocType &amp; &quot;Export&quot;).Model.Enabled = bDoEnable
+ End With
+ ToggleNextButton()
+End Sub
+
+
+Function MakeSummaryString()
+Dim sTmpText As String
+Dim i as Integer
+Dim Index as Integer
+Dim sAddText as String
+ For i = 0 To ApplCount -1
+ Index = Applications(i,SBAPPLKEY)
+ GetFilterTracingLogPath(i, Index)
+ If Applications(i,SBTEMPLCONVERT) Then
+ &apos; Templates are to be converted
+ sAddText = &quot;&quot;
+ If WizardMode = SBMICROSOFTMODE Then
+ sAddText = sSumMSTemplates(Index) &amp; sCRLF
+ Else
+ sAddText = sSumSOTemplates(Index) &amp; sCRLF
+ End If
+ sTmpText = sTmpText &amp; sAddText &amp; ConvertFromUrl(Applications(i,SBTEMPLSOURCE)) &amp; sCRLF
+ If Applications(i,SBTEMPLRECURSIVE) Then
+ &apos; Including Subdirectories
+ sTmpText = sTmpText &amp; sSumInclusiveSubDir &amp; sCRLF
+ End If
+ sTmpText = sTmpText &amp; sSumSaveDocuments &amp; sCRLF
+ sTmpText = sTmpText &amp; ConvertFromUrl(Applications(i,SBTEMPLTARGET)) &amp; sCRLF
+ sTmpText = sTmpText &amp; sCRLF
+ End If
+
+ If Applications(i,SBDOCCONVERT) Then
+ &apos; Documents are to be converted
+ If WizardMode = SBMICROSOFTMODE Then
+ sAddText = sSumMSDocuments(Index) &amp; sCRLF
+ Else
+ sAddText = sSumSODocuments(Index) &amp; sCRLF
+ End If
+ sTmpText = sTmpText &amp; sAddText &amp; ConvertFromUrl(Applications(i,SBDOCSOURCE)) &amp; sCRLF
+
+ If Applications(i,SBDOCRECURSIVE) Then
+ &apos; Including Subdirectories
+ sTmpText = sTmpText &amp; sSumInclusiveSubDir &amp; sCRLF
+ End If
+
+ sTmpText = sTmpText &amp; sSumSaveDocuments &amp; sCRLF
+ sTmpText = sTmpText &amp; ConvertFromUrl(Applications(i,SBDOCTARGET)) &amp; sCRLF
+ sTmpText = sTmpText &amp; sCRLF
+ End If
+ Next i
+ MakeSummaryString = sTmpText
+End Function
+
+
+Sub FillStep_Summary()
+ ImportDialogArea.Title = sTitle
+ With ImportDialog
+ .SummaryTextbox.Text = MakeSummaryString()
+ .cmdGoOn.Enabled = .SummaryTextbox.Text &lt;&gt; &quot;&quot;
+ .cmdGoOn.Label = sBeginButton
+ .SummaryHeaderLabel.Label = sSummaryHeader
+ .Step = 3
+ End With
+ ImportDialogArea.GetControl(&quot;SummaryHeaderLabel&quot;).SetFocus()
+End Sub
+
+
+Sub FillStep_Progress()
+ With ImportDialog
+ .cmdBack.Enabled = False
+ .cmdGoOn.Enabled = False
+ .hlnProgress.Label = sProgressPage_1
+ .LabelRetrieval.FontWeight = com.sun.star.awt.FontWeight.BOLD
+ .LabelRetrieval.Label = sProgressPage_2
+ .LabelCurProgress.Label = sProgressPage_3
+ .LabelCurDocumentRetrieval.Label = &quot;&quot;
+ .LabelCurTemplateRetrieval.Label = &quot;&quot;
+ .LabelCurDocument.Label = &quot;&quot;
+ .Step = 4
+ End With
+ ImportDialogArea.GetControl(&quot;LabelRetrieval&quot;).SetFocus()
+ If ImportDialog.chkLogfile.State = 1 Then
+ ImportDialog.cmdShowLogFile.DefaultButton = True
+ End If
+End Sub
+
+
+Sub GetFilterTracingLogPath(i as Integer, Index as Integer)
+Dim aNodePath(0) as new com.sun.star.beans.PropertyValue
+Dim oMasterKey
+Dim oImportKey
+Dim oWordKey
+Dim oExcelkey
+Dim oPowerpointKey
+Dim oFilterService
+ aNodePath(0).Name = &quot;nodepath&quot;
+ aNodePath(0).Value = &quot;org.openoffice.Office.Tracing&quot;
+ oFilterService = createUnoService(&quot;com.sun.star.util.FilterTracer&quot;)
+ bFilterTracingAvailable = Not IsNull(oFilterService)
+ If bFilterTracingAvailable Then
+ oMasterkey = GetRegistryKeyContent(&quot;org.openoffice.Office.Tracing/&quot;)
+ If oMasterKey.hasbyName(&quot;Import&quot;) Then
+ oImportKey = GetRegistryKeyContent(&quot;org.openoffice.Office.Tracing/Import&quot;)
+ bMSApplFilterTracingAvailable(i) = CheckMSImportAvailability(oImportkey, MSFiltername(Index, 4), FilterTracingLogPath(i), bTakeOverTargetName(i), bTakeOverPathName(i))
+ End If
+ End If
+End Sub
+
+
+Function CheckMSImportAvailability(oImportkey, MSApplName as String, MSLogPath as String, bTakeOverTargetname as String, bTakeOverpathName as String) as Boolean
+Dim bApplIsAvailable as Boolean
+Dim oApplKey
+Dim LocApplName as String
+Dim LocApplPath as String
+ bApplIsAvailable = oImportKey.hasbyName(MSApplName)
+ If bApplIsAvailable Then
+ oApplKey = oImportKey.getByName(MSApplName)
+ bApplIsAvailable = oApplKey.On
+ LocApplName = oApplKey.Name
+ LocApplPath = oApplKey.Path
+ bTakeOverTargetName = (LocApplName = &quot;&quot;)
+ bTakeOverPathName = (LocApplPath = &quot;&quot;)
+ MSLogPath = LocApplPath &amp; &quot;/&quot; &amp; LocApplName &amp; &quot;.log&quot;
+ End If
+ CheckMSImportAvailability() = bApplIsAvailable
+End Function
+
+
+
+Sub SetupMSConfiguration()
+ iApplSection = 0
+ Wizardmode = SBMICROSOFTMODE
+ MaxApplCount = 3
+ ApplCount = 3
+ &apos; chkTemplatePath-Captions
+ GetApplResourceArray(1009 + iApplSection, ApplCount, sTemplateCheckBox())
+ &apos; DocumentCheckbox- Captions
+ GetApplResourceArray(1009 + iApplSection + ApplCount, ApplCount, sDocumentCheckBox())
+
+ sKeyName(0) = &quot;Software\Microsoft\Office\8.0\Word\Options&quot;
+ sKeyName(1) = &quot;Software\Microsoft\Office\8.0\Excel\Microsoft Excel&quot;
+ sKeyName(2) = &quot;Software\Microsoft\Office\8.0\PowerPoint\Recent Folder List\Default&quot;
+
+ sValueName(0) = &quot;DOC-PATH&quot;
+ sValueName(1) = &quot;DefaultPath&quot;
+ sValueName(2) = &quot;&quot;
+
+&apos; See definition of Filtername-Array about meaning of fields
+ MSFilterName(0,0) = &quot;doc&quot;
+ MSFilterName(0,1) = &quot;writer8&quot;
+ MSFilterName(0,2) = &quot;odt&quot;
+ MSFilterName(0,3) = sMSDocumentCheckBox(0)
+ MSFilterName(0,4) = &quot;Word&quot;
+
+
+ MSFilterName(1,0) = &quot;xls&quot;
+ MSFilterName(1,1) = &quot;calc8&quot;
+ MSFilterName(1,2) = &quot;ods&quot;
+ MSFilterName(1,3) = sMSDocumentCheckBox(1)
+ MSFilterName(1,4) = &quot;Excel&quot;
+
+ MSFilterName(2,0) = &quot;ppt|pps&quot;
+ MSFilterName(2,1) = &quot;impress8|impress8&quot;
+ MSFilterName(2,2) = &quot;odp|odp&quot;
+ MSFilterName(2,3) = sMSDocumentCheckBox(2)
+ MSFilterName(2,4) = &quot;PowerPoint&quot;
+
+ MSFilterName(3,0) = &quot;dot&quot;
+ MSFilterName(3,1) = &quot;writer8_template&quot;
+ MSFilterName(3,2) = &quot;ott&quot;
+ MSFilterName(3,3) = sMSTemplateCheckBox(0)
+ MSFilterName(3,4) = &quot;Word&quot;
+
+ MSFilterName(4,0) = &quot;xlt&quot;
+ MSFilterName(4,1) = &quot;calc8_template&quot;
+ MSFilterName(4,2) = &quot;ots&quot;
+ MSFilterName(4,3) = sMSTemplateCheckBox(1)
+ MSFilterName(4,4) = &quot;Excel&quot;
+
+ MSFilterName(5,0) = &quot;pot&quot;
+ MSFilterName(5,1) = &quot;impress8_template&quot;
+ MSFilterName(5,2) = &quot;otp&quot;
+ MSFilterName(5,3) = sMSTemplateCheckBox(2)
+ MSFilterName(5,4) = &quot;PowerPoint&quot;
+End Sub
+
+
+
+&apos; This is an extract from &quot;http://util.openoffice.org/source/browse/util/sot/source/base/exchange.cxx?rev=1.25&amp;content-type=text/x-cvsweb-markup&quot;
+&apos; about the listed defined mimetypes that are required to define binary StarOffice templates that have for all applications the same extension &quot;.vor&quot;
+
+&apos; 26 SOT_FORMATSTR_ID_STARWRITER_30*/ { &quot;application/x-openoffice-starwriter-30;windows_formatname=\&quot;StarWriter 3.0\&quot;&quot;, &quot;StarWriter 3.0&quot;, &amp;::getCppuType( (const Sequence&lt; sal_Int8 &gt;*) 0 ) },
+&apos; 27 SOT_FORMATSTR_ID_STARWRITER_40*/ { &quot;application/x-openoffice-starwriter-40;windows_formatname=\&quot;StarWriter 4.0\&quot;&quot;, &quot;StarWriter 4.0&quot;, &amp;::getCppuType( (const Sequence&lt; sal_Int8 &gt;*) 0 ) },
+&apos; 28 SOT_FORMATSTR_ID_STARWRITER_50*/ { &quot;application/x-openoffice-starwriter-50;windows_formatname=\&quot;StarWriter 5.0\&quot;&quot;, &quot;StarWriter 5.0&quot;, &amp;::getCppuType( (const Sequence&lt; sal_Int8 &gt;*) 0 ) },
+
+&apos; 29 SOT_FORMATSTR_ID_STARWRITERWEB_40*/ { &quot;application/x-openoffice-starwriterweb-40;windows_formatname=\&quot;StarWriter/Web 4.0\&quot;&quot;, &quot;StarWriter/Web 4.0&quot;, &amp;::getCppuType( (const Sequence&lt; sal_Int8 &gt;*) 0 ) },
+&apos; 30 SOT_FORMATSTR_ID_STARWRITERWEB_50*/ { &quot;application/x-openoffice-starwriterweb-50;windows_formatname=\&quot;StarWriter/Web 5.0\&quot;&quot;, &quot;StarWriter/Web 5.0&quot;, &amp;::getCppuType( (const Sequence&lt; sal_Int8 &gt;*) 0 ) },
+
+&apos; 31 SOT_FORMATSTR_ID_STARWRITERGLOB_40*/ { &quot;application/x-openoffice-starwriterglob-40;windows_formatname=\&quot;StarWriter/Global 4.0\&quot;&quot;, &quot;StarWriter/Global 4.0&quot;, &amp;::getCppuType( (const Sequence&lt; sal_Int8 &gt;*) 0 ) },
+&apos; 32 SOT_FORMATSTR_ID_STARWRITERGLOB_50*/ { &quot;application/x-openoffice-starwriterglob-50;windows_formatname=\&quot;StarWriter/Global 5.0\&quot;&quot;, &quot;StarWriter/Global 5.0&quot;, &amp;::getCppuType( (const Sequence&lt; sal_Int8 &gt;*) 0 ) },
+
+&apos; 33 SOT_FORMATSTR_ID_STARDRAW*/ { &quot;application/x-openoffice-stardraw;windows_formatname=\&quot;StarDrawDocument\&quot;&quot;, &quot;StarDrawDocument&quot;, &amp;::getCppuType( (const Sequence&lt; sal_Int8 &gt;*) 0 ) },
+&apos; 34 SOT_FORMATSTR_ID_STARDRAW_40*/ { &quot;application/x-openoffice-stardraw-40;windows_formatname=\&quot;StarDrawDocument 4.0\&quot;&quot;, &quot;StarDrawDocument 4.0&quot;, &amp;::getCppuType( (const Sequence&lt; sal_Int8 &gt;*) 0 ) },
+&apos; 36 SOT_FORMATSTR_ID_STARDRAW_50*/ { &quot;application/x-openoffice-stardraw-50;windows_formatname=\&quot;StarDraw 5.0\&quot;&quot;, &quot;StarDraw 5.0&quot;, &amp;::getCppuType( (const Sequence&lt; sal_Int8 &gt;*) 0 ) },
+
+&apos; 35 SOT_FORMATSTR_ID_STARIMPRESS_50*/ { &quot;application/x-openoffice-starimpress-50;windows_formatname=\&quot;StarImpress 5.0\&quot;&quot;, &quot;StarImpress 5.0&quot;, &amp;::getCppuType( (const Sequence&lt; sal_Int8 &gt;*) 0 ) },
+
+&apos; 37 SOT_FORMATSTR_ID_STARCALC*/ { &quot;application/x-openoffice-starcalc;windows_formatname=\&quot;StarCalcDocument\&quot;&quot;, &quot;StarCalcDocument&quot;, &amp;::getCppuType( (const Sequence&lt; sal_Int8 &gt;*) 0 ) },
+&apos; 38 SOT_FORMATSTR_ID_STARCALC_40*/ { &quot;application/x-openoffice-starcalc-40;windows_formatname=\&quot;StarCalc 4.0\&quot;&quot;, &quot;StarCalc 4.0&quot;, &amp;::getCppuType( (const Sequence&lt; sal_Int8 &gt;*) 0 ) },
+&apos; 39 SOT_FORMATSTR_ID_STARCALC_50*/ { &quot;application/x-openoffice-starcalc-50;windows_formatname=\&quot;StarCalc 5.0\&quot;&quot;, &quot;StarCalc 5.0&quot;, &amp;::getCppuType( (const Sequence&lt; sal_Int8 &gt;*) 0 ) },
+
+&apos; 40 SOT_FORMATSTR_ID_STARCHART*/ { &quot;application/x-openoffice-starchart;windows_formatname=\&quot;StarChartDocument\&quot;&quot;, &quot;StarChartDocument&quot;, &amp;::getCppuType( (const Sequence&lt; sal_Int8 &gt;*) 0 ) },
+&apos; 41 SOT_FORMATSTR_ID_STARCHART_40*/ { &quot;application/x-openoffice-starchart-40;windows_formatname=\&quot;StarChartDocument 4.0\&quot;&quot;, &quot;StarChartDocument 4.0&quot;, &amp;::getCppuType( (const Sequence&lt; sal_Int8 &gt;*) 0 ) },
+&apos; 42 SOT_FORMATSTR_ID_STARCHART_50*/ { &quot;application/x-openoffice-starchart-50;windows_formatname=\&quot;StarChart 5.0\&quot;&quot;, &quot;StarChart 5.0&quot;, &amp;::getCppuType( (const Sequence&lt; sal_Int8 &gt;*) 0 ) },
+
+&apos; 46 SOT_FORMATSTR_ID_STARMATH*/ { &quot;application/x-openoffice-starmath;windows_formatname=\&quot;StarMath\&quot;&quot;, &quot;StarMath&quot;, &amp;::getCppuType( (const Sequence&lt; sal_Int8 &gt;*) 0 ) },
+&apos; 47 SOT_FORMATSTR_ID_STARMATH_40*/ { &quot;application/x-openoffice-starmath-40;windows_formatname=\&quot;StarMathDocument 4.0\&quot;&quot;, &quot;StarMathDocument 4.0&quot;, &amp;::getCppuType( (const Sequence&lt; sal_Int8 &gt;*) 0 ) },
+&apos; 48 SOT_FORMATSTR_ID_STARMATH_50*/ { &quot;application/x-openoffice-starmath-50;windows_formatname=\&quot;StarMath 5.0\&quot;&quot;, &quot;StarMath 5.0&quot;, &amp;::getCppuType( (const Sequence&lt; sal_Int8 &gt;*) 0 ) },
+
+
+Sub SetupXMLConfiguration()
+ iApplSection = 1000
+ Wizardmode = SBXMLMODE
+ ApplCount = 4
+ MaxApplCount = 4
+ XMLTemplateList = Array(&quot;vor&quot;, &quot;sti&quot;, &quot;stw&quot; , &quot;stc&quot; , &quot;std&quot;)
+ &apos; chkTemplatePath-Captions
+ GetApplResourceArray(1009 + iApplSection, ApplCount, sTemplateCheckBox())
+ &apos; DocumentCheckbox- Captions
+ GetApplResourceArray(1009 + iApplSection + ApplCount, ApplCount, sDocumentCheckBox())
+
+ XMLFilterName(0,0) = &quot;sdw|sxw&quot;
+ XMLFilterName(0,1) = &quot;writer8|writer8&quot;
+ XMLFilterName(0,2) = &quot;odt|odt&quot;
+ XMLFilterName(0,3) = sDocumentCheckBox(0)
+
+ XMLFilterName(1,0) = &quot;sdc|sxc&quot;
+ XMLFilterName(1,1) = &quot;calc8|calc8&quot;
+ XMLFilterName(1,2) = &quot;ods|ods&quot;
+ XMLFilterName(1,3) = sDocumentCheckBox(1)
+
+ If oFactoryKey.HasByName(&quot;com.sun.star.drawing.DrawingDocument&quot;) and oFactoryKey.HasByName(&quot;com.sun.star.presentation.PresentationDocument&quot;) Then
+ XMLFilterName(2,0) = &quot;sdd|sda|sxi|sxd&quot;
+ XMLFilterName(2,1) = &quot;impress8|draw8|impress8|draw8&quot;
+ XMLFilterName(2,2) = &quot;odp|odg|odp|odg&quot;
+ Elseif oFactoryKey.HasByName(&quot;com.sun.star.drawing.DrawingDocument&quot;) Then
+ XMLFilterName(2,0) = &quot;sda|sxd&quot;
+ XMLFilterName(2,1) = &quot;draw8|draw8&quot;
+ XMLFilterName(2,2) = &quot;odg|odg&quot;
+ Elseif oFactoryKey.HasByName(&quot;com.sun.star.presentation.PresentationDocument&quot;) Then
+ XMLFilterName(2,0) = &quot;sdd|sxi&quot;
+ XMLFilterName(2,1) = &quot;impress8|impress8&quot;
+ XMLFilterName(2,2) = &quot;odp|odp&quot;
+ End If
+ XMLFilterName(2,3) = sDocumentCheckBox(2)
+
+
+ XMLFilterName(3,0) = &quot;smf|sxm&quot;
+ XMLFilterName(3,1) = &quot;math8|math8&quot;
+ XMLFilterName(3,2) = &quot;odf|odf&quot;
+ XMLFilterName(3,3) = sDocumentCheckBox(3)
+
+ XMLFilterName(4,0) = &quot;application/x-openoffice-starwriter|application/vnd.stardivision.writer/web|application/vnd.sun.xml.writer|application/vnd.sun.xml.writerweb&quot;
+ XMLFilterName(4,1) = &quot;writer8_template|writerweb8_writer_template|writer8_template|writerweb8_writer_template&quot;
+ XMLFilterName(4,2) = &quot;ott|oth|ott|oth&quot;
+ XMLFilterName(4,3) = sTemplateCheckBox(0)
+
+
+ XMLFilterName(5,0) = &quot;application/x-openoffice-starcalc|application/vnd.sun.xml.calc&quot;
+ XMLFilterName(5,1) = &quot;calc8_template|calc8_template&quot;
+ XMLFilterName(5,2) = &quot;ots|ots&quot;
+ XMLFilterName(5,3) = sTemplateCheckBox(1)
+
+ &apos; due to bug #108942# impress templates of the version 4.0 have to be handled in a special way because their mimetype
+ &apos; falsely points to the draw application.
+ If oFactoryKey.HasByName(&quot;com.sun.star.drawing.DrawingDocument&quot;) and oFactoryKey.HasByName(&quot;com.sun.star.presentation.PresentationDocument&quot;) Then
+ XMLFilterName(6,0) = &quot;application/x-openoffice-starimpress|application/x-openoffice-stardraw-40|application/x-openoffice-stardraw|application/vnd.sun.xml.impress|application/vnd.sun.xml.draw&quot;
+ XMLFilterName(6,1) = &quot;impress8_template|impress8_template|draw8_template|impress8_template|draw8_template&quot;
+ XMLFilterName(6,2) = &quot;otp|otp|otg|otp|otg&quot;
+ Elseif oFactoryKey.HasByName(&quot;com.sun.star.drawing.DrawingDocument&quot;) Then
+ XMLFilterName(6,0) = &quot;application/x-openoffice-stardraw|application/vnd.sun.xml.draw&quot;
+ XMLFilterName(6,1) = &quot;draw8_template|draw8_template&quot;
+ XMLFilterName(6,2) = &quot;otg|otg&quot;
+ Elseif oFactoryKey.HasByName(&quot;com.sun.star.presentation.PresentationDocument&quot;) Then
+ XMLFilterName(6,0) = &quot;application/x-openoffice-starimpress|application/x-openoffice-stardraw-40|application/vnd.sun.xml.impress&quot;
+ XMLFilterName(6,1) = &quot;impress8_template|impress8_template|impress8_template&quot;
+ XMLFilterName(6,2) = &quot;otp|otp|otp&quot;
+ End If
+ XMLFilterName(6,3) = sTemplateCheckBox(2)
+
+ If oFactoryKey.HasByName(&quot;com.sun.star.text.GlobalDocument&quot;) Then
+ XMLFilterName(7,0) = &quot;sgl|sxg&quot;
+ XMLFilterName(7,1) = &quot;writerglobal8|writerglobal8&quot;
+ XMLFilterName(7,2) = &quot;odm|odm&quot;
+ XMLFilterName(7,3) = sTemplateCheckBox(3)
+ End If
+End Sub
+
+
+Function CheckControlPath(oCheckbox as Object, oTextBox as Object, ByVal bDoEnable as Boolean)
+Dim sPath as String
+ If Not bDoEnable Then
+ CheckControlPath = False
+ ElseIf oCheckbox.State = 0 Then
+ CheckControlPath = True
+ Else
+ sPath = ConvertToUrl(Trim(oTextBox.Text)
+ CheckControlPath = oUcb.Exists(sPath)
+ End If
+End Function
+
+
+Function CheckInputPaths() as Boolean
+Dim bChangePage as Boolean
+ bChangePage = CheckTextBoxPath(ImportDialog.txtTemplateImportPath, True, False, sTitle, False)
+ bChangePage = CheckTextBoxPath(ImportDialog.txtTemplateExportPath, bChangePage, True, sTitle, False)
+ bChangePage = CheckTextBoxPath(ImportDialog.txtDocumentImportPath, bChangePage, False, sTitle, False)
+ bChangePage = CheckTextBoxPath(ImportDialog.txtDocumentExportPath, bChangePage, True, sTitle, False)
+ CheckInputPaths = bChangePage
+End Function
+
+
+Function CheckTextBoxPath(oTextBox as Object, ByVal bCheck as Boolean, bCreateNew as Boolean, sTitle as String, bgetResources as Boolean) as Boolean
+Dim iCreate as Integer
+Dim sQueryMessage as String
+Dim sUrlPath as String
+Dim sMessageNoDir as String
+Dim sShowPath as String
+Dim oLocUcb as Object
+ oLocUcb = createUnoService(&quot;com.sun.star.ucb.SimpleFileAccess&quot;)
+ If bGetResources Then
+ If InitResources(&quot;ImportWizard&quot;,&quot;imp&quot;) then
+ sNoDirCreation = GetResText(1050)
+ sMsgDirNotThere = GetResText(1051)
+ sQueryForNewCreation = GetResText(1052)
+ Else
+ CheckTextBoxPath() = False
+ Exit Function
+ End If
+ End If
+ If oTextBox.Enabled Then
+ If bCheck Then
+ sShowPath = oTextBox.Text
+ sUrlPath = ConvertToUrl(sShowPath)
+ If Not oLocUcb.Exists(sUrlPath) Then
+ If Not bCreateNew Then
+ &apos; Sourcedirectories must be existing, Targetdirectories may be created new
+ sQueryMessage = ReplaceString(sMsgDirNotThere, sShowPath,&quot;%1&quot;)
+ Msgbox(sQueryMessage,16,sTitle)
+ CheckTextBoxPath() = False
+ Exit Function
+ Else
+ sQueryMessage = ReplaceString(sMsgDirNotThere, sShowPath,&quot;%1&quot;)
+ sQueryMessage = sQueryMessage &amp; Chr(13) &amp; sQueryForNewCreation
+ iCreate = Msgbox (sQueryMessage, 36, sTitle)
+ If iCreate = 6 Then
+ On Local Error Goto NOVALIDPATH
+ CreateFolder(sUrlPath)
+ If Not oLocUcb.Exists(sUrlPath) Then
+ Goto NOVALIDPATH
+ End If
+ Else
+ CheckTextBoxPath() = False
+ Exit Function
+ End If
+ End If
+ End If
+ CheckTextBoxPath() = True
+ Else
+ CheckTextBoxPath() = False
+ End If
+ Else
+ CheckTextBoxPath() = True
+ End If
+ Exit Function
+NOVALIDPATH:
+ sMessageNoDir = ReplaceString(sNoDirCreation, sShowPath, &quot;%1&quot;)
+ Msgbox(sMessageNoDir, 16, sTitle)
+ CheckTextBoxPath() = False
+End Function
+
+
+Sub InitializeProgressPage(oDialog as Object)
+ oDialog.LabelRetrieval.FontWeight = com.sun.star.awt.FontWeight.NORMAL
+ oDialog.LabelCurProgress.FontWeight = com.sun.star.awt.FontWeight.BOLD
+End Sub
+
+
+Sub SetProgressDisplay(AbsFound as Integer)
+ ImportDialog.LabelRetrieval.Label = sProgressPage_2 &amp; &quot; &quot; &amp; ReplaceString(sProgressPage_5, Str(AbsFound) &amp; &quot; &quot;, &quot;%1&quot;)
+ ImportDialog.LabelCurDocumentRetrieval.Label = sProgressFound &amp; &quot; &quot; &amp; CStr(AbsDocuFound) &amp; &quot; &quot; &amp; sProgressMoreDocs
+ ImportDialog.LabelCurTemplateRetrieval.Label = sProgressFound &amp; &quot; &quot; &amp; CStr(AbsTemplateFound) &amp; &quot; &quot; &amp; sProgressMoreTemplates
+End Sub
+
+Sub TakoverFolderName(aEvent as Object)
+Dim RefControlName as String
+Dim oRefControl
+ RefControlName = aEvent.Source.Model.Tag
+ oRefControl = ImportDialogArea.GetControl(RefControlName)
+ GetFolderName(oRefControl.Model)
+ ToggleNextButton()
+End Sub
+
+
+Sub FinalizeDialogButtons()
+ ImportDialog.cmdShowLogFile.Enabled = ((Isnull(oLogDocument) = False) And (ImportDialog.chkLogfile.State = 1))
+ ImportDialog.cmdCancel.Enabled = False
+ ImportDialog.cmdGoOn.Label = sCloseButton
+ ImportDialog.cmdGoOn.Enabled = True
+End Sub
+</script:module> \ No newline at end of file
diff --git a/wizards/source/importwizard/FilesModul.xba b/wizards/source/importwizard/FilesModul.xba
new file mode 100644
index 000000000000..cb999252b24c
--- /dev/null
+++ b/wizards/source/importwizard/FilesModul.xba
@@ -0,0 +1,824 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
+<script:module xmlns:script="http://openoffice.org/2000/script" script:name="FilesModul" script:language="StarBasic">Option Explicit
+
+Public AbsTemplateFound as Integer
+Public AbsDocuFound as Integer
+Public oLogDocument as Object
+Public oLogTable as Object
+Public bLogExists as Boolean
+Public sComment as String
+Public MaxCollectIndex as Integer
+Public bInsertRow as Boolean
+Public sLogUrl as String
+Public sCurPassWord as String
+Public FileCount as Integer
+Public XMLTemplateCount as Integer
+Public PathCollection(7,3) as String
+Public bIsFirstLogTable as Boolean
+Public bFilterTracerIsinsideTable as Boolean
+
+
+Function ReadCollectionPaths(FilesList() as String, sFilterName() as String)
+Dim FilterIndex as Integer
+Dim bRecursive as Boolean
+Dim SearchDir as String
+Dim i as Integer
+Dim n as Integer
+Dim a as Integer
+Dim s as Integer
+Dim t as Integer
+Dim sFileContent() as String
+Dim NewList(0,1) as String
+Dim Index as Integer
+Dim CurFileName as String
+Dim CurExtension as String
+Dim CurFileContent as String
+Dim XMLTemplateContentList() as String
+Dim bIsTemplatePath as Boolean
+Dim MaxIndex as Integer
+Dim NewContentList() as String
+Dim XMLTemplateContentString as String
+Dim ApplIndex as Integer
+Dim bAssignFileName as Boolean
+ bInterruptSearch = False
+ For i = 0 To MaxCollectIndex
+ SearchDir = PathCollection(i,0)
+ bRecursive = PathCollection(i,1)
+ sFileContent() = ArrayoutofString(PathCollection(i,2), &quot;|&quot;)
+ NewList() = ReadDirectories(SearchDir, bRecursive, False, False, sFileContent(), &quot;&quot;)
+ If InterruptProcess Then
+ ReadCollectionPaths() = False
+ Exit Function
+ End If
+ If Ubound(NewList()) &gt; -1 Then
+ bIsTemplatePath = FieldInList(&quot;vor&quot;, sFileContent)
+ If bIsTemplatePath Then
+ XMLTemplateContentString = PathCollection(i,3)
+ XMLTemplateContentList() = ArrayoutofString(XMLTemplateContentString, &quot;|&quot;)
+ If Ubound(XMLTemplateContentList()) &gt; -1 Then
+ MaxIndex = Ubound(NewList())
+ ReDim Preserve NewList(MaxIndex, 1) as String
+ ReDim Preserve NewContentList(MaxIndex) as String
+ a = -1
+ For n = 0 To MaxIndex
+ bAssignFileName = True
+ If InterruptProcess() Then
+ ReadCollectionPaths() = False
+ Exit Function
+ End If
+ CurFileContent = &quot;&quot;
+ CurFileName = NewList(n,0)
+ If (FieldInList(NewList(n,1), XMLTemplateList())) Then
+ CurFileContent = GetRealFileContent(CurFileName)
+ t = SearchArrayforPartString(CurFileContent, XMLTemplateContentList())
+ bAssignFileName = (t &gt; -1)
+ If bAssignFileName Then
+ CurFileContent = XMLTemplateContentList(t)
+ End If
+ NewList(n,1) = CurFileContent
+ End If
+ CurExtension = NewList(n,1)
+ If bAssignFileName Then
+ If a &lt; n Then
+ a = a + 1
+ NewList(a,0) = CurFileName
+ NewList(a,1) = CurExtension
+ If CurFileContent = &quot;&quot; Then
+ CurFileContent = CurExtension
+ End If
+ ApplIndex = GetApplicationIndex(CurFileContent, sFiltername())
+ NewContentList(a) = ApplIndex
+ End If
+ End If
+ Next n
+ If a &lt; MaxIndex And a &gt; -1 Then
+ ReDim Preserve NewList(a, 1) as String
+ End If
+ If a &gt; -1 Then
+ AddListtoFilesList(FilesList(), NewList(), NewContentList())
+ End If
+ End If
+ Else
+ MaxIndex = Ubound(NewList())
+ ReDim Preserve NewContentList(MaxIndex) as String
+ For s = 0 To MaxIndex
+ CurExtension = NewList(s,1)
+ NewContentList(s) = GetApplicationIndex(CurExtension, sFiltername())
+ Next s
+ AddListtoFilesList(FilesList(), NewList(), NewContentList())
+ End If
+ End If
+ Next i
+ ReadCollectionPaths() = Ubound(FilesList()) &gt; -1
+End Function
+
+
+Function GetApplicationIndex(CurFileContent as String, sFilterName() as String) as Integer
+Dim Index as Integer
+Dim i as Integer
+ Index = GetIndexForPartStringinMultiArray(sFilterName(), CurFileContent, 0)
+ If Index &gt;= MaxApplCount Then
+ Index = Index - MaxApplCount
+ End If
+ For i = 0 To MaxApplCount - 1
+ If Applications(i, SBAPPLKEY) = Index Then
+ GetApplicationIndex() = i
+ Exit Function
+ End If
+ Next i
+ GetApplicationIndex() = - 1
+End Function
+
+
+Function InterruptProcess() as Boolean
+ If bCancelTask Or RetValue = 0 Then
+ bConversionIsRunning = False
+ InterruptProcess() = True
+ Exit Function
+ End if
+ InterruptProcess() = False
+End Function
+
+
+Sub AddCollectionPath(ApplIndex as Integer, DocIndex as Integer, RecursiveIndex as Integer, sFiltername() as String, DistIndex as Integer)
+ MaxCollectIndex = MaxCollectIndex + 1
+ PathCollection(MaxCollectIndex, 0) = Applications(ApplIndex, DocIndex)
+ PathCollection(MaxCollectIndex, 1) = Applications(ApplIndex, RecursiveIndex)
+ AddFilterNameToPathItem(ApplIndex, MaxCollectIndex, sFiltername(), DistIndex)
+End Sub
+
+
+Function SetExtension(LocExtension) as String
+ if (Instr(LocExtension, &quot;vnd.sun.xml.impress&quot;)) &gt; 0 then
+ SetExtension() = &quot;vor|sti|std&quot;
+ elseif (Instr(LocExtension, &quot;vnd.sun.xml.writer&quot;)) &gt; 0 then
+ SetExtension() = &quot;vor|stw&quot;
+ elseif (Instr(LocExtension, &quot;vnd.sun.xml.calc&quot;)) &gt; 0 then
+ SetExtension() = &quot;vor|stc&quot;
+ elseif (Instr(LocExtension, &quot;vnd.sun.xml.draw&quot;)) &gt; 0 then
+ SetExtension() = &quot;vor|std|sti&quot;
+ endif
+End Function
+
+Sub AddFilterNameToPathItem(ApplIndex as Integer, CollectIndex as Integer, sFiltername() as String, DistIndex as Integer)
+Dim iKey as Integer
+Dim CurListString as String
+Dim LocExtension as String
+Dim LocContentString as String
+Dim LocXMLTemplateContent as String
+ iKey = Applications(ApplIndex, SBAPPLKEY)
+ CurListString = PathCollection(CollectIndex, 2)
+ LocExtension = sFilterName(iKey +DistIndex, 0)
+ If Len(LocExtension) &gt; SBMAXEXTENSIONLENGTH Then &apos; 7 == Length of two extensions like &apos;sda|sdd
+ LocExtension = SetExtension(LocExtension)
+ LocContentString = sFilterName(iKey +DistIndex, 0)
+ LocContentString = ReplaceString(LocContentString, &quot;|&quot;, &quot;;&quot;)
+ LocXMLTemplateContent = PathCollection(CollectIndex, 3)
+ If LocXMLTemplateContent = &quot;&quot; Then
+ LocXMLTemplateContent = LocContentString
+ Else
+ LocXMLTemplateContent = LocXMLTemplateContent &amp; &quot;|&quot; &amp; LocContentString
+ End If
+ PathCollection(CollectIndex, 3) = LocXMLTemplateContent
+ End If
+ If CurListString = &quot;&quot; Then
+ PathCollection(CollectIndex, 2) = LocExtension
+ Else
+ If Instr(CurListString, LocExtension) = 0 Then
+ PathCollection(CollectIndex, 2) = CurListString &amp; &quot;|&quot; &amp; LocExtension
+ End If
+ End If
+End Sub
+
+
+Sub CheckIfToAddPathToCollection(ApplIndex as Integer, bDoConvertIndex as Integer, DocIndex as Integer, RecursiveIndex as Integer, sFiltername() as String, DistIndex as Integer)
+Dim CollectIndex as Integer
+Dim bCheckDocuType as Boolean
+ bCheckDocuType = Applications(ApplIndex, bDoConvertIndex)
+ If bCheckDocuType Then
+ CollectIndex = GetIndexInMultiArray(PathCollection(), Applications(ApplIndex,DocIndex), 0)
+ If (CollectIndex &gt;-1) Then
+ If Applications(ApplIndex, RecursiveIndex) &lt;&gt; PathCollection(CollectIndex, 1) Then
+ AddCollectionPath(ApplIndex, DocIndex, RecursiveIndex, sFilterName(), DistIndex)
+ Else
+ AddFilterNameToPathItem(ApplIndex, CollectIndex, sFilterName(), DistIndex)
+ End If
+ Else
+ AddCollectionPath(ApplIndex, DocIndex, RecursiveIndex, sFilterName(), DistIndex)
+ End If
+ End If
+End Sub
+
+
+Sub CollectPaths(sFiltername() as String)
+Dim i as Integer
+Dim XMLTemplateContentString as String
+ MaxCollectIndex = -1
+ For i = 0 To ApplCount-1
+ CheckIfToAddPathToCollection(i, SBDOCCONVERT, SBDOCSOURCE, SBDOCRECURSIVE, sFilterName(), 0)
+ Next i
+ XMLTemplateCount = 0
+ XMLTemplateContentString = &quot;&quot;
+ For i = 0 To ApplCount-1
+ If WizardMode = SBXMLMODE Then
+ XMLTemplateCount = XMLTemplateCount + 1
+ End If
+ CheckIfToAddPathToCollection(i, SBTEMPLCONVERT, SBTEMPLSOURCE, SBTEMPLRECURSIVE, sFilterName(), MaxApplCount)
+ Next i
+End Sub
+
+
+Sub ConvertAllDocuments(sFilterName() as String)
+Dim FileProperties(1) as new com.sun.star.beans.PropertyValue
+Dim PWFileProperties(2) as New com.sun.star.beans.PropertyValue
+Dim WriterWebProperties(0) as new com.sun.star.beans.PropertyValue
+Dim OpenProperties(4) as new com.sun.star.beans.PropertyValue
+Dim oInteractionHandler as Object
+Dim InteractionTypes(0) as Long
+Dim FilesList(0,2) as String
+Dim sViewPath as String
+Dim i as Integer
+Dim FilterIndex as Integer
+Dim sSourceUrl as String
+Dim CurFilename as String
+Dim oDocument as Object
+Dim sExtension as String
+Dim OldExtension as String
+Dim CurFound as Integer
+Dim TotFound as Integer
+Dim TargetStemDir as String
+Dim SourceStemDir as String
+Dim TargetDir as String
+Dim sTargetUrl as String
+Dim CurFilterName as String
+Dim ApplIndex as Integer
+Dim Index as Integer
+Dim bIsDocument as Boolean
+Dim bDoSave as Boolean
+Dim sCurFileExists as String
+Dim MaxFileIndex as Integer
+Dim bContainsBasicMacro as Boolean
+Dim bIsPassWordProtected as Boolean
+Dim iOverwrite as Integer
+Dim sMimeTypeorExtension as String
+Dim sPrevMimeTypeorExtension as String
+ bConversionisrunning = True
+ InteractionTypes(0) = com.sun.star.task.PasswordRequestMode.PASSWORD_REENTER
+ oInteractionHandler = createUnoService(&quot;com.sun.star.task.InteractionHandler&quot;)
+ oInteractionHandler.initialize(InteractionTypes())
+ iGeneralOverwrite = SBOVERWRITEUNDEFINED
+ bConversionIsRunning = True
+ bLogExists = false
+ AbsTemplateFound = 0
+ AbsDocuFound = 0
+ CollectPaths(sFiltername())
+ If Not ReadCollectionPaths(FilesList(), sFilterName()) Then
+ TotFound = 0
+ SetProgressDisplay(0)
+ bConversionisrunning = false
+ FinalizeDialogButtons()
+ Exit Sub
+ End If
+ TotFound = Ubound(FilesList()) + 1
+ If FilesList(0,0) = &quot;&quot; Then &apos; Querying the number of fields in a multidimensionl Array is unsecure
+ TotFound = 0 &apos; because it will return the value 0 (and not -1) even when the Array is empty
+ SetProgressDisplay(0)
+ End If
+ BubbleSortList(FilesList(), true)
+ If TotFound &gt; 0 Then
+ CreateLogDocument(OpenProperties())
+ InitializeProgressPage(ImportDialog)
+ OpenProperties(0).Name = &quot;Hidden&quot;
+ OpenProperties(0).Value = True
+ OpenProperties(1).Name = &quot;AsTemplate&quot;
+ OpenProperties(1).Value = False
+ OpenProperties(2).Name = &quot;MacroExecutionMode&quot;
+ OpenProperties(2).Value = com.sun.star.document.MacroExecMode.NEVER_EXECUTE
+ OpenProperties(3).Name = &quot;UpdateDocMode&quot;
+ OpenProperties(3).Value = com.sun.star.document.UpdateDocMode.NO_UPDATE
+ OpenProperties(4).Name = &quot;InteractionHandler&quot;
+ OpenProperties(4).Value = oInteractionHandler
+ MaxFileIndex = Ubound(FilesList(),1)
+ FileCount = 0
+ For i = 0 To MaxFileIndex
+ sComment = &quot;&quot;
+ If InterruptProcess() Then
+ Exit For
+ End If
+ bDoSave = True
+ sSourceUrl = FilesList(i,0)
+ sPrevMimeTypeorExtension = sMimeTypeorExtension
+ sMimeTypeorExtension = FilesList(i,1)
+ CurFiltername = GetFilterName(sMimeTypeorExtension, sFilterName(), sExtension, FilterIndex)
+ ApplIndex = FilesList(i,2)
+ If sMimeTypeorExtension &lt;&gt; sPrevMimeTypeorExtension Then
+ CreateLogTable(ApplIndex, sMimeTypeOrExtension, sFiltername()
+ End If
+ If ApplIndex &gt; Ubound(Applications) or (ApplIndex &lt; 0) Then
+ Msgbox &quot;Applicationindex out of bounds:&quot; &amp; sSourcUrl
+ End If
+ sViewPath = ConvertFromUrl(sSourceUrl) &apos; CutPathView(sSourceUrl, 70)
+ ImportDialog.LabelCurDocument.Label = Str(i+1) &amp; &quot;/&quot; &amp; MaxFileIndex + 1 &amp; &quot; (&quot; &amp; sViewPath &amp; &quot;)&quot;
+ Select Case lcase(sExtension)
+ Case &quot;odt&quot;, &quot;ods&quot;, &quot;odp&quot;, &quot;odg&quot;, &quot;odm&quot;, &quot;odf&quot;
+ SourceStemDir = RTrimStr(Applications(ApplIndex,SBDOCSOURCE), &quot;/&quot;)
+ TargetStemDir = RTrimStr(Applications(ApplIndex,SBDOCTARGET), &quot;/&quot;)
+ Case Else &apos; Templates and Helper-Applications remain
+ SourceStemDir = RTrimStr(Applications(ApplIndex,SBTEMPLSOURCE), &quot;/&quot;)
+ TargetStemDir = RTrimStr(Applications(ApplIndex,SBTEMPLTARGET), &quot;/&quot;)
+ End Select
+ sTargetUrl = ReplaceString(sSourceUrl, TargetStemDir, SourceStemDir)
+ CurFilename = GetFileNameWithoutExtension(sTargetUrl, &quot;/&quot;)
+ OldExtension = GetFileNameExtension(sTargetUrl)
+ sTargetUrl = RTrimStr(sTargetUrl, OldExtension)
+ sTargetUrl = sTargetUrl &amp; sExtension
+ TargetDir = RTrimStr(sTargetUrl, CurFilename &amp; &quot;.&quot; &amp; sExtension)
+ If (oUcb.Exists(sTargetUrl)) Then
+ If (iGeneralOverwrite &lt;&gt; SBOVERWRITEALWAYS) Then
+ If (iGeneralOverwrite = SBOVERWRITEUNDEFINED) Then
+ ShowOverwriteAllDialog(sTargetUrl, sTitle)
+ bDoSave = (iGeneralOverwrite = SBOVERWRITEQUERY) Or (iGeneralOverwrite = SBOVERWRITEALWAYS)
+ Elseif iGeneralOverwrite = SBOVERWRITENEVER Then
+ bDoSave = False
+ ElseIf ((iGeneralOverWrite = SBOVERWRITEQUERY) OR (iGeneralOverwrite = SBOVERWRITECANCEL)) Then
+ &apos; Todo: According to AS there might come a new feature that storeasUrl could possibly rise a UI dialog.
+ &apos; In this case my own UI becomes obsolete
+ sCurFileExists = ReplaceString(sFileExists, ConvertFromUrl(sTargetUrl), &quot;&lt;1&gt;&quot;)
+ sCurFileExists = ReplaceString(sCurFileExists, chr(13), &quot;&lt;CR&gt;&quot;)
+ iOverWrite = Msgbox (sCurFileExists, 32 + 3, sTitle)
+ Select Case iOverWrite
+ Case 1 &apos; OK
+ &apos; In the FileProperty-Bean this is already default
+ bDoSave = True
+ Case 2 &apos; Abort
+ CancelTask(False)
+ bDoSave = False
+ Case 7 &apos; No
+ bDoSave = False
+ End Select
+ End If
+ End If
+ End If
+ If bDoSave Then
+ If Not oUcb.Exists(TargetDir) Then
+ bDoSave = CreateFolder(TargetDir)
+ End If
+ If bDoSave Then
+ oDocument = StarDesktop.LoadComponentFromURL(sSourceUrl, &quot;_default&quot;, 0, OpenProperties())
+ If Not IsNull(oDocument) Then
+ InsertSourceUrlToLogDocument(sSourceUrl, &quot;&quot;)
+ bIsPassWordProtected = CheckPassWordProtection(oDocument)
+ CheckIfMacroExists(oDocument.BasicLibraries, sComment)
+ On Local Error Goto NOSAVING
+ If bIsPassWordProtected Then
+ PWFileProperties(0).Name = &quot;FilterName&quot;
+ PWFileProperties(0).Value = CurFilterName
+ PWFileProperties(1).Name = &quot;Overwrite&quot;
+ PWFileProperties(1).Value = True
+ PWFileProperties(2).Name = &quot;Password&quot;
+ PWFileProperties(2).Value = sCurPassWord
+ oDocument.StoreAsUrl(sTargetUrl, PWFileProperties())
+ Else
+ FileProperties(0).Name = &quot;FilterName&quot;
+ FileProperties(0).Value = CurFilterName
+ FileProperties(1).Name = &quot;Overwrite&quot;
+ FileProperties(1).Value = True
+ oDocument.StoreAsUrl(sTargetUrl,FileProperties())
+ End If
+ &apos; Todo: Make sure that an errorbox pops up when saving fails
+ NOSAVING:
+ If Err &lt;&gt; 0 Then
+ sCurcouldnotsaveDocument = ReplaceString(scouldnotsaveDocument, ConvertFromUrl(sTargetUrl), &quot;&lt;1&gt;&quot;)
+ sComment = ConcatComment(sComment, sCurCouldnotsaveDocument)
+ Resume LETSGO
+ LETSGO:
+ Else
+ FileCount = FileCount + 1
+ End If
+ oDocument.Dispose()
+ InsertTargetUrlToLogDocument(sTargetUrl, sComment, ApplIndex)
+ Else
+ sCurcouldnotopenDocument = ReplaceString(scouldnotopenDocument, ConvertFromUrl(sSourceUrl), &quot;&lt;1&gt;&quot;)
+ sComment = ConcatComment(sComment, sCurCouldnotopenDocument)
+ InsertSourceUrlToLogDocument(sSourceUrl, sComment)
+ End If
+ End If
+ End If
+ Next i
+ End If
+ AddLogStatistics()
+ FinalizeDialogButtons()
+ bConversionIsRunning = False
+ Exit Sub
+RTError:
+ Msgbox sRTErrorDesc, 16, sRTErrorHeader
+End Sub
+
+
+
+Sub AddListtoFilesList(FirstList(), SecList(), NewContentList() as String)
+Dim sLocExtension as String
+Dim FirstStart as Integer
+Dim FirstEnd as Integer
+Dim i as Integer
+Dim s as Integer
+ If FirstList(0,0) = &quot;&quot; Then
+ FirstStart = Ubound(FirstList(),1)
+ Else
+ FirstStart = Ubound(FirstList(),1) + 1
+ End If
+ FirstEnd = FirstStart + Ubound(SecList(),1)
+ ReDim Preserve FirstList(FirstEnd,2)
+ s = 0
+ For i = FirstStart To FirstEnd
+ FirstList(i,0) = SecList(s,0)
+ FirstList(i,1) = SecList(s,1)
+ sLocExtension = lcase(FirstList(i,1))
+ Select Case sLocExtension
+ Case &quot;sdw&quot;, &quot;sdc&quot;, &quot;sda&quot;, &quot;sdd&quot;, &quot;smf&quot;, &quot;sgl&quot;, &quot;doc&quot;, &quot;xls&quot;, &quot;ppt&quot;, &quot;sxi&quot; , &quot;sxw&quot; , &quot;sxd&quot; , &quot;sxg&quot; , &quot;sxm&quot; , &quot;sxc&quot; , &quot;pps&quot;
+ AbsDocuFound = AbsDocuFound + 1
+ Case else
+ AbsTemplateFound = AbsTemplateFound + 1
+ End Select
+ FirstList(i,2) = CStr(NewContentList(s))
+ s = s + 1
+ Next i
+ SetProgressDisplay(Ubound(FirstList()) + 1)
+End Sub
+
+
+
+Function GetTargetTemplatePath(Index as Integer)
+ Select Case WizardMode
+ Case SBMICROSOFTMODE
+ GetTargetTemplatePath() = SOTemplatePath &amp; &quot;/&quot; &amp; sTemplateGroupName
+ Case SBXMLMODE
+ If Index = 3 Then
+ &apos; Helper Application
+ GetTargetTemplatePath = SOWorkPath
+ Else
+ GetTargetTemplatePath = SOTemplatePath
+ End If
+ End Select
+End Function
+
+
+&apos; Retrieves the second value for a next to &apos;SearchString&apos; in
+&apos; a two-dimensional string-Array
+Function GetFilterName(sMimetypeorExtension as String, sFilterName(), sExtension as string, FilterIndex as Integer) as String
+Dim i as Integer
+Dim MaxIndex as Integer
+Dim sLocFilterlist() as String
+ For i = 0 To Ubound(sFiltername(),1)
+ If Instr(1,sFilterName(i,0),sMimeTypeOrExtension) &lt;&gt; 0 Then
+ sLocFilterList() = ArrayoutofString(sFiltername(i,0),&quot;|&quot;, MaxIndex)
+ If MaxIndex = 0 Then
+ sExtension = sFiltername(i,2)
+ GetFilterName = sFilterName(i,1)
+ Else
+ Dim b as Integer
+ Dim sLocExtensionList() as String
+ b = SearchArrayForPartString(sMimetypeOrExtension, sLocFilterList())
+ sLocFilterList() = ArrayoutofString(sFiltername(i,1),&quot;|&quot;, MaxIndex)
+ GetFilterName = sLocFilterList(b)
+ sLocExtensionList() = ArrayoutofString(sFilterName(i,2), &quot;|&quot;, MaxIndex)
+ sExtension = sLocExtensionList(b)
+ End If
+ Exit For
+ End If
+ Next
+ FilterIndex = i
+End Function
+
+
+Function SearchArrayforPartString(SearchString as String, LocList()) as Integer
+Dim i as Integer
+Dim a as Integer
+Dim StringList() as String
+ For i = Lbound(LocList(),1) to Ubound(LocList(),1)
+ StringList() = ArrayoutofString(LocList(i), &quot;|&quot;)
+ For a = 0 To Ubound(StringList())
+ If (Instr(1, SearchString, StringList(a)) &lt;&gt; 0) Then
+ SearchArrayForPartString() = i
+ Exit Function
+ End If
+ Next a
+ Next i
+ SearchArrayForPartString() = -1
+End Function
+
+
+Sub CreateLogTable(ApplIndex as Integer, CurFileContent as String, sFilterName() as String)
+Dim oLogCursor as Object
+Dim oLogRows as Object
+Dim FilterIndex as Integer
+Dim sDocumentType as String
+Dim oTextCursor
+Dim oCell
+ If Not bLogExists Then
+ Exit Sub
+ End If
+ bFilterTracerIsinsideTable = False
+ FilterIndex = GetIndexForPartStringinMultiArray(sFilterName(), CurFileContent, 0)
+ sDocumentType = sFiltername(FilterIndex,3)
+ oLogCursor = oLogDocument.Text.createTextCursor()
+ oLogCursor.GotoEnd(False)
+ If Not bIsFirstLogTable Then
+ oLogDocument.Text.insertControlCharacter(oLogCursor, com.sun.star.text.ControlCharacter.PARAGRAPH_BREAK, False)
+ Else
+ bisFirstLogTable = False
+ End If
+ oLogCursor.HyperLinkURL = &quot;&quot;
+ oLogCursor.HyperLinkName = &quot;&quot;
+ oLogCursor.HyperLinkTarget = &quot;&quot;
+ oLogCursor.ParaStyleName = &quot;Heading 1&quot;
+ oLogCursor.setString(sDocumentType)
+ If WizardMode = SBMICROSOFTMODE Then
+ If bFilterTracingAvailable Then
+ If bMSApplFilterTracingAvailable(ApplIndex) Then
+ Dim CurFilterTracingPath as String
+ CurFilterTracingPath = FilterTracingLogPath(ApplIndex)
+ bFilterTracerIsinsideTable = (bTakeOverTargetName(ApplIndex) Or bTakeOverPathName(ApplIndex))
+ If Not bFilterTracerIsinsideTable Then
+ oLogCursor.CollapseToEnd()
+ oLogDocument.Text.insertControlCharacter(oLogCursor, com.sun.star.text.ControlCharacter.PARAGRAPH_BREAK, False)
+ InsertCommandButtonatViewCursor(oLogDocument, oLogCursor, CurFilterTracingPath)
+ End If
+ End If
+ End If
+ End If
+ oLogCursor.CollapsetoEnd()
+ oLogDocument.Text.insertControlCharacter(oLogCursor, com.sun.star.text.ControlCharacter.PARAGRAPH_BREAK, False)
+ oLogTable = oLogDocument.CreateInstance(&quot;com.sun.star.text.TextTable&quot;)
+ oLogTable.RepeatHeadline = true
+ If bFilterTracerIsinsideTable Then
+ oLogTable.initialize(2,3)
+ End If
+ oLogCursor.Text.InsertTextContent(oLogCursor, oLogTable, True)
+ oTextCursor = oLogTable.GetCellbyPosition(0,0).createTextCursor()
+ oTextCursor.SetString(sSourceDocuments)
+ oTextCursor = oLogTable.GetCellbyPosition(1,0).createTextCursor()
+ oTextCursor.SetString(sTargetDocuments)
+ If bFilterTracerIsinsideTable Then
+ oTextCursor = oLogTable.GetCellbyPosition(2,0).createTextCursor()
+ oTextCursor.SetString(&quot;FilterTracer&quot;)
+ End If
+ bInsertRow = False
+End Sub
+
+
+Function GetSize(iWidth, iHeight) As New com.sun.star.awt.Size
+Dim aSize As New com.sun.star.awt.Size
+ aSize.Width = iWidth
+ aSize.Height = iHeight
+ GetSize() = aSize
+End Function
+
+
+Sub InsertCommandButtonatViewCursor(oLocDocument, oLocCursor, TargetUrl as String, Optional aSize)
+Dim oDocument
+Dim oController
+Dim oCommandButton
+Dim oShape
+Dim oDrawPage
+Dim oCommandControl
+Dim oEvent
+Dim oCell
+ oCommandButton = oLocDocument.createInstance(&quot;com.sun.star.form.component.CommandButton&quot;)
+ oShape = oLocDocument.CreateInstance (&quot;com.sun.star.drawing.ControlShape&quot;)
+ If IsMissing(aSize) Then
+ oShape.Size = GetSize(4000, 600)
+ End If
+ oCommandButton.Label = FileNameoutofPath(Targeturl)
+ oCommandButton.TargetFrame = &quot;_default&quot;
+ oCommandButton.ButtonType = com.sun.star.form.FormButtonType.URL
+ oCommandbutton.DispatchUrlInternal = True
+ oCommandButton.TargetURL = ConverttoUrl(TargetUrl)
+ oShape.Control = oCommandbutton
+ oLocCursor.Text.InsertTextContent(oLocCursor, oShape, True)
+End Sub
+
+
+
+Sub CreateLogDocument(HiddenProperties())
+Dim OpenProperties(0) as new com.sun.star.beans.PropertyValue
+Dim NoArgs()
+Dim i as Integer
+Dim bLogIsThere as Boolean
+ If ImportDialog.chkLogfile.State = 1 Then
+ i = 2
+ OpenProperties(0).Name = &quot;Hidden&quot;
+ OpenProperties(0).Value = True
+ oLogDocument = StarDesktop.LoadComponentFromURL(&quot;private:factory/swriter&quot;, &quot;_default&quot;, 4, OpenProperties())
+ SOWorkPath = RTrimStr(SOWorkPath,&quot;/&quot;)
+ sLogUrl = SOWorkPath &amp; &quot;/Logfile.odt&quot;
+ Do
+ bLogIsThere = oUcb.Exists(sLogUrl)
+ If bLogIsThere Then
+ If i = 2 Then
+ sLogUrl = ReplaceString(sLogUrl, &quot;/Logfile_2.odt&quot;, &quot;/Logfile.odt&quot;)
+ Else
+ sLogUrl = ReplaceString(sLogUrl, &quot;/Logfile_&quot; &amp; cStr(i) &amp; &quot;.odt&quot;, &quot;/Logfile_&quot; &amp; cStr(i-1) &amp; &quot;.odt&quot;)
+ End If
+ i = i + 1
+ End If
+ Loop Until Not bLogIsThere
+ bLogExists = True
+ oLogDocument.StoreAsUrl(sLogUrl, NoArgs())
+ End If
+End Sub
+
+
+Function GetFilterTracingLogPath(sTargetUrl as String, ApplIndex) as String
+Dim TargetFileName as String
+Dim sTargetFolder as String
+Dim CurFilterTracingPath as String
+Dim CurFilterTracingname as String
+Dim CurFilterFolder as String
+ CurFilterTracingPath = FilterTracingLogPath(ApplIndex)
+ If bTakeOverTargetName(ApplIndex) Then
+ TargetFilename = GetFileNameWithoutextension(sTargetUrl, &quot;/&quot;)
+ CurFilterFolder = DirectoryNameoutofPath(FilterTracingLogPath(ApplIndex), &quot;/&quot;)
+ CurFilterTracingpath = CurFilterFolder &amp; &quot;/&quot; &amp; TargetFilename &amp; &quot;.log&quot;
+ End If
+ If bTakeOverPathName(ApplIndex) Then &apos;Replace the Folder in the FilterTracerpath by the Folder of the targetUrl
+ sTargetFolder = DirectoryNameoutofPath(sTargetUrl,&quot;/&quot;)
+ CurFilterTracingPath = sTargetFolder &amp; &quot;/&quot; &amp; FileNameoutofPath(CurFilterTracingPath, &quot;/&quot;)
+ End If
+ GetFilterTracingLogPath() = CurFilterTracingPath
+End Function
+
+
+Sub InsertTargetUrlToLogDocument(sTargetUrl as String, sComment as String, ApplIndex as Integer)
+Dim oCell
+Dim oTextCursor
+Dim CurFilterTracingpath as String
+ If (bLogExists) And (sTargetUrl &lt;&gt; &quot;&quot;) Then
+ If sTargetUrl &lt;&gt; &quot;&quot; Then
+ oCell = oLogTable.GetCellbyPosition(1,oLogTable.Rows.Count-1)
+ InsertCommentToLogCell(sComment, oCell)
+ InsertHyperLinkToLogCell(sTargetUrl, oCell)
+ If bFilterTracerIsinsideTable Then
+ oCell = oLogTable.getCellByPosition(2, oLogTable.Rows.Count-1)
+ oTextCursor = oCell.Text.CreateTextCursor()
+ CurFilterTracingpath = GetFilterTracingLogPath(sTargetUrl, ApplIndex)
+ InsertCommandButtonatViewCursor(oLogDocument, oTextCursor, CurFilterTracingPath)
+ End If
+ oLogDocument.Store()
+ End If
+ End If
+End Sub
+
+
+Sub InsertSourceUrlToLogDocument(SourceUrl as String, sComment) &apos;
+Dim oCell as Object
+ If bLogExists Then
+ If bInsertRow Then
+ oLogTable.Rows.InsertByIndex(oLogTable.Rows.Count,1)
+ Else
+ bInsertRow = True
+ End If
+ oCell = oLogTable.GetCellbyPosition(0,oLogTable.Rows.Count-1)
+ InsertCommentToLogCell(sComment, oCell)
+ InsertHyperLinkToLogCell(SourceUrl, oCell)
+ oLogDocument.Store()
+ End If
+End Sub
+
+
+Sub InsertHyperLinkToLogCell(sUrl as String, oCell as Object)
+Dim oLogCursor as Object
+Dim LocFileName as String
+ oLogCursor = oCell.createTextCursor()
+ oLogCursor.CollapseToStart()
+ oLogCursor.HyperLinkURL = sUrl
+ oLogCursor.HyperLinkName = sUrl
+ oLogCursor.HyperLinkTarget = sUrl
+ LocFileName = FileNameOutOfPath(sUrl)
+ oCell.InsertString(oLogCursor, LocFileName,False)
+End Sub
+
+
+Sub InsertCommentToLogCell(sComment as string, oCell as Object)
+Dim oCommentCursor as Object
+ If sComment &lt;&gt; &quot;&quot; Then
+ oCommentCursor = oCell.createTextCursor()
+ oCell.insertControlCharacter(oCommentCursor, com.sun.star.text.ControlCharacter.PARAGRAPH_BREAK, False)
+ oCell.insertString(oCommentCursor, sComment, false)
+ End If
+End Sub
+
+
+Sub AddLogStatistics()
+Dim oCell as Object
+Dim oLogCursor as Object
+Dim MaxRowIndex as Integer
+ If bLogExists Then
+ MaxRowIndex = oLogTable.Rows.Count
+ sLogSummary = ReplaceString(sLogSummary, FileCount, &quot;&lt;COUNT&gt;&quot;)
+&apos; oLogTable.Rows.InsertByIndex(MaxRowIndex, 1)
+&apos; oCell = oLogTable.GetCellbyPosition(0, MaxRowIndex)
+&apos; oLogCursor = oCell.createTextCursor()
+&apos; oCell.InsertString(oLogCursor, sLogSummary,False)
+&apos; MergeRange(oLogTable, oCell, 1)
+
+ oLogCursor = oLogDocument.Text.CreateTextCursor
+ oLogCursor.gotoEnd(False)
+ oLogCursor.HyperLinkURL = &quot;&quot;
+ oLogCursor.HyperLinkName = &quot;&quot;
+ oLogCursor.HyperLinkTarget = &quot;&quot;
+ oLogCursor.SetString(sLogSummary)
+ oLogDocument.Store()
+ oLogDocument.Dispose()
+ bLogExists = False
+ End If
+End Sub
+
+
+
+Function CheckIfMacroExists(oBasicLibraries as Object, sComment as String) as Boolean
+Dim ModuleNames() as String
+Dim ModuleName as String
+Dim MaxLibIndex as Integer
+Dim MaxModuleIndex as Integer
+Dim bMacroExists as Boolean
+Dim n as Integer
+Dim m as Integer
+Dim LibName as String
+Dim sBasicCode as String
+Dim oLibrary as Object
+ bMacroExists = False
+ bMacroExists = oBasicLibraries.hasElements
+ If bMacroExists Then
+ MaxLibIndex = Ubound(oBasicLibraries.ElementNames())
+ For n = 0 To MaxLibIndex
+ LibName = oBasicLibraries.ElementNames(n)
+ If oBasicLibraries.isLibraryLoaded(LibName) Then
+ oLibrary = oBasicLibraries.getbyName(LibName)
+ If oLibrary.hasElements() Then
+ MaxModuleIndex = Ubound(oLibrary.ElementNames())
+ For m = 0 To MaxModuleIndex
+ ModuleName = oLibrary.ElementNames(m)
+ sBasicCode = oLibrary.getbyName(ModuleName)
+ If sBasicCode &lt;&gt; &quot;&quot; Then
+ ConcatComment(sComment, sReeditMacro)
+ CheckIfMacroExists() = True
+ Exit Function
+ End If
+ Next m
+ End If
+ End If
+ Next n
+ End If
+ CheckIfMacroExists() = False
+End Function
+
+
+
+Function CheckPassWordProtection(oDocument as Object)
+Dim bIsPassWordProtected as Boolean
+Dim i as Integer
+Dim oArgs()
+Dim MaxIndex as Integer
+Dim sblabla as String
+ bIsPassWordProtected = false
+ oArgs() = oDocument.getArgs()
+ MaxIndex = Ubound(oArgs())
+ For i = 0 To MaxIndex
+ sblabla = oArgs(i).Name
+ If oArgs(i).Name = &quot;Password&quot; Then
+ bIsPassWordProtected = True
+ sCurPassWord = oArgs(i).Value
+ Exit For
+ End If
+ Next i
+ CheckPassWordProtection() = bIsPassWordProtected
+End Function
+
+
+Sub OpenLogDocument()
+
+ bShowLogFile = True
+ ImportDialogArea.endexecute()
+
+End Sub
+
+
+Sub MergeRange(oTable as Object, oCell as Object, MergeCount as Integer)
+Dim oTableCursor as Object
+ oTableCursor = oTable.createCursorByCellName(oCell.CellName)
+ oTableCursor.goRight(MergeCount, True)
+ oTableCursor.mergeRange()
+End Sub
+
+
+Function ConcatComment(sComment as String, AdditionalComment as String)
+ If sComment = &quot;&quot; Then
+ sComment = AdditionalComment
+ Else
+ sComment = sComment &amp; chr(13) + AdditionalComment
+ End If
+ ConcatComment = sComment
+End Function
+</script:module>
diff --git a/wizards/source/importwizard/ImportDialog.xdl b/wizards/source/importwizard/ImportDialog.xdl
new file mode 100644
index 000000000000..082c06bc8970
--- /dev/null
+++ b/wizards/source/importwizard/ImportDialog.xdl
@@ -0,0 +1,96 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE dlg:window PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "dialog.dtd">
+<dlg:window xmlns:dlg="http://openoffice.org/2000/dialog" xmlns:script="http://openoffice.org/2000/script" dlg:id="ImportDialog" dlg:left="96" dlg:top="28" dlg:width="270" dlg:height="210" dlg:page="4" dlg:help-url="HID:34570" dlg:closeable="true" dlg:moveable="true" dlg:title="ImportDialog">
+ <dlg:bulletinboard>
+ <dlg:text dlg:id="lblTemplateExport" dlg:tab-index="0" dlg:left="12" dlg:top="94" dlg:width="60" dlg:height="8" dlg:page="2" dlg:value="lblTemplateExport"/>
+ <dlg:textfield dlg:id="txtTemplateImportPath" dlg:tab-index="1" dlg:left="73" dlg:top="76" dlg:width="170" dlg:height="12" dlg:page="2" dlg:help-url="HID:34583">
+ <script:event script:event-name="on-textchange" script:macro-name="vnd.sun.star.script:ImportWizard.Main.ToggleNextButton?language=Basic&amp;location=application" script:language="Script"/>
+ </dlg:textfield>
+ <dlg:textfield dlg:id="txtTemplateExportPath" dlg:tab-index="2" dlg:left="73" dlg:top="92" dlg:width="170" dlg:height="12" dlg:page="2" dlg:help-url="HID:34584"/>
+ <dlg:checkbox dlg:id="chkDocumentPath" dlg:tab-index="3" dlg:left="12" dlg:top="121" dlg:width="240" dlg:height="10" dlg:page="2" dlg:tag="Document" dlg:help-url="HID:34586" dlg:value="chkDocumentPath" dlg:checked="true">
+ <script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.script:ImportWizard.DialogModul.ToggleInputPaths?language=Basic&amp;location=application" script:language="Script"/>
+ </dlg:checkbox>
+ <dlg:checkbox dlg:id="chkDocumentSearchSubDir" dlg:tab-index="4" dlg:left="12" dlg:top="134" dlg:width="240" dlg:height="10" dlg:page="2" dlg:help-url="HID:34587" dlg:value="chkDocumentSearchSubDir" dlg:checked="false"/>
+ <dlg:text dlg:id="lblDocumentImport" dlg:tab-index="5" dlg:left="10" dlg:top="151" dlg:width="60" dlg:height="8" dlg:page="2" dlg:value="lblDocumentImport"/>
+ <dlg:text dlg:id="lblDocumentExport" dlg:tab-index="6" dlg:left="10" dlg:top="167" dlg:width="60" dlg:height="8" dlg:page="2" dlg:value="lblDocumentExport"/>
+ <dlg:textfield dlg:id="txtDocumentImportPath" dlg:tab-index="7" dlg:left="73" dlg:top="149" dlg:width="170" dlg:height="12" dlg:page="2" dlg:help-url="HID:34588">
+ <script:event script:event-name="on-textchange" script:macro-name="vnd.sun.star.script:ImportWizard.Main.ToggleNextButton?language=Basic&amp;location=application" script:language="Script"/>
+ </dlg:textfield>
+ <dlg:textfield dlg:id="txtDocumentExportPath" dlg:tab-index="8" dlg:left="73" dlg:top="165" dlg:width="170" dlg:height="12" dlg:page="2" dlg:help-url="HID:34589"/>
+ <dlg:text dlg:id="SummaryHeaderLabel" dlg:tab-index="9" dlg:left="6" dlg:top="37" dlg:width="258" dlg:height="8" dlg:page="3" dlg:value="SummaryHeaderLabel"/>
+ <dlg:textfield dlg:id="SummaryTextbox" dlg:tab-index="10" dlg:left="5" dlg:top="48" dlg:width="259" dlg:height="125" dlg:page="3" dlg:help-url="HID:34595" dlg:vscroll="true" dlg:multiline="true" dlg:readonly="true"/>
+ <dlg:text dlg:id="LabelRetrieval" dlg:tab-index="11" dlg:left="10" dlg:top="67" dlg:width="255" dlg:height="8" dlg:page="4" dlg:value="LabelRetrieval"/>
+ <dlg:text dlg:id="LabelCurTemplateRetrieval" dlg:tab-index="12" dlg:left="15" dlg:top="79" dlg:width="249" dlg:height="8" dlg:page="4" dlg:value="LabelCurTemplateRetrieval"/>
+ <dlg:text dlg:id="LabelCurDocumentRetrieval" dlg:tab-index="13" dlg:left="15" dlg:top="91" dlg:width="249" dlg:height="8" dlg:page="4" dlg:value="LabelCurDocumentRetrieval"/>
+ <dlg:text dlg:id="LabelCurProgress" dlg:tab-index="14" dlg:left="10" dlg:top="106" dlg:width="255" dlg:height="8" dlg:page="4" dlg:value="LabelCurProgress"/>
+ <dlg:text dlg:id="LabelCurDocument" dlg:tab-index="15" dlg:left="15" dlg:top="118" dlg:width="249" dlg:height="20" dlg:page="4" dlg:value="LabelCurDocument" dlg:multiline="true"/>
+ <dlg:img dlg:id="ImportPreview" dlg:tab-index="16" dlg:left="5" dlg:top="6" dlg:width="258" dlg:height="26" dlg:scale-image="false"/>
+ <dlg:button dlg:id="cmdBack" dlg:tab-index="17" dlg:left="155" dlg:top="190" dlg:width="50" dlg:height="14" dlg:help-url="HID:34573" dlg:value="cmdBack">
+ <script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:ImportWizard.Main.PrevStep?language=Basic&amp;location=application" script:language="Script"/>
+ </dlg:button>
+ <dlg:button dlg:id="cmdCancel" dlg:tab-index="18" dlg:left="6" dlg:top="190" dlg:width="50" dlg:height="14" dlg:help-url="HID:34572" dlg:value="cmdCancel">
+ <script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:ImportWizard.Main.CancelTask?language=Basic&amp;location=application" script:language="Script"/>
+ </dlg:button>
+ <dlg:button dlg:id="cmdHelp" dlg:tab-index="19" dlg:left="65" dlg:top="190" dlg:width="50" dlg:height="14" dlg:value="cmdHelp" dlg:button-type="help"/>
+ <dlg:button dlg:id="cmdGoOn" dlg:tab-index="20" dlg:left="214" dlg:top="190" dlg:width="50" dlg:height="14" dlg:help-url="HID:34574" dlg:value="cmdGoOn">
+ <script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:ImportWizard.Main.NextStep?language=Basic&amp;location=application" script:language="Script"/>
+ </dlg:button>
+ <dlg:text dlg:id="WelcomeTextLabel" dlg:tab-index="21" dlg:left="6" dlg:top="38" dlg:width="258" dlg:height="20" dlg:page="1" dlg:value="WelcomeTextLabel" dlg:multiline="true"/>
+ <dlg:text dlg:id="WelcomeTextLabel3" dlg:tab-index="22" dlg:left="6" dlg:top="58" dlg:width="258" dlg:height="12" dlg:page="1" dlg:value="WelcomeTextLabel3"/>
+ <dlg:button dlg:id="cmdTemplateImport" dlg:tab-index="23" dlg:left="248" dlg:top="75" dlg:width="14" dlg:height="14" dlg:page="2" dlg:tag="txtTemplateImportPath" dlg:help-url="HID:34585" dlg:value="...">
+ <script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:ImportWizard.DialogModul.TakoverFolderName?language=Basic&amp;location=application" script:language="Script"/>
+ </dlg:button>
+ <dlg:button dlg:id="cmdTemplateExport" dlg:tab-index="24" dlg:left="248" dlg:top="91" dlg:width="14" dlg:height="14" dlg:page="2" dlg:tag="txtTemplateExportPath" dlg:help-url="HID:34600" dlg:value="...">
+ <script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:ImportWizard.DialogModul.TakoverFolderName?language=Basic&amp;location=application" script:language="Script"/>
+ </dlg:button>
+ <dlg:button dlg:id="cmdDocumentImport" dlg:tab-index="25" dlg:left="248" dlg:top="148" dlg:width="14" dlg:height="14" dlg:page="2" dlg:tag="txtDocumentImportPath" dlg:help-url="HID:34590" dlg:value="...">
+ <script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:ImportWizard.DialogModul.TakoverFolderName?language=Basic&amp;location=application" script:language="Script"/>
+ </dlg:button>
+ <dlg:button dlg:id="cmdDocumentExport" dlg:tab-index="26" dlg:left="248" dlg:top="164" dlg:width="14" dlg:height="14" dlg:page="2" dlg:tag="txtDocumentExportPath" dlg:help-url="HID:34601" dlg:value="...">
+ <script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:ImportWizard.DialogModul.TakoverFolderName?language=Basic&amp;location=application" script:language="Script"/>
+ </dlg:button>
+ <dlg:radiogroup>
+ <dlg:radio dlg:id="optSODocuments" dlg:tab-index="27" dlg:left="6" dlg:top="72" dlg:width="258" dlg:height="9" dlg:page="1" dlg:tag="SO" dlg:help-url="HID:34575" dlg:value="optSODocuments" dlg:checked="true">
+ <script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:ImportWizard.Main.ToggleCheckboxes?language=Basic&amp;location=application" script:language="Script"/>
+ </dlg:radio>
+ <dlg:radio dlg:id="optMSDocuments" dlg:tab-index="28" dlg:left="6" dlg:top="113" dlg:width="258" dlg:height="9" dlg:page="1" dlg:tag="MS" dlg:help-url="HID:34576" dlg:value="optMSDocuments">
+ <script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:ImportWizard.Main.ToggleCheckboxes?language=Basic&amp;location=application" script:language="Script"/>
+ </dlg:radio>
+ </dlg:radiogroup>
+ <dlg:checkbox dlg:id="chkSOApplication1" dlg:tab-index="29" dlg:left="12" dlg:top="85" dlg:width="141" dlg:height="9" dlg:page="1" dlg:help-url="HID:34596" dlg:value="chkSOApplication1" dlg:checked="false">
+ <script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.script:ImportWizard.Main.ToggleNextButton?language=Basic&amp;location=application" script:language="Script"/>
+ </dlg:checkbox>
+ <dlg:checkbox dlg:id="chkSOApplication2" dlg:tab-index="30" dlg:left="155" dlg:top="85" dlg:width="109" dlg:height="9" dlg:page="1" dlg:help-url="HID:34597" dlg:value="chkSOApplication2" dlg:checked="false">
+ <script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.script:ImportWizard.Main.ToggleNextButton?language=Basic&amp;location=application" script:language="Script"/>
+ </dlg:checkbox>
+ <dlg:checkbox dlg:id="chkSOApplication3" dlg:tab-index="31" dlg:left="12" dlg:top="98" dlg:width="141" dlg:height="9" dlg:page="1" dlg:help-url="HID:34598" dlg:value="chkSOApplication3" dlg:checked="false">
+ <script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.script:ImportWizard.Main.ToggleNextButton?language=Basic&amp;location=application" script:language="Script"/>
+ </dlg:checkbox>
+ <dlg:checkbox dlg:id="chkSOApplication4" dlg:tab-index="32" dlg:left="155" dlg:top="98" dlg:width="109" dlg:height="9" dlg:page="1" dlg:help-url="HID:34599" dlg:value="chkSOApplication4" dlg:checked="false">
+ <script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.script:ImportWizard.Main.ToggleNextButton?language=Basic&amp;location=application" script:language="Script"/>
+ </dlg:checkbox>
+ <dlg:checkbox dlg:id="chkMSApplication1" dlg:tab-index="33" dlg:disabled="true" dlg:left="12" dlg:top="126" dlg:width="141" dlg:height="9" dlg:page="1" dlg:help-url="HID:34578" dlg:value="chkMSApplication1" dlg:checked="false">
+ <script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.script:ImportWizard.Main.ToggleNextButton?language=Basic&amp;location=application" script:language="Script"/>
+ </dlg:checkbox>
+ <dlg:checkbox dlg:id="chkMSApplication2" dlg:tab-index="34" dlg:disabled="true" dlg:left="155" dlg:top="126" dlg:width="109" dlg:height="9" dlg:page="1" dlg:help-url="HID:34579" dlg:value="chkMSApplication2" dlg:checked="false">
+ <script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.script:ImportWizard.Main.ToggleNextButton?language=Basic&amp;location=application" script:language="Script"/>
+ </dlg:checkbox>
+ <dlg:checkbox dlg:id="chkMSApplication3" dlg:tab-index="35" dlg:disabled="true" dlg:left="12" dlg:top="139" dlg:width="141" dlg:height="9" dlg:page="1" dlg:help-url="HID:34580" dlg:value="chkMSApplication3" dlg:checked="false">
+ <script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.script:ImportWizard.Main.ToggleNextButton?language=Basic&amp;location=application" script:language="Script"/>
+ </dlg:checkbox>
+ <dlg:text dlg:id="WelcomeTextLabel2" dlg:tab-index="36" dlg:disabled="true" dlg:left="6" dlg:top="152" dlg:width="258" dlg:height="18" dlg:page="1" dlg:value="WelcomeTextLabel2" dlg:multiline="true"/>
+ <dlg:checkbox dlg:id="chkTemplatePath" dlg:tab-index="37" dlg:left="12" dlg:top="48" dlg:width="240" dlg:height="10" dlg:page="2" dlg:tag="Template" dlg:help-url="HID:34581" dlg:value="chkTemplatePath" dlg:checked="true">
+ <script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.script:ImportWizard.DialogModul.ToggleInputPaths?language=Basic&amp;location=application" script:language="Script"/>
+ </dlg:checkbox>
+ <dlg:checkbox dlg:id="chkTemplateSearchSubDir" dlg:tab-index="38" dlg:left="12" dlg:top="61" dlg:width="240" dlg:height="10" dlg:page="2" dlg:help-url="HID:34582" dlg:value="chkTemplateSearchSubDir" dlg:checked="false"/>
+ <dlg:text dlg:id="lblTemplateImport" dlg:tab-index="39" dlg:left="12" dlg:top="78" dlg:width="60" dlg:height="8" dlg:page="2" dlg:value="lblTemplateImport"/>
+ <dlg:checkbox dlg:id="chkLogfile" dlg:tab-index="40" dlg:left="6" dlg:top="171" dlg:width="136" dlg:height="9" dlg:page="1" dlg:help-url="HID:34577" dlg:value="chkLogfile" dlg:checked="true"/>
+ <dlg:fixedline dlg:id="hlnTemplates" dlg:tab-index="41" dlg:left="6" dlg:top="37" dlg:width="258" dlg:height="8" dlg:page="2" dlg:value="hlnTemplates"/>
+ <dlg:fixedline dlg:id="hlnDocuments" dlg:tab-index="42" dlg:left="6" dlg:top="110" dlg:width="258" dlg:height="8" dlg:page="2" dlg:value="hlnDocuments"/>
+ <dlg:fixedline dlg:id="FixedLine1" dlg:tab-index="43" dlg:left="6" dlg:top="181" dlg:width="258" dlg:height="6"/>
+ <dlg:fixedline dlg:id="hlnProgress" dlg:tab-index="44" dlg:left="6" dlg:top="55" dlg:width="258" dlg:height="8" dlg:page="4" dlg:value="hlnProgress"/>
+ <dlg:button dlg:id="cmdShowLogFile" dlg:tab-index="45" dlg:disabled="true" dlg:left="75" dlg:top="142" dlg:width="120" dlg:height="14" dlg:page="4" dlg:value="cmdShowLogFile">
+ <script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:ImportWizard.FilesModul.OpenLogDocument?language=Basic&amp;location=application" script:language="Script"/>
+ </dlg:button>
+ </dlg:bulletinboard>
+</dlg:window> \ No newline at end of file
diff --git a/wizards/source/importwizard/Language.xba b/wizards/source/importwizard/Language.xba
new file mode 100644
index 000000000000..32efcc242e8a
--- /dev/null
+++ b/wizards/source/importwizard/Language.xba
@@ -0,0 +1,157 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
+<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Language" script:language="StarBasic">Option Explicit
+
+Public sMSTemplateCheckbox(2) As String
+Public sMSDocumentCheckbox(2) As String
+Public sSODocumentCheckbox(4) As String
+Public sSOHelperdocuments(1,1) As String
+Public sTemplateCheckbox(SBMAXAPPLCOUNT-1) As String
+Public sDocumentCheckbox(SBMAXAPPLCOUNT-1) As String
+Public sTemplateGroupName As String
+Public sSearchInSubDir as String
+Public sPathErrorTemplates(SBMAXAPPLCOUNT-1) As String
+Public sPathErrorDocument(SBMAXAPPLCOUNT-1) As String
+Public sPathErrorStarDoc(SBMAXAPPLCOUNT-1) As String
+Public sStarDocLabel(SBMAXAPPLCOUNT-1) As String
+Public sImportLabel As String, sExportLabel As String
+Public SOApplicationName(5) As String
+Public sHelpButton As String, sCancelButton As String, sBackButton As String, sNextButton As String
+Public sSumInclusiveSubDir As String, sSumSaveDocuments As String
+Public sSummaryHeader As String
+Public sWelcometextLabel1 As String, sWelcometextLabel2 As String, sWelcometextLabel3 As String
+Public sBeginButton As String, sMsgDirNotThere As String
+Public sQueryForNewCreation As String, sPathError3 As String
+Public sNoDirCreation As String
+Public sProgressMoreDocs As String, sProgressMoreTemplates as String
+Public sFileExists As String, sMorePathsError3 As String
+Public sConvertError1 As String, sConvertError2 As String, sPathDialogMessage As String
+Public sRTErrorDesc As String, sRTErrorHeader As String
+Public sProgressPage_1 As String, sProgressPage_2 As String, sProgressPage_3 as String
+Public sProgressFound as String, sProgresspage_5 as String
+Public sContainerName(1) as String
+Public sReady as String, sTitle as String
+Public sCloseButton as String
+Public sSourceDocuments as String
+Public sTargetDocuments as String
+Public sSumSODocuments(4) as String
+Public sSumSOTemplates(4) as String
+Public sSumMSDocuments(3) as String
+Public sSumMSTemplates(3) as String
+Public ModuleList(3) as String
+Public sLogSummary as String
+Public sReeditMacro as String
+Public sOverwriteallFiles as String
+Public scouldnotopenDocument as String
+Public sCurcouldnotopenDocument as String
+Public scouldnotsaveDocument as String
+Public sCurcouldnotsaveDocument as String
+
+
+Sub LoadLanguage()
+ If InitResources(&quot;ImportWizard&quot;,&quot;imp&quot;) then
+ sHelpButton = GetResText(1000)
+ sCancelButton = GetResText(1001)
+ sBackButton = GetResText(1002)
+ sNextButton = GetResText(1003)
+ sBeginButton = GetResText(1004)
+ sCloseButton = GetResText(1005)
+
+ sWelcometextLabel1 = ReplaceString(GetResText(1006), GetProductName(),&quot;%PRODUCTNAME&quot;)
+ sWelcometextLabel2 = GetResText(1007)
+ sWelcometextLabel3 = GetResText(1008)
+
+ &apos; Microsoft Documents
+ GetApplResourceArray(1009, 3, sMSTemplateCheckBox())
+
+ &apos; DocumentCheckbox- Captions
+ GetApplResourceArray(1012, 3, sMSDocumentCheckBox())
+
+ &apos; DocumentCheckbox- Captions
+ GetApplResourceArray(2013, 5, sSODocumentCheckBox())
+
+ &apos;StarOffice Applicationnames
+
+ sSOHelperDocuments(0,0) = GetResText(2017)
+ sSOHelperDocuments(0,1) = &quot;com.sun.star.text.GlobalDocument&quot;
+ sSOHelperDocuments(1,0) = GetResText(2018)
+ sSOHelperDocuments(1,1) = &quot;com.sun.star.formula.FormulaProperties&quot;
+
+ GetApplResourceArray(2017,2, sSOHelperDocuments())
+
+ sContainerName(0) = GetResText(1030)
+ &apos; Note: for the version 5.2 there was no Productname &quot;StarSuite&quot;
+ sContainerName(1) = &quot;StarOffice&quot;
+
+ sSummaryHeader = GetResText(1031)
+
+ sTemplateGroupName = GetResText(1036)
+
+ sProgressMoreDocs = GetResText(1041)
+ sProgressMoreTemplates = GetResText(1042)
+ sNoDirCreation = GetResText(1050)
+ sMsgDirNotThere = GetResText(1051)
+ sQueryForNewCreation = GetResText(1052)
+ sFileExists = GetResText(1053)
+ sMorePathsError3 = GetResText(1054)
+ sConvertError1 = GetResText(1055)
+ sConvertError2 = GetResText(1056)
+ sRTErrorDesc = GetResText(1057)
+ sRTErrorHeader = GetResText(1058)
+ sOverwriteallFiles = GetResText(1070)
+ sReeditMacro = GetResText(1071)
+ scouldnotsaveDocument = GetResText(1072)
+ scouldnotopenDocument = GetResText(1073)
+ sPathDialogMessage = GetResText(1080)
+ sTitle = GetResText(1081)
+
+ sProgressPage_1 = GetResText(1090)
+ sProgressPage_2 = GetResText(1091)
+ sProgressPage_3 = GetResText(1092)
+ sProgressFound = GetResText(1093)
+ sProgressPage_5 = GetResText(1094)
+ sReady = GetResText(1100)
+ sSourceDocuments = GetResText(2030)
+ sTargetDocuments = GetResText(2031)
+ sLogSummary = GetResText(2034)
+ sSumInclusiveSubDir = GetResText(3000)
+ sSumSaveDocuments = GetResText(3001)
+ &apos;StarOffice Applicationnames
+ GetApplResourceArray(3100, 4, sSumSODocuments())
+ GetApplResourceArray(3110, 4, sSumSOTemplates())
+ GetApplResourceArray(3200, 3, sSumMSDocuments())
+ GetApplResourceArray(3210, 3, sSumMSTemplates())
+ With ImportDialog
+ sImportLabel = GetResText(1033)
+ sExportLabel = GetResText(1034)
+ sSearchInSubDir = GetResText(1022)
+ .chkTemplateSearchSubDir.Label = sSearchInSubDir
+ .lblDocumentImport.Label = sImportLabel
+ .lblDocumentExport.Label = sExportLabel
+ .chkDocumentSearchSubDir.Label = sSearchInSubDir
+ .lblTemplateImport.Label = sImportLabel
+ .lblTemplateExport.Label = sExportLabel
+ .chkLogfile.Label = GetResText(2032)
+ .chkLogfile.Helptext = GetResText(2033)
+ Dim Blabla as String
+ blabla = GetResText(1072)
+ .cmdShowLogFile.Label = GetResText(2035)
+ End With
+ ModuleList(0) = &quot;com.sun.star.text.TextDocument&quot;
+ ModuleList(1) = &quot;com.sun.star.sheet.SpreadsheetDocument&quot;
+ ModuleList(2) = &quot;com.sun.star.drawing.DrawingDocument/com.sun.star.presentation.PresentationDocument&quot;
+ ModuleList(3) = &quot;com.sun.star.formula.FormulaProperties/com.sun.star.text.GlobalDocument&quot;
+ End If
+End Sub
+
+
+Sub GetApplResourceArray(StartResIndex as Integer, Count as Integer, BigArray())
+Dim i as Integer
+Dim a as Integer
+ a = 0
+ For i = StartResIndex To StartResIndex + Count-1
+ BigArray(a) = GetResText(i)
+ a = a + 1
+ Next
+End Sub
+</script:module> \ No newline at end of file
diff --git a/wizards/source/importwizard/Main.xba b/wizards/source/importwizard/Main.xba
new file mode 100644
index 000000000000..2c25c6abebd0
--- /dev/null
+++ b/wizards/source/importwizard/Main.xba
@@ -0,0 +1,290 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
+<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Main" script:language="StarBasic">Option Explicit
+
+&apos; ***** BASIC *****
+Public HeaderPreviews(4) as Object
+Public ImportDialog as Object
+Public ImportDialogArea as Object
+Public oFactoryKey as Object
+Public bShowLogFile as Boolean
+
+&apos; If the ProgressPage ist already on Top The Dialog will be immediately closed when this flag is
+&apos; set to False
+Public bConversionIsRunning as Boolean
+Public RetValue as Integer
+
+Sub Main()
+ Dim NoArgs() as New com.sun.star.beans.PropertyValue
+ bShowLogFile=FALSE
+ If Not bDebugWizard Then
+ On Local Error Goto RTError
+ End If
+ BasicLibraries.LoadLibrary(&quot;Tools&quot;)
+ RetValue = 10
+ bIsFirstLogTable = True
+ bConversionIsRunning = False
+ sCRLF = CHR(13) &amp; CHR(10)
+ oUcb = createUnoService(&quot;com.sun.star.ucb.SimpleFileAccess&quot;)
+ oFactoryKey = GetRegistryKeyContent(&quot;org.openoffice.Setup/Office/Factories&quot;)
+ If GetImportWizardPaths() = False Then
+ Exit Sub
+ End If
+ bCancelTask = False
+ bDoKeepApplValues = False
+ CurOffice = 0
+ ImportDialogArea = LoadDialog(&quot;ImportWizard&quot;,&quot;ImportDialog&quot;)
+ ImportDialog = ImportDialogArea.Model
+ LoadLanguage()
+ WizardMode = SBXMLMODE
+ MaxApplCount = 4
+ FillStep_Welcome()
+ RepaintHeaderPreview()
+ ImportDialog.ImportPreview.BackGroundColor = RGB(0,60,126)
+ ImportDialog.cmdGoOn.DefaultButton = True
+ ImportDialogArea.GetControl(&quot;optSODocuments&quot;).SetFocus()
+ ToggleCheckboxesWithBoolean(False)
+ RetValue = ImportDialogArea.Execute()
+ If bShowLogFile=TRUE Then
+ OpenDocument(sLogUrl, NoArgs())
+ End if
+ If RetValue = 0 Then
+ CancelTask()
+ End If
+ ImportDialogArea.Dispose()
+ End
+ Exit Sub
+RTError:
+ Msgbox sRTErrorDesc, 16, sRTErrorHeader
+End Sub
+
+
+
+Sub NextStep()
+Dim iCurStep as Integer
+ If Not bDebugWizard Then
+ On Error Goto RTError
+ End If
+ bConversionIsRunning = False
+ iCurStep = ImportDialog.Step
+ Select Case iCurStep
+ Case 1
+ FillStep_InputPaths(0, True)
+ Case 2
+ If CheckInputPaths Then
+ SaveStep_InputPath
+ If CurOffice &lt; ApplCount - 1 Then
+ CurOffice = CurOffice + 1
+ TakeOverPathSettings()
+ FillStep_InputPaths(CurOffice, False)
+ Else
+ FillStep_Summary()
+ End If
+ End If
+ Case 3
+ FillStep_Progress()
+ Select Case WizardMode
+ Case SBMICROSOFTMODE
+ Call ConvertAllDocuments(MSFilterName())
+ CASE SBXMLMODE
+ Call ConvertAllDocuments(XMLFilterName())
+ End Select
+ Case 4
+ CancelTask(True)
+ End Select
+
+ If ((ImportDialog.chkLogfile.State &lt;&gt; 1) OR (iCurStep &lt;&gt; 3)) Then
+ ImportDialog.cmdGoOn.DefaultButton = True
+ End If
+
+ RepaintHeaderPreview()
+ Exit Sub
+RTError:
+ Msgbox sRTErrorDesc, 16, sRTErrorHeader
+End Sub
+
+
+
+Sub PrevStep()
+Dim iCurStep as Integer
+ If Not bDebugWizard Then
+ On Error Goto RTError
+ End If
+ bConversionIsRunning = False
+ iCurStep = ImportDialog.Step
+ Select Case iCurStep
+ Case 4
+ ImportDialog.cmdCancel.Label = sCancelButton
+ FillStep_Summary()
+ Case 3
+ FillStep_InputPaths(Applcount-1, False)
+ Case 2
+ SaveStep_InputPath
+ If CurOffice &gt; 0 Then
+ CurOffice = CurOffice - 1
+ FillStep_InputPaths(CurOffice, False)
+ Else
+ FillStep_Welcome()
+ bDoKeepApplValues = True
+ End If
+ End Select
+ ImportDialog.cmdGoOn.DefaultButton = True
+ RepaintHeaderPreview()
+ Exit Sub
+RTError:
+ Msgbox sRTErrorDesc, 16, sRTErrorHeader
+End Sub
+
+
+
+Sub CancelTask()
+ If bConversionIsRunning Then
+ If Msgbox(sConvertError1, 36, sConvertError2) = 6 Then
+ bCancelTask = True
+ bInterruptSearch = True
+ Else
+ bCancelTask = False
+ ImportDialog.cmdCancel.Enabled = True
+ End If
+ Else
+ ImportDialogArea.EndExecute()
+ End If
+End Sub
+
+
+Sub TemplateDirSearchDialog()
+ CallDirSearchDialog(ImportDialog.TemplateImportPath)
+End Sub
+
+
+Sub RepaintHeaderPreview()
+Dim Bitmap As Object
+Dim CurStep as Integer
+Dim sBitmapPath as String
+Dim LocPrefix as String
+ CurStep = ImportDialog.Step
+ LocPrefix = WizardMode
+ LocPrefix = ReplaceString(LocPrefix,&quot;XML&quot;, &quot;SO&quot;)
+ If CurStep = 2 Then
+ sBitmapPath = SOBitmapPath &amp; LocPrefix &amp; &quot;-Import_&quot; &amp; CurStep &amp; &quot;-&quot; &amp; Applications(CurOffice,SBAPPLKEY) + 1 &amp; &quot;.bmp&quot;
+ Else
+ sBitmapPath = SOBitmapPath &amp; &quot;Import_&quot; &amp; CurStep &amp; &quot;.bmp&quot;
+ End If
+ ImportDialog.ImportPreview.ImageURL = sBitmapPath
+End Sub
+
+
+Sub CheckModuleInstallation()
+Dim i as Integer
+ For i = 1 To MaxApplCount
+ ImportDialogArea.GetControl(&quot;chk&quot; &amp; WizardMode &amp; &quot;Application&quot; &amp; i).Model.Enabled = Abs(CheckInstalledModule(i-1))
+ Next i
+End Sub
+
+
+Function CheckInstalledModule(Index as Integer) as Boolean
+Dim ModuleName as String
+Dim NameList() as String
+Dim MaxIndex as Integer
+Dim i as Integer
+ ModuleName = ModuleList(Index)
+ If Instr(1,ModuleName,&quot;/&quot;) &lt;&gt; 0 Then
+ CheckInstalledModule() = False
+ NameList() = ArrayoutOfString(ModuleName,&quot;/&quot;, MaxIndex)
+ For i = 0 To MaxIndex
+ If oFactoryKey.HasByName(NameList(i)) Then
+ CheckInstalledModule() = True
+ End If
+ Next i
+ Else
+ CheckInstalledModule() = oFactoryKey.HasByName(ModuleName)
+ End If
+End Function
+
+
+Sub ToggleCheckboxes(oEvent as Object)
+Dim bMSEnable as Boolean
+ WizardMode = oEvent.Source.Model.Tag
+ bMSEnable = WizardMode = &quot;MS&quot;
+ ToggleCheckBoxesWithBoolean(bMSEnable)
+End Sub
+
+
+Sub ToggleCheckboxesWithBoolean(bMSEnable as Boolean)
+ If bMSEnable = True Then
+ WizardMode = SBMICROSOFTMODE
+ MaxApplCount = 3
+ Else
+ WizardMode = SBXMLMODE
+ MaxApplCount = 4
+ End If
+ With ImportDialogArea
+ .GetControl(&quot;chkSOApplication1&quot;).Model.Enabled = Not bMSEnable
+ .GetControl(&quot;chkSOApplication2&quot;).Model.Enabled = Not bMSEnable
+ .GetControl(&quot;chkSOApplication3&quot;).Model.Enabled = Not bMSEnable
+ .GetControl(&quot;chkSOApplication4&quot;).Model.Enabled = Not bMSEnable
+ .GetControl(&quot;chkMSApplication1&quot;).Model.Enabled = bMSEnable
+ .GetControl(&quot;chkMSApplication2&quot;).Model.Enabled = bMSEnable
+ .GetControl(&quot;chkMSApplication3&quot;).Model.Enabled = bMSEnable
+ End With
+ CheckModuleInstallation()
+ ImportDialog.WelcomeTextLabel2.Enabled = bMSEnable
+ bDoKeepApplValues = False
+ ToggleNextButton()
+End Sub
+
+
+Sub ToggleNextButton()
+Dim iCurStep as Integer
+Dim bDoEnable as Boolean
+Dim i as Integer
+ iCurStep = ImportDialog.Step
+ Select Case iCurStep
+ Case 1
+ With ImportDialog
+ If .optMSDocuments.State = 1 Then
+ bDoEnable = .chkMSApplication1.State = 1 Or .chkMSApplication2.State = 1 Or .chkMSApplication3.State = 1
+ Else
+ bDoEnable = .chkSOApplication1.State = 1 Or .chkSOApplication2.State = 1 Or .chkSOApplication3.State = 1 Or .chkSOApplication4.State = 1
+ End If
+ End With
+ bDoKeepApplValues = False
+ Case 2
+ bDoEnable = CheckControlPath(ImportDialog.chkTemplatePath, ImportDialog.txtTemplateImportPath, True)
+ bDoEnable = CheckControlPath(ImportDialog.chkDocumentPath, ImportDialog.txtDocumentImportPath, bDoEnable)
+ End Select
+ ImportDialog.cmdGoOn.Enabled = bDoEnable
+End Sub
+
+
+Sub TakeOverPathSettings()
+&apos;Takes over the Pathsettings from the first selected application to the next applications
+ If Applications(CurOffice,SBDOCSOURCE) = &quot;&quot; Then
+ Applications(CurOffice,SBDOCSOURCE) = Applications(0,SBDOCSOURCE)
+ Applications(CurOffice,SBDOCTARGET) = Applications(0,SBDOCTARGET)
+ If WizardMode = SBXMLMODE AND Applications(CurOffice,SBAPPLKEY) = 3 Then
+ Applications(CurOffice,SBTEMPLSOURCE) = Applications(CurOffice,SBDOCSOURCE)
+ Applications(CurOffice,SBTEMPLTARGET) = Applications(CurOffice,SBDOCTARGET)
+ Else
+ Applications(CurOffice,SBTEMPLSOURCE) = Applications(0,SBTEMPLSOURCE)
+ Applications(CurOffice,SBTEMPLTARGET) = Applications(0,SBTEMPLTARGET)
+ End If
+ End If
+End Sub
+
+
+Function GetImportWizardPaths() as Boolean
+ SOBitmapPath = GetOfficeSubPath(&quot;Template&quot;, &quot;wizard/bitmap&quot;)
+ If SOBitmapPath &lt;&gt; &quot;&quot; Then
+ SOWorkPath = GetPathSettings(&quot;Work&quot;, False)
+ If SOWorkPath &lt;&gt; &quot;&quot; Then
+ SOTemplatePath = GetPathSettings(&quot;Template_writable&quot;,False,0)
+ If SOTemplatePath &lt;&gt; &quot;&quot; Then
+ GetImportWizardPaths() = True
+ Exit Function
+ End If
+ End If
+ End If
+ GetImportWizardPaths() = False
+End Function
+</script:module> \ No newline at end of file
diff --git a/wizards/source/importwizard/delzip b/wizards/source/importwizard/delzip
new file mode 100644
index 000000000000..e69de29bb2d1
--- /dev/null
+++ b/wizards/source/importwizard/delzip
diff --git a/wizards/source/importwizard/dialog.xlb b/wizards/source/importwizard/dialog.xlb
new file mode 100644
index 000000000000..f5cc021d521d
--- /dev/null
+++ b/wizards/source/importwizard/dialog.xlb
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
+<library:library xmlns:library="http://openoffice.org/2000/library" library:name="ImportWizard" library:readonly="true" library:passwordprotected="false">
+ <library:element library:name="ImportDialog"/>
+</library:library>
diff --git a/wizards/source/importwizard/importwi.src b/wizards/source/importwizard/importwi.src
new file mode 100644
index 000000000000..5031b8471b2d
--- /dev/null
+++ b/wizards/source/importwizard/importwi.src
@@ -0,0 +1,677 @@
+/*************************************************************************
+ *
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * Copyright 2008 by Sun Microsystems, Inc.
+ *
+ * OpenOffice.org - a multi-platform office productivity suite
+ *
+ * $RCSfile: importwi.src,v $
+ * $Revision: 1.54 $
+ *
+ * This file is part of OpenOffice.org.
+ *
+ * OpenOffice.org is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Lesser General Public License version 3
+ * only, as published by the Free Software Foundation.
+ *
+ * OpenOffice.org is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Lesser General Public License version 3 for more details
+ * (a copy is included in the LICENSE file that accompanied this code).
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * version 3 along with OpenOffice.org. If not, see
+ * <http://www.openoffice.org/license.html>
+ * for a copy of the LGPLv3 License.
+ *
+ ************************************************************************/#define sHelpButton 1000
+#define sCancelButton 1001
+#define sBackButton 1002
+#define sNextButton 1003
+#define sBeginButton 1004
+#define sCloseButton 1005
+#define sWelcometextLabel1 1006
+#define sWelcometextLabel2 1007
+#define sWelcometextLabel3 1008
+#define sMSTemplateCheckbox_1_ 1009
+#define sMSTemplateCheckbox_2_ 1010
+#define sMSTemplateCheckbox_3_ 1011
+#define sMSDocumentCheckbox_1_ 1012
+#define sMSDocumentCheckbox_2_ 1013
+#define sMSDocumentCheckbox_3_ 1014
+#define sSearchInSubDir 1022
+#define sMSContainerName 1030
+#define sSummaryHeader 1031
+#define sSummaryFrame 1032
+#define sTextImportLabel 1033
+#define sTextExportLabel 1034
+#define sGroupnameDefault 1036
+#define sProgressDesc1 1039
+#define sProgressOneDoc 1040
+#define sProgressMoreDocs 1041
+#define sProgressMoreTemplates 1042
+#define sNoDirCreation 1050
+#define sMsgDirNotThere 1051
+#define sQueryfornewCreation 1052
+#define sFileExists 1053
+#define sMorePathsError3 1054
+#define sConvertError1 1055
+#define sConvertError2 1056
+#define sRTErrorDesc 1057
+#define sRTErrorHeader 1058
+#define sPathErrorTemplates_1_ 1059
+#define sPathErrorTemplates_2_ 1060
+#define sPathErrorTemplates_3_ 1061
+#define sPathErrorDocument_1_ 1062
+#define sPathErrorDocument_2_ 1063
+#define sPathErrorDocument_3_ 1064
+#define sPathErrorStarDoc_1_ 1065
+#define sPathErrorStarDoc_2_ 1066
+#define sPathErrorStarDoc_3_ 1067
+#define sOverwriteallFiles 1070
+#define sreeditMacro 1071
+#define scouldNotsaveDocument 1072
+#define scouldNotopenDocument 1073
+#define sPathDialogMessage 1080
+#define sDialogTitle 1081
+#define sProgressPage1 1090
+#define sProgressPage2 1091
+#define sProgressPage3 1092
+#define sProgressFound 1093
+#define sProgressPage5 1094
+#define sReady 1100
+#define sXMLTemplateCheckbox_1_ 2009
+#define sXMLTemplateCheckbox_2_ 2010
+#define sXMLTemplateCheckbox_3_ 2011
+#define sXMLTemplateCheckbox_4_ 2012
+#define sXMLDocumentCheckbox_1_ 2013
+#define sXMLDocumentCheckbox_2_ 2014
+#define sXMLDocumentCheckbox_3_ 2015
+#define sXMLDocumentCheckbox_4_ 2016
+#define sXMLHelperApplications_1 2017
+#define sXMLHelperApplications_2 2018
+
+#define sSourceDocuments 2030
+#define sTargetDocuments 2031
+#define sCreateLogfile 2032
+#define sLogfileHelpText 2033
+#define sLogfileSummary 2034
+#define sshowLogfile 2035
+
+#define sSumInclusiveSubDir 3000
+#define sSumSaveDokumente 3001
+
+#define sSumSOTextDocuments 3100
+#define sSumSOTableDocuments 3101
+#define sSumSODrawDocuments 3102
+#define sSumSOMathDocuments 3103
+
+#define sSumSOTextTemplates 3110
+#define sSumSOTableTemplates 3111
+#define sSumSODrawTemplates 3112
+#define sSumSOGlobalDocuments 3113
+
+#define sSumMSTextDocuments 3200
+#define sSumMSTableDocuments 3201
+#define sSumMSDrawDocuments 3202
+
+#define sSumMSTextTemplates 3210
+#define sSumMSTableTemplates 3211
+#define sSumMSDrawTemplates 3212
+
+
+// --------------------------------------------------------------------
+String sHelpButton
+{
+ Text [ en-US ] = "~Help";
+};
+
+String sCancelButton
+{
+ Text [ en-US ] = "~Cancel";
+};
+
+String sBackButton
+{
+ Text [ en-US ] = "<< ~Back";
+};
+
+String sNextButton
+{
+ Text [ en-US ] = "Ne~xt >>";
+};
+
+String sBeginButton
+{
+ Text [ en-US ] = "~Convert";
+};
+
+String sCloseButton
+{
+ Text [ en-US ] = "~Close";
+};
+
+String sWelcometextLabel1
+{
+ Text [ en-US ] = "This wizard converts documents in %PRODUCTNAME format and Microsoft Office documents to the new OpenDocument format.";
+};
+
+String sWelcometextLabel2
+{
+ Text [ en-US ] = "Please note that when converting Microsoft documents any attached VBA macros lose their functionality.";
+};
+
+String sWelcometextLabel3
+{
+ Text [ en-US ] = "Select the document type for conversion:";
+};
+
+
+
+String sMSTemplateCheckbox_1_
+{
+ Text [ en-US ] = "Word templates";
+};
+
+String sMSTemplateCheckbox_2_
+{
+ Text [ en-US ] = "Excel templates";
+};
+
+String sMSTemplateCheckbox_3_
+{
+ Text [ en-US ] = "PowerPoint templates";
+};
+
+String sMSDocumentCheckbox_1_
+{
+ Text [ en-US ] = "Word documents";
+};
+
+String sMSDocumentCheckbox_2_
+{
+ Text [ en-US ] = "Excel documents";
+};
+
+String sMSDocumentCheckbox_3_
+{
+ Text [ en-US ] = "PowerPoint documents";
+};
+
+
+String sSearchInSubDir
+{
+ Text [ en-US ] = "Including subdirectories";
+};
+
+
+
+String sMSContainerName
+{
+ Text [ en-US ] = "Microsoft Office";
+};
+
+
+
+String sSummaryHeader
+{
+ Text [ en-US ] = "Summary:";
+};
+
+String sTextImportLabel
+{
+ Text [ en-US ] = "Import from:";
+};
+
+
+String sTextExportLabel
+{
+ Text [ en-US ] = "Save to:";
+};
+
+
+String sGroupnameDefault
+{
+ Text [ en-US ] = "Imported_Templates";
+};
+
+
+String sProgressDesc1
+{
+ Text [ en-US ] = "Progress: ";
+};
+
+String sProgressOneDoc
+{
+ Text [ en-US ] = "Document";
+};
+
+String sProgressMoreDocs
+{
+ Text [ en-US ] = "Documents";
+};
+
+
+String sProgressMoreTemplates
+{
+ Text [ en-US ] = "Templates";
+};
+
+
+String sNoDirCreation
+{
+ Text [ en-US ] = "The '%1' directory cannot be created: ";
+};
+
+
+String sMsgDirNotThere
+{
+ Text [ en-US ] = "The '%1' directory does not exist.";
+};
+
+
+String sQueryfornewCreation
+{
+ Text [ en-US ] = "Do you want to create it now?";
+};
+
+
+String sFileExists
+{
+ Text [ en-US ] = "The '<1>' file already exists.<CR>Do you want to overwrite it?";
+};
+
+String sMorePathsError3
+{
+ Text [ en-US ] = "Directories do not exist";
+};
+
+
+String sOverwriteallFiles
+{
+ Text [ en-US ] = "Do you want to overwrite documents without being asked?";
+};
+
+
+String sreeditMacro
+{
+ Text [ en-US ] = "Document macro has to be revised.";
+};
+
+String scouldNotsaveDocument
+{
+ Text [ en-US ] = "Document '<1>' could not be saved.";
+};
+
+
+String scouldNotopenDocument
+{
+ Text [ en-US ] = "Document '<1>' could not be opened.";
+};
+
+
+
+String sConvertError1
+{
+ Text [ en-US ] = "Do you really want to terminate conversion at this point?";
+};
+
+String sConvertError2
+{
+ Text [ en-US ] = "Cancel Wizard";
+};
+
+String sRTErrorDesc
+{
+ Text [ en-US ] = "An unexpected error has occurred in the wizard.";
+};
+
+String sRTErrorHeader
+{
+ Text [ en-US ] = "Error";
+};
+
+
+String sPathDialogMessage
+{
+ Text [ en-US ] = "Select a directory";
+};
+
+String sDialogTitle
+{
+ Text [ en-US ] = "Document Converter";
+};
+
+String sProgressPage1
+{
+ Text [ en-US ] = "Progress";
+};
+
+String sProgressPage2
+{
+ Text [ en-US ] = "Retrieving the relevant documents:";
+};
+
+String sProgressPage3
+{
+ Text [ en-US ] = "Converting the documents";
+};
+
+
+String sProgressFound
+{
+ Text [ en-US ] = "Found:";
+};
+
+
+String sProgressPage5
+{
+ Text [ en-US ] = "%1 found";
+};
+
+String sReady
+{
+ Text [ en-US ] = "Finished";
+};
+
+
+String sXMLTemplateCheckbox_1_
+{
+ Text [ en-US ] = "Text templates";
+};
+
+String sXMLTemplateCheckbox_2_
+{
+ Text [ en-US ] = "Spreadsheet templates";
+};
+
+String sXMLTemplateCheckbox_3_
+{
+ Text [ en-US ] = "Drawing/presentation templates";
+};
+
+String sXMLTemplateCheckbox_4_
+{
+ Text [ en-US ] = "Master documents";
+};
+
+
+String sXMLDocumentCheckbox_1_
+{
+ Text [ en-US ] = "Text documents";
+};
+
+String sXMLDocumentCheckbox_2_
+{
+ Text [ en-US ] = "Spreadsheets";
+};
+
+String sXMLDocumentCheckbox_3_
+{
+ Text [ en-US ] = "Drawing/presentation documents";
+};
+
+
+String sXMLDocumentCheckbox_4_
+{
+ Text [ en-US ] = "Master documents/formulas";
+};
+
+String sXMLHelperApplications_1
+{
+ Text [ en-US ] = "Master documents";
+};
+
+String sXMLHelperApplications_2
+{
+ Text [ en-US ] = "Formulas";
+};
+
+
+String sSourceDocuments
+{
+ Text [ en-US ] = "Source documents";
+};
+
+
+String sTargetDocuments
+{
+ Text [ en-US ] = "Target documents";
+};
+
+String sCreateLogfile
+{
+ Text [ en-US ] = "Create log file";
+};
+
+
+String sLogfileSummary
+{
+ Text [ en-US ] = "<COUNT> documents converted";
+};
+
+
+
+String sLogfileHelpText
+{
+ Text [ en-US ] = "A log file will be created in your work directory";
+};
+
+
+String sshowLogfile
+{
+ Text [ en-US ] = "Show log file";
+};
+
+
+String sSumInclusiveSubDir
+{
+ Text [ en-US ] = "All subdirectories will be taken into account";
+};
+
+String sSumSaveDokumente
+{
+ Text [ en-US ] = "These will be exported to the following directory:";
+};
+
+
+String sSumSOTextDocuments
+{
+ Text [ en-US ] = "All %PRODUCTNAME text documents contained in the following directory will be imported:";
+};
+
+
+String sSumSOTableDocuments
+{
+ Text [ en-US ] = "All %PRODUCTNAME spreadsheets contained in the following directory will be imported:";
+};
+
+
+String sSumSODrawDocuments
+{
+ Text [ en-US ] = "All %PRODUCTNAME drawing and presentation documents contained in the following directory will be imported:";
+};
+
+
+String sSumSOMathDocuments
+{
+ Text [ en-US ] = "All %PRODUCTNAME formula documents contained in the following directory will be imported:";
+};
+
+
+String sSumSOTextTemplates
+{
+ Text [ en-US ] = "All %PRODUCTNAME text templates contained in the following directory will be imported:";
+};
+
+
+String sSumSOTableTemplates
+{
+ Text [ en-US ] = "All %PRODUCTNAME table templates contained in the following directory will be imported:";
+};
+
+
+String sSumSODrawTemplates
+{
+ Text [ en-US ] = "All %PRODUCTNAME drawing and presentation templates contained in the following directory will be imported:";
+};
+
+String sSumSOGlobalDocuments
+{
+ Text [ en-US ] = "All %PRODUCTNAME master documents contained in the following directory will be imported:";
+};
+
+
+String sSumMSTextDocuments
+{
+ Text [ en-US ] = "All Word documents contained in the following directory will be imported:";
+};
+
+
+String sSumMSTableDocuments
+{
+ Text [ en-US ] = "All Excel documents contained in the following directory will be imported:";
+};
+
+
+String sSumMSDrawDocuments
+{
+ Text [ en-US ] = "All PowerPoint documents contained in the following directory will be imported:";
+};
+
+
+String sSumMSTextTemplates
+{
+ Text [ en-US ] = "All Word templates contained in the following directory will be imported:";
+};
+
+
+String sSumMSTableTemplates
+{
+ Text [ en-US ] = "All Excel templates contained in the following directory will be imported:";
+};
+
+
+String sSumMSDrawTemplates
+{
+ Text [ en-US ] = "All PowerPoint templates contained in the following directory will be imported:";
+};
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/wizards/source/importwizard/makefile.mk b/wizards/source/importwizard/makefile.mk
new file mode 100644
index 000000000000..f5924895f5e2
--- /dev/null
+++ b/wizards/source/importwizard/makefile.mk
@@ -0,0 +1,57 @@
+#*************************************************************************
+#
+# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+#
+# Copyright 2008 by Sun Microsystems, Inc.
+#
+# OpenOffice.org - a multi-platform office productivity suite
+#
+# $RCSfile: makefile.mk,v $
+#
+# $Revision: 1.7 $
+#
+# This file is part of OpenOffice.org.
+#
+# OpenOffice.org is free software: you can redistribute it and/or modify
+# it under the terms of the GNU Lesser General Public License version 3
+# only, as published by the Free Software Foundation.
+#
+# OpenOffice.org is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU Lesser General Public License version 3 for more details
+# (a copy is included in the LICENSE file that accompanied this code).
+#
+# You should have received a copy of the GNU Lesser General Public License
+# version 3 along with OpenOffice.org. If not, see
+# <http://www.openoffice.org/license.html>
+# for a copy of the LGPLv3 License.
+#
+#*************************************************************************
+PRJ=..$/..
+
+PRJNAME=wizards
+TARGET=importwizardall
+
+# --- Settings -----------------------------------------------------
+
+.INCLUDE : settings.mk
+.INCLUDE : $(PRJ)$/util$/target.pmk
+
+# --- Files --------------------------------------------------------
+
+#
+# testresource.
+#
+SRS2NAME = importwi
+SRC2FILES= importwi.src
+RESLIB2SRSFILES= $(SRS)$/importwi.srs
+RESLIB2NAME= imp
+
+ZIP1TARGET = $(IMPORTWIZARD_ALL_TARGET)
+ZIP1LIST = *.xdl *.xba *.xlb
+
+# --- Targets ------------------------------------------------------
+
+.INCLUDE : target.mk
+
diff --git a/wizards/source/importwizard/script.xlb b/wizards/source/importwizard/script.xlb
new file mode 100644
index 000000000000..2d10f65cba30
--- /dev/null
+++ b/wizards/source/importwizard/script.xlb
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
+<library:library xmlns:library="http://openoffice.org/2000/library" library:name="ImportWizard" library:readonly="true" library:passwordprotected="false">
+ <library:element library:name="Main"/>
+ <library:element library:name="DialogModul"/>
+ <library:element library:name="Language"/>
+ <library:element library:name="FilesModul"/>
+ <library:element library:name="API"/>
+</library:library>