summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorLionel Elie Mamane <lionel@mamane.lu>2011-09-09 23:37:16 +0200
committerLionel Elie Mamane <lionel@mamane.lu>2011-09-09 23:39:41 +0200
commit0ef7ce4a234c6649dcca219b96185acb7634fe34 (patch)
treecac63511f8a47d0cdbcf7db91a7863881cd1a771 /svx
parentac015eb157d8d4ac548880f8321400834ff3d02d (diff)
FmXGridPeer::getByIndex: Error checking of pGrid->GetModelColumnPos(nId) call
Fixes crash of fdo#40701, but not broken feature
Diffstat (limited to 'svx')
-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 c0b929bdf7c2..6ccd37d763a5 100644
--- a/svx/source/fmcomp/fmgridif.cxx
+++ b/svx/source/fmcomp/fmgridif.cxx
@@ -2436,6 +2436,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;