mirror of
https://github.com/kekingcn/kkFileView.git
synced 2026-04-19 21:18:37 +00:00
集成OpenOffice替换为LibreOffice
This commit is contained in:
@@ -1,25 +1,22 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
|
||||
<!--***********************************************************
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one
|
||||
* or more contributor license agreements. See the NOTICE file
|
||||
* distributed with this work for additional information
|
||||
* regarding copyright ownership. The ASF licenses this file
|
||||
* to you under the Apache License, Version 2.0 (the
|
||||
* "License"); you may not use this file except in compliance
|
||||
* with the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing,
|
||||
* software distributed under the License is distributed on an
|
||||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
||||
* KIND, either express or implied. See the License for the
|
||||
* specific language governing permissions and limitations
|
||||
* under the License.
|
||||
*
|
||||
***********************************************************-->
|
||||
<!--
|
||||
* This file is part of the LibreOffice project.
|
||||
*
|
||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* This file incorporates work covered by the following license notice:
|
||||
*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed
|
||||
* with this work for additional information regarding copyright
|
||||
* ownership. The ASF licenses this file to you under the Apache
|
||||
* License, Version 2.0 (the "License"); you may not use this file
|
||||
* except in compliance with the License. You may obtain a copy of
|
||||
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
||||
-->
|
||||
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="DialogModul" script:language="StarBasic">Option Explicit
|
||||
|
||||
Public Const bDebugWizard = True
|
||||
@@ -28,13 +25,11 @@ 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 = "MS"
|
||||
Public Const SBXMLMODE = "SO"
|
||||
' The absolute maximal Number of possible Applications
|
||||
Public Const Twip = 425
|
||||
Public Const SBMAXAPPLCOUNT = 4
|
||||
Public Const Twip = 425
|
||||
Public MaxApplCount as Integer
|
||||
Public CurOffice As Integer
|
||||
Public SOBitmapPath As String
|
||||
@@ -42,7 +37,6 @@ 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
|
||||
|
||||
@@ -51,16 +45,6 @@ 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 'Number of different formats
|
||||
Public FilterTracingLogPath(2) as String
|
||||
Public bMSApplFilterTracingAvailable(2) as String
|
||||
Public bTakeOverTargetName(2) as Boolean
|
||||
Public bTakeOverPathName(2) as Boolean
|
||||
|
||||
' e.g.:
|
||||
' XMLFilterName(x,0) = "sdw" ' in documents we take the extensions; in SO-templates the appropriate Filtername
|
||||
' XMLFilterName(x,1) = "swriter: StarWriter 5.0" ' the filtername of the target-format
|
||||
' XMLFilterName(x,2) = "sxw" ' the target extension
|
||||
|
||||
Public Applications(SBMAXAPPLCOUNT-1,9)
|
||||
|
||||
@@ -89,8 +73,6 @@ Public XMLTemplateList()
|
||||
' Applications(X,8) = "File:///..." (TargetUrl of the templates)
|
||||
' Applications(X,9) = 0 (Key to the original Index of the Applications)
|
||||
|
||||
Public Const SBMAXEXTENSIONLENGTH = 17
|
||||
|
||||
|
||||
Sub FillStep_Welcome()
|
||||
Dim i as Integer
|
||||
@@ -102,7 +84,6 @@ Dim i as Integer
|
||||
.cmdBack.Label = sBackButton
|
||||
.cmdGoOn.Label = sNextButton
|
||||
.WelcomeTextLabel.Label = sWelcomeTextLabel1
|
||||
.WelcomeTextLabel2.Label = sWelcomeTextLabel2
|
||||
.WelcomeTextLabel3.Label = sWelcomeTextLabel3
|
||||
|
||||
.optMSDocuments.Label = sContainerName(0)
|
||||
@@ -110,11 +91,6 @@ Dim i as Integer
|
||||
.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
|
||||
|
||||
@@ -135,7 +111,7 @@ Dim oNullObject as Object
|
||||
If ImportDialog.optMSDocuments.State = 1 Then
|
||||
SetupMSConfiguration()
|
||||
Else
|
||||
SetupXMLConfiguration()
|
||||
'Not supposed to happen - is there an assert in BASIC...
|
||||
End If
|
||||
FillUpApplicationList()
|
||||
End If
|
||||
@@ -149,25 +125,14 @@ Dim oNullObject as Object
|
||||
.txtDocumentImportPath.Text = ConvertFromUrl(Applications(CurOffice,SBDOCSOURCE))
|
||||
.txtDocumentExportPath.Text = ConvertFromUrl(Applications(CurOffice,SBDOCTARGET))
|
||||
.hlnDocuments.Label = sProgressMoreDocs
|
||||
If WizardMode = SBXMLMODE Then
|
||||
ImportDialogArea.Title = sTitle & " - " & sSODocumentCheckBox(Index)
|
||||
Else
|
||||
If WizardMode = SBMICROSOFTMODE Then
|
||||
ImportDialogArea.Title = sTitle & " - " & sMSDocumentCheckBox(Index)
|
||||
End If
|
||||
If WizardMode = SBXMLMODE AND Index = 3 Then
|
||||
' 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.Enabled = True
|
||||
.chkDocumentPath.Enabled = True
|
||||
.chkTemplatePath.Label = sTemplateCheckbox(Index)
|
||||
.chkDocumentPath.Label = sDocumentCheckbox(Index)
|
||||
.hlnTemplates.Label = sProgressMoreTemplates
|
||||
.chkTemplatePath.State = Abs(Applications(CurOffice,SBTEMPLCONVERT))
|
||||
ToggleInputPaths(oNullObject,"Template")
|
||||
ToggleInputPaths(oNullObject,"Document")
|
||||
@@ -192,8 +157,6 @@ Dim BoolValue as Boolean
|
||||
For i = 1 To ApplCount
|
||||
If ImportDialog.optMSDocuments.State = 1 Then
|
||||
BoolValue = ImportDialogArea.GetControl("chkMSApplication" & i).Model.State = 1
|
||||
Else
|
||||
BoolValue = ImportDialogArea.GetControl("chkSOApplication" & i).Model.State = 1
|
||||
End If
|
||||
Applications(a,SBAPPLCONVERT) = BoolValue
|
||||
Applications(a,SBDOCCONVERT) = BoolValue
|
||||
@@ -276,14 +239,11 @@ 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
|
||||
' Templates are to be converted
|
||||
sAddText = ""
|
||||
If WizardMode = SBMICROSOFTMODE Then
|
||||
sAddText = sSumMSTemplates(Index) & sCRLF
|
||||
Else
|
||||
sAddText = sSumSOTemplates(Index) & sCRLF
|
||||
End If
|
||||
sTmpText = sTmpText & sAddText & ConvertFromUrl(Applications(i,SBTEMPLSOURCE)) & sCRLF
|
||||
If Applications(i,SBTEMPLRECURSIVE) Then
|
||||
@@ -299,8 +259,6 @@ Dim sAddText as String
|
||||
' Documents are to be converted
|
||||
If WizardMode = SBMICROSOFTMODE Then
|
||||
sAddText = sSumMSDocuments(Index) & sCRLF
|
||||
Else
|
||||
sAddText = sSumSODocuments(Index) & sCRLF
|
||||
End If
|
||||
sTmpText = sTmpText & sAddText & ConvertFromUrl(Applications(i,SBDOCSOURCE)) & sCRLF
|
||||
|
||||
@@ -351,57 +309,18 @@ Sub FillStep_Progress()
|
||||
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 = "nodepath"
|
||||
aNodePath(0).Value = "org.openoffice.Office.Tracing"
|
||||
oFilterService = createUnoService("com.sun.star.util.FilterTracer")
|
||||
bFilterTracingAvailable = Not IsNull(oFilterService)
|
||||
If bFilterTracingAvailable Then
|
||||
oMasterkey = GetRegistryKeyContent("org.openoffice.Office.Tracing/")
|
||||
If oMasterKey.hasbyName("Import") Then
|
||||
oImportKey = GetRegistryKeyContent("org.openoffice.Office.Tracing/Import")
|
||||
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 = "")
|
||||
bTakeOverPathName = (LocApplPath = "")
|
||||
MSLogPath = LocApplPath & "/" & LocApplName & ".log"
|
||||
End If
|
||||
CheckMSImportAvailability() = bApplIsAvailable
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
Sub SetupMSConfiguration()
|
||||
iApplSection = 0
|
||||
Wizardmode = SBMICROSOFTMODE
|
||||
MaxApplCount = 3
|
||||
ApplCount = 3
|
||||
' chkTemplatePath-Captions
|
||||
GetApplResourceArray(1009 + iApplSection, ApplCount, sTemplateCheckBox())
|
||||
sTemplateCheckBox(0) = GetResText("MSTemplateCheckbox_1_")
|
||||
sTemplateCheckBox(1) = GetResText("MSTemplateCheckbox_2_")
|
||||
sTemplateCheckBox(2) = GetResText("MSTemplateCheckbox_3_")
|
||||
' DocumentCheckbox- Captions
|
||||
GetApplResourceArray(1009 + iApplSection + ApplCount, ApplCount, sDocumentCheckBox())
|
||||
sDocumentCheckBox(0) = GetResText("MSDocumentCheckbox_1_")
|
||||
sDocumentCheckBox(1) = GetResText("MSDocumentCheckbox_2_")
|
||||
sDocumentCheckBox(2) = GetResText("MSDocumentCheckbox_3_")
|
||||
|
||||
sKeyName(0) = "Software\Microsoft\Office\8.0\Word\Options"
|
||||
sKeyName(1) = "Software\Microsoft\Office\8.0\Excel\Microsoft Excel"
|
||||
@@ -425,11 +344,11 @@ Sub SetupMSConfiguration()
|
||||
MSFilterName(1,3) = sMSDocumentCheckBox(1)
|
||||
MSFilterName(1,4) = "Excel"
|
||||
|
||||
MSFilterName(2,0) = "ppt|pps|pptx|pptm"
|
||||
MSFilterName(2,1) = "impress8|impress8|impress8|impress8"
|
||||
MSFilterName(2,2) = "odp|odp|odp|odp"
|
||||
MSFilterName(2,0) = "ppt|pps|pptx|pub|pptm|ppsx|ppsm"
|
||||
MSFilterName(2,1) = "impress8|impress8|impress8|impress8|impress8|impress8|impress8"
|
||||
MSFilterName(2,2) = "odp|odp|odp|odp|odp|odp|odp"
|
||||
MSFilterName(2,3) = sMSDocumentCheckBox(2)
|
||||
MSFilterName(2,4) = "PowerPoint"
|
||||
MSFilterName(2,4) = "PowerPoint/Publisher"
|
||||
|
||||
MSFilterName(3,0) = "dot|dotx|dotm"
|
||||
MSFilterName(3,1) = "writer8_template|writer8_template|writer8_template"
|
||||
@@ -451,118 +370,6 @@ Sub SetupMSConfiguration()
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
' 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"
|
||||
' about the listed defined mimetypes that are required to define binary StarOffice templates that have for all applications the same extension ".vor"
|
||||
|
||||
' 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 ) },
|
||||
' 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 ) },
|
||||
' 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 ) },
|
||||
|
||||
' 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 ) },
|
||||
' 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 ) },
|
||||
|
||||
' 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 ) },
|
||||
' 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 ) },
|
||||
|
||||
' 33 SOT_FORMATSTR_ID_STARDRAW*/ { "application/x-openoffice-stardraw;windows_formatname=\"StarDrawDocument\"", "StarDrawDocument", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) },
|
||||
' 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 ) },
|
||||
' 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 ) },
|
||||
|
||||
' 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 ) },
|
||||
|
||||
' 37 SOT_FORMATSTR_ID_STARCALC*/ { "application/x-openoffice-starcalc;windows_formatname=\"StarCalcDocument\"", "StarCalcDocument", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) },
|
||||
' 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 ) },
|
||||
' 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 ) },
|
||||
|
||||
' 40 SOT_FORMATSTR_ID_STARCHART*/ { "application/x-openoffice-starchart;windows_formatname=\"StarChartDocument\"", "StarChartDocument", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) },
|
||||
' 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 ) },
|
||||
' 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 ) },
|
||||
|
||||
' 46 SOT_FORMATSTR_ID_STARMATH*/ { "application/x-openoffice-starmath;windows_formatname=\"StarMath\"", "StarMath", &::getCppuType( (const Sequence< sal_Int8 >*) 0 ) },
|
||||
' 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 ) },
|
||||
' 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 ) },
|
||||
|
||||
|
||||
Sub SetupXMLConfiguration()
|
||||
iApplSection = 1000
|
||||
Wizardmode = SBXMLMODE
|
||||
ApplCount = 4
|
||||
MaxApplCount = 4
|
||||
XMLTemplateList = Array("vor", "sti", "stw" , "stc" , "std")
|
||||
' chkTemplatePath-Captions
|
||||
GetApplResourceArray(1009 + iApplSection, ApplCount, sTemplateCheckBox())
|
||||
' DocumentCheckbox- Captions
|
||||
GetApplResourceArray(1009 + iApplSection + ApplCount, ApplCount, sDocumentCheckBox())
|
||||
|
||||
XMLFilterName(0,0) = "sdw|sxw"
|
||||
XMLFilterName(0,1) = "writer8|writer8"
|
||||
XMLFilterName(0,2) = "odt|odt"
|
||||
XMLFilterName(0,3) = sDocumentCheckBox(0)
|
||||
|
||||
XMLFilterName(1,0) = "sdc|sxc"
|
||||
XMLFilterName(1,1) = "calc8|calc8"
|
||||
XMLFilterName(1,2) = "ods|ods"
|
||||
XMLFilterName(1,3) = sDocumentCheckBox(1)
|
||||
|
||||
If oFactoryKey.HasByName("com.sun.star.drawing.DrawingDocument") and oFactoryKey.HasByName("com.sun.star.presentation.PresentationDocument") Then
|
||||
XMLFilterName(2,0) = "sdd|sda|sxi|sxd"
|
||||
XMLFilterName(2,1) = "impress8|draw8|impress8|draw8"
|
||||
XMLFilterName(2,2) = "odp|odg|odp|odg"
|
||||
Elseif oFactoryKey.HasByName("com.sun.star.drawing.DrawingDocument") Then
|
||||
XMLFilterName(2,0) = "sda|sxd"
|
||||
XMLFilterName(2,1) = "draw8|draw8"
|
||||
XMLFilterName(2,2) = "odg|odg"
|
||||
Elseif oFactoryKey.HasByName("com.sun.star.presentation.PresentationDocument") Then
|
||||
XMLFilterName(2,0) = "sdd|sxi"
|
||||
XMLFilterName(2,1) = "impress8|impress8"
|
||||
XMLFilterName(2,2) = "odp|odp"
|
||||
End If
|
||||
XMLFilterName(2,3) = sDocumentCheckBox(2)
|
||||
|
||||
|
||||
XMLFilterName(3,0) = "smf|sxm"
|
||||
XMLFilterName(3,1) = "math8|math8"
|
||||
XMLFilterName(3,2) = "odf|odf"
|
||||
XMLFilterName(3,3) = sDocumentCheckBox(3)
|
||||
|
||||
XMLFilterName(4,0) = "application/x-openoffice-starwriter|application/vnd.stardivision.writer/web|application/vnd.sun.xml.writer|application/vnd.sun.xml.writerweb"
|
||||
XMLFilterName(4,1) = "writer8_template|writerweb8_writer_template|writer8_template|writerweb8_writer_template"
|
||||
XMLFilterName(4,2) = "ott|oth|ott|oth"
|
||||
XMLFilterName(4,3) = sTemplateCheckBox(0)
|
||||
|
||||
|
||||
XMLFilterName(5,0) = "application/x-openoffice-starcalc|application/vnd.sun.xml.calc"
|
||||
XMLFilterName(5,1) = "calc8_template|calc8_template"
|
||||
XMLFilterName(5,2) = "ots|ots"
|
||||
XMLFilterName(5,3) = sTemplateCheckBox(1)
|
||||
|
||||
' due to bug #108942# impress templates of the version 4.0 have to be handled in a special way because their mimetype
|
||||
' falsely points to the draw application.
|
||||
If oFactoryKey.HasByName("com.sun.star.drawing.DrawingDocument") and oFactoryKey.HasByName("com.sun.star.presentation.PresentationDocument") Then
|
||||
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"
|
||||
XMLFilterName(6,1) = "impress8_template|impress8_template|draw8_template|impress8_template|draw8_template"
|
||||
XMLFilterName(6,2) = "otp|otp|otg|otp|otg"
|
||||
Elseif oFactoryKey.HasByName("com.sun.star.drawing.DrawingDocument") Then
|
||||
XMLFilterName(6,0) = "application/x-openoffice-stardraw|application/vnd.sun.xml.draw"
|
||||
XMLFilterName(6,1) = "draw8_template|draw8_template"
|
||||
XMLFilterName(6,2) = "otg|otg"
|
||||
Elseif oFactoryKey.HasByName("com.sun.star.presentation.PresentationDocument") Then
|
||||
XMLFilterName(6,0) = "application/x-openoffice-starimpress|application/x-openoffice-stardraw-40|application/vnd.sun.xml.impress"
|
||||
XMLFilterName(6,1) = "impress8_template|impress8_template|impress8_template"
|
||||
XMLFilterName(6,2) = "otp|otp|otp"
|
||||
End If
|
||||
XMLFilterName(6,3) = sTemplateCheckBox(2)
|
||||
|
||||
If oFactoryKey.HasByName("com.sun.star.text.GlobalDocument") Then
|
||||
XMLFilterName(7,0) = "sgl|sxg"
|
||||
XMLFilterName(7,1) = "writerglobal8|writerglobal8"
|
||||
XMLFilterName(7,2) = "odm|odm"
|
||||
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
|
||||
@@ -570,7 +377,7 @@ Dim sPath as String
|
||||
ElseIf oCheckbox.State = 0 Then
|
||||
CheckControlPath = True
|
||||
Else
|
||||
sPath = ConvertToUrl(Trim(oTextBox.Text)
|
||||
sPath = ConvertToUrl(Trim(oTextBox.Text))
|
||||
CheckControlPath = oUcb.Exists(sPath)
|
||||
End If
|
||||
End Function
|
||||
@@ -595,10 +402,10 @@ Dim sShowPath as String
|
||||
Dim oLocUcb as Object
|
||||
oLocUcb = createUnoService("com.sun.star.ucb.SimpleFileAccess")
|
||||
If bGetResources Then
|
||||
If InitResources("ImportWizard","imp") then
|
||||
sNoDirCreation = GetResText(1050)
|
||||
sMsgDirNotThere = GetResText(1051)
|
||||
sQueryForNewCreation = GetResText(1052)
|
||||
If InitResources("ImportWizard") then
|
||||
sNoDirCreation = GetResText("NoDirCreation")
|
||||
sMsgDirNotThere = GetResText("MsgDirNotThere")
|
||||
sQueryForNewCreation = GetResText("QueryfornewCreation")
|
||||
Else
|
||||
CheckTextBoxPath() = False
|
||||
Exit Function
|
||||
|
||||
Reference in New Issue
Block a user