Rearranging menus
This commit is contained in:
parent
9fa7e795a3
commit
6b9701952a
3 changed files with 83 additions and 35 deletions
27
Addons.xcu
27
Addons.xcu
|
@ -10,21 +10,38 @@
|
||||||
<value xml:lang="en">ePublishing</value>
|
<value xml:lang="en">ePublishing</value>
|
||||||
</prop>
|
</prop>
|
||||||
<node oor:name="Submenu">
|
<node oor:name="Submenu">
|
||||||
<node oor:name="HyphenationsConversion" oor:op="replace">
|
<node oor:name="cleanConfigure" oor:op="replace">
|
||||||
<prop oor:name="Context" oor:type="xs:string">
|
<prop oor:name="Context" oor:type="xs:string">
|
||||||
<value>com.sun.star.text.GlobalDocument,com.sun.star.text.TextDocument,com.sun.star.text.WebDocument</value>
|
<value>com.sun.star.text.TextDocument,com.sun.star.text.WebDocument</value>
|
||||||
</prop>
|
</prop>
|
||||||
<prop oor:name="Title" oor:type="xs:string">
|
<prop oor:name="Title" oor:type="xs:string">
|
||||||
<value xml:lang="en">Convert authHyphenations to manual</value>
|
<value xml:lang="en">Configure clean</value>
|
||||||
<value xml:lang="ru">Конвертация автоматических переносов в ручные</value>
|
<value xml:lang="ru">Настройка чистки</value>
|
||||||
</prop>
|
</prop>
|
||||||
<prop oor:name="URL" oor:type="xs:string">
|
<prop oor:name="URL" oor:type="xs:string">
|
||||||
<value>macro:///ePublishing.Hyphenations.convertAutoHyphToManual</value>
|
<value>macro:///Redaction.Configuration.ConfigurationDialog</value>
|
||||||
</prop>
|
</prop>
|
||||||
<prop oor:name="Target" oor:type="xs:string">
|
<prop oor:name="Target" oor:type="xs:string">
|
||||||
<value>_self</value>
|
<value>_self</value>
|
||||||
</prop>
|
</prop>
|
||||||
</node>
|
</node>
|
||||||
|
<node oor:name="convertHyphens" oor:op="replace">
|
||||||
|
<prop oor:name="Context" oor:type="xs:string">
|
||||||
|
<value>com.sun.star.text.TextDocument,com.sun.star.text.WebDocument</value>
|
||||||
|
</prop>
|
||||||
|
<prop oor:name="Title" oor:type="xs:string">
|
||||||
|
<value xml:lang="en">Convert auto hyphenations to manual</value>
|
||||||
|
<value xml:lang="ru">Конвертация автоматических переносов в ручные</value>
|
||||||
|
</prop>
|
||||||
|
<prop oor:name="URL" oor:type="xs:string">
|
||||||
|
<value>macro:///ePublishing.Hyphenations.convertHyphInDoc</value>
|
||||||
|
</prop>
|
||||||
|
<prop oor:name="Target" oor:type="xs:string">
|
||||||
|
<value>_self</value>
|
||||||
|
</prop>
|
||||||
|
</node>
|
||||||
|
|
||||||
|
</node>
|
||||||
</node>
|
</node>
|
||||||
</node>
|
</node>
|
||||||
</node>
|
</node>
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
xmlns:dep="http://openoffice.org/extensions/description/2006"
|
xmlns:dep="http://openoffice.org/extensions/description/2006"
|
||||||
xmlns:xlink="http://www.w3.org/1999/xlink">
|
xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
<identifier value="pro.litvinovg.epublishing" />
|
<identifier value="pro.litvinovg.epublishing" />
|
||||||
<version value="0.0.1" />
|
<version value="0.0.3" />
|
||||||
<platform value="all" />
|
<platform value="all" />
|
||||||
<display-name>
|
<display-name>
|
||||||
<name lang="ru">Инструменты для создания электронных изданий</name>
|
<name lang="ru">Инструменты для создания электронных изданий</name>
|
||||||
|
|
|
@ -1,15 +1,25 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
|
<!DOCTYPE script:module PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "module.dtd">
|
||||||
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Hyphenations" script:language="StarBasic">sub markHyph1
|
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Hyphenations" script:language="StarBasic">Private Sub markHyph2
|
||||||
End sub
|
End sub
|
||||||
Sub convertHyphInDoc()
|
|
||||||
|
Private Sub convertHyphInDoc()
|
||||||
|
|
||||||
|
Dim description As String
|
||||||
|
Dim allNotes As Object
|
||||||
|
dim aNote As Object
|
||||||
|
description = "Запустить конвертацию автоматических переносов в ручные?"
|
||||||
|
If NOT confirm(description) Then
|
||||||
|
Exit Sub
|
||||||
|
EndIf
|
||||||
Dim statusIndicator as Object
|
Dim statusIndicator as Object
|
||||||
statusIndicator = ThisComponent.getCurrentController.StatusIndicator
|
statusIndicator = ThisComponent.getCurrentController.StatusIndicator
|
||||||
statusIndicator.Start("Конвертация переносов, подождите",10)
|
statusIndicator.Start("Произвожу конвертацию, подождите",10)
|
||||||
|
turnOffTracking
|
||||||
AcceptAllTrackedChanges
|
AcceptAllTrackedChanges
|
||||||
convertHyphInText(ThisComponent.Text)
|
convertHyphInText(ThisComponent.Text)
|
||||||
' Globalscope.BasicLibraries.LoadLibrary( "MRILib" )
|
' Globalscope.BasicLibraries.LoadLibrary( "MRILib" )
|
||||||
statusIndicator.Start("Конвертация переносов, подождите",70)
|
statusIndicator.Start("Произвожу конвертацию, подождите",70)
|
||||||
allNotes = ThisComponent.FootNotes
|
allNotes = ThisComponent.FootNotes
|
||||||
For x = 0 to allNotes.Count -1
|
For x = 0 to allNotes.Count -1
|
||||||
aNote = allNotes.getByIndex(x)
|
aNote = allNotes.getByIndex(x)
|
||||||
|
@ -18,9 +28,10 @@ Sub convertHyphInDoc()
|
||||||
'disableAutoHyph()
|
'disableAutoHyph()
|
||||||
statusIndicator.end()
|
statusIndicator.end()
|
||||||
MsgBox "Конвертация переносов успешно завершена."
|
MsgBox "Конвертация переносов успешно завершена."
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
sub disableAutoHyph()
|
Private sub disableAutoHyph()
|
||||||
Dim propertySetInfo As Object
|
Dim propertySetInfo As Object
|
||||||
Dim oPositionOfMatch As Long
|
Dim oPositionOfMatch As Long
|
||||||
oFamilies = ThisComponent.StyleFamilies
|
oFamilies = ThisComponent.StyleFamilies
|
||||||
|
@ -35,7 +46,7 @@ sub disableAutoHyph()
|
||||||
Next
|
Next
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Sub convertHyphInText(textElement)
|
Private Sub convertHyphInText(textElement)
|
||||||
Dim enum1Element As Object
|
Dim enum1Element As Object
|
||||||
Dim enum1 As Object
|
Dim enum1 As Object
|
||||||
Dim i As Integer
|
Dim i As Integer
|
||||||
|
@ -57,7 +68,7 @@ Sub convertHyphInText(textElement)
|
||||||
Wend
|
Wend
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Sub convertParaHyphens(para)
|
Private Sub convertParaHyphens(para)
|
||||||
Dim lineEnd As String
|
Dim lineEnd As String
|
||||||
Dim autoHyphens() As Object
|
Dim autoHyphens() As Object
|
||||||
Dim autoBreaks() As Object
|
Dim autoBreaks() As Object
|
||||||
|
@ -121,23 +132,24 @@ Sub convertParaHyphens(para)
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Sub insertBreak(tCursor As Object)
|
Private Sub insertBreak(tCursor As Object)
|
||||||
'U+200B Zero length space
|
'U+200B Zero length space
|
||||||
tCursor.String = ""
|
tCursor.String = ""
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Function getPrevChar(tCurs As Object)
|
Private Function getPrevChar(tCurs As Object)
|
||||||
tCurs.goLeft(1,true)
|
tCurs.goLeft(1,true)
|
||||||
getPrevChar = tCurs.getString()
|
getPrevChar = tCurs.getString()
|
||||||
tCurs.goRight(1,false)
|
tCurs.goRight(1,false)
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Function getNextChar(tCurs As Object)
|
Private Function getNextChar(tCurs As Object)
|
||||||
tCurs.goRight(1,true)
|
tCurs.goRight(1,true)
|
||||||
getNextChar = tCurs.getString()
|
getNextChar = tCurs.getString()
|
||||||
tCurs.goLeft(1,false)
|
tCurs.goLeft(1,false)
|
||||||
End Function
|
End Function
|
||||||
Sub replaceHyphen(tCurs As Object,lineNumber As Integer)
|
|
||||||
|
Private Sub replaceHyphen(tCurs As Object,lineNumber As Integer)
|
||||||
Dim curLineNum As Integer
|
Dim curLineNum As Integer
|
||||||
Dim vCurs As Object
|
Dim vCurs As Object
|
||||||
Dim tLine As Object
|
Dim tLine As Object
|
||||||
|
@ -160,7 +172,7 @@ Sub replaceHyphen(tCurs As Object,lineNumber As Integer)
|
||||||
EndIf
|
EndIf
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Sub compressLine(tCurs As Object)
|
Private Sub compressLine(tCurs As Object)
|
||||||
Dim vCurs As Object
|
Dim vCurs As Object
|
||||||
Dim tLine As Object
|
Dim tLine As Object
|
||||||
Dim kerning As Integer
|
Dim kerning As Integer
|
||||||
|
@ -222,7 +234,7 @@ Sub compressLine(tCurs As Object)
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Sub stretchLine(tCurs As Object)
|
Private Sub stretchLine(tCurs As Object)
|
||||||
Dim vCurs As Object
|
Dim vCurs As Object
|
||||||
Dim tLine As Object
|
Dim tLine As Object
|
||||||
Dim kerning As Integer
|
Dim kerning As Integer
|
||||||
|
@ -244,7 +256,7 @@ Sub stretchLine(tCurs As Object)
|
||||||
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Function getParaLineNumber(vCursor As Object)
|
Private Function getParaLineNumber(vCursor As Object)
|
||||||
Dim lineNumber As Integer
|
Dim lineNumber As Integer
|
||||||
Dim oSavePosition As Object
|
Dim oSavePosition As Object
|
||||||
Dim tCursor As Object
|
Dim tCursor As Object
|
||||||
|
@ -263,7 +275,7 @@ Function getParaLineNumber(vCursor As Object)
|
||||||
getParaLineNumber = lineNumber
|
getParaLineNumber = lineNumber
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
Function needLineBreak(before,after)
|
Private Function needLineBreak(before,after)
|
||||||
needLineBreak = false
|
needLineBreak = false
|
||||||
If before = "/" Then
|
If before = "/" Then
|
||||||
If after <> " " AND after <> Chr(10) Then
|
If after <> " " AND after <> Chr(10) Then
|
||||||
|
@ -278,7 +290,7 @@ End Sub
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Function needHyphen(before As String, after As String,lineLength As Integer)
|
Private Function needHyphen(before As String, after As String,lineLength As Integer)
|
||||||
Dim charNumBefore as Integer
|
Dim charNumBefore as Integer
|
||||||
Dim charNumAfter as Integer
|
Dim charNumAfter as Integer
|
||||||
needHyphen = true
|
needHyphen = true
|
||||||
|
@ -338,7 +350,7 @@ Dim charNumAfter as Integer
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
|
||||||
sub AcceptAllTrackedChanges
|
Private sub AcceptAllTrackedChanges
|
||||||
rem ----------------------------------------------------------------------
|
rem ----------------------------------------------------------------------
|
||||||
rem define variables
|
rem define variables
|
||||||
dim document as object
|
dim document as object
|
||||||
|
@ -352,5 +364,24 @@ rem ----------------------------------------------------------------------
|
||||||
dispatcher.executeDispatch(document, ".uno:AcceptAllTrackedChanges", "", 0, Array())
|
dispatcher.executeDispatch(document, ".uno:AcceptAllTrackedChanges", "", 0, Array())
|
||||||
|
|
||||||
|
|
||||||
end sub
|
End sub
|
||||||
|
|
||||||
|
Private Sub turnOffTracking
|
||||||
|
document = ThisComponent.CurrentController.Frame
|
||||||
|
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
|
||||||
|
Dim args(0) as new com.sun.star.beans.PropertyValue
|
||||||
|
args(0).Name = "TrackChanges"
|
||||||
|
args(0).Value = false
|
||||||
|
dispatcher.executeDispatch(document, ".uno:TrackChanges", "", 0, args())
|
||||||
|
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Function confirm(description)
|
||||||
|
If MsgBox (description, 4) =6 Then
|
||||||
|
confirm = true
|
||||||
|
Else
|
||||||
|
confirm = false
|
||||||
|
EndIf
|
||||||
|
|
||||||
|
End Function
|
||||||
</script:module>
|
</script:module>
|
Loading…
Add table
Reference in a new issue