summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2021-09-06 21:45:42 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2021-09-07 12:07:55 +0200
commit098c6c216af2828ab388ca61abee594f69bb5793 (patch)
tree1a3d19395e46f1c9482db9cd289b439af3242ca9
parentc0ac99bd1f3b035260aa6a1a180e1e4b230ef554 (diff)
tdf#140951: fix crash on Base when accessibility used
See bt here: https://bugs.documentfoundation.org/attachment.cgi?id=174832 Change-Id: Ia0a52b1e6aafc043f6be2d8406a98e7d4ebf55dc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121735 Tested-by: Jenkins Reviewed-by: Julien Nabet <serval2412@yahoo.fr> (cherry picked from commit 970883a85ad1d714683a1d98fb45efc89cbdeb3b) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121758 Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
-rw-r--r--dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
index 22e17c01ec36..a466f74c840a 100644
--- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
+++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx
@@ -2098,6 +2098,8 @@ OUString OSelectionBrowseBox::GetCellText(sal_Int32 nRow, sal_uInt16 nColId) con
{
sal_uInt16 nPos = GetColumnPos(nColId);
+ if ( nPos == 0 || nPos == BROWSER_INVALIDID || nPos > getFields().size() )
+ return OUString();
OTableFieldDescRef pEntry = getFields()[nPos-1];
OSL_ENSURE(pEntry != nullptr, "OSelectionBrowseBox::GetCellText : invalid column id, prepare for GPF ... ");
@@ -2682,7 +2684,7 @@ void OSelectionBrowseBox::setFunctionCell(OTableFieldDescRef const & _pEntry)
Reference< XAccessible > OSelectionBrowseBox::CreateAccessibleCell( sal_Int32 _nRow, sal_uInt16 _nColumnPos )
{
OTableFieldDescRef pEntry;
- if(getFields().size() > o3tl::make_unsigned(_nColumnPos - 1))
+ if ( _nColumnPos != 0 && _nColumnPos != BROWSER_INVALIDID && _nColumnPos <= getFields().size() )
pEntry = getFields()[_nColumnPos - 1];
if ( _nRow == BROW_VIS_ROW && pEntry.is() )