From 2d5ce0e1b233c83f91481cd6b9306ac8de7f5ff8 Mon Sep 17 00:00:00 2001 From: heiko tietze Date: Mon, 26 Mar 2018 13:08:54 +0200 Subject: tdf#116452 Remove "3 seconds to add/delete col/row" functions key events and timer removed Change-Id: I1fd1f907400eb5abbdaccbb101aa7491ec23048a Reviewed-on: https://gerrit.libreoffice.org/51872 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt --- sw/source/uibase/docvw/edtwin.cxx | 102 ++------------------------------------ sw/source/uibase/inc/edtwin.hxx | 7 --- 2 files changed, 4 insertions(+), 105 deletions(-) diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx index d16cf9d3808b..c4a7013b504c 100644 --- a/sw/source/uibase/docvw/edtwin.cxx +++ b/sw/source/uibase/docvw/edtwin.cxx @@ -1551,9 +1551,6 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt) SwModuleOptions* pModOpt = SW_MOD()->GetModuleConfig(); - TableChgWidthHeightType eTableChgMode = TableChgWidthHeightType::ColLeft; // initialization just for warning-free code - sal_uInt16 nTableChgSize = 0; - bool bStopKeyInputTimer = true; OUString sFormulaEntry; enum class SwKeyState { CheckKey, InsChar, InsTab, @@ -1579,8 +1576,6 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt) CellTopBig, CellBottomBig, CellTopSmall, CellBottomSmall, - TableColCellInsDel, - Fly_Change, Draw_Change, SpecialInsert, EnterCharCell, @@ -1773,19 +1768,8 @@ KEYINPUT_CHECKTABLE: eFlyState = SwKeyState::Fly_Change; nDir = MOVE_LEFT_BIG; } - eTableChgMode = TableChgWidthHeightType::InsertDeleteMode | - ( bMod1 - ? TableChgWidthHeightType::CellLeft - : TableChgWidthHeightType::ColLeft ); - nTableChgSize = pModOpt->GetTableVInsert(); - } - goto KEYINPUT_CHECKTABLE_INSDEL; - case KEY_RIGHT | KEY_MOD1: - { - eTableChgMode = TableChgWidthHeightType::InsertDeleteMode | TableChgWidthHeightType::CellRight; - nTableChgSize = pModOpt->GetTableVInsert(); + break; } - goto KEYINPUT_CHECKTABLE_INSDEL; case KEY_UP: case KEY_UP | KEY_MOD1: { @@ -1795,13 +1779,8 @@ KEYINPUT_CHECKTABLE: eFlyState = SwKeyState::Fly_Change; nDir = MOVE_UP_BIG; } - eTableChgMode = TableChgWidthHeightType::InsertDeleteMode | - ( bMod1 - ? TableChgWidthHeightType::CellTop - : TableChgWidthHeightType::RowTop ); - nTableChgSize = pModOpt->GetTableHInsert(); + break; } - goto KEYINPUT_CHECKTABLE_INSDEL; case KEY_DOWN: case KEY_DOWN | KEY_MOD1: { @@ -1811,36 +1790,8 @@ KEYINPUT_CHECKTABLE: eFlyState = SwKeyState::Fly_Change; nDir = MOVE_DOWN_BIG; } - eTableChgMode = TableChgWidthHeightType::InsertDeleteMode | - ( bMod1 - ? TableChgWidthHeightType::CellBottom - : TableChgWidthHeightType::RowBottom ); - nTableChgSize = pModOpt->GetTableHInsert(); - } - goto KEYINPUT_CHECKTABLE_INSDEL; - -KEYINPUT_CHECKTABLE_INSDEL: - if( rSh.IsTableMode() || !rSh.GetTableFormat() || !m_bTableInsDelMode ) - { - const SelectionType nSelectionType = rSh.GetSelectionType(); - - eKeyState = SwKeyState::KeyToView; - if(SwKeyState::KeyToView != eFlyState) - { - if((nSelectionType & (SelectionType::DrawObject|SelectionType::DbForm)) && - rSh.GetDrawView()->AreObjectsMarked()) - eKeyState = SwKeyState::Draw_Change; - else if(nSelectionType & (SelectionType::Frame|SelectionType::Ole|SelectionType::Graphic)) - eKeyState = SwKeyState::Fly_Change; - } - } - else - { - if( !m_bTableIsInsMode ) - eTableChgMode = eTableChgMode | TableChgWidthHeightType::BiggerMode; - eKeyState = SwKeyState::TableColCellInsDel; - } break; + } case KEY_DELETE: if ( !rSh.HasReadonlySel() || rSh.CursorInsideInputField()) @@ -1857,27 +1808,6 @@ KEYINPUT_CHECKTABLE_INSDEL: } break; - case KEY_DELETE | KEY_MOD2: - if( !rSh.IsTableMode() && rSh.GetTableFormat() ) - { - eKeyState = SwKeyState::End; - m_bTableInsDelMode = true; - m_bTableIsInsMode = false; - m_aKeyInputTimer.Start(); - bStopKeyInputTimer = false; - } - break; - case KEY_INSERT | KEY_MOD2: - if( !rSh.IsTableMode() && rSh.GetTableFormat() ) - { - eKeyState = SwKeyState::End; - m_bTableInsDelMode = true; - m_bTableIsInsMode = true; - m_aKeyInputTimer.Start(); - bStopKeyInputTimer = false; - } - break; - case KEY_RETURN: { if ( !rSh.HasReadonlySel() @@ -2038,9 +1968,7 @@ KEYINPUT_CHECKTABLE_INSDEL: { eFlyState = SwKeyState::Fly_Change; nDir = MOVE_RIGHT_BIG; - eTableChgMode = TableChgWidthHeightType::InsertDeleteMode | TableChgWidthHeightType::ColRight; - nTableChgSize = pModOpt->GetTableVInsert(); - goto KEYINPUT_CHECKTABLE_INSDEL; + break; } case KEY_TAB: { @@ -2651,9 +2579,6 @@ KEYINPUT_CHECKTABLE_INSDEL: case SwKeyState::CellTopSmall: rSh.SetColRowWidthHeight( TableChgWidthHeightType::CellTop, pModOpt->GetTableVMove() ); break; case SwKeyState::CellBottomSmall: rSh.SetColRowWidthHeight( TableChgWidthHeightType::CellBottom, pModOpt->GetTableVMove() ); break; - case SwKeyState::TableColCellInsDel: - rSh.SetColRowWidthHeight( eTableChgMode, nTableChgSize ); - break; case SwKeyState::Fly_Change: { SdrView *pSdrView = rSh.GetDrawView(); @@ -2680,12 +2605,6 @@ KEYINPUT_CHECKTABLE_INSDEL: } } - if( bStopKeyInputTimer ) - { - m_aKeyInputTimer.Stop(); - m_bTableInsDelMode = false; - } - // in case the buffered characters are inserted if( bFlushBuffer && !m_aInBuffer.isEmpty() ) { @@ -5037,8 +4956,6 @@ SwEditWin::SwEditWin(vcl::Window *pParent, SwView &rMyView): m_bIsInDrag(false), m_bOldIdle(false), m_bOldIdleSet(false), - m_bTableInsDelMode(false), - m_bTableIsInsMode(false), m_bChainMode(false), m_bWasShdwCursor(false), m_bLockInput(false), @@ -5064,10 +4981,6 @@ SwEditWin::SwEditWin(vcl::Window *pParent, SwView &rMyView): SetPointer( PointerStyle::Text ); m_aTimer.SetInvokeHandler(LINK(this, SwEditWin, TimerHandler)); - m_bTableInsDelMode = false; - m_aKeyInputTimer.SetTimeout( 3000 ); - m_aKeyInputTimer.SetInvokeHandler(LINK(this, SwEditWin, KeyInputTimerHandler)); - m_aKeyInputFlushTimer.SetTimeout( 200 ); m_aKeyInputFlushTimer.SetInvokeHandler(LINK(this, SwEditWin, KeyInputFlushHandler)); @@ -5093,8 +5006,6 @@ SwEditWin::~SwEditWin() void SwEditWin::dispose() { - m_aKeyInputTimer.Stop(); - delete m_pShadCursor; m_pShadCursor = nullptr; @@ -5857,11 +5768,6 @@ IMPL_LINK_NOARG(SwEditWin, KeyInputFlushHandler, Timer *, void) FlushInBuffer(); } -IMPL_LINK_NOARG(SwEditWin, KeyInputTimerHandler, Timer *, void) -{ - m_bTableInsDelMode = false; -} - void SwEditWin::InitStaticData() { m_pQuickHlpData = new QuickHelpData(); diff --git a/sw/source/uibase/inc/edtwin.hxx b/sw/source/uibase/inc/edtwin.hxx index ee00d4e95371..091b787d3a3c 100644 --- a/sw/source/uibase/inc/edtwin.hxx +++ b/sw/source/uibase/inc/edtwin.hxx @@ -72,8 +72,6 @@ class SwEditWin final : public vcl::Window, * regularly. */ AutoTimer m_aTimer; - // timer for overlapping KeyInputs (e.g. for tables) - Timer m_aKeyInputTimer; // timer for ANY-KeyInput question without a following KeyInputEvent Timer m_aKeyInputFlushTimer; @@ -113,8 +111,6 @@ class SwEditWin final : public vcl::Window, m_bIsInDrag : 1, // don't execute StartExecuteDrag twice m_bOldIdle : 1, // to stop to idle m_bOldIdleSet : 1, // during QeueryDrop - m_bTableInsDelMode : 1, - m_bTableIsInsMode : 1, m_bChainMode : 1, // connect frames m_bWasShdwCursor : 1, // ShadowCursor was on in MouseButtonDown m_bLockInput : 1, // lock while calc panel is active @@ -164,9 +160,6 @@ class SwEditWin final : public vcl::Window, // timer for ANY-KeyInut question without a following KeyInputEvent DECL_LINK( KeyInputFlushHandler, Timer *, void ); - // timer for overlapping KeyInputs (e.g. for tables) - DECL_LINK( KeyInputTimerHandler, Timer *, void ); - // timer for ApplyTemplates via mouse (in disguise Drag&Drop) DECL_LINK( TemplateTimerHdl, Timer *, void ); -- cgit v1.2.3