https://bugs.documentfoundation.org/show_bug.cgi?id=96896
--- Comment #20 from [email protected] --- (In reply to Rodrigo Castanheira from comment #13) Hi castan, > I am actually able to edit the doc after step 4 in case 2. Surprisingly, I > am also able to edit the doc before step 3! I haven't noticed that before. > When a new doc is opened using > loadComponentFromURL("private:factory/swriter","_blank",0,OpenOptions) and > OpenOptions has a value "ReadOnly" = True, the expression "(read-only)" is > appended to the window title, but document is not put in read-only mode. It > is not possible to toggle edit mode using Ctrl+Shift+M (grayed out under > Edit menu). This behaviour is the same whether window title is changed or > not. I found some documentation on this: Read-Only Tells whether a document should be loaded in a (logical) readonly or in read/write mode.By default the loaded content decides what to do: if its UCB content supports a "readonly" property, the logical open mode depends on that, otherwise it will be read/write. This is only a UI related property, opening a document in read only mode will not prevent the component from being modified by API calls, but all modifying functionality in the UI will be disabled or removed. > However, when an existing document is opened using > loadComponentFromURL("file:///C:/Users/Public/existing.odt","_blank",0, > OpenOptions) and OpenOptions has a value "ReadOnly" = True, the expression > "(read-only)" is appended to the window title and, as expected, document > actually opens in read-only mode. Then, if window title is changed using API > and print preview is selected, the expression "(read-only)" dissapears but > document remains in read-only mode. From now on, no matter how many times > you toggle edit mode using Ctrl+Shift+M, the expression "(read-only)" is > never appended to window title. According to the implementation of TitleHelper, this is also correct behaviour. If external title is found it won't be updated internally. I hope all undefined behaviours have been explained. I have attached a patch. I hope it solves the problem. -- You are receiving this mail because: You are the assignee for the bug.
_______________________________________________ Libreoffice-bugs mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs
