Bug 144656 - Load-Property AsTemplate='True' shows dialog if document is write protected
Summary: Load-Property AsTemplate='True' shows dialog if document is write protected
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
7.2.0.4 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-09-22 09:56 UTC by Sven
Modified: 2023-01-23 21:10 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sven 2021-09-22 09:56:59 UTC
Description:
I open a write protected template with the property AsTemplate = 'True' and LibreOffice shows a dialog to choose whether to open the protected document or a new untitled document. Loading a non-write protected document with property AsTemplate works fine.

I have expected to open the untitled document directly without showing a dialog.

Loading the document without ReadOnly-Property shows a dialog.
Loading the document with ReadOnly-Property = False shows an error.

Tested with:
Version: 7.2.0.4 (x64) / LibreOffice Community
Build ID: 9a9c6381e3f7a62afc1329bd359cc48accb6435b
CPU threads: 4; OS: Windows 10.0 Build 18363; UI render: Skia/Vulkan; VCL: win
Locale: de-DE (de_DE); UI: de-DE
Calc: threaded

Steps to Reproduce:
1. Run macro
Sub Main
    Dim oDesktop as Object
    Dim aPva(2) as new com.sun.star.beans.PropertyValue

    aPva(0).Name = "AsTemplate"
    aPva(0).Value = True
'   aPva(1).Name = "ReadOnly"
'   aPva(1).Value = False

    oDesktop = createUnoService( "com.sun.star.frame.Desktop" )
    oDesktop.loadComponentFromURL( "file:///C:/TEMP/Test.ott" , "_blank" , 0 , aPva )

End Sub

Actual Results:
Dialog will be shown

Expected Results:
untitled document should be opened directly


Reproducible: Always


User Profile Reset: No



Additional Info:
none
Comment 1 Oliver Brinzing 2021-09-25 14:46:14 UTC
i can confirm the described behaviour:

ReadOnly = False 

Type: com.sun.star.lang.IllegalArgumentException
Message: Unsupported URL <file:///D:/Test.ott>: "type detection failed"

ReadOnly = True // without ReadOnly:

Das Dokument 'Test.ott' ist schreibgeschützt.
Öffnen Sie es schreibgeschützt oder wählen Sie "Benachrichtigen", um das Dokument schreibgeschützt zu 
öffnen und benachrichtigt zu werden, wenn es wieder bearbeitet werden kann.
Comment 2 Sven 2023-01-23 18:28:08 UTC
Problem doesn't exist anymore. Tested with

Version: 7.5.0.1 (X86_64) / LibreOffice Community
Build ID: 77cd3d7ad4445740a0c6cf977992dafd8ebad8df
CPU threads: 4; OS: Windows 10.0 Build 19044; UI render: Skia/Vulkan; VCL: win
Locale: de-DE (de_DE); UI: de-DE
Calc: threaded