mirror of
https://gitee.com/kekingcn/file-online-preview.git
synced 2026-06-17 19:37:09 +00:00
优化项目结构、优化 maven 结构
This commit is contained in:
228
office-plugin/windows-office/share/basic/ImportWizard/API.xba
Normal file
228
office-plugin/windows-office/share/basic/ImportWizard/API.xba
Normal file
@@ -0,0 +1,228 @@
|
||||
<?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.
|
||||
*
|
||||
***********************************************************-->
|
||||
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="API" script:language="StarBasic">Declare Function RegOpenKeyEx Lib "advapi32.dll" Alias "RegOpenKeyExA" _
|
||||
(ByVal hKey As Long, _
|
||||
ByVal lpSubKey As String, _
|
||||
ByVal ulOptions As Long, _
|
||||
ByVal samDesired As Long, _
|
||||
phkResult As Long) As Long
|
||||
|
||||
Declare Function RegQueryValueExString Lib "advapi32.dll" Alias "RegQueryValueExA" _
|
||||
(ByVal hKey As Long, _
|
||||
ByVal lpValueName As String, _
|
||||
ByVal lpReserved As Long, _
|
||||
lpType As Long, _
|
||||
lpData As String, _
|
||||
lpcbData As Long) As Long
|
||||
|
||||
Declare Function RegQueryValueExLong Lib "advapi32.dll" Alias "RegQueryValueExA" _
|
||||
(ByVal hKey As Long, _
|
||||
ByVal lpValueName As String, _
|
||||
ByVal lpReserved As Long, _
|
||||
lpType As Long, _
|
||||
lpData As Long, _
|
||||
lpcbData As Long) As Long
|
||||
|
||||
Declare Function RegQueryValueExNULL Lib "advapi32.dll" Alias "RegQueryValueExA" _
|
||||
(ByVal hKey As Long, _
|
||||
ByVal lpValueName As String, _
|
||||
ByVal lpReserved As Long, _
|
||||
lpType As Long, _
|
||||
ByVal lpData As Long, _
|
||||
lpcbData As Long) As Long
|
||||
|
||||
Declare Function RegCloseKeyA Lib "advapi32.dll" Alias "RegCloseKey" _
|
||||
(ByVal hKey As Long) As Long
|
||||
|
||||
|
||||
Public Const HKEY_CLASSES_ROOT = &H80000000
|
||||
Public Const HKEY_CURRENT_USER = &H80000001
|
||||
Public Const HKEY_LOCAL_MACHINE = &H80000002
|
||||
Public Const HKEY_USERS = &H80000003
|
||||
Public Const KEY_ALL_ACCESS = &H3F
|
||||
Public Const REG_OPTION_NON_VOLATILE = 0
|
||||
Public Const REG_SZ As Long = 1
|
||||
Public Const REG_DWORD As Long = 4
|
||||
Public Const ERROR_NONE = 0
|
||||
Public Const ERROR_BADDB = 1
|
||||
Public Const ERROR_BADKEY = 2
|
||||
Public Const ERROR_CANTOPEN = 3
|
||||
Public Const ERROR_CANTREAD = 4
|
||||
Public Const ERROR_CANTWRITE = 5
|
||||
Public Const ERROR_OUTOFMEMORY = 6
|
||||
Public Const ERROR_INVALID_PARAMETER = 7
|
||||
Public Const ERROR_ACCESS_DENIED = 8
|
||||
Public Const ERROR_INVALID_PARAMETERS = 87
|
||||
Public Const ERROR_NO_MORE_ITEMS = 259
|
||||
'Public Const KEY_READ = &H20019
|
||||
|
||||
|
||||
Function OpenRegKey(lBaseKey As Long, sKeyName As String) As Variant
|
||||
Dim LocKeyValue
|
||||
Dim hKey as Long
|
||||
Dim lRetValue as Long
|
||||
lRetValue = RegOpenKeyEx(lBaseKey, sKeyName, 0, KEY_ALL_ACCESS, hKey)
|
||||
' lRetValue = QueryValue(HKEY_LOCAL_MACHINE, "SOFTWARE\Microsoft\Outlook Express\5.0\Default Settings", "Revocation Checking")
|
||||
If hKey <> 0 Then
|
||||
RegCloseKeyA (hKey)
|
||||
End If
|
||||
OpenRegKey() = lRetValue
|
||||
End Function
|
||||
|
||||
|
||||
Function GetDefaultPath(CurOffice as Integer) As String
|
||||
Dim sPath as String
|
||||
Dim Index as Integer
|
||||
Select Case Wizardmode
|
||||
Case SBMICROSOFTMODE
|
||||
Index = Applications(CurOffice,SBAPPLKEY)
|
||||
If GetGUIType = 1 Then ' Windows
|
||||
sPath = QueryValue(HKEY_LOCAL_MACHINE, sKeyName(Index), sValueName(Index))
|
||||
Else
|
||||
sPath = ""
|
||||
End If
|
||||
If sPath = "" Then
|
||||
sPath = SOWorkPath
|
||||
End If
|
||||
GetDefaultPath = sPath
|
||||
Case SBXMLMODE
|
||||
GetDefaultPath = SOWorkPath
|
||||
End Select
|
||||
End Function
|
||||
|
||||
|
||||
Function GetTemplateDefaultPath(Index as Integer) As String
|
||||
Dim sLocTemplatePath as String
|
||||
Dim sLocProgrampath as String
|
||||
Dim Progstring as String
|
||||
Dim PathList()as String
|
||||
Dim Maxindex as Integer
|
||||
Dim OldsLocTemplatePath
|
||||
Dim sTemplateKeyName as String
|
||||
Dim sTemplateValueName as String
|
||||
On Local Error Goto NOVAlIDSYSTEMPATH
|
||||
Select Case WizardMode
|
||||
Case SBMICROSOFTMODE
|
||||
If GetGUIType = 1 Then ' Windows
|
||||
' Template directory of Office 97
|
||||
sTemplateKeyName = "Software\Microsoft\Office\8.0\Common\FileNew\LocalTemplates"
|
||||
sTemplateValueName = ""
|
||||
sLocTemplatePath = QueryValue(HKEY_LOCAL_MACHINE, sTemplateKeyName, sTemplateValueName)
|
||||
|
||||
If sLocTemplatePath = "" Then
|
||||
' Retrieve the template directory of Office 2000
|
||||
' Unfortunately there is no existing note about the template directory in
|
||||
' the whole registry.
|
||||
|
||||
' Programdirectory of Office 2000
|
||||
sTemplateKeyName = "Software\Microsoft\Office\9.0\Common\InstallRoot"
|
||||
sTemplateValueName = "Path"
|
||||
sLocProgrampath = QueryValue(HKEY_LOCAL_MACHINE, sTemplateKeyName, sTemplateValueName)
|
||||
If sLocProgrampath <> "" Then
|
||||
If Right(sLocProgrampath, 1) <> "\" Then
|
||||
sLocProgrampath = sLocProgrampath & "\"
|
||||
End If
|
||||
PathList() = ArrayoutofString(sLocProgrampath,"\",Maxindex)
|
||||
Progstring = "\" & PathList(Maxindex-1) & "\"
|
||||
OldsLocTemplatePath = DeleteStr(sLocProgramPath,Progstring)
|
||||
|
||||
sLocTemplatePath = OldsLocTemplatePath & "\" & "Templates"
|
||||
|
||||
' Does this subdirectory "templates" exist at all
|
||||
If oUcb.Exists(sLocTemplatePath) Then
|
||||
' If Not the main directory of the office is the base
|
||||
sLocTemplatePath = OldsLocTemplatePath
|
||||
End If
|
||||
Else
|
||||
sLocTemplatePath = SOWorkPath
|
||||
End If
|
||||
End If
|
||||
GetTemplateDefaultPath = ConvertToUrl(sLocTemplatePath)
|
||||
Else
|
||||
GetTemplateDefaultPath = SOWorkPath
|
||||
End If
|
||||
Case SBXMLMODE
|
||||
If Index = 3 Then
|
||||
' Helper Application with no templates
|
||||
GetTemplateDefaultPath = SOWorkPath
|
||||
Else
|
||||
GetTemplateDefaultPath = SOTemplatePath
|
||||
End If
|
||||
End Select
|
||||
NOVALIDSYSTEMPATH:
|
||||
If Err <> 0 Then
|
||||
GetTemplateDefaultPath() = SOWorkPath
|
||||
Resume ONITGOES
|
||||
ONITGOES:
|
||||
End If
|
||||
End Function
|
||||
|
||||
|
||||
Function QueryValueEx(ByVal lhKey, ByVal szValueName As String, vValue As String) As Long
|
||||
Dim cch As Long
|
||||
Dim lrc As Long
|
||||
Dim lType As Long
|
||||
Dim lValue As Long
|
||||
Dim sValue As String
|
||||
Dim Empty
|
||||
|
||||
On Error GoTo QueryValueExError
|
||||
|
||||
lrc = RegQueryValueExNULL(lhKey, szValueName, 0&, lType, 0&, cch)
|
||||
If lrc <> ERROR_NONE Then Error 5
|
||||
Select Case lType
|
||||
Case REG_SZ:
|
||||
sValue = String(cch, 0)
|
||||
lrc = RegQueryValueExString(lhKey, szValueName, 0&, lType, sValue, cch)
|
||||
If lrc = ERROR_NONE Then
|
||||
vValue = Left$(sValue, cch)
|
||||
Else
|
||||
vValue = Empty
|
||||
End If
|
||||
Case REG_DWORD:
|
||||
lrc = RegQueryValueExLong(lhKey, szValueName, 0&, lType, lValue, cch)
|
||||
If lrc = ERROR_NONE Then
|
||||
vValue = lValue
|
||||
End If
|
||||
Case Else
|
||||
lrc = -1
|
||||
End Select
|
||||
QueryValueExExit:
|
||||
QueryValueEx = lrc
|
||||
Exit Function
|
||||
QueryValueExError:
|
||||
Resume QueryValueExExit
|
||||
End Function
|
||||
|
||||
|
||||
Function QueryValue(BaseKey As Long, sKeyName As String, sValueName As String) As Variant
|
||||
Dim lRetVal As Long ' Returnvalue API-Call
|
||||
Dim hKey As Long ' Onen key handle
|
||||
Dim vValue As String ' Key value
|
||||
|
||||
lRetVal = RegOpenKeyEx(BaseKey, sKeyName, 0, KEY_ALL_ACCESS, hKey)
|
||||
lRetVal = QueryValueEx(hKey, sValueName, vValue)
|
||||
RegCloseKeyA (hKey)
|
||||
QueryValue = vValue
|
||||
End Function
|
||||
</script:module>
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,116 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE dlg:window PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "dialog.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.
|
||||
*
|
||||
***********************************************************-->
|
||||
<dlg:window xmlns:dlg="http://openoffice.org/2000/dialog" xmlns:script="http://openoffice.org/2000/script" dlg:id="ImportDialog" dlg:left="96" dlg:top="28" dlg:width="270" dlg:height="210" dlg:page="4" dlg:help-url="HID:WIZARDS_HID_DLGIMPORT_DIALOG" dlg:closeable="true" dlg:moveable="true" dlg:title="ImportDialog">
|
||||
<dlg:bulletinboard>
|
||||
<dlg:text dlg:id="lblTemplateExport" dlg:tab-index="0" dlg:left="12" dlg:top="94" dlg:width="60" dlg:height="8" dlg:page="2" dlg:value="lblTemplateExport"/>
|
||||
<dlg:textfield dlg:id="txtTemplateImportPath" dlg:tab-index="1" dlg:left="73" dlg:top="76" dlg:width="170" dlg:height="12" dlg:page="2" dlg:help-url="HID:WIZARDS_HID_DLGIMPORT_2_LBTEMPLATEPATH">
|
||||
<script:event script:event-name="on-textchange" script:macro-name="vnd.sun.star.script:ImportWizard.Main.ToggleNextButton?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:textfield>
|
||||
<dlg:textfield dlg:id="txtTemplateExportPath" dlg:tab-index="2" dlg:left="73" dlg:top="92" dlg:width="170" dlg:height="12" dlg:page="2" dlg:help-url="HID:WIZARDS_HID_DLGIMPORT_2_EDTEMPLATEPATH"/>
|
||||
<dlg:checkbox dlg:id="chkDocumentPath" dlg:tab-index="3" dlg:left="12" dlg:top="121" dlg:width="240" dlg:height="10" dlg:page="2" dlg:tag="Document" dlg:help-url="HID:WIZARDS_HID_DLGIMPORT_2_CBDOCUMENT" dlg:value="chkDocumentPath" dlg:checked="true">
|
||||
<script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.script:ImportWizard.DialogModul.ToggleInputPaths?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:checkbox>
|
||||
<dlg:checkbox dlg:id="chkDocumentSearchSubDir" dlg:tab-index="4" dlg:left="12" dlg:top="134" dlg:width="240" dlg:height="10" dlg:page="2" dlg:help-url="HID:WIZARDS_HID_DLGIMPORT_2_CBDOCUMENTRECURSE" dlg:value="chkDocumentSearchSubDir" dlg:checked="false"/>
|
||||
<dlg:text dlg:id="lblDocumentImport" dlg:tab-index="5" dlg:left="10" dlg:top="151" dlg:width="60" dlg:height="8" dlg:page="2" dlg:value="lblDocumentImport"/>
|
||||
<dlg:text dlg:id="lblDocumentExport" dlg:tab-index="6" dlg:left="10" dlg:top="167" dlg:width="60" dlg:height="8" dlg:page="2" dlg:value="lblDocumentExport"/>
|
||||
<dlg:textfield dlg:id="txtDocumentImportPath" dlg:tab-index="7" dlg:left="73" dlg:top="149" dlg:width="170" dlg:height="12" dlg:page="2" dlg:help-url="HID:WIZARDS_HID_DLGIMPORT_2_LBDOCUMENTPATH">
|
||||
<script:event script:event-name="on-textchange" script:macro-name="vnd.sun.star.script:ImportWizard.Main.ToggleNextButton?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:textfield>
|
||||
<dlg:textfield dlg:id="txtDocumentExportPath" dlg:tab-index="8" dlg:left="73" dlg:top="165" dlg:width="170" dlg:height="12" dlg:page="2" dlg:help-url="HID:WIZARDS_HID_DLGIMPORT_2_EDDOCUMENTPATH"/>
|
||||
<dlg:text dlg:id="SummaryHeaderLabel" dlg:tab-index="9" dlg:left="6" dlg:top="37" dlg:width="258" dlg:height="8" dlg:page="3" dlg:value="SummaryHeaderLabel"/>
|
||||
<dlg:textfield dlg:id="SummaryTextbox" dlg:tab-index="10" dlg:left="5" dlg:top="48" dlg:width="259" dlg:height="125" dlg:page="3" dlg:help-url="HID:WIZARDS_HID_DLGIMPORT_3_TBSUMMARY" dlg:vscroll="true" dlg:multiline="true" dlg:readonly="true"/>
|
||||
<dlg:text dlg:id="LabelRetrieval" dlg:tab-index="11" dlg:left="10" dlg:top="67" dlg:width="255" dlg:height="8" dlg:page="4" dlg:value="LabelRetrieval"/>
|
||||
<dlg:text dlg:id="LabelCurTemplateRetrieval" dlg:tab-index="12" dlg:left="15" dlg:top="79" dlg:width="249" dlg:height="8" dlg:page="4" dlg:value="LabelCurTemplateRetrieval"/>
|
||||
<dlg:text dlg:id="LabelCurDocumentRetrieval" dlg:tab-index="13" dlg:left="15" dlg:top="91" dlg:width="249" dlg:height="8" dlg:page="4" dlg:value="LabelCurDocumentRetrieval"/>
|
||||
<dlg:text dlg:id="LabelCurProgress" dlg:tab-index="14" dlg:left="10" dlg:top="106" dlg:width="255" dlg:height="8" dlg:page="4" dlg:value="LabelCurProgress"/>
|
||||
<dlg:text dlg:id="LabelCurDocument" dlg:tab-index="15" dlg:left="15" dlg:top="118" dlg:width="249" dlg:height="20" dlg:page="4" dlg:value="LabelCurDocument" dlg:multiline="true"/>
|
||||
<dlg:img dlg:id="ImportPreview" dlg:tab-index="16" dlg:left="5" dlg:top="6" dlg:width="258" dlg:height="26" dlg:scale-image="false"/>
|
||||
<dlg:button dlg:id="cmdBack" dlg:tab-index="17" dlg:left="155" dlg:top="190" dlg:width="50" dlg:height="14" dlg:help-url="HID:WIZARDS_HID_DLGIMPORT_0_CMDPREV" dlg:value="cmdBack">
|
||||
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:ImportWizard.Main.PrevStep?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:button>
|
||||
<dlg:button dlg:id="cmdCancel" dlg:tab-index="18" dlg:left="6" dlg:top="190" dlg:width="50" dlg:height="14" dlg:help-url="HID:WIZARDS_HID_DLGIMPORT_0_CMDCANCEL" dlg:value="cmdCancel">
|
||||
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:ImportWizard.Main.CancelTask?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:button>
|
||||
<dlg:button dlg:id="cmdHelp" dlg:tab-index="19" dlg:left="65" dlg:top="190" dlg:width="50" dlg:height="14" dlg:value="cmdHelp" dlg:button-type="help"/>
|
||||
<dlg:button dlg:id="cmdGoOn" dlg:tab-index="20" dlg:left="214" dlg:top="190" dlg:width="50" dlg:height="14" dlg:help-url="HID:WIZARDS_HID_DLGIMPORT_0_CMDNEXT" dlg:value="cmdGoOn">
|
||||
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:ImportWizard.Main.NextStep?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:button>
|
||||
<dlg:text dlg:id="WelcomeTextLabel" dlg:tab-index="21" dlg:left="6" dlg:top="38" dlg:width="258" dlg:height="20" dlg:page="1" dlg:value="WelcomeTextLabel" dlg:multiline="true"/>
|
||||
<dlg:text dlg:id="WelcomeTextLabel3" dlg:tab-index="22" dlg:left="6" dlg:top="58" dlg:width="258" dlg:height="12" dlg:page="1" dlg:value="WelcomeTextLabel3"/>
|
||||
<dlg:button dlg:id="cmdTemplateImport" dlg:tab-index="23" dlg:left="248" dlg:top="75" dlg:width="14" dlg:height="14" dlg:page="2" dlg:tag="txtTemplateImportPath" dlg:help-url="HID:WIZARDS_HID_DLGIMPORT_2_CMDTEMPLATEPATHSELECT" dlg:value="...">
|
||||
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:ImportWizard.DialogModul.TakoverFolderName?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:button>
|
||||
<dlg:button dlg:id="cmdTemplateExport" dlg:tab-index="24" dlg:left="248" dlg:top="91" dlg:width="14" dlg:height="14" dlg:page="2" dlg:tag="txtTemplateExportPath" dlg:help-url="HID:WIZARDS_HID_DLGIMPORT_2_CMDTEMPLATEPATHSELECT2" dlg:value="...">
|
||||
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:ImportWizard.DialogModul.TakoverFolderName?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:button>
|
||||
<dlg:button dlg:id="cmdDocumentImport" dlg:tab-index="25" dlg:left="248" dlg:top="148" dlg:width="14" dlg:height="14" dlg:page="2" dlg:tag="txtDocumentImportPath" dlg:help-url="HID:WIZARDS_HID_DLGIMPORT_2_CMDDOCUMENTPATHSELECT" dlg:value="...">
|
||||
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:ImportWizard.DialogModul.TakoverFolderName?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:button>
|
||||
<dlg:button dlg:id="cmdDocumentExport" dlg:tab-index="26" dlg:left="248" dlg:top="164" dlg:width="14" dlg:height="14" dlg:page="2" dlg:tag="txtDocumentExportPath" dlg:help-url="HID:WIZARDS_HID_DLGIMPORT_2_CMDDOCUMENTPATHSELECT2" dlg:value="...">
|
||||
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:ImportWizard.DialogModul.TakoverFolderName?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:button>
|
||||
<dlg:radiogroup>
|
||||
<dlg:radio dlg:id="optSODocuments" dlg:tab-index="27" dlg:left="6" dlg:top="72" dlg:width="258" dlg:height="9" dlg:page="1" dlg:tag="SO" dlg:help-url="HID:WIZARDS_HID_DLGIMPORT_0_OPTSODOCUMENTS" dlg:value="optSODocuments" dlg:checked="true">
|
||||
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:ImportWizard.Main.ToggleCheckboxes?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:radio>
|
||||
<dlg:radio dlg:id="optMSDocuments" dlg:tab-index="28" dlg:left="6" dlg:top="113" dlg:width="258" dlg:height="9" dlg:page="1" dlg:tag="MS" dlg:help-url="HID:WIZARDS_HID_DLGIMPORT_0_OPTMSDOCUMENTS" dlg:value="optMSDocuments">
|
||||
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:ImportWizard.Main.ToggleCheckboxes?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:radio>
|
||||
</dlg:radiogroup>
|
||||
<dlg:checkbox dlg:id="chkSOApplication1" dlg:tab-index="29" dlg:left="12" dlg:top="85" dlg:width="141" dlg:height="9" dlg:page="1" dlg:help-url="HID:WIZARDS_HID_DLGIMPORT_0_CHKWRITER" dlg:value="chkSOApplication1" dlg:checked="false">
|
||||
<script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.script:ImportWizard.Main.ToggleNextButton?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:checkbox>
|
||||
<dlg:checkbox dlg:id="chkSOApplication2" dlg:tab-index="30" dlg:left="155" dlg:top="85" dlg:width="109" dlg:height="9" dlg:page="1" dlg:help-url="HID:WIZARDS_HID_DLGIMPORT_0_CHKCALC" dlg:value="chkSOApplication2" dlg:checked="false">
|
||||
<script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.script:ImportWizard.Main.ToggleNextButton?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:checkbox>
|
||||
<dlg:checkbox dlg:id="chkSOApplication3" dlg:tab-index="31" dlg:left="12" dlg:top="98" dlg:width="141" dlg:height="9" dlg:page="1" dlg:help-url="HID:WIZARDS_HID_DLGIMPORT_0_CHKIMPRESS" dlg:value="chkSOApplication3" dlg:checked="false">
|
||||
<script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.script:ImportWizard.Main.ToggleNextButton?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:checkbox>
|
||||
<dlg:checkbox dlg:id="chkSOApplication4" dlg:tab-index="32" dlg:left="155" dlg:top="98" dlg:width="109" dlg:height="9" dlg:page="1" dlg:help-url="HID:WIZARDS_HID_DLGIMPORT_0_CHKMATHGLOBAL" dlg:value="chkSOApplication4" dlg:checked="false">
|
||||
<script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.script:ImportWizard.Main.ToggleNextButton?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:checkbox>
|
||||
<dlg:checkbox dlg:id="chkMSApplication1" dlg:tab-index="33" dlg:disabled="true" dlg:left="12" dlg:top="126" dlg:width="141" dlg:height="9" dlg:page="1" dlg:help-url="HID:WIZARDS_HID_DLGIMPORT_2_CHKWORD" dlg:value="chkMSApplication1" dlg:checked="false">
|
||||
<script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.script:ImportWizard.Main.ToggleNextButton?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:checkbox>
|
||||
<dlg:checkbox dlg:id="chkMSApplication2" dlg:tab-index="34" dlg:disabled="true" dlg:left="155" dlg:top="126" dlg:width="109" dlg:height="9" dlg:page="1" dlg:help-url="HID:WIZARDS_HID_DLGIMPORT_2_CHKEXCEL" dlg:value="chkMSApplication2" dlg:checked="false">
|
||||
<script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.script:ImportWizard.Main.ToggleNextButton?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:checkbox>
|
||||
<dlg:checkbox dlg:id="chkMSApplication3" dlg:tab-index="35" dlg:disabled="true" dlg:left="12" dlg:top="139" dlg:width="141" dlg:height="9" dlg:page="1" dlg:help-url="HID:WIZARDS_HID_DLGIMPORT_2_CHKPOWERPOINT" dlg:value="chkMSApplication3" dlg:checked="false">
|
||||
<script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.script:ImportWizard.Main.ToggleNextButton?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:checkbox>
|
||||
<dlg:text dlg:id="WelcomeTextLabel2" dlg:tab-index="36" dlg:disabled="true" dlg:left="6" dlg:top="152" dlg:width="258" dlg:height="18" dlg:page="1" dlg:value="WelcomeTextLabel2" dlg:multiline="true"/>
|
||||
<dlg:checkbox dlg:id="chkTemplatePath" dlg:tab-index="37" dlg:left="12" dlg:top="48" dlg:width="240" dlg:height="10" dlg:page="2" dlg:tag="Template" dlg:help-url="HID:WIZARDS_HID_DLGIMPORT_2_CBTEMPLATE" dlg:value="chkTemplatePath" dlg:checked="true">
|
||||
<script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.script:ImportWizard.DialogModul.ToggleInputPaths?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:checkbox>
|
||||
<dlg:checkbox dlg:id="chkTemplateSearchSubDir" dlg:tab-index="38" dlg:left="12" dlg:top="61" dlg:width="240" dlg:height="10" dlg:page="2" dlg:help-url="HID:WIZARDS_HID_DLGIMPORT_2_CBTEMPLATERECURSE" dlg:value="chkTemplateSearchSubDir" dlg:checked="false"/>
|
||||
<dlg:text dlg:id="lblTemplateImport" dlg:tab-index="39" dlg:left="12" dlg:top="78" dlg:width="60" dlg:height="8" dlg:page="2" dlg:value="lblTemplateImport"/>
|
||||
<dlg:checkbox dlg:id="chkLogfile" dlg:tab-index="40" dlg:left="6" dlg:top="171" dlg:width="136" dlg:height="9" dlg:page="1" dlg:help-url="HID:WIZARDS_HID_DLGIMPORT_0_CHKLOGFILE" dlg:value="chkLogfile" dlg:checked="true"/>
|
||||
<dlg:fixedline dlg:id="hlnTemplates" dlg:tab-index="41" dlg:left="6" dlg:top="37" dlg:width="258" dlg:height="8" dlg:page="2" dlg:value="hlnTemplates"/>
|
||||
<dlg:fixedline dlg:id="hlnDocuments" dlg:tab-index="42" dlg:left="6" dlg:top="110" dlg:width="258" dlg:height="8" dlg:page="2" dlg:value="hlnDocuments"/>
|
||||
<dlg:fixedline dlg:id="FixedLine1" dlg:tab-index="43" dlg:left="6" dlg:top="181" dlg:width="258" dlg:height="6"/>
|
||||
<dlg:fixedline dlg:id="hlnProgress" dlg:tab-index="44" dlg:left="6" dlg:top="55" dlg:width="258" dlg:height="8" dlg:page="4" dlg:value="hlnProgress"/>
|
||||
<dlg:button dlg:id="cmdShowLogFile" dlg:tab-index="45" dlg:disabled="true" dlg:left="75" dlg:top="142" dlg:width="120" dlg:height="14" dlg:page="4" dlg:value="cmdShowLogFile">
|
||||
<script:event script:event-name="on-performaction" script:macro-name="vnd.sun.star.script:ImportWizard.FilesModul.OpenLogDocument?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:button>
|
||||
</dlg:bulletinboard>
|
||||
</dlg:window>
|
||||
@@ -0,0 +1,177 @@
|
||||
<?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.
|
||||
*
|
||||
***********************************************************-->
|
||||
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Language" script:language="StarBasic">Option Explicit
|
||||
|
||||
Public sMSTemplateCheckbox(2) As String
|
||||
Public sMSDocumentCheckbox(2) As String
|
||||
Public sSODocumentCheckbox(4) As String
|
||||
Public sSOHelperdocuments(1,1) As String
|
||||
Public sTemplateCheckbox(SBMAXAPPLCOUNT-1) As String
|
||||
Public sDocumentCheckbox(SBMAXAPPLCOUNT-1) As String
|
||||
Public sTemplateGroupName As String
|
||||
Public sSearchInSubDir as String
|
||||
Public sPathErrorTemplates(SBMAXAPPLCOUNT-1) As String
|
||||
Public sPathErrorDocument(SBMAXAPPLCOUNT-1) As String
|
||||
Public sPathErrorStarDoc(SBMAXAPPLCOUNT-1) As String
|
||||
Public sStarDocLabel(SBMAXAPPLCOUNT-1) As String
|
||||
Public sImportLabel As String, sExportLabel As String
|
||||
Public SOApplicationName(5) As String
|
||||
Public sHelpButton As String, sCancelButton As String, sBackButton As String, sNextButton As String
|
||||
Public sSumInclusiveSubDir As String, sSumSaveDocuments As String
|
||||
Public sSummaryHeader As String
|
||||
Public sWelcometextLabel1 As String, sWelcometextLabel2 As String, sWelcometextLabel3 As String
|
||||
Public sBeginButton As String, sMsgDirNotThere As String
|
||||
Public sQueryForNewCreation As String, sPathError3 As String
|
||||
Public sNoDirCreation As String
|
||||
Public sProgressMoreDocs As String, sProgressMoreTemplates as String
|
||||
Public sFileExists As String, sMorePathsError3 As String
|
||||
Public sConvertError1 As String, sConvertError2 As String, sPathDialogMessage As String
|
||||
Public sRTErrorDesc As String, sRTErrorHeader As String
|
||||
Public sProgressPage_1 As String, sProgressPage_2 As String, sProgressPage_3 as String
|
||||
Public sProgressFound as String, sProgresspage_5 as String
|
||||
Public sContainerName(1) as String
|
||||
Public sReady as String, sTitle as String
|
||||
Public sCloseButton as String
|
||||
Public sSourceDocuments as String
|
||||
Public sTargetDocuments as String
|
||||
Public sSumSODocuments(4) as String
|
||||
Public sSumSOTemplates(4) as String
|
||||
Public sSumMSDocuments(3) as String
|
||||
Public sSumMSTemplates(3) as String
|
||||
Public ModuleList(3) as String
|
||||
Public sLogSummary as String
|
||||
Public sReeditMacro as String
|
||||
Public sOverwriteallFiles as String
|
||||
Public scouldnotopenDocument as String
|
||||
Public sCurcouldnotopenDocument as String
|
||||
Public scouldnotsaveDocument as String
|
||||
Public sCurcouldnotsaveDocument as String
|
||||
|
||||
|
||||
Sub LoadLanguage()
|
||||
If InitResources("ImportWizard","imp") then
|
||||
sHelpButton = GetResText(1000)
|
||||
sCancelButton = GetResText(1001)
|
||||
sBackButton = GetResText(1002)
|
||||
sNextButton = GetResText(1003)
|
||||
sBeginButton = GetResText(1004)
|
||||
sCloseButton = GetResText(1005)
|
||||
|
||||
sWelcometextLabel1 = ReplaceString(GetResText(1006), GetProductName(),"%PRODUCTNAME")
|
||||
sWelcometextLabel2 = GetResText(1007)
|
||||
sWelcometextLabel3 = GetResText(1008)
|
||||
|
||||
' Microsoft Documents
|
||||
GetApplResourceArray(1009, 3, sMSTemplateCheckBox())
|
||||
|
||||
' DocumentCheckbox- Captions
|
||||
GetApplResourceArray(1012, 3, sMSDocumentCheckBox())
|
||||
|
||||
' DocumentCheckbox- Captions
|
||||
GetApplResourceArray(2013, 5, sSODocumentCheckBox())
|
||||
|
||||
'StarOffice Applicationnames
|
||||
|
||||
sSOHelperDocuments(0,0) = GetResText(2017)
|
||||
sSOHelperDocuments(0,1) = "com.sun.star.text.GlobalDocument"
|
||||
sSOHelperDocuments(1,0) = GetResText(2018)
|
||||
sSOHelperDocuments(1,1) = "com.sun.star.formula.FormulaProperties"
|
||||
|
||||
GetApplResourceArray(2017,2, sSOHelperDocuments())
|
||||
|
||||
sContainerName(0) = GetResText(1030)
|
||||
' Note: for the version 5.2 there was no Productname "StarSuite"
|
||||
sContainerName(1) = "StarOffice"
|
||||
|
||||
sSummaryHeader = GetResText(1031)
|
||||
|
||||
sTemplateGroupName = GetResText(1036)
|
||||
|
||||
sProgressMoreDocs = GetResText(1041)
|
||||
sProgressMoreTemplates = GetResText(1042)
|
||||
sNoDirCreation = GetResText(1050)
|
||||
sMsgDirNotThere = GetResText(1051)
|
||||
sQueryForNewCreation = GetResText(1052)
|
||||
sFileExists = GetResText(1053)
|
||||
sMorePathsError3 = GetResText(1054)
|
||||
sConvertError1 = GetResText(1055)
|
||||
sConvertError2 = GetResText(1056)
|
||||
sRTErrorDesc = GetResText(1057)
|
||||
sRTErrorHeader = GetResText(1058)
|
||||
sOverwriteallFiles = GetResText(1070)
|
||||
sReeditMacro = GetResText(1071)
|
||||
scouldnotsaveDocument = GetResText(1072)
|
||||
scouldnotopenDocument = GetResText(1073)
|
||||
sPathDialogMessage = GetResText(1080)
|
||||
sTitle = GetResText(1081)
|
||||
|
||||
sProgressPage_1 = GetResText(1090)
|
||||
sProgressPage_2 = GetResText(1091)
|
||||
sProgressPage_3 = GetResText(1092)
|
||||
sProgressFound = GetResText(1093)
|
||||
sProgressPage_5 = GetResText(1094)
|
||||
sReady = GetResText(1100)
|
||||
sSourceDocuments = GetResText(2030)
|
||||
sTargetDocuments = GetResText(2031)
|
||||
sLogSummary = GetResText(2034)
|
||||
sSumInclusiveSubDir = GetResText(3000)
|
||||
sSumSaveDocuments = GetResText(3001)
|
||||
'StarOffice Applicationnames
|
||||
GetApplResourceArray(3100, 4, sSumSODocuments())
|
||||
GetApplResourceArray(3110, 4, sSumSOTemplates())
|
||||
GetApplResourceArray(3200, 3, sSumMSDocuments())
|
||||
GetApplResourceArray(3210, 3, sSumMSTemplates())
|
||||
With ImportDialog
|
||||
sImportLabel = GetResText(1033)
|
||||
sExportLabel = GetResText(1034)
|
||||
sSearchInSubDir = GetResText(1022)
|
||||
.chkTemplateSearchSubDir.Label = sSearchInSubDir
|
||||
.lblDocumentImport.Label = sImportLabel
|
||||
.lblDocumentExport.Label = sExportLabel
|
||||
.chkDocumentSearchSubDir.Label = sSearchInSubDir
|
||||
.lblTemplateImport.Label = sImportLabel
|
||||
.lblTemplateExport.Label = sExportLabel
|
||||
.chkLogfile.Label = GetResText(2032)
|
||||
.chkLogfile.Helptext = GetResText(2033)
|
||||
Dim Blabla as String
|
||||
blabla = GetResText(1072)
|
||||
.cmdShowLogFile.Label = GetResText(2035)
|
||||
End With
|
||||
ModuleList(0) = "com.sun.star.text.TextDocument"
|
||||
ModuleList(1) = "com.sun.star.sheet.SpreadsheetDocument"
|
||||
ModuleList(2) = "com.sun.star.drawing.DrawingDocument/com.sun.star.presentation.PresentationDocument"
|
||||
ModuleList(3) = "com.sun.star.formula.FormulaProperties/com.sun.star.text.GlobalDocument"
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Sub GetApplResourceArray(StartResIndex as Integer, Count as Integer, BigArray())
|
||||
Dim i as Integer
|
||||
Dim a as Integer
|
||||
a = 0
|
||||
For i = StartResIndex To StartResIndex + Count-1
|
||||
BigArray(a) = GetResText(i)
|
||||
a = a + 1
|
||||
Next
|
||||
End Sub
|
||||
</script:module>
|
||||
310
office-plugin/windows-office/share/basic/ImportWizard/Main.xba
Normal file
310
office-plugin/windows-office/share/basic/ImportWizard/Main.xba
Normal file
@@ -0,0 +1,310 @@
|
||||
<?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.
|
||||
*
|
||||
***********************************************************-->
|
||||
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Main" script:language="StarBasic">Option Explicit
|
||||
|
||||
' ***** BASIC *****
|
||||
Public HeaderPreviews(4) as Object
|
||||
Public ImportDialog as Object
|
||||
Public ImportDialogArea as Object
|
||||
Public oFactoryKey as Object
|
||||
Public bShowLogFile as Boolean
|
||||
|
||||
' If the ProgressPage ist already on Top The Dialog will be immediately closed when this flag is
|
||||
' set to False
|
||||
Public bConversionIsRunning as Boolean
|
||||
Public RetValue as Integer
|
||||
|
||||
Sub Main()
|
||||
Dim NoArgs() as New com.sun.star.beans.PropertyValue
|
||||
bShowLogFile=FALSE
|
||||
If Not bDebugWizard Then
|
||||
On Local Error Goto RTError
|
||||
End If
|
||||
BasicLibraries.LoadLibrary("Tools")
|
||||
RetValue = 10
|
||||
bIsFirstLogTable = True
|
||||
bConversionIsRunning = False
|
||||
sCRLF = CHR(13) & CHR(10)
|
||||
oUcb = createUnoService("com.sun.star.ucb.SimpleFileAccess")
|
||||
oFactoryKey = GetRegistryKeyContent("org.openoffice.Setup/Office/Factories")
|
||||
If GetImportWizardPaths() = False Then
|
||||
Exit Sub
|
||||
End If
|
||||
bCancelTask = False
|
||||
bDoKeepApplValues = False
|
||||
CurOffice = 0
|
||||
ImportDialogArea = LoadDialog("ImportWizard","ImportDialog")
|
||||
ImportDialog = ImportDialogArea.Model
|
||||
LoadLanguage()
|
||||
WizardMode = SBXMLMODE
|
||||
MaxApplCount = 4
|
||||
FillStep_Welcome()
|
||||
RepaintHeaderPreview()
|
||||
ImportDialog.ImportPreview.BackGroundColor = RGB(0,60,126)
|
||||
ImportDialog.cmdGoOn.DefaultButton = True
|
||||
ImportDialogArea.GetControl("optSODocuments").SetFocus()
|
||||
ToggleCheckboxesWithBoolean(False)
|
||||
RetValue = ImportDialogArea.Execute()
|
||||
If bShowLogFile=TRUE Then
|
||||
OpenDocument(sLogUrl, NoArgs())
|
||||
End if
|
||||
If RetValue = 0 Then
|
||||
CancelTask()
|
||||
End If
|
||||
ImportDialogArea.Dispose()
|
||||
End
|
||||
Exit Sub
|
||||
RTError:
|
||||
Msgbox sRTErrorDesc, 16, sRTErrorHeader
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Sub NextStep()
|
||||
Dim iCurStep as Integer
|
||||
If Not bDebugWizard Then
|
||||
On Error Goto RTError
|
||||
End If
|
||||
bConversionIsRunning = False
|
||||
iCurStep = ImportDialog.Step
|
||||
Select Case iCurStep
|
||||
Case 1
|
||||
FillStep_InputPaths(0, True)
|
||||
Case 2
|
||||
If CheckInputPaths Then
|
||||
SaveStep_InputPath
|
||||
If CurOffice < ApplCount - 1 Then
|
||||
CurOffice = CurOffice + 1
|
||||
TakeOverPathSettings()
|
||||
FillStep_InputPaths(CurOffice, False)
|
||||
Else
|
||||
FillStep_Summary()
|
||||
End If
|
||||
End If
|
||||
Case 3
|
||||
FillStep_Progress()
|
||||
Select Case WizardMode
|
||||
Case SBMICROSOFTMODE
|
||||
Call ConvertAllDocuments(MSFilterName())
|
||||
CASE SBXMLMODE
|
||||
Call ConvertAllDocuments(XMLFilterName())
|
||||
End Select
|
||||
Case 4
|
||||
CancelTask(True)
|
||||
End Select
|
||||
|
||||
If ((ImportDialog.chkLogfile.State <> 1) OR (iCurStep <> 3)) Then
|
||||
ImportDialog.cmdGoOn.DefaultButton = True
|
||||
End If
|
||||
|
||||
RepaintHeaderPreview()
|
||||
Exit Sub
|
||||
RTError:
|
||||
Msgbox sRTErrorDesc, 16, sRTErrorHeader
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Sub PrevStep()
|
||||
Dim iCurStep as Integer
|
||||
If Not bDebugWizard Then
|
||||
On Error Goto RTError
|
||||
End If
|
||||
bConversionIsRunning = False
|
||||
iCurStep = ImportDialog.Step
|
||||
Select Case iCurStep
|
||||
Case 4
|
||||
ImportDialog.cmdCancel.Label = sCancelButton
|
||||
FillStep_Summary()
|
||||
Case 3
|
||||
FillStep_InputPaths(Applcount-1, False)
|
||||
Case 2
|
||||
SaveStep_InputPath
|
||||
If CurOffice > 0 Then
|
||||
CurOffice = CurOffice - 1
|
||||
FillStep_InputPaths(CurOffice, False)
|
||||
Else
|
||||
FillStep_Welcome()
|
||||
bDoKeepApplValues = True
|
||||
End If
|
||||
End Select
|
||||
ImportDialog.cmdGoOn.DefaultButton = True
|
||||
RepaintHeaderPreview()
|
||||
Exit Sub
|
||||
RTError:
|
||||
Msgbox sRTErrorDesc, 16, sRTErrorHeader
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Sub CancelTask()
|
||||
If bConversionIsRunning Then
|
||||
If Msgbox(sConvertError1, 36, sConvertError2) = 6 Then
|
||||
bCancelTask = True
|
||||
bInterruptSearch = True
|
||||
Else
|
||||
bCancelTask = False
|
||||
ImportDialog.cmdCancel.Enabled = True
|
||||
End If
|
||||
Else
|
||||
ImportDialogArea.EndExecute()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Sub TemplateDirSearchDialog()
|
||||
CallDirSearchDialog(ImportDialog.TemplateImportPath)
|
||||
End Sub
|
||||
|
||||
|
||||
Sub RepaintHeaderPreview()
|
||||
Dim Bitmap As Object
|
||||
Dim CurStep as Integer
|
||||
Dim sBitmapPath as String
|
||||
Dim LocPrefix as String
|
||||
CurStep = ImportDialog.Step
|
||||
LocPrefix = WizardMode
|
||||
LocPrefix = ReplaceString(LocPrefix,"XML", "SO")
|
||||
If CurStep = 2 Then
|
||||
sBitmapPath = SOBitmapPath & LocPrefix & "-Import_" & CurStep & "-" & Applications(CurOffice,SBAPPLKEY) + 1 & ".bmp"
|
||||
Else
|
||||
sBitmapPath = SOBitmapPath & "Import_" & CurStep & ".bmp"
|
||||
End If
|
||||
ImportDialog.ImportPreview.ImageURL = sBitmapPath
|
||||
End Sub
|
||||
|
||||
|
||||
Sub CheckModuleInstallation()
|
||||
Dim i as Integer
|
||||
For i = 1 To MaxApplCount
|
||||
ImportDialogArea.GetControl("chk" & WizardMode & "Application" & i).Model.Enabled = Abs(CheckInstalledModule(i-1))
|
||||
Next i
|
||||
End Sub
|
||||
|
||||
|
||||
Function CheckInstalledModule(Index as Integer) as Boolean
|
||||
Dim ModuleName as String
|
||||
Dim NameList() as String
|
||||
Dim MaxIndex as Integer
|
||||
Dim i as Integer
|
||||
ModuleName = ModuleList(Index)
|
||||
If Instr(1,ModuleName,"/") <> 0 Then
|
||||
CheckInstalledModule() = False
|
||||
NameList() = ArrayoutOfString(ModuleName,"/", MaxIndex)
|
||||
For i = 0 To MaxIndex
|
||||
If oFactoryKey.HasByName(NameList(i)) Then
|
||||
CheckInstalledModule() = True
|
||||
End If
|
||||
Next i
|
||||
Else
|
||||
CheckInstalledModule() = oFactoryKey.HasByName(ModuleName)
|
||||
End If
|
||||
End Function
|
||||
|
||||
|
||||
Sub ToggleCheckboxes(oEvent as Object)
|
||||
Dim bMSEnable as Boolean
|
||||
WizardMode = oEvent.Source.Model.Tag
|
||||
bMSEnable = WizardMode = "MS"
|
||||
ToggleCheckBoxesWithBoolean(bMSEnable)
|
||||
End Sub
|
||||
|
||||
|
||||
Sub ToggleCheckboxesWithBoolean(bMSEnable as Boolean)
|
||||
If bMSEnable = True Then
|
||||
WizardMode = SBMICROSOFTMODE
|
||||
MaxApplCount = 3
|
||||
Else
|
||||
WizardMode = SBXMLMODE
|
||||
MaxApplCount = 4
|
||||
End If
|
||||
With ImportDialogArea
|
||||
.GetControl("chkSOApplication1").Model.Enabled = Not bMSEnable
|
||||
.GetControl("chkSOApplication2").Model.Enabled = Not bMSEnable
|
||||
.GetControl("chkSOApplication3").Model.Enabled = Not bMSEnable
|
||||
.GetControl("chkSOApplication4").Model.Enabled = Not bMSEnable
|
||||
.GetControl("chkMSApplication1").Model.Enabled = bMSEnable
|
||||
.GetControl("chkMSApplication2").Model.Enabled = bMSEnable
|
||||
.GetControl("chkMSApplication3").Model.Enabled = bMSEnable
|
||||
End With
|
||||
CheckModuleInstallation()
|
||||
ImportDialog.WelcomeTextLabel2.Enabled = bMSEnable
|
||||
bDoKeepApplValues = False
|
||||
ToggleNextButton()
|
||||
End Sub
|
||||
|
||||
|
||||
Sub ToggleNextButton()
|
||||
Dim iCurStep as Integer
|
||||
Dim bDoEnable as Boolean
|
||||
Dim i as Integer
|
||||
iCurStep = ImportDialog.Step
|
||||
Select Case iCurStep
|
||||
Case 1
|
||||
With ImportDialog
|
||||
If .optMSDocuments.State = 1 Then
|
||||
bDoEnable = .chkMSApplication1.State = 1 Or .chkMSApplication2.State = 1 Or .chkMSApplication3.State = 1
|
||||
Else
|
||||
bDoEnable = .chkSOApplication1.State = 1 Or .chkSOApplication2.State = 1 Or .chkSOApplication3.State = 1 Or .chkSOApplication4.State = 1
|
||||
End If
|
||||
End With
|
||||
bDoKeepApplValues = False
|
||||
Case 2
|
||||
bDoEnable = CheckControlPath(ImportDialog.chkTemplatePath, ImportDialog.txtTemplateImportPath, True)
|
||||
bDoEnable = CheckControlPath(ImportDialog.chkDocumentPath, ImportDialog.txtDocumentImportPath, bDoEnable)
|
||||
End Select
|
||||
ImportDialog.cmdGoOn.Enabled = bDoEnable
|
||||
End Sub
|
||||
|
||||
|
||||
Sub TakeOverPathSettings()
|
||||
'Takes over the Pathsettings from the first selected application to the next applications
|
||||
If Applications(CurOffice,SBDOCSOURCE) = "" Then
|
||||
Applications(CurOffice,SBDOCSOURCE) = Applications(0,SBDOCSOURCE)
|
||||
Applications(CurOffice,SBDOCTARGET) = Applications(0,SBDOCTARGET)
|
||||
If WizardMode = SBXMLMODE AND Applications(CurOffice,SBAPPLKEY) = 3 Then
|
||||
Applications(CurOffice,SBTEMPLSOURCE) = Applications(CurOffice,SBDOCSOURCE)
|
||||
Applications(CurOffice,SBTEMPLTARGET) = Applications(CurOffice,SBDOCTARGET)
|
||||
Else
|
||||
Applications(CurOffice,SBTEMPLSOURCE) = Applications(0,SBTEMPLSOURCE)
|
||||
Applications(CurOffice,SBTEMPLTARGET) = Applications(0,SBTEMPLTARGET)
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Function GetImportWizardPaths() as Boolean
|
||||
SOBitmapPath = GetOfficeSubPath("Template", "../wizard/bitmap")
|
||||
If SOBitmapPath <> "" Then
|
||||
SOWorkPath = GetPathSettings("Work", False)
|
||||
If SOWorkPath <> "" Then
|
||||
SOTemplatePath = GetPathSettings("Template_writable",False,0)
|
||||
If SOTemplatePath <> "" Then
|
||||
GetImportWizardPaths() = True
|
||||
Exit Function
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
GetImportWizardPaths() = False
|
||||
End Function
|
||||
</script:module>
|
||||
@@ -0,0 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
|
||||
<library:library xmlns:library="http://openoffice.org/2000/library" library:name="ImportWizard" library:readonly="true" library:passwordprotected="false">
|
||||
<library:element library:name="ImportDialog"/>
|
||||
</library:library>
|
||||
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE library:library PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "library.dtd">
|
||||
<library:library xmlns:library="http://openoffice.org/2000/library" library:name="ImportWizard" library:readonly="true" library:passwordprotected="false">
|
||||
<library:element library:name="Main"/>
|
||||
<library:element library:name="DialogModul"/>
|
||||
<library:element library:name="Language"/>
|
||||
<library:element library:name="FilesModul"/>
|
||||
<library:element library:name="API"/>
|
||||
</library:library>
|
||||
Reference in New Issue
Block a user