fpicker/source/office/RemoteFilesDialog.cxx |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 15d0eec26be416e77d9b9580cf34d9a1d32a2615
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Mon Oct 18 13:01:05 2021 +0100
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Mon Oct 18 16:08:29 2021 +0200

    Related: tdf#145169 unwanted dialogs on sftp save to remote to a new 
document
    
    which is similar to:
    
    commit f12e483589888f87843026ceff5ae3c1e615ca02
    Date:   Mon Feb 1 16:04:49 2016 +0100
    
        Fix tdf#97500 Reinstate missing file error dialog on WebDAV
    
    this all looks a bit dubious, but make a safely backportable change
    first
    
    Change-Id: Ia6dbaacf7024d05083c336135a80b5acf607dfc5
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123749
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/fpicker/source/office/RemoteFilesDialog.cxx 
b/fpicker/source/office/RemoteFilesDialog.cxx
index ee031caf099d..2d1c4c961119 100644
--- a/fpicker/source/office/RemoteFilesDialog.cxx
+++ b/fpicker/source/office/RemoteFilesDialog.cxx
@@ -1146,6 +1146,9 @@ bool RemoteFilesDialog::ContentIsFolder( const OUString& 
rURL )
     {
         Reference< XInteractionHandler > xInteractionHandler(
                         InteractionHandler::createWithParent( m_xContext, 
nullptr ), UNO_QUERY_THROW );
+        INetURLObject aURLObject(rURL);
+        if (aURLObject.isAnyKnownWebDAVScheme() || aURLObject.GetProtocol() == 
INetProtocol::Sftp)
+            xInteractionHandler.set(new 
comphelper::StillReadWriteInteraction(xInteractionHandler, 
xInteractionHandler));
         Reference< XCommandEnvironment > xEnv = new 
::ucbhelper::CommandEnvironment( xInteractionHandler, Reference< 
XProgressHandler >() );
         ::ucbhelper::Content aContent( rURL, xEnv, m_xContext );
 
@@ -1166,7 +1169,8 @@ bool RemoteFilesDialog::ContentIsDocument( const 
OUString& rURL )
         Reference< XInteractionHandler > xInteractionHandler(
                         InteractionHandler::createWithParent( m_xContext, 
nullptr ), UNO_QUERY_THROW );
         //check if WebDAV or not
-        if ( !INetURLObject( rURL ).isAnyKnownWebDAVScheme() )
+        INetURLObject aURLObject(rURL);
+        if (!aURLObject.isAnyKnownWebDAVScheme() && aURLObject.GetProtocol() 
!= INetProtocol::Sftp)
         {
                 // no webdav, use the interaction handler as is
                 Reference< XCommandEnvironment > xEnv = new 
::ucbhelper::CommandEnvironment( xInteractionHandler, Reference< 
XProgressHandler >() );

Reply via email to