sc: search the name list forwards again in XclImpNameManager::FindName

revert:

commit ea093514e4
Date:   Sun Jan 29 20:59:44 2023 +0000

    crashtesting: crash in ReadQsiforum-mso-en4-30276.xls

as the workaround should no longer be needed.

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I8a3ac88d49464bb1fdd71f826183a82477adcd22
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/9289
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
(cherry picked from commit 61037a6fced9d1b4b741002df99b986e48353aed)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/209467
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
This commit is contained in:
Caolán McNamara
2026-08-22 01:11:06 +02:00
committed by Xisco Fauli
parent 3b30dd7104
commit 63ebf5c928
+1 -6
View File
@@ -285,13 +285,8 @@ const XclImpName* XclImpNameManager::FindName( std::u16string_view rXclName, SCT
{
const XclImpName* pGlobalName = nullptr; // a found global name
const XclImpName* pLocalName = nullptr; // a found local name
// A file can define the same name more than once, as
// 'forum-mso-en4-30276.xls' does. All of the duplicates share the one Calc
// entry that holds the last definition. Search from the end, so the name
// the file defines last is the one returned.
for (auto itName = maNameList.rbegin(); itName != maNameList.rend(); ++itName)
for( const auto& rxName : maNameList )
{
const auto& rxName = *itName;
if( rxName->GetXclName() == rXclName )
{
if( rxName->GetScTab() == nScTab )