diff --git a/Redaction/Translations.xba b/Redaction/Translations.xba index 130669b..89a2d35 100644 --- a/Redaction/Translations.xba +++ b/Redaction/Translations.xba @@ -304,6 +304,9 @@ Function getRussian(identifier As String) As String Exit Function Case "fixBrokenCharBackTransparentMenuItem" getRussian = "Исправить некорректные настройки цветовой заливки абзацев" + Exit Function + Case "badSymbols" + getRussian = "Неподходящие для публикации символы" Exit Function Case Else getRussian = "Перевод не найден" @@ -591,6 +594,9 @@ Function getEnglish(identifier As String) As String Exit Function Case "fixBrokenCharBackTransparentMenuItem" getEnglish = "Fix incorrect color fill settings for paragraphs " + Exit Function + Case "badSymbols" + getEnglish = "Unsuitable for publishing characters" Exit Function Case Else getEnglish = "No translation" @@ -878,6 +884,9 @@ Function getCroatian(identifier As String) As String Case "fixBrokenCharBackTransparentMenuItem" getCroatian = "Ispravite netočne postavke ispunjavanja boja za odlomke " Exit Function + Case "badSymbols" + getCroatian = "Neprimjerene znakova za objavljivanje" + Exit Function Case Else getCroatian = "No translation" End Select @@ -1164,6 +1173,9 @@ Function getSerbian(identifier As String) As String Case "fixBrokenCharBackTransparentMenuItem" getSerbian = "Исправите нетачна подешавања попуњавања боја за пасусе " Exit Function + Case "badSymbols" + getSerbian = "Неодговарајуће знакова за објављивање" + Exit Function Case Else getSerbian = "No translation" End Select @@ -1450,6 +1462,9 @@ Function getBosnian(identifier As String) As String Case "fixBrokenCharBackTransparentMenuItem" getBosnian = "Ispravite netočne postavke ispunjavanja boja za odlomke " Exit Function + Case "badSymbols" + getBosnian = "Neprimjerene znakova za objavljivanje" + Exit Function Case Else getBosnian = "No translation" End Select diff --git a/Redaction/Validation.xba b/Redaction/Validation.xba index c9f7ee2..0c70c28 100644 --- a/Redaction/Validation.xba +++ b/Redaction/Validation.xba @@ -1,27 +1,10 @@ -Sub markval25 +Sub markval26 End Sub -Private Function isInDoc(searchString As String) As Boolean - Dim founds As Object - Dim sDesc As Object - Dim srch(0) as new com.sun.star.beans.PropertyValue - sDesc = Thiscomponent.createSearchDescriptor() - sDesc.SearchAll = true - sDesc.ValueSearch = false - sDesc.SearchStyles = false - sDesc.SearchCaseSensitive = true - sDesc.SearchRegularExpression = true - sDesc.SearchString = searchString - founds = Thiscomponent.findAll(sDesc) - If founds.count <> 0 Then - isInDoc = true - Else - isInDoc = false - EndIf -End Function + Sub validateButton Dim footnotesReport As String @@ -75,10 +58,9 @@ Sub validateButton If sectionsReport <> "" Then MsgBox sectionsReport EndIf - If isInDoc("[\uE000-\uF8FF]") Then - badText = true - EndIf - + + badText = findBadCharacters + If config.getPropertyValue("complexity") = "makerUp" then needExtendedInfo = true Else @@ -95,10 +77,7 @@ Sub validateButton 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 MsgBox getTranslation("validationWarning") - If badText Then - MsgBox getTranslation("validationBadSymbolsNotification") - removeBadCharacters - EndIf + Else MsgBox getTranslation("validationSuccess") EndIf @@ -150,14 +129,6 @@ Private Function checkGraphics() As String checkGraphics = result End Function -Private Sub removeBadCharacters - StartTracking - AskAndReplace("[\uE000-\uF8FF]+","") - StopTracking - showTrackedChanges -End Sub - - Private Sub fixDOI StartTracking replaceCharsInDOI @@ -979,6 +950,19 @@ Function getCharsInFont(fontName As String) As String EndIf End Function + +Function findBadCharacters() As Boolean + Dim founds As Object + founds = findInDoc("[\uE000-\uF8FF]") + findBadCharacters = false + If founds.count <> 0 Then + MsgBox getTranslation("validationBadSymbolsNotification") + startNavigatorDialog(getTranslation("badSymbols"),founds) + findBadCharacters = true + EndIf + +End Function + Function findColoredBackgroundInDoc() As Boolean Dim founds As Object Dim sDesc As Object @@ -1114,4 +1098,30 @@ sub openReport(fileName As String) Kill(tmpName) End If End Sub - + + +Function isInDoc(searchString As String) As Boolean + Dim founds As Variant + founds = findInDoc(searchString) + If founds.count <> 0 Then + isInDoc = true + Else + isInDoc = false + EndIf +End Function + +Function findInDoc(searchString As String) As Variant + Dim founds As Object + Dim sDesc As Object + Dim srch(0) as new com.sun.star.beans.PropertyValue + sDesc = Thiscomponent.createSearchDescriptor() + sDesc.SearchAll = true + sDesc.ValueSearch = false + sDesc.SearchStyles = false + sDesc.SearchCaseSensitive = true + sDesc.SearchRegularExpression = true + sDesc.SearchString = searchString + founds = Thiscomponent.findAll(sDesc) + findInDoc = founds +End Function + \ No newline at end of file diff --git a/translations.ods b/translations.ods index 8fc0ef1..d3422f8 100644 Binary files a/translations.ods and b/translations.ods differ