diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2023-12-14 12:56:03 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2023-12-14 15:21:35 +0100 |
commit | df6a8667e6dd8b710bfae4944915f6eeb4efb233 (patch) | |
tree | 1834ab2cc74b3c0acf8d61f1aec9a2da19c31918 /package | |
parent | 975bbafaae39f4dc5d9120b4347498b07e7e2426 (diff) |
tdf#131575: in repair mode, match names ASCII case-insensitively
It would work for the bugdoc in tdf#131575; but not if the wrong case
is the only problem in the package, because then there would be no
repairment mode active. An alternative could be to use case insensitive
match always, but that looks wrong.
Change-Id: Ie405d37e1dc639482bd2608e4479de5b707a07d4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160761
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'package')
-rw-r--r-- | package/source/xstor/xstorage.cxx | 6 | ||||
-rw-r--r-- | package/source/xstor/xstorage.hxx | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/package/source/xstor/xstorage.cxx b/package/source/xstor/xstorage.cxx index 05150a48f988..d19d1cac7f33 100644 --- a/package/source/xstor/xstorage.cxx +++ b/package/source/xstor/xstorage.cxx @@ -403,6 +403,8 @@ void OStorage_Impl::OpenOwnPackage() aArguments.realloc( ++nArgNum ); pArguments = aArguments.getArray(); pArguments[nArgNum-1] <<= aNamedValue; + if (rProp.Name == "RepairPackage") + rProp.Value >>= m_bRepairPackage; } else if ( rProp.Name == "Password" ) { @@ -1264,6 +1266,10 @@ SotElement_Impl* OStorage_Impl::FindElement( const OUString& rName ) ReadContents(); auto mapIt = m_aChildrenMap.find(rName); + if (mapIt == m_aChildrenMap.end() && m_bRepairPackage) + mapIt = std::find_if(m_aChildrenMap.begin(), m_aChildrenMap.end(), + [&rName](const auto& pair) + { return rName.equalsIgnoreAsciiCase(pair.first); }); if (mapIt == m_aChildrenMap.end()) return nullptr; for (auto pElement : mapIt->second) diff --git a/package/source/xstor/xstorage.hxx b/package/source/xstor/xstorage.hxx index a32aeca1d25d..54fe49a9d9ca 100644 --- a/package/source/xstor/xstorage.hxx +++ b/package/source/xstor/xstorage.hxx @@ -122,6 +122,7 @@ struct OStorage_Impl bool m_bIsRoot; // marks this storage as root storages that manages all commits and reverts bool m_bListCreated; + bool m_bRepairPackage = false; /// Count of registered modification listeners oslInterlockedCount m_nModifiedListenerCount; |