Issue 34456 - API: sw.SwXTextDoicument::XPrintJobBroadcaster
Summary: API: sw.SwXTextDoicument::XPrintJobBroadcaster
Status: CONFIRMED
Alias: None
Product: App Dev
Classification: Unclassified
Component: api (show other issues)
Version: 3.3.0 or older (OOo)
Hardware: All All
: P3 Trivial
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-09-21 15:56 UTC by steffen.grund
Modified: 2017-05-20 11:27 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description steffen.grund 2004-09-21 15:56:03 UTC
The removePrintJobListener at interface XPrintJobBroadcaster does not work: the
listener is called nevertheless. Apart from SwXTextDocument, ScModelObj and
SdXImpressDocument are also affected (all us the same implementation).

Macro to reproduce:

Const tempDir = "/var/tmp/"

Global bEventCalled as Boolean

Sub Main
	listener = createUnoListener("PJL_", "com.sun.star.view.XPrintJobListener")
	
	xTextDoc = ThisComponent	

	bEventCalled = false
		
	xTextDoc.addPrintJobListener(listener)

	triggerEvent(xTextDoc)	
	print "Event called: " + bEventCalled
	
	xTextDoc.removePrintJobListener(listener)
	
	bEventCalled = false
	
	triggerEvent(xTextDoc)	
	print "Event called: " + bEventCalled
	
End Sub


Sub PJL_printJobEvent(aPrintJobEvent as Variant)
	bEventCalled = True
End Sub

Sub triggerEvent(xPrintable)
	Dim printProperty(1) as new com.sun.star.beans.PropertyValue
	printProperty(0).Name = "FileName"
	printProperty(0).Value = tempDir + "printname.prt"
 	printProperty(0).State = com.sun.star.beans.PropertyState.DEFAULT_VALUE
 	printProperty(1).Name = "Wait"
 	printProperty(1).Value = True
	xPrintable.print(printProperty())
End Sub
Comment 1 Marcus 2017-05-20 11:27:32 UTC
Reset assigne to the default "issues@openoffice.apache.org".