Following up on the auto-healing attempt of 
<https://bugs.freedesktop.org/show_bug.cgi?id=46074#c59> "FILEOPEN: No 
Recent Documents...", 
<https://bugs.freedesktop.org/show_bug.cgi?id=49948> "FILEOPEN: No 
recent documents" revealed a further problem that can still prevent 
auto-healing of the Recent Documents list in LO 3.5.3 and that requires 
the below fix.
Please review and consider for backporting to libreoffice-3-5 and 
libreoffice-3-5-4.
Thanks,
Stephan
On 05/16/2012 09:37 AM, Stephan Bergmann wrote:
commit e3633f60b349022994e291aa3d1a0c90c3403b2e
Author: Stephan Bergmann<sbergman@redhat.com>
Date:   Wed May 16 09:32:51 2012 +0200
     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
diff --git a/unotools/source/config/historyoptions.cxx b/unotools/source/config/historyoptions.cxx
index e681395..93d5854 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&)
+                {
+                    //<https://bugs.freedesktop.org/show_bug.cgi?id=46074>
+                    // "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 )
              {
Context
- [REVIEW-3-5] [REVIEW-3-5-4] Re: [Libreoffice-commits] · Stephan Bergmann
 
   
 
  Privacy Policy |
  
Impressum (Legal Info) |
  
Copyright information: Unless otherwise specified, all text and images
  on this website are licensed under the
  
Creative Commons Attribution-Share Alike 3.0 License.
  This does not include the source code of LibreOffice, which is
  licensed under the Mozilla Public License (
MPLv2).
  "LibreOffice" and "The Document Foundation" are
  registered trademarks of their corresponding registered owners or are
  in actual use as trademarks in one or more countries. Their respective
  logos and icons are also subject to international copyright laws. Use
  thereof is explained in our 
trademark policy.