Kaydet (Commit) d143e211 authored tarafından Lionel Elie Mamane's avatar Lionel Elie Mamane

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: 's avatarLionel Elie Mamane <lionel@mamane.lu>
üst 2f792ac9
...@@ -1253,8 +1253,8 @@ sal_Int8 SbaGridControl::AcceptDrop( const BrowserAcceptDropEvent& rEvt ) ...@@ -1253,8 +1253,8 @@ sal_Int8 SbaGridControl::AcceptDrop( const BrowserAcceptDropEvent& rEvt )
// without an empty row we're not in update mode // without an empty row we're not in update mode
break; break;
long nRow = GetRowAtYPosPixel(rEvt.maPosPixel.Y(), false); const long nRow = GetRowAtYPosPixel(rEvt.maPosPixel.Y(), false);
sal_uInt16 nCol = GetColumnAtXPosPixel(rEvt.maPosPixel.X()); const sal_uInt16 nCol = GetColumnId(GetColumnAtXPosPixel(rEvt.maPosPixel.X()));
long nCorrectRowCount = GetRowCount(); long nCorrectRowCount = GetRowCount();
if (GetOptions() & DbGridControlOptions::Insert) if (GetOptions() & DbGridControlOptions::Insert)
...@@ -1262,7 +1262,7 @@ sal_Int8 SbaGridControl::AcceptDrop( const BrowserAcceptDropEvent& rEvt ) ...@@ -1262,7 +1262,7 @@ sal_Int8 SbaGridControl::AcceptDrop( const BrowserAcceptDropEvent& rEvt )
if (IsCurrentAppending()) if (IsCurrentAppending())
--nCorrectRowCount; // the current data record doesn't really exist, we are appending a new one --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 // no valid cell under the mouse cursor
break; break;
......
...@@ -1337,7 +1337,7 @@ void OTableEditorCtrl::Command(const CommandEvent& rEvt) ...@@ -1337,7 +1337,7 @@ void OTableEditorCtrl::Command(const CommandEvent& rEvt)
// Show the Context menu // Show the Context menu
if( !IsReadOnly() ) if( !IsReadOnly() )
{ {
sal_uInt16 nColId = GetColumnAtXPosPixel(aMenuPos.X()); sal_uInt16 nColId = GetColumnId(GetColumnAtXPosPixel(aMenuPos.X()));
long nRow = GetRowAtYPosPixel(aMenuPos.Y()); long nRow = GetRowAtYPosPixel(aMenuPos.Y());
if ( HANDLE_ID != nColId ) if ( HANDLE_ID != nColId )
......
...@@ -103,7 +103,7 @@ void OTableRowView::Command(const CommandEvent& rEvt) ...@@ -103,7 +103,7 @@ void OTableRowView::Command(const CommandEvent& rEvt)
return; return;
} }
sal_uInt16 nColId = GetColumnAtXPosPixel(rEvt.GetMousePosPixel().X()); sal_uInt16 nColId = GetColumnId(GetColumnAtXPosPixel(rEvt.GetMousePosPixel().X()));
long nRow = GetRowAtYPosPixel(rEvt.GetMousePosPixel().Y()); long nRow = GetRowAtYPosPixel(rEvt.GetMousePosPixel().Y());
if ( nColId == HANDLE_ID ) if ( nColId == HANDLE_ID )
......
...@@ -695,7 +695,7 @@ void OFieldExpressionControl::Command(const CommandEvent& rEvt) ...@@ -695,7 +695,7 @@ void OFieldExpressionControl::Command(const CommandEvent& rEvt)
return; return;
} }
sal_uInt16 nColId = GetColumnAtXPosPixel(rEvt.GetMousePosPixel().X()); sal_uInt16 nColId = GetColumnId(GetColumnAtXPosPixel(rEvt.GetMousePosPixel().X()));
if ( nColId == HANDLE_ID ) if ( nColId == HANDLE_ID )
{ {
......
...@@ -2754,7 +2754,7 @@ void DbGridControl::StartDrag( sal_Int8 /*nAction*/, const Point& rPosPixel ) ...@@ -2754,7 +2754,7 @@ void DbGridControl::StartDrag( sal_Int8 /*nAction*/, const Point& rPosPixel )
if (!m_pSeekCursor || IsResizing()) if (!m_pSeekCursor || IsResizing())
return; return;
sal_uInt16 nColId = GetColumnAtXPosPixel(rPosPixel.X()); sal_uInt16 nColId = GetColumnId(GetColumnAtXPosPixel(rPosPixel.X()));
long nRow = GetRowAtYPosPixel(rPosPixel.Y()); long nRow = GetRowAtYPosPixel(rPosPixel.Y());
if (nColId != HandleColumnId && nRow >= 0) if (nColId != HandleColumnId && nRow >= 0)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment