Issue 18047 - XPrintJobListener crashes OOo when called
Summary: XPrintJobListener crashes OOo when called
Status: CLOSED IRREPRODUCIBLE
Alias: None
Product: App Dev
Classification: Unclassified
Component: api (show other issues)
Version: 3.3.0 or older (OOo)
Hardware: PC Linux, all
: P3 Trivial
Target Milestone: ---
Assignee: halvaughan
QA Contact: issues@api
URL:
Keywords: oooqa
Depends on:
Blocks:
 
Reported: 2003-08-08 20:16 UTC by halvaughan
Modified: 2013-02-24 21:10 UTC (History)
2 users (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 halvaughan 2003-08-08 20:16:47 UTC
I've created the simplist XPrintJobListener I could.  I run my program, which
opens a new doc, does a search and replace, then prints it, then exits.  It
doesn't save the doc or close it or anything.  From printing, it goes straight
to the quit code.

Every time I run it, it crashes OOo.  I've included code from the method that
creates the listener as well as the listener itself, which is in its own class.

This is the first time I've tried something like this and I wouldn't report it
until I could check out more, except for 2 reasons: 1) It causes an actual
crash, not just an error and 2) I don't know the timing before 1.1 goes gold, so
I want to make sure the issue is reported in case it needs to be fixed.  If I've
jumped the gun and reported this too early, I apologize.

Here's the print method that prints out the document and creates the listener:

	public void printDoc (XDocument oDoc) {
		XPrintable oPrint = (XPrintable)
			UnoRuntime.queryInterface(XPrintable.class, oDoc);
		PropertyValue[] printOpts = new PropertyValue[1];
		printOpts[0] = new PropertyValue();
		printOpts[0].Name = "Name";
		printOpts[0].Value = sPrinter;
		//sPrinter already defined within class
		XPrintJobBroadcaster xPrintStat = (XPrintJobBroadcaster)
			UnoRuntime.queryInterface(
			XPrintJobBroadcaster.class,oPrint);
		PrintListener oListener = new PrintListener();
		xPrintStat.addPrintJobListener(oListener);
		try {oPrint.print(printOpts);} catch (Exception e)
			{System.out.println("Printing exception: " + e);}
		return;
	}

//----------------------
//And here's the listener class and method:
//-------------------

import com.sun.star.lang.*;
import com.sun.star.uno.*;
import com.sun.star.view.*;

public class PrintListener implements XPrintJobListener {

	public void disposing(EventObject event) {
	}

	public void printJobEvent(PrintJobEvent event) {
		PrintableState oState = event.State;
		System.out.println("The printer state is changed: " + oState);
		return;
	}
}
Comment 1 ooo 2004-01-29 15:49:31 UTC
assigning target
Comment 2 ooo 2004-02-10 14:17:24 UTC
Sorry, I cannot reproduce this with a close to OOo 1.1.1 version.  I need more information.
Comment 3 ooo 2004-02-10 14:17:59 UTC
returning to reporter
Comment 4 lohmaier 2004-02-25 21:25:20 UTC
clearing resolution.
Comment 5 lohmaier 2004-02-25 21:26:08 UTC
closing.