[Libreoffice-commits] .: Branch 'libreoffice-3-5-4' - unotools/source

Stephan Bergmann sbergmann at kemper.freedesktop.org
Fri May 18 01:29:56 PDT 2012


 unotools/source/config/historyoptions.cxx |   18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

New commits:
commit 12e49e422e5244173d97bcf61f5354fd90d7fab3
Author: Stephan Bergmann <sbergman at 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.
    
    Conflicts:
    
    	unotools/source/config/historyoptions.cxx
    
    Signed-off-by: Michael Meeks <michael.meeks at suse.com>
    
    (cherry picked from commit fcac9e82d3233d85a6da11bd716a7dc357d5eed2)
    Signed-off-by: Michael Stahl <mstahl at redhat.com>
    Signed-off-by: Jan Holesovsky <kendy at suse.cz>
    
    Change-Id: I3e7c803813f09c1f031defc2c18cfab6732b1621

diff --git a/unotools/source/config/historyoptions.cxx b/unotools/source/config/historyoptions.cxx
index 5ba2045..94385f1 100644
--- a/unotools/source/config/historyoptions.cxx
+++ b/unotools/source/config/historyoptions.cxx
@@ -583,7 +583,23 @@ void SvtHistoryOptions_Impl::AppendItem(       EHistoryType eHistory ,
                 ::rtl::OUString sRemove;
                 xOrderList->getByName(::rtl::OUString::valueOf(nLength-1)) >>= xSet;
                 xSet->getPropertyValue(s_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 )
             {


More information about the Libreoffice-commits mailing list