summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-06-08 12:41:04 +0100
committerCaolán McNamara <caolanm@redhat.com>2016-06-08 12:43:29 +0100
commit1a9e0f420181316fbbaae14f1afb58a49c77cb3a (patch)
tree90257562b5fd566fd0764193a2e3320de5a0c56a
parentf7b0cbf1df98a1c42fe25cfdbd9977fba78347c8 (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 (cherry picked from commit 7f25ccc81a35d2a89880cacf7835aa4b875f2ab2)
-rw-r--r--unotools/source/config/historyoptions.cxx37
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)
{