[Libreoffice-commits] core.git: Branch 'feature/gsoc15-open-remote-files-dialog' - 2 commits - fpicker/source

Szymon Kłos eszkadev at gmail.com
Wed Jul 29 05:15:46 PDT 2015


 fpicker/source/office/RemoteFilesDialog.cxx |   35 ++++++++++++----------------
 1 file changed, 15 insertions(+), 20 deletions(-)

New commits:
commit c042209709c592f6ac121a57bba9d9893c56fa97
Author: Szymon Kłos <eszkadev at gmail.com>
Date:   Wed Jul 29 14:13:58 2015 +0200

    save mode improvements
    
    Change-Id: I14953eafb3fbd840df5f9c890b55855e14a1fd9a

diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx
index 4544cf8..969e8f3 100644
--- a/fpicker/source/office/RemoteFilesDialog.cxx
+++ b/fpicker/source/office/RemoteFilesDialog.cxx
@@ -761,8 +761,11 @@ IMPL_LINK_NOARG ( RemoteFilesDialog, SelectHdl )
             }
             else
             {
-                m_sPath.clear();
-                m_pName_ed->SetText( "" );
+                if( m_eMode == REMOTEDLG_MODE_OPEN )
+                {
+                    m_sPath.clear();
+                    m_pName_ed->SetText( "" );
+                }
             }
 
             EnableControls();
@@ -887,24 +890,10 @@ IMPL_LINK_NOARG ( RemoteFilesDialog, OkHdl )
 
     bool bExists = false;
 
-    Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext();
-    Reference< XInteractionHandler > xInteractionHandler(
-                    InteractionHandler::createWithParent( xContext, 0 ), UNO_QUERY_THROW );
-    Reference< XCommandEnvironment > xEnv = new ::ucbhelper::CommandEnvironment(
-                    xInteractionHandler, Reference< XProgressHandler >() );
-    ::ucbhelper::Content m_aContent( m_sPath, xEnv, xContext );
-
-    try
-    {
-        if( bFileDlg )
-            bExists = m_aContent.isDocument();
-        else
-            bExists = m_aContent.isFolder();
-    }
-    catch( const Exception& )
-    {
-        bExists = false;
-    }
+    if( bFileDlg )
+        bExists = ContentIsDocument(m_sPath);
+    else
+        bExists = ContentIsFolder(m_sPath);
 
     if ( bExists )
     {
@@ -921,6 +910,8 @@ IMPL_LINK_NOARG ( RemoteFilesDialog, OkHdl )
     {
         if( m_eMode == REMOTEDLG_MODE_OPEN )
             return 0;
+        if( m_eMode == REMOTEDLG_MODE_SAVE && ContentIsFolder(m_sPath) )
+            return 0;
     }
 
     EndDialog( RET_OK );
commit 6d5ad561e65848ad87bab4d0fb1d4a7efdf4644d
Author: Szymon Kłos <eszkadev at gmail.com>
Date:   Wed Jul 29 12:42:12 2015 +0200

    set no selection when user aborted auth
    
    Change-Id: I15c865306948d4fe321b188324ad298fee322a6a

diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx
index cf70a36..4544cf8 100644
--- a/fpicker/source/office/RemoteFilesDialog.cxx
+++ b/fpicker/source/office/RemoteFilesDialog.cxx
@@ -336,6 +336,10 @@ short RemoteFilesDialog::Execute()
         Show();
         SelectServiceHdl( NULL );
     }
+    if( !m_bIsConnected )
+    {
+        m_pServices_lb->SetNoSelection();
+    }
 
     short nRet = SvtFileDialog_Base::Execute();
 


More information about the Libreoffice-commits mailing list