From 7f25ccc81a35d2a89880cacf7835aa4b875f2ab2 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 8 Jun 2016 12:41:04 +0100 Subject: Resolves: tdf#89394 revert attempt to ditch missing file from recent files this reverts commit 93eefe54f5d6b6092371bad1e86444489d29eee2 Author: Krisztian Pinter 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 --- unotools/source/config/historyoptions.cxx | 37 +++++++------------------------ 1 file changed, 8 insertions(+), 29 deletions(-) (limited to 'unotools') diff --git a/unotools/source/config/historyoptions.cxx b/unotools/source/config/historyoptions.cxx index bb9d41d11b2a..70f66081d411 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 #include #include #include @@ -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 > SvtHistoryOptions_Impl::GetList(EHistoryType eHistory) { uno::Reference xListAccess(GetListAccess(eHistory)); @@ -316,22 +303,14 @@ Sequence< Sequence > 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) { -- cgit