From 56a3bb29b1451233118204159b7861a23ace5d23 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 5 Jul 2024 13:55:31 +0200 Subject: package: avoid throwing RuntimeException in getZipFileContents() Translate it to ZipIOException. Change-Id: I7a07a59c0ba301b92f31696355c73ccbdf119ff8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170013 Tested-by: Jenkins Reviewed-by: Michael Stahl (cherry picked from commit c409c83d777fdb6291c7cd03186b69fe4e7fd902) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170029 Reviewed-by: Xisco Fauli --- package/source/zippackage/ZipPackage.cxx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'package') diff --git a/package/source/zippackage/ZipPackage.cxx b/package/source/zippackage/ZipPackage.cxx index 907ed1b4112e..2cb267734b9f 100644 --- a/package/source/zippackage/ZipPackage.cxx +++ b/package/source/zippackage/ZipPackage.cxx @@ -626,7 +626,11 @@ void ZipPackage::getZipFileContents() if ( !pCurrent->hasByName( sTemp ) ) { rtl::Reference pPkgFolder = new ZipPackageFolder(m_xContext, m_nFormat, m_bAllowRemoveOnInsert); - pPkgFolder->setName( sTemp ); + try { + pPkgFolder->setName( sTemp ); + } catch (uno::RuntimeException const& e) { + throw css::packages::zip::ZipIOException(e.Message); + } pPkgFolder->doSetParent( pCurrent ); pCurrent = pPkgFolder.get(); } -- cgit