| commit | 9a48470a613323bc1ebf68ed1a3cb595d55908fc | [log] |
|---|---|---|
| author | Julien Nabet <serval2412@yahoo.fr> | Tue Apr 14 14:28:55 2020 +0200 |
| committer | Xisco FaulĂ <xiscofauli@libreoffice.org> | Thu Apr 16 18:58:05 2020 +0200 |
| tree | 1ac2719987ed62770ac970da7ecc0066b8fc1e31 | |
| parent | 644c9f8360818d37428d30bc5a6a90412d3983da [diff] |
tdf#132097: fix Find Previous with direction columns crashes in specific case See bt here: https://bugs.documentfoundation.org/attachment.cgi?id=159553 nBlockPos vector is created with nLastCol + 1 elements, so if we click on a cell in a column which is after last value, the search will crash Change-Id: I9de688a8a80a45c3e5ddea6d2f461926e9777052 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92165 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> (cherry picked from commit 2670e980c7dbadbdc20ff23d57ad892951edc254) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92296 Reviewed-by: Xisco FaulĂ <xiscofauli@libreoffice.org>
diff --git a/sc/source/core/data/table6.cxx b/sc/source/core/data/table6.cxx index 4d09986..ecaf800 100644 --- a/sc/source/core/data/table6.cxx +++ b/sc/source/core/data/table6.cxx
@@ -328,8 +328,8 @@ bool ScTable::Search(const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& rRow, bool bSkipFiltered = !rSearchItem.IsSearchFiltered(); bool bSearchNotes = (rSearchItem.GetCellType() == SvxSearchCellType::NOTE); // We need to cache sc::ColumnBlockConstPosition per each column. std::vector< sc::ColumnBlockConstPosition > blockPos( nLastCol + 1 ); for( SCCOL i = 0; i <= nLastCol; ++i ) std::vector< sc::ColumnBlockConstPosition > blockPos( nLastCol + 2 ); for( SCCOL i = 0; i <= nLastCol+1; ++i ) aCol[ i ].InitBlockPosition( blockPos[ i ] ); if (!bAll && rSearchItem.GetBackward()) {