Bug 159278 - API call to XStorable.storeToURL with Password does not work for DOCX output
Summary: API call to XStorable.storeToURL with Password does not work for DOCX output
Status: UNCONFIRMED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: filters and storage (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-01-19 03:17 UTC by Paul
Modified: 2024-01-31 07:02 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Document with macro showing issue (11.01 KB, application/vnd.oasis.opendocument.text)
2024-01-31 06:58 UTC, Paul
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Paul 2024-01-19 03:17:29 UTC
Using XStorable.storeToURL(url, args) and adding a "Password" to args allows an "open password" (ie "read password") to be set on the stored document.

This works as expected for ODT and DOC formats - when the documents are opened the user is prompted for a password.

It does not seem to work when storing in DOCX format (filter "MS Word 2007 XML") - the saved document can simply be opened and viewed.

Is this a bug or is there a different way to set the open-password on a DOCX file?  I see MediaDescriptor also mentions EncryptionData, can that be used?  If so, is there any information available as to how to do so?
Comment 1 Buovjaga 2024-01-30 10:51:11 UTC
Can you attach an example ODT with a macro that shows the issue when saved as DOCX?
Comment 2 Paul 2024-01-31 06:58:29 UTC
Created attachment 192278 [details]
Document with macro showing issue
Comment 3 Paul 2024-01-31 07:02:23 UTC
Document with macro attached.  It seems to show the problem that I experience with the UNO (Java) API.  It is currently configured to set the password and save the current to c:\temp\Output.docx.  The resulting docx file does not require a password.  If lines 13 and 14 are uncommented (and 15/16 are commented out), it saves Output.doc and the open password is needed to open the document in Word.