diff options
author | AhmedHamed <ahmedhamed3699@gmail.com> | 2024-08-08 22:38:11 +0300 |
---|---|---|
committer | Andreas Heinisch <andreas.heinisch@yahoo.de> | 2024-08-14 11:20:27 +0200 |
commit | b8593ef96da5a6090a03812247a0a7c3651546a6 (patch) | |
tree | b5369de98421641cad2bd6d4a7d571deaf9c0e5f /sc | |
parent | a22fe103e7a26270b7213448c570400a563c18ba (diff) |
tdf#162069 Initial focus is in the document when creating a new sheet
Change-Id: Iabd5401397bbdd5b45275da06235d879ce4ac984
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/171709
Tested-by: Jenkins
Tested-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/view/tabcont.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/tabvwshf.cxx | 6 |
2 files changed, 8 insertions, 0 deletions
diff --git a/sc/source/ui/view/tabcont.cxx b/sc/source/ui/view/tabcont.cxx index 2fffc87fc1b4..09507f258d69 100644 --- a/sc/source/ui/view/tabcont.cxx +++ b/sc/source/ui/view/tabcont.cxx @@ -240,6 +240,8 @@ void ScTabControl::AddTabClick() rDoc.CreateValidTabName(aName); SCTAB nTabCount = rDoc.GetTableCount(); pViewData->GetViewShell()->InsertTable(aName, nTabCount); + if (!pScMod->IsModalMode() && !pScMod->IsFormulaMode() && !IsInEditMode()) + pViewData->GetViewShell()->SetActive(); } void ScTabControl::Select() diff --git a/sc/source/ui/view/tabvwshf.cxx b/sc/source/ui/view/tabvwshf.cxx index dd0a12930870..8c0d4049ffc4 100644 --- a/sc/source/ui/view/tabvwshf.cxx +++ b/sc/source/ui/view/tabvwshf.cxx @@ -880,7 +880,10 @@ void ScTabViewShell::ExecuteInsertTable(SfxRequest& rReq) } if (bOk) + { + rViewData.GetViewShell()->SetActive(); rReq.Done( *pReqArgs ); + } //! else set error } else // dialog @@ -996,6 +999,7 @@ void ScTabViewShell::DoInsertTableFromDialog(SfxRequest& rReq, const VclPtr<Abst } } } + rViewData.GetViewShell()->SetActive(); } void ScTabViewShell::DoMoveTableFromDialog( SfxRequest& rReq, const VclPtr<AbstractScMoveTableDlg>& pDlg ) @@ -1166,6 +1170,8 @@ bool ScTabViewShell::DoAppendOrRenameTableDialog(sal_Int32 nResult, const VclPtr if ( bDone ) { + if (nSlot == FID_TAB_APPEND) + rViewData.GetViewShell()->SetActive(); xReq->AppendItem( SfxStringItem( nSlot, aName ) ); xReq->Done(); } |