From 67a3ea1852a73a25980250473b0fd43a8392f779 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 19 Oct 2021 12:29:18 +0100 Subject: Related: tdf#145169 warn on overwrite from gtk "save as" for remote files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Idb98cd13826b6a4bdcbeee4e91dc8678f148dbdc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123815 Reviewed-by: Justin Luth Reviewed-by: Caolán McNamara Tested-by: Jenkins --- vcl/unx/gtk3/fpicker/SalGtkFilePicker.cxx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'vcl/unx/gtk3/fpicker') 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 #include +#include #include #include @@ -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; -- cgit