From e3633f60b349022994e291aa3d1a0c90c3403b2e Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Wed, 16 May 2012 09:32:51 +0200 Subject: fdo#46074 fdo#49948 Ignore corrupted items in Recent Documents ...following up on 4ccb4bda483eb548eb6efb5e2f1952f094522320 "fdo#46074 Ignore corrupted items in Recent Documents" with another problematic scenario found with fdo#49948. Change-Id: I3e7c803813f09c1f031defc2c18cfab6732b1621 --- unotools/source/config/historyoptions.cxx | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'unotools/source/config/historyoptions.cxx') diff --git a/unotools/source/config/historyoptions.cxx b/unotools/source/config/historyoptions.cxx index e681395c0a8d..93d5854f0676 100644 --- a/unotools/source/config/historyoptions.cxx +++ b/unotools/source/config/historyoptions.cxx @@ -533,7 +533,23 @@ void SvtHistoryOptions_Impl::AppendItem( EHistoryType eHistory , ::rtl::OUString sRemove; xOrderList->getByName(::rtl::OUString::valueOf(nLength-1)) >>= xSet; xSet->getPropertyValue(sHistoryItemRef) >>= sRemove; - xItemList->removeByName(sRemove); + try + { + xItemList->removeByName(sRemove); + } + catch (css::container::NoSuchElementException &) + { + // + // "FILEOPEN: No Recent Documents..." discusses a problem + // with corrupted /org.openoffice.Office/Histories/Histories + // configuration items; to work around that problem, simply + // ignore such corrupted individual items here, so that at + // least newly added items are successfully added: + if (!sRemove.isEmpty()) + { + throw; + } + } } if ( nLength != nMaxSize ) { -- cgit v1.2.3