diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2024-09-17 08:42:01 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2024-09-17 10:55:35 +0200 |
commit | a95b90bc0cf0f8a58fc20684acc23bb89b827cd1 (patch) | |
tree | 31324c77c77a9ed1adc7512544f9af5a5a5c0c8f /sw/inc/viewsh.hxx | |
parent | 45399721e1497bc9731eacc1b001335ef4314579 (diff) |
cool#9992 lok doc sign: fix signature status after load
Load a document, see the 'signaturestatus: 4' callback
(SignatureState::NOTVALIDATED, "signature is OK, but certificate could
not be validated"), wait till the view is initialized, notice the
strange later arriving 'statechanged: .uno:Signature=3' callback, which
hints that the document was modified, but we're right after load, so
that should not happen.
I already tried to prevent doc modified status in commit
654f972a97c374fa90eb3984a44c7f54ddba9c61 (sw lok: make sure author name
change doesn't mark the doc as modified, 2023-01-16), but this is not
enough for the doc sign case, where SfxObjectShell::SetModified() ends
up refreshing the doc title, which calls
SfxObjectShell::GetDocumentSignatureState() and then caches the wrong
SignatureState::INVALID state.
Fix the problem by adding a flag to not mark the document as modified
during "init view" in the first place: that keeps the document unchanged
after updating fields, but doesn't break the doc sign status.
Now LOK clients get a first 'signaturestatus: 4' on load, and a
'statechanged: .uno:Signature=4' on initializing the view, which is a
bit redundant, but at least is consistent.
Change-Id: I42d50525ba96900eeeb927a50f1484c882347b13
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173514
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'sw/inc/viewsh.hxx')
-rw-r--r-- | sw/inc/viewsh.hxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx index 9c0bd4014a16..9b4c54a8b444 100644 --- a/sw/inc/viewsh.hxx +++ b/sw/inc/viewsh.hxx @@ -396,7 +396,7 @@ public: void CalcPagesForPrint( sal_uInt16 nMax ); // All about fields. - SW_DLLPUBLIC void UpdateFields(bool bCloseDB = false); + SW_DLLPUBLIC void UpdateFields(bool bCloseDB = false, bool bSetModified = true); bool IsAnyFieldInDoc() const; /// Update the previews of all OLE objects. |