sc/source/ui/view/editsh.cxx | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
New commits: commit 57835f3e2524060fcb021ea5dfb31f81c089d4f1 Author: Justin Luth <jl...@mail.com> AuthorDate: Thu Mar 2 15:11:45 2023 -0500 Commit: Eike Rathke <er...@redhat.com> CommitDate: Sun Mar 5 23:19:56 2023 +0000 tdf#153548 sc: don't disable all state when IsFormulaMode This allows "Cycle Cell Reference Types" (aka F4) to remain active when switching between unfrozen and frozen sheets in order to build a formula. workdir/SdiTarget/sc/sdi/scslots.hxx is a good place to find the linkages between slot names and numbers. I also added the slots I saw on my machine that tested as usable during formula-building. I considered the following (which were in the set when I tested): SID_INSERT_FIELD_DATE_VAR SID_INSERT_FIELD_TITLE SID_INSERT_FIELD_SHEET FID_INSERT_NAME SID_CELL_FORMAT_RESET FN_INSERT_HARDHYPHEN FN_INSERT_SOFT_HYPHEN SID_TRANSLITERATE_SENTENCE_CASE SID_TRANSLITERATE_TITLE_CASE SID_TRANSLITERATE_TOGGLE_CASE SID_TRANSLITERATE_* SID_INSERT_WJ SID_INSERT_ZWSP SID_INSERT_LRM SID_INSERT_RLM SID_CHAR_DLG SID_ATTR_INSERT SID_SELECTALL # didn't actually select everything SID_DELETE SID_PASTE # seems to work magically, probably b/c FastCall = TRUE SID_COPY SID_CUT # didn't actually cut everything Change-Id: I8b7f678a2f37a79474796a568a589b83abdde4de Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148144 Tested-by: Jenkins Reviewed-by: Justin Luth <jl...@mail.com> Reviewed-by: Eike Rathke <er...@redhat.com> diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx index 9583f7fb0ac9..77583ab898e4 100644 --- a/sc/source/ui/view/editsh.cxx +++ b/sc/source/ui/view/editsh.cxx @@ -727,13 +727,20 @@ void ScEditShell::GetState( SfxItemSet& rSet ) // When deactivating the view, edit mode is stopped, but the EditShell is left active // (a shell can't be removed from within Deactivate). In that state, the EditView isn't inserted // into the EditEngine, so it can have an invalid selection and must not be used. + ScInputHandler* pHdl = GetMyInputHdl(); if ( !rViewData.HasEditView( rViewData.GetActivePart() ) ) { lcl_DisableAll( rSet ); + + // Some items are actually useful and still applicable when in formula building mode: enable + if (pHdl && pHdl->IsFormulaMode()) + { + rSet.ClearItem(SID_TOGGLE_REL); // F4 Cycle Cell Reference Types + rSet.ClearItem(SID_CHARMAP); // Insert Special Characters + } return; } - ScInputHandler* pHdl = GetMyInputHdl(); EditView* pActiveView = pHdl ? pHdl->GetActiveView() : pEditView; SfxWhichIter aIter( rSet );