diff options
author | Tünde Tóth <toth.tunde@nisz.hu> | 2021-05-11 11:21:35 +0200 |
---|---|---|
committer | Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de> | 2022-05-23 10:50:01 +0200 |
commit | 9b1d7b235753c85151cc97503764bc99a8903618 (patch) | |
tree | 068c93c4b9881d70004c15078b38d8ac9f19dbf0 | |
parent | d572ee2d6c17c112a457d47d759a72bffcbc4bba (diff) |
tdf#57351 sc UI: fix disabled Insert Columns options
In a sheet with active autofilter or standard filter,
Insert Columns Before/After weren't available in the
context menu of the column header and in Sheet->Insert
Columns...
Change-Id: I746d7d5a451848306d67d57e42d3981c471c66f2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115400
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119146
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Andras Timar <andras.timar@collabora.com>
-rw-r--r-- | sc/source/ui/view/cellsh.cxx | 3 | ||||
-rw-r--r-- | sc/source/ui/view/viewfunc.cxx | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/sc/source/ui/view/cellsh.cxx b/sc/source/ui/view/cellsh.cxx index 67908ba1ba68..6b1fc8cf7ef0 100644 --- a/sc/source/ui/view/cellsh.cxx +++ b/sc/source/ui/view/cellsh.cxx @@ -254,7 +254,8 @@ void ScCellShell::GetBlockState( SfxItemSet& rSet ) if (nWhich == FID_INS_COLUMNS_AFTER) eAction = sc::ColRowEditAction::InsertColumnsAfter; - bDisable = (!bSimpleArea) || GetViewData()->SimpleRowMarked(); + bDisable = (!bSimpleArea && eMarkType != SC_MARK_SIMPLE_FILTERED) + || GetViewData()->SimpleRowMarked(); if (!bEditable && nRow1 == 0 && nRow2 == pDoc->MaxRow()) { // See if row insertions are allowed. diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx index 21d10fcd1726..8d3afb70ea2e 100644 --- a/sc/source/ui/view/viewfunc.cxx +++ b/sc/source/ui/view/viewfunc.cxx @@ -1602,7 +1602,8 @@ void ScViewFunc::OnLOKSetWidthOrHeight(SCCOLROW nStart, bool bWidth) bool ScViewFunc::InsertCells( InsCellCmd eCmd, bool bRecord, bool bPartOfPaste ) { ScRange aRange; - if (GetViewData().GetSimpleArea(aRange) == SC_MARK_SIMPLE) + ScMarkType eMarkType = GetViewData().GetSimpleArea(aRange); + if (eMarkType == SC_MARK_SIMPLE || eMarkType == SC_MARK_SIMPLE_FILTERED) { ScDocShell* pDocSh = GetViewData().GetDocShell(); const ScMarkData& rMark = GetViewData().GetMarkData(); |