Issue 118032 - getPrinter behavior changed between oo3.2.1 and oo3.3 - causing exception
Summary: getPrinter behavior changed between oo3.2.1 and oo3.3 - causing exception
Status: CLOSED DUPLICATE of issue 117010
Alias: None
Product: udk
Classification: Code
Component: code (show other issues)
Version: OOo 3.3 RC8
Hardware: PC Windows, all
: P3 Normal (vote)
Target Milestone: not determined
Assignee: kay.ramme
QA Contact: issues@udk
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-16 14:29 UTC by jb
Modified: 2012-06-13 12:22 UTC (History)
4 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description jb 2011-05-16 14:29:44 UTC
I am maintaining an old Delphi app that works fine with oo3.2.1 and earlier.  Its interface with OpenOffice uses Bernard Marcelly's "OOo Tool".

Since oo3.3, getPrinter causes an exception as follows:

EVariantBadVarTypeError 
Description: "Invalid Variant Type...raised when a variant operation fails because of a value that isn't a valid variant type."

It looks like the getPrinter method behaves differently since oo3.3.  Is this by design?  Perhaps there is a bug?

I would be very happy to look at the source code, but do not know how to obtain it.  I would want to compare the source of getPrinter between v3.2.1 and v3.3.

Regards
Julian Brewer

P.S. The code that throws the exception is marked (***) below.  I stress that this all worked fine until v3.3:

docs[di].v := StarDesktop.LoadComponentFromURL(URL, '_blank', 0, fileProp);

[...]

function ToOoDoc.docPrinterBusy( docIndex : integer) : boolean;
var
   queryPrinter : variant;
   i : integer;
begin
     result := false;
     if not docs[docIndex].isOpen then exit;
(***)queryPrinter := docs[docIndex].v.getPrinter;
     [...]
end;
Comment 1 Oliver Brinzing 2011-05-16 16:45:08 UTC
,
Comment 2 niklas.nebel 2011-05-17 15:28:55 UTC
getPrinter returns a sequence of PropertyValue, so this sounds like a duplicate of issue 117010 (fixed in CWS jl166, but not yet integrated). See also issue 117523.
Comment 3 jpmartin_akantha 2011-06-22 09:47:17 UTC
i've the same trouble with a VB6 app when trying to apply printerproperties from a getPrinter 
(it was working fine in OOo 2.2, 3.1, 3.2 and crash in 3.3.0)

would it be fixed in 3.4 or is there any change to do in our code ?

thanks
Jean-Pierre
Comment 4 hdu@apache.org 2012-02-03 11:22:09 UTC
Kudos to Niklas for identifying this issue as having the same root cause as the fixed bug 117010.

*** This issue has been marked as a duplicate of issue 117010 ***
Comment 5 Oliver-Rainer Wittmann 2012-06-13 12:22:49 UTC
getting rid of value "enhancement" for field "severity".
For enhancement the field "issue type" shall be used.