Compare commits

...

10 commits

9 changed files with 246 additions and 28 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.12" />
<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

@ -1,6 +1,7 @@
<?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="PageStyles" script:language="StarBasic" script:moduleType="normal"> Dim pDialog As Object
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="PageStyles" script:language="StarBasic" script:moduleType="normal">
Dim pDialog As Object
Sub pageStylesDialog
Dim listBox As Object
@ -356,8 +357,8 @@ Function covertMMtoLong(dimension As String) As Long
convertMMtoLong = -1
Exit Function
EndIf
dimension = customReplace(dimension, &quot;,&quot;, &quot;.&quot;)
If Not IsNumeric(dimension) Then
dimension = customReplace(dimension, &quot;.&quot;, &quot;,&quot;)
If Not IsNumeric( dimension ) Then
convertMMtoLong = -1
Exit Function
EndIf

View file

@ -18,6 +18,7 @@ Sub makeLinksWithLevel(level)
Dim outline() As Object
Dim oAnchor1Name As String
Dim oAnchor2Name As String
Dim message As String
Dim i As Integer
heading = getHeadingWithLevel(level)
outline = getOutlineWithLevel(level)
@ -31,7 +32,10 @@ Sub makeLinksWithLevel(level)
createLink(outline(i),&quot;&quot;,oAnchor2Name)
Next i
Else
MsgBox getTranslation(&quot;TOCErrorContentsNotMatchHeadings1&quot;) &amp; &quot; &quot; &amp; level &amp; &quot; (&quot; &amp; (Ubound(outline)+1) &amp; getTranslation(&quot;TOCErrorContentsNotMatchHeadings2&quot;) &amp; &quot; &quot; &amp; level &amp; &quot; &quot; &amp; getTranslation(&quot;TOCErrorContentsNotMatchHeadings3&quot;) &amp; (Ubound(heading)+1) &amp; &quot;)&quot;
message = getTranslation(&quot;TOCErrorContentsNotMatchHeadings1&quot;) &amp; &quot; &quot; &amp; level &amp; &quot; (&quot; &amp; (Ubound(outline)+1) &amp;&quot;) &quot; &amp; _
getTranslation(&quot;TOCErrorContentsNotMatchHeadings2&quot;) &amp; &quot; &quot; &amp; level &amp; &quot; &quot; &amp; _
getTranslation(&quot;TOCErrorContentsNotMatchHeadings3&quot;) &amp; &quot; (&quot; &amp; (Ubound(heading)+1) &amp; &quot;)&quot;
showTOCLinksDialog(message, heading(), outline() )
EndIf
ElseIf Ubound(outline) = -1 Then
&apos; MsgBox (getTranslation(&quot;TOCErrorNoContents1&quot;) &amp; &quot; &quot; &amp; level &amp; &quot; &quot; &amp; getTranslation(&quot;TOCErrorNoContents2&quot;))
@ -131,6 +135,95 @@ Function getOutlineWithLevel(curNum)
getOutlineWithLevel = par()
End Function
Sub showTOCLinksDialog(message As String, heading() As Object, outline() As Object)
Dim pDialog As Object
Dim grid As Object
Dim headingsColumn As Object
Dim tocColumn As Object
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
Dim headingCell As String
DialogLibraries.LoadLibrary(&quot;ePublishing&quot;)
pDialog = CreateUnoDialog( DialogLibraries.ePublishing.toc_links )
&apos;grid = pDialog.getControl(&quot;grid&quot;)
grid = pDialog.Model.createInstance(&quot;com.sun.star.awt.grid.UnoControlGridModel&quot;)
grid.Name = &quot;tocGrid&quot;
grid.ShowColumnHeader = True
grid.ShowRowHeader = True
grid.VScroll = true
grid.Sizeable = true
grid.Step = 0
oColumnModel = createUnoService( &quot;com.sun.star.awt.grid.DefaultGridColumnModel&quot;)
tocColumn = createUnoService( &quot;com.sun.star.awt.grid.GridColumn&quot;)
tocColumn.Title = getTranslation(&quot;tocItemText&quot;)
tocColumn.ColumnWidth = 100
tocColumn.Resizeable = true
&apos;tocColumn.Flexibility = true
oColumnModel.addColumn( tocColumn )
headingsColumn = createUnoService( &quot;com.sun.star.awt.grid.GridColumn&quot;)
headingsColumn.Title = getTranslation(&quot;headingItemText&quot;)
headingsColumn.ColumnWidth = 100
headingsColumn.Resizeable = true
&apos;headingsColumn.Flexibility = true
oColumnModel.addColumn( headingsColumn )
grid.ColumnModel = oColumnModel
&apos;grid.Sizeable = False
&apos;gridStep = 0
oDataModel = createUnoService( &quot;com.sun.star.awt.grid.DefaultGridDataModel&quot;)
If Ubound(outline) &gt; Ubound(heading) Then
For i = 0 To (Ubound(outline))
outlineCell = outline(i).getString()
j = i MOD (Ubound(heading) + 1)
headingCell = heading(j).getString()
oDataModel.addRow ( i+1 , Array(outlineCell, headingCell) )
Next
Else
For i = 0 To (Ubound(heading))
headingCell = heading(i).getString()
If i &gt; Ubound(outline) Then
outlineCell = &quot;&quot;
Else
outlineCell = outline(i).getString()
EndIf
oDataModel.addRow ( i+1 , Array(outlineCell, headingCell) )
Next i
EndIf
grid.GridDataModel = oDataModel
oGridControl = createUnoService(&quot;com.sun.star.awt.grid.UnoControlGrid&quot;)
oGridControl.setModel(grid)
pDialog.addControl(&quot;gridtab&quot;, oGridControl)
rect = pDialog.getPosSize()
oGridControl.setPosSize(10,60,rect.Width - 20,rect.Height - 120, com.sun.star.awt.PosSize.POSSIZE)
pDialog.getControl(&quot;Ok&quot;).Label = getTranslation(&quot;buttonOk&quot;)
pDialog.getControl(&quot;message&quot;).SetText(message)
pDialog.Title = getTranslation(&quot;tocDialogLabel&quot;)
pDialog.Execute()
pDialog.dispose()
End Sub
Sub addToArray(xArray(),vNextElement)
Dim iUB As Integer
Dim iLB As Integer

