diff --git a/Redaction/Validation.xba b/Redaction/Validation.xba index 2f3d98c..74b0974 100644 --- a/Redaction/Validation.xba +++ b/Redaction/Validation.xba @@ -1,7 +1,6 @@ -Sub markval30 - +Sub markval31 End Sub @@ -770,11 +769,9 @@ Sub fontReportButton Exit sub EndIf Dim FileName As String - FileName = getCharsInFont(targetFontName) + getCharsInFont(targetFontName) statusIndicator.end() - If FileName <> "" Then - openReport(FileName) - EndIf + End Sub Sub onSelectFont(oEvent) @@ -914,7 +911,7 @@ Sub addToArray(xArray(),vNextElement) xArray(iUB) = vNextElement End Sub -Function getCharsInFont(fontName As String) As String +Sub getCharsInFont(fontName As String) Dim resultArray() As String Dim pageNums() As Long Dim firstPages() As Long @@ -1000,43 +997,30 @@ Function getCharsInFont(fontName As String) As String EndIf Next j Next i - resultString = "" - For i = LBound(resultArray) To UBound(resultArray) - resultString = resultString & "<a href='https://unicode-table.com/ru/" & resultArray(i) & "'" & ">https://unicode-table.com/ru/" & resultArray(i) & "</a> " & getTranslation("charFirstPage") & " " & pageNums(i) & "<br>" & Chr(10) - Next i - If resultString <> "" Then - 'MsgBox "Символы в шрифте "& fontName &Chr(10)&resultString - Dim FileName As String 'Holds the file name - Dim n As Integer 'Holds the file number - Dim f As Integer 'Index variable - Dim s As String 'Temporary string for input - Dim fileaccess As Object - Dim outtextstream As Object - Dim out As Object - - Dim sTemp$ - GlobalScope.BasicLibraries.loadLibrary("Tools") - path=DirectoryNameoutofPath(ThisComponent.getURL(),"/") - FileName = path & "/symbolsInFont" & fontName & ".html" - 'n = FreeFile() 'Next free file number - 'Open FileName For Output Access Read Write As #n 'Open for read/write - fileaccess = createUnoService ("com.sun.star.ucb.SimpleFileAccess") - outtextstream = createUnoService ("com.sun.star.io.TextOutputStream") - outtextstream.setEncoding( "UTF-8" ) - out = fileaccess.openFileWrite( FileName ) - outtextstream.setOutputStream( out ) - outtextstream.writeString( "<html><head><title>" & getTranslation("symbolsInFontHeading") & " "& fontName & "</title></head><body><h2>" & getTranslation("symbolsInFontHeading") & " "& fontName &":</h2>"&resultString &"</body></html>" ) - outtextstream.closeOutput() - getCharsInFont = FileName - Exit Function + Dim newDocCursor As Object + Dim newDoc As Object + newDoc = starDesktop.loadComponentFromURL("private:factory/swriter", "_blank", 0, Array()) + newDocCursor = newDoc.getCurrentController().getViewCursor() + newDocCursor.String = getTranslation("symbolsInFontHeading") & " " & fontName + newDocCursor.ParaStyleName = "Heading 1" + newDocCursor.collapseToEnd() + newDocCursor.Text.insertControlCharacter(newDocCursor.End,com.sun.star.text.ControlCharacter.PARAGRAPH_BREAK,False) + For i = LBound(resultArray) To UBound(resultArray) + newDocCursor.ParaStyleName = "Text body" + newDocCursor.String = "https://unicode-table.com/ru/" & resultArray(i) + newDocCursor.HyperLinkURL = "https://unicode-table.com/ru/" & resultArray(i) + newDocCursor.collapseToEnd() + newDocCursor.String = " " & getTranslation("charFirstPage") & " " & pageNums(i) + newDocCursor.collapseToEnd() + newDocCursor.Text.insertControlCharacter(newDocCursor.End,com.sun.star.text.ControlCharacter.PARAGRAPH_BREAK,False) + Next i + Exit Sub Else MsgBox getTranslation("symbolsInFontNotFound1") & " " & fontName & " " & getTranslation("symbolsInFontNotFound2") - getCharsInFont = "" - Exit Function EndIf -End Function +End Sub Function findBadCharacters() As Boolean diff --git a/cleanandvalidate.update.xml b/cleanandvalidate.update.xml index 3585505..23f5439 100644 --- a/cleanandvalidate.update.xml +++ b/cleanandvalidate.update.xml @@ -2,9 +2,9 @@ - + - + diff --git a/gradle.properties b/gradle.properties index 58ee9a0..199950f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1 +1 @@ -version=0.10.6 +version=0.10.7