1cdf0e10cSrcweir<?xml version="1.0" encoding="UTF-8"?>
2cdf0e10cSrcweir<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
33e02b54dSAndrew Rist<!--***********************************************************
43e02b54dSAndrew Rist *
53e02b54dSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
63e02b54dSAndrew Rist * or more contributor license agreements.  See the NOTICE file
73e02b54dSAndrew Rist * distributed with this work for additional information
83e02b54dSAndrew Rist * regarding copyright ownership.  The ASF licenses this file
93e02b54dSAndrew Rist * to you under the Apache License, Version 2.0 (the
103e02b54dSAndrew Rist * "License"); you may not use this file except in compliance
113e02b54dSAndrew Rist * with the License.  You may obtain a copy of the License at
123e02b54dSAndrew Rist *
133e02b54dSAndrew Rist *   http://www.apache.org/licenses/LICENSE-2.0
143e02b54dSAndrew Rist *
153e02b54dSAndrew Rist * Unless required by applicable law or agreed to in writing,
163e02b54dSAndrew Rist * software distributed under the License is distributed on an
173e02b54dSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
183e02b54dSAndrew Rist * KIND, either express or implied.  See the License for the
193e02b54dSAndrew Rist * specific language governing permissions and limitations
203e02b54dSAndrew Rist * under the License.
213e02b54dSAndrew Rist *
223e02b54dSAndrew Rist ***********************************************************-->
23cdf0e10cSrcweir<script:module xmlns:script="http://openoffice.org/2000/script" script:name="DialogModul" script:language="StarBasic">Option Explicit
24cdf0e10cSrcweir
25cdf0e10cSrcweirPublic Const bDebugWizard = True
26cdf0e10cSrcweir
27cdf0e10cSrcweirPublic Const SBFIRSTAPPLCHECKED = 0
28cdf0e10cSrcweirPublic Const SBSECONDAPPLCHECKED = 1
29cdf0e10cSrcweirPublic Const SBTHIRDAPPLCHECKED = 2
30cdf0e10cSrcweirPublic Const SBFOURTHAPPLCHECKED = 3
31cdf0e10cSrcweirPublic bFilterTracingAvailable as Boolean
32cdf0e10cSrcweirPublic WizardMode as String
33cdf0e10cSrcweirPublic Const SBMICROSOFTMODE = &quot;MS&quot;
34cdf0e10cSrcweirPublic Const SBXMLMODE = &quot;SO&quot;
35cdf0e10cSrcweir&apos; The absolute maximal Number of possible Applications
36cdf0e10cSrcweirPublic Const Twip = 425
37cdf0e10cSrcweirPublic Const SBMAXAPPLCOUNT = 4
38cdf0e10cSrcweirPublic MaxApplCount as Integer
39cdf0e10cSrcweirPublic CurOffice As Integer
40cdf0e10cSrcweirPublic SOBitmapPath As String
41cdf0e10cSrcweirPublic SOWorkPath As String
42cdf0e10cSrcweirPublic SOTemplatePath as String
43cdf0e10cSrcweirPublic bCancelTask As Boolean
44cdf0e10cSrcweirPublic bDoKeepApplValues as Boolean
45cdf0e10cSrcweirPublic iApplSection as Integer
46cdf0e10cSrcweirPublic oUcb as Object
47cdf0e10cSrcweirPublic PathSeparator as String
48cdf0e10cSrcweir
49cdf0e10cSrcweirPublic ApplCount as Integer
50cdf0e10cSrcweirPublic sKeyName(SBMAXAPPLCOUNT-1) as String
51cdf0e10cSrcweirPublic sValueName(SBMAXAPPLCOUNT-1) as String
52cdf0e10cSrcweirPublic sCRLF as String
53cdf0e10cSrcweirPublic MSFilterName(5,4) as String
54cdf0e10cSrcweirPublic XMLFilterName(7,3) as String &apos;Number of different formats
55cdf0e10cSrcweirPublic FilterTracingLogPath(2) as String
56cdf0e10cSrcweirPublic bMSApplFilterTracingAvailable(2) as String
57cdf0e10cSrcweirPublic bTakeOverTargetName(2) as Boolean
58cdf0e10cSrcweirPublic bTakeOverPathName(2) as Boolean
59cdf0e10cSrcweir
60cdf0e10cSrcweir&apos; e.g.:
61cdf0e10cSrcweir&apos; XMLFilterName(x,0) = &quot;sdw&quot; 						&apos; in documents we take the extensions; in SO-templates the appropriate Filtername
62cdf0e10cSrcweir&apos; XMLFilterName(x,1) = &quot;swriter: StarWriter 5.0&quot; 	&apos; the filtername of the target-format
63cdf0e10cSrcweir&apos; XMLFilterName(x,2) = &quot;sxw&quot; 						&apos; the target extension
64cdf0e10cSrcweir
65cdf0e10cSrcweirPublic Applications(SBMAXAPPLCOUNT-1,9)
66cdf0e10cSrcweir
67cdf0e10cSrcweirPublic Const SBAPPLCONVERT = 0
68cdf0e10cSrcweirPublic Const SBDOCCONVERT = 1
69cdf0e10cSrcweirPublic Const SBDOCRECURSIVE = 2
70cdf0e10cSrcweirPublic Const SBDOCSOURCE = 3
71cdf0e10cSrcweirPublic Const SBDOCTARGET = 4
72cdf0e10cSrcweirPublic Const SBTEMPLCONVERT = 5
73cdf0e10cSrcweirPublic Const SBTEMPLRECURSIVE = 6
74cdf0e10cSrcweirPublic Const SBTEMPLSOURCE = 7
75cdf0e10cSrcweirPublic Const SBTEMPLTARGET = 8
76cdf0e10cSrcweirPublic Const SBAPPLKEY = 9
77cdf0e10cSrcweirPublic XMLTemplateList()
78cdf0e10cSrcweir
79cdf0e10cSrcweir&apos; Application-relating Data are stored in this Array
80cdf0e10cSrcweir&apos; according to the following structure:
81cdf0e10cSrcweir&apos; Applications(X,0) = True/False 		(Application is to be converted)
82cdf0e10cSrcweir&apos; Applications(X,1) = True/False 		(Documents are to be converted)
83cdf0e10cSrcweir&apos; Applications(X,2) = True/False		(Including Subdirectories)
84cdf0e10cSrcweir&apos; Applications(X,3) = &quot;File:///...&quot;		(SourceUrl of the documents)
85cdf0e10cSrcweir&apos; Applications(X,4) = &quot;File///:...&quot;		(TargetUrl of the documents)
86cdf0e10cSrcweir&apos; Applications(X,5) = True/False		(Templates are to be converted)
87cdf0e10cSrcweir&apos; Applications(X,6) = True/False 		(Including Subdirectories)
88cdf0e10cSrcweir&apos; Applications(X,7) = &quot;File:///...&quot;		(SourceUrl of the templates)
89cdf0e10cSrcweir&apos; Applications(X,8) = &quot;File:///...&quot; 	(TargetUrl of the templates)
90cdf0e10cSrcweir&apos; Applications(X,9) = 0				    (Key to the original Index of the Applications)
91cdf0e10cSrcweir
92*bc0b50ddSTsutomu UchinoPublic Const SBMAXEXTENSIONLENGTH = 17
93cdf0e10cSrcweir
94cdf0e10cSrcweir
95cdf0e10cSrcweirSub FillStep_Welcome()
96cdf0e10cSrcweirDim i as Integer
97cdf0e10cSrcweir&apos;	bDoKeepApplValues = False
98cdf0e10cSrcweir	ImportDialogArea.Title = sTitle
99cdf0e10cSrcweir	With ImportDialog
100cdf0e10cSrcweir		.cmdHelp.Label = sHelpButton
101cdf0e10cSrcweir		.cmdCancel.Label = sCancelButton
102cdf0e10cSrcweir		.cmdBack.Label = sBackButton
103cdf0e10cSrcweir		.cmdGoOn.Label = sNextButton
104cdf0e10cSrcweir		.WelcomeTextLabel.Label = sWelcomeTextLabel1
105cdf0e10cSrcweir		.WelcomeTextLabel2.Label = sWelcomeTextLabel2
106cdf0e10cSrcweir		.WelcomeTextLabel3.Label = sWelcomeTextLabel3
107cdf0e10cSrcweir
108cdf0e10cSrcweir		.optMSDocuments.Label = sContainerName(0)
109cdf0e10cSrcweir		.chkMSApplication1.Label = sMsDocumentCheckbox(0)
110cdf0e10cSrcweir		.chkMSApplication2.Label = sMsDocumentCheckbox(1)
111cdf0e10cSrcweir		.chkMSApplication3.Label = sMsDocumentCheckbox(2)
112cdf0e10cSrcweir
113cdf0e10cSrcweir		.optSODocuments.Label = sContainerName(1)
114cdf0e10cSrcweir		.chkSOApplication1.Label = sSODocumentCheckbox(0)
115cdf0e10cSrcweir		.chkSOApplication2.Label = sSODocumentCheckbox(1)
116cdf0e10cSrcweir		.chkSOApplication3.Label = sSODocumentCheckbox(2)
117cdf0e10cSrcweir		.chkSOApplication4.Label = sSODocumentCheckbox(3)
118cdf0e10cSrcweir		.cmdBack.Enabled = False
119cdf0e10cSrcweir		.Step = 1
120cdf0e10cSrcweir
121cdf0e10cSrcweir		If Not oFactoryKey.hasbyName(&quot;com.sun.star.text.TextDocument&quot;) Then
122cdf0e10cSrcweir			.chkLogfile.State = 0
123cdf0e10cSrcweir			.chkLogfile.Enabled = False
124cdf0e10cSrcweir		End If
125cdf0e10cSrcweir	End With
126cdf0e10cSrcweir	CheckModuleInstallation()
127cdf0e10cSrcweir	ToggleNextButton()
128cdf0e10cSrcweirEnd Sub
129cdf0e10cSrcweir
130cdf0e10cSrcweir
131cdf0e10cSrcweirSub FillStep_InputPaths(OfficeIndex as Integer, bStartup as Boolean)
132cdf0e10cSrcweirDim Index as Integer
133cdf0e10cSrcweirDim oNullObject as Object
134cdf0e10cSrcweir	If bStartup And Not bDoKeepApplValues Then
135cdf0e10cSrcweir	    If ImportDialog.optMSDocuments.State = 1 Then
136cdf0e10cSrcweir			SetupMSConfiguration()
137cdf0e10cSrcweir		Else
138cdf0e10cSrcweir			SetupXMLConfiguration()
139cdf0e10cSrcweir		End If
140cdf0e10cSrcweir		FillUpApplicationList()
141cdf0e10cSrcweir	End If
142cdf0e10cSrcweir	CurOffice = OfficeIndex
143cdf0e10cSrcweir	Index = Applications(CurOffice,SBAPPLKEY)
144cdf0e10cSrcweir	InitializePathsforCurrentApplication(Index)
145cdf0e10cSrcweir	With ImportDialog
146cdf0e10cSrcweir		.chkTemplatePath.Label = sTemplateCheckbox(Index)
147cdf0e10cSrcweir    	.chkDocumentPath.State = Abs(Applications(CurOffice,SBDOCCONVERT))
148cdf0e10cSrcweir 	  	.chkDocumentSearchSubDir.State = Abs(Applications(CurOffice,SBDOCRECURSIVE))
149cdf0e10cSrcweir		.txtDocumentImportPath.Text = ConvertFromUrl(Applications(CurOffice,SBDOCSOURCE))
150cdf0e10cSrcweir		.txtDocumentExportPath.Text = ConvertFromUrl(Applications(CurOffice,SBDOCTARGET))
151cdf0e10cSrcweir		.hlnDocuments.Label = sProgressMoreDocs
152cdf0e10cSrcweir		If WizardMode = SBXMLMODE Then
153cdf0e10cSrcweir			ImportDialogArea.Title = sTitle &amp; &quot; - &quot; &amp; sSODocumentCheckBox(Index)
154cdf0e10cSrcweir		Else
155cdf0e10cSrcweir			ImportDialogArea.Title = sTitle &amp; &quot; - &quot; &amp; sMSDocumentCheckBox(Index)
156cdf0e10cSrcweir		End If
157cdf0e10cSrcweir		If WizardMode = SBXMLMODE AND Index = 3 Then
158cdf0e10cSrcweir			&apos; Note: SO-Helper Applications are partly treated like templates although they only have documents
159cdf0e10cSrcweir			.hlnTemplates.Label = sProgressMoreDocs
160cdf0e10cSrcweir			.chkTemplatePath.Label = sSOHelperDocuments(0,0)
161cdf0e10cSrcweir			.chkTemplatePath.Enabled = oFactoryKey.HasByName(sSOHelperDocuments(0,1))
162cdf0e10cSrcweir			.chkDocumentPath.Label = sSOHelperDocuments(1,0)
163cdf0e10cSrcweir			.chkDocumentPath.Enabled = oFactoryKey.HasByName(sSOHelperDocuments(1,1))
164cdf0e10cSrcweir		Else
165cdf0e10cSrcweir			.chkTemplatePath.Enabled = True
166cdf0e10cSrcweir			.chkDocumentPath.Enabled = True
167cdf0e10cSrcweir			.chkTemplatePath.Label = sTemplateCheckbox(Index)
168cdf0e10cSrcweir			.chkDocumentPath.Label = sDocumentCheckbox(Index)
169cdf0e10cSrcweir			.hlnTemplates.Label = sProgressMoreTemplates
170cdf0e10cSrcweir		End If
171cdf0e10cSrcweir		.chkTemplatePath.State = Abs(Applications(CurOffice,SBTEMPLCONVERT))
172cdf0e10cSrcweir		ToggleInputPaths(oNullObject,&quot;Template&quot;)
173cdf0e10cSrcweir		ToggleInputPaths(oNullObject,&quot;Document&quot;)
174cdf0e10cSrcweir		.chkTemplateSearchSubDir.State = Abs(Applications(CurOffice,SBTEMPLRECURSIVE))
175cdf0e10cSrcweir		.txtTemplateImportPath.Text = ConvertFromUrl(Applications(CurOffice,SBTEMPLSOURCE))
176cdf0e10cSrcweir		.txtTemplateExportPath.Text = ConvertFromUrl(Applications(CurOffice,SBTEMPLTARGET))
177cdf0e10cSrcweir		.cmdGoOn.Label = sNextButton
178cdf0e10cSrcweir		.cmdBack.Enabled = True
179cdf0e10cSrcweir		ImportDialog.Step = 2
180cdf0e10cSrcweir	End With
181cdf0e10cSrcweir	ImportDialogArea.GetControl(&quot;chkTemplatePath&quot;).SetFocus()
182cdf0e10cSrcweir	ToggleNextButton()
183cdf0e10cSrcweirEnd Sub
184cdf0e10cSrcweir
185cdf0e10cSrcweir
186cdf0e10cSrcweirSub FillUpApplicationList()
187cdf0e10cSrcweirDim i as Integer
188cdf0e10cSrcweirDim a as Integer
189cdf0e10cSrcweirDim BoolValue as Boolean
190cdf0e10cSrcweir	If Not bDoKeepApplValues Then
191cdf0e10cSrcweir		a = 0
192cdf0e10cSrcweir		For i = 1 To ApplCount
193cdf0e10cSrcweir		    If ImportDialog.optMSDocuments.State = 1 Then
194cdf0e10cSrcweir				BoolValue = ImportDialogArea.GetControl(&quot;chkMSApplication&quot; &amp; i).Model.State = 1
195cdf0e10cSrcweir			Else
196cdf0e10cSrcweir				BoolValue = ImportDialogArea.GetControl(&quot;chkSOApplication&quot; &amp; i).Model.State = 1
197cdf0e10cSrcweir			End If
198cdf0e10cSrcweir			Applications(a,SBAPPLCONVERT) = BoolValue
199cdf0e10cSrcweir			Applications(a,SBDOCCONVERT) = BoolValue
200cdf0e10cSrcweir			Applications(a,SBDOCRECURSIVE) = BoolValue
201cdf0e10cSrcweir			Applications(a,SBDOCSOURCE) = &quot;&quot;			&apos; GetDefaultPath(i)
202cdf0e10cSrcweir			Applications(a,SBDOCTARGET) = &quot;&quot;			&apos; SOWorkPath
203cdf0e10cSrcweir			Applications(a,SBTEMPLCONVERT) = BoolValue
204cdf0e10cSrcweir			Applications(a,SBTEMPLRECURSIVE) = BoolValue
205cdf0e10cSrcweir			Applications(a,SBTEMPLSOURCE) = &quot;&quot; 			&apos; GetTemplateDefaultPath(i)
206cdf0e10cSrcweir			Applications(a,SBTEMPLTARGET) = &quot;&quot; 			&apos; GetTargetTemplatePath(i)
207cdf0e10cSrcweir			Applications(a,SBAPPLKEY) = i-1
208cdf0e10cSrcweir			If BoolValue Then
209cdf0e10cSrcweir				a = a + 1
210cdf0e10cSrcweir			End If
211cdf0e10cSrcweir		Next i
212cdf0e10cSrcweir		ApplCount = a
213cdf0e10cSrcweir	End If
214cdf0e10cSrcweirEnd Sub
215cdf0e10cSrcweir
216cdf0e10cSrcweir
217cdf0e10cSrcweirSub InitializePathsforCurrentApplication(i as Integer)
218cdf0e10cSrcweir	AssignPathToCurrentApplication(SBDOCSOURCE, GetDefaultPath(i))
219cdf0e10cSrcweir	AssignPathToCurrentApplication(SBDOCTARGET, SOWorkPath)
220cdf0e10cSrcweir	AssignPathToCurrentApplication(SBTEMPLSOURCE, GetTemplateDefaultPath(i))
221cdf0e10cSrcweir	AssignPathToCurrentApplication(SBTEMPLTARGET, GetTargetTemplatePath(i))
222cdf0e10cSrcweirEnd Sub
223cdf0e10cSrcweir
224cdf0e10cSrcweir
225cdf0e10cSrcweirSub AssignPathToCurrentApplication(Index as Integer, NewPath as String)
226cdf0e10cSrcweir	If Applications(CurOffice,Index) = &quot;&quot; Then
227cdf0e10cSrcweir		If CurOffice &gt; 0 Then
228cdf0e10cSrcweir			Applications(CurOffice,Index) = Applications(CurOffice-1,Index)
229cdf0e10cSrcweir		Else
230cdf0e10cSrcweir			Applications(CurOffice,Index) = NewPath
231cdf0e10cSrcweir		End If
232cdf0e10cSrcweir	End If
233cdf0e10cSrcweirEnd Sub
234cdf0e10cSrcweir
235cdf0e10cSrcweir
236cdf0e10cSrcweirSub SaveStep_InputPath()
237cdf0e10cSrcweir	Applications(CurOffice,SBDOCCONVERT)  = ImportDialog.chkDocumentPath.State = 1
238cdf0e10cSrcweir	Applications(CurOffice,SBDOCRECURSIVE)  = ImportDialog.chkDocumentSearchSubDir.State = 1
239cdf0e10cSrcweir	Applications(CurOffice,SBDOCSOURCE)  = ConvertToURL(ImportDialog.txtDocumentImportPath.Text)
240cdf0e10cSrcweir	Applications(CurOffice,SBDOCTARGET) = ConvertToUrl(ImportDialog.txtDocumentExportPath.Text)
241cdf0e10cSrcweir    Applications(CurOffice,SBTEMPLCONVERT) = ImportDialog.chkTemplatePath.State = 1
242cdf0e10cSrcweir    Applications(CurOffice,SBTEMPLRECURSIVE) = ImportDialog.chkTemplateSearchSubDir.State = 1
243cdf0e10cSrcweir	Applications(CurOffice,SBTEMPLSOURCE) = ConvertToURL(ImportDialog.txtTemplateImportPath.Text)
244cdf0e10cSrcweir	Applications(CurOffice,SBTEMPLTARGET) = ConvertToURL(ImportDialog.txtTemplateExportPath.Text)
245cdf0e10cSrcweirEnd Sub
246cdf0e10cSrcweir
247cdf0e10cSrcweir
248cdf0e10cSrcweirSub ToggleInputPaths(aEvent as Object, Optional sDocType)
249cdf0e10cSrcweirDim bDoEnable as Boolean
250cdf0e10cSrcweirDim sLocDocType as String
251cdf0e10cSrcweirDim oCheckBox as Object
252cdf0e10cSrcweir	If Not IsNull(aEvent) Then
253cdf0e10cSrcweir		sLocDocType = aEvent.Source.Model.Tag
254cdf0e10cSrcweir	Else
255cdf0e10cSrcweir		sLocDocType = sDocType
256cdf0e10cSrcweir	End If
257cdf0e10cSrcweir	With ImportDialogArea
258cdf0e10cSrcweir		oCheckBox = .GetControl(&quot;chk&quot; &amp; sLocDocType &amp; &quot;Path&quot;).Model
259cdf0e10cSrcweir    	bDoEnable = oCheckBox.State = 1 And oCheckBox.Enabled
260cdf0e10cSrcweir		.GetControl(&quot;lbl&quot; &amp; sLocDocType &amp; &quot;Import&quot;).Model.Enabled = bDoEnable
261cdf0e10cSrcweir		.GetControl(&quot;lbl&quot; &amp; sLocDocType &amp; &quot;Export&quot;).Model.Enabled = bDoEnable
262cdf0e10cSrcweir		.GetControl(&quot;txt&quot; &amp; sLocDocType &amp; &quot;ImportPath&quot;).Model.Enabled = bDoEnable
263cdf0e10cSrcweir		.GetControl(&quot;txt&quot; &amp; sLocDocType &amp; &quot;ExportPath&quot;).Model.Enabled = bDoEnable
264cdf0e10cSrcweir		.GetControl(&quot;chk&quot; &amp; sLocDocType &amp; &quot;SearchSubDir&quot;).Model.Enabled = bDoEnable
265cdf0e10cSrcweir		.GetControl(&quot;cmd&quot; &amp; sLocDocType &amp; &quot;Import&quot;).Model.Enabled = bDoEnable
266cdf0e10cSrcweir		.GetControl(&quot;cmd&quot; &amp; sLocDocType &amp; &quot;Export&quot;).Model.Enabled = bDoEnable
267cdf0e10cSrcweir	End With
268cdf0e10cSrcweir	ToggleNextButton()
269cdf0e10cSrcweirEnd Sub
270cdf0e10cSrcweir
271cdf0e10cSrcweir
272cdf0e10cSrcweirFunction MakeSummaryString()
273cdf0e10cSrcweirDim sTmpText As String
274cdf0e10cSrcweirDim i as Integer
275cdf0e10cSrcweirDim Index as Integer
276cdf0e10cSrcweirDim sAddText as String
277cdf0e10cSrcweir	For i = 0 To ApplCount -1
278cdf0e10cSrcweir		Index = Applications(i,SBAPPLKEY)
279cdf0e10cSrcweir		GetFilterTracingLogPath(i, Index)
280cdf0e10cSrcweir		If 	Applications(i,SBTEMPLCONVERT) Then
281cdf0e10cSrcweir			&apos; Templates are to be converted
282cdf0e10cSrcweir			sAddText = &quot;&quot;
283cdf0e10cSrcweir			If WizardMode = SBMICROSOFTMODE Then
284cdf0e10cSrcweir				sAddText = sSumMSTemplates(Index) &amp; sCRLF
285cdf0e10cSrcweir			Else
286cdf0e10cSrcweir				sAddText = sSumSOTemplates(Index) &amp; sCRLF
287cdf0e10cSrcweir			End If
288cdf0e10cSrcweir			sTmpText = sTmpText &amp; sAddText &amp;  ConvertFromUrl(Applications(i,SBTEMPLSOURCE)) &amp; sCRLF
289cdf0e10cSrcweir			If Applications(i,SBTEMPLRECURSIVE) Then
290cdf0e10cSrcweir				&apos; Including Subdirectories
291cdf0e10cSrcweir				sTmpText = sTmpText &amp; sSumInclusiveSubDir &amp; sCRLF
292cdf0e10cSrcweir			End If
293cdf0e10cSrcweir			sTmpText = sTmpText &amp; sSumSaveDocuments &amp; sCRLF
294cdf0e10cSrcweir			sTmpText = sTmpText &amp; ConvertFromUrl(Applications(i,SBTEMPLTARGET)) &amp; sCRLF
295cdf0e10cSrcweir			sTmpText = sTmpText &amp; sCRLF
296cdf0e10cSrcweir		End If
297cdf0e10cSrcweir
298cdf0e10cSrcweir		If Applications(i,SBDOCCONVERT) Then
299cdf0e10cSrcweir			&apos; Documents are to be converted
300cdf0e10cSrcweir			If WizardMode = SBMICROSOFTMODE Then
301cdf0e10cSrcweir				sAddText = sSumMSDocuments(Index) &amp; sCRLF
302cdf0e10cSrcweir			Else
303cdf0e10cSrcweir				sAddText = sSumSODocuments(Index) &amp; sCRLF
304cdf0e10cSrcweir			End If
305cdf0e10cSrcweir			sTmpText = sTmpText &amp; sAddText &amp; ConvertFromUrl(Applications(i,SBDOCSOURCE)) &amp; sCRLF
306cdf0e10cSrcweir
307cdf0e10cSrcweir			If Applications(i,SBDOCRECURSIVE) Then
308cdf0e10cSrcweir				&apos; Including Subdirectories
309cdf0e10cSrcweir				sTmpText = sTmpText &amp; sSumInclusiveSubDir &amp; sCRLF
310cdf0e10cSrcweir			End If
311cdf0e10cSrcweir
312cdf0e10cSrcweir			sTmpText = sTmpText &amp; sSumSaveDocuments &amp; sCRLF
313cdf0e10cSrcweir			sTmpText = sTmpText &amp; ConvertFromUrl(Applications(i,SBDOCTARGET)) &amp; sCRLF
314cdf0e10cSrcweir			sTmpText = sTmpText &amp; sCRLF
315cdf0e10cSrcweir		End If
316cdf0e10cSrcweir	Next i
317cdf0e10cSrcweir	MakeSummaryString = sTmpText
318cdf0e10cSrcweirEnd Function
319cdf0e10cSrcweir
320cdf0e10cSrcweir
321cdf0e10cSrcweirSub FillStep_Summary()
322cdf0e10cSrcweir	ImportDialogArea.Title = sTitle
323cdf0e10cSrcweir	With ImportDialog
324cdf0e10cSrcweir		.SummaryTextbox.Text = MakeSummaryString()
325cdf0e10cSrcweir		.cmdGoOn.Enabled = .SummaryTextbox.Text &lt;&gt; &quot;&quot;
326cdf0e10cSrcweir		.cmdGoOn.Label = sBeginButton
327cdf0e10cSrcweir		.SummaryHeaderLabel.Label = sSummaryHeader
328cdf0e10cSrcweir		.Step = 3
329cdf0e10cSrcweir	End With
330cdf0e10cSrcweir	ImportDialogArea.GetControl(&quot;SummaryHeaderLabel&quot;).SetFocus()
331cdf0e10cSrcweirEnd Sub
332cdf0e10cSrcweir
333cdf0e10cSrcweir
334cdf0e10cSrcweirSub FillStep_Progress()
335cdf0e10cSrcweir	With ImportDialog
336cdf0e10cSrcweir		.cmdBack.Enabled = False
337cdf0e10cSrcweir		.cmdGoOn.Enabled = False
338cdf0e10cSrcweir	    .hlnProgress.Label = sProgressPage_1
339cdf0e10cSrcweir	    .LabelRetrieval.FontWeight = com.sun.star.awt.FontWeight.BOLD
340cdf0e10cSrcweir   	 	.LabelRetrieval.Label = sProgressPage_2
341cdf0e10cSrcweir   	 	.LabelCurProgress.Label = sProgressPage_3
342cdf0e10cSrcweir   	 	.LabelCurDocumentRetrieval.Label = &quot;&quot;
343cdf0e10cSrcweir   	 	.LabelCurTemplateRetrieval.Label = &quot;&quot;
344cdf0e10cSrcweir   		.LabelCurDocument.Label = &quot;&quot;
345cdf0e10cSrcweir		.Step = 4
346cdf0e10cSrcweir	End With
347cdf0e10cSrcweir	ImportDialogArea.GetControl(&quot;LabelRetrieval&quot;).SetFocus()
348cdf0e10cSrcweir	If ImportDialog.chkLogfile.State = 1 Then
349cdf0e10cSrcweir		ImportDialog.cmdShowLogFile.DefaultButton = True
350cdf0e10cSrcweir	End If
351cdf0e10cSrcweirEnd Sub
352cdf0e10cSrcweir
353cdf0e10cSrcweir
354cdf0e10cSrcweirSub GetFilterTracingLogPath(i as Integer, Index as Integer)
355cdf0e10cSrcweirDim aNodePath(0) as new com.sun.star.beans.PropertyValue
356cdf0e10cSrcweirDim oMasterKey
357cdf0e10cSrcweirDim oImportKey
358cdf0e10cSrcweirDim oWordKey
359cdf0e10cSrcweirDim oExcelkey
360cdf0e10cSrcweirDim oPowerpointKey
361cdf0e10cSrcweirDim oFilterService
362cdf0e10cSrcweir	aNodePath(0).Name = &quot;nodepath&quot;
363cdf0e10cSrcweir	aNodePath(0).Value = &quot;org.openoffice.Office.Tracing&quot;
364cdf0e10cSrcweir	oFilterService = createUnoService(&quot;com.sun.star.util.FilterTracer&quot;)
365cdf0e10cSrcweir	bFilterTracingAvailable = Not IsNull(oFilterService)
366cdf0e10cSrcweir	If bFilterTracingAvailable Then
367cdf0e10cSrcweir		oMasterkey = GetRegistryKeyContent(&quot;org.openoffice.Office.Tracing/&quot;)
368cdf0e10cSrcweir		If oMasterKey.hasbyName(&quot;Import&quot;) Then
369cdf0e10cSrcweir			oImportKey = GetRegistryKeyContent(&quot;org.openoffice.Office.Tracing/Import&quot;)
370cdf0e10cSrcweir			bMSApplFilterTracingAvailable(i) = CheckMSImportAvailability(oImportkey, MSFiltername(Index, 4), FilterTracingLogPath(i), bTakeOverTargetName(i), bTakeOverPathName(i))
371cdf0e10cSrcweir		End If
372cdf0e10cSrcweir	End If
373cdf0e10cSrcweirEnd Sub
374cdf0e10cSrcweir
375cdf0e10cSrcweir
376cdf0e10cSrcweirFunction CheckMSImportAvailability(oImportkey, MSApplName as String, MSLogPath as String, bTakeOverTargetname as String, bTakeOverpathName as String) as Boolean
377cdf0e10cSrcweirDim bApplIsAvailable as Boolean
378cdf0e10cSrcweirDim oApplKey
379cdf0e10cSrcweirDim LocApplName as String
380cdf0e10cSrcweirDim LocApplPath as String
381cdf0e10cSrcweir	bApplIsAvailable = oImportKey.hasbyName(MSApplName)
382cdf0e10cSrcweir	If bApplIsAvailable Then
383cdf0e10cSrcweir		oApplKey = oImportKey.getByName(MSApplName)
384cdf0e10cSrcweir		bApplIsAvailable = oApplKey.On
385cdf0e10cSrcweir		LocApplName = oApplKey.Name
386cdf0e10cSrcweir		LocApplPath = oApplKey.Path
387cdf0e10cSrcweir		bTakeOverTargetName = (LocApplName = &quot;&quot;)
388cdf0e10cSrcweir		bTakeOverPathName = (LocApplPath = &quot;&quot;)
389cdf0e10cSrcweir		MSLogPath = LocApplPath &amp; &quot;/&quot; &amp; LocApplName &amp; &quot;.log&quot;
390cdf0e10cSrcweir	End If
391cdf0e10cSrcweir	CheckMSImportAvailability() = bApplIsAvailable
392cdf0e10cSrcweirEnd Function
393cdf0e10cSrcweir
394cdf0e10cSrcweir
395cdf0e10cSrcweir
396cdf0e10cSrcweirSub	SetupMSConfiguration()
397cdf0e10cSrcweir	iApplSection = 0
398cdf0e10cSrcweir	Wizardmode = SBMICROSOFTMODE
399cdf0e10cSrcweir	MaxApplCount = 3
400cdf0e10cSrcweir	ApplCount = 3
401cdf0e10cSrcweir	&apos; chkTemplatePath-Captions
402cdf0e10cSrcweir	GetApplResourceArray(1009 + iApplSection, ApplCount, sTemplateCheckBox())
403cdf0e10cSrcweir	&apos; DocumentCheckbox- Captions
404cdf0e10cSrcweir	GetApplResourceArray(1009 + iApplSection + ApplCount, ApplCount, sDocumentCheckBox())
405cdf0e10cSrcweir
406cdf0e10cSrcweir	sKeyName(0) = &quot;Software\Microsoft\Office\8.0\Word\Options&quot;
407cdf0e10cSrcweir	sKeyName(1) = &quot;Software\Microsoft\Office\8.0\Excel\Microsoft Excel&quot;
408cdf0e10cSrcweir	sKeyName(2) = &quot;Software\Microsoft\Office\8.0\PowerPoint\Recent Folder List\Default&quot;
409cdf0e10cSrcweir
410cdf0e10cSrcweir	sValueName(0) = &quot;DOC-PATH&quot;
411cdf0e10cSrcweir	sValueName(1) = &quot;DefaultPath&quot;
412cdf0e10cSrcweir	sValueName(2) = &quot;&quot;
413cdf0e10cSrcweir
414cdf0e10cSrcweir&apos; See definition of Filtername-Array about meaning of fields
415*bc0b50ddSTsutomu Uchino	MSFilterName(0,0) = &quot;doc|docx|docm&quot;
416*bc0b50ddSTsutomu Uchino	MSFilterName(0,1) = &quot;writer8|writer8|writer8&quot;
417*bc0b50ddSTsutomu Uchino	MSFilterName(0,2) = &quot;odt|odt|odt&quot;
418cdf0e10cSrcweir	MSFilterName(0,3) = sMSDocumentCheckBox(0)
419cdf0e10cSrcweir	MSFilterName(0,4) = &quot;Word&quot;
420cdf0e10cSrcweir
421cdf0e10cSrcweir
422*bc0b50ddSTsutomu Uchino	MSFilterName(1,0) = &quot;xls|xlsx|xlsm&quot;
423*bc0b50ddSTsutomu Uchino	MSFilterName(1,1) = &quot;calc8|calc8|calc8&quot;
424*bc0b50ddSTsutomu Uchino	MSFilterName(1,2) = &quot;ods|ods|ods&quot;
425cdf0e10cSrcweir	MSFilterName(1,3) = sMSDocumentCheckBox(1)
426cdf0e10cSrcweir	MSFilterName(1,4) = &quot;Excel&quot;
427cdf0e10cSrcweir
428*bc0b50ddSTsutomu Uchino	MSFilterName(2,0) = &quot;ppt|pps|pptx|pptm&quot;
429*bc0b50ddSTsutomu Uchino	MSFilterName(2,1) = &quot;impress8|impress8|impress8|impress8&quot;
430*bc0b50ddSTsutomu Uchino	MSFilterName(2,2) = &quot;odp|odp|odp|odp&quot;
431cdf0e10cSrcweir	MSFilterName(2,3) = sMSDocumentCheckBox(2)
432cdf0e10cSrcweir	MSFilterName(2,4) = &quot;PowerPoint&quot;
433cdf0e10cSrcweir
434*bc0b50ddSTsutomu Uchino	MSFilterName(3,0) = &quot;dot|dotx|dotm&quot;
435*bc0b50ddSTsutomu Uchino	MSFilterName(3,1) = &quot;writer8_template|writer8_template|writer8_template&quot;
436*bc0b50ddSTsutomu Uchino	MSFilterName(3,2) = &quot;ott|ott|ott&quot;
437cdf0e10cSrcweir	MSFilterName(3,3) = sMSTemplateCheckBox(0)
438cdf0e10cSrcweir	MSFilterName(3,4) = &quot;Word&quot;
439cdf0e10cSrcweir
440*bc0b50ddSTsutomu Uchino	MSFilterName(4,0) = &quot;xlt|xltx|xltm&quot;
441*bc0b50ddSTsutomu Uchino	MSFilterName(4,1) = &quot;calc8_template|calc8_template|calc8_template&quot;
442*bc0b50ddSTsutomu Uchino	MSFilterName(4,2) = &quot;ots|ots|ots&quot;
443cdf0e10cSrcweir	MSFilterName(4,3) = sMSTemplateCheckBox(1)
444cdf0e10cSrcweir	MSFilterName(4,4) = &quot;Excel&quot;
445cdf0e10cSrcweir
446*bc0b50ddSTsutomu Uchino	MSFilterName(5,0) = &quot;pot|potx|potm&quot;
447*bc0b50ddSTsutomu Uchino	MSFilterName(5,1) = &quot;impress8_template|impress8_template|impress8_template&quot;
448*bc0b50ddSTsutomu Uchino	MSFilterName(5,2) = &quot;otp|otp|otp&quot;
449cdf0e10cSrcweir	MSFilterName(5,3) = sMSTemplateCheckBox(2)
450cdf0e10cSrcweir	MSFilterName(5,4) = &quot;PowerPoint&quot;
451cdf0e10cSrcweirEnd Sub
452cdf0e10cSrcweir
453cdf0e10cSrcweir
454cdf0e10cSrcweir
455cdf0e10cSrcweir&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;
456cdf0e10cSrcweir&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;
457cdf0e10cSrcweir
458cdf0e10cSrcweir&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 ) },
459cdf0e10cSrcweir&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 ) },
460cdf0e10cSrcweir&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 ) },
461cdf0e10cSrcweir
462cdf0e10cSrcweir&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 ) },
463cdf0e10cSrcweir&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 ) },
464cdf0e10cSrcweir
465cdf0e10cSrcweir&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 ) },
466cdf0e10cSrcweir&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 ) },
467cdf0e10cSrcweir
468cdf0e10cSrcweir&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 ) },
469cdf0e10cSrcweir&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 ) },
470cdf0e10cSrcweir&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 ) },
471cdf0e10cSrcweir
472cdf0e10cSrcweir&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 ) },
473cdf0e10cSrcweir
474cdf0e10cSrcweir&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 ) },
475cdf0e10cSrcweir&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 ) },
476cdf0e10cSrcweir&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 ) },
477cdf0e10cSrcweir
478cdf0e10cSrcweir&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 ) },
479cdf0e10cSrcweir&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 ) },
480cdf0e10cSrcweir&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 ) },
481cdf0e10cSrcweir
482cdf0e10cSrcweir&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 ) },
483cdf0e10cSrcweir&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 ) },
484cdf0e10cSrcweir&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 ) },
485cdf0e10cSrcweir
486cdf0e10cSrcweir
487cdf0e10cSrcweirSub SetupXMLConfiguration()
488cdf0e10cSrcweir	iApplSection = 1000
489cdf0e10cSrcweir	Wizardmode = SBXMLMODE
490cdf0e10cSrcweir	ApplCount = 4
491cdf0e10cSrcweir	MaxApplCount = 4
492cdf0e10cSrcweir	XMLTemplateList = Array(&quot;vor&quot;, &quot;sti&quot;, &quot;stw&quot; , &quot;stc&quot; , &quot;std&quot;)
493cdf0e10cSrcweir	&apos; chkTemplatePath-Captions
494cdf0e10cSrcweir	GetApplResourceArray(1009 + iApplSection, ApplCount, sTemplateCheckBox())
495cdf0e10cSrcweir	&apos; DocumentCheckbox- Captions
496cdf0e10cSrcweir	GetApplResourceArray(1009 + iApplSection + ApplCount, ApplCount, sDocumentCheckBox())
497cdf0e10cSrcweir
498cdf0e10cSrcweir	XMLFilterName(0,0) = &quot;sdw|sxw&quot;
499cdf0e10cSrcweir	XMLFilterName(0,1) = &quot;writer8|writer8&quot;
500cdf0e10cSrcweir	XMLFilterName(0,2) = &quot;odt|odt&quot;
501cdf0e10cSrcweir	XMLFilterName(0,3) = sDocumentCheckBox(0)
502cdf0e10cSrcweir
503cdf0e10cSrcweir	XMLFilterName(1,0) = &quot;sdc|sxc&quot;
504cdf0e10cSrcweir	XMLFilterName(1,1) = &quot;calc8|calc8&quot;
505cdf0e10cSrcweir	XMLFilterName(1,2) = &quot;ods|ods&quot;
506cdf0e10cSrcweir	XMLFilterName(1,3) = sDocumentCheckBox(1)
507cdf0e10cSrcweir
508cdf0e10cSrcweir	If oFactoryKey.HasByName(&quot;com.sun.star.drawing.DrawingDocument&quot;) and oFactoryKey.HasByName(&quot;com.sun.star.presentation.PresentationDocument&quot;) Then
509cdf0e10cSrcweir		XMLFilterName(2,0) = &quot;sdd|sda|sxi|sxd&quot;
510cdf0e10cSrcweir		XMLFilterName(2,1) = &quot;impress8|draw8|impress8|draw8&quot;
511cdf0e10cSrcweir		XMLFilterName(2,2) = &quot;odp|odg|odp|odg&quot;
512cdf0e10cSrcweir	Elseif oFactoryKey.HasByName(&quot;com.sun.star.drawing.DrawingDocument&quot;) Then
513cdf0e10cSrcweir		XMLFilterName(2,0) = &quot;sda|sxd&quot;
514cdf0e10cSrcweir		XMLFilterName(2,1) = &quot;draw8|draw8&quot;
515cdf0e10cSrcweir		XMLFilterName(2,2) = &quot;odg|odg&quot;
516cdf0e10cSrcweir	Elseif oFactoryKey.HasByName(&quot;com.sun.star.presentation.PresentationDocument&quot;) Then
517cdf0e10cSrcweir		XMLFilterName(2,0) = &quot;sdd|sxi&quot;
518cdf0e10cSrcweir		XMLFilterName(2,1) = &quot;impress8|impress8&quot;
519cdf0e10cSrcweir		XMLFilterName(2,2) = &quot;odp|odp&quot;
520cdf0e10cSrcweir	End If
521cdf0e10cSrcweir	XMLFilterName(2,3) = sDocumentCheckBox(2)
522cdf0e10cSrcweir
523cdf0e10cSrcweir
524cdf0e10cSrcweir	XMLFilterName(3,0) = &quot;smf|sxm&quot;
525cdf0e10cSrcweir	XMLFilterName(3,1) = &quot;math8|math8&quot;
526cdf0e10cSrcweir	XMLFilterName(3,2) = &quot;odf|odf&quot;
527cdf0e10cSrcweir	XMLFilterName(3,3) = sDocumentCheckBox(3)
528cdf0e10cSrcweir
529cdf0e10cSrcweir	XMLFilterName(4,0) = &quot;application/x-openoffice-starwriter|application/vnd.stardivision.writer/web|application/vnd.sun.xml.writer|application/vnd.sun.xml.writerweb&quot;
530cdf0e10cSrcweir	XMLFilterName(4,1) = &quot;writer8_template|writerweb8_writer_template|writer8_template|writerweb8_writer_template&quot;
531cdf0e10cSrcweir	XMLFilterName(4,2) = &quot;ott|oth|ott|oth&quot;
532cdf0e10cSrcweir	XMLFilterName(4,3) = sTemplateCheckBox(0)
533cdf0e10cSrcweir
534cdf0e10cSrcweir
535cdf0e10cSrcweir	XMLFilterName(5,0) = &quot;application/x-openoffice-starcalc|application/vnd.sun.xml.calc&quot;
536cdf0e10cSrcweir	XMLFilterName(5,1) = &quot;calc8_template|calc8_template&quot;
537cdf0e10cSrcweir	XMLFilterName(5,2) = &quot;ots|ots&quot;
538cdf0e10cSrcweir	XMLFilterName(5,3) = sTemplateCheckBox(1)
539cdf0e10cSrcweir
540cdf0e10cSrcweir	&apos; due to bug #108942# impress templates of the version 4.0 have to be handled in a special way because their mimetype
541cdf0e10cSrcweir	&apos; falsely points to the draw application.
542cdf0e10cSrcweir	If oFactoryKey.HasByName(&quot;com.sun.star.drawing.DrawingDocument&quot;) and  oFactoryKey.HasByName(&quot;com.sun.star.presentation.PresentationDocument&quot;) Then
543cdf0e10cSrcweir		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;
544cdf0e10cSrcweir		XMLFilterName(6,1) = &quot;impress8_template|impress8_template|draw8_template|impress8_template|draw8_template&quot;
545cdf0e10cSrcweir		XMLFilterName(6,2) = &quot;otp|otp|otg|otp|otg&quot;
546cdf0e10cSrcweir	Elseif oFactoryKey.HasByName(&quot;com.sun.star.drawing.DrawingDocument&quot;) Then
547cdf0e10cSrcweir		XMLFilterName(6,0) = &quot;application/x-openoffice-stardraw|application/vnd.sun.xml.draw&quot;
548cdf0e10cSrcweir		XMLFilterName(6,1) = &quot;draw8_template|draw8_template&quot;
549cdf0e10cSrcweir		XMLFilterName(6,2) = &quot;otg|otg&quot;
550cdf0e10cSrcweir	Elseif oFactoryKey.HasByName(&quot;com.sun.star.presentation.PresentationDocument&quot;) Then
551cdf0e10cSrcweir		XMLFilterName(6,0) = &quot;application/x-openoffice-starimpress|application/x-openoffice-stardraw-40|application/vnd.sun.xml.impress&quot;
552cdf0e10cSrcweir		XMLFilterName(6,1) = &quot;impress8_template|impress8_template|impress8_template&quot;
553cdf0e10cSrcweir		XMLFilterName(6,2) = &quot;otp|otp|otp&quot;
554cdf0e10cSrcweir	End If
555cdf0e10cSrcweir	XMLFilterName(6,3) = sTemplateCheckBox(2)
556cdf0e10cSrcweir
557cdf0e10cSrcweir	If oFactoryKey.HasByName(&quot;com.sun.star.text.GlobalDocument&quot;) Then
558cdf0e10cSrcweir		XMLFilterName(7,0) = &quot;sgl|sxg&quot;
559cdf0e10cSrcweir		XMLFilterName(7,1) = &quot;writerglobal8|writerglobal8&quot;
560cdf0e10cSrcweir		XMLFilterName(7,2) = &quot;odm|odm&quot;
561cdf0e10cSrcweir		XMLFilterName(7,3) = sTemplateCheckBox(3)
562cdf0e10cSrcweir	End If
563cdf0e10cSrcweirEnd Sub
564cdf0e10cSrcweir
565cdf0e10cSrcweir
566cdf0e10cSrcweirFunction CheckControlPath(oCheckbox as Object, oTextBox as Object, ByVal bDoEnable as Boolean)
567cdf0e10cSrcweirDim sPath as String
568cdf0e10cSrcweir	If Not bDoEnable Then
569cdf0e10cSrcweir		CheckControlPath = False
570cdf0e10cSrcweir	ElseIf oCheckbox.State = 0 Then
571cdf0e10cSrcweir		CheckControlPath = True
572cdf0e10cSrcweir	Else
573cdf0e10cSrcweir		sPath = ConvertToUrl(Trim(oTextBox.Text)
574cdf0e10cSrcweir		CheckControlPath = oUcb.Exists(sPath)
575cdf0e10cSrcweir	End If
576cdf0e10cSrcweirEnd Function
577cdf0e10cSrcweir
578cdf0e10cSrcweir
579cdf0e10cSrcweirFunction CheckInputPaths() as Boolean
580cdf0e10cSrcweirDim bChangePage as Boolean
581cdf0e10cSrcweir	bChangePage = CheckTextBoxPath(ImportDialog.txtTemplateImportPath, True, False, sTitle, False)
582cdf0e10cSrcweir	bChangePage = CheckTextBoxPath(ImportDialog.txtTemplateExportPath, bChangePage, True, sTitle, False)
583cdf0e10cSrcweir	bChangePage = CheckTextBoxPath(ImportDialog.txtDocumentImportPath, bChangePage, False, sTitle, False)
584cdf0e10cSrcweir	bChangePage = CheckTextBoxPath(ImportDialog.txtDocumentExportPath, bChangePage, True, sTitle, False)
585cdf0e10cSrcweir	CheckInputPaths = bChangePage
586cdf0e10cSrcweirEnd Function
587cdf0e10cSrcweir
588cdf0e10cSrcweir
589cdf0e10cSrcweirFunction CheckTextBoxPath(oTextBox as Object, ByVal bCheck as Boolean, bCreateNew as Boolean, sTitle as String, bgetResources as Boolean) as Boolean
590cdf0e10cSrcweirDim iCreate as Integer
591cdf0e10cSrcweirDim sQueryMessage as String
592cdf0e10cSrcweirDim sUrlPath as String
593cdf0e10cSrcweirDim sMessageNoDir as String
594cdf0e10cSrcweirDim sShowPath as String
595cdf0e10cSrcweirDim oLocUcb as Object
596cdf0e10cSrcweir	oLocUcb = createUnoService(&quot;com.sun.star.ucb.SimpleFileAccess&quot;)
597cdf0e10cSrcweir	If bGetResources Then
598cdf0e10cSrcweir		If InitResources(&quot;ImportWizard&quot;,&quot;imp&quot;) then
599cdf0e10cSrcweir 			sNoDirCreation = GetResText(1050)
600cdf0e10cSrcweir			sMsgDirNotThere = GetResText(1051)
601cdf0e10cSrcweir			sQueryForNewCreation = GetResText(1052)
602cdf0e10cSrcweir		Else
603cdf0e10cSrcweir			CheckTextBoxPath() = False
604cdf0e10cSrcweir			Exit Function
605cdf0e10cSrcweir		End If
606cdf0e10cSrcweir	End If
607cdf0e10cSrcweir	If oTextBox.Enabled Then
608cdf0e10cSrcweir		If bCheck Then
609cdf0e10cSrcweir			sShowPath = oTextBox.Text
610cdf0e10cSrcweir			sUrlPath = ConvertToUrl(sShowPath)
611cdf0e10cSrcweir			If Not oLocUcb.Exists(sUrlPath) Then
612cdf0e10cSrcweir				If Not bCreateNew Then
613cdf0e10cSrcweir					&apos; Sourcedirectories must be existing, Targetdirectories may be created new
614cdf0e10cSrcweir					sQueryMessage = ReplaceString(sMsgDirNotThere, sShowPath,&quot;%1&quot;)
615cdf0e10cSrcweir					Msgbox(sQueryMessage,16,sTitle)
616cdf0e10cSrcweir					CheckTextBoxPath() = False
617cdf0e10cSrcweir					Exit Function
618cdf0e10cSrcweir				Else
619cdf0e10cSrcweir					sQueryMessage = ReplaceString(sMsgDirNotThere, sShowPath,&quot;%1&quot;)
620cdf0e10cSrcweir					sQueryMessage = sQueryMessage &amp; Chr(13) &amp; sQueryForNewCreation
621cdf0e10cSrcweir					iCreate = Msgbox (sQueryMessage, 36, sTitle)
622cdf0e10cSrcweir					If iCreate = 6 Then
623cdf0e10cSrcweir						On Local Error Goto NOVALIDPATH
624cdf0e10cSrcweir						CreateFolder(sUrlPath)
625cdf0e10cSrcweir						If Not oLocUcb.Exists(sUrlPath) Then
626cdf0e10cSrcweir							Goto NOVALIDPATH
627cdf0e10cSrcweir						End If
628cdf0e10cSrcweir					Else
629cdf0e10cSrcweir						CheckTextBoxPath() = False
630cdf0e10cSrcweir						Exit Function
631cdf0e10cSrcweir					End If
632cdf0e10cSrcweir				End If
633cdf0e10cSrcweir			End If
634cdf0e10cSrcweir			CheckTextBoxPath() = True
635cdf0e10cSrcweir		Else
636cdf0e10cSrcweir			CheckTextBoxPath() = False
637cdf0e10cSrcweir		End If
638cdf0e10cSrcweir	Else
639cdf0e10cSrcweir		CheckTextBoxPath() = True
640cdf0e10cSrcweir	End If
641cdf0e10cSrcweir	Exit Function
642cdf0e10cSrcweirNOVALIDPATH:
643cdf0e10cSrcweir	sMessageNoDir = ReplaceString(sNoDirCreation, sShowPath, &quot;%1&quot;)
644cdf0e10cSrcweir	Msgbox(sMessageNoDir, 16, sTitle)
645cdf0e10cSrcweir	CheckTextBoxPath() = False
646cdf0e10cSrcweirEnd Function
647cdf0e10cSrcweir
648cdf0e10cSrcweir
649cdf0e10cSrcweirSub InitializeProgressPage(oDialog as Object)
650cdf0e10cSrcweir  oDialog.LabelRetrieval.FontWeight = com.sun.star.awt.FontWeight.NORMAL
651cdf0e10cSrcweir  oDialog.LabelCurProgress.FontWeight = com.sun.star.awt.FontWeight.BOLD
652cdf0e10cSrcweirEnd Sub
653cdf0e10cSrcweir
654cdf0e10cSrcweir
655cdf0e10cSrcweirSub	SetProgressDisplay(AbsFound as Integer)
656cdf0e10cSrcweir	ImportDialog.LabelRetrieval.Label = sProgressPage_2 &amp;  &quot;  &quot; &amp; ReplaceString(sProgressPage_5, Str(AbsFound) &amp; &quot; &quot;, &quot;%1&quot;)
657cdf0e10cSrcweir	ImportDialog.LabelCurDocumentRetrieval.Label =  sProgressFound &amp; &quot; &quot; &amp; CStr(AbsDocuFound) &amp;  &quot; &quot; &amp; sProgressMoreDocs
658cdf0e10cSrcweir	ImportDialog.LabelCurTemplateRetrieval.Label = sProgressFound &amp; &quot; &quot; &amp; CStr(AbsTemplateFound) &amp; &quot; &quot; &amp; sProgressMoreTemplates
659cdf0e10cSrcweirEnd Sub
660cdf0e10cSrcweir
661cdf0e10cSrcweirSub TakoverFolderName(aEvent as Object)
662cdf0e10cSrcweirDim RefControlName as String
663cdf0e10cSrcweirDim oRefControl
664cdf0e10cSrcweir	RefControlName = aEvent.Source.Model.Tag
665cdf0e10cSrcweir	oRefControl = ImportDialogArea.GetControl(RefControlName)
666cdf0e10cSrcweir	GetFolderName(oRefControl.Model)
667cdf0e10cSrcweir	ToggleNextButton()
668cdf0e10cSrcweirEnd Sub
669cdf0e10cSrcweir
670cdf0e10cSrcweir
671cdf0e10cSrcweirSub FinalizeDialogButtons()
672cdf0e10cSrcweir	ImportDialog.cmdShowLogFile.Enabled = ((Isnull(oLogDocument) = False) And (ImportDialog.chkLogfile.State = 1))
673cdf0e10cSrcweir	ImportDialog.cmdCancel.Enabled = False
674cdf0e10cSrcweir	ImportDialog.cmdGoOn.Label = sCloseButton
675cdf0e10cSrcweir	ImportDialog.cmdGoOn.Enabled = True
676cdf0e10cSrcweirEnd Sub
6773e02b54dSAndrew Rist</script:module>
678