[Libreoffice-commits] core.git: dbaccess/source reportdesign/source svx/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Oct 10 12:51:43 UTC 2018


 dbaccess/source/ui/browser/sbagrid.cxx                |    6 +++---
 dbaccess/source/ui/tabledesign/TEditControl.cxx       |    2 +-
 dbaccess/source/ui/tabledesign/TableDesignControl.cxx |    2 +-
 reportdesign/source/ui/dlg/GroupsSorting.cxx          |    2 +-
 svx/source/fmcomp/gridctrl.cxx                        |    2 +-
 5 files changed, 7 insertions(+), 7 deletions(-)

New commits:
commit d143e211b1416665d77cd1914dd7f6a6b0b4f72a
Author:     Lionel Elie Mamane <lionel at mamane.lu>
AuthorDate: Thu Oct 4 19:33:14 2018 +0200
Commit:     Lionel Elie Mamane <lionel at mamane.lu>
CommitDate: Wed Oct 10 14:51:12 2018 +0200

    clean up column pos vs column id
    
    everywhere GetColumnAtXPosPixel is used;
    see also tdf#119564 fix
    
    Change-Id: Ibab57c7305bf4dce9ea9f3df66e6214b0d1585b2
    Reviewed-on: https://gerrit.libreoffice.org/61390
    Tested-by: Jenkins
    Reviewed-by: Lionel Elie Mamane <lionel at mamane.lu>

diff --git a/dbaccess/source/ui/browser/sbagrid.cxx b/dbaccess/source/ui/browser/sbagrid.cxx
index 9f5709f34782..9f80745f3a11 100644
--- a/dbaccess/source/ui/browser/sbagrid.cxx
+++ b/dbaccess/source/ui/browser/sbagrid.cxx
@@ -1253,8 +1253,8 @@ sal_Int8 SbaGridControl::AcceptDrop( const BrowserAcceptDropEvent& rEvt )
             // without an empty row we're not in update mode
             break;
 
-        long    nRow = GetRowAtYPosPixel(rEvt.maPosPixel.Y(), false);
-        sal_uInt16  nCol = GetColumnAtXPosPixel(rEvt.maPosPixel.X());
+        const long        nRow = GetRowAtYPosPixel(rEvt.maPosPixel.Y(), false);
+        const sal_uInt16  nCol = GetColumnId(GetColumnAtXPosPixel(rEvt.maPosPixel.X()));
 
         long nCorrectRowCount = GetRowCount();
         if (GetOptions() & DbGridControlOptions::Insert)
@@ -1262,7 +1262,7 @@ sal_Int8 SbaGridControl::AcceptDrop( const BrowserAcceptDropEvent& rEvt )
         if (IsCurrentAppending())
             --nCorrectRowCount; // the current data record doesn't really exist, we are appending a new one
 
-        if ((nCol == BROWSER_INVALIDID) || (nRow >= nCorrectRowCount) || GetColumnId(nCol) == 0  || GetColumnId(nCol) == BROWSER_INVALIDID )
+        if ((nCol == BROWSER_INVALIDID) || (nRow >= nCorrectRowCount) || nCol == 0  || nCol == BROWSER_INVALIDID )
             // no valid cell under the mouse cursor
             break;
 
diff --git a/dbaccess/source/ui/tabledesign/TEditControl.cxx b/dbaccess/source/ui/tabledesign/TEditControl.cxx
index 03936e7611f6..2dc9d91345c0 100644
--- a/dbaccess/source/ui/tabledesign/TEditControl.cxx
+++ b/dbaccess/source/ui/tabledesign/TEditControl.cxx
@@ -1337,7 +1337,7 @@ void OTableEditorCtrl::Command(const CommandEvent& rEvt)
             // Show the Context menu
             if( !IsReadOnly() )
             {
-                sal_uInt16 nColId = GetColumnAtXPosPixel(aMenuPos.X());
+                sal_uInt16 nColId = GetColumnId(GetColumnAtXPosPixel(aMenuPos.X()));
                 long   nRow = GetRowAtYPosPixel(aMenuPos.Y());
 
                 if ( HANDLE_ID != nColId )
diff --git a/dbaccess/source/ui/tabledesign/TableDesignControl.cxx b/dbaccess/source/ui/tabledesign/TableDesignControl.cxx
index 2816a400716c..fd661a107066 100644
--- a/dbaccess/source/ui/tabledesign/TableDesignControl.cxx
+++ b/dbaccess/source/ui/tabledesign/TableDesignControl.cxx
@@ -103,7 +103,7 @@ void OTableRowView::Command(const CommandEvent& rEvt)
                 return;
             }
 
-            sal_uInt16 nColId = GetColumnAtXPosPixel(rEvt.GetMousePosPixel().X());
+            sal_uInt16 nColId = GetColumnId(GetColumnAtXPosPixel(rEvt.GetMousePosPixel().X()));
             long   nRow = GetRowAtYPosPixel(rEvt.GetMousePosPixel().Y());
 
             if ( nColId == HANDLE_ID )
diff --git a/reportdesign/source/ui/dlg/GroupsSorting.cxx b/reportdesign/source/ui/dlg/GroupsSorting.cxx
index 6e2e741abf8d..cbaa45f0361c 100644
--- a/reportdesign/source/ui/dlg/GroupsSorting.cxx
+++ b/reportdesign/source/ui/dlg/GroupsSorting.cxx
@@ -695,7 +695,7 @@ void OFieldExpressionControl::Command(const CommandEvent& rEvt)
                 return;
             }
 
-            sal_uInt16 nColId = GetColumnAtXPosPixel(rEvt.GetMousePosPixel().X());
+            sal_uInt16 nColId = GetColumnId(GetColumnAtXPosPixel(rEvt.GetMousePosPixel().X()));
 
             if ( nColId == HANDLE_ID )
             {
diff --git a/svx/source/fmcomp/gridctrl.cxx b/svx/source/fmcomp/gridctrl.cxx
index 9d56cc434cbe..79fa0339f7b3 100644
--- a/svx/source/fmcomp/gridctrl.cxx
+++ b/svx/source/fmcomp/gridctrl.cxx
@@ -2754,7 +2754,7 @@ void DbGridControl::StartDrag( sal_Int8 /*nAction*/, const Point& rPosPixel )
     if (!m_pSeekCursor || IsResizing())
         return;
 
-    sal_uInt16 nColId = GetColumnAtXPosPixel(rPosPixel.X());
+    sal_uInt16 nColId = GetColumnId(GetColumnAtXPosPixel(rPosPixel.X()));
     long   nRow = GetRowAtYPosPixel(rPosPixel.Y());
     if (nColId != HandleColumnId && nRow >= 0)
     {


More information about the Libreoffice-commits mailing list