diff --git a/Redaction/Navigator.xdl b/Redaction/Navigator.xdl new file mode 100644 index 0000000..da0ae6f --- /dev/null +++ b/Redaction/Navigator.xdl @@ -0,0 +1,12 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/Redaction/Translations.xba b/Redaction/Translations.xba index 466ccc1..0d214ad 100644 --- a/Redaction/Translations.xba +++ b/Redaction/Translations.xba @@ -287,6 +287,12 @@ Function getRussian(identifier As String) As String Case "advancedMenuconvertFontsToCharStyles" getRussian = "Создать стили символов из найденных шрифтов" Exit Function + Case "buttonClose" + getRussian = "Закрыть" + Exit Function + Case "navigatorFound" + getRussian = "Всего найдено: " + Exit Function Case Else getRussian = "Перевод не найден" End Select @@ -556,6 +562,12 @@ Function getEnglish(identifier As String) As String Case "advancedMenuconvertFontsToCharStyles" getEnglish = "Create character styles from found fonts " Exit Function + Case "buttonClose" + getEnglish = "Close" + Exit Function + Case "navigatorFound" + getEnglish = "Total found: " + Exit Function Case Else getEnglish = "No translation" End Select @@ -824,6 +836,12 @@ Function getCroatian(identifier As String) As String Case "advancedMenuconvertFontsToCharStyles" getCroatian = "Stvorite stilove znakova iz pronađenih fontova " Exit Function + Case "buttonClose" + getCroatian = "Zatvoriti " + Exit Function + Case "navigatorFound" + getCroatian = "Ukupno pronađeno: " + Exit Function Case Else getCroatian = "No translation" End Select @@ -1092,6 +1110,12 @@ Function getSerbian(identifier As String) As String Case "advancedMenuconvertFontsToCharStyles" getSerbian = "Створите стилове знакова од пронађених фонтова " Exit Function + Case "buttonClose" + getSerbian = "Затворити" + Exit Function + Case "navigatorFound" + getSerbian = "Укупно пронађено: " + Exit Function Case Else getSerbian = "No translation" End Select @@ -1360,6 +1384,12 @@ Function getBosnian(identifier As String) As String Case "advancedMenuconvertFontsToCharStyles" getBosnian = "Stvorite stilove znakova iz pronađenih fontova " Exit Function + Case "buttonClose" + getBosnian = "Zatvoriti " + Exit Function + Case "navigatorFound" + getBosnian = "Ukupno pronađeno: " + Exit Function Case Else getBosnian = "No translation" End Select diff --git a/Redaction/Validation.xba b/Redaction/Validation.xba index 928dc5d..d220ebe 100644 --- a/Redaction/Validation.xba +++ b/Redaction/Validation.xba @@ -1,6 +1,6 @@ -Sub markval22 +Sub markval24 End Sub @@ -851,6 +851,81 @@ Function getCharsInFont(fontName As String) As String EndIf End Function + Sub findColoredBackgroundInDoc() + + Dim founds As Object + Dim sDesc As Object + Dim SrchAttributes(0) as new com.sun.star.beans.PropertyValue + SrchAttributes(0).Name = "CharBackTransparent" + SrchAttributes(0).Value = False + sDesc = Thiscomponent.createSearchDescriptor() + sDesc.SearchAll = true + sDesc.ValueSearch = false + sDesc.SearchRegularExpression = true + sDesc.SearchString = searchString + sDesc.searchStyles = true + sDesc.SetSearchAttributes(SrchAttributes()) + founds = Thiscomponent.findAll(sDesc) + If founds.count <> 0 Then + MsgBox founds.count + Else + MsgBox getTranslation("No colored text excerpts found") + EndIf +End Sub + + +Sub starNavigatorDialog(objectsDescription As Text,founds As Object) + Dim dialog As Object + Dim leftImageURL As String + Dim rightImageURL As String + waitingForDialog = true + dialog = notModalDialog("Navigator") +' dialog.getControl("found").SetText(getTranslation("EndnotesNativeDialogFound") & CStr(UBound(foundEndNotes)+1)) +' dialog.getControl("description").SetText(getTranslation("EndnotesNativeDialogDescriptionSelect")) +' dialog.getControl("cancel").Label = getTranslation("buttonCancel") + dialog.getControl("close").Label = getTranslation("buttonClose") + leftImageURL = convertToURL(getExtensionPath() & "/images/left-navigator.svg") + rightImageURL = convertToURL(getExtensionPath() & "/images/right-navigator.svg") + dialog.getControl("prev").model.imageURL = leftImageURL + 'dialog.getControl("prev").model.ScaleMode = 2 + dialog.getControl("next").model.imageURL = rightImageURL + 'dialog.getControl("next").model.ScaleMode = 2 + dialog.setvisible(true) + Do While waitingForDialog + If dialog.getControl("close").model.state = 1 then + exit Do + EndIf + If dialog.getControl("prev").model.state = 1 then + EndIf + If dialog.getControl("next").model.state = 1 then + EndIf + + wait (100) + Loop + dialog.dispose +End Sub + +Function getExtensionPath() As String + Dim extensionIdentifier As String + Dim pip As Object + extensionIdentifier = "pro.litvinovg.Redaction" + pip = GetDefaultContext.getByName("/singletons/com.sun.star.deployment.PackageInformationProvider") + getExtensionPath = pip.getPackageLocation(extensionIdentifier) +End Function + + +Function notModalDialog(dialogName As String) As Variant + Dim windowProvider As Object + Dim containerWindow As Object + Dim handler As Object + Dim dialogUrl As String + Dim dialog As Object + containerWindow = ThisComponent.getCurrentController().getFrame().getContainerWindow() + dialogUrl = "vnd.sun.star.script:Redaction." & dialogName & "?location=application" + windowProvider = CreateUnoService("com.sun.star.awt.ContainerWindowProvider") + dialog = windowProvider.createContainerWindow(dialogUrl, "", containerWindow, handler) + notModalDialog = dialog +End Function sub openReport(fileName As String) dim document as object diff --git a/Redaction/dialog.xlb b/Redaction/dialog.xlb index bb3cd32..9f687a7 100644 --- a/Redaction/dialog.xlb +++ b/Redaction/dialog.xlb @@ -6,4 +6,5 @@ + \ No newline at end of file diff --git a/images/left-navigator.svg b/images/left-navigator.svg new file mode 100644 index 0000000..a92a21f --- /dev/null +++ b/images/left-navigator.svg @@ -0,0 +1,1175 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/images/right-navigator.svg b/images/right-navigator.svg new file mode 100644 index 0000000..c487805 --- /dev/null +++ b/images/right-navigator.svg @@ -0,0 +1,1175 @@ + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/translations.ods b/translations.ods index 8bda3e8..1c00c31 100644 Binary files a/translations.ods and b/translations.ods differ