vcl/unx/gtk3/fpicker/SalGtkFilePicker.cxx |    9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

New commits:
commit be611817ba6a1627b9d1384537aeb471d0372a7c
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Tue Oct 19 12:29:18 2021 +0100
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Tue Oct 19 20:52:52 2021 +0200

    Related: tdf#145169 warn on overwrite from gtk "save as" for remote files
    
    Change-Id: Idb98cd13826b6a4bdcbeee4e91dc8678f148dbdc
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123781
    Tested-by: Jenkins
    Reviewed-by: Justin Luth <justin_l...@sil.org>
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/vcl/unx/gtk3/fpicker/SalGtkFilePicker.cxx 
b/vcl/unx/gtk3/fpicker/SalGtkFilePicker.cxx
index a318a115f575..b9b6b057b8e5 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;

Reply via email to