/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
sal_uInt16 nLocked = pTabViewShell->GetLockedModifiers(); if ( nLocked & KEY_SHIFT )
bSel = true; // EXT elseif ( nLocked & KEY_MOD1 )
{ // ADD mode: keep the selection, start a new block when marking with shift again
bKeep = true;
}
}
if (bSel)
{ switch (nSlotId)
{ case SID_CURSORDOWN:
rReq.SetSlot(SID_CURSORDOWN_SEL); break; case SID_CURSORUP:
rReq.SetSlot(SID_CURSORUP_SEL); break; case SID_CURSORRIGHT:
rReq.SetSlot(SID_CURSORRIGHT_SEL); break; case SID_CURSORLEFT:
rReq.SetSlot(SID_CURSORLEFT_SEL); break; case SID_CURSORPAGEDOWN:
rReq.SetSlot(SID_CURSORPAGEDOWN_SEL); break; case SID_CURSORPAGEUP:
rReq.SetSlot(SID_CURSORPAGEUP_SEL); break; case SID_CURSORBLKDOWN:
rReq.SetSlot(SID_CURSORBLKDOWN_SEL); break; case SID_CURSORBLKUP:
rReq.SetSlot(SID_CURSORBLKUP_SEL); break; case SID_CURSORBLKRIGHT:
rReq.SetSlot(SID_CURSORBLKRIGHT_SEL); break; case SID_CURSORBLKLEFT:
rReq.SetSlot(SID_CURSORBLKLEFT_SEL); break; default:
;
}
ExecuteCursorSel(rReq); return;
}
SCCOLROW nRTLSign = 1; if ( rData.GetDocument().IsLayoutRTL( rData.GetTabNo() ) )
{ //! evaluate cursor movement option?
nRTLSign = -1;
}
// once extra, so that the cursor will not be painted too often with ExecuteInputDirect:
pTabViewShell->HideAllCursors();
// If ScrollLock key is active, cell cursor stays on the current cell while // scrolling the grid. bool bScrollLock = false; // tdf#112876 - allow to disable for special keyboards if (officecfg::Office::Calc::Input::UseScrollLock::get())
{
KeyIndicatorState eState = pFrameWin->GetIndicatorState(); if (eState & KeyIndicatorState::SCROLLLOCK)
bScrollLock = true;
} //OS: once for all should do, however!
pTabViewShell->ExecuteInputDirect(); switch ( nSlotId )
{ case SID_CURSORDOWN: if (bScrollLock)
pTabViewShell->ScrollY( nRepeat, SC_SPLIT_BOTTOM ); else
pTabViewShell->MoveCursorRel( 0, nRepeat, SC_FOLLOW_LINE, bSel, bKeep ); break;
void ScCellShell::ExecuteCursorSel( SfxRequest& rReq )
{
sal_uInt16 nSlotId = rReq.GetSlot();
ScTabViewShell* pViewShell = GetViewData().GetViewShell();
ScInputHandler* pInputHdl = pViewShell->GetInputHandler();
pViewShell->HideAllCursors(); if (pInputHdl && pInputHdl->IsInputMode())
{ // the current cell is in edit mode. Commit the text before moving on.
pViewShell->ExecuteInputDirect();
}
SCCOLROW nRepeat = 1; const SfxItemSet* pReqArgs = rReq.GetArgs(); // get repetition if ( pReqArgs != nullptr )
{ const SfxPoolItem* pItem; if (pReqArgs->HasItem(FN_PARAM_1, &pItem))
nRepeat = static_cast<SCCOLROW>(static_cast<const SfxInt16Item*>(pItem)->GetValue());
}
SCROW nMovY = nRepeat; // Horizontal direction depends on whether or not the UI language is RTL.
SCCOL nMovX = nRepeat; if (GetViewData().GetDocument().IsLayoutRTL(GetViewData().GetTabNo()))
{ // mirror horizontal movement for right-to-left mode.
nMovX = -nRepeat;
}
switch (nSlotId)
{ case SID_CURSORDOWN_SEL:
pViewShell->ExpandBlock(0, nMovY, SC_FOLLOW_LINE); break; case SID_CURSORUP_SEL:
pViewShell->ExpandBlock(0, -nMovY, SC_FOLLOW_LINE); break; case SID_CURSORRIGHT_SEL:
pViewShell->ExpandBlock(nMovX, 0, SC_FOLLOW_LINE); break; case SID_CURSORLEFT_SEL:
pViewShell->ExpandBlock(-nMovX, 0, SC_FOLLOW_LINE); break; case SID_CURSORPAGEUP_SEL:
pViewShell->ExpandBlockPage(0, -nMovY); break; case SID_CURSORPAGEDOWN_SEL:
pViewShell->ExpandBlockPage(0, nMovY); break; case SID_CURSORPAGERIGHT_SEL:
pViewShell->ExpandBlockPage(nMovX, 0); break; case SID_CURSORPAGELEFT_SEL:
pViewShell->ExpandBlockPage(-nMovX, 0); break; case SID_CURSORBLKDOWN_SEL:
pViewShell->ExpandBlockArea(0, nMovY); break; case SID_CURSORBLKUP_SEL:
pViewShell->ExpandBlockArea(0, -nMovY); break; case SID_CURSORBLKRIGHT_SEL:
pViewShell->ExpandBlockArea(nMovX , 0); break; case SID_CURSORBLKLEFT_SEL:
pViewShell->ExpandBlockArea(-nMovX, 0); break; default:
;
}
pViewShell->ShowAllCursors();
case SID_SELECT_NONE:
pTabViewShell->Unmark(); break;
case SID_ALIGNCURSOR:
pTabViewShell->AlignToCursor( GetViewData().GetCurX(), GetViewData().GetCurY(), SC_FOLLOW_JUMP ); break;
case SID_MARKDATAAREA:
pTabViewShell->MarkDataArea(); break;
case SID_MARKARRAYFORMULA:
pTabViewShell->MarkMatrixFormula(); break;
case SID_SETINPUTMODE:
ScModule::get()->SetInputMode(SC_INPUT_TABLE); break;
case SID_FOCUS_INPUTLINE: if (ScInputHandler* pHdl = ScModule::get()->GetInputHdl(pTabViewShell)) if (ScInputWindow* pWin = pHdl->GetInputWindow())
pWin->SwitchToTextWin(); break;
case SID_CURSORTOPOFSCREEN:
pTabViewShell->MoveCursorScreen( 0, -1, SC_FOLLOW_LINE, false ); break;
case SID_CURSORENDOFSCREEN:
pTabViewShell->MoveCursorScreen( 0, 1, SC_FOLLOW_LINE, false ); break;
default:
OSL_FAIL("Unknown message in ViewShell (Cursor)"); return;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.