[Libreoffice-commits] core.git: 2 commits - unotools/source

Stephan Bergmann sbergman at redhat.com
Thu Apr 16 08:14:35 PDT 2015


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

New commits:
commit bfedaea4921a3bba10e1cdb566901978b6dbffc2
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Apr 16 16:34:34 2015 +0200

    improve comment
    
    Change-Id: I451ab0fb0e7ee1a6d20091caa9c1142b16796dc7

diff --git a/unotools/source/config/historyoptions.cxx b/unotools/source/config/historyoptions.cxx
index e7c2806..a9acd9a 100644
--- a/unotools/source/config/historyoptions.cxx
+++ b/unotools/source/config/historyoptions.cxx
@@ -315,12 +315,11 @@ Sequence< Sequence<PropertyValue> > SvtHistoryOptions_Impl::GetList(EHistoryType
             xOrderList->getByName(OUString::number(nItem)) >>= xSet;
             xSet->getPropertyValue(s_sHistoryItemRef) >>= sUrl;
 
-            // Check if file is openable and on a local filesystem.
-            // Windows UNC pathes like \\server.domain\file.odt map to
-            // file://server.domain/file.odt. Therefore, we require a beginning
-            // slash which supprisingly also works for local files on Windows
-            // as they map to file:///C:/folder/file.odt. Remote files may
-            // cause hangs if the share is unavailable. See tdf#89394
+            // 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;
commit 3e55cf49f406076e1bdb491f8b3d484b766d5c72
Author: Jan Kantert <jan-lo at kantert.net>
Date:   Tue Apr 14 21:28:57 2015 +0200

    tdf#89394. fix hangs because of unavailable Windows UNC path.
    
    UNC: \\server.domain\file.odt is stored as file://server.domain/file.odt.
    Windows local: C:\folder\file.odt is stored as file:///C:/folder/file.odt.
    Linux: /home/user/file.odt is stored as file:///home/user/file.odt.
    
    I cannot find any case where we only have file:// (but not a third slash) on
    a local file.
    
    Change-Id: Ib15b3380cb40f1cd37123be7a38426b74fbde5cf
    
    Signed-off-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/unotools/source/config/historyoptions.cxx b/unotools/source/config/historyoptions.cxx
index 7899c86..e7c2806 100644
--- a/unotools/source/config/historyoptions.cxx
+++ b/unotools/source/config/historyoptions.cxx
@@ -315,7 +315,13 @@ Sequence< Sequence<PropertyValue> > SvtHistoryOptions_Impl::GetList(EHistoryType
             xOrderList->getByName(OUString::number(nItem)) >>= xSet;
             xSet->getPropertyValue(s_sHistoryItemRef) >>= sUrl;
 
-            if (!sUrl.startsWith("file://") || lcl_fileOpenable(sUrl))
+            // Check if file is openable and on a local filesystem.
+            // Windows UNC pathes like \\server.domain\file.odt map to
+            // file://server.domain/file.odt. Therefore, we require a beginning
+            // slash which supprisingly also works for local files on Windows
+            // as they map to file:///C:/folder/file.odt. Remote files may
+            // cause hangs if the share is unavailable. See tdf#89394
+            if (!sUrl.startsWith("file:///") || lcl_fileOpenable(sUrl))
             {
                 xItemList->getByName(sUrl) >>= xSet;
                 seqProperties[s_nOffsetURL  ].Value <<= sUrl;


More information about the Libreoffice-commits mailing list