summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sc/source/ui/docshell/externalrefmgr.cxx6
-rw-r--r--unotools/inc/unotools/localfilehelper.hxx1
-rw-r--r--unotools/source/ucbhelper/localfilehelper.cxx8
3 files changed, 11 insertions, 4 deletions
diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx
index a66dd35fa3bb..62fe0dd6c288 100644
--- a/sc/source/ui/docshell/externalrefmgr.cxx
+++ b/sc/source/ui/docshell/externalrefmgr.cxx
@@ -2272,12 +2272,11 @@ bool ScExternalRefManager::isFileLoadable(const OUString& rFile) const
if (isOwnDocument(rFile))
return false;
- String aPhysical;
- if (utl::LocalFileHelper::ConvertURLToPhysicalName(rFile, aPhysical) && aPhysical.Len())
+ rtl::OUString aPhysical;
+ if (utl::LocalFileHelper::ConvertURLToPhysicalName(rFile, aPhysical) && aPhysical.getLength())
{
// #i114504# try IsFolder/Exists only for file URLs
- return utl::UCBContentHelper::Exists(rFile);
if (utl::UCBContentHelper::IsFolder(rFile))
return false;
@@ -2285,7 +2284,6 @@ bool ScExternalRefManager::isFileLoadable(const OUString& rFile) const
}
else
return true; // for http and others, Exists doesn't work, but the URL can still be opened
- return utl::UCBContentHelper::Exists(rFile);
}
void ScExternalRefManager::maybeLinkExternalFile(sal_uInt16 nFileId)
diff --git a/unotools/inc/unotools/localfilehelper.hxx b/unotools/inc/unotools/localfilehelper.hxx
index 08be26017cdc..634c7dea8d5b 100644
--- a/unotools/inc/unotools/localfilehelper.hxx
+++ b/unotools/inc/unotools/localfilehelper.hxx
@@ -55,6 +55,7 @@ public:
file system is present ( watch: this doesn't mean that this file really exists! )
*/
static sal_Bool ConvertURLToPhysicalName( const String& rName, String& rReturn );
+ static bool ConvertURLToPhysicalName( const rtl::OUString& rName, rtl::OUString& rReturn );
static sal_Bool ConvertURLToSystemPath( const String& rName, String& rReturn );
static sal_Bool IsLocalFile( const String& rName );
diff --git a/unotools/source/ucbhelper/localfilehelper.cxx b/unotools/source/ucbhelper/localfilehelper.cxx
index f1026f749f45..26b90a7913e4 100644
--- a/unotools/source/ucbhelper/localfilehelper.cxx
+++ b/unotools/source/ucbhelper/localfilehelper.cxx
@@ -131,6 +131,14 @@ sal_Bool LocalFileHelper::ConvertPhysicalNameToURL( const String& rName, String&
return ( rReturn.Len() != 0 );
}
+bool LocalFileHelper::ConvertURLToPhysicalName( const rtl::OUString& rName, rtl::OUString& rReturn )
+{
+ String aReturn;
+ bool bReturn = ConvertURLToPhysicalName( rName, aReturn );
+ rReturn = rtl::OUString( aReturn );
+ return bReturn;
+}
+
sal_Bool LocalFileHelper::ConvertURLToPhysicalName( const String& rName, String& rReturn )
{
rReturn = ::rtl::OUString();