[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-5.0' - 2 commits - sc/sdi sc/source

Jan Holesovsky kendy at collabora.com
Thu Mar 17 19:12:10 UTC 2016


 sc/sdi/scalc.sdi               |    4 ++--
 sc/source/ui/inc/tabview.hxx   |   17 +++++++++++++++++
 sc/source/ui/view/cellsh4.cxx  |   31 +++++++++++++++++++++++++++++--
 sc/source/ui/view/gridwin4.cxx |   11 +++++++++++
 sc/source/ui/view/tabview3.cxx |   39 +++++++++++++++++++++++++++++++++++++++
 5 files changed, 98 insertions(+), 4 deletions(-)

New commits:
commit 6ed0bbf32160386ac1287e77279105b11f25ff50
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Thu Mar 17 19:53:40 2016 +0100

    sc: Improve documentation, and a cosmetic change.
    
    Change-Id: Id99b963602816710a2c6767795343a9518833b43

diff --git a/sc/source/ui/inc/tabview.hxx b/sc/source/ui/inc/tabview.hxx
index 3d9c09c..e5cce13 100644
--- a/sc/source/ui/inc/tabview.hxx
+++ b/sc/source/ui/inc/tabview.hxx
@@ -476,19 +476,21 @@ public:
     void            MarkRows();
 
     /**
-     * @brief Called to select a full column
+     * Called to select the specified full column.
      *
      * @param nCol: Column number to do operation on
-     * @param nModifier:
+     * @param nModifier: 0, KEY_SHIFT, KEY_MOD1, KEY_SHIFT | KEY_MOD1
      */
+
     void            MarkColumns(SCCOL nCol, sal_Int16 nModifier);
     /**
-     * @brief Called to select a full row
+     * Called to select the specified full row.
      *
      * @param nRow: Row number to do operation on
-     * @param nModifier:
+     * @param nModifier: 0, KEY_SHIFT, KEY_MOD1, KEY_SHIFT | KEY_MOD1
      */
     void            MarkRows(SCROW nRow, sal_Int16 nModifier);
+
     void            MarkDataArea( bool bIncludeCursor = true );
     void            MarkMatrixFormula();
     void            Unmark();
diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index ab23799..b7ec282 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -1392,12 +1392,10 @@ void ScTabView::MarkColumns(SCCOL nCol, sal_Int16 nModifier)
     SCTAB nTab = aViewData.GetTabNo();
     bool bTestNeg = true;
 
-    switch( nModifier )
+    if ((nModifier & KEY_SHIFT) == KEY_SHIFT)
     {
-        case KEY_SHIFT:
-        case KEY_MOD1 + KEY_SHIFT:
-            nStartCol = aViewData.GetCurX();
-            bTestNeg = false;
+        nStartCol = aViewData.GetCurX();
+        bTestNeg = false;
     }
 
     DoneBlockMode( nModifier != 0 );
@@ -1413,12 +1411,10 @@ void ScTabView::MarkRows(SCROW nRow, sal_Int16 nModifier)
     SCTAB nTab = aViewData.GetTabNo();
     bool bTestNeg = true;
 
-    switch ( nModifier )
+    if ((nModifier & KEY_SHIFT) == KEY_SHIFT)
     {
-        case KEY_SHIFT:
-        case KEY_MOD1 + KEY_SHIFT:
-            nStartRow = aViewData.GetCurY();
-            bTestNeg = false;
+        nStartRow = aViewData.GetCurY();
+        bTestNeg = false;
     }
 
     DoneBlockMode( nModifier != 0 );
commit ede2f9fb6dc7131970581eaac1a8d7d34947aeab
Author: Pranav Kant <pranavk at collabora.com>
Date:   Tue Mar 15 15:35:27 2016 +0530

    sc lok: Extend uno commands: .uno:SelectRow/Column
    
    Now also accepts a row/column index with modifier key to do various
    selection/block selection/negative selection operations
    
    Change-Id: Idfb56b94ca2eb4553eb9388b786f5d1e89448ec2
    Reviewed-on: https://gerrit.libreoffice.org/23256
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/sc/sdi/scalc.sdi b/sc/sdi/scalc.sdi
index fa51a39..129076d 100644
--- a/sc/sdi/scalc.sdi
+++ b/sc/sdi/scalc.sdi
@@ -6192,7 +6192,7 @@ SfxVoidItem SelectOLE SID_OLE_SELECT
 
 
 SfxVoidItem SelectColumn SID_SELECT_COL
-()
+(SfxInt32Item Col FN_PARAM_1,SfxInt16Item Modifier FN_PARAM_2)
 [
     /* flags: */
     AutoUpdate = FALSE,
@@ -6441,7 +6441,7 @@ SfxObjectItem Selection SID_SC_SELECTION
 
 
 SfxVoidItem SelectRow SID_SELECT_ROW
-()
+(SfxInt32Item Row FN_PARAM_1,SfxInt16Item Modifier FN_PARAM_2)
 [
     /* flags: */
     AutoUpdate = FALSE,
diff --git a/sc/source/ui/inc/tabview.hxx b/sc/source/ui/inc/tabview.hxx
index 2150d2e..3d9c09c 100644
--- a/sc/source/ui/inc/tabview.hxx
+++ b/sc/source/ui/inc/tabview.hxx
@@ -474,6 +474,21 @@ public:
 
     void            MarkColumns();
     void            MarkRows();
+
+    /**
+     * @brief Called to select a full column
+     *
+     * @param nCol: Column number to do operation on
+     * @param nModifier:
+     */
+    void            MarkColumns(SCCOL nCol, sal_Int16 nModifier);
+    /**
+     * @brief Called to select a full row
+     *
+     * @param nRow: Row number to do operation on
+     * @param nModifier:
+     */
+    void            MarkRows(SCROW nRow, sal_Int16 nModifier);
     void            MarkDataArea( bool bIncludeCursor = true );
     void            MarkMatrixFormula();
     void            Unmark();
diff --git a/sc/source/ui/view/cellsh4.cxx b/sc/source/ui/view/cellsh4.cxx
index 0cd2a9f..c78f58f 100644
--- a/sc/source/ui/view/cellsh4.cxx
+++ b/sc/source/ui/view/cellsh4.cxx
@@ -275,6 +275,7 @@ void ScCellShell::ExecuteMove( SfxRequest& rReq )
 {
     ScTabViewShell* pTabViewShell   = GetViewData()->GetViewShell();
     sal_uInt16 nSlotId  = rReq.GetSlot();
+    const SfxItemSet* pReqArgs = rReq.GetArgs();
 
     if(nSlotId != SID_CURSORTOPOFSCREEN && nSlotId != SID_CURSORENDOFSCREEN)
         pTabViewShell->ExecuteInputDirect();
@@ -316,11 +317,37 @@ void ScCellShell::ExecuteMove( SfxRequest& rReq )
             break;
 
         case SID_SELECT_COL:
-            pTabViewShell->MarkColumns();
+            {
+                const SfxPoolItem* pColItem;
+                const SfxPoolItem* pModifierItem;
+                if ( pReqArgs && pReqArgs->HasItem( FN_PARAM_1, &pColItem ) &&
+                     pReqArgs->HasItem( FN_PARAM_2, &pModifierItem ) )
+                {
+                    SCCOL nCol = static_cast<SCCOL>(static_cast<const SfxInt16Item*>(pColItem)->GetValue());;
+                    sal_Int16 nModifier = static_cast<sal_Int16>(static_cast<const SfxInt16Item*>(pModifierItem)->GetValue());
+
+                    pTabViewShell->MarkColumns( nCol, nModifier );
+                }
+                else
+                    pTabViewShell->MarkColumns();
+            }
             break;
 
         case SID_SELECT_ROW:
-            pTabViewShell->MarkRows();
+            {
+                const SfxPoolItem* pRowItem;
+                const SfxPoolItem* pModifierItem;
+                if ( pReqArgs && pReqArgs->HasItem( FN_PARAM_1, &pRowItem ) &&
+                     pReqArgs->HasItem( FN_PARAM_2, &pModifierItem ) )
+                {
+                    SCROW nRow = static_cast<SCROW>(static_cast<const SfxInt32Item*>(pRowItem)->GetValue());;
+                    sal_Int16 nModifier = static_cast<sal_Int16>(static_cast<const SfxInt16Item*>(pModifierItem)->GetValue());
+
+                    pTabViewShell->MarkRows( nRow, nModifier );
+                }
+                else
+                    pTabViewShell->MarkRows();
+            }
             break;
 
         case SID_SELECT_NONE:
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index ceaf3d8..2a8abc3 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -1612,6 +1612,17 @@ void ScGridWindow::GetSelectionRects( ::std::vector< Rectangle >& rPixelRects )
         if (nY2 > nYBottom)
             nY2 = nYBottom;
     }
+    else
+    {
+        SCCOL nMaxTiledCol;
+        SCROW nMaxTiledRow;
+        pDoc->GetTiledRenderingArea( nTab, nMaxTiledCol, nMaxTiledRow );
+
+        if (nX2 > nMaxTiledCol)
+            nX2 = nMaxTiledCol;
+        if (nY2 > nMaxTiledRow)
+            nY2 = nMaxTiledRow;
+    }
 
     double nPPTX = pViewData->GetPPTX();
     double nPPTY = pViewData->GetPPTY();
diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index dd47fa2..ab23799 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -1385,6 +1385,49 @@ void ScTabView::MarkRows()
     SelectionChanged();
 }
 
+
+void ScTabView::MarkColumns(SCCOL nCol, sal_Int16 nModifier)
+{
+    SCCOL nStartCol = nCol;
+    SCTAB nTab = aViewData.GetTabNo();
+    bool bTestNeg = true;
+
+    switch( nModifier )
+    {
+        case KEY_SHIFT:
+        case KEY_MOD1 + KEY_SHIFT:
+            nStartCol = aViewData.GetCurX();
+            bTestNeg = false;
+    }
+
+    DoneBlockMode( nModifier != 0 );
+    InitBlockMode( nStartCol, 0, nTab, bTestNeg, true, false );
+    MarkCursor( nCol, MAXROW, nTab );
+    SetCursor( nCol, 0 );
+    SelectionChanged();
+}
+
+void ScTabView::MarkRows(SCROW nRow, sal_Int16 nModifier)
+{
+    SCROW nStartRow = nRow;
+    SCTAB nTab = aViewData.GetTabNo();
+    bool bTestNeg = true;
+
+    switch ( nModifier )
+    {
+        case KEY_SHIFT:
+        case KEY_MOD1 + KEY_SHIFT:
+            nStartRow = aViewData.GetCurY();
+            bTestNeg = false;
+    }
+
+    DoneBlockMode( nModifier != 0 );
+    InitBlockMode( 0, nStartRow, nTab, bTestNeg, false, true );
+    MarkCursor( MAXCOL, nRow, nTab );
+    SetCursor( 0, nRow );
+    SelectionChanged();
+}
+
 void ScTabView::MarkDataArea( bool bIncludeCursor )
 {
     ScDocument* pDoc = aViewData.GetDocument();


More information about the Libreoffice-commits mailing list