diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-10-19 12:29:18 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-10-19 15:27:12 +0200 |
commit | 67a3ea1852a73a25980250473b0fd43a8392f779 (patch) | |
tree | 0782c73d84f55f4abf3310fdd48f665dae82236f /vcl/unx/gtk3/fpicker | |
parent | 5e8479a38f0c342979520018f79a6f79d40e99e3 (diff) |
Related: tdf#145169 warn on overwrite from gtk "save as" for remote files
Change-Id: Idb98cd13826b6a4bdcbeee4e91dc8678f148dbdc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123815
Reviewed-by: Justin Luth <justin_luth@sil.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Jenkins
Diffstat (limited to 'vcl/unx/gtk3/fpicker')
-rw-r--r-- | vcl/unx/gtk3/fpicker/SalGtkFilePicker.cxx | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/vcl/unx/gtk3/fpicker/SalGtkFilePicker.cxx b/vcl/unx/gtk3/fpicker/SalGtkFilePicker.cxx index 2e89fe670c24..d0d852e99d5d 100644 --- a/vcl/unx/gtk3/fpicker/SalGtkFilePicker.cxx +++ b/vcl/unx/gtk3/fpicker/SalGtkFilePicker.cxx @@ -46,6 +46,7 @@ #include <vcl/svapp.hxx> #include <tools/urlobj.hxx> +#include <unotools/ucbhelper.hxx> #include <algorithm> #include <set> @@ -967,11 +968,10 @@ sal_Int16 SAL_CALL SalGtkFilePicker::execute() Sequence < OUString > aPathSeq = getFiles(); if( aPathSeq.getLength() == 1 ) { - OString sFileName = unicodetouri( aPathSeq[0] ); - gchar *gFileName = g_filename_from_uri ( sFileName.getStr(), nullptr, nullptr ); - if( g_file_test( gFileName, G_FILE_TEST_IS_REGULAR ) ) + OUString sFileName = aPathSeq[0]; + if (::utl::UCBContentHelper::Exists(sFileName)) { - INetURLObject aFileObj( OStringToOUString(sFileName, RTL_TEXTENCODING_UTF8) ); + INetURLObject aFileObj(sFileName); OString baseName( OUStringToOString( @@ -1049,7 +1049,6 @@ sal_Int16 SAL_CALL SalGtkFilePicker::execute() gtk_window_destroy(GTK_WINDOW(dlg)); #endif } - g_free (gFileName); if( btn == GTK_RESPONSE_YES ) retVal = ExecutableDialogResults::OK; |