Issue 24690 - Opening a Password Protected Document through API Pops Dialog
Summary: Opening a Password Protected Document through API Pops Dialog
Status: CLOSED NOT_AN_OOO_ISSUE
Alias: None
Product: App Dev
Classification: Unclassified
Component: api (show other issues)
Version: 3.3.0 or older (OOo)
Hardware: All Windows 2000
: P3 Trivial
Target Milestone: ---
Assignee: amit_batra
QA Contact: issues@api
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-01-22 09:13 UTC by amit_batra
Modified: 2013-02-24 21:06 UTC (History)
1 user (show)

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


Attachments
Java code to be run from command-line (4.38 KB, text/plain)
2004-01-28 04:53 UTC, abatra
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description amit_batra 2004-01-22 09:13:59 UTC
STEPS TO REPRODUCE:
1. Create an MS Word document that requires a password to open.
2. Write some Java code to open this document using OpenOffice.org 1.1 on 
Windows 2000.
3. Run this code.

OBSERVED BEHAVIOR:
OpenOffice.org pops up a UI dialog saying that "password protected documents 
cannot be opened."

EXPECTED BEHAVIOR:
When driven from the API, the product is expected to return the error to the 
caller by means of throwing an exception or another programmable means. The UI 
dialog is inappropriate in such cases.
Comment 1 ooo 2004-01-22 14:45:23 UTC
I don't know where the dialog comes from, Writers Word import filter or Sfx, thus guessing
Comment 2 andreas.schluens 2004-01-23 12:56:38 UTC
I cant reproduce this behaviour. Please try the following basic code:

sub main
    dim args() as new com.sun.star.beans.PropertyValue
    dim doc as object
    dim url as string

    url   = "file:///c:/password.doc"
    doc = StarDesktop.loadComponentFromURL(url , "_blank", 0, args())
    msgbox isnull(doc)
end sub

Here no UI was detected and the document couldnt be loaded (means doc=null).
Comment 3 andreas.schluens 2004-01-23 12:57:26 UTC
.
Comment 4 abatra 2004-01-28 04:52:52 UTC
Maybe this is happens only in certain cases. I am attaching some sample code in
Java that will load the document for you in OpenOffice.org 1.1. Please try to
reproduce the behavior with this code (which is theoretically the same as your
StarBasic code).
Comment 5 abatra 2004-01-28 04:53:56 UTC
Created attachment 12756 [details]
Java code to be run from command-line
Comment 6 andreas.schluens 2004-01-29 07:57:12 UTC
Sorry - but it doesnt matter if you call loadComponentFromURL() from java or
from basic. The implementation of this method is always the same ... and BTW an
implementation object cant detect, from which location its called.

Please try to reproduce the behaviour with the given basic script. May be you
was connected to an older office version? I cant reproduce your problem here.
Comment 7 ooo 2004-01-29 15:30:33 UTC
returning to reporter
Comment 8 Martin Hollmichel 2004-06-04 10:25:44 UTC
set status to resolved/invalid.
Comment 9 Martin Hollmichel 2004-06-04 10:26:59 UTC
close issue. please feel free to reopen if there are still question open