diff options
-rw-r--r-- | officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu | 12 | ||||
-rw-r--r-- | sc/inc/sc.hrc | 5 | ||||
-rw-r--r-- | sc/sdi/cellsh.sdi | 3 | ||||
-rw-r--r-- | sc/sdi/scalc.sdi | 19 | ||||
-rw-r--r-- | sc/source/ui/view/cellsh1.cxx | 40 | ||||
-rw-r--r-- | sc/uiconfig/scalc/menubar/menubar.xml | 3 |
6 files changed, 74 insertions, 8 deletions
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu index 919237963507..77a9015986cf 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/CalcCommands.xcu @@ -585,9 +585,17 @@ <value>1</value> </prop> </node> - <node oor:name=".uno:SelectVisibleCells" oor:op="replace"> + <node oor:name=".uno:SelectVisibleRows" oor:op="replace"> <prop oor:name="Label" oor:type="xs:string"> - <value xml:lang="en-US">Select Visible Cells Only</value> + <value xml:lang="en-US">Select Visible Rows Only</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>1</value> + </prop> + </node> + <node oor:name=".uno:SelectVisibleColumns" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="en-US">Select Visible Columns Only</value> </prop> <prop oor:name="Properties" oor:type="xs:int"> <value>1</value> diff --git a/sc/inc/sc.hrc b/sc/inc/sc.hrc index 55be197e79c4..4e0001d3f1ff 100644 --- a/sc/inc/sc.hrc +++ b/sc/inc/sc.hrc @@ -603,8 +603,9 @@ #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_SELECT_VISIBLE_CELLS (SID_NEW_SLOTS+107) -#define SID_CURRENT_FORMULA_RANGE (SID_NEW_SLOTS+108) +#define SID_SELECT_VISIBLE_ROWS (SID_NEW_SLOTS+107) +#define SID_SELECT_VISIBLE_COLUMNS (SID_NEW_SLOTS+108) +#define SID_CURRENT_FORMULA_RANGE (SID_NEW_SLOTS+109) // idl parameter #define SID_SORT_BYROW (SC_PARAM_START) diff --git a/sc/sdi/cellsh.sdi b/sc/sdi/cellsh.sdi index cbc20f2f8959..e75d9b3fcc11 100644 --- a/sc/sdi/cellsh.sdi +++ b/sc/sdi/cellsh.sdi @@ -230,7 +230,8 @@ interface CellSelection SID_DEC_INDENT [ ExecMethod = ExecuteEdit; StateMethod = GetState; ] SID_INC_INDENT [ ExecMethod = ExecuteEdit; StateMethod = GetState; ] SID_SELECT_UNPROTECTED_CELLS [ ExecMethod = ExecuteEdit;] - SID_SELECT_VISIBLE_CELLS [ ExecMethod = ExecuteEdit;] + SID_SELECT_VISIBLE_ROWS [ ExecMethod = ExecuteEdit;] + SID_SELECT_VISIBLE_COLUMNS [ ExecMethod = ExecuteEdit;] SID_CURRENT_FORMULA_RANGE [ ExecMethod = ExecuteEdit;] SID_THESAURUS [ ExecMethod = ExecuteEdit; StateMethod = GetCellState; ] diff --git a/sc/sdi/scalc.sdi b/sc/sdi/scalc.sdi index fae369fa24a8..fbbbe1809873 100644 --- a/sc/sdi/scalc.sdi +++ b/sc/sdi/scalc.sdi @@ -4453,7 +4453,24 @@ SfxVoidItem SelectUnprotectedCells SID_SELECT_UNPROTECTED_CELLS GroupId = SfxGroupId::Edit; ] -SfxVoidItem SelectVisibleCells SID_SELECT_VISIBLE_CELLS +SfxVoidItem SelectVisibleRows SID_SELECT_VISIBLE_ROWS +() +[ + AutoUpdate = FALSE, + FastCall = FALSE, + ReadOnlyDoc = TRUE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + + AccelConfig = FALSE, + MenuConfig = TRUE, + ToolBoxConfig = FALSE, + GroupId = SfxGroupId::Edit; +] + +SfxVoidItem SelectVisibleColumns SID_SELECT_VISIBLE_COLUMNS () [ AutoUpdate = FALSE, diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index f529e34b6140..d619b461d6c3 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -2768,7 +2768,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) } break; - case SID_SELECT_VISIBLE_CELLS: + case SID_SELECT_VISIBLE_ROWS: { ScViewData& rData = GetViewData(); ScMarkData& rMark = rData.GetMarkData(); @@ -2806,6 +2806,44 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) } break; + case SID_SELECT_VISIBLE_COLUMNS: + { + ScViewData& rData = GetViewData(); + ScMarkData& rMark = rData.GetMarkData(); + ScDocument& rDoc = rData.GetDocument(); + + rMark.MarkToMulti(); + + ScRange aMultiArea; + rMark.GetMultiMarkArea(aMultiArea); + SCCOL nStartCol = aMultiArea.aStart.Col(); + SCROW nStartRow = aMultiArea.aStart.Row(); + SCCOL nEndCol = aMultiArea.aEnd.Col(); + SCROW nEndRow = aMultiArea.aEnd.Row(); + + bool bChanged = false; + for (const SCTAB& nTab : rMark) + { + for (SCCOL nCol = nStartCol; nCol <= nEndCol; ++nCol) + { + SCCOL nLastCol = nCol; + if (rDoc.ColHidden(nCol, nTab, nullptr, &nLastCol)) + { + rMark.SetMultiMarkArea( + ScRange(nCol, nStartRow, nTab, nLastCol, nEndRow, nTab), false); + bChanged = true; + nCol = nLastCol; + } + } + } + + if (bChanged && !rMark.HasAnyMultiMarks()) + rMark.ResetMark(); + + rMark.MarkToSimple(); + } + break; + case SID_CURRENT_FORMULA_RANGE: { const SfxInt32Item* param1 = rReq.GetArg<SfxInt32Item>(FN_PARAM_1); diff --git a/sc/uiconfig/scalc/menubar/menubar.xml b/sc/uiconfig/scalc/menubar/menubar.xml index f413f7a6b627..ee6527266192 100644 --- a/sc/uiconfig/scalc/menubar/menubar.xml +++ b/sc/uiconfig/scalc/menubar/menubar.xml @@ -110,7 +110,8 @@ <menu:menuitem menu:id=".uno:SelectColumn"/> <menu:menuitem menu:id=".uno:SelectData"/> <menu:menuitem menu:id=".uno:SelectUnprotectedCells"/> - <menu:menuitem menu:id=".uno:SelectVisibleCells"/> + <menu:menuitem menu:id=".uno:SelectVisibleRows"/> + <menu:menuitem menu:id=".uno:SelectVisibleColumns"/> </menu:menupopup> </menu:menu> <menu:menuseparator/> |