diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2025-03-05 08:22:14 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2025-03-05 14:46:03 +0100 |
commit | 85fc28a4e55bb8dafd69a19dc5d21a76501446cb (patch) | |
tree | 3b1f4b10c5af3ee23388dcde3c0d7b9c610a9ead /sw/inc | |
parent | 3786da6ebe9da3d2b37ba2425bbfed57cfb7913f (diff) |
cool#11226 sw per-view redline on: state for the per-view and per-doc commands
The UI for recording is one toolbar button (toggle) with a dropdown that
has 2 radio buttons. The expectation is that once the toggle is on, one
of the radio buttons report enabled state. So this is a tri-state: the
record status is off, per-view or per-doc on the UI. At a code level, we
have a per-doc flag and we have a boolean in each view.
The requirements:
1) Compatibility: if the dropdown menu is not used, then clicking on the
old toggle should enable recording for all views & once it's enabled
(either per-view or per-doc), clicking on it should disable the
recording.
2) If recording is on, the exactly one of per-view or per-doc radio
button in the submenu should report enabled status.
This leads to a not entirely symmetric behavior if you compare the
enable, status and disable parts of this commands, and this is wanted to
result in the least amount of surprise.
Fix the problem by:
1) Enable: the toolbar button enables recording for all views (to stay
compatible), the dropdown menu allows choosing between this view vs
all views.
2) Status: the toolbar button reports enabled status if recording is on
for this view for any reason; the "this view" command reports enabled
status if recording is on in this view but not in all views; the "all
views" command reports enabled status if recording is on in this view
and no other view has it disabled.
3) Disable is almost the opposite of enabled, but the toolbar toggle can
always disable recording, so a per-view -> off -> all-views
transition is possible by clicking on the toggle twice.
This required a single change to testTrackChangesPerViewEnableOne,
because now going back to the no-record state is doable by clicking on
the enabled toolbar button, i.e. by dispatching the .uno:TrackChanges
command; dispatching .uno:TrackChangesInThisView always changes to the
per-view recording.
Change-Id: Iacc984f832b4c08e0e100a67774e1e559729d82a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182539
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sw/inc')
-rw-r--r-- | sw/inc/docsh.hxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sw/inc/docsh.hxx b/sw/inc/docsh.hxx index d6d54f136335..d67471627c5c 100644 --- a/sw/inc/docsh.hxx +++ b/sw/inc/docsh.hxx @@ -321,7 +321,7 @@ public: /** passwword protection for Writer (derived from SfxObjectShell) see also: FN_REDLINE_ON, FN_REDLINE_ON */ - virtual bool IsChangeRecording(SfxViewShell* pViewShell = nullptr) const override; + virtual bool IsChangeRecording(SfxViewShell* pViewShell = nullptr, bool bRecordAllViews = true) const override; virtual bool HasChangeRecordProtection() const override; virtual void SetChangeRecording( bool bActivate, bool bLockAllViews = false, bool bRecordAllViews = true ) override; virtual void SetProtectionPassword( const OUString &rPassword ) override; |