summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
authorLionel Elie Mamane <lionel@mamane.lu>2018-10-04 19:33:14 +0200
committerLionel Elie Mamane <lionel@mamane.lu>2018-10-10 14:51:12 +0200
commitd143e211b1416665d77cd1914dd7f6a6b0b4f72a (patch)
treeb11c29a13754b5739da174dd4249bc1ae2bf616c /dbaccess
parent2f792ac91fdaaea1df38e64833dd1c258bb41c03 (diff)
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@mamane.lu>
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/source/ui/browser/sbagrid.cxx6
-rw-r--r--dbaccess/source/ui/tabledesign/TEditControl.cxx2
-rw-r--r--dbaccess/source/ui/tabledesign/TableDesignControl.cxx2
3 files changed, 5 insertions, 5 deletions
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 )