summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLionel Elie Mamane <lionel@mamane.lu>2013-07-30 09:23:52 +0200
committerPetr Mladek <pmladek@suse.cz>2013-07-30 09:52:07 +0000
commit1e1d5847102cc23f33649118637e1723155e4b1a (patch)
tree3871525c0879a70b230fbc7a3466a2ae18193087
parentc486d46980cae515ee7b9d0e8c7d5b12a295b503 (diff)
fdo#55955 select first column if possible
Change-Id: I131cb0395c481d9cc1de210abc207221dab14bf4 Reviewed-on: https://gerrit.libreoffice.org/5178 Reviewed-by: Petr Mladek <pmladek@suse.cz> Tested-by: Petr Mladek <pmladek@suse.cz>
-rw-r--r--svx/source/fmcomp/gridctrl.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/svx/source/fmcomp/gridctrl.cxx b/svx/source/fmcomp/gridctrl.cxx
index 83358a73284c..f3d875c7361b 100644
--- a/svx/source/fmcomp/gridctrl.cxx
+++ b/svx/source/fmcomp/gridctrl.cxx
@@ -1604,6 +1604,12 @@ void DbGridControl::setDataSource(const Reference< XRowSet >& _xCursor, sal_uInt
if (nCurPos == BROWSER_INVALIDID || nCurPos >= ColCount())
nCurPos = 0;
+ // Column zero is a valid choice and guaranteed to exist,
+ // but invisible to the user; if we have at least one
+ // user-visible column, go to that one.
+ if (nCurPos == 0 && ColCount() > 1)
+ nCurPos = 1;
+
// there are rows so go to the selected current column
if (nRecordCount)
GoToRowColumnId(0, GetColumnId(nCurPos));