Added check for colored text areas
This commit is contained in:
parent
9846e2933c
commit
fae0f0b494
4 changed files with 89 additions and 14 deletions
|
@ -2,11 +2,11 @@
|
|||
<!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="Navigator" dlg:left="0" dlg:top="50" dlg:width="100" dlg:height="123" dlg:closeable="true" dlg:moveable="true">
|
||||
<dlg:bulletinboard>
|
||||
<dlg:text dlg:id="description" dlg:tab-index="1" dlg:left="2" dlg:top="5" dlg:width="96" dlg:height="47" dlg:value="описание объектов для навигации" dlg:multiline="true"/>
|
||||
<dlg:text dlg:id="description" dlg:tab-index="1" dlg:left="2" dlg:top="5" dlg:width="96" dlg:height="47" dlg:value="описание объектов для навигации" dlg:align="center" dlg:multiline="true"/>
|
||||
<dlg:button dlg:id="close" dlg:tab-index="2" dlg:left="2" dlg:top="105" dlg:width="96" dlg:height="15" dlg:value="Закрыть навигатор" dlg:toggled="1"/>
|
||||
<dlg:button dlg:id="next" dlg:tab-index="0" dlg:left="67" dlg:top="70" dlg:width="30" dlg:height="30" dlg:toggled="1"/>
|
||||
<dlg:text dlg:id="current" dlg:tab-index="4" dlg:left="36" dlg:top="81" dlg:width="28" dlg:height="15" dlg:value="current"/>
|
||||
<dlg:text dlg:id="found" dlg:tab-index="5" dlg:left="2" dlg:top="55" dlg:width="96" dlg:height="12" dlg:value="Всего найдено"/>
|
||||
<dlg:text dlg:id="current" dlg:tab-index="4" dlg:left="36" dlg:top="81" dlg:width="28" dlg:height="15" dlg:value="current" dlg:align="center"/>
|
||||
<dlg:text dlg:id="found" dlg:tab-index="5" dlg:left="2" dlg:top="55" dlg:width="96" dlg:height="12" dlg:value="Всего найдено" dlg:align="center"/>
|
||||
<dlg:button dlg:id="prev" dlg:tab-index="3" dlg:left="3" dlg:top="70" dlg:width="30" dlg:height="30" dlg:valign="center" dlg:toggled="1"/>
|
||||
</dlg:bulletinboard>
|
||||
</dlg:window>
|
|
@ -293,6 +293,12 @@ Function getRussian(identifier As String) As String
|
|||
Case "navigatorFound"
|
||||
getRussian = "Всего найдено: "
|
||||
Exit Function
|
||||
Case "coloredTextDescription"
|
||||
getRussian = "Навигация по выделенному цветом тексту"
|
||||
Exit Function
|
||||
Case "foundColoredTextMessage"
|
||||
getRussian = "Найден текст c непрозрачным фоном. Обычно это не подходит для электронных публикаций. Вместо белого цвета фона используйте «Без заливки»"
|
||||
Exit Function
|
||||
Case Else
|
||||
getRussian = "Перевод не найден"
|
||||
End Select
|
||||
|
@ -568,6 +574,12 @@ Function getEnglish(identifier As String) As String
|
|||
Case "navigatorFound"
|
||||
getEnglish = "Total found: "
|
||||
Exit Function
|
||||
Case "coloredTextDescription"
|
||||
getEnglish = "Navigation over highlighted text"
|
||||
Exit Function
|
||||
Case "foundColoredTextMessage"
|
||||
getEnglish = "Found text with an opaque background. This is usually not suitable for electronic publishing. Use „No Fill“ instead of a white background "
|
||||
Exit Function
|
||||
Case Else
|
||||
getEnglish = "No translation"
|
||||
End Select
|
||||
|
@ -842,6 +854,12 @@ Function getCroatian(identifier As String) As String
|
|||
Case "navigatorFound"
|
||||
getCroatian = "Ukupno pronađeno: "
|
||||
Exit Function
|
||||
Case "coloredTextDescription"
|
||||
getCroatian = "Navigacija istaknutim tekstom "
|
||||
Exit Function
|
||||
Case "foundColoredTextMessage"
|
||||
getCroatian = "Pronađen tekst s neprozirnom pozadinom. To obično nije prikladno za elektroničko izdavanje. Upotrijebite „Bez popunjavanja“ umjesto bijele pozadine "
|
||||
Exit Function
|
||||
Case Else
|
||||
getCroatian = "No translation"
|
||||
End Select
|
||||
|
@ -1116,6 +1134,12 @@ Function getSerbian(identifier As String) As String
|
|||
Case "navigatorFound"
|
||||
getSerbian = "Укупно пронађено: "
|
||||
Exit Function
|
||||
Case "coloredTextDescription"
|
||||
getSerbian = "Навигација по истакнутом тексту "
|
||||
Exit Function
|
||||
Case "foundColoredTextMessage"
|
||||
getSerbian = "Пронађен је текст са непрозирном позадином. Ово обично није погодно за електронско издавање. Користите „Без попуњавања“ уместо беле позадине "
|
||||
Exit Function
|
||||
Case Else
|
||||
getSerbian = "No translation"
|
||||
End Select
|
||||
|
@ -1390,6 +1414,12 @@ Function getBosnian(identifier As String) As String
|
|||
Case "navigatorFound"
|
||||
getBosnian = "Ukupno pronađeno: "
|
||||
Exit Function
|
||||
Case "coloredTextDescription"
|
||||
getBosnian = "Navigacija istaknutim tekstom "
|
||||
Exit Function
|
||||
Case "foundColoredTextMessage"
|
||||
getBosnian = "Pronađen tekst s neprozirnom pozadinom. To obično nije prikladno za elektroničko izdavanje. Upotrijebite „Bez popunjavanja“ umjesto bijele pozadine "
|
||||
Exit Function
|
||||
Case Else
|
||||
getBosnian = "No translation"
|
||||
End Select
|
||||
|
|
|
@ -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="Validation" script:language="StarBasic">Sub markval24
|
||||
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Validation" script:language="StarBasic">Sub markval25
|
||||
|
||||
End Sub
|
||||
|
||||
|
@ -34,6 +34,7 @@ Sub validateButton
|
|||
Dim badNumberings As Boolean
|
||||
Dim needExtendedInfo As Boolean
|
||||
Dim config As Object
|
||||
Dim needFixColoredText As Boolean
|
||||
config = initRedactionConfiguration()
|
||||
|
||||
Dim statusIndicator as Object
|
||||
|
@ -83,9 +84,11 @@ Sub validateButton
|
|||
needExtendedInfo = false
|
||||
EndIf
|
||||
|
||||
needFixColoredText = findColoredBackgroundInDoc
|
||||
|
||||
numberingsErros = printNumberingSymbols(needExtendedInfo)
|
||||
statusIndicator.setValue(80)
|
||||
If numberingsErros OR badText OR badNumberings OR footnotesReport <> "" OR graphicsReport <> "" Or outlineInNotesReport <> "" Or sectionsReport <> "" OR oulineInTablesReport <> "" OR outlinePageStylesReport <> "" Then
|
||||
If needFixColoredText OR numberingsErros OR badText OR badNumberings OR footnotesReport <> "" OR graphicsReport <> "" Or outlineInNotesReport <> "" Or sectionsReport <> "" OR oulineInTablesReport <> "" OR outlinePageStylesReport <> "" Then
|
||||
MsgBox getTranslation("validationWarning")
|
||||
If badText Then
|
||||
MsgBox getTranslation("validationBadSymbolsNotification")
|
||||
|
@ -851,8 +854,7 @@ Function getCharsInFont(fontName As String) As String
|
|||
EndIf
|
||||
End Function
|
||||
|
||||
Sub findColoredBackgroundInDoc()
|
||||
|
||||
Function findColoredBackgroundInDoc() As Boolean
|
||||
Dim founds As Object
|
||||
Dim sDesc As Object
|
||||
Dim SrchAttributes(0) as new com.sun.star.beans.PropertyValue
|
||||
|
@ -866,22 +868,36 @@ End Function
|
|||
sDesc.searchStyles = true
|
||||
sDesc.SetSearchAttributes(SrchAttributes())
|
||||
founds = Thiscomponent.findAll(sDesc)
|
||||
findColoredBackgroundInDoc = false
|
||||
If founds.count <> 0 Then
|
||||
MsgBox founds.count
|
||||
Else
|
||||
MsgBox getTranslation("No colored text excerpts found")
|
||||
MsgBox getTranslation("foundColoredTextMessage")
|
||||
startNavigatorDialog(getTranslation("coloredTextDescription"),founds)
|
||||
findColoredBackgroundInDoc = true
|
||||
EndIf
|
||||
End Sub
|
||||
|
||||
End Function
|
||||
|
||||
|
||||
Sub starNavigatorDialog(objectsDescription As Text,founds As Object)
|
||||
Sub startNavigatorDialog(objectsDescription As String,founds As Object)
|
||||
Dim dialog As Object
|
||||
Dim leftImageURL As String
|
||||
Dim rightImageURL As String
|
||||
Dim curNum As Long
|
||||
Dim maxNum As Long
|
||||
Dim found As Object
|
||||
Dim oViewCursor As Object
|
||||
'Globalscope.BasicLibraries.LoadLibrary( "MRILib" )
|
||||
'Mri founds
|
||||
oViewCursor = ThisComponent.CurrentController.getViewCursor()
|
||||
waitingForDialog = true
|
||||
maxNum = founds.count - 1
|
||||
dialog = notModalDialog("Navigator")
|
||||
' dialog.getControl("found").SetText(getTranslation("EndnotesNativeDialogFound") & CStr(UBound(foundEndNotes)+1))
|
||||
' dialog.getControl("description").SetText(getTranslation("EndnotesNativeDialogDescriptionSelect"))
|
||||
dialog.getControl("found").SetText(getTranslation("navigatorFound") & CStr(maxNum+1))
|
||||
curNum = 0
|
||||
found = founds.getByIndex(curNum)
|
||||
dialog.getControl("current").SetText(CStr(curNum+1))
|
||||
|
||||
dialog.getControl("description").SetText(objectsDescription)
|
||||
' dialog.getControl("cancel").Label = getTranslation("buttonCancel")
|
||||
dialog.getControl("close").Label = getTranslation("buttonClose")
|
||||
leftImageURL = convertToURL(getExtensionPath() & "/images/left-navigator.svg")
|
||||
|
@ -891,13 +907,24 @@ Sub starNavigatorDialog(objectsDescription As Text,founds As Object)
|
|||
dialog.getControl("next").model.imageURL = rightImageURL
|
||||
'dialog.getControl("next").model.ScaleMode = 2
|
||||
dialog.setvisible(true)
|
||||
oViewCursor.goToRange(found,false)
|
||||
Do While waitingForDialog
|
||||
If dialog.getControl("close").model.state = 1 then
|
||||
exit Do
|
||||
EndIf
|
||||
If dialog.getControl("prev").model.state = 1 then
|
||||
curNum = getPrevFound(curNum, maxNum)
|
||||
found = founds.getByIndex(curNum)
|
||||
oViewCursor.goToRange(found,false)
|
||||
dialog.getControl("current").SetText(CStr(curNum+1))
|
||||
dialog.getControl("prev").model.state = 0
|
||||
EndIf
|
||||
If dialog.getControl("next").model.state = 1 then
|
||||
curNum = getNextFound(curNum, maxNum)
|
||||
found = founds.getByIndex(curNum)
|
||||
oViewCursor.goToRange(found,false)
|
||||
dialog.getControl("current").SetText(CStr(curNum+1))
|
||||
dialog.getControl("next").model.state = 0
|
||||
EndIf
|
||||
|
||||
wait (100)
|
||||
|
@ -905,6 +932,24 @@ Sub starNavigatorDialog(objectsDescription As Text,founds As Object)
|
|||
dialog.dispose
|
||||
End Sub
|
||||
|
||||
Function getNextFound(curNum As Long, max As Long) As Long
|
||||
If curNum < max Then
|
||||
getNextFound = curNum + 1
|
||||
Else
|
||||
getNextFound = 0
|
||||
EndIf
|
||||
End Function
|
||||
|
||||
Function getPrevFound(curNum As Long, max As Long) As Long
|
||||
If curNum = 0 Then
|
||||
getPrevFound = max
|
||||
Else
|
||||
getPrevFound = curNum - 1
|
||||
EndIf
|
||||
End Function
|
||||
|
||||
|
||||
|
||||
Function getExtensionPath() As String
|
||||
Dim extensionIdentifier As String
|
||||
Dim pip As Object
|
||||
|
|
BIN
translations.ods
BIN
translations.ods
Binary file not shown.
Loading…
Add table
Reference in a new issue