summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLionel Elie Mamane <lionel@mamane.lu>2011-09-11 23:40:09 +0200
committerPetr Mladek <pmladek@suse.cz>2011-10-24 17:24:33 +0200
commit8590273b3ee8f34386bcb9e620fab10794b38a6f (patch)
treee65cedaddad63e482e25b37807ace532b581c209
parent45e6ceee47e4f1c5fdf800ae35b062f8387cf61c (diff)
FmXGridPeer::getByIndex: Error checking of pGrid->GetModelColumnPos(nId) call
Fixes crash of fdo#40701, but not broken feature Signed-off-by: Petr Mladek <pmladek@suse.cz>
-rw-r--r--svx/source/fmcomp/fmgridif.cxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/svx/source/fmcomp/fmgridif.cxx b/svx/source/fmcomp/fmgridif.cxx
index 3080d773b4..a4146a9d0e 100644
--- a/svx/source/fmcomp/fmgridif.cxx
+++ b/svx/source/fmcomp/fmgridif.cxx
@@ -2442,6 +2442,9 @@ Any FmXGridPeer::getByIndex(sal_Int32 _nIndex) throw( IndexOutOfBoundsException,
// get the list position
sal_uInt16 nPos = pGrid->GetModelColumnPos(nId);
+ if ( nPos == GRID_COLUMN_NOT_FOUND )
+ return aElement;
+
DbGridColumn* pCol = pGrid->GetColumns().at( nPos );
Reference< ::com::sun::star::awt::XControl > xControl(pCol->GetCell());
aElement <<= xControl;