Added navigator dialog
This commit is contained in:
parent
2395f816e6
commit
9846e2933c
7 changed files with 2469 additions and 1 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 markval22
|
||||
<script:module xmlns:script="http://openoffice.org/2000/script" script:name="Validation" script:language="StarBasic">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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue