sfx2/source/dialog/dinfdlg.cxx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
New commits: commit 6c7fd1dc50cbc3f8e61c741367223a4b4aefc98b Author: Gökay Şatır <gokaysa...@collabora.com> AuthorDate: Tue Oct 31 16:57:52 2023 +0300 Commit: Mike Kaganski <mike.kagan...@collabora.com> CommitDate: Wed Nov 1 13:22:13 2023 +0100 Get the current view with SfxViewFrame::Current(). It was getting a null ptr for some reason. Signed-off-by: Gökay Şatır <gokaysa...@collabora.com> Change-Id: Ib3e285dc86cd3918b631b6993e9afb221994bfab Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158727 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx index 52416c1f55d0..ec37a70828e0 100644 --- a/sfx2/source/dialog/dinfdlg.cxx +++ b/sfx2/source/dialog/dinfdlg.cxx @@ -798,9 +798,11 @@ IMPL_LINK_NOARG(SfxDocumentPage, ChangePassHdl, weld::Button&, void) tools::JsonWriter payloadJson; payloadJson.put("password", m_xPasswordDialog->GetPasswordToOpen()); payloadJson.put("isToModify", false); - pShell->GetViewShell()->libreOfficeKitViewCallback( - LOK_CALLBACK_DOCUMENT_PASSWORD_RESET, - payloadJson.extractAsOString().getStr()); + + SfxViewShell *vShell = SfxViewShell::Current(); + if (vShell) + vShell->libreOfficeKitViewCallback(LOK_CALLBACK_DOCUMENT_PASSWORD_RESET, payloadJson.extractAsOString().getStr()); + pShell->SetModified(); } m_xPasswordDialog->disposeOnce();