Compare commits

...

5 commits

5 changed files with 78 additions and 15 deletions

View file

@ -3,7 +3,7 @@
xmlns:dep="http://openoffice.org/extensions/description/2006"
xmlns:xlink="http://www.w3.org/1999/xlink">
<identifier value="pro.litvinovg.epublishing" />
<version value="0.7.14" />
<version value="0.7.16" />
<platform value="all" />
<display-name>
<name lang="ru">Инструменты для создания электронных изданий</name>

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Archive" script:language="StarBasic" script:moduleType="normal">Sub archMark27
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Archive" script:language="StarBasic" script:moduleType="normal">Sub archMark29
End Sub
@ -1118,8 +1118,10 @@ End Sub
Sub replaceParaStyle
dim oldStyleName As String
dim oldStyleNameLocalized As String
dim oldStyle As Object
dim newStyleName As String
dim newStyleNameLocalized As String
dim paragraphStyles As Object
dim userInput As Integer
Dim listBox As Object
@ -1151,11 +1153,11 @@ Sub replaceParaStyle
listBox.addItems(sortedDPSN , 0)
oDialog.Title = getTranslation(&quot;replaceParaStyleDialogTitle&quot;)
oDialog.Execute()
newStyleName = oDialog.model.Tag
If newStyleName=&quot;0&quot; or newStyleName=&quot;&quot; Then
newStyleNameLocalized = oDialog.model.Tag
If newStyleNameLocalized=&quot;0&quot; or newStyleNameLocalized=&quot;&quot; Then
Exit sub
EndIf
foundIndex = getIndex(displayParaStyleNames, newStyleName)
foundIndex = getIndex(displayParaStyleNames, newStyleNameLocalized)
&apos;set style system name instead of display name
newStyleName = paraStyleNames(foundIndex)
@ -1163,11 +1165,10 @@ Sub replaceParaStyle
MsgBox getTranslation(&quot;replaceParaStyleStylesEqualsNotification&quot;)
Exit sub
EndIf
If oldStyleName &lt;&gt; &quot;&quot; Then
oldStyle = paraStyles.getByName(oldStyleName)
If NOT oldStyle.isUserDefined Then
MsgBox getTranslation(&quot;replaceParaStyleCurrentStyleIsStandard&quot;)
replaceDefaultParaStyle(getLocalizedParaStyleName(oldStyleName), newStyleNameLocalized)
Exit sub
EndIf
oldStyle.ParentStyle = newStyleName
@ -1185,10 +1186,70 @@ Sub replaceParaStyle
EndIf
EndIf
Wend
End Sub
Function getLocalizedParaStyleName(styleName as String) As String
Dim style As Object
Dim styles As Object
styles = ThisComponent.StyleFamilies
style = styles.getByName(styles.elementNames(1)).getByName(styleName)
getLocalizedParaStyleName = style.DisplayName
End Function
sub replaceDefaultParaStyle(fromStyle As String, toStyle As String)
dim document as object
dim dispatcher as object
document = ThisComponent.CurrentController.Frame
dispatcher = createUnoService(&quot;com.sun.star.frame.DispatchHelper&quot;)
dim args1(21) as new com.sun.star.beans.PropertyValue
args1(0).Name = &quot;SearchItem.StyleFamily&quot;
args1(0).Value = 2
args1(1).Name = &quot;SearchItem.CellType&quot;
args1(1).Value = 0
args1(2).Name = &quot;SearchItem.RowDirection&quot;
args1(2).Value = true
args1(3).Name = &quot;SearchItem.AllTables&quot;
args1(3).Value = false
args1(4).Name = &quot;SearchItem.SearchFiltered&quot;
args1(4).Value = false
args1(5).Name = &quot;SearchItem.Backward&quot;
args1(5).Value = false
args1(6).Name = &quot;SearchItem.Pattern&quot;
args1(6).Value = true
args1(7).Name = &quot;SearchItem.Content&quot;
args1(7).Value = false
args1(8).Name = &quot;SearchItem.AsianOptions&quot;
args1(8).Value = false
args1(9).Name = &quot;SearchItem.AlgorithmType&quot;
args1(9).Value = 0
args1(10).Name = &quot;SearchItem.SearchFlags&quot;
args1(10).Value = 65536
args1(11).Name = &quot;SearchItem.SearchString&quot;
args1(11).Value = fromStyle
args1(12).Name = &quot;SearchItem.ReplaceString&quot;
args1(12).Value = toStyle
args1(13).Name = &quot;SearchItem.Locale&quot;
args1(13).Value = 255
args1(14).Name = &quot;SearchItem.ChangedChars&quot;
args1(14).Value = 2
args1(15).Name = &quot;SearchItem.DeletedChars&quot;
args1(15).Value = 2
args1(16).Name = &quot;SearchItem.InsertedChars&quot;
args1(16).Value = 2
args1(17).Name = &quot;SearchItem.TransliterateFlags&quot;
args1(17).Value = 1280
args1(18).Name = &quot;SearchItem.Command&quot;
args1(18).Value = 3
args1(19).Name = &quot;SearchItem.SearchFormatted&quot;
args1(19).Value = false
args1(20).Name = &quot;SearchItem.AlgorithmType2&quot;
args1(20).Value = 1
args1(21).Name = &quot;Quiet&quot;
args1(21).Value = true
dispatcher.executeDispatch(document, &quot;.uno:ExecuteSearch&quot;, &quot;&quot;, 0, args1())
end sub
Function getIndex(array As variant, value As variant) As Integer
Dim id As Integer
Dim nRight As Integer

