集成OpenOffice替换为LibreOffice

This commit is contained in:
陈精华
2021-06-23 10:26:22 +08:00
parent 8a1eebb9b0
commit 79341b2c8e
14724 changed files with 2184695 additions and 551131 deletions

View File

@@ -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
&apos; Initialization...
BasicLibraries.LoadLibrary(&quot;Tools&quot;)
If InitResources(&quot;&apos;Template&apos;&quot;, &quot;tpl&quot;) Then
sGeneralError = GetResText(1302)
sTextFieldNotDefined = GetResText(1400)
If InitResources(&quot;&apos;Template&apos;&quot;) Then
sGeneralError = GetResText(&quot;CorrespondenceMsgError&quot;)
sTextFieldNotDefined = GetResText(&quot;TextField&quot;)
End If
UserfieldDatatype(0) = &quot;COMPANY&quot;
@@ -128,7 +125,7 @@ Sub CreateUserDatafield(oCursor, sFoundContent as String)
oUserfield = oDocAuto.CreateInstance(&quot;com.sun.star.text.TextField.ExtendedUser&quot;)
sFoundList() = ArrayoutofString(sFoundContent,&quot;:&quot;,MaxIndex)
UserInfo = UCase(LTrim(sFoundList(1)))
UserIndex = IndexinArray(UserInfo, UserfieldDatatype())
UserIndex = IndexInArray(UserInfo, UserfieldDatatype())
If UserIndex &lt;&gt; -1 Then
oUserField.UserDatatype = UserIndex
oCursor.Text.InsertTextContent(oCursor,oUserField,True)

View File

