filter/source/config/cache/typedetection.cxx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
New commits: commit 278008f76835a128025b2a37ba8c9a7613284b6d Author: Mike Kaganski <mike.kagan...@collabora.com> AuthorDate: Fri Jun 14 19:03:30 2024 +0500 Commit: Mike Kaganski <mike.kagan...@collabora.com> CommitDate: Fri Jun 14 21:01:06 2024 +0200 tdf#161573: Do not show unrelated messages during broken ZIP detection Change-Id: Iab7f4bb492e24eb2ca6448f3540d219a18c15d79 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168869 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> diff --git a/filter/source/config/cache/typedetection.cxx b/filter/source/config/cache/typedetection.cxx index 9c4cb2258f8e..0f655cfa7709 100644 --- a/filter/source/config/cache/typedetection.cxx +++ b/filter/source/config/cache/typedetection.cxx @@ -926,6 +926,12 @@ OUString TypeDetection::impl_detectTypeFlatAndDeep( utl::MediaDescriptor& r { try { + // tdf#161573: do not interact with the user about possible unrelated failures (e.g., + // missing file). If needed, that will happen later, in the main detection phase. + auto aInteraction(rDescriptor.getValue(utl::MediaDescriptor::PROP_INTERACTIONHANDLER)); + rDescriptor.erase(utl::MediaDescriptor::PROP_INTERACTIONHANDLER); + comphelper::ScopeGuard interactionHelperGuard([&rDescriptor, &aInteraction] + { rDescriptor[utl::MediaDescriptor::PROP_INTERACTIONHANDLER] = aInteraction; }); impl_openStream(rDescriptor); if (auto xStream = rDescriptor.getUnpackedValueOrDefault( utl::MediaDescriptor::PROP_INPUTSTREAM, @@ -943,7 +949,7 @@ OUString TypeDetection::impl_detectTypeFlatAndDeep( utl::MediaDescriptor& r if (isBrokenZIP(xStream, xContext)) { if (css::uno::Reference<css::task::XInteractionHandler> xInteraction{ - rDescriptor.getValue(utl::MediaDescriptor::PROP_INTERACTIONHANDLER), + aInteraction, css::uno::UNO_QUERY }) { INetURLObject aURL(rDescriptor.getUnpackedValueOrDefault(