[Libreoffice-commits] core.git: svx/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Wed Oct 10 12:49:52 UTC 2018
svx/source/fmcomp/gridctrl.cxx | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
New commits:
commit 2f792ac91fdaaea1df38e64833dd1c258bb41c03
Author: Lionel Elie Mamane <lionel at mamane.lu>
AuthorDate: Thu Oct 4 16:16:46 2018 +0200
Commit: Lionel Elie Mamane <lionel at mamane.lu>
CommitDate: Wed Oct 10 14:49:26 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 <lionel at mamane.lu>
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)
More information about the Libreoffice-commits
mailing list