@@ -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(&quot;&apos;Template&apos;&quot;, &quot;tpl&quot;) Then
msgNoTextmark$ = GetResText(1303) &amp; Chr(13) &amp; Chr(10) &amp; GetResText(1301)
msgError$ = GetResText(1302)
If InitResources(&quot;&apos;Template&apos;&quot;) Then
msgNoTextmark$ = GetResText(&quot;CorrespondenceDialog_0&quot;) &amp; Chr(13) &amp; Chr(10) &amp; GetResText(&quot;CorrespondenceNoTextmark_1&quot;)
msgError$ = GetResText(&quot;CorrespondenceMsgError&quot;)
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(&quot;CorrespondenceDialog_3&quot;)
DialogModel.CmdCancel.Label = GetResText(&quot;STYLES_2&quot;)
DialogModel.CmdCorrGoOn.Label = GetResText(&quot;STYLES_3&quot;)
DialogModel.OptSingle.Label = GetResText(&quot;CorrespondenceDialog_1&quot;)
DialogModel.Optmerge.Label = GetResText(&quot;CorrespondenceDialog_2&quot;)
DialogModel.FrmLetter.Label = GetResText(&quot;CorrespondenceDialog_0&quot;)
End If
LoadLanguageCorrespondence() = True
Else
@@ -133,7 +130,7 @@ Dim bDBvalid as Boolean
oDBAccess = GetRegistryKeyContent(&quot;org.openoffice.Office.DataAccess/AddressBook/&quot;)
sAddressbook = oDBAccess.DataSourceName
If sAddressbook = &quot;&quot; Then
MsgBox(GetResText(1301))
MsgBox(GetResText(&quot;CorrespondenceNoTextmark_1&quot;))
Exit Sub
End If
End If
@@ -233,72 +230,72 @@ Dim bCorrectField as Boolean
oFieldMaster = oDocument.createInstance(&quot;com.sun.star.text.TextField.JumpEdit&quot;)
Select Case sColName
Case &quot;Company&quot;
oFieldMaster.PlaceHolder = getResText(1350+1)
oFieldMaster.PlaceHolder = getResText(&quot;CorrespondenceFields_1&quot;)
Case &quot;Department&quot;
oFieldMaster.PlaceHolder = getResText(1350+2)
oFieldMaster.PlaceHolder = getResText(&quot;CorrespondenceFields_2&quot;)
Case &quot;FirstName&quot;
oFieldMaster.PlaceHolder = getResText(1350+3)
oFieldMaster.PlaceHolder = getResText(&quot;CorrespondenceFields_3&quot;)
Case &quot;LastName&quot;
oFieldMaster.PlaceHolder = getResText(1350+4)
oFieldMaster.PlaceHolder = getResText(&quot;CorrespondenceFields_4&quot;)
Case &quot;Street&quot;
oFieldMaster.PlaceHolder = getResText(1350+5)
oFieldMaster.PlaceHolder = getResText(&quot;CorrespondenceFields_5&quot;)
Case &quot;Country&quot;
oFieldMaster.PlaceHolder = getResText(1350+6)
oFieldMaster.PlaceHolder = getResText(&quot;CorrespondenceFields_6&quot;)
Case &quot;Zip&quot;
oFieldMaster.PlaceHolder = getResText(1350+7)
oFieldMaster.PlaceHolder = getResText(&quot;CorrespondenceFields_7&quot;)
Case &quot;City&quot;
oFieldMaster.PlaceHolder = getResText(1350+8)
oFieldMaster.PlaceHolder = getResText(&quot;CorrespondenceFields_8&quot;)
Case &quot;Title&quot;
oFieldMaster.PlaceHolder = getResText(1350+9)
oFieldMaster.PlaceHolder = getResText(&quot;CorrespondenceFields_9&quot;)
Case &quot;Position&quot;
oFieldMaster.PlaceHolder = getResText(1350+10)
oFieldMaster.PlaceHolder = getResText(&quot;CorrespondenceFields_10&quot;)
Case &quot;AddrForm&quot;
oFieldMaster.PlaceHolder = getResText(1350+11)
oFieldMaster.PlaceHolder = getResText(&quot;CorrespondenceFields_11&quot;)
Case &quot;Code&quot;
oFieldMaster.PlaceHolder = getResText(1350+12)
oFieldMaster.PlaceHolder = getResText(&quot;CorrespondenceFields_12&quot;)
Case &quot;AddrFormMail&quot;
oFieldMaster.PlaceHolder = getResText(1350+13)
oFieldMaster.PlaceHolder = getResText(&quot;CorrespondenceFields_13&quot;)
Case &quot;PhonePriv&quot;
oFieldMaster.PlaceHolder = getResText(1350+14)
oFieldMaster.PlaceHolder = getResText(&quot;CorrespondenceFields_14&quot;)
Case &quot;PhoneComp&quot;
oFieldMaster.PlaceHolder = getResText(1350+15)
oFieldMaster.PlaceHolder = getResText(&quot;CorrespondenceFields_15&quot;)
Case &quot;Fax&quot;
oFieldMaster.PlaceHolder = getResText(1350+16)
oFieldMaster.PlaceHolder = getResText(&quot;CorrespondenceFields_16&quot;)
Case &quot;EMail&quot;
oFieldMaster.PlaceHolder = getResText(1350+17)
oFieldMaster.PlaceHolder = getResText(&quot;CorrespondenceFields_17&quot;)
Case &quot;URL&quot;
oFieldMaster.PlaceHolder = getResText(1350+18)
oFieldMaster.PlaceHolder = getResText(&quot;CorrespondenceFields_18&quot;)
Case &quot;Note&quot;
oFieldMaster.PlaceHolder = getResText(1350+19)
oFieldMaster.PlaceHolder = getResText(&quot;CorrespondenceFields_19&quot;)
Case &quot;Altfield1&quot;
oFieldMaster.PlaceHolder = getResText(1350+20)
oFieldMaster.PlaceHolder = getResText(&quot;CorrespondenceFields_20&quot;)
Case &quot;Altfield2&quot;
oFieldMaster.PlaceHolder = getResText(1350+21)
oFieldMaster.PlaceHolder = getResText(&quot;CorrespondenceFields_21&quot;)
Case &quot;Altfield3&quot;
oFieldMaster.PlaceHolder = getResText(1350+22)
oFieldMaster.PlaceHolder = getResText(&quot;CorrespondenceFields_22&quot;)
Case &quot;Altfield4&quot;
oFieldMaster.PlaceHolder = getResText(1350+23)
oFieldMaster.PlaceHolder = getResText(&quot;CorrespondenceFields_23&quot;)
Case &quot;Id&quot;
oFieldMaster.PlaceHolder = getResText(1350+24)
oFieldMaster.PlaceHolder = getResText(&quot;CorrespondenceFields_24&quot;)
Case &quot;State&quot;
oFieldMaster.PlaceHolder = getResText(1350+25)
oFieldMaster.PlaceHolder = getResText(&quot;CorrespondenceFields_25&quot;)
Case &quot;PhoneOffice&quot;
oFieldMaster.PlaceHolder = getResText(1350+26)
oFieldMaster.PlaceHolder = getResText(&quot;CorrespondenceFields_26&quot;)
Case &quot;Pager&quot;
oFieldMaster.PlaceHolder = getResText(1350+27)
oFieldMaster.PlaceHolder = getResText(&quot;CorrespondenceFields_27&quot;)
Case &quot;PhoneCell&quot;
oFieldMaster.PlaceHolder = getResText(1350+28)
oFieldMaster.PlaceHolder = getResText(&quot;CorrespondenceFields_28&quot;)
Case &quot;PhoneOther&quot;
oFieldMaster.PlaceHolder = getResText(1350+29)
oFieldMaster.PlaceHolder = getResText(&quot;CorrespondenceFields_29&quot;)
Case &quot;CalendarURL&quot;
oFieldMaster.PlaceHolder = getResText(1350+30)
oFieldMaster.PlaceHolder = getResText(&quot;CorrespondenceFields_30&quot;)
Case &quot;InviteParticipant&quot;
oFieldMaster.PlaceHolder = getResText(1350+31)
oFieldMaster.PlaceHolder = getResText(&quot;CorrespondenceFields_31&quot;)
Case Else
bCorrectField = False
End Select
If bCorrectField Then
oFieldMaster.Hint = getResText(1350)
oFieldMaster.Hint = getResText(&quot;CorrespondenceFields_0&quot;)
oBookText.InsertTextContent(oBookMarkCursor, oFieldMaster, True)
End If
End If

