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 /filter/source/xsltdialog | |
parent | 520053459aa6a34b6d9ad52d97704399e5138d3d (diff) |
Consolidate isFileUrl checks
Change-Id: I1b74fdfaa09c4d0d6c296253958e83e78b546a9a
Diffstat (limited to 'filter/source/xsltdialog')
-rw-r--r-- | filter/source/xsltdialog/xmlfiltercommon.hxx | 6 | ||||
-rw-r--r-- | filter/source/xsltdialog/xmlfiltersettingsdialog.cxx | 5 | ||||
-rw-r--r-- | filter/source/xsltdialog/xmlfiltertabdialog.cxx | 7 |
3 files changed, 4 insertions, 14 deletions
diff --git a/filter/source/xsltdialog/xmlfiltercommon.hxx b/filter/source/xsltdialog/xmlfiltercommon.hxx index 59523ce4b8ec..9db846a8b6e2 100644 --- a/filter/source/xsltdialog/xmlfiltercommon.hxx +++ b/filter/source/xsltdialog/xmlfiltercommon.hxx @@ -33,12 +33,6 @@ extern OUString string_encode( const OUString & rText ); extern OUString string_decode( const OUString & rText ); - - -extern bool isFileURL( const OUString & rURL ); - - - bool copyStreams( ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream > xIS, ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream > xOS ); bool createDirectory( OUString& rURL ); diff --git a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx index 7fcbaaae7ac0..c937e3f4029a 100644 --- a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx +++ b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx @@ -1622,11 +1622,6 @@ OUString string_decode( const OUString & rText ) return Uri::decode( rText, rtl_UriDecodeWithCharset, RTL_TEXTENCODING_UTF8 ); } -bool isFileURL( const OUString & rURL ) -{ - return rURL.startsWith("file:"); -} - bool copyStreams( Reference< XInputStream > xIS, Reference< XOutputStream > xOS ) { try diff --git a/filter/source/xsltdialog/xmlfiltertabdialog.cxx b/filter/source/xsltdialog/xmlfiltertabdialog.cxx index 9309ef173b1b..1511f12ba39f 100644 --- a/filter/source/xsltdialog/xmlfiltertabdialog.cxx +++ b/filter/source/xsltdialog/xmlfiltertabdialog.cxx @@ -20,6 +20,7 @@ #include <com/sun/star/container/XNameAccess.hpp> #include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/uno/XComponentContext.hpp> +#include <comphelper/fileurl.hxx> #include <tools/resid.hxx> #include <vcl/layout.hxx> #include <osl/file.hxx> @@ -193,7 +194,7 @@ bool XMLFilterTabDialog::onOk() if( 0 == nErrorId ) { // 4. see if the export xslt is valid - if( (mpNewInfo->maExportXSLT != mpOldInfo->maExportXSLT) && isFileURL( mpNewInfo->maExportXSLT ) ) + if( (mpNewInfo->maExportXSLT != mpOldInfo->maExportXSLT) && comphelper::isFileUrl( mpNewInfo->maExportXSLT ) ) { osl::File aFile( mpNewInfo->maExportXSLT ); osl::File::RC aRC = aFile.open( osl_File_OpenFlag_Read ); @@ -209,7 +210,7 @@ bool XMLFilterTabDialog::onOk() if( 0 == nErrorId ) { // 5. see if the import xslt is valid - if( (mpNewInfo->maImportXSLT != mpOldInfo->maImportXSLT) && isFileURL( mpNewInfo->maImportXSLT ) ) + if( (mpNewInfo->maImportXSLT != mpOldInfo->maImportXSLT) && comphelper::isFileUrl( mpNewInfo->maImportXSLT ) ) { osl::File aFile( mpNewInfo->maImportXSLT ); osl::File::RC aRC = aFile.open( osl_File_OpenFlag_Read ); @@ -233,7 +234,7 @@ bool XMLFilterTabDialog::onOk() if( 0 == nErrorId ) { // 6. see if the import template is valid - if( (mpNewInfo->maImportTemplate != mpOldInfo->maImportTemplate) && isFileURL( mpNewInfo->maImportTemplate ) ) + if( (mpNewInfo->maImportTemplate != mpOldInfo->maImportTemplate) && comphelper::isFileUrl( mpNewInfo->maImportTemplate ) ) { osl::File aFile( mpNewInfo->maImportTemplate ); osl::File::RC aRC = aFile.open( osl_File_OpenFlag_Read ); |