summaryrefslogtreecommitdiff
path: root/svx/source
diff options
context:
space:
mode:
authorLionel Elie Mamane <lionel@mamane.lu>2018-10-04 16:16:46 +0200
committerCaolán McNamara <caolanm@redhat.com>2018-10-11 10:01:20 +0200
commit21fc0ce61a25a7ab6f9bb83cecfd880f17033c4e (patch)
treee68609bc3e4e075bbc58eb249d825e4f7ec19783 /svx/source
parent88f10aed35c19cc43a88bbcd12b026cb32c0003f (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> (cherry picked from commit 2f792ac91fdaaea1df38e64833dd1c258bb41c03) Reviewed-on: https://gerrit.libreoffice.org/61619 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx/source')
-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 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)