View File

@@ -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&amp;location=application" script:language="Script"/>
</dlg:menulist>
</dlg:bulletinboard>
</dlg:window>
</dlg:window>

View File

@@ -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">&apos; All variables must be declared before use
Option Explicit
@@ -48,14 +45,14 @@ End Sub
Sub LoadLanguageAgenda()
If InitResources(&quot;&apos;Template&apos;&quot;, &quot;tpl&quot;) Then
DlgAgenda_gMyName = GetResText(1200)
DialogModel.CmdCancel.Label = GetResText(1102)
DialogModel.CmdAgdGoon.Label = GetResText(1103)
&apos; DlgAgenda_gMsgNoCancel$ = GetResText(1201)
DialogModel.FrmAgenda.Label = GetResText(1202)
DialogModel.OptAgenda1.Label = GetResText(1203)
DialogModel.OptAgenda2.Label = GetResText(1204)
If InitResources(&quot;&apos;Template&apos;&quot;) Then
DlgAgenda_gMyName = GetResText(&quot;AgendaDlgName&quot;)
DialogModel.CmdCancel.Label = GetResText(&quot;STYLES_2&quot;)
DialogModel.CmdAgdGoon.Label = GetResText(&quot;STYLES_3&quot;)
&apos; DlgAgenda_gMsgNoCancel$ = GetResText(&quot;AgendaDlgNoCancel&quot;)
DialogModel.FrmAgenda.Label = GetResText(&quot;AgendaDlgFrame&quot;)
DialogModel.OptAgenda1.Label = GetResText(&quot;AgendaDlgButton1&quot;)
DialogModel.OptAgenda2.Label = GetResText(&quot;AgendaDlgButton2&quot;)
&apos; DialogModel.OptAgenda1.State = 1
End If
End Sub

View File

