https://bugs.documentfoundation.org/show_bug.cgi?id=148416

--- Comment #6 from Justin L <[email protected]> ---
The act of requesting a password in this case should be pretty simple. It is
the same area as bug 142147.

We have the following functions to work with:
-IsLoadReadonly() // File - Properties - Security - Open File read only
-IsReadOnly() // Is the document currently in read-only mode?
-IsModifyPasswordEntered() // Has the user unlocked edit mode already?
-GetModifyPasswordHash() // one of two ways to require password to modify
-GetModifyPasswordInfo().hasElements() // second way to require edit password.

I'm assuming GetModifyPasswordHash is an old method. During investigation for
this bug report, I only saw GetModifyPasswordInfo used.

So the question is "In which situations should we assume the user wants to
enter a password?"

Note that "open read only" is hidden under a dropdown, and will ALWAYS start as
unchecked. (To change this would be rather tedious I expect. 
cui/source/dialogs/passwdomdlg.cxx's m_xOpenReadonlyCB.

[The function is passed bIsPasswordToModify, but that only indicates whether to
 ENABLE the read-only part of the dialog. It is a LONG calling trail to try to
 pass any config options to it...]

Perhaps the easier question to ask is when would you NOT want to save with
password.
-obviously one of the two password methods needs to exist
-but not if the user has turned off IsLoadReadonly - verify still active.
    -question: is there a way to set Modify Password WITHOUT LoadReadOnly?
-so at this point the document is going to open read-only anyway, the only
question remaining is whether it should require a password.

In the spirit of bug 142147, it shouldn't matter whether the user has entered
edit mode or not. Since a password exists, it should be suggested at SAVE-AS.

so bPreselectPassword &= IsLoadReadonly() &&
(GetModifyPasswordInfo().hasElements() || GetModifyPasswordHash())

The downside here is that there is NOTHING that hints to the user why the
password is being requested. The read-only portion is minimized, and the
read-only flag is off (despite being IsLoadReadonly).

I think the key to fixing this is to get that dialog to expand and default to
m_xOpenReadonlyCB->set_active(IsLoadReadonly())

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to