View file

@ -378,4 +378,4 @@ Function customReplace(Source As String, Search As String, NewPart As String) As
customReplace = Result
End Function
</script:module>
</script:module>

View file

@ -144,6 +144,7 @@ Sub showTOCLinksDialog(message As String, heading() As Object, outline() As Obje
Dim oGridControl As Object
Dim oColumnModel As Object
Dim oDataModel As Object
Dim rect As Object
Dim i As Integer
Dim j As Integer
Dim outlineCell As String
@ -155,7 +156,7 @@ Sub showTOCLinksDialog(message As String, heading() As Object, outline() As Obje
grid = pDialog.Model.createInstance(&quot;com.sun.star.awt.grid.UnoControlGridModel&quot;)
grid.Name = &quot;tocGrid&quot;
grid.ShowColumnHeader = True
grid.ShowRowHeader = false
grid.ShowRowHeader = True
grid.VScroll = true
grid.Sizeable = true
grid.Step = 0
@ -206,7 +207,8 @@ Sub showTOCLinksDialog(message As String, heading() As Object, outline() As Obje
oGridControl = createUnoService(&quot;com.sun.star.awt.grid.UnoControlGrid&quot;)
oGridControl.setModel(grid)
pDialog.addControl(&quot;gridtab&quot;, oGridControl)
oGridControl.setPosSize(10,40,850,550, 15)
rect = pDialog.getPosSize()
oGridControl.setPosSize(10,60,rect.Width - 20,rect.Height - 120, com.sun.star.awt.PosSize.POSSIZE)
@ -237,4 +239,4 @@ Sub addToArray(xArray(),vNextElement)
xArray(iUB) = vNextElement
End Sub
</script:module>
</script:module>

View file

@ -2,9 +2,9 @@
<description xmlns="http://openoffice.org/extensions/update/2006"
xmlns:xlink="http://www.w3.org/1999/xlink">
<identifier value="pro.litvinovg.epublishing"/>
<version value="0.7.14" />
<version value="0.7.16" />
<update-download>
<src xlink:href="https://dev.litvinovg.pro/litvinovg/epublishing/uploads/32a96686fd2b6aed6b29070afcdc88dd/epublishing.oxt" />
<src xlink:href="https://dev.litvinovg.pro/litvinovg/epublishing/uploads/9e6d9eaeb144d7a67e94c8460492a040/epublishing.oxt" />
</update-download>
<release-notes>
<src xlink:href="https://dev.litvinovg.pro/litvinovg/epublishing/-/raw/master/releasenotes.txt" lang="en" />