sc/source/ui/view/tabvwsha.cxx | 5 +++-- sd/sdi/_docsh.sdi | 4 ++++ sd/source/ui/docshell/docshel3.cxx | 21 +++++++++++++++++++++ 3 files changed, 28 insertions(+), 2 deletions(-)
New commits: commit d33dab92286f139178488c3091e0c4b8dcf38277 Author: Szymon Kłos <szymon.k...@collabora.com> AuthorDate: Thu Apr 3 04:11:37 2025 +0000 Commit: Szymon Kłos <szymon.k...@collabora.com> CommitDate: Tue Apr 8 10:56:34 2025 +0200 Impress: implement DontTerminateEdit support Name FN_PARAM1 in calc so it is clear what it does. It is used as DontTerminateEdit indicator used eg. in LOK case when we do saving in the background. In Impress when we edit textbox and close presentation - sometimes it is not saved because we didn't press Enter to commit the change inside. In LOK case we want to save the content to not allow data loss in unexpected connection close. Change-Id: Ibcdcd4a0d52eb36e0b1004971dcb73f58c35459e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183652 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> (cherry picked from commit ff47a1657d3fb9ac89824566f5b7b8899a72587b) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183826 Tested-by: Jenkins Reviewed-by: Szymon Kłos <szymon.k...@collabora.com> diff --git a/sc/source/ui/view/tabvwsha.cxx b/sc/source/ui/view/tabvwsha.cxx index d756d5f22acc..67e2fe125430 100644 --- a/sc/source/ui/view/tabvwsha.cxx +++ b/sc/source/ui/view/tabvwsha.cxx @@ -808,9 +808,10 @@ void ScTabViewShell::ExecuteSave( SfxRequest& rReq ) // only SID_SAVEDOC / SID_SAVEASDOC bool bCommitChanges = true; const SfxItemSet* pReqArgs = rReq.GetArgs(); - const SfxPoolItem* pItem; + const SfxPoolItem* pItem = nullptr; - if (pReqArgs && pReqArgs->HasItem(FN_PARAM_1, &pItem)) + bool bHasDontTerminateEdit = pReqArgs && pReqArgs->HasItem(FN_PARAM_1, &pItem); + if (bHasDontTerminateEdit && pItem) bCommitChanges = !static_cast<const SfxBoolItem*>(pItem)->GetValue(); // Finish entering unless 'DontTerminateEdit' is specified, even if a formula is being processed diff --git a/sd/sdi/_docsh.sdi b/sd/sdi/_docsh.sdi index 02de70858ab0..2414c07449bc 100644 --- a/sd/sdi/_docsh.sdi +++ b/sd/sdi/_docsh.sdi @@ -21,6 +21,10 @@ interface DrawDocument [ StateMethod = GetState ; ] + SID_SAVEDOC + [ + ExecMethod = Execute ; + ] SID_CLOSEDOC // ole : ?, status : ? [ ExecMethod = Execute ; diff --git a/sd/source/ui/docshell/docshel3.cxx b/sd/source/ui/docshell/docshel3.cxx index 1ebde799f15a..c3d129678bbb 100644 --- a/sd/source/ui/docshell/docshel3.cxx +++ b/sd/source/ui/docshell/docshel3.cxx @@ -230,6 +230,27 @@ void DrawDocShell::Execute( SfxRequest& rReq ) } break; + case SID_SAVEDOC: + case SID_SAVEASDOC: + { + const SfxPoolItem* pItem = nullptr; + bool bCommitChanges = false; + const SfxItemSet* pReqArgs = rReq.GetArgs(); + bool bHasDontTerminateEdit = pReqArgs && pReqArgs->HasItem(FN_PARAM_1, &pItem); + if (bHasDontTerminateEdit && pItem) + bCommitChanges = !static_cast<const SfxBoolItem*>(pItem)->GetValue(); + + if (mpViewShell && bCommitChanges) + { + SdrView* pView = mpViewShell->GetView(); + if (pView) + pView->SdrEndTextEdit(); + } + + ExecuteSlot( rReq, SfxObjectShell::GetStaticInterface() ); + } + break; + case SID_VERSION: case SID_CLOSEDOC: {