Replaced graphics report with navigator
This commit is contained in:
parent
962a6fe83f
commit
cd9266e83d
2 changed files with 48 additions and 50 deletions
|
@ -1,43 +1,50 @@
|
|||
<?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 markval28
|
||||
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Validation" script:language="StarBasic">Sub markval29
|
||||
|
||||
End Sub
|
||||
|
||||
|
||||
|
||||
Sub validateButton
|
||||
Dim footnotesReport As Boolean
|
||||
Dim graphicsReport As String
|
||||
Dim badFootnoteSigns As Boolean
|
||||
Dim badGraphics As Boolean
|
||||
Dim sectionsReport As String
|
||||
Dim outlinePageStylesReport As String
|
||||
Dim outlineInNotesReport As String
|
||||
Dim oulineInTablesReport As String
|
||||
Dim badText As Boolean
|
||||
Dim badNumberings As Boolean
|
||||
Dim needExtendedInfo As Boolean
|
||||
Dim config As Object
|
||||
Dim needFixColoredText As Boolean
|
||||
Dim brokenCharBackTransparent As Boolean
|
||||
config = initRedactionConfiguration()
|
||||
|
||||
Dim statusIndicator as Object
|
||||
statusIndicator = ThisComponent.getCurrentController.statusIndicator
|
||||
statusIndicator.Start(getTranslation("validationStarted"),100)
|
||||
|
||||
badText = false
|
||||
badNumberings = false
|
||||
footnotesReport = noteSingsCheck()
|
||||
badFootnoteSigns = noteSingsCheck()
|
||||
statusIndicator.setValue(10)
|
||||
graphicsReport = checkGraphics
|
||||
|
||||
badGraphics = checkGraphics()
|
||||
|
||||
badText = findBadCharacters()
|
||||
|
||||
needFixColoredText = findColoredBackgroundInDoc()
|
||||
|
||||
statusIndicator.setValue(20)
|
||||
sectionsReport = checkSectionsInTables
|
||||
'
|
||||
sectionsReport = checkSectionsInTables()
|
||||
statusIndicator.setValue(30)
|
||||
'
|
||||
outlineInNotesReport = checkNotesOutline()
|
||||
statusIndicator.setValue(40)
|
||||
outlinePageStylesReport = checkHeadingsInHeadersFooters
|
||||
'
|
||||
outlinePageStylesReport = checkHeadingsInHeadersFooters()
|
||||
statusIndicator.setValue(50)
|
||||
oulineInTablesReport = checkHeadingsInTextTables
|
||||
'
|
||||
oulineInTablesReport = checkHeadingsInTextTables()
|
||||
|
||||
statusIndicator.setValue(60)
|
||||
If outlineInNotesReport <> "" Then
|
||||
MsgBox outlineInNotesReport
|
||||
|
@ -49,66 +56,56 @@ Sub validateButton
|
|||
MsgBox outlinePageStylesReport
|
||||
EndIf
|
||||
|
||||
If graphicsReport <> "" Then
|
||||
MsgBox graphicsReport
|
||||
EndIf
|
||||
If sectionsReport <> "" Then
|
||||
MsgBox sectionsReport
|
||||
EndIf
|
||||
|
||||
badText = findBadCharacters()
|
||||
|
||||
|
||||
If config.getPropertyValue("complexity") = "makerUp" then
|
||||
needExtendedInfo = true
|
||||
Else
|
||||
needExtendedInfo = false
|
||||
EndIf
|
||||
|
||||
brokenCharBackTransparent = hasbrokenCharBackTransparent
|
||||
brokenCharBackTransparent = hasbrokenCharBackTransparent()
|
||||
If (brokenCharBackTransparent) Then
|
||||
MsgBox getTranslation("invalidParagraphFormattingFound")
|
||||
EndIf
|
||||
needFixColoredText = findColoredBackgroundInDoc
|
||||
|
||||
|
||||
numberingsErros = printNumberingSymbols(needExtendedInfo)
|
||||
statusIndicator.setValue(80)
|
||||
If brokenCharBackTransparent OR needFixColoredText OR numberingsErros OR badText OR badNumberings OR footnotesReport OR graphicsReport <> "" Or outlineInNotesReport <> "" Or sectionsReport <> "" OR oulineInTablesReport <> "" OR outlinePageStylesReport <> "" Then
|
||||
If brokenCharBackTransparent OR needFixColoredText OR numberingsErros OR badText OR badFootnoteSigns OR badGraphics Or outlineInNotesReport <> "" Or sectionsReport <> "" OR oulineInTablesReport <> "" OR outlinePageStylesReport <> "" Then
|
||||
MsgBox getTranslation("validationWarning")
|
||||
Else
|
||||
MsgBox getTranslation("validationSuccess")
|
||||
MsgBox getTranslation("validationSuccess")
|
||||
EndIf
|
||||
statusIndicator.end()
|
||||
End Sub
|
||||
|
||||
Private Function checkGraphics() As String
|
||||
Function checkGraphics() As Boolean
|
||||
Dim drawPages As Object
|
||||
Dim count as Integer
|
||||
Dim draw As Object
|
||||
Dim result As String
|
||||
result = ""
|
||||
Dim shapeType As String
|
||||
Dim embeededObject As Object
|
||||
Dim badFrame As Long
|
||||
badFrame = 0
|
||||
Dim drawingN As Long
|
||||
drawingN = 0
|
||||
drawPages = ThisComponent.DrawPage
|
||||
Dim i As Integer
|
||||
Dim i As Long
|
||||
Dim badDrawings() As Object
|
||||
Dim badFrames() As Object
|
||||
count = drawPages.getCount()
|
||||
For i = 0 to count-1
|
||||
For i = 0 to count - 1
|
||||
draw = drawPages.getByIndex(i)
|
||||
shapeType = draw.ShapeType
|
||||
If InStr(shapeType,"com.sun.star.drawing") = 1 Then
|
||||
drawingN = drawingN + 1
|
||||
addToArray(badDrawings, draw.Anchor)
|
||||
EndIf
|
||||
If InStr(shapeType,"FrameShape") = 1 Then
|
||||
If draw.supportsService("com.sun.star.text.TextEmbeddedObject") Then
|
||||
embeededObject = draw.getEmbeddedObject()
|
||||
If IsNull(embeededObject) Then
|
||||
badFrame = badFrame + 1
|
||||
addToArray(badFrames, draw.Anchor)
|
||||
Else
|
||||
If Not embeededObject.supportsService("com.sun.star.formula.FormulaProperties") Then
|
||||
badFrame = badFrame + 1
|
||||
addToArray(badFrames, draw.Anchor)
|
||||
Else
|
||||
'Formula
|
||||
EndIf
|
||||
|
@ -116,13 +113,15 @@ Private Function checkGraphics() As String
|
|||
EndIf
|
||||
EndIf
|
||||
Next i
|
||||
If drawingN <> 0 Then
|
||||
result = result & getTranslation("validationBadDrawings") & drawingN & getTranslation("validationExcerptNotSuitable") & chr(10)
|
||||
checkGraphics = false
|
||||
If UBound(badDrawings) > -1 Then
|
||||
startNavigatorDialog(getTranslation("validationBadDrawings") & (UBound(badDrawings) + 1) & getTranslation("validationExcerptNotSuitable"),badDrawings)
|
||||
checkGraphics = true
|
||||
EndIf
|
||||
If badFrame <> 0 Then
|
||||
result = result & getTranslation("validationBadEmbeededObjects") & badFrame & getTranslation("validationExcerptNotSuitable") & chr(10)
|
||||
If UBound(badFrames) > -1 Then
|
||||
startNavigatorDialog(getTranslation("validationBadEmbeededObjects") & (UBound(badFrames) + 1) & getTranslation("validationExcerptNotSuitable"),badFrames)
|
||||
checkGraphics = true
|
||||
EndIf
|
||||
checkGraphics = result
|
||||
End Function
|
||||
|
||||
Private Sub fixDOI
|
||||
|
@ -418,9 +417,9 @@ Function isHeadingsInText(oText As Object) As Boolean
|
|||
End Function
|
||||
|
||||
Function hasBrokenCharBackTransparent As Boolean
|
||||
Dim foonNotes As Object
|
||||
Dim footNotes As Object
|
||||
Dim endNotes As Object
|
||||
Dim i As Integer
|
||||
Dim i As Long
|
||||
Dim oStyles As Object
|
||||
Dim pageStyles As Object
|
||||
Dim pageStyle As Object
|
||||
|
@ -428,8 +427,8 @@ Function hasBrokenCharBackTransparent As Boolean
|
|||
If (hasBrokenCharBackTransparent) Then
|
||||
Exit Function
|
||||
EndIf
|
||||
footNotes = thisComponent.footNotes
|
||||
For i = 0 to footNotes.Count -1
|
||||
footNotes = ThisComponent.FootNotes
|
||||
For i = 0 to footNotes.getCount - 1
|
||||
hasBrokenCharBackTransparent = isBackColorInText(footNotes.getByIndex(i).Text)
|
||||
If (hasBrokenCharBackTransparent) Then
|
||||
Exit Function
|
||||
|
@ -1002,8 +1001,6 @@ Sub startNavigatorDialog(objectsDescription As String,foundObjects() As Object)
|
|||
Dim curNum As Long
|
||||
Dim maxNum As Long
|
||||
Dim found As Object
|
||||
Dim oViewCursor As Object
|
||||
oViewCursor = ThisComponent.CurrentController.getViewCursor()
|
||||
waitingForDialog = true
|
||||
maxNum = UBound(foundObjects)
|
||||
dialog = notModalDialog("Navigator")
|
||||
|
@ -1022,7 +1019,9 @@ Sub startNavigatorDialog(objectsDescription As String,foundObjects() As Object)
|
|||
dialog.getControl("next").model.imageURL = rightImageURL
|
||||
'dialog.getControl("next").model.ScaleMode = 2
|
||||
dialog.setvisible(true)
|
||||
oViewCursor.goToRange(found,false)
|
||||
'select first found '
|
||||
'not using view cursor as if shape was prevously selected runtime exception will appear
|
||||
Thiscomponent.CurrentController.select(found)
|
||||
Do While waitingForDialog
|
||||
If dialog.getControl("close").model.state = 1 then
|
||||
exit Do
|
||||
|
@ -1030,14 +1029,14 @@ Sub startNavigatorDialog(objectsDescription As String,foundObjects() As Object)
|
|||
If dialog.getControl("prev").model.state = 1 then
|
||||
curNum = getPrevFound(curNum, maxNum)
|
||||
found = foundObjects(curNum)
|
||||
oViewCursor.goToRange(found,false)
|
||||
Thiscomponent.CurrentController.select(found)
|
||||
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 = foundObjects(curNum)
|
||||
oViewCursor.goToRange(found,false)
|
||||
Thiscomponent.CurrentController.select(found)
|
||||
dialog.getControl("current").SetText(CStr(curNum+1))
|
||||
dialog.getControl("next").model.state = 0
|
||||
EndIf
|
||||
|
@ -1118,7 +1117,6 @@ sub openReport(fileName As String)
|
|||
End If
|
||||
End Sub
|
||||
|
||||
|
||||
Function isInDoc(searchString As String) As Boolean
|
||||
Dim founds As Variant
|
||||
founds = findInDoc(searchString)
|
||||
|
|
BIN
translations.ods
BIN
translations.ods
Binary file not shown.
Loading…
Add table
Reference in a new issue