Added option to remove all colored text backgrounds
This commit is contained in:
parent
6a0bc8412e
commit
c06cdfc25b
4 changed files with 65 additions and 19 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="Clean" script:language="StarBasic">Sub mark82
|
||||
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Clean" script:language="StarBasic">Sub mark83
|
||||
|
||||
End Sub
|
||||
|
||||
|
@ -46,6 +46,7 @@ Private Sub makerUpMenu
|
|||
dialog.getControl("resetChapterNumberingRules").Label = getTranslation("advancedMenuResetChapterNumberingRules")
|
||||
dialog.getControl("convertFontsToCharStyles").Label = getTranslation("advancedMenuconvertFontsToCharStyles")
|
||||
dialog.getControl("fixBrokenCharBackTransparent").Label = getTranslation("fixBrokenCharBackTransparentMenuItem")
|
||||
dialog.getControl("removeNotTransparentBackgrounds").Label = getTranslation("removeNotTransparentBackgrounds")
|
||||
dialog.getControl("Cancel").Label = getTranslation("buttonCancel")
|
||||
dialog.getControl("OK").Label = getTranslation("buttonOK")
|
||||
dialog.getControl("buttonLoad").Label = getTranslation("buttonLoad")
|
||||
|
@ -156,6 +157,9 @@ Private Sub cleanAccordingTo(dialog As Object)
|
|||
If dialog.getControl("fixBrokenCharBackTransparent").state = 1 Then
|
||||
fixBrokenCharBackTransparent()
|
||||
EndIf
|
||||
If dialog.getControl("removeNotTransparentBackgrounds").state = 1 Then
|
||||
fixColoredBackgroundInDoc()
|
||||
EndIf
|
||||
|
||||
|
||||
statusIndicator.end()
|
||||
|
@ -2067,4 +2071,30 @@ Sub setDefaultBackColorInText(oText As Object)
|
|||
EndIf
|
||||
Wend
|
||||
End Sub
|
||||
|
||||
|
||||
Function fixColoredBackgroundInDoc() As Boolean
|
||||
Dim founds As Object
|
||||
Dim sDesc As Object
|
||||
Dim i As Long
|
||||
Dim foundObjects() 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.searchStyles = true
|
||||
sDesc.SetSearchAttributes(SrchAttributes())
|
||||
founds = Thiscomponent.findAll(sDesc)
|
||||
If founds.count <> 0 Then
|
||||
foundObjects = convertXIndexAccessToArray(founds)
|
||||
For i = LBound(foundObjects) To UBound(foundObjects)
|
||||
foundObjects(i).CharBackTransparent = false
|
||||
foundObjects(i).CharBackColor = -1
|
||||
Next i
|
||||
EndIf
|
||||
|
||||
End Function
|
||||
</script:module>
|
Loading…
Add table
Add a link
Reference in a new issue