diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-08-19 12:24:37 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-08-19 12:24:37 +0200 |
commit | 5da0dce19caaf87a6fe53750a7e9ea5d564d6a12 (patch) | |
tree | 52028a1384c5074886fdd1722f71c32f3970146f /svl | |
parent | 520053459aa6a34b6d9ad52d97704399e5138d3d (diff) |
Consolidate isFileUrl checks
Change-Id: I1b74fdfaa09c4d0d6c296253958e83e78b546a9a
Diffstat (limited to 'svl')
-rw-r--r-- | svl/source/fsstor/fsstorage.cxx | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/svl/source/fsstor/fsstorage.cxx b/svl/source/fsstor/fsstorage.cxx index 625cd951379f..14543b6ec21b 100644 --- a/svl/source/fsstor/fsstorage.cxx +++ b/svl/source/fsstor/fsstorage.cxx @@ -42,7 +42,7 @@ #include <com/sun/star/sdbc/XResultSet.hpp> #include <com/sun/star/sdbc/XRow.hpp> - +#include <comphelper/fileurl.hxx> #include <comphelper/processfactory.hxx> #include <comphelper/storagehelper.hxx> #include <cppuhelper/queryinterface.hxx> @@ -61,13 +61,6 @@ using namespace ::com::sun::star; - -// TODO: move to a standard helper -bool isLocalFile_Impl( const OUString& aURL ) -{ - return aURL.startsWithIgnoreAsciiCase("file:"); -} - struct FSStorage_Impl { OUString m_aURL; @@ -403,7 +396,7 @@ uno::Reference< io::XStream > SAL_CALL FSStorage::openStreamElement( { if ( nOpenMode & embed::ElementModes::WRITE ) { - if ( isLocalFile_Impl( aFileURL.GetMainURL( INetURLObject::NO_DECODE ) ) ) + if ( aFileURL.GetProtocol() == INetProtocol::File ) { uno::Reference<ucb::XSimpleFileAccess3> xSimpleFileAccess( ucb::SimpleFileAccess::create( m_pImpl->m_xContext ) ); @@ -1351,7 +1344,7 @@ uno::Reference< embed::XExtendedStorageStream > SAL_CALL FSStorage::openStreamEl { if ( nOpenMode & embed::ElementModes::WRITE ) { - if ( isLocalFile_Impl( aFileURL ) ) + if ( comphelper::isFileUrl( aFileURL ) ) { uno::Reference<ucb::XSimpleFileAccess3> xSimpleFileAccess( ucb::SimpleFileAccess::create( m_pImpl->m_xContext ) ); |