mirror of
https://github.com/kekingcn/kkFileView.git
synced 2026-04-19 18:58:37 +00:00
集成OpenOffice替换为LibreOffice
This commit is contained in:
@@ -1,31 +1,27 @@
|
||||
<?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="FormWizard" script:language="StarBasic">Option Explicit
|
||||
|
||||
Public DocumentName as String
|
||||
Public FormPath as String
|
||||
Public WizardPath as String
|
||||
Public WebWizardPath as String
|
||||
Public WorkPath as String
|
||||
Public TempPath as String
|
||||
Public TexturePath as String
|
||||
@@ -93,7 +89,6 @@ Dim SelList(0) as Integer
|
||||
Dim LocList() as String
|
||||
SelList(0) = 0
|
||||
BasicLibraries.LoadLibrary("Tools")
|
||||
BasicLibraries.LoadLibrary("WebWizard")
|
||||
bDebug = False
|
||||
If Not bDebug Then
|
||||
On Local Error GoTo WIZARDERROR
|
||||
@@ -104,7 +99,7 @@ Dim LocList() as String
|
||||
bEnableBinaryOptionGroup = False
|
||||
bDisposeDoc = True
|
||||
MaxIndex = -1
|
||||
If Not InitResources("Formwizard","dbw") Then
|
||||
If Not InitResources("Formwizard") Then
|
||||
Exit Sub
|
||||
End If
|
||||
oDBContext = CreateUnoService("com.sun.star.sdb.DatabaseContext")
|
||||
@@ -156,11 +151,11 @@ Dim LocList() as String
|
||||
DlgFormDB.GetControl("lstTables").SelectItem(sContent, True)
|
||||
Else
|
||||
If CommandType = com.sun.star.sdb.CommandType.QUERY Then
|
||||
SelIndex = IndexInArray(sContent, QueryNames()
|
||||
SelIndex = IndexInArray(sContent, QueryNames())
|
||||
DlgFormDB.GetControl("lstTables").SelectItemPos(SelIndex, True)
|
||||
ElseIf CommandType = com.sun.star.sdb.CommandType.TABLE Then
|
||||
SelIndex = IndexInArray(sContent, TableNames()
|
||||
DlgFormDB.GetControl("lstTables").SelectItemPos(Ubound(QueryNames()+1 + SelIndex, True)
|
||||
SelIndex = IndexInArray(sContent, TableNames())
|
||||
DlgFormDB.GetControl("lstTables").SelectItemPos(Ubound(QueryNames()+1 + SelIndex, True))
|
||||
End If
|
||||
End If
|
||||
CurCommandType = CommandType
|
||||
@@ -189,7 +184,7 @@ Dim LocList() as String
|
||||
ControlCaptionsToStandardLayout()
|
||||
oDocument.GetCurrentController().Frame.ComponentWindow.Enable = True
|
||||
oProgressBar.Value = 90
|
||||
DialogModel.imgTheme.ImageURL = FormPath & "FormWizard_1.bmp"
|
||||
DialogModel.imgTheme.ImageURL = FormPath & "FormWizard_1.png"
|
||||
DialogModel.imgTheme.BackGroundColor = RGB(0,60,126)
|
||||
ToggleDatabasePage(True)
|
||||
oProgressBar.Value = 100
|
||||
@@ -202,11 +197,11 @@ Dim LocList() as String
|
||||
oFormDocuments = oDataSource.getFormDocuments()
|
||||
DlgFormDB.Dispose()
|
||||
oDocument.dispose()
|
||||
Dim bLinkExists as Boolean
|
||||
Dim bLinkExists as Boolean
|
||||
i = 1
|
||||
Dim FormBaseName as String
|
||||
Dim FormBaseName as String
|
||||
FormBaseName = FormName
|
||||
Do
|
||||
Do
|
||||
bLinkExists = oFormDocuments.HasbyHierarchicalName(FormName)
|
||||
If bLinkExists Then
|
||||
i = i + 1
|
||||
@@ -227,7 +222,7 @@ Dim LocList() as String
|
||||
End If
|
||||
If ((Not IsNull(oDBConnection)) And (Not bConnectionIsovergiven)) Then
|
||||
oDBConnection.Dispose()
|
||||
End If
|
||||
End If
|
||||
WIZARDERROR:
|
||||
If Err <> 0 Then
|
||||
Msgbox(sMsgErrMsg, 16, GetProductName())
|
||||
@@ -262,7 +257,7 @@ Dim QueryIndex as Integer
|
||||
CurCommandType = iCommandTypes(SelIndex)
|
||||
End If
|
||||
If CurCommandType = com.sun.star.sdb.CommandType.QUERY Then
|
||||
QueryIndex = SelIndex - Ubound(Tablenames()) - 1
|
||||
QueryIndex = SelIndex - Ubound(Tablenames()) - 1
|
||||
Tablename = QueryNames(QueryIndex)
|
||||
oColumns = oDBConnection.Queries.GetByName(TableName).Columns
|
||||
Else
|
||||
@@ -292,7 +287,7 @@ Sub PreviousStep()
|
||||
.cmdGoOn.Enabled = True
|
||||
.lstSelFields.Tag = Not bControlsareCreated
|
||||
.cmdGoOn.Label = sGoOn
|
||||
.imgTheme.ImageUrl = FormPath & "FormWizard_1.bmp"
|
||||
.imgTheme.ImageUrl = FormPath & "FormWizard_1.png"
|
||||
End With
|
||||
FormSetMoveRights()
|
||||
WIZARDERROR:
|
||||
@@ -327,7 +322,7 @@ Sub NextStep()
|
||||
DlgFormDB.EndExecute()
|
||||
exit Sub
|
||||
End Select
|
||||
DialogModel.imgTheme.ImageUrl = FormPath & "FormWizard_" & DialogModel.Step & ".bmp"
|
||||
DialogModel.imgTheme.ImageUrl = FormPath & "FormWizard_" & DialogModel.Step & ".png"
|
||||
DlgFormDB.Title = WizardTitle(DialogModel.Step)
|
||||
WIZARDERROR:
|
||||
If Err <> 0 Then
|
||||
@@ -391,7 +386,7 @@ End Sub
|
||||
|
||||
|
||||
Sub StoreFormInDatabase()
|
||||
Dim NoArgs() as new com.sun.star.beans.PropertyValue
|
||||
Dim NoArgs() as new com.sun.star.beans.PropertyValue
|
||||
FormName = "Form_" & sDBName & "_" & TableName & ".sxw"
|
||||
sFormUrl = TempPath & "/" & FormName
|
||||
oDocument.StoreAsUrl(sFormUrl, NoArgs())
|
||||
@@ -400,7 +395,6 @@ Sub StoreFormInDatabase()
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Sub StoreForm()
|
||||
Dim sTargetPath as String
|
||||
Dim TypeNames(0,2) as String
|
||||
@@ -416,7 +410,6 @@ Dim oTypes() as Object
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Sub EmptyFieldsListboxes()
|
||||
Dim NullList() as String
|
||||
ToggleListboxControls(DialogModel, False)
|
||||
@@ -438,9 +431,9 @@ dim iSelPos as Integer
|
||||
sFirstItem = oListBox.getItem(0)
|
||||
If sFirstItem = DelEntryName Then
|
||||
iSelPos = oListBox.getSelectedItemPos()
|
||||
oListBox.removeItems(0, 1)
|
||||
oListBox.removeItems(0, 1)
|
||||
If iSelPos > 0 Then
|
||||
oListBox.selectItemPos(iSelPos-1, True)
|
||||
oListBox.selectItemPos(iSelPos-1, True)
|
||||
End If
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Reference in New Issue
Block a user