[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - unotools/source

Caolán McNamara caolanm at redhat.com
Wed Jun 8 11:44:11 UTC 2016


 unotools/source/config/historyoptions.cxx |   37 ++++++------------------------
 1 file changed, 8 insertions(+), 29 deletions(-)

New commits:
commit 1a9e0f420181316fbbaae14f1afb58a49c77cb3a
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Wed Jun 8 12:41:04 2016 +0100

    Resolves: tdf#89394 revert attempt to ditch missing file from recent files
    
    this reverts
    
    commit 93eefe54f5d6b6092371bad1e86444489d29eee2
    Author: Krisztian Pinter <pin.terminator at gmail.com>
    Date:   Fri Sep 6 14:45:13 2013 +0200
    
        Make SvtHistoryOptions not return files if they can't be opened
    
    which seemed like a good idea, but was only really to fix a cosmetic
    problem, while the outcome was a more serious issue
    
    Change-Id: Ic9c9c136e1e50f5e28fe377b64f56e501fb836ca
    (cherry picked from commit 7f25ccc81a35d2a89880cacf7835aa4b875f2ab2)

diff --git a/unotools/source/config/historyoptions.cxx b/unotools/source/config/historyoptions.cxx
index bb9d41d..70f6608 100644
--- a/unotools/source/config/historyoptions.cxx
+++ b/unotools/source/config/historyoptions.cxx
@@ -17,7 +17,6 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
-#include <osl/file.hxx>
 #include <sal/log.hxx>
 #include <unotools/historyoptions.hxx>
 #include <unotools/configmgr.hxx>
@@ -264,18 +263,6 @@ void SvtHistoryOptions_Impl::Clear( EHistoryType eHistory )
     }
 }
 
-static bool lcl_fileOpenable(const OUString &rURL)
-{
-    osl::File aRecentFile(rURL);
-    if(!aRecentFile.open(osl_File_OpenFlag_Read))
-    {
-        aRecentFile.close();
-        return true;
-    }
-    else
-        return false;
-}
-
 Sequence< Sequence<PropertyValue> > SvtHistoryOptions_Impl::GetList(EHistoryType eHistory)
 {
     uno::Reference<container::XNameAccess> xListAccess(GetListAccess(eHistory));
@@ -316,22 +303,14 @@ Sequence< Sequence<PropertyValue> > SvtHistoryOptions_Impl::GetList(EHistoryType
             xOrderList->getByName(OUString::number(nItem)) >>= xSet;
             xSet->getPropertyValue(s_sHistoryItemRef) >>= sUrl;
 
-            // Check if file is openable, but for performance reasons try to
-            // only do so for files on a local filesystem.  For Windows,
-            // checking for "file:///" nicely filters out UNC paths (that only
-            // have two slashes), but of course misses to filter out remote
-            // mounts on Unix-like systems:
-            if (!sUrl.startsWith("file:///") || lcl_fileOpenable(sUrl))
-            {
-                xItemList->getByName(sUrl) >>= xSet;
-                seqProperties[s_nOffsetURL  ].Value <<= sUrl;
-
-                xSet->getPropertyValue(s_sFilter)   >>= seqProperties[s_nOffsetFilter   ].Value;
-                xSet->getPropertyValue(s_sTitle)    >>= seqProperties[s_nOffsetTitle    ].Value;
-                xSet->getPropertyValue(s_sPassword) >>= seqProperties[s_nOffsetPassword ].Value;
-                xSet->getPropertyValue(s_sThumbnail)>>= seqProperties[s_nOffsetThumbnail].Value;
-                aRet[nCount++] = seqProperties;
-            }
+            xItemList->getByName(sUrl) >>= xSet;
+            seqProperties[s_nOffsetURL  ].Value <<= sUrl;
+
+            xSet->getPropertyValue(s_sFilter)   >>= seqProperties[s_nOffsetFilter   ].Value;
+            xSet->getPropertyValue(s_sTitle)    >>= seqProperties[s_nOffsetTitle    ].Value;
+            xSet->getPropertyValue(s_sPassword) >>= seqProperties[s_nOffsetPassword ].Value;
+            xSet->getPropertyValue(s_sThumbnail)>>= seqProperties[s_nOffsetThumbnail].Value;
+            aRet[nCount++] = seqProperties;
         }
         catch(const uno::Exception& ex)
         {


More information about the Libreoffice-commits mailing list