diff options
author | Caolán McNamara <caolanm@redhat.com> | 2016-06-08 12:41:04 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-06-08 12:43:03 +0100 |
commit | 7f25ccc81a35d2a89880cacf7835aa4b875f2ab2 (patch) | |
tree | a5f17afb0628ea5566e7abb5ea41a5556a8a6637 /unotools | |
parent | 6d78ce11e1215a1c284585b4811aa0eeedd7187c (diff) |
Resolves: tdf#89394 revert attempt to ditch missing file from recent files
this reverts
commit 93eefe54f5d6b6092371bad1e86444489d29eee2
Author: Krisztian Pinter <pin.terminator@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
Diffstat (limited to 'unotools')
-rw-r--r-- | unotools/source/config/historyoptions.cxx | 37 |
1 files changed, 8 insertions, 29 deletions
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 <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) { |