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