diff options
author | Jan Kantert <jan-lo@kantert.net> | 2015-04-14 21:28:57 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-04-16 17:11:40 +0200 |
commit | 3e55cf49f406076e1bdb491f8b3d484b766d5c72 (patch) | |
tree | 9a5e06b7d20d33eee2076de11d2f808c38deebe6 /unotools | |
parent | ae677af0440037b28a69c6ca4ea90de821435b85 (diff) |
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@redhat.com>
Diffstat (limited to 'unotools')
-rw-r--r-- | unotools/source/config/historyoptions.cxx | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/unotools/source/config/historyoptions.cxx b/unotools/source/config/historyoptions.cxx index 7899c8670911..e7c28067823d 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; |