summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorLionel Elie Mamane <lionel@mamane.lu>2018-10-04 16:16:46 +0200
committerLionel Elie Mamane <lionel@mamane.lu>2018-10-10 14:49:26 +0200
commit2f792ac91fdaaea1df38e64833dd1c258bb41c03 (patch)
treef4891542bf1cdcaf6324575b51a8f672d7946e95 /svx
parent3a81c0d402d70b00351d1b236939976d589856b8 (diff)
tdf#119564 column id is not always the same as position
GetColumnAtXPosPixel returns the column position (index in mvCols vector), _not_ the column id! These differ in particular when some columns are hidden. Change-Id: Ifc068bd3cc090969278f10e48d9d7d3f8a682e13 Reviewed-on: https://gerrit.libreoffice.org/60975 Tested-by: Jenkins Reviewed-by: Lionel Elie Mamane <lionel@mamane.lu>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/fmcomp/gridctrl.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/svx/source/fmcomp/gridctrl.cxx b/svx/source/fmcomp/gridctrl.cxx
index eedf197d0c8f..9d56cc434cbe 100644
--- a/svx/source/fmcomp/gridctrl.cxx
+++ b/svx/source/fmcomp/gridctrl.cxx
@@ -2773,7 +2773,7 @@ bool DbGridControl::canCopyCellText(sal_Int32 _nRow, sal_uInt16 _nColId)
return (_nRow >= 0)
&& (_nRow < GetRowCount())
&& (_nColId != HandleColumnId)
- && (_nColId <= ColCount());
+ && (GetModelColumnPos(_nColId) != GRID_COLUMN_NOT_FOUND);
}
void DbGridControl::copyCellText(sal_Int32 _nRow, sal_uInt16 _nColId)
@@ -2820,7 +2820,7 @@ void DbGridControl::Command(const CommandEvent& rEvt)
}
}
- sal_uInt16 nColId = GetColumnAtXPosPixel(rEvt.GetMousePosPixel().X());
+ sal_uInt16 nColId = GetColumnId(GetColumnAtXPosPixel(rEvt.GetMousePosPixel().X()));
long nRow = GetRowAtYPosPixel(rEvt.GetMousePosPixel().Y());
if (nColId == HandleColumnId)