From e0920fb441e5747e683af3a5748b893e4778b9f9 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Fri, 8 Dec 2017 21:53:47 +0100 Subject: tdf#114243 sot: catch exceptions in SotStorage::GetFormatID() This function returns an error code so it might as well convert exceptions to that for the benefit of clients like lcl_ReadSections(). (cherry picked from commit 07c7b5441251b55be72256ae8c64138eecf6cb5f) Change-Id: Iccf21bf64ee81b66dd9b9902b9b952fa48a318e5 Reviewed-on: https://gerrit.libreoffice.org/46124 Tested-by: Jenkins Reviewed-by: Michael Stahl --- sot/source/sdstor/storage.cxx | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/sot/source/sdstor/storage.cxx b/sot/source/sdstor/storage.cxx index 9d19bafafedb..ac723c28e251 100644 --- a/sot/source/sdstor/storage.cxx +++ b/sot/source/sdstor/storage.cxx @@ -762,7 +762,15 @@ SotClipboardFormatId SotStorage::GetFormatID( const css::uno::Reference < css::e return SotClipboardFormatId::NONE; OUString aMediaType; - xProps->getPropertyValue("MediaType") >>= aMediaType; + try + { + xProps->getPropertyValue("MediaType") >>= aMediaType; + } + catch (uno::Exception const& e) + { + SAL_INFO("sot", "SotStorage::GetFormatID: exception: " << e); + } + if ( !aMediaType.isEmpty() ) { css::datatransfer::DataFlavor aDataFlavor; -- cgit