Bug 65781

Summary: UI: Edit -> "Compare Document" greyed out for read-only documents
Product: LibreOffice Reporter: Charles <c>
Component: WriterAssignee: Not Assigned <libreoffice-bugs>
Status: RESOLVED NOTABUG    
Severity: normal CC: cno, michael.stahl, sberg.fun
Priority: medium    
Version: 3.5.7.2 release   
Hardware: Other   
OS: Linux (All)   
Whiteboard: BSA
Crash report or crash signature: Regression By:

Description Charles 2013-06-15 08:35:20 UTC
Problem description:

When a .odt file with write permission is opened and the Edit menu expanded, “Compare Document” is available. It is not available (greyed out) when the .odt file does not have write permission.

Steps to reproduce:

1. Start LO Writer without naming a file.
2. Save "Untitled 1" as /tmp/test.odt
3. Close the LOW window.
4. Remove write permission from /tmp/test.odt
5. Open /tmp/test.odt
6. Expand the edit menu and observe that "Compare Document..." is greyed out.
7. Close the LOW window.
8. Restore write permission on /tmp/test.odt
5. Open /tmp/test.odt
6. Expand the edit menu and observe that "Compare Document..." is not greyed out. 

Current behavior: as above

Expected behavior: "Compare Document..." available regardless of the write permission status.

This behaviour was initially seen with a workaday file using LO 4.0.1.2 on Slackware 14.0, then with a minimal test file. The same behaviour was seen with LO 3.5.7 on Ubuntu 12.04.              
Operating System: Linux (Other)
Version: 3.5.7.2 release
Comment 1 Cor Nouws 2013-06-15 09:15:50 UTC
Hi Charles,
Thanks for reporting, but I do not see the bug or idea for enhancing.

What happens when you do a "Edit > Compare Document"?
The currenct document is edited. How should that be done on a read-only file ??
Best - Cor
Comment 2 Charles 2013-06-16 11:38:48 UTC
One use case is to display the difference between two archived documents, archived in the sense that both are kept "for the record", and not to be changed.
Comment 3 ign_christian 2013-06-20 08:38:14 UTC
Same behavior with Windows system if we set Read-only attributes within file properties from Explorer.

Perhaps that could be an enhancement request?
Comment 4 Charles 2013-06-20 09:44:44 UTC
Converting this to an enhancement request would be OK with me.  If there is any action I should take, please advise.
Comment 5 Cor Nouws 2013-06-20 10:43:29 UTC
@sbergman: didn't I see a message in one of the release notes that editing read only documents was added ?
Comment 6 Stephan Bergmann 2013-06-20 12:44:53 UTC
That "Edit - Compare Document..." is disabled for read-only documents is due to

  ReadOnlyDoc = FALSE

in the

  SfxInt32Item CompareDocuments SID_DOCUMENT_COMPARE

entry in sfx2/sdi/sfx.sdi.  It was that way already "since the beginning," <http://cgit.freedesktop.org/libreoffice/core/commit/?id=fd069bee7e57ad529c3c0974559fd2d84ec3151a> "initial import" (and entries in sfx.sdi got later reshuffled with <http://cgit.freedesktop.org/libreoffice/core/commit/?id=94bb4bf8a4b2fc5f1a782de6edbc824faa81e6f0> "#98405#: prepare items and slots for new recording," but that left the value intact).

Changing that to

  ReadOnlyDoc = TRUE

would enable "Edit - Compare Document..." for read-only documents, but I have no idea whether that would be a welcome fix or whether the current state is "a feature, not a bug."
Comment 7 Michael Stahl (allotropia) 2013-06-20 15:28:56 UTC
the Compare Document feature will modify the opened document
by inserting Change Tracking information.

Every part of the UI that allows editing an open document
is disabled in read-only mode.

the "editing read only documents" mentioned in comment #5
refers to switching a file which is in a location where the
user has insufficient permissions to write from read-only mode
to read-write mode without annoying dialogs (and then asking
for a different location when the user saves the document),
which is applicable in this case: if you want to use the
Compare Document feature, just click the Edit button in the
toolbar, just like for every other editing operation.

thus i would say this is working as designed, and not a bug.
Comment 8 Cor Nouws 2013-07-30 21:44:31 UTC
as per explanation of Michael