diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2021-09-06 21:45:42 +0200 |
---|---|---|
committer | Michael Stahl <michael.stahl@allotropia.de> | 2021-09-07 12:03:32 +0200 |
commit | b658ca65c6d5583dedec64da9b891b62d2692d49 (patch) | |
tree | 41dcc55cb13239c1daa5ee3a9948ff3404404f5b | |
parent | tdf#144340: fix FB configure on Windows (diff) | |
download | core-b658ca65c6d5583dedec64da9b891b62d2692d49.tar.gz core-b658ca65c6d5583dedec64da9b891b62d2692d49.zip |
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/+/121754
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 6e65bfc1781d..0c65ad53ab60 100644 --- a/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx +++ b/dbaccess/source/ui/querydesign/SelectionBrowseBox.cxx @@ -2105,6 +2105,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 ... "); @@ -2689,7 +2691,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() ) |