Check for grouped elements for font reports
This commit is contained in:
parent
ba5fc11a2e
commit
1449c9d450
1 changed files with 62 additions and 3 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 markval13
|
||||
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Validation" script:language="StarBasic">Sub markval14
|
||||
|
||||
End Sub
|
||||
|
||||
|
@ -579,16 +579,19 @@ Sub onSelectFont(oEvent)
|
|||
End Sub
|
||||
|
||||
Function getODGFontNames() As Variant
|
||||
'Globalscope.BasicLibraries.LoadLibrary( "MRILib" )
|
||||
Dim fontNames() As String
|
||||
Dim pages As Object
|
||||
Dim pageCount As Long
|
||||
Dim page As Object
|
||||
Dim elementCount As Long
|
||||
Dim groupCount As Long
|
||||
Dim i As Long
|
||||
Dim j As Long
|
||||
Dim k As Long
|
||||
Dim element As Object
|
||||
Dim elementText As Object
|
||||
Dim groupElement As Object
|
||||
Dim enum1 As Object
|
||||
Dim enum1Element As Object
|
||||
Dim enum2 As Object
|
||||
|
@ -620,7 +623,32 @@ Function getODGFontNames() As Variant
|
|||
Wend
|
||||
EndIf
|
||||
Wend
|
||||
EndIf
|
||||
EndIf
|
||||
If element.supportsService("com.sun.star.drawing.GroupShape") Then
|
||||
groupCount = element.getCount()
|
||||
For k = 0 To groupCount - 1
|
||||
groupElement = element.getByIndex(k)
|
||||
If groupElement.supportsService("com.sun.star.drawing.Text") Then
|
||||
elementText = groupElement.getText()
|
||||
enum1 = elementText.createEnumeration()
|
||||
While enum1.hasMoreElements
|
||||
enum1Element = enum1.nextElement
|
||||
If enum1Element.supportsService("com.sun.star.text.Paragraph") Then
|
||||
enum2 = enum1Element.createEnumeration
|
||||
While enum2.hasMoreElements
|
||||
thisPortion = enum2.nextElement
|
||||
If Len(thisPortion.String) > 0 Then
|
||||
fontName = thisPortion.CharFontName
|
||||
If NOT fontIsAlreadyFound(fontNames, fontName) Then
|
||||
AddToArray(fontNames, fontName)
|
||||
EndIf
|
||||
EndIf
|
||||
Wend
|
||||
EndIf
|
||||
Wend
|
||||
EndIf
|
||||
Next k
|
||||
EndIf
|
||||
Next j
|
||||
Next i
|
||||
getODGFontNames = fontNames
|
||||
|
@ -701,6 +729,8 @@ Function getCharsInFont(fontName As String) As String
|
|||
Dim enum2 As Object
|
||||
Dim thisPortion As Object
|
||||
Dim fontChar As Long
|
||||
Dim groupCount As Long
|
||||
Dim groupElement As Object
|
||||
pages = ThisComponent.getDrawPages()
|
||||
pagesCount = pages.getCount()
|
||||
For i = 0 To pagesCount - 1
|
||||
|
@ -730,7 +760,36 @@ Function getCharsInFont(fontName As String) As String
|
|||
Wend
|
||||
EndIf
|
||||
Wend
|
||||
EndIf
|
||||
EndIf
|
||||
If element.supportsService("com.sun.star.drawing.GroupShape") Then
|
||||
groupCount = element.getCount()
|
||||
For k = 0 To groupCount - 1
|
||||
groupElement = element.getByIndex(k)
|
||||
If groupElement.supportsService("com.sun.star.drawing.Text") Then
|
||||
elementText = groupElement.getText()
|
||||
enum1 = elementText.createEnumeration()
|
||||
While enum1.hasMoreElements
|
||||
enum1Element = enum1.nextElement
|
||||
If enum1Element.supportsService("com.sun.star.text.Paragraph") Then
|
||||
enum2 = enum1Element.createEnumeration
|
||||
While enum2.hasMoreElements
|
||||
thisPortion = enum2.nextElement
|
||||
If thisPortion.CharFontName = fontName Then
|
||||
resultString = thisPortion.String
|
||||
For k = 0 To Len(resultString) - 1
|
||||
fontChar = Hex(Asc(Mid(resultString,k+1,1)))
|
||||
If NOT IsInArray(resultArray,fontChar) Then
|
||||
AddToArray(resultArray(), fontChar)
|
||||
AddToArray(pageNums(), i + 1)
|
||||
EndIf
|
||||
Next k
|
||||
EndIf
|
||||
Wend
|
||||
EndIf
|
||||
Wend
|
||||
EndIf
|
||||
Next k
|
||||
EndIf
|
||||
Next j
|
||||
Next i
|
||||
resultString = ""
|
||||
|
|
Loading…
Add table
Reference in a new issue