View file

@ -29,7 +29,7 @@ End Function
Function getRussian(identifier As String) As String
Select Case identifier
Case &quot;buttonOk&quot;
getRussian = &quot;Применить&quot;
getRussian = &quot;OK&quot;
Exit Function
Case &quot;buttonCancel&quot;
getRussian = &quot;Отмена&quot;
@ -140,10 +140,10 @@ Function getRussian(identifier As String) As String
getRussian = &quot;Число параграфов со стилем Оглавление &quot;
Exit Function
Case &quot;TOCErrorContentsNotMatchHeadings2&quot;
getRussian = &quot;) не кратно числу Заголовоков&quot;
getRussian = &quot; не кратно числу Заголовоков&quot;
Exit Function
Case &quot;TOCErrorContentsNotMatchHeadings3&quot;
getRussian = &quot;уровня (&quot;
getRussian = &quot;уровня &quot;
Exit Function
Case &quot;complileJournalIssueConfirmation&quot;
getRussian = &quot;Вы уверены, что хотите запустить сборку выпуска ?&quot;
@ -295,6 +295,15 @@ Function getRussian(identifier As String) As String
Case &quot;EndnotesConversionTwoOptions&quot;
getRussian = &quot;Найдены и стандартные и ручные концевые сноски. Можно сконвертировать стандартные в ручные (установите курсор в нужном параграфе) или ручные в стандартные&quot;
Exit Function
Case &quot;tocDialogLabel&quot;
getRussian = &quot;Ошибка&quot;
Exit Function
Case &quot;tocItemText&quot;
getRussian = &quot;Текст оглавления&quot;
Exit Function
Case &quot;headingItemText&quot;
getRussian = &quot;Текст заголовка&quot;
Exit Function
Case Else
getRussian = &quot;Перевод не найден&quot;
End Select
@ -415,10 +424,10 @@ Function getEnglish(identifier As String) As String
getEnglish = &quot;Number of paras with style Contents &quot;
Exit Function
Case &quot;TOCErrorContentsNotMatchHeadings2&quot;
getEnglish = &quot;) dosn&apos;t match number of headings with &quot;
getEnglish = &quot; dosn&apos;t match number of headings with &quot;
Exit Function
Case &quot;TOCErrorContentsNotMatchHeadings3&quot;
getEnglish = &quot;level (&quot;
getEnglish = &quot;level &quot;
Exit Function
Case &quot;complileJournalIssueConfirmation&quot;
getEnglish = &quot;Compile journal issue from articles?&quot;
@ -570,6 +579,15 @@ Function getEnglish(identifier As String) As String
Case &quot;EndnotesConversionTwoOptions&quot;
getEnglish = &quot;Both standard and manual endnotes are found. You can convert standard to manual (place the cursor in the desired paragraph) or manual to standard&quot;
Exit Function
Case &quot;tocDialogLabel&quot;
getEnglish = &quot;Error&quot;
Exit Function
Case &quot;tocItemText&quot;
getEnglish = &quot;Contents item text&quot;
Exit Function
Case &quot;headingItemText&quot;
getEnglish = &quot;Heading text&quot;
Exit Function
Case Else
getEnglish = &quot;No translation&quot;
End Select
@ -689,10 +707,10 @@ Function getFrench(identifier As String) As String
getFrench = &quot;Nombre de paragraphes avec style Table des matières.&quot;
Exit Function
Case &quot;TOCErrorContentsNotMatchHeadings2&quot;
getFrench = &quot;) n&apos;est pas un multiple du nombre de titres&quot;
getFrench = &quot; n&apos;est pas un multiple du nombre de titres&quot;
Exit Function
Case &quot;TOCErrorContentsNotMatchHeadings3&quot;
getFrench = &quot;au niveau (&quot;
getFrench = &quot;au niveau &quot;
Exit Function
Case &quot;complileJournalIssueConfirmation&quot;
getFrench = &quot;Êtes-vous sûr de vouloir compiler un journal à partir d&apos;articles ?&quot;
@ -844,6 +862,15 @@ Function getFrench(identifier As String) As String
Case &quot;EndnotesConversionTwoOptions&quot;
getFrench = &quot;Des notes de fin standard et manuelles sont trouvées. Vous pouvez convertir standard en manuel (placez le curseur dans le paragraphe souhaité) ou manuel en standard&quot;
Exit Function
Case &quot;tocDialogLabel&quot;
getFrench = &quot;Erreur&quot;
Exit Function
Case &quot;tocItemText&quot;
getFrench = &quot;Texte de l&apos;élément de contenu&quot;
Exit Function
Case &quot;headingItemText&quot;
getFrench = &quot;Texte d&apos;en-tête&quot;
Exit Function
Case Else
getFrench = &quot;No translation&quot;
End Select
@ -963,10 +990,10 @@ Function getCroatian(identifier As String) As String
getCroatian = &quot;Broj paragrafa sa stilom Sadržaj&quot;
Exit Function
Case &quot;TOCErrorContentsNotMatchHeadings2&quot;
getCroatian = &quot;) nije višestruko od broja Zaglavlja&quot;
getCroatian = &quot; nije višestruko od broja Zaglavlja&quot;
Exit Function
Case &quot;TOCErrorContentsNotMatchHeadings3&quot;
getCroatian = &quot;Nivoa (&quot;
getCroatian = &quot;Nivoa &quot;
Exit Function
Case &quot;complileJournalIssueConfirmation&quot;
getCroatian = &quot;Da li ste sigurni da želite da pokrenete gradnju izdanja ?&quot;
@ -1118,6 +1145,15 @@ Function getCroatian(identifier As String) As String
Case &quot;EndnotesConversionTwoOptions&quot;
getCroatian = &quot;Pronađene su i standardne i ručne bilješke. Možete pretvoriti standardni u ručni (postavite kursor u željeni odlomak) ili ručni u standardni&quot;
Exit Function
Case &quot;tocDialogLabel&quot;
getCroatian = &quot;Pogreška&quot;
Exit Function
Case &quot;tocItemText&quot;
getCroatian = &quot;Sadržaj teksta stavke&quot;
Exit Function
Case &quot;headingItemText&quot;
getCroatian = &quot;Tekst zaglavlja&quot;
Exit Function
Case Else
getCroatian = &quot;No translation&quot;
End Select
@ -1237,10 +1273,10 @@ Function getSerbian(identifier As String) As String
getSerbian = &quot;Број параграфа са стилом Садржај&quot;
Exit Function
Case &quot;TOCErrorContentsNotMatchHeadings2&quot;
getSerbian = &quot;) није вишеструко од броја Заглавља&quot;
getSerbian = &quot; није вишеструко од броја Заглавља&quot;
Exit Function
Case &quot;TOCErrorContentsNotMatchHeadings3&quot;
getSerbian = &quot;Нивоа (&quot;
getSerbian = &quot;Нивоа &quot;
Exit Function
Case &quot;complileJournalIssueConfirmation&quot;
getSerbian = &quot;Да ли сте сигурни да желите да покренете градњу издања ?&quot;
@ -1392,6 +1428,15 @@ Function getSerbian(identifier As String) As String
Case &quot;EndnotesConversionTwoOptions&quot;
getSerbian = &quot;Пронађене су и стандардне и ручне белешке. Можете претворити стандардни у ручни (поставите курсор у жељени одломак) или ручни у стандардни&quot;
Exit Function
Case &quot;tocDialogLabel&quot;
getSerbian = &quot;Грешка&quot;
Exit Function
Case &quot;tocItemText&quot;
getSerbian = &quot;Садржај текста ставке&quot;
Exit Function
Case &quot;headingItemText&quot;
getSerbian = &quot;Текст заглавља&quot;
Exit Function
Case Else
getSerbian = &quot;No translation&quot;
End Select
@ -1511,10 +1556,10 @@ Function getBosnian(identifier As String) As String
getBosnian = &quot;Broj paragrafa sa stilom Sadržaj&quot;
Exit Function
Case &quot;TOCErrorContentsNotMatchHeadings2&quot;
getBosnian = &quot;) nije višestruko od broja Zaglavlja&quot;
getBosnian = &quot; nije višestruko od broja Zaglavlja&quot;
Exit Function
Case &quot;TOCErrorContentsNotMatchHeadings3&quot;
getBosnian = &quot;Nivoa (&quot;
getBosnian = &quot;Nivoa &quot;
Exit Function
Case &quot;complileJournalIssueConfirmation&quot;
getBosnian = &quot;Da li ste sigurni da želite da pokrenete gradnju izdanja ?&quot;
@ -1666,6 +1711,15 @@ Function getBosnian(identifier As String) As String
Case &quot;EndnotesConversionTwoOptions&quot;
getBosnian = &quot;Pronađene su i standardne i ručne bilješke. Možete pretvoriti standardni u ručni (postavite kursor u željeni odlomak) ili ručni u standardni&quot;
Exit Function
Case &quot;tocDialogLabel&quot;
getBosnian = &quot;Greška&quot;
Exit Function
Case &quot;tocItemText&quot;
getBosnian = &quot;Sadržaj teksta stavke&quot;
Exit Function
Case &quot;headingItemText&quot;
getBosnian = &quot;Tekst zaglavlja&quot;
Exit Function
Case Else
getBosnian = &quot;No translation&quot;
End Select

View file

@ -5,4 +5,5 @@
<library:element library:name="replaceParaStyle"/>
<library:element library:name="PageConfig"/>
<library:element library:name="EndnotesConversion"/>
<library:element library:name="toc_links"/>
</library:library>

View file

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE dlg:window PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "dialog.dtd">
<dlg:window xmlns:dlg="http://openoffice.org/2000/dialog" xmlns:script="http://openoffice.org/2000/script" dlg:id="toc_links" dlg:left="74" dlg:top="15" dlg:width="346" dlg:height="284" dlg:closeable="true" dlg:moveable="true">
<dlg:bulletinboard>
<dlg:button dlg:id="Ok" dlg:tab-index="0" dlg:left="125" dlg:top="265" dlg:width="96" dlg:height="17" dlg:value="CommandButton1" dlg:button-type="ok"/>
<dlg:text dlg:id="message" dlg:tab-index="1" dlg:left="5" dlg:top="4" dlg:width="334" dlg:height="24" dlg:value="message" dlg:align="center" dlg:multiline="true"/>
</dlg:bulletinboard>
</dlg:window>

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.12" />
<version value="0.7.16" />
<update-download>
<src xlink:href="https://dev.litvinovg.pro/litvinovg/epublishing/uploads/1a8a542e9db7b8e13fec0123f86fba85/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" />

Binary file not shown.