fpicker/source/office/autocmpledit.cxx | 25 ++++++++++++++++++++++++- fpicker/source/office/autocmpledit.hxx | 2 ++ sfx2/source/appl/newhelp.cxx | 1 + svx/source/table/tablecontroller.cxx | 2 ++ 4 files changed, 29 insertions(+), 1 deletion(-)
New commits: commit 3f793465819f63aa001f5842f232be24d13153fd Author: Caolán McNamara <[email protected]> AuthorDate: Thu Apr 14 12:05:49 2022 +0100 Commit: Caolán McNamara <[email protected]> CommitDate: Thu Apr 14 16:10:37 2022 +0200 tdf#148101 don't autocomplete remote files dialog entry on delete/backspace Change-Id: Ieddb41eb37e7090416a418afeffb76ce0eddf90a Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133009 Tested-by: Jenkins Reviewed-by: Caolán McNamara <[email protected]> diff --git a/fpicker/source/office/autocmpledit.cxx b/fpicker/source/office/autocmpledit.cxx index 5a31c7bdc501..89a2d0b0c245 100644 --- a/fpicker/source/office/autocmpledit.cxx +++ b/fpicker/source/office/autocmpledit.cxx @@ -7,21 +7,44 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +#include <vcl/event.hxx> #include "autocmpledit.hxx" AutocompleteEdit::AutocompleteEdit(std::unique_ptr<weld::Entry> xEntry) : m_xEntry(std::move(xEntry)) , m_aChangedIdle("fpicker::AutocompleteEdit m_aChangedIdle") + , m_nLastCharCode(0) { m_xEntry->connect_changed(LINK(this, AutocompleteEdit, ChangedHdl)); + m_xEntry->connect_key_press(LINK(this, AutocompleteEdit, KeyInputHdl)); m_aChangedIdle.SetInvokeHandler(LINK(this, AutocompleteEdit, TryAutoComplete)); } +IMPL_LINK(AutocompleteEdit, KeyInputHdl, const KeyEvent&, rKEvt, bool) +{ + m_nLastCharCode = rKEvt.GetKeyCode().GetCode(); + return false; +} + IMPL_LINK_NOARG(AutocompleteEdit, ChangedHdl, weld::Entry&, void) { m_aChangeHdl.Call(*m_xEntry); - m_aChangedIdle.Start(); //launch this to happen on idle after cursor position will have been set + + switch (m_nLastCharCode) + { + case css::awt::Key::DELETE_WORD_BACKWARD: + case css::awt::Key::DELETE_WORD_FORWARD: + case css::awt::Key::DELETE_TO_BEGIN_OF_LINE: + case css::awt::Key::DELETE_TO_END_OF_LINE: + case KEY_BACKSPACE: + case KEY_DELETE: + m_aChangedIdle.Stop(); + break; + default: + m_aChangedIdle.Start(); //launch this to happen on idle after cursor position will have been set + break; + } } void AutocompleteEdit::AddEntry( const OUString& rEntry ) diff --git a/fpicker/source/office/autocmpledit.hxx b/fpicker/source/office/autocmpledit.hxx index bfb2ee096a63..3eb79eb14aa6 100644 --- a/fpicker/source/office/autocmpledit.hxx +++ b/fpicker/source/office/autocmpledit.hxx @@ -22,7 +22,9 @@ private: std::vector<OUString> m_aMatching; Idle m_aChangedIdle; Link<weld::Entry&, void> m_aChangeHdl; + sal_uInt16 m_nLastCharCode; + DECL_LINK(KeyInputHdl, const KeyEvent&, bool); DECL_LINK(ChangedHdl, weld::Entry&, void); DECL_LINK(TryAutoComplete, Timer*, void); diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx index 58818c3a248d..a120a99f41bb 100644 --- a/sfx2/source/appl/newhelp.cxx +++ b/sfx2/source/appl/newhelp.cxx @@ -475,6 +475,7 @@ IMPL_LINK_NOARG(IndexTabPage_Impl, EntryChangeHdl, weld::Entry&, void) case css::awt::Key::DELETE_TO_END_OF_LINE: case KEY_BACKSPACE: case KEY_DELETE: + aAutoCompleteIdle.Stop(); break; default: aAutoCompleteIdle.Start(); commit ae0e7e3918284c31a91acca0f733919926ae3a62 Author: Caolán McNamara <[email protected]> AuthorDate: Thu Apr 14 11:20:23 2022 +0100 Commit: Caolán McNamara <[email protected]> CommitDate: Thu Apr 14 16:10:20 2022 +0200 tdf#141812 keep focus in an impress table cell when row/col deleted Change-Id: I3b396ba92039bad657ca159002598a271b68a79d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133008 Tested-by: Jenkins Reviewed-by: Caolán McNamara <[email protected]> diff --git a/svx/source/table/tablecontroller.cxx b/svx/source/table/tablecontroller.cxx index 3a60e5c773ac..8ef76acd377e 100644 --- a/svx/source/table/tablecontroller.cxx +++ b/svx/source/table/tablecontroller.cxx @@ -827,6 +827,7 @@ void SvxTableController::onDelete( sal_uInt16 nSId ) { Reference< XTableColumns > xCols( mxTable->getColumns() ); xCols->removeByIndex( aStart.mnCol, nRemovedColumns ); + EditCell(aStart, nullptr, TblAction::NONE); } break; } @@ -842,6 +843,7 @@ void SvxTableController::onDelete( sal_uInt16 nSId ) { Reference< XTableRows > xRows( mxTable->getRows() ); xRows->removeByIndex( aStart.mnRow, nRemovedRows ); + EditCell(aStart, nullptr, TblAction::NONE); } break; }
