sc/source/ui/view/tabvwsha.cxx | 3 ++- sd/sdi/_docsh.sdi | 4 ++++ sd/source/ui/docshell/docshel3.cxx | 21 +++++++++++++++++++++ 3 files changed, 27 insertions(+), 1 deletion(-)
New commits: commit ff47a1657d3fb9ac89824566f5b7b8899a72587b 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 07:33:23 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 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/183824 Reviewed-by: Szymon Kłos <szymon.k...@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> diff --git a/sc/source/ui/view/tabvwsha.cxx b/sc/source/ui/view/tabvwsha.cxx index d756d5f22acc..46cb5a6e8258 100644 --- a/sc/source/ui/view/tabvwsha.cxx +++ b/sc/source/ui/view/tabvwsha.cxx @@ -810,7 +810,8 @@ void ScTabViewShell::ExecuteSave( SfxRequest& rReq ) const SfxItemSet* pReqArgs = rReq.GetArgs(); const SfxPoolItem* pItem; - if (pReqArgs && pReqArgs->HasItem(FN_PARAM_1, &pItem)) + bool bHasDontTerminateEdit = pReqArgs && pReqArgs->HasItem(FN_PARAM_1, &pItem); + if (bHasDontTerminateEdit) 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..67948004d5fa 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; + bool bCommitChanges = false; + const SfxItemSet* pReqArgs = rReq.GetArgs(); + bool bHasDontTerminateEdit = pReqArgs && pReqArgs->HasItem(FN_PARAM_1, &pItem); + if (bHasDontTerminateEdit) + 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: {