HI

Here is a patch to allow GoUpSel, GoDownSel, GoLeftsel,GoRightSel to receive
"By" property

a test file appended as well. Run Main macro to test patch

I left
SID_CURSORBLKDOWN_SEL
SID_CURSORBLKUP_SEL
SID_CURSORBLKLEFT_SEL
SID_CURSORBLKRIGHT_SEL

untouched because repetitions makes no sense to them  AFAIK (I may have
missed something, otherwise)

License is LGPLV3 + MPL

regards
Olivier

-- 
Olivier Hallot
Founder and Steering Commitee Member
The Document Foundation

Attachment: teste-cell.ods
Description: application/vnd.oasis.opendocument.spreadsheet

--- cellsh4.cxx	2011-07-28 09:17:01.797526002 -0300
+++ git/libo/sc/source/ui/view/cellsh4.cxx	2011-07-28 17:53:17.053526001 -0300
@@ -219,8 +219,10 @@
 {
     sal_uInt16 nSlotId  = rReq.GetSlot();
     ScTabViewShell* pViewShell = GetViewData()->GetViewShell();
+    const SfxItemSet*   pReqArgs = rReq.GetArgs();
     ScInputHandler* pInputHdl = pViewShell->GetInputHandler();
     pViewShell->HideAllCursors();
+    SCsCOLROW	        nRepeat = 1;
     if (pInputHdl && pInputHdl->IsInputMode())
     {
         // the current cell is in edit mode.  Commit the text before moving on.
@@ -232,32 +234,40 @@
     if (GetViewData()->GetDocument()->IsLayoutRTL(GetViewData()->GetTabNo()))
         // mirror horizontal movement for right-to-left mode.
         nMovX = -1;
-
+    
+    // get repetition
+      if ( pReqArgs != NULL )
+      {
+          const   SfxPoolItem* pItem;
+          if( IS_AVAILABLE( FN_PARAM_1, &pItem ) )
+              nRepeat = static_cast<SCsCOLROW>(((const SfxInt16Item*)pItem)->GetValue());
+      }
+    
     switch (nSlotId)
     {
         case SID_CURSORDOWN_SEL:
-            pViewShell->ExpandBlock(0, 1, SC_FOLLOW_LINE);
+            pViewShell->ExpandBlock(0, nRepeat, SC_FOLLOW_LINE);
         break;
         case SID_CURSORUP_SEL:
-            pViewShell->ExpandBlock(0, -1, SC_FOLLOW_LINE);
+            pViewShell->ExpandBlock(0, -nRepeat, SC_FOLLOW_LINE);
         break;
         case SID_CURSORRIGHT_SEL:
-            pViewShell->ExpandBlock(nMovX, 0, SC_FOLLOW_LINE);
+            pViewShell->ExpandBlock(nMovX * nRepeat, 0, SC_FOLLOW_LINE);
         break;
         case SID_CURSORLEFT_SEL:
-            pViewShell->ExpandBlock(-nMovX, 0, SC_FOLLOW_LINE);
+            pViewShell->ExpandBlock(-nMovX * nRepeat, 0, SC_FOLLOW_LINE);
         break;
         case SID_CURSORPAGEUP_SEL:
-            pViewShell->ExpandBlockPage(0, -1);
+            pViewShell->ExpandBlockPage(0, -nRepeat);
         break;
         case SID_CURSORPAGEDOWN_SEL:
-            pViewShell->ExpandBlockPage(0, 1);
+            pViewShell->ExpandBlockPage(0, nRepeat);
         break;
         case SID_CURSORPAGERIGHT_SEL:
-            pViewShell->ExpandBlockPage(nMovX, 0);
+            pViewShell->ExpandBlockPage(nMovX * nRepeat, 0);
         break;
         case SID_CURSORPAGELEFT_SEL:
-            pViewShell->ExpandBlockPage(-nMovX, 0);
+            pViewShell->ExpandBlockPage(-nMovX * nRepeat, 0);
         break;
         case SID_CURSORBLKDOWN_SEL:
             pViewShell->ExpandBlockArea(0, 1);
@@ -266,7 +276,7 @@
             pViewShell->ExpandBlockArea(0, -1);
         break;
         case SID_CURSORBLKRIGHT_SEL:
-            pViewShell->ExpandBlockArea(nMovX, 0);
+            pViewShell->ExpandBlockArea(nMovX , 0);
         break;
         case SID_CURSORBLKLEFT_SEL:
             pViewShell->ExpandBlockArea(-nMovX, 0);
@@ -275,6 +285,7 @@
             ;
     }
     pViewShell->ShowAllCursors();
+    rReq.AppendItem( SfxInt16Item(FN_PARAM_1,static_cast<sal_Int16>(nRepeat)) );
     rReq.Done();
 }
 
_______________________________________________
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice

Reply via email to