svx/source/fmcomp/gridctrl.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
New commits: commit 21fc0ce61a25a7ab6f9bb83cecfd880f17033c4e Author: Lionel Elie Mamane <lio...@mamane.lu> AuthorDate: Thu Oct 4 16:16:46 2018 +0200 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Thu Oct 11 10:01:20 2018 +0200 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 <lio...@mamane.lu> (cherry picked from commit 2f792ac91fdaaea1df38e64833dd1c258bb41c03) Reviewed-on: https://gerrit.libreoffice.org/61619 Reviewed-by: Caolán McNamara <caol...@redhat.com> Tested-by: Caolán McNamara <caol...@redhat.com> diff --git a/svx/source/fmcomp/gridctrl.cxx b/svx/source/fmcomp/gridctrl.cxx index 2048e63e7a35..eb81535f5018 100644 --- a/svx/source/fmcomp/gridctrl.cxx +++ b/svx/source/fmcomp/gridctrl.cxx @@ -2774,7 +2774,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) @@ -2821,7 +2821,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) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits