mirror of
https://github.com/kekingcn/kkFileView.git
synced 2026-04-20 00:08:38 +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="Autotext" script:language="StarBasic">Option Explicit
|
||||
|
||||
Public UserfieldDataType(14) as String
|
||||
@@ -44,9 +41,9 @@ Sub Main()
|
||||
On Local Error Goto GENERALERROR
|
||||
' Initialization...
|
||||
BasicLibraries.LoadLibrary("Tools")
|
||||
If InitResources("'Template'", "tpl") Then
|
||||
sGeneralError = GetResText(1302)
|
||||
sTextFieldNotDefined = GetResText(1400)
|
||||
If InitResources("'Template'") Then
|
||||
sGeneralError = GetResText("CorrespondenceMsgError")
|
||||
sTextFieldNotDefined = GetResText("TextField")
|
||||
End If
|
||||
|
||||
UserfieldDatatype(0) = "COMPANY"
|
||||
@@ -128,7 +125,7 @@ Sub CreateUserDatafield(oCursor, sFoundContent as String)
|
||||
oUserfield = oDocAuto.CreateInstance("com.sun.star.text.TextField.ExtendedUser")
|
||||
sFoundList() = ArrayoutofString(sFoundContent,":",MaxIndex)
|
||||
UserInfo = UCase(LTrim(sFoundList(1)))
|
||||
UserIndex = IndexinArray(UserInfo, UserfieldDatatype())
|
||||
UserIndex = IndexInArray(UserInfo, UserfieldDatatype())
|
||||
If UserIndex <> -1 Then
|
||||
oUserField.UserDatatype = UserIndex
|
||||
oCursor.Text.InsertTextContent(oCursor,oUserField,True)
|
||||
|
||||
@@ -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="Correspondence" script:language="StarBasic">Option Explicit
|
||||
|
||||
Public msgNoTextmark$, msgError$
|
||||
@@ -62,16 +59,16 @@ End Sub
|
||||
|
||||
|
||||
Function LoadLanguageCorrespondence() as Boolean
|
||||
If InitResources("'Template'", "tpl") Then
|
||||
msgNoTextmark$ = GetResText(1303) & Chr(13) & Chr(10) & GetResText(1301)
|
||||
msgError$ = GetResText(1302)
|
||||
If InitResources("'Template'") Then
|
||||
msgNoTextmark$ = GetResText("CorrespondenceDialog_0") & Chr(13) & Chr(10) & GetResText("CorrespondenceNoTextmark_1")
|
||||
msgError$ = GetResText("CorrespondenceMsgError")
|
||||
If bTemplate Then
|
||||
DialogModel.Title = GetResText(1303+3)
|
||||
DialogModel.CmdCancel.Label = GetResText(1102)
|
||||
DialogModel.CmdCorrGoOn.Label = GetResText(1103)
|
||||
DialogModel.OptSingle.Label = GetResText(1303 + 1)
|
||||
DialogModel.Optmerge.Label = GetResText(1303 + 2)
|
||||
DialogModel.FrmLetter.Label = GetResText(1303)
|
||||
DialogModel.Title = GetResText("CorrespondenceDialog_3")
|
||||
DialogModel.CmdCancel.Label = GetResText("STYLES_2")
|
||||
DialogModel.CmdCorrGoOn.Label = GetResText("STYLES_3")
|
||||
DialogModel.OptSingle.Label = GetResText("CorrespondenceDialog_1")
|
||||
DialogModel.Optmerge.Label = GetResText("CorrespondenceDialog_2")
|
||||
DialogModel.FrmLetter.Label = GetResText("CorrespondenceDialog_0")
|
||||
End If
|
||||
LoadLanguageCorrespondence() = True
|
||||
Else
|
||||
@@ -133,7 +130,7 @@ Dim bDBvalid as Boolean
|
||||
oDBAccess = GetRegistryKeyContent("org.openoffice.Office.DataAccess/AddressBook/")
|
||||
sAddressbook = oDBAccess.DataSourceName
|
||||
If sAddressbook = "" Then
|
||||
MsgBox(GetResText(1301))
|
||||
MsgBox(GetResText("CorrespondenceNoTextmark_1"))
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
@@ -233,72 +230,72 @@ Dim bCorrectField as Boolean
|
||||
oFieldMaster = oDocument.createInstance("com.sun.star.text.TextField.JumpEdit")
|
||||
Select Case sColName
|
||||
Case "Company"
|
||||
oFieldMaster.PlaceHolder = getResText(1350+1)
|
||||
oFieldMaster.PlaceHolder = getResText("CorrespondenceFields_1")
|
||||
Case "Department"
|
||||
oFieldMaster.PlaceHolder = getResText(1350+2)
|
||||
oFieldMaster.PlaceHolder = getResText("CorrespondenceFields_2")
|
||||
Case "FirstName"
|
||||
oFieldMaster.PlaceHolder = getResText(1350+3)
|
||||
oFieldMaster.PlaceHolder = getResText("CorrespondenceFields_3")
|
||||
Case "LastName"
|
||||
oFieldMaster.PlaceHolder = getResText(1350+4)
|
||||
oFieldMaster.PlaceHolder = getResText("CorrespondenceFields_4")
|
||||
Case "Street"
|
||||
oFieldMaster.PlaceHolder = getResText(1350+5)
|
||||
oFieldMaster.PlaceHolder = getResText("CorrespondenceFields_5")
|
||||
Case "Country"
|
||||
oFieldMaster.PlaceHolder = getResText(1350+6)
|
||||
oFieldMaster.PlaceHolder = getResText("CorrespondenceFields_6")
|
||||
Case "Zip"
|
||||
oFieldMaster.PlaceHolder = getResText(1350+7)
|
||||
oFieldMaster.PlaceHolder = getResText("CorrespondenceFields_7")
|
||||
Case "City"
|
||||
oFieldMaster.PlaceHolder = getResText(1350+8)
|
||||
oFieldMaster.PlaceHolder = getResText("CorrespondenceFields_8")
|
||||
Case "Title"
|
||||
oFieldMaster.PlaceHolder = getResText(1350+9)
|
||||
oFieldMaster.PlaceHolder = getResText("CorrespondenceFields_9")
|
||||
Case "Position"
|
||||
oFieldMaster.PlaceHolder = getResText(1350+10)
|
||||
oFieldMaster.PlaceHolder = getResText("CorrespondenceFields_10")
|
||||
Case "AddrForm"
|
||||
oFieldMaster.PlaceHolder = getResText(1350+11)
|
||||
oFieldMaster.PlaceHolder = getResText("CorrespondenceFields_11")
|
||||
Case "Code"
|
||||
oFieldMaster.PlaceHolder = getResText(1350+12)
|
||||
oFieldMaster.PlaceHolder = getResText("CorrespondenceFields_12")
|
||||
Case "AddrFormMail"
|
||||
oFieldMaster.PlaceHolder = getResText(1350+13)
|
||||
oFieldMaster.PlaceHolder = getResText("CorrespondenceFields_13")
|
||||
Case "PhonePriv"
|
||||
oFieldMaster.PlaceHolder = getResText(1350+14)
|
||||
oFieldMaster.PlaceHolder = getResText("CorrespondenceFields_14")
|
||||
Case "PhoneComp"
|
||||
oFieldMaster.PlaceHolder = getResText(1350+15)
|
||||
oFieldMaster.PlaceHolder = getResText("CorrespondenceFields_15")
|
||||
Case "Fax"
|
||||
oFieldMaster.PlaceHolder = getResText(1350+16)
|
||||
oFieldMaster.PlaceHolder = getResText("CorrespondenceFields_16")
|
||||
Case "EMail"
|
||||
oFieldMaster.PlaceHolder = getResText(1350+17)
|
||||
oFieldMaster.PlaceHolder = getResText("CorrespondenceFields_17")
|
||||
Case "URL"
|
||||
oFieldMaster.PlaceHolder = getResText(1350+18)
|
||||
oFieldMaster.PlaceHolder = getResText("CorrespondenceFields_18")
|
||||
Case "Note"
|
||||
oFieldMaster.PlaceHolder = getResText(1350+19)
|
||||
oFieldMaster.PlaceHolder = getResText("CorrespondenceFields_19")
|
||||
Case "Altfield1"
|
||||
oFieldMaster.PlaceHolder = getResText(1350+20)
|
||||
oFieldMaster.PlaceHolder = getResText("CorrespondenceFields_20")
|
||||
Case "Altfield2"
|
||||
oFieldMaster.PlaceHolder = getResText(1350+21)
|
||||
oFieldMaster.PlaceHolder = getResText("CorrespondenceFields_21")
|
||||
Case "Altfield3"
|
||||
oFieldMaster.PlaceHolder = getResText(1350+22)
|
||||
oFieldMaster.PlaceHolder = getResText("CorrespondenceFields_22")
|
||||
Case "Altfield4"
|
||||
oFieldMaster.PlaceHolder = getResText(1350+23)
|
||||
oFieldMaster.PlaceHolder = getResText("CorrespondenceFields_23")
|
||||
Case "Id"
|
||||
oFieldMaster.PlaceHolder = getResText(1350+24)
|
||||
oFieldMaster.PlaceHolder = getResText("CorrespondenceFields_24")
|
||||
Case "State"
|
||||
oFieldMaster.PlaceHolder = getResText(1350+25)
|
||||
oFieldMaster.PlaceHolder = getResText("CorrespondenceFields_25")
|
||||
Case "PhoneOffice"
|
||||
oFieldMaster.PlaceHolder = getResText(1350+26)
|
||||
oFieldMaster.PlaceHolder = getResText("CorrespondenceFields_26")
|
||||
Case "Pager"
|
||||
oFieldMaster.PlaceHolder = getResText(1350+27)
|
||||
oFieldMaster.PlaceHolder = getResText("CorrespondenceFields_27")
|
||||
Case "PhoneCell"
|
||||
oFieldMaster.PlaceHolder = getResText(1350+28)
|
||||
oFieldMaster.PlaceHolder = getResText("CorrespondenceFields_28")
|
||||
Case "PhoneOther"
|
||||
oFieldMaster.PlaceHolder = getResText(1350+29)
|
||||
oFieldMaster.PlaceHolder = getResText("CorrespondenceFields_29")
|
||||
Case "CalendarURL"
|
||||
oFieldMaster.PlaceHolder = getResText(1350+30)
|
||||
oFieldMaster.PlaceHolder = getResText("CorrespondenceFields_30")
|
||||
Case "InviteParticipant"
|
||||
oFieldMaster.PlaceHolder = getResText(1350+31)
|
||||
oFieldMaster.PlaceHolder = getResText("CorrespondenceFields_31")
|
||||
Case Else
|
||||
bCorrectField = False
|
||||
End Select
|
||||
If bCorrectField Then
|
||||
oFieldMaster.Hint = getResText(1350)
|
||||
oFieldMaster.Hint = getResText("CorrespondenceFields_0")
|
||||
oBookText.InsertTextContent(oBookMarkCursor, oFieldMaster, True)
|
||||
End If
|
||||
End If
|
||||
|
||||
@@ -1,25 +1,22 @@
|
||||
<?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.
|
||||
*
|
||||
***********************************************************-->
|
||||
<!--
|
||||
* 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 .
|
||||
-->
|
||||
<dlg:window xmlns:dlg="http://openoffice.org/2000/dialog" xmlns:script="http://openoffice.org/2000/script" dlg:id="DialogStyles" dlg:left="170" dlg:top="93" dlg:width="120" dlg:height="169" dlg:help-url="HID:WIZARDS_HID_DLGSTYLES_DIALOG" dlg:closeable="true" dlg:moveable="true">
|
||||
<dlg:bulletinboard>
|
||||
<dlg:button dlg:id="cmdCancel" dlg:tab-index="0" dlg:left="5" dlg:top="150" dlg:width="50" dlg:height="13" dlg:help-url="HID:WIZARDS_HID_DLGSTYLES_CANCEL" dlg:value="cmdCancel">
|
||||
@@ -32,4 +29,4 @@
|
||||
<script:event script:event-name="on-itemstatechange" script:macro-name="vnd.sun.star.script:Template.Samples.SelectStyle?language=Basic&location=application" script:language="Script"/>
|
||||
</dlg:menulist>
|
||||
</dlg:bulletinboard>
|
||||
</dlg:window>
|
||||
</dlg:window>
|
||||
@@ -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="ModuleAgenda" script:language="StarBasic">' All variables must be declared before use
|
||||
Option Explicit
|
||||
|
||||
@@ -48,14 +45,14 @@ End Sub
|
||||
|
||||
|
||||
Sub LoadLanguageAgenda()
|
||||
If InitResources("'Template'", "tpl") Then
|
||||
DlgAgenda_gMyName = GetResText(1200)
|
||||
DialogModel.CmdCancel.Label = GetResText(1102)
|
||||
DialogModel.CmdAgdGoon.Label = GetResText(1103)
|
||||
' DlgAgenda_gMsgNoCancel$ = GetResText(1201)
|
||||
DialogModel.FrmAgenda.Label = GetResText(1202)
|
||||
DialogModel.OptAgenda1.Label = GetResText(1203)
|
||||
DialogModel.OptAgenda2.Label = GetResText(1204)
|
||||
If InitResources("'Template'") Then
|
||||
DlgAgenda_gMyName = GetResText("AgendaDlgName")
|
||||
DialogModel.CmdCancel.Label = GetResText("STYLES_2")
|
||||
DialogModel.CmdAgdGoon.Label = GetResText("STYLES_3")
|
||||
' DlgAgenda_gMsgNoCancel$ = GetResText("AgendaDlgNoCancel")
|
||||
DialogModel.FrmAgenda.Label = GetResText("AgendaDlgFrame")
|
||||
DialogModel.OptAgenda1.Label = GetResText("AgendaDlgButton1")
|
||||
DialogModel.OptAgenda2.Label = GetResText("AgendaDlgButton2")
|
||||
' DialogModel.OptAgenda1.State = 1
|
||||
End If
|
||||
End Sub
|
||||
|
||||
@@ -1,31 +1,26 @@
|
||||
<?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="Samples" script:language="StarBasic">Option Explicit
|
||||
|
||||
Const SAMPLES = 1000
|
||||
Const STYLES = 1100
|
||||
Const NumStyles = 18
|
||||
Const aTempFileName = "Berend_Ilko_Tom_Stella_Volker.stc"
|
||||
Public Const Twip = 425
|
||||
Dim oUcbObject as Object
|
||||
Public StylesDir as String
|
||||
Public StylesDialog as Object
|
||||
@@ -38,52 +33,6 @@ Public aTempURL as String
|
||||
|
||||
Public Files(100) as String
|
||||
|
||||
|
||||
'--------------------------------------------------------------------------------------
|
||||
'Miscellaneous Section starts here
|
||||
|
||||
Function PrepareForEditing(Optional ByVal oDocument)
|
||||
'This sub is called when sample documents are loaded (load event).
|
||||
'It checks whether the documents is read-only, in which case it
|
||||
'offers the user to create a new (writable) document using the original
|
||||
'as a template.
|
||||
Dim DocPath as String
|
||||
Dim MMessage as String
|
||||
Dim MTitle as String
|
||||
Dim RValue as Integer
|
||||
Dim oNewDocument as Object
|
||||
Dim mFileProperties(1) as New com.sun.star.beans.PropertyValue
|
||||
PrepareForEditing = NULL
|
||||
BasicLibraries.LoadLibrary( "Tools" )
|
||||
If InitResources("'Template'", "tpl") then
|
||||
If IsMissing(oDocument) Then
|
||||
oDocument = ThisComponent
|
||||
End If
|
||||
If oDocument.IsReadOnly then
|
||||
MMessage = GetResText(SAMPLES)
|
||||
MTitle = GetResText(SAMPLES + 1)
|
||||
RValue = Msgbox(MMessage, (128+48+1), MTitle)
|
||||
If RValue = 1 Then
|
||||
DocPath = oDocument.URL
|
||||
mFileProperties(0).Name = "AsTemplate"
|
||||
mFileProperties(0).Value = True
|
||||
mFileProperties(1).Name = "MacroExecutionMode"
|
||||
mFileProperties(1).Value = com.sun.star.document.MacroExecMode.USE_CONFIG
|
||||
|
||||
oNewDocument = StarDesktop.LoadComponentFromURL(DocPath,"_default",0, mFileProperties())
|
||||
PrepareForEditing() = oNewDocument
|
||||
DisposeDocument(oDocument)
|
||||
Else
|
||||
PrepareForEditing() = NULL
|
||||
End If
|
||||
Else
|
||||
PrepareForEditing() = oDocument
|
||||
End If
|
||||
End If
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
'--------------------------------------------------------------------------------------
|
||||
'Calc Style Section starts here
|
||||
|
||||
@@ -92,11 +41,14 @@ Sub ShowStyles
|
||||
Dim TemplateDir, ActFileTitle, DisplayDummy as String
|
||||
Dim sFilterName(0) as String
|
||||
Dim StyleNames() as String
|
||||
Dim LocalizedStyleNames(NumStyles,2) As String
|
||||
Dim LocalizedStyleName As String
|
||||
Dim t as Integer
|
||||
Dim MaxIndex as Integer
|
||||
BasicLibraries.LoadLibrary("Tools")
|
||||
If InitResources("'Template'", "tpl") then
|
||||
oDocument = ThisComponent
|
||||
Dim StyleNameDef As Variant
|
||||
BasicLibraries.LoadLibrary("Tools")
|
||||
If InitResources("'Template'") then
|
||||
oDocument = ThisComponent
|
||||
If oDocument.SupportsService("com.sun.star.sheet.SpreadsheetDocument") Then
|
||||
ToggleWindow(False)
|
||||
oUcbObject = createUnoService("com.sun.star.ucb.SimpleFileAccess")
|
||||
@@ -107,11 +59,22 @@ Dim MaxIndex as Integer
|
||||
TemplateDir = GetPathSettings("Template", False, 0)
|
||||
StylesDir = GetOfficeSubPath("Template", "wizard/styles/")
|
||||
sQueryPath = GetOfficeSubPath("Template", "../wizard/bitmap/")
|
||||
DialogModel.Title = GetResText(STYLES)
|
||||
DialogModel.cmdCancel.Label = GetResText(STYLES+2)
|
||||
DialogModel.cmdOk.Label = GetResText(STYLES+3)
|
||||
DialogModel.Title = GetResText("STYLES_0")
|
||||
DialogModel.cmdCancel.Label = GetResText("STYLES_2")
|
||||
DialogModel.cmdOk.Label = GetResText("STYLES_3")
|
||||
StyleNameDef = Array("(Standard)", "Autumn Leaves", "Be", "Black and White", "Blackberry Bush", "Blue Jeans", "Fifties Diner", "Glacier", "Green Grapes", "Marine", "Millennium", "Nature", "Neon", "Night", "PC Nostalgia", "Pastel", "Pool Party", "Pumpkin")
|
||||
For t = 0 to NumStyles - 1
|
||||
LocalizedStyleNames(t,0) = StyleNameDef(t)
|
||||
LocalizedStyleNames(t,1) = GetResText("STYLENAME_" & Trim(Str(t)))
|
||||
Next t
|
||||
Stylenames() = ReadDirectories(StylesDir, False, False, True,)
|
||||
MaxIndex = Ubound(Stylenames())
|
||||
For t = 0 to MaxIndex
|
||||
LocalizedStyleName = StringInMultiArray(LocalizedStyleNames(), StyleNames(t,1), 0, 1)
|
||||
If LocalizedStyleName <> "" Then
|
||||
StyleNames(t,1) = LocalizedStyleName
|
||||
End If
|
||||
Next t
|
||||
BubbleSortList(Stylenames(),True)
|
||||
Dim cStyles(MaxIndex)
|
||||
For t = 0 to MaxIndex
|
||||
@@ -137,8 +100,8 @@ Dim Position as Integer
|
||||
If Position > -1 Then
|
||||
ToggleWindow(False)
|
||||
StylePath = Files(Position)
|
||||
aOptions(0).Name = "OverwriteStyles"
|
||||
aOptions(0).Value = true
|
||||
aOptions(0).Name = "OverwriteStyles"
|
||||
aOptions(0).Value = true
|
||||
oFamilies.loadStylesFromURL(StylePath, aOptions())
|
||||
ToggleWindow(True)
|
||||
End If
|
||||
@@ -146,9 +109,9 @@ End Sub
|
||||
|
||||
|
||||
Sub SaveCurrentStyles(oDocument as Object)
|
||||
'This sub stores the current document in the user work directory
|
||||
On Error Goto ErrorOcurred
|
||||
aTempURL = GetPathSettings("Work", False)
|
||||
'This sub stores the current document in the directory to hold temporary files.
|
||||
On Error Goto ErrorOccurred
|
||||
aTempURL = GetPathSettings("Temp", False)
|
||||
Dim aRightMost as String
|
||||
aRightMost = Right(aTempURL, 1)
|
||||
if aRightMost = "/" Then
|
||||
@@ -163,8 +126,8 @@ Sub SaveCurrentStyles(oDocument as Object)
|
||||
oDocument.storeToURL(aTempURL, NoArgs())
|
||||
Exit Sub
|
||||
|
||||
ErrorOcurred:
|
||||
MsgBox(GetResText( STYLES+1 ), 16, GetResText( STYLES ))
|
||||
ErrorOccurred:
|
||||
MsgBox(GetResText("STYLES_1"), 16, GetResText("STYLES_0"))
|
||||
On Local Error Goto 0
|
||||
End Sub
|
||||
|
||||
@@ -174,8 +137,8 @@ Sub RestoreCurrentStyles
|
||||
ToggleWindow(False)
|
||||
On Local Error Goto NoFile
|
||||
If FileExists(aTempURL) Then
|
||||
aOptions(0).Name = "OverwriteStyles"
|
||||
aOptions(0).Value = true
|
||||
aOptions(0).Name = "OverwriteStyles"
|
||||
aOptions(0).Value = true
|
||||
oFamilies.LoadStylesFromURL(aTempURL, aOptions())
|
||||
KillTempFile()
|
||||
End If
|
||||
|
||||
@@ -1,25 +1,22 @@
|
||||
<?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.
|
||||
*
|
||||
***********************************************************-->
|
||||
<!--
|
||||
* 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 .
|
||||
-->
|
||||
<dlg:window xmlns:dlg="http://openoffice.org/2000/dialog" xmlns:script="http://openoffice.org/2000/script" dlg:id="TemplateDialog" dlg:left="170" dlg:top="93" dlg:width="220" dlg:height="60" dlg:page="1" dlg:help-url="HID:WIZARDS_HID_DLGCORRESPONDENCE_DIALOG" dlg:closeable="true" dlg:moveable="true">
|
||||
<dlg:bulletinboard>
|
||||
<dlg:radiogroup>
|
||||
@@ -46,4 +43,4 @@
|
||||
<dlg:fixedline dlg:id="FrmLetter" dlg:tab-index="7" dlg:left="6" dlg:top="6" dlg:width="150" dlg:height="10" dlg:page="2" dlg:value="FrmLetter"/>
|
||||
<dlg:fixedline dlg:id="FrmAgenda" dlg:tab-index="8" dlg:left="6" dlg:top="6" dlg:width="150" dlg:height="10" dlg:page="1" dlg:value="FrmAgenda"/>
|
||||
</dlg:bulletinboard>
|
||||
</dlg:window>
|
||||
</dlg:window>
|
||||
Reference in New Issue
Block a user