summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPranav Kant <pranavk@collabora.com>2016-05-11 18:32:52 +0530
committerpranavk <pranavk@collabora.com>2016-05-11 16:27:46 +0000
commitfa4c2244122230e90e8e972950a6ef4a5b0c0dc5 (patch)
treefb2ce98a7df0b8c882241c86298d3bad31bb2c9d
parentf768a04255933c6ac1ab0972d4a90a1c8d55ed34 (diff)
sc: Add new param, DontTerminateEdit, to .uno:Save
... which determines if current editing mode before save should be terminated with save or not. Change-Id: I49318013f1244eb8681a19ed3da50fbecd336a3d (cherry picked from commit a5a71cea62ac3041006c5e9815ae2317999639ac) Reviewed-on: https://gerrit.libreoffice.org/24895 Reviewed-by: pranavk <pranavk@collabora.com> Tested-by: pranavk <pranavk@collabora.com>
-rw-r--r--sc/source/ui/view/tabvwsha.cxx11
-rw-r--r--sfx2/sdi/sfx.sdi2
-rw-r--r--sfx2/source/appl/appuno.cxx1
3 files changed, 11 insertions, 3 deletions
diff --git a/sc/source/ui/view/tabvwsha.cxx b/sc/source/ui/view/tabvwsha.cxx
index fe2dbadffb51..957ba5a71aa1 100644
--- a/sc/source/ui/view/tabvwsha.cxx
+++ b/sc/source/ui/view/tabvwsha.cxx
@@ -696,9 +696,16 @@ void ScTabViewShell::UpdateInputHandlerCellAdjust( SvxCellHorJustify eJust )
void ScTabViewShell::ExecuteSave( SfxRequest& rReq )
{
// only SID_SAVEDOC / SID_SAVEASDOC
+ bool bCommitChanges = true;
+ const SfxItemSet* pReqArgs = rReq.GetArgs();
+ const SfxPoolItem* pItem;
+
+ if (pReqArgs && pReqArgs->HasItem(FN_PARAM_1, &pItem))
+ bCommitChanges = !static_cast<const SfxBoolItem*>(pItem)->GetValue();
- // Finish entering in any case, even if a formula is being processed
- SC_MOD()->InputEnterHandler();
+ // Finish entering unless 'DontTerminateEdit' is specified, even if a formula is being processed
+ if (bCommitChanges)
+ SC_MOD()->InputEnterHandler();
if ( GetViewData().GetDocShell()->IsDocShared() )
{
diff --git a/sfx2/sdi/sfx.sdi b/sfx2/sdi/sfx.sdi
index 0b8f47adb6de..93db31698e6c 100644
--- a/sfx2/sdi/sfx.sdi
+++ b/sfx2/sdi/sfx.sdi
@@ -4934,7 +4934,7 @@ SfxVoidItem RunBasic SID_BASICRUN
SfxBoolItem Save SID_SAVEDOC
-(SfxStringItem VersionComment SID_DOCINFO_COMMENTS,SfxStringItem Author SID_DOCINFO_AUTHOR)
+(SfxStringItem VersionComment SID_DOCINFO_COMMENTS,SfxStringItem Author SID_DOCINFO_AUTHOR,SfxBoolItem DontTerminateEdit FN_PARAM_1)
[
/* flags: */
AutoUpdate = FALSE,
diff --git a/sfx2/source/appl/appuno.cxx b/sfx2/source/appl/appuno.cxx
index 27abb609e811..5ee0a60dab46 100644
--- a/sfx2/source/appl/appuno.cxx
+++ b/sfx2/source/appl/appuno.cxx
@@ -83,6 +83,7 @@ SfxFormalArgument aFormalArgs[] = {
{ reinterpret_cast<SfxType*>(&aSfxStringItem_Impl), "SuggestedSaveAsDir", SID_DEFAULTFILEPATH },
{ reinterpret_cast<SfxType*>(&aSfxStringItem_Impl), "VersionAuthor", SID_DOCINFO_AUTHOR },
{ reinterpret_cast<SfxType*>(&aSfxStringItem_Impl), "VersionComment", SID_DOCINFO_COMMENTS },
+ { reinterpret_cast<SfxType*>(&aSfxBoolItem_Impl), "DontTerminateEdit", FN_PARAM_1 },
{ reinterpret_cast<SfxType*>(&aSfxBoolItem_Impl), "VersionMajor", SID_DOCINFO_MAJOR },
{ reinterpret_cast<SfxType*>(&aSfxStringItem_Impl), "FilterOptions", SID_FILE_FILTEROPTIONS },
{ reinterpret_cast<SfxType*>(&aSfxStringItem_Impl), "FilterName", SID_FILTER_NAME },