diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2021-09-06 21:45:42 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2021-09-30 11:01:33 +0200 |
commit | 4b94eb5c9b5591bf409b1b290479e7135f3b6563 (patch) | |
tree | 94f2d6dc17d2785354944d4c34d752a7bf4b1927 | |
parent | 839dd79505f5e02248835a89d053337f7a04b529 (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.cxx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx index 4d12925c2205..7ec0eb25d78a 100644 --- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx +++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx @@ -2099,6 +2099,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 ... "); @@ -2683,7 +2685,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() ) |