mirror of
https://gitee.com/kekingcn/file-online-preview.git
synced 2026-06-18 20:07:07 +00:00
集成OpenOffice替换为LibreOffice
This commit is contained in:
@@ -1,31 +1,28 @@
|
||||
<?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="tools" script:language="StarBasic">REM ***** BASIC *****
|
||||
Option Explicit
|
||||
Public Const SBMAXTEXTSIZE = 50
|
||||
|
||||
|
||||
Function SetProgressValue(iValue as Integer)
|
||||
Function SetProgressValue(iValue as Integer)
|
||||
If iValue = 0 Then
|
||||
oProgressbar.End
|
||||
End If
|
||||
@@ -87,7 +84,7 @@ Dim NullValue
|
||||
Else
|
||||
oControl.Model.EffectiveValue = oControl.Model.EffectiveMax
|
||||
End If
|
||||
GetPeerSize() = oPeer.PreferredSize()
|
||||
GetPeerSize() = oPeer.PreferredSize()
|
||||
oControl.Model.EffectiveValue = NullValue
|
||||
ElseIf Not IsMissing(LocText) Then
|
||||
oControl.Text = LocText
|
||||
@@ -109,7 +106,7 @@ Dim NullValue
|
||||
oControl.Text = Mid(SBSIZETEXT,1, SBMAXTEXTSIZE)
|
||||
Else
|
||||
oControl.Text = Mid(SBSIZETEXT,1, oControl.MaxTextLen)
|
||||
End If
|
||||
End If
|
||||
GetPeerSize() = oPeer.PreferredSize()
|
||||
oControl.Text = ""
|
||||
End If
|
||||
@@ -143,7 +140,7 @@ Function PixelTo100thMMY(oControl as Object) as long
|
||||
oPeer = oControl.GetPeer()
|
||||
PixelTo100mmX = Clng(Peer.GetInfo.PixelPerMeterY/100000)
|
||||
|
||||
' PixelTo100thMM = nValue * 28 ' not an exact calculation
|
||||
' PixelTo100thMM = nValue * 28 ' not an exact calculation
|
||||
End function
|
||||
|
||||
|
||||
@@ -170,25 +167,25 @@ Dim OldIndex as Integer
|
||||
End If
|
||||
OldIndex = CurIndex
|
||||
CurIndex = GetCurIndex(DialogModel.lstStyles, Styles(),8)
|
||||
If CurIndex <> OldIndex Then
|
||||
If CurIndex <> OldIndex Then
|
||||
ToggleLayoutPage(False)
|
||||
Dim sImportPath as String
|
||||
sImportPath = Styles(CurIndex, 8)
|
||||
bWithBackGraphic = LoadNewStyles(oDocument, DialogModel, CurIndex, sImportPath, Styles(), TexturePath)
|
||||
ControlCaptionsToStandardLayout()
|
||||
ToggleLayoutPage(True, "lstStyles")
|
||||
ToggleLayoutPage(True, "lstStyles")
|
||||
End If
|
||||
WIZARDERROR:
|
||||
If Err <> 0 Then
|
||||
If Err <> 0 Then
|
||||
Msgbox(sMsgErrMsg, 16, GetProductName())
|
||||
Resume LOCERROR
|
||||
LOCERROR:
|
||||
LOCERROR:
|
||||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Function SetNumerics(ByVal oLocObject as Object, iLocFieldType as Integer) as Object
|
||||
Function SetNumerics(ByVal oLocObject as Object, iLocFieldType as Integer) as Object
|
||||
If CurControlType = cNumericBox Then
|
||||
oLocObject.TreatAsNumber = True
|
||||
Select Case iLocFieldType
|
||||
@@ -228,9 +225,9 @@ Function SetNumerics(ByVal oLocObject as Object, iLocFieldType as Integer) as Ob
|
||||
' Todo Why does this not work?: oLocObject.DefaultDate = CurDefaultValue
|
||||
ElseIf CurControlType = cTimeBox Then ' com.sun.star.sdbc.DataType.DATE, com.sun.star.sdbc.DataType.TIME
|
||||
oLocObject.DefaultTime = CurDefaultValue
|
||||
' Todo: Property TimeFormat? frome where?
|
||||
' Todo: Property TimeFormat? from where?
|
||||
ElseIf CurControlType = cCheckBox Then
|
||||
' Todo Why does this not work?: oLocObject.DefautState = CurDefaultValue
|
||||
' Todo Why does this not work?: oLocObject.DefaultState = CurDefaultValue
|
||||
End If
|
||||
If oLocObject.PropertySetInfo.HasPropertybyName("FormatKey") Then
|
||||
On Local Error Resume Next
|
||||
@@ -326,19 +323,16 @@ End Function
|
||||
Function GetFormWizardPaths() as Boolean
|
||||
FormPath = GetOfficeSubPath("Template","../wizard/bitmap")
|
||||
If FormPath <> "" Then
|
||||
WebWizardPath = GetOfficeSubPath("Template","wizard/web")
|
||||
If WebWizardPath <> "" Then
|
||||
WizardPath = GetOfficeSubPath("Template","wizard/")
|
||||
If Wizardpath <> "" Then
|
||||
TexturePath = GetOfficeSubPath("Gallery", "www-back/")
|
||||
If TexturePath <> "" Then
|
||||
WorkPath = GetPathSettings("Work")
|
||||
If WorkPath <> "" Then
|
||||
TempPath = GetPathSettings("Temp")
|
||||
If TempPath <> "" Then
|
||||
GetFormWizardPaths = True
|
||||
Exit Function
|
||||
End If
|
||||
WizardPath = GetOfficeSubPath("Template","wizard/")
|
||||
If Wizardpath <> "" Then
|
||||
TexturePath = GetOfficeSubPath("Gallery", "backgrounds/")
|
||||
If TexturePath <> "" Then
|
||||
WorkPath = GetPathSettings("Work")
|
||||
If WorkPath <> "" Then
|
||||
TempPath = GetPathSettings("Temp")
|
||||
If TempPath <> "" Then
|
||||
GetFormWizardPaths = True
|
||||
Exit Function
|
||||
End If
|
||||
End If
|
||||
End If
|
||||
|
||||
Reference in New Issue
Block a user