sc/inc/sc.hrc | 2 +- sc/sdi/cellsh.sdi | 1 + sc/sdi/scalc.sdi | 17 +++++++++++++++++ sc/source/ui/view/cellsh1.cxx | 34 ++++++++++++++++++++++++++++++++++ 4 files changed, 53 insertions(+), 1 deletion(-)
New commits: commit 163fbf7231b26ec645365020cbef829a027e020a Author: Pranam Lashkari <lpra...@collabora.com> AuthorDate: Tue Jan 5 20:43:57 2021 +0530 Commit: Pranam Lashkari <lpra...@collabora.com> CommitDate: Sat Jan 30 08:05:54 2021 +0100 Added uno command for formula range selection Change-Id: I01cd06ed51197ffe21102fb1fd0fcdce88ab333b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108810 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Szymon Kłos <szymon.k...@collabora.com> (cherry picked from commit e8a9157878f156e599e66349d7fb60ca39e62514) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109746 Reviewed-by: Pranam Lashkari <lpra...@collabora.com> (cherry picked from commit 820984cdd2bc8f1bd8675606ec92eb42e01fff75) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109796 Tested-by: Jenkins diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc index bb8652429b27..4f7ed6980636 100644 --- a/sc/inc/sc.hrc +++ b/sc/inc/sc.hrc @@ -603,7 +603,7 @@ #define FID_DELETE_ALL_NOTES (SID_NEW_SLOTS+104) #define SID_SCATTR_CELLPROTECTION (SID_NEW_SLOTS+105) #define SID_SELECT_UNPROTECTED_CELLS (SID_NEW_SLOTS+106) - +#define SID_CURRENT_FORMULA_RANGE (SID_NEW_SLOTS+107) // idl parameter #define SID_SORT_BYROW (SC_PARAM_START) diff --git a/sc/sdi/cellsh.sdi b/sc/sdi/cellsh.sdi index 902cf8a639e9..de9f537de767 100644 --- a/sc/sdi/cellsh.sdi +++ b/sc/sdi/cellsh.sdi @@ -230,6 +230,7 @@ interface CellSelection SID_DEC_INDENT [ ExecMethod = ExecuteEdit; StateMethod = GetState; ] SID_INC_INDENT [ ExecMethod = ExecuteEdit; StateMethod = GetState; ] SID_SELECT_UNPROTECTED_CELLS [ ExecMethod = ExecuteEdit;] + SID_CURRENT_FORMULA_RANGE [ ExecMethod = ExecuteEdit;] SID_THESAURUS [ ExecMethod = ExecuteEdit; StateMethod = GetCellState; ] SID_SPELL_DIALOG [ ExecMethod = ExecuteEdit; StateMethod = GetState; ] diff --git a/sc/sdi/scalc.sdi b/sc/sdi/scalc.sdi index a85957b245e7..47b429465197 100644 --- a/sc/sdi/scalc.sdi +++ b/sc/sdi/scalc.sdi @@ -4453,6 +4453,23 @@ SfxVoidItem SelectUnprotectedCells SID_SELECT_UNPROTECTED_CELLS GroupId = SfxGroupId::Edit; ] +SfxVoidItem CurrentFormulaRange SID_CURRENT_FORMULA_RANGE +(SfxInt32Item StartCol FN_PARAM_1,SfxInt32Item StartRow FN_PARAM_2,SfxInt32Item EndCol FN_PARAM_3,SfxInt32Item EndRow FN_PARAM_4, SfxInt32Item Table FN_PARAM_5) +[ + AutoUpdate = FALSE, + FastCall = FALSE, + ReadOnlyDoc = TRUE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + + AccelConfig = FALSE, + MenuConfig = FALSE, + ToolBoxConfig = FALSE, + GroupId = SfxGroupId::Edit; +] + SfxVoidItem SelectOLE SID_OLE_SELECT () [ diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index 209172fc731b..a8940d2495ac 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -2768,6 +2768,40 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) } break; + case SID_CURRENT_FORMULA_RANGE: + { + const SfxInt32Item* param1 = rReq.GetArg<SfxInt32Item>(FN_PARAM_1); + SCCOL colStart = param1 ? param1->GetValue() : 0; + + const SfxInt32Item* param2 = rReq.GetArg<SfxInt32Item>(FN_PARAM_2); + SCROW rowStart = param2 ? param2->GetValue() : 0; + + const SfxInt32Item* param3 = rReq.GetArg<SfxInt32Item>(FN_PARAM_3); + SCCOL colEnd = param3 ? param3->GetValue() : 0; + + const SfxInt32Item* param4 = rReq.GetArg<SfxInt32Item>(FN_PARAM_4); + SCROW rowEnd = param4 ? param4->GetValue() : 0; + + const SfxInt32Item* param5 = rReq.GetArg<SfxInt32Item>(FN_PARAM_5); + SCROW table = param5 ? param5->GetValue() : 0; + + ScInputHandler* pInputHdl = SC_MOD()->GetInputHdl(); + + if(param3 && param4 && pInputHdl && pTabViewShell) + { + ScViewData& rData = pTabViewShell->GetViewData(); + ScTabView* pTabView = dynamic_cast< ScTabView* >( rData.GetView() ); + + if (param1 && param2) + rData.SetRefStart(colStart, rowStart, table); + + pTabView->UpdateRef( colEnd, rowEnd, table ); // setup the end & refresh formula + + pInputHdl->UpdateLokReferenceMarks(); + } + } + break; + default: OSL_FAIL("incorrect slot in ExecuteEdit"); break; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits