From 3e55cf49f406076e1bdb491f8b3d484b766d5c72 Mon Sep 17 00:00:00 2001 From: Jan Kantert Date: Tue, 14 Apr 2015 21:28:57 +0200 Subject: 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 --- unotools/source/config/historyoptions.cxx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'unotools') 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 > 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; -- cgit