Kaydet (Commit) e3167c72 authored tarafından Olivier Hallot's avatar Olivier Hallot Kaydeden (comit) Caolán McNamara

Fix the "By" property in GoDownSel and GoDownBlockSel

The "By" property for cell commands Go[Down,Up,Left,Right]Sel and
Go[Down,Up,Left,Right]BlockSel was hardcoded to 1 in cellsh4.cxx. This
patch allows repetition of the commands by the value of the By property.
üst 439e3b42
...@@ -227,19 +227,32 @@ void ScCellShell::ExecuteCursorSel( SfxRequest& rReq ) ...@@ -227,19 +227,32 @@ void ScCellShell::ExecuteCursorSel( SfxRequest& rReq )
pViewShell->ExecuteInputDirect(); pViewShell->ExecuteInputDirect();
} }
SCsCOLROW nRepeat = 1;
const SfxItemSet* pReqArgs = rReq.GetArgs();
// get repetition
if ( pReqArgs != NULL )
{
const SfxPoolItem* pItem;
if( IS_AVAILABLE( FN_PARAM_1, &pItem ) )
nRepeat = static_cast<SCsCOLROW>(((const SfxInt16Item*)pItem)->GetValue());
}
SCsROW nMovY = nRepeat;
// Horizontal direction depends on whether or not the UI language is RTL. // Horizontal direction depends on whether or not the UI language is RTL.
SCsCOL nMovX = 1; SCsCOL nMovX = nRepeat;
if (GetViewData()->GetDocument()->IsLayoutRTL(GetViewData()->GetTabNo())) if (GetViewData()->GetDocument()->IsLayoutRTL(GetViewData()->GetTabNo()))
{
// mirror horizontal movement for right-to-left mode. // mirror horizontal movement for right-to-left mode.
nMovX = -1; nMovX = -nRepeat;
}
switch (nSlotId) switch (nSlotId)
{ {
case SID_CURSORDOWN_SEL: case SID_CURSORDOWN_SEL:
pViewShell->ExpandBlock(0, 1, SC_FOLLOW_LINE); pViewShell->ExpandBlock(0, nMovY, SC_FOLLOW_LINE);
break; break;
case SID_CURSORUP_SEL: case SID_CURSORUP_SEL:
pViewShell->ExpandBlock(0, -1, SC_FOLLOW_LINE); pViewShell->ExpandBlock(0, -nMovY, SC_FOLLOW_LINE);
break; break;
case SID_CURSORRIGHT_SEL: case SID_CURSORRIGHT_SEL:
pViewShell->ExpandBlock(nMovX, 0, SC_FOLLOW_LINE); pViewShell->ExpandBlock(nMovX, 0, SC_FOLLOW_LINE);
...@@ -248,10 +261,10 @@ void ScCellShell::ExecuteCursorSel( SfxRequest& rReq ) ...@@ -248,10 +261,10 @@ void ScCellShell::ExecuteCursorSel( SfxRequest& rReq )
pViewShell->ExpandBlock(-nMovX, 0, SC_FOLLOW_LINE); pViewShell->ExpandBlock(-nMovX, 0, SC_FOLLOW_LINE);
break; break;
case SID_CURSORPAGEUP_SEL: case SID_CURSORPAGEUP_SEL:
pViewShell->ExpandBlockPage(0, -1); pViewShell->ExpandBlockPage(0, -nMovY);
break; break;
case SID_CURSORPAGEDOWN_SEL: case SID_CURSORPAGEDOWN_SEL:
pViewShell->ExpandBlockPage(0, 1); pViewShell->ExpandBlockPage(0, nMovY);
break; break;
case SID_CURSORPAGERIGHT_SEL: case SID_CURSORPAGERIGHT_SEL:
pViewShell->ExpandBlockPage(nMovX, 0); pViewShell->ExpandBlockPage(nMovX, 0);
...@@ -260,13 +273,13 @@ void ScCellShell::ExecuteCursorSel( SfxRequest& rReq ) ...@@ -260,13 +273,13 @@ void ScCellShell::ExecuteCursorSel( SfxRequest& rReq )
pViewShell->ExpandBlockPage(-nMovX, 0); pViewShell->ExpandBlockPage(-nMovX, 0);
break; break;
case SID_CURSORBLKDOWN_SEL: case SID_CURSORBLKDOWN_SEL:
pViewShell->ExpandBlockArea(0, 1); pViewShell->ExpandBlockArea(0, nMovY);
break; break;
case SID_CURSORBLKUP_SEL: case SID_CURSORBLKUP_SEL:
pViewShell->ExpandBlockArea(0, -1); pViewShell->ExpandBlockArea(0, -nMovY);
break; break;
case SID_CURSORBLKRIGHT_SEL: case SID_CURSORBLKRIGHT_SEL:
pViewShell->ExpandBlockArea(nMovX, 0); pViewShell->ExpandBlockArea(nMovX , 0);
break; break;
case SID_CURSORBLKLEFT_SEL: case SID_CURSORBLKLEFT_SEL:
pViewShell->ExpandBlockArea(-nMovX, 0); pViewShell->ExpandBlockArea(-nMovX, 0);
...@@ -275,6 +288,8 @@ void ScCellShell::ExecuteCursorSel( SfxRequest& rReq ) ...@@ -275,6 +288,8 @@ void ScCellShell::ExecuteCursorSel( SfxRequest& rReq )
; ;
} }
pViewShell->ShowAllCursors(); pViewShell->ShowAllCursors();
rReq.AppendItem( SfxInt16Item(FN_PARAM_1,static_cast<sal_Int16>(nRepeat)) );
rReq.Done(); rReq.Done();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment