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 e8a9157878f156e599e66349d7fb60ca39e62514
Author:     Pranam Lashkari <lpra...@collabora.com>
AuthorDate: Tue Jan 5 20:43:57 2021 +0530
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Tue Jan 19 14:04:33 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>

diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc
index ccd4ad2da3b1..c77011c6696b 100644
--- a/sc/inc/sc.hrc
+++ b/sc/inc/sc.hrc
@@ -609,7 +609,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 4f2cd4d234b4..62d4eb31fee6 100644
--- a/sc/sdi/cellsh.sdi
+++ b/sc/sdi/cellsh.sdi
@@ -229,6 +229,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 366317ba3aae..0e8788582469 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 eb81697a4dfd..b0c703a4e3ed 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -2706,6 +2706,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& rViewData = pTabViewShell->GetViewData();
+                    ScTabView* pTabView = dynamic_cast< ScTabView* >( 
rViewData.GetView() );
+
+                    if (param1 && param2)
+                        rViewData.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

Reply via email to