diff options
author | Olivier Hallot <olivier.hallot@documentfoundation.org> | 2011-07-29 12:23:26 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-07-29 12:24:04 +0100 |
commit | 2a6f95014f3f8be561b4b67e9274a3cc24e2d08f (patch) | |
tree | b3a3cafb3f3fb9413829bbede97b82bedd0bd0db | |
parent | 80583680685f571124ece05e008e1236295ab49a (diff) |
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.
-rw-r--r-- | sc/source/ui/view/cellsh4.cxx | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/sc/source/ui/view/cellsh4.cxx b/sc/source/ui/view/cellsh4.cxx index 39a0d6597..136b650d1 100644 --- a/sc/source/ui/view/cellsh4.cxx +++ b/sc/source/ui/view/cellsh4.cxx @@ -227,19 +227,32 @@ void ScCellShell::ExecuteCursorSel( SfxRequest& rReq ) 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. - SCsCOL nMovX = 1; + SCsCOL nMovX = nRepeat; if (GetViewData()->GetDocument()->IsLayoutRTL(GetViewData()->GetTabNo())) + { // mirror horizontal movement for right-to-left mode. - nMovX = -1; + nMovX = -nRepeat; + } switch (nSlotId) { case SID_CURSORDOWN_SEL: - pViewShell->ExpandBlock(0, 1, SC_FOLLOW_LINE); + pViewShell->ExpandBlock(0, nMovY, SC_FOLLOW_LINE); break; case SID_CURSORUP_SEL: - pViewShell->ExpandBlock(0, -1, SC_FOLLOW_LINE); + pViewShell->ExpandBlock(0, -nMovY, SC_FOLLOW_LINE); break; case SID_CURSORRIGHT_SEL: pViewShell->ExpandBlock(nMovX, 0, SC_FOLLOW_LINE); @@ -248,10 +261,10 @@ void ScCellShell::ExecuteCursorSel( SfxRequest& rReq ) pViewShell->ExpandBlock(-nMovX, 0, SC_FOLLOW_LINE); break; case SID_CURSORPAGEUP_SEL: - pViewShell->ExpandBlockPage(0, -1); + pViewShell->ExpandBlockPage(0, -nMovY); break; case SID_CURSORPAGEDOWN_SEL: - pViewShell->ExpandBlockPage(0, 1); + pViewShell->ExpandBlockPage(0, nMovY); break; case SID_CURSORPAGERIGHT_SEL: pViewShell->ExpandBlockPage(nMovX, 0); @@ -260,13 +273,13 @@ void ScCellShell::ExecuteCursorSel( SfxRequest& rReq ) pViewShell->ExpandBlockPage(-nMovX, 0); break; case SID_CURSORBLKDOWN_SEL: - pViewShell->ExpandBlockArea(0, 1); + pViewShell->ExpandBlockArea(0, nMovY); break; case SID_CURSORBLKUP_SEL: - pViewShell->ExpandBlockArea(0, -1); + pViewShell->ExpandBlockArea(0, -nMovY); break; case SID_CURSORBLKRIGHT_SEL: - pViewShell->ExpandBlockArea(nMovX, 0); + pViewShell->ExpandBlockArea(nMovX , 0); break; case SID_CURSORBLKLEFT_SEL: pViewShell->ExpandBlockArea(-nMovX, 0); @@ -275,6 +288,8 @@ void ScCellShell::ExecuteCursorSel( SfxRequest& rReq ) ; } pViewShell->ShowAllCursors(); + + rReq.AppendItem( SfxInt16Item(FN_PARAM_1,static_cast<sal_Int16>(nRepeat)) ); rReq.Done(); } |