@@ -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 = &quot;Berend_Ilko_Tom_Stella_Volker.stc&quot;
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
&apos;--------------------------------------------------------------------------------------
&apos;Miscellaneous Section starts here
Function PrepareForEditing(Optional ByVal oDocument)
&apos;This sub is called when sample documents are loaded (load event).
&apos;It checks whether the documents is read-only, in which case it
&apos;offers the user to create a new (writable) document using the original
&apos;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( &quot;Tools&quot; )
If InitResources(&quot;&apos;Template&apos;&quot;, &quot;tpl&quot;) 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 = &quot;AsTemplate&quot;
mFileProperties(0).Value = True
mFileProperties(1).Name = &quot;MacroExecutionMode&quot;
mFileProperties(1).Value = com.sun.star.document.MacroExecMode.USE_CONFIG
oNewDocument = StarDesktop.LoadComponentFromURL(DocPath,&quot;_default&quot;,0, mFileProperties())
PrepareForEditing() = oNewDocument
DisposeDocument(oDocument)
Else
PrepareForEditing() = NULL
End If
Else
PrepareForEditing() = oDocument
End If
End If
End Function
&apos;--------------------------------------------------------------------------------------
&apos;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(&quot;Tools&quot;)
If InitResources(&quot;&apos;Template&apos;&quot;, &quot;tpl&quot;) then
oDocument = ThisComponent
Dim StyleNameDef As Variant
BasicLibraries.LoadLibrary(&quot;Tools&quot;)
If InitResources(&quot;&apos;Template&apos;&quot;) then
oDocument = ThisComponent
If oDocument.SupportsService(&quot;com.sun.star.sheet.SpreadsheetDocument&quot;) Then
ToggleWindow(False)
oUcbObject = createUnoService(&quot;com.sun.star.ucb.SimpleFileAccess&quot;)
@@ -107,11 +59,22 @@ Dim MaxIndex as Integer
TemplateDir = GetPathSettings(&quot;Template&quot;, False, 0)
StylesDir = GetOfficeSubPath(&quot;Template&quot;, &quot;wizard/styles/&quot;)
sQueryPath = GetOfficeSubPath(&quot;Template&quot;, &quot;../wizard/bitmap/&quot;)
DialogModel.Title = GetResText(STYLES)
DialogModel.cmdCancel.Label = GetResText(STYLES+2)
DialogModel.cmdOk.Label = GetResText(STYLES+3)
DialogModel.Title = GetResText(&quot;STYLES_0&quot;)
DialogModel.cmdCancel.Label = GetResText(&quot;STYLES_2&quot;)
DialogModel.cmdOk.Label = GetResText(&quot;STYLES_3&quot;)
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(&quot;STYLENAME_&quot; &amp; 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 &lt;&gt; "" 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 &gt; -1 Then
ToggleWindow(False)
StylePath = Files(Position)
aOptions(0).Name = &quot;OverwriteStyles&quot;
aOptions(0).Value = true
aOptions(0).Name = &quot;OverwriteStyles&quot;
aOptions(0).Value = true
oFamilies.loadStylesFromURL(StylePath, aOptions())
ToggleWindow(True)
End If
@@ -146,9 +109,9 @@ End Sub
Sub SaveCurrentStyles(oDocument as Object)
&apos;This sub stores the current document in the user work directory
On Error Goto ErrorOcurred
aTempURL = GetPathSettings(&quot;Work&quot;, False)
&apos;This sub stores the current document in the directory to hold temporary files.
On Error Goto ErrorOccurred
aTempURL = GetPathSettings(&quot;Temp&quot;, False)
Dim aRightMost as String
aRightMost = Right(aTempURL, 1)
if aRightMost = &quot;/&quot; 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(&quot;STYLES_1&quot;), 16, GetResText(&quot;STYLES_0&quot;))
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 = &quot;OverwriteStyles&quot;
aOptions(0).Value = true
aOptions(0).Name = &quot;OverwriteStyles&quot;
aOptions(0).Value = true
oFamilies.LoadStylesFromURL(aTempURL, aOptions())
KillTempFile()
End If

View File

@@ -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>