Added check for colored text areas
This commit is contained in:
parent
9846e2933c
commit
fae0f0b494
4 changed files with 89 additions and 14 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue