diff options
Diffstat (limited to 'sfx2/source/dialog/filedlghelper.cxx')
-rw-r--r-- | sfx2/source/dialog/filedlghelper.cxx | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx index 0018912180fa..37a2f29ed1e3 100644 --- a/sfx2/source/dialog/filedlghelper.cxx +++ b/sfx2/source/dialog/filedlghelper.cxx @@ -1641,8 +1641,17 @@ void FileDialogHelper_Impl::getRealFilter( String& _rFilter ) const void FileDialogHelper_Impl::verifyPath() { #ifdef UNX + static char const s_FileScheme[] = "file://"; + if (0 != rtl_ustr_ascii_shortenedCompareIgnoreAsciiCase_WithLength( + maPath.getStr(), maPath.getLength(), + s_FileScheme, RTL_CONSTASCII_LENGTH(s_FileScheme))) + { + return; + } + const OString sFullPath = OUStringToOString( + maPath.copy(RTL_CONSTASCII_LENGTH(s_FileScheme)) + maFileName, + osl_getThreadTextEncoding() ); struct stat aFileStat; - const OString sFullPath = OUStringToOString( maPath.copy(RTL_CONSTASCII_LENGTH("file://")) + maFileName, osl_getThreadTextEncoding() ); stat( sFullPath.getStr(), &aFileStat ); // lp#905355, fdo#43895 // Check that the file has read only permission and is in /tmp -- this is |