[Libreoffice-commits] core.git: Branch 'feature/gsoc15-open-remote-files-dialog' - 63 commits - dbaccess/source desktop/source drawinglayer/source editeng/source filter/source fpicker/source fpicker/uiconfig framework/source icon-themes/breeze icon-themes/galaxy icon-themes/hicontrast icon-themes/human icon-themes/tango include/filter include/o3tl include/svtools include/svx include/tools include/vcl instsetoo_native/inc_common o3tl/CppunitTest_o3tl_tests.mk o3tl/qa officecfg/registry reportdesign/source rsc/inc rsc/source scp2/source sc/qa sc/source sc/uiconfig sd/source sd/uiconfig setup_native/source sfx2/source svtools/inc svtools/source svx/source sw/source sw/uiconfig toolkit/source vcl/inc vcl/opengl vcl/source vcl/unx vcl/workben writerfilter/source

Szymon Kłos eszkadev at gmail.com
Fri Jul 24 03:32:59 PDT 2015


Rebased ref, commits from common ancestor:
commit 2c6ad5343de947f1646536c539b116346adb8fdc
Author: Szymon Kłos <eszkadev at gmail.com>
Date:   Fri Jul 24 10:46:02 2015 +0200

    the dialog width independent from a filters length
    
    Change-Id: If945bafe2f230bf1ede9a12782b6a487b7b08099

diff --git a/fpicker/uiconfig/ui/remotefilesdialog.ui b/fpicker/uiconfig/ui/remotefilesdialog.ui
index 631d289..c9a6ac0 100644
--- a/fpicker/uiconfig/ui/remotefilesdialog.ui
+++ b/fpicker/uiconfig/ui/remotefilesdialog.ui
@@ -214,6 +214,7 @@
             </child>
             <child>
               <object class="GtkComboBox" id="filter_lb">
+                <property name="width_request">200</property>
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
                 <property name="hexpand">True</property>
commit 9ef305a1ff535bfa5513dca56aeeb2f6322e2d32
Author: Szymon Kłos <eszkadev at gmail.com>
Date:   Fri Jul 24 10:44:36 2015 +0200

    fixed some refresh problems (after resize)
    
    Change-Id: If140a8c9680ac30f5d26f0a034b8a7c7dea4bf64

diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx
index a263c3f..8607af6 100644
--- a/fpicker/source/office/RemoteFilesDialog.cxx
+++ b/fpicker/source/office/RemoteFilesDialog.cxx
@@ -321,6 +321,7 @@ void RemoteFilesDialog::Resize()
         Size aSize = m_pContainer->GetSizePixel();
         m_pFileView->SetSizePixel( aSize );
     }
+    Invalidate(InvalidateFlags::Update);
 }
 
 short RemoteFilesDialog::Execute()
@@ -559,6 +560,8 @@ void RemoteFilesDialog::EnableControls()
 
     m_pPath->EnableFields( true );
     m_pAddService_btn->Enable( true );
+
+    Invalidate(InvalidateFlags::Update);
 }
 
 void RemoteFilesDialog::DisableControls()
commit b11f521c56cba07a7b8a0568ca76d48461e08a5f
Author: Szymon Kłos <eszkadev at gmail.com>
Date:   Fri Jul 24 09:47:18 2015 +0200

    handle the delete button from PlaceEditDialog
    
    Change-Id: Idb3257d1c106821a6e86182bca79c1aff8bfaea3

diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx
index a810ff8..a263c3f 100644
--- a/fpicker/source/office/RemoteFilesDialog.cxx
+++ b/fpicker/source/office/RemoteFilesDialog.cxx
@@ -658,6 +658,9 @@ IMPL_LINK_TYPED ( RemoteFilesDialog, EditServiceMenuHdl, MenuButton *, pButton,
                     m_bIsUpdated = true;
                     break;
                 }
+                case RET_NO:
+                    sIdent = "delete_service";
+                    break;
                 case RET_CANCEL :
                 default :
                     // Do Nothing
@@ -665,7 +668,7 @@ IMPL_LINK_TYPED ( RemoteFilesDialog, EditServiceMenuHdl, MenuButton *, pButton,
             };
         }
     }
-    else if( sIdent == "delete_service"  && m_pServices_lb->GetEntryCount() > 0 )
+    if( sIdent == "delete_service"  && m_pServices_lb->GetEntryCount() > 0 )
     {
         unsigned int nSelected = m_pServices_lb->GetSelectEntryPos();
         int nPos = GetSelectedServicePos();
commit 2c6ffb2c758f70e7259f8285703c22d32f47f7ab
Author: Szymon Kłos <eszkadev at gmail.com>
Date:   Fri Jul 24 09:39:09 2015 +0200

    don't show edit/delete menu when there is no service
    
    Change-Id: Ia53c9e3f6a4bcaab5e68fbbff6d2ec8cfe5cd702

diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx
index ab11f2f..a810ff8 100644
--- a/fpicker/source/office/RemoteFilesDialog.cxx
+++ b/fpicker/source/office/RemoteFilesDialog.cxx
@@ -176,6 +176,7 @@ RemoteFilesDialog::RemoteFilesDialog( vcl::Window* pParent, WinBits nBits )
     , m_pSplitter( NULL )
     , m_pFileView( NULL )
     , m_pContainer( NULL )
+    , m_pAddMenu( NULL )
 {
     get( m_pCancel_btn, "cancel" );
     get( m_pAddService_btn, "add_service_btn" );
@@ -252,6 +253,7 @@ RemoteFilesDialog::RemoteFilesDialog( vcl::Window* pParent, WinBits nBits )
     m_pName_ed->SetModifyHdl( LINK( this, RemoteFilesDialog, FileNameModifyHdl ) );
 
     m_pAddService_btn->SetMenuMode( MENUBUTTON_MENUMODE_TIMED );
+    m_pAddMenu = m_pAddService_btn->GetPopupMenu();
     m_pAddService_btn->SetClickHdl( LINK( this, RemoteFilesDialog, AddServiceHdl ) );
     m_pAddService_btn->SetSelectHdl( LINK( this, RemoteFilesDialog, EditServiceMenuHdl ) );
 
@@ -413,7 +415,10 @@ void RemoteFilesDialog::FillServicesListbox()
     if( m_pServices_lb->GetEntryCount() > 0 )
     {
         m_pServices_lb->SelectEntryPos( nPos );
+        m_pAddService_btn->SetPopupMenu( m_pAddMenu );
     }
+    else
+        m_pAddService_btn->SetPopupMenu( NULL );
 
     EnableControls();
 }
@@ -588,6 +593,7 @@ IMPL_LINK_NOARG ( RemoteFilesDialog, AddServiceHdl )
 
             m_pServices_lb->InsertEntry( sPrefix + newService->GetName() );
             m_pServices_lb->SelectEntryPos( m_pServices_lb->GetEntryCount() - 1 );
+            m_pAddService_btn->SetPopupMenu( m_pAddMenu );
             SelectServiceHdl( NULL );
 
             m_bIsUpdated = true;
@@ -682,6 +688,7 @@ IMPL_LINK_TYPED ( RemoteFilesDialog, EditServiceMenuHdl, MenuButton *, pButton,
                 else
                 {
                     m_pServices_lb->SetNoSelection();
+                    m_pAddService_btn->SetPopupMenu( NULL );
                 }
 
                 m_bIsUpdated = true;
diff --git a/fpicker/source/office/RemoteFilesDialog.hxx b/fpicker/source/office/RemoteFilesDialog.hxx
index a62b4cf..63fbd94 100644
--- a/fpicker/source/office/RemoteFilesDialog.hxx
+++ b/fpicker/source/office/RemoteFilesDialog.hxx
@@ -144,6 +144,7 @@ private:
     VclPtr< FileViewContainer > m_pContainer;
     VclPtr< ListBox > m_pFilter_lb;
     VclPtr< Edit > m_pName_ed;
+    PopupMenu* m_pAddMenu;
 
     std::vector< ServicePtr > m_aServices;
     std::vector< std::pair< OUString, OUString > > m_aFilters;
commit 5ea686c41b16c0a44c787d9361ee680e16f7ac2f
Author: Szymon Kłos <eszkadev at gmail.com>
Date:   Fri Jul 24 09:18:17 2015 +0200

    working busy pointer
    
    Change-Id: I8c5e9e155a1854a670961fa67aa2aa6944604177

diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx
index 7106366..ab11f2f 100644
--- a/fpicker/source/office/RemoteFilesDialog.cxx
+++ b/fpicker/source/office/RemoteFilesDialog.cxx
@@ -470,6 +470,7 @@ FileViewResult RemoteFilesDialog::OpenURL( OUString const & sURL )
 
         EnableChildPointerOverwrite( true );
         SetPointer( PointerStyle::Wait );
+        Invalidate(InvalidateFlags::Update);
 
         if( !sURL.isEmpty() )
         {
commit 3eee31157a320181c9d5c70681e62a085212c22e
Author: Szymon Kłos <eszkadev at gmail.com>
Date:   Thu Jul 23 16:22:33 2015 +0200

    RemoteFilesDialog integration with AsyncPickerAction
    
    Change-Id: If6ded1c2f2b056ce864589649b08ed19a73dc5dd

diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx
index 4e69c9d..7106366 100644
--- a/fpicker/source/office/RemoteFilesDialog.cxx
+++ b/fpicker/source/office/RemoteFilesDialog.cxx
@@ -171,6 +171,7 @@ class FileViewContainer : public vcl::Window
 RemoteFilesDialog::RemoteFilesDialog( vcl::Window* pParent, WinBits nBits )
     : SvtFileDialog_Base( pParent, "RemoteFilesDialog", "fps/ui/remotefilesdialog.ui" )
     , m_context( comphelper::getProcessComponentContext() )
+    , m_pCurrentAsyncAction( NULL )
     , m_pFileNotifier( NULL )
     , m_pSplitter( NULL )
     , m_pFileView( NULL )
@@ -187,6 +188,7 @@ RemoteFilesDialog::RemoteFilesDialog( vcl::Window* pParent, WinBits nBits )
     m_bMultiselection = ( nBits & SFXWB_MULTISELECTION ) != 0;
     m_bIsUpdated = false;
     m_bIsConnected = false;
+    m_bServiceChanged = false;
     m_nCurrentFilter = LISTBOX_ENTRY_NOTFOUND;
 
     m_pFilter_lb->Enable( false );
@@ -201,6 +203,7 @@ RemoteFilesDialog::RemoteFilesDialog( vcl::Window* pParent, WinBits nBits )
     m_pOk_btn->Enable( false );
 
     m_pOk_btn->SetClickHdl( LINK( this, RemoteFilesDialog, OkHdl ) );
+    m_pCancel_btn->SetClickHdl( LINK( this, RemoteFilesDialog, CancelHdl ) );
 
     m_pPath = VclPtr<Breadcrumb>::Create( get< vcl::Window >( "breadcrumb_container" ) );
     m_pPath->set_hexpand( true );
@@ -462,7 +465,13 @@ FileViewResult RemoteFilesDialog::OpenURL( OUString const & sURL )
 
     if( m_pFileView )
     {
-        if( !sURL.isEmpty() && ContentIsFolder( sURL ) )
+        m_pTreeView->EndSelection();
+        DisableControls();
+
+        EnableChildPointerOverwrite( true );
+        SetPointer( PointerStyle::Wait );
+
+        if( !sURL.isEmpty() )
         {
             OUString sFilter = FILEDIALOG_FILTER_ALL;
 
@@ -473,33 +482,27 @@ FileViewResult RemoteFilesDialog::OpenURL( OUString const & sURL )
 
             m_pFileView->EndInplaceEditing( false );
 
-            EnableChildPointerOverwrite( true );
-            SetPointer( PointerStyle::Wait );
-
-            eResult = m_pFileView->Initialize( sURL, sFilter, NULL, GetBlackList() );
+            DBG_ASSERT( !m_pCurrentAsyncAction.is(), "SvtFileDialog::executeAsync: previous async action not yet finished!" );
 
-            if( eResult == eSuccess )
-            {
-                m_pPath->SetURL( sURL );
-
-                m_pTreeView->SetSelectHdl( Link<>() );
-                m_pTreeView->SetTreePath( sURL );
-                m_pTreeView->SetSelectHdl( LINK( this, RemoteFilesDialog, TreeSelectHdl ) );
+            m_pCurrentAsyncAction = new AsyncPickerAction( this, m_pFileView, AsyncPickerAction::Action::eOpenURL );
 
-                m_bIsConnected = true;
-                EnableControls();
-            }
-
-            SetPointer( PointerStyle::Arrow );
-            EnableChildPointerOverwrite( false );
+            // -1 timeout - sync
+            m_pCurrentAsyncAction->execute( sURL, sFilter, -1, -1, GetBlackList() );
         }
         else
         {
+            SetPointer( PointerStyle::Arrow );
+            EnableChildPointerOverwrite( false );
+
             // content doesn't exist
-            m_pTreeView->EndSelection();
             ErrorHandler::HandleError( ERRCODE_IO_NOTEXISTS );
+
+            EnableControls();
             return eFailure;
         }
+
+        SetPointer( PointerStyle::Arrow );
+        EnableChildPointerOverwrite( false );
     }
 
     return eResult;
@@ -547,6 +550,22 @@ void RemoteFilesDialog::EnableControls()
         m_pContainer->Enable( false );
         m_pOk_btn->Enable( false );
     }
+
+    m_pPath->EnableFields( true );
+    m_pAddService_btn->Enable( true );
+}
+
+void RemoteFilesDialog::DisableControls()
+{
+    m_pServices_lb->Enable( false );
+    m_pFilter_lb->Enable( false );
+    m_pAddService_btn->Enable( false );
+    m_pName_ed->Enable( false );
+    m_pContainer->Enable( false );
+    m_pOk_btn->Enable( false );
+    m_pPath->EnableFields( false );
+
+    m_pCancel_btn->Enable( true );
 }
 
 IMPL_LINK_NOARG ( RemoteFilesDialog, AddServiceHdl )
@@ -591,23 +610,9 @@ IMPL_LINK_NOARG ( RemoteFilesDialog, SelectServiceHdl )
     if( nPos >= 0 )
     {
         OUString sURL = m_aServices[nPos]->GetUrl();
-        OUString sName = m_aServices[nPos]->GetName();
-
-        if( OpenURL( sURL ) == eSuccess )
-        {
-            m_pPath->SetRootName( sName );
-            m_pTreeView->Clear();
-
-            SvTreeListEntry* pRoot = m_pTreeView->InsertEntry( sName, NULL, true );
-            OUString* sData = new OUString( sURL );
-            pRoot->SetUserData( static_cast< void* >( sData ) );
 
-            m_pTreeView->Expand( pRoot );
-
-            m_pName_ed->GrabFocus();
-
-            m_sLastServiceUrl = sURL;
-        }
+        m_bServiceChanged = true;
+        OpenURL( sURL );
     }
 
     return 1;
@@ -690,15 +695,23 @@ IMPL_LINK_NOARG ( RemoteFilesDialog, DoubleClickHdl )
 {
     if( m_pFileView->GetSelectionCount() )
     {
-        OUString sURL = m_pFileView->GetCurrentURL();
+        SvTreeListEntry* pEntry = m_pFileView->FirstSelected();
 
-        if( ContentIsDocument( sURL ) )
-        {
-            EndDialog( RET_OK );
-        }
-        else
+        if( pEntry )
         {
-            OpenURL( sURL );
+            SvtContentEntry* pData = static_cast< SvtContentEntry* >( pEntry->GetUserData() );
+
+            if( pData )
+            {
+                if( !pData->mbIsFolder )
+                {
+                    EndDialog( RET_OK );
+                }
+                else
+                {
+                    OpenURL( pData->maURL );
+                }
+            }
         }
     }
 
@@ -789,7 +802,7 @@ IMPL_LINK_NOARG ( RemoteFilesDialog, SelectFilterHdl )
 
         OUString sCurrentURL = m_pFileView->GetViewURL();
 
-        if( !sCurrentURL.isEmpty() )
+        if( !sCurrentURL.isEmpty() && m_bIsConnected )
             OpenURL( sCurrentURL );
     }
 
@@ -896,6 +909,20 @@ IMPL_LINK_NOARG ( RemoteFilesDialog, OkHdl )
     return 1;
 }
 
+IMPL_LINK_NOARG ( RemoteFilesDialog, CancelHdl )
+{
+    if( m_pCurrentAsyncAction.is() )
+    {
+        m_pCurrentAsyncAction->cancel();
+        onAsyncOperationFinished();
+    }
+    else
+    {
+        EndDialog( RET_CANCEL );
+    }
+    return 1;
+}
+
 // SvtFileDialog_Base
 
 SvtFileView* RemoteFilesDialog::GetView()
@@ -941,6 +968,24 @@ void RemoteFilesDialog::SetPath( const OUString& rNewURL )
     }
 }
 
+OUString RemoteFilesDialog::getCurrentFileText() const
+{
+    OUString sReturn;
+    if( m_pName_ed )
+        sReturn = m_pName_ed->GetText();
+    return sReturn;
+}
+
+void RemoteFilesDialog::setCurrentFileText( const OUString& rText, bool bSelectAll )
+{
+    if( m_pName_ed )
+    {
+        m_pName_ed->SetText( rText );
+        if( bSelectAll )
+            m_pName_ed->SetSelection( Selection( 0, rText.getLength() ) );
+    }
+}
+
 void RemoteFilesDialog::AddFilterGroup(
                                   const OUString& rFilter,
                                   const com::sun::star::uno::Sequence< com::sun::star::beans::StringPair >& rFilters )
@@ -987,11 +1032,60 @@ void RemoteFilesDialog::SetCurFilter( const OUString& rFilter )
     }
 }
 
+void RemoteFilesDialog::FilterSelect()
+{
+}
+
 void RemoteFilesDialog::SetFileCallback( ::svt::IFilePickerListener *pNotifier )
 {
     m_pFileNotifier = pNotifier;
 }
 
+void RemoteFilesDialog::onAsyncOperationStarted()
+{
+    DisableControls();
+}
+
+void RemoteFilesDialog::onAsyncOperationFinished()
+{
+    m_pCurrentAsyncAction = NULL;
+    EnableControls();
+}
+
+void RemoteFilesDialog::UpdateControls( const OUString& rURL )
+{
+    int nPos = GetSelectedServicePos();
+
+    if( nPos >= 0 && m_bServiceChanged && rURL == m_aServices[nPos]->GetUrl() )
+    {
+        OUString sURL = m_aServices[nPos]->GetUrl();
+        OUString sName = m_aServices[nPos]->GetName();
+
+        m_pPath->SetRootName( sName );
+        m_pTreeView->Clear();
+
+        SvTreeListEntry* pRoot = m_pTreeView->InsertEntry( sName, NULL, true );
+        OUString* sData = new OUString( rURL );
+        pRoot->SetUserData( static_cast< void* >( sData ) );
+
+        m_pTreeView->Expand( pRoot );
+
+        m_pName_ed->GrabFocus();
+
+        m_sLastServiceUrl = sURL;
+
+        m_bServiceChanged = false;
+    }
+
+    m_pPath->SetURL( rURL );
+    m_pTreeView->SetSelectHdl( Link<>() );
+    m_pTreeView->SetTreePath( rURL );
+    m_pTreeView->SetSelectHdl( LINK( this, RemoteFilesDialog, TreeSelectHdl ) );
+
+    m_bIsConnected = true;
+    EnableControls();
+}
+
 void RemoteFilesDialog::EnableAutocompletion( bool )
 {
     // This dialog contains Breadcrumb, not Edit
diff --git a/fpicker/source/office/RemoteFilesDialog.hxx b/fpicker/source/office/RemoteFilesDialog.hxx
index b0f151e..a62b4cf 100644
--- a/fpicker/source/office/RemoteFilesDialog.hxx
+++ b/fpicker/source/office/RemoteFilesDialog.hxx
@@ -84,13 +84,20 @@ public:
     virtual bool ContentIsFolder( const OUString& rURL ) SAL_OVERRIDE;
     virtual bool ContentIsDocument( const OUString& rURL );
 
+    virtual OUString getCurrentFileText() const SAL_OVERRIDE;
+    virtual void setCurrentFileText( const OUString& rText, bool bSelectAll = false ) SAL_OVERRIDE;
+
     virtual void AddFilter( const OUString& rFilter, const OUString& rType ) SAL_OVERRIDE;
     virtual void AddFilterGroup( const OUString& _rFilter,
                                 const com::sun::star::uno::Sequence< com::sun::star::beans::StringPair >& rFilters ) SAL_OVERRIDE;
     virtual OUString GetCurFilter() const SAL_OVERRIDE;
     virtual void SetCurFilter( const OUString& rFilter ) SAL_OVERRIDE;
+    virtual void FilterSelect() SAL_OVERRIDE;
 
     virtual void SetFileCallback( ::svt::IFilePickerListener *pNotifier ) SAL_OVERRIDE;
+    virtual void onAsyncOperationStarted() SAL_OVERRIDE;
+    virtual void onAsyncOperationFinished() SAL_OVERRIDE;
+    virtual void UpdateControls( const OUString& rURL ) SAL_OVERRIDE;
 
     virtual void EnableAutocompletion( bool ) SAL_OVERRIDE;
 
@@ -114,12 +121,15 @@ private:
     bool m_bMultiselection;
     bool m_bIsUpdated;
     bool m_bIsConnected;
+    bool m_bServiceChanged;
 
     OUString m_sPath;
     OUString m_sStdDir;
     OUString m_sLastServiceUrl;
     unsigned int m_nCurrentFilter;
 
+    ::rtl::Reference< ::svt::AsyncPickerAction > m_pCurrentAsyncAction;
+
     ::com::sun::star::uno::Sequence< OUString > m_aBlackList;
     ::svt::IFilePickerListener* m_pFileNotifier;
 
@@ -148,6 +158,7 @@ private:
     void AddFileExtension();
 
     void EnableControls();
+    void DisableControls();
 
     DECL_LINK ( AddServiceHdl, void * );
     DECL_LINK ( SelectServiceHdl, void * );
@@ -168,6 +179,7 @@ private:
     DECL_LINK( SelectBreadcrumbHdl, Breadcrumb * );
 
     DECL_LINK( OkHdl, void * );
+    DECL_LINK( CancelHdl, void * );
 };
 
 #endif // INCLUDED_SVTOOLS_REMOTEFILESDIALOG_HXX
diff --git a/fpicker/source/office/asyncfilepicker.cxx b/fpicker/source/office/asyncfilepicker.cxx
index cf6b17b..8e4c9e3 100644
--- a/fpicker/source/office/asyncfilepicker.cxx
+++ b/fpicker/source/office/asyncfilepicker.cxx
@@ -28,7 +28,7 @@
 
 namespace svt
 {
-    AsyncPickerAction::AsyncPickerAction( SvtFileDialog* _pDialog, SvtFileView* _pView, const Action _eAction )
+    AsyncPickerAction::AsyncPickerAction( SvtFileDialog_Base* _pDialog, SvtFileView* _pView, const Action _eAction )
         :m_eAction  ( _eAction )
         ,m_pView    ( _pView   )
         ,m_pDialog  ( _pDialog )
diff --git a/fpicker/source/office/asyncfilepicker.hxx b/fpicker/source/office/asyncfilepicker.hxx
index 2174eb5..bd40153 100644
--- a/fpicker/source/office/asyncfilepicker.hxx
+++ b/fpicker/source/office/asyncfilepicker.hxx
@@ -28,7 +28,7 @@
 #include <vcl/vclptr.hxx>
 
 class SvtFileView;
-class SvtFileDialog;
+class SvtFileDialog_Base;
 
 typedef ::com::sun::star::uno::Sequence< OUString >  OUStringList;
 
@@ -54,13 +54,13 @@ namespace svt
     private:
         Action                      m_eAction;
         VclPtr<SvtFileView>         m_pView;
-        VclPtr<SvtFileDialog>       m_pDialog;
+        VclPtr<SvtFileDialog_Base>  m_pDialog;
         OUString                    m_sURL;
         OUString                    m_sFileName;
         bool                        m_bRunning;
 
     public:
-        AsyncPickerAction( SvtFileDialog* _pDialog, SvtFileView* _pView, const Action _eAction );
+        AsyncPickerAction( SvtFileDialog_Base* _pDialog, SvtFileView* _pView, const Action _eAction );
 
         /** executes the action
 
diff --git a/fpicker/source/office/fpdialogbase.hxx b/fpicker/source/office/fpdialogbase.hxx
index 7812737..19a26a4 100644
--- a/fpicker/source/office/fpdialogbase.hxx
+++ b/fpicker/source/office/fpdialogbase.hxx
@@ -82,13 +82,20 @@ public:
     virtual std::vector<OUString> GetPathList() const = 0;
     virtual bool ContentIsFolder( const OUString& rURL ) = 0;
 
+    virtual OUString getCurrentFileText() const = 0;
+    virtual void setCurrentFileText( const OUString& rText, bool bSelectAll = false ) = 0;
+
     virtual void AddFilter( const OUString& rFilter, const OUString& rType ) = 0;
     virtual void AddFilterGroup( const OUString& _rFilter,
                                 const com::sun::star::uno::Sequence< com::sun::star::beans::StringPair >& rFilters ) = 0;
     virtual OUString GetCurFilter() const = 0;
     virtual void SetCurFilter( const OUString& rFilter ) = 0;
+    virtual void FilterSelect() = 0;
 
     virtual void SetFileCallback( ::svt::IFilePickerListener *pNotifier ) = 0;
+    virtual void onAsyncOperationStarted() = 0;
+    virtual void onAsyncOperationFinished() = 0;
+    virtual void UpdateControls( const OUString& rURL ) = 0;
 
     virtual void EnableAutocompletion( bool _bEnable = true ) = 0;
 
diff --git a/fpicker/source/office/iodlg.hxx b/fpicker/source/office/iodlg.hxx
index 5748210..3856139 100644
--- a/fpicker/source/office/iodlg.hxx
+++ b/fpicker/source/office/iodlg.hxx
@@ -178,7 +178,7 @@ public:
     virtual void                StartExecuteModal( const Link<>& rEndDialogHdl ) SAL_OVERRIDE;
 
             void                FileSelect();
-            void                FilterSelect();
+            void                FilterSelect() SAL_OVERRIDE;
 
     void                        SetBlackList( const ::com::sun::star::uno::Sequence< OUString >& rBlackList ) SAL_OVERRIDE;
     const ::com::sun::star::uno::Sequence< OUString >& GetBlackList() const SAL_OVERRIDE;
@@ -207,7 +207,7 @@ public:
     SvtFileView*                GetView() SAL_OVERRIDE;
 
     void                        InitSize();
-    void                        UpdateControls( const OUString& rURL );
+    void                        UpdateControls( const OUString& rURL ) SAL_OVERRIDE;
     void                        EnableAutocompletion( bool _bEnable = true ) SAL_OVERRIDE;
 
     void                        SetFileCallback( ::svt::IFilePickerListener *pNotifier ) SAL_OVERRIDE { _pFileNotifier = pNotifier; }
@@ -219,11 +219,11 @@ public:
     bool                        getShowState() SAL_OVERRIDE;
     bool                        isAutoExtensionEnabled();
 
-    OUString                    getCurrentFileText( ) const;
-    void                        setCurrentFileText( const OUString& _rText, bool _bSelectAll = false );
+    OUString                    getCurrentFileText( ) const SAL_OVERRIDE;
+    void                        setCurrentFileText( const OUString& _rText, bool _bSelectAll = false ) SAL_OVERRIDE;
 
-    void                        onAsyncOperationStarted();
-    void                        onAsyncOperationFinished();
+    void                        onAsyncOperationStarted() SAL_OVERRIDE;
+    void                        onAsyncOperationFinished() SAL_OVERRIDE;
 
     void                        RemovablePlaceSelected(bool enable = true);
 
diff --git a/include/svtools/breadcrumb.hxx b/include/svtools/breadcrumb.hxx
index 6e6ac5f..ddd377d 100644
--- a/include/svtools/breadcrumb.hxx
+++ b/include/svtools/breadcrumb.hxx
@@ -35,6 +35,7 @@ class SVT_DLLPUBLIC Breadcrumb : public VclHBox
 
         OUString m_sRootName;
         OUString m_sClickedURL;
+        OUString m_aCurrentURL;
 
         SvtBreadcrumbMode m_eMode;
 
@@ -50,6 +51,7 @@ class SVT_DLLPUBLIC Breadcrumb : public VclHBox
         virtual ~Breadcrumb();
 
         void dispose() SAL_OVERRIDE;
+        void EnableFields( bool bEnable );
 
         void SetClickHdl( const Link<>& rLink );
         OUString GetHdlURL();
diff --git a/svtools/source/control/breadcrumb.cxx b/svtools/source/control/breadcrumb.cxx
index f1725e9..5ae725d 100644
--- a/svtools/source/control/breadcrumb.cxx
+++ b/svtools/source/control/breadcrumb.cxx
@@ -32,6 +32,17 @@ void Breadcrumb::dispose()
     VclHBox::dispose();
 }
 
+void Breadcrumb::EnableFields( bool bEnable )
+{
+    VclHBox::Enable( bEnable, true );
+    if( bEnable )
+    {
+        INetURLObject aURL( m_aCurrentURL );
+        int nSegments = aURL.getSegmentCount();
+        m_aLinks[nSegments]->Enable( false );
+    }
+}
+
 void Breadcrumb::SetClickHdl( const Link<>& rLink )
 {
     m_aClickHdl = rLink;
@@ -59,6 +70,7 @@ void Breadcrumb::SetRootName( const OUString& rURL )
 
 void Breadcrumb::SetURL( const OUString& rURL )
 {
+    m_aCurrentURL = rURL;
     INetURLObject aURL( rURL );
     aURL.setFinalSlash();
 
commit db33c7853e12e9593a530ce2327e9662bcab1480
Author: Szymon Kłos <eszkadev at gmail.com>
Date:   Thu Jul 23 10:54:44 2015 +0200

    fixed crash
    
    While opening folders in SvtFileView using doubleclick,
    sometimes GtkSalFrame::gestureLongPress method is
    executed with a null frame pointer and LO crashes.
    I noticed this only with remote dirs, probably this
    bug occurs only when the doubleclick handler routine
    takes a lot of time.
    
    Change-Id: I432046994b3e1662bd7e499681bd20e9696b2d52

diff --git a/vcl/unx/gtk/window/gtksalframe.cxx b/vcl/unx/gtk/window/gtksalframe.cxx
index 5944b6b..6280d37 100644
--- a/vcl/unx/gtk/window/gtksalframe.cxx
+++ b/vcl/unx/gtk/window/gtksalframe.cxx
@@ -3540,15 +3540,18 @@ void GtkSalFrame::gestureLongPress(GtkGestureLongPress* gesture, gpointer frame)
 {
     GtkSalFrame* pThis = static_cast<GtkSalFrame*>(frame);
 
-    SalLongPressEvent aEvent;
+    if(pThis)
+    {
+        SalLongPressEvent aEvent;
 
-    gdouble x, y;
-    GdkEventSequence *sequence = gtk_gesture_single_get_current_sequence(GTK_GESTURE_SINGLE(gesture));
-    gtk_gesture_get_point(GTK_GESTURE(gesture), sequence, &x, &y);
-    aEvent.mnX = x;
-    aEvent.mnY = y;
+        gdouble x, y;
+        GdkEventSequence *sequence = gtk_gesture_single_get_current_sequence(GTK_GESTURE_SINGLE(gesture));
+        gtk_gesture_get_point(GTK_GESTURE(gesture), sequence, &x, &y);
+        aEvent.mnX = x;
+        aEvent.mnY = y;
 
-    pThis->CallCallback(SALEVENT_LONGPRESS, &aEvent);
+        pThis->CallCallback(SALEVENT_LONGPRESS, &aEvent);
+    }
 }
 
 #endif
commit 8f7978245471763e5a2394cc8e67fed33483fe68
Author: Szymon Kłos <eszkadev at gmail.com>
Date:   Wed Jul 22 17:20:26 2015 +0200

    show error when directory doesn't exist
    
    Change-Id: I1c8ca1a509c9187687079d86f0e637b26490a7a3

diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx
index bd35802..4e69c9d 100644
--- a/fpicker/source/office/RemoteFilesDialog.cxx
+++ b/fpicker/source/office/RemoteFilesDialog.cxx
@@ -462,7 +462,7 @@ FileViewResult RemoteFilesDialog::OpenURL( OUString const & sURL )
 
     if( m_pFileView )
     {
-        if( ContentIsFolder( sURL ) )
+        if( !sURL.isEmpty() && ContentIsFolder( sURL ) )
         {
             OUString sFilter = FILEDIALOG_FILTER_ALL;
 
@@ -496,6 +496,9 @@ FileViewResult RemoteFilesDialog::OpenURL( OUString const & sURL )
         else
         {
             // content doesn't exist
+            m_pTreeView->EndSelection();
+            ErrorHandler::HandleError( ERRCODE_IO_NOTEXISTS );
+            return eFailure;
         }
     }
 
@@ -689,13 +692,13 @@ IMPL_LINK_NOARG ( RemoteFilesDialog, DoubleClickHdl )
     {
         OUString sURL = m_pFileView->GetCurrentURL();
 
-        if( ContentIsFolder( sURL ) )
+        if( ContentIsDocument( sURL ) )
         {
-            OpenURL( sURL );
+            EndDialog( RET_OK );
         }
         else
         {
-            EndDialog( RET_OK );
+            OpenURL( sURL );
         }
     }
 
@@ -1043,6 +1046,26 @@ bool RemoteFilesDialog::ContentIsFolder( const OUString& rURL )
     return false;
 }
 
+bool RemoteFilesDialog::ContentIsDocument( const OUString& rURL )
+{
+    try
+    {
+        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 aContent( rURL, xEnv, xContext );
+
+        return aContent.isDocument();
+    }
+    catch( const Exception& )
+    {
+        // a content doesn't exist
+    }
+
+    return false;
+}
+
 sal_Int32 RemoteFilesDialog::getTargetColorDepth()
 {
     // This dialog doesn't contain preview
diff --git a/fpicker/source/office/RemoteFilesDialog.hxx b/fpicker/source/office/RemoteFilesDialog.hxx
index ede30c7..b0f151e 100644
--- a/fpicker/source/office/RemoteFilesDialog.hxx
+++ b/fpicker/source/office/RemoteFilesDialog.hxx
@@ -16,6 +16,7 @@
 #include <svtools/breadcrumb.hxx>
 #include <svtools/fileview.hxx>
 
+#include <tools/errinf.hxx>
 #include <tools/resid.hxx>
 
 #include <vcl/button.hxx>
@@ -81,6 +82,7 @@ public:
     virtual const OUString& GetPath() SAL_OVERRIDE;
     virtual std::vector<OUString> GetPathList() const SAL_OVERRIDE;
     virtual bool ContentIsFolder( const OUString& rURL ) SAL_OVERRIDE;
+    virtual bool ContentIsDocument( const OUString& rURL );
 
     virtual void AddFilter( const OUString& rFilter, const OUString& rType ) SAL_OVERRIDE;
     virtual void AddFilterGroup( const OUString& _rFilter,
commit 638e527bfaae76fc4b32fa17c0bd576378a8a479
Author: Szymon Kłos <eszkadev at gmail.com>
Date:   Wed Jul 22 16:42:47 2015 +0200

    reload content while expanding node
    
    Change-Id: I7ce281ea4e2d5c5c9fc0b2b3f315defc14364df3

diff --git a/svtools/source/contnr/foldertree.cxx b/svtools/source/contnr/foldertree.cxx
index 63cc7e0..d597168 100644
--- a/svtools/source/contnr/foldertree.cxx
+++ b/svtools/source/contnr/foldertree.cxx
@@ -32,9 +32,14 @@ void FolderTree::RequestingChildren( SvTreeListEntry* pEntry )
 
 void FolderTree::FillTreeEntry( SvTreeListEntry* pEntry )
 {
-    // fill only empty entries
-    if( pEntry && GetChildCount( pEntry ) == 0 )
+    if( pEntry )
     {
+        while( GetChildCount( pEntry ) > 0 )
+        {
+            SvTreeListEntry* pChild = FirstChild( pEntry );
+            GetModel()->Remove( pChild );
+        }
+
         ::std::vector< SortingData_Impl* > aContent;
 
         ::rtl::Reference< ::svt::FileViewContentEnumerator >
commit 62f77f52e9cb5e4825a269fa377af696235d0d17
Author: Szymon Kłos <eszkadev at gmail.com>
Date:   Wed Jul 22 15:19:37 2015 +0200

    check if path exist before init of the fileview
    
    Change-Id: I0c9384644cf5aabf83512c341d3ffff5d4847f36

diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx
index 75615d1..bd35802 100644
--- a/fpicker/source/office/RemoteFilesDialog.cxx
+++ b/fpicker/source/office/RemoteFilesDialog.cxx
@@ -462,34 +462,41 @@ FileViewResult RemoteFilesDialog::OpenURL( OUString const & sURL )
 
     if( m_pFileView )
     {
-        OUString sFilter = FILEDIALOG_FILTER_ALL;
-
-        if( m_nCurrentFilter != LISTBOX_ENTRY_NOTFOUND )
+        if( ContentIsFolder( sURL ) )
         {
-            sFilter = m_aFilters[m_nCurrentFilter].second;
-        }
+            OUString sFilter = FILEDIALOG_FILTER_ALL;
 
-        m_pFileView->EndInplaceEditing( false );
+            if( m_nCurrentFilter != LISTBOX_ENTRY_NOTFOUND )
+            {
+                sFilter = m_aFilters[m_nCurrentFilter].second;
+            }
 
-        EnableChildPointerOverwrite( true );
-        SetPointer( PointerStyle::Wait );
+            m_pFileView->EndInplaceEditing( false );
 
-        eResult = m_pFileView->Initialize( sURL, sFilter, NULL, GetBlackList() );
+            EnableChildPointerOverwrite( true );
+            SetPointer( PointerStyle::Wait );
 
-        if( eResult == eSuccess )
-        {
-            m_pPath->SetURL( sURL );
+            eResult = m_pFileView->Initialize( sURL, sFilter, NULL, GetBlackList() );
 
-            m_pTreeView->SetSelectHdl( Link<>() );
-            m_pTreeView->SetTreePath( sURL );
-            m_pTreeView->SetSelectHdl( LINK( this, RemoteFilesDialog, TreeSelectHdl ) );
+            if( eResult == eSuccess )
+            {
+                m_pPath->SetURL( sURL );
 
-            m_bIsConnected = true;
-            EnableControls();
-        }
+                m_pTreeView->SetSelectHdl( Link<>() );
+                m_pTreeView->SetTreePath( sURL );
+                m_pTreeView->SetSelectHdl( LINK( this, RemoteFilesDialog, TreeSelectHdl ) );
+
+                m_bIsConnected = true;
+                EnableControls();
+            }
 
-        SetPointer( PointerStyle::Arrow );
-        EnableChildPointerOverwrite( false );
+            SetPointer( PointerStyle::Arrow );
+            EnableChildPointerOverwrite( false );
+        }
+        else
+        {
+            // content doesn't exist
+        }
     }
 
     return eResult;
commit d2daae30e56a9fdfd945002c4f75889819065873
Author: Szymon Kłos <eszkadev at gmail.com>
Date:   Wed Jul 22 14:06:52 2015 +0200

    Breadcrumb: clear all fields after changing root
    
    Change-Id: I8cefc8f755234cb4b63ca3a414402469df0394e1

diff --git a/svtools/source/control/breadcrumb.cxx b/svtools/source/control/breadcrumb.cxx
index 564c968..f1725e9 100644
--- a/svtools/source/control/breadcrumb.cxx
+++ b/svtools/source/control/breadcrumb.cxx
@@ -45,6 +45,16 @@ OUString Breadcrumb::GetHdlURL()
 void Breadcrumb::SetRootName( const OUString& rURL )
 {
     m_sRootName = rURL;
+
+    // we changed root - clear all fields
+    for( std::vector<VclPtr<FixedHyperlink>>::size_type i = 1; i < m_aLinks.size(); i++ )
+    {
+        m_aLinks[i]->SetText( "" );
+
+        m_aLinks[i]->Hide();
+        m_aSeparators[i]->Hide();
+        m_aLinks[i]->Enable( true );
+    }
 }
 
 void Breadcrumb::SetURL( const OUString& rURL )
commit 4577f449db7e92a98cbfb5b5addf7ebff66e7dad
Author: Szymon Kłos <eszkadev at gmail.com>
Date:   Tue Jul 21 17:21:57 2015 +0200

    Open/Save Remote File in Impress/Draw toolbars and menu
    
    Change-Id: I9503f5beaa8b5a6afc213747a691265acd5903f7

diff --git a/sd/source/ui/app/sddll.cxx b/sd/source/ui/app/sddll.cxx
index fe9e58a5..1564f37 100644
--- a/sd/source/ui/app/sddll.cxx
+++ b/sd/source/ui/app/sddll.cxx
@@ -243,6 +243,8 @@ void SdDLL::RegisterControllers()
     SvxFrameLineStyleToolBoxControl::RegisterControl(SID_FRAME_LINESTYLE, pMod );
     SvxColorToolBoxControl::RegisterControl(SID_FRAME_LINECOLOR, pMod );
     SvxFrameToolBoxControl::RegisterControl(SID_ATTR_BORDER, pMod );
+
+    SfxSaveAsToolBoxControl::RegisterControl(SID_SAVEASDOC, pMod );
 }
 
 void SdDLL::Init()
diff --git a/sd/uiconfig/sdraw/menubar/menubar.xml b/sd/uiconfig/sdraw/menubar/menubar.xml
index bc8cfee..c1a9be9 100644
--- a/sd/uiconfig/sdraw/menubar/menubar.xml
+++ b/sd/uiconfig/sdraw/menubar/menubar.xml
@@ -21,6 +21,7 @@
     <menu:menupopup>
       <menu:menuitem menu:id=".uno:AddDirect"/>
       <menu:menuitem menu:id=".uno:Open"/>
+      <menu:menuitem menu:id=".uno:OpenRemote"/>
       <menu:menuitem menu:id=".uno:RecentFileList"/>
       <menu:menuseparator/>
       <menu:menuitem menu:id=".uno:AutoPilotMenu"/>
@@ -36,6 +37,7 @@
       <menu:menuitem menu:id=".uno:Save"/>
       <menu:menuitem menu:id=".uno:SaveAs"/>
       <menu:menuitem menu:id=".uno:SaveACopy"/>
+      <menu:menuitem menu:id=".uno:SaveAsRemote"/>
       <menu:menuitem menu:id=".uno:SaveAll"/>
       <menu:menuitem menu:id=".uno:CheckOut"/>
       <menu:menuitem menu:id=".uno:CancelCheckOut"/>
diff --git a/sd/uiconfig/sdraw/toolbar/standardbar.xml b/sd/uiconfig/sdraw/toolbar/standardbar.xml
index 06c7d5d..6e2d1fa 100644
--- a/sd/uiconfig/sdraw/toolbar/standardbar.xml
+++ b/sd/uiconfig/sdraw/toolbar/standardbar.xml
@@ -22,8 +22,9 @@
  <toolbar:toolbaritem xlink:href=".uno:AddDirect" toolbar:helpid="5537"/>
  <toolbar:toolbaritem xlink:href=".uno:NewDoc" toolbar:visible="false" toolbar:helpid="5500"/>
  <toolbar:toolbaritem xlink:href=".uno:Open" toolbar:style="dropdown"/>
+ <toolbar:toolbaritem xlink:href=".uno:OpenRemote"/>
  <toolbar:toolbaritem xlink:href=".uno:Save" toolbar:helpid="5505"/>
- <toolbar:toolbaritem xlink:href=".uno:SaveAs" toolbar:helpid="5502"/>
+ <toolbar:toolbaritem xlink:href=".uno:SaveAs" toolbar:style="dropdown" toolbar:helpid="5502"/>
  <toolbar:toolbaritem xlink:href=".uno:SendMail" toolbar:visible="false" toolbar:helpid="5331"/>
  <toolbar:toolbarseparator/>
  <toolbar:toolbaritem xlink:href=".uno:EditDoc" toolbar:helpid="6312" toolbar:visible="false"/>
diff --git a/sd/uiconfig/simpress/menubar/menubar.xml b/sd/uiconfig/simpress/menubar/menubar.xml
index 3eb5156..71146c2 100644
--- a/sd/uiconfig/simpress/menubar/menubar.xml
+++ b/sd/uiconfig/simpress/menubar/menubar.xml
@@ -21,6 +21,7 @@
         <menu:menupopup>
             <menu:menuitem menu:id=".uno:AddDirect"/>
             <menu:menuitem menu:id=".uno:Open"/>
+            <menu:menuitem menu:id=".uno:OpenRemote"/>
             <menu:menuitem menu:id=".uno:RecentFileList"/>
             <menu:menuitem menu:id=".uno:CloseDoc"/>
             <menu:menuseparator/>
@@ -38,6 +39,7 @@
             <menu:menuitem menu:id=".uno:Save"/>
             <menu:menuitem menu:id=".uno:SaveAs"/>
             <menu:menuitem menu:id=".uno:SaveACopy"/>
+            <menu:menuitem menu:id=".uno:SaveAsRemote"/>
             <menu:menuitem menu:id=".uno:SaveAll"/>
             <menu:menuitem menu:id=".uno:CheckOut"/>
             <menu:menuitem menu:id=".uno:CancelCheckOut"/>
diff --git a/sd/uiconfig/simpress/toolbar/standardbar.xml b/sd/uiconfig/simpress/toolbar/standardbar.xml
index c82ad6a..a83b414 100644
--- a/sd/uiconfig/simpress/toolbar/standardbar.xml
+++ b/sd/uiconfig/simpress/toolbar/standardbar.xml
@@ -22,8 +22,9 @@
  <toolbar:toolbaritem xlink:href=".uno:AddDirect" toolbar:style="dropdown"/>
  <toolbar:toolbaritem xlink:href=".uno:NewDoc" toolbar:visible="false"/>
  <toolbar:toolbaritem xlink:href=".uno:Open" toolbar:style="dropdown"/>
+ <toolbar:toolbaritem xlink:href=".uno:OpenRemote"/>
  <toolbar:toolbaritem xlink:href=".uno:Save"/>
- <toolbar:toolbaritem xlink:href=".uno:SaveAs"/>
+ <toolbar:toolbaritem xlink:href=".uno:SaveAs" toolbar:style="dropdown"/>
  <toolbar:toolbaritem xlink:href=".uno:SendMail" toolbar:visible="false"/>
  <toolbar:toolbarseparator/>
  <toolbar:toolbaritem xlink:href=".uno:EditDoc" toolbar:visible="false"/>
commit 0a420eedb5960b1c5fd00332e625fb0bb02ee1eb
Author: Szymon Kłos <eszkadev at gmail.com>
Date:   Tue Jul 21 16:45:00 2015 +0200

    set pointer to Wait while reading url
    
    Change-Id: I3c0786f8fb20df368cc7c03e35deba51d7ebbecd

diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx
index f618965..75615d1 100644
--- a/fpicker/source/office/RemoteFilesDialog.cxx
+++ b/fpicker/source/office/RemoteFilesDialog.cxx
@@ -470,6 +470,10 @@ FileViewResult RemoteFilesDialog::OpenURL( OUString const & sURL )
         }
 
         m_pFileView->EndInplaceEditing( false );
+
+        EnableChildPointerOverwrite( true );
+        SetPointer( PointerStyle::Wait );
+
         eResult = m_pFileView->Initialize( sURL, sFilter, NULL, GetBlackList() );
 
         if( eResult == eSuccess )
@@ -483,6 +487,9 @@ FileViewResult RemoteFilesDialog::OpenURL( OUString const & sURL )
             m_bIsConnected = true;
             EnableControls();
         }
+
+        SetPointer( PointerStyle::Arrow );
+        EnableChildPointerOverwrite( false );
     }
 
     return eResult;
commit 0eb92b403532a045fb8865ce71275ca44f546a72
Author: Szymon Kłos <eszkadev at gmail.com>
Date:   Tue Jul 21 15:50:09 2015 +0200

    select recently added service
    
    Change-Id: I55a32eef4a5eb3b9f57cf6d1b8f3cba5a9a14c55

diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx
index 47d2ddf..f618965 100644
--- a/fpicker/source/office/RemoteFilesDialog.cxx
+++ b/fpicker/source/office/RemoteFilesDialog.cxx
@@ -551,6 +551,7 @@ IMPL_LINK_NOARG ( RemoteFilesDialog, AddServiceHdl )
 
             m_pServices_lb->InsertEntry( sPrefix + newService->GetName() );
             m_pServices_lb->SelectEntryPos( m_pServices_lb->GetEntryCount() - 1 );
+            SelectServiceHdl( NULL );
 
             m_bIsUpdated = true;
 
commit 436f474f2c0b411032f9d5ce6a342b3563b83e76
Author: Szymon Kłos <eszkadev at gmail.com>
Date:   Tue Jul 21 15:39:08 2015 +0200

    automatically select last used service
    
    Change-Id: Ic66517cd65c28bd7e62e38796cf8580ed31305f7

diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx
index d2e3cc5..47d2ddf 100644
--- a/fpicker/source/office/RemoteFilesDialog.cxx
+++ b/fpicker/source/office/RemoteFilesDialog.cxx
@@ -325,6 +325,11 @@ short RemoteFilesDialog::Execute()
         Show();
         AddServiceHdl( NULL );
     }
+    if( m_pServices_lb->GetEntryCount() > 0 )
+    {
+        Show();
+        SelectServiceHdl( NULL );
+    }
 
     short nRet = SvtFileDialog_Base::Execute();
 
commit f4c88188729051c2d97c6f574119afcf0b988810
Author: Szymon Kłos <eszkadev at gmail.com>
Date:   Tue Jul 21 13:28:46 2015 +0200

    avoid multiple recursive opening the same url, cleaning
    
    Change-Id: I8a3ae75a64ffcc4879af3e3591b3b433cee1678d

diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx
index 7f0447a..d2e3cc5 100644
--- a/fpicker/source/office/RemoteFilesDialog.cxx
+++ b/fpicker/source/office/RemoteFilesDialog.cxx
@@ -470,7 +470,10 @@ FileViewResult RemoteFilesDialog::OpenURL( OUString const & sURL )
         if( eResult == eSuccess )
         {
             m_pPath->SetURL( sURL );
+
+            m_pTreeView->SetSelectHdl( Link<>() );
             m_pTreeView->SetTreePath( sURL );
+            m_pTreeView->SetSelectHdl( LINK( this, RemoteFilesDialog, TreeSelectHdl ) );
 
             m_bIsConnected = true;
             EnableControls();
@@ -662,24 +665,17 @@ IMPL_LINK_TYPED ( RemoteFilesDialog, EditServiceMenuHdl, MenuButton *, pButton,
 
 IMPL_LINK_NOARG ( RemoteFilesDialog, DoubleClickHdl )
 {
-    SvTreeListEntry* pEntry = m_pFileView->FirstSelected();
-
-    if( pEntry )
+    if( m_pFileView->GetSelectionCount() )
     {
-        SvtContentEntry* pData = static_cast< SvtContentEntry* >( pEntry->GetUserData() );
+        OUString sURL = m_pFileView->GetCurrentURL();
 
-        if( pData )
+        if( ContentIsFolder( sURL ) )
         {
-            if( pData->mbIsFolder )
-            {
-                OUString sURL = m_pFileView->GetCurrentURL();
-
-                OpenURL( sURL );
-            }
-            else
-            {
-                EndDialog( RET_OK );
-            }
+            OpenURL( sURL );
+        }
+        else
+        {
+            EndDialog( RET_OK );
         }
     }
 
commit 52ead2fbca3e6f6274fe34d1c0b13e46c4e5b8e1
Author: Szymon Kłos <eszkadev at gmail.com>
Date:   Tue Jul 21 12:35:19 2015 +0200

    don't take full email address as a username
    
    Change-Id: Ibc8f951dc3281b0b1d0f4b6783af0dbe2fb75da0

diff --git a/svtools/source/dialogs/PlaceEditDialog.cxx b/svtools/source/dialogs/PlaceEditDialog.cxx
index cb90be7..125a817 100644
--- a/svtools/source/dialogs/PlaceEditDialog.cxx
+++ b/svtools/source/dialogs/PlaceEditDialog.cxx
@@ -198,7 +198,13 @@ void PlaceEditDialog::UpdateLabel( )
         if( !m_pEDUsername->GetText().isEmpty( ) )
         {
             OUString sLabel = SvtResId( STR_SVT_DEFAULT_SERVICE_LABEL );
-            sLabel = sLabel.replaceFirst( "$user$", m_pEDUsername->GetText() );
+            OUString sUser = m_pEDUsername->GetText();
+
+            int nLength = sUser.indexOf( '@' );
+            if( nLength < 0 )
+                nLength = sUser.getLength();
+
+            sLabel = sLabel.replaceFirst( "$user$", sUser.copy( 0, nLength ) );
             sLabel = sLabel.replaceFirst( "$service$", m_pLBServerType->GetSelectEntry() );
 
             m_pEDServerName->SetText( sLabel );
commit 9051f255080a2f04af30bdaef39ee7d684e6b8d9
Author: Szymon Kłos <eszkadev at gmail.com>
Date:   Tue Jul 21 11:59:45 2015 +0200

    FolderTree: expanded folder icon
    
    Change-Id: If5956b61dec2f00f9233e8f4906bdb9b6f22571d

diff --git a/icon-themes/breeze/links.txt b/icon-themes/breeze/links.txt
index 7ba9f85..9475368 100644
--- a/icon-themes/breeze/links.txt
+++ b/icon-themes/breeze/links.txt
@@ -126,3 +126,6 @@ cmd/sc_showgraphics.png cmd/sc_graphic.png
 # split cells duplicates
 svx/res/zetlhor2.png /sw/res/zetlhor2.png
 svx/res/zetlver2.png /sw/res/zetlver2.png
+
+# FolderTree expanded icon
+svtools/res/folderop.png formula/res/fapopen.png
diff --git a/icon-themes/galaxy/links.txt b/icon-themes/galaxy/links.txt
index 2e42f11..6a68faf 100644
--- a/icon-themes/galaxy/links.txt
+++ b/icon-themes/galaxy/links.txt
@@ -81,3 +81,6 @@ cmd/lc_charbackcolor.png cmd/lc_backcolor.png
 
 # Toggle graphics visibility in Writer
 cmd/sc_showgraphics.png cmd/sc_graphic.png
+
+# FolderTree expanded icon
+svtools/res/folderop.png formula/res/fapopen.png
diff --git a/icon-themes/hicontrast/links.txt b/icon-themes/hicontrast/links.txt
index 3c9fd17..ea11b2a 100644
--- a/icon-themes/hicontrast/links.txt
+++ b/icon-themes/hicontrast/links.txt
@@ -5,3 +5,7 @@ cmd/sc_linespacing.png cmd/sc_spacepara15.png
 # text background colour Impress/Draw
 cmd/sc_charbackcolor.png cmd/sc_backcolor.png
 cmd/lc_charbackcolor.png cmd/lc_backcolor.png
+
+# FolderTree icons
+svtools/res/folder.png formula/res/fapclose.png
+svtools/res/folderop.png formula/res/fapopen.png
diff --git a/icon-themes/human/links.txt b/icon-themes/human/links.txt
index 3e7c8a7..5b1aca0 100644
--- a/icon-themes/human/links.txt
+++ b/icon-themes/human/links.txt
@@ -8,3 +8,6 @@ cmd/sc_linespacing.png cmd/sc_spacepara15.png
 # text background colour Impress/Draw
 cmd/sc_charbackcolor.png cmd/sc_backcolor.png
 cmd/lc_charbackcolor.png cmd/lc_backcolor.png
+
+# FolderTree expanded icon
+svtools/res/folderop.png formula/res/fapopen.png
diff --git a/icon-themes/tango/links.txt b/icon-themes/tango/links.txt
index 2fc1b96..672e153 100644
--- a/icon-themes/tango/links.txt
+++ b/icon-themes/tango/links.txt
@@ -383,6 +383,7 @@ res/sc10712.png cmd/sc_sortdescending.png
 res/reload.png cmd/sc_reload.png
 res/sc05501.png cmd/sc_open.png
 svtools/res/folder.png formula/res/fapclose.png
+svtools/res/folderop.png formula/res/fapopen.png
 fpicker/res/fp011.png res/sc06303.png
 sfx2/res/styfam1.png sw/imglst/sf01.png
 sfx2/res/styfam2.png sw/imglst/sf02.png
diff --git a/include/svtools/foldertree.hxx b/include/svtools/foldertree.hxx
index e430072..4be22b9 100644
--- a/include/svtools/foldertree.hxx
+++ b/include/svtools/foldertree.hxx
@@ -40,6 +40,7 @@ private:
     ::osl::Mutex m_aMutex;
     Sequence< OUString > m_aBlackList;
     Image m_aFolderImage;
+    Image m_aFolderExpandedImage;
 
 public:
     FolderTree( vcl::Window* pParent, WinBits nBits );
diff --git a/include/svtools/svtools.hrc b/include/svtools/svtools.hrc
index 5ddb4dd..570809b 100644
--- a/include/svtools/svtools.hrc
+++ b/include/svtools/svtools.hrc
@@ -263,6 +263,7 @@
 #define IMG_TRIANGLE_DOWN               (RID_SVTOOLS_START + 20)
 
 #define IMG_SVT_FOLDER                  (RID_SVTOOLS_START + 42)
+#define IMG_SVT_FOLDER_OPEN             (RID_SVTOOLS_START + 43)
 
 #define RID_IMG_PRNDLG_NOCOLLATE            (STR_SVT_PRNDLG_START + 30)
 
diff --git a/svtools/source/contnr/fileview.src b/svtools/source/contnr/fileview.src
index c645737..54119f3 100644
--- a/svtools/source/contnr/fileview.src
+++ b/svtools/source/contnr/fileview.src
@@ -76,6 +76,12 @@ Image IMG_SVT_FOLDER
     MaskColor = Color { Red = 0xFFFF ; Green = 0x0000 ; Blue = 0xFFFF ; };
 };
 
+Image IMG_SVT_FOLDER_OPEN
+{
+    ImageBitmap = Bitmap { File = "folderop.png" ; };
+    MaskColor = Color { Red = 0xFFFF ; Green = 0x0000 ; Blue = 0xFFFF ; };
+};
+
 // Menus -----------------------------------------------------------------
 
 Menu RID_FILEVIEW_CONTEXTMENU
diff --git a/svtools/source/contnr/foldertree.cxx b/svtools/source/contnr/foldertree.cxx
index 50df76b..63cc7e0 100644
--- a/svtools/source/contnr/foldertree.cxx
+++ b/svtools/source/contnr/foldertree.cxx
@@ -14,6 +14,7 @@
 FolderTree::FolderTree( vcl::Window* pParent, WinBits nBits )
     : SvTreeListBox( pParent, nBits | WB_SORT | WB_TABSTOP )
     , m_aFolderImage( SvtResId( IMG_SVT_FOLDER ) )
+    , m_aFolderExpandedImage( SvtResId( IMG_SVT_FOLDER_OPEN ) )
 {
     Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext();
     Reference< XInteractionHandler > xInteractionHandler(
@@ -21,7 +22,7 @@ FolderTree::FolderTree( vcl::Window* pParent, WinBits nBits )
     m_xEnv = new ::ucbhelper::CommandEnvironment( xInteractionHandler, Reference< XProgressHandler >() );
 
     SetDefaultCollapsedEntryBmp( m_aFolderImage );
-    SetDefaultExpandedEntryBmp( m_aFolderImage );
+    SetDefaultExpandedEntryBmp( m_aFolderExpandedImage );
 }
 
 void FolderTree::RequestingChildren( SvTreeListEntry* pEntry )
commit e211358e99942e38971a9f54bb305c3846720c9f
Author: Szymon Kłos <eszkadev at gmail.com>
Date:   Tue Jul 21 09:40:49 2015 +0200

    check pointers
    
    Change-Id: Iacf9213d833a0a3c2d951c667108a5e2538f4215

diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx
index 1662758..7f0447a 100644
--- a/fpicker/source/office/RemoteFilesDialog.cxx
+++ b/fpicker/source/office/RemoteFilesDialog.cxx
@@ -689,30 +689,35 @@ IMPL_LINK_NOARG ( RemoteFilesDialog, DoubleClickHdl )
 IMPL_LINK_NOARG ( RemoteFilesDialog, SelectHdl )
 {
     SvTreeListEntry* pEntry = m_pFileView->FirstSelected();
-    if (!pEntry)
-        return 1;
-    SvtContentEntry* pData = static_cast< SvtContentEntry* >( pEntry->GetUserData() );
 
-    if( ( pData->mbIsFolder && ( m_eType == REMOTEDLG_TYPE_PATHDLG ) )
-       || ( !pData->mbIsFolder && ( m_eType == REMOTEDLG_TYPE_FILEDLG ) ) )
+    if( pEntry )
     {
-        // url must contain user info, because we need this info in recent files entry
-        // (to fill user field in login box by default)
-        INetURLObject aURL( pData->maURL );
-        INetURLObject aCurrentURL( m_sLastServiceUrl );
-        aURL.SetUser( aCurrentURL.GetUser() );
+        SvtContentEntry* pData = static_cast< SvtContentEntry* >( pEntry->GetUserData() );
 
-        m_sPath = aURL.GetMainURL( INetURLObject::NO_DECODE );
+        if( pData )
+        {
+            if( ( pData->mbIsFolder && ( m_eType == REMOTEDLG_TYPE_PATHDLG ) )
+                || ( !pData->mbIsFolder && ( m_eType == REMOTEDLG_TYPE_FILEDLG ) ) )
+            {
+                // url must contain user info, because we need this info in recent files entry
+                // (to fill user field in login box by default)
+                INetURLObject aURL( pData->maURL );
+                INetURLObject aCurrentURL( m_sLastServiceUrl );
+                aURL.SetUser( aCurrentURL.GetUser() );
 
-        m_pName_ed->SetText( INetURLObject::decode( aURL.GetLastName(), INetURLObject::DECODE_WITH_CHARSET ) );
-    }
-    else
-    {
-        m_sPath.clear();
-        m_pName_ed->SetText( "" );
-    }
+                m_sPath = aURL.GetMainURL( INetURLObject::NO_DECODE );
 
-    EnableControls();
+                m_pName_ed->SetText( INetURLObject::decode( aURL.GetLastName(), INetURLObject::DECODE_WITH_CHARSET ) );
+            }
+            else
+            {
+                m_sPath.clear();
+                m_pName_ed->SetText( "" );
+            }
+
+            EnableControls();
+        }
+    }
 
     return 1;
 }
commit f369d4764b3575c01dc7245686e9493784473ada
Author: Szymon Kłos <eszkadev at gmail.com>
Date:   Mon Jul 20 16:01:09 2015 +0200

    default label for service
    
    Change-Id: Iad4ad161765c943a035dcc15232c4dcbef1cc68c

diff --git a/include/svtools/PlaceEditDialog.hxx b/include/svtools/PlaceEditDialog.hxx
index b601b9b..e492978 100644
--- a/include/svtools/PlaceEditDialog.hxx
+++ b/include/svtools/PlaceEditDialog.hxx
@@ -53,7 +53,9 @@ private:
 
     unsigned int m_nCurrentType;
 
-public:
+    bool bLabelChanged;
+
+public :
 
      PlaceEditDialog( vcl::Window* pParent);
      PlaceEditDialog(vcl::Window* pParent, const std::shared_ptr<Place> &rPlace );
@@ -69,11 +71,13 @@ public:
 private:
 
     void InitDetails( );
+    void UpdateLabel( );
 
     DECL_LINK ( OKHdl, Button * );
     DECL_LINK ( DelHdl, Button * );
     DECL_LINK ( EditHdl, void * );
     DECL_LINK ( SelectTypeHdl, void * );
+    DECL_LINK ( EditLabelHdl, void * );
     DECL_LINK ( EditUsernameHdl, void * );
 
 };
diff --git a/include/svtools/svtools.hrc b/include/svtools/svtools.hrc
index 23cf007..5ddb4dd 100644
--- a/include/svtools/svtools.hrc
+++ b/include/svtools/svtools.hrc
@@ -51,6 +51,9 @@
 #define STR_SVT_ESTIMATED_SIZE_VEC      (RID_SVTOOLS_START + 41)
 
 // FREE
+
+#define STR_SVT_DEFAULT_SERVICE_LABEL   (RID_SVTOOLS_START+57)
+
 #define STRARY_SVT_DOCINFO              (RID_SVTOOLS_START+58)
 
 #define STR_BASICKEY_FORMAT_ON          (RID_SVTOOLS_START+103)
diff --git a/svtools/source/dialogs/PlaceEditDialog.cxx b/svtools/source/dialogs/PlaceEditDialog.cxx
index 15034dd..cb90be7 100644
--- a/svtools/source/dialogs/PlaceEditDialog.cxx
+++ b/svtools/source/dialogs/PlaceEditDialog.cxx
@@ -13,6 +13,7 @@
 #include <com/sun/star/uno/Sequence.hxx>
 #include <officecfg/Office/Common.hxx>
 #include <svtools/svtresid.hxx>
+#include <svtools/svtools.hrc>
 #include <vcl/msgbox.hxx>
 
 using namespace com::sun::star::uno;
@@ -21,6 +22,7 @@ PlaceEditDialog::PlaceEditDialog(vcl::Window* pParent)
     : ModalDialog(pParent, "PlaceEditDialog", "svt/ui/placeedit.ui")
     , m_xCurrentDetails()
     , m_nCurrentType( 0 )
+    , bLabelChanged( false )
 {
     get( m_pEDServerName, "name" );
     get( m_pLBServerType, "type" );
@@ -33,7 +35,7 @@ PlaceEditDialog::PlaceEditDialog(vcl::Window* pParent)
     m_pBTOk->SetClickHdl( LINK( this, PlaceEditDialog, OKHdl) );
     m_pBTOk->Enable( false );
 
-    m_pEDServerName->SetModifyHdl( LINK( this, PlaceEditDialog, EditHdl) );
+    m_pEDServerName->SetModifyHdl( LINK( this, PlaceEditDialog, EditLabelHdl) );
 
     // This constructor is called when user request a place creation, so
     // delete button is hidden.
@@ -48,6 +50,7 @@ PlaceEditDialog::PlaceEditDialog(vcl::Window* pParent)
 PlaceEditDialog::PlaceEditDialog(vcl::Window* pParent, const std::shared_ptr<Place>& rPlace)
     : ModalDialog(pParent, "PlaceEditDialog", "svt/ui/placeedit.ui")
     , m_xCurrentDetails( )
+    , bLabelChanged( true )
 {
     get( m_pEDServerName, "name" );
     get( m_pLBServerType, "type" );
@@ -188,6 +191,26 @@ void PlaceEditDialog::InitDetails( )
     SelectTypeHdl( m_pLBServerType );
 }
 
+void PlaceEditDialog::UpdateLabel( )
+{
+    if( !bLabelChanged )
+    {
+        if( !m_pEDUsername->GetText().isEmpty( ) )
+        {
+            OUString sLabel = SvtResId( STR_SVT_DEFAULT_SERVICE_LABEL );
+            sLabel = sLabel.replaceFirst( "$user$", m_pEDUsername->GetText() );
+            sLabel = sLabel.replaceFirst( "$service$", m_pLBServerType->GetSelectEntry() );
+
+            m_pEDServerName->SetText( sLabel );
+            bLabelChanged = false;
+        }
+        else
+        {
+            m_pEDServerName->SetText( m_pLBServerType->GetSelectEntry( ) );
+        }
+    }
+}
+
 IMPL_LINK ( PlaceEditDialog,  OKHdl, Button *, )
 {
     if ( m_xCurrentDetails.get() )
@@ -234,12 +257,22 @@ IMPL_LINK ( PlaceEditDialog, DelHdl, Button *, )
 
 IMPL_LINK_NOARG( PlaceEditDialog, EditHdl )
 {
+    UpdateLabel( );
+
     OUString sUrl = GetServerUrl( );
     OUString sName = OUString( m_pEDServerName->GetText() ).trim( );
     m_pBTOk->Enable( !sName.isEmpty( ) && !sUrl.isEmpty( ) );
     return 1;
 }
 
+IMPL_LINK_NOARG( PlaceEditDialog, EditLabelHdl )
+{
+    bLabelChanged = true;
+    EditHdl(NULL);
+
+    return 1;
+}
+
 IMPL_LINK_NOARG( PlaceEditDialog, EditUsernameHdl )
 {
     for ( std::vector< std::shared_ptr< DetailsContainer > >::iterator it = m_aDetailsContainers.begin( );
@@ -247,7 +280,9 @@ IMPL_LINK_NOARG( PlaceEditDialog, EditUsernameHdl )
     {
         ( *it )->setUsername( OUString( m_pEDUsername->GetText() ) );
     }
+
     EditHdl(NULL);
+
     return 1;
 }
 
diff --git a/svtools/source/dialogs/filedlg2.src b/svtools/source/dialogs/filedlg2.src
index 6e68db0..795da0e 100644
--- a/svtools/source/dialogs/filedlg2.src
+++ b/svtools/source/dialogs/filedlg2.src
@@ -18,6 +18,7 @@
  */
 
 #include <svtools/filedlg2.hrc>
+#include <svtools/svtools.hrc>
 
 String STR_FILEDLG_OPEN
 {
@@ -32,4 +33,9 @@ String STR_FILEDLG_SAVE
     Text [ en-US ] = "Save" ;
 };
 
+String STR_SVT_DEFAULT_SERVICE_LABEL
+{
+    Text [ en-US ] = "$user$'s $service$" ;
+};
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit ea956fa67ff42596cbe79a402dcb2c4c767e6946
Author: Szymon Kłos <eszkadev at gmail.com>
Date:   Mon Jul 20 14:26:41 2015 +0200

    string: 'Remote File' -> 'Save Remote File...'
    
    Change-Id: I30e664e6fa16cdcbdffa97c57905b73224d42636

diff --git a/framework/source/classes/resource.src b/framework/source/classes/resource.src
index 4f8ce0e..44e0c70 100644
--- a/framework/source/classes/resource.src
+++ b/framework/source/classes/resource.src
@@ -121,7 +121,7 @@ String STR_OPEN_REMOTE
 
 String STR_REMOTE_FILE
 {
-    Text [ en-US ] = "Remote file";
+    Text [ en-US ] = "Save Remote File...";
 };
 
 String STR_TOOLBAR_TITLE_ADDON
commit 7c4fe320e6c4aeb30a9801e1ec34255422e047e4
Author: Szymon Kłos <eszkadev at gmail.com>
Date:   Mon Jul 20 14:19:54 2015 +0200

    remember user name in recent files
    
    Change-Id: I55b340e90d51b614b8f46c06e3dc1961b3bac2ba

diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx
index 28200bb..1662758 100644
--- a/fpicker/source/office/RemoteFilesDialog.cxx
+++ b/fpicker/source/office/RemoteFilesDialog.cxx
@@ -696,8 +696,13 @@ IMPL_LINK_NOARG ( RemoteFilesDialog, SelectHdl )
     if( ( pData->mbIsFolder && ( m_eType == REMOTEDLG_TYPE_PATHDLG ) )
        || ( !pData->mbIsFolder && ( m_eType == REMOTEDLG_TYPE_FILEDLG ) ) )
     {
+        // url must contain user info, because we need this info in recent files entry
+        // (to fill user field in login box by default)
         INetURLObject aURL( pData->maURL );
-        m_sPath = pData->maURL;
+        INetURLObject aCurrentURL( m_sLastServiceUrl );
+        aURL.SetUser( aCurrentURL.GetUser() );
+
+        m_sPath = aURL.GetMainURL( INetURLObject::NO_DECODE );
 
         m_pName_ed->SetText( INetURLObject::decode( aURL.GetLastName(), INetURLObject::DECODE_WITH_CHARSET ) );
     }
@@ -815,6 +820,14 @@ IMPL_LINK_NOARG ( RemoteFilesDialog, OkHdl )
             m_sPath = sCurrentPath;
         else
             m_sPath = sSelectedItem;
+
+        // url must contain user info, because we need this info in recent files entry
+        // (to fill user field in login box by default)
+        INetURLObject aURL( m_sPath );
+        INetURLObject aCurrentURL( m_sLastServiceUrl );
+        aURL.SetUser( aCurrentURL.GetUser() );
+
+        m_sPath = aURL.GetMainURL( INetURLObject::NO_DECODE );
     }
 
     bool bExists = false;
@@ -973,7 +986,13 @@ std::vector<OUString> RemoteFilesDialog::GetPathList() const
 
     while( pEntry )
     {
-        aList.push_back( SvtFileView::GetURL( pEntry ) );
+        // url must contain user info, because we need this info in recent files entry
+        // (to fill user field in login box by default)
+        INetURLObject aURL( SvtFileView::GetURL( pEntry ) );
+        INetURLObject aCurrentURL( m_sLastServiceUrl );
+        aURL.SetUser( aCurrentURL.GetUser() );
+
+        aList.push_back( aURL.GetMainURL( INetURLObject::NO_DECODE ) );
         pEntry = m_pFileView->NextSelected( pEntry );
     }
 
commit 37e184911ef6cd19f9b7ede0407f9a60a3932b44
Author: Szymon Kłos <eszkadev at gmail.com>
Date:   Mon Jul 20 11:30:49 2015 +0200

    Show 'Add service' dialog when there is no service added yet
    
    Change-Id: I72d294e9c09b0d02b829b91fb188c1c7965d1d45

diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx
index bb2587d..28200bb 100644
--- a/fpicker/source/office/RemoteFilesDialog.cxx
+++ b/fpicker/source/office/RemoteFilesDialog.cxx
@@ -318,6 +318,19 @@ void RemoteFilesDialog::Resize()
     }
 }
 
+short RemoteFilesDialog::Execute()
+{
+    if( m_pServices_lb->GetEntryCount() == 0 )
+    {
+        Show();
+        AddServiceHdl( NULL );
+    }
+
+    short nRet = SvtFileDialog_Base::Execute();
+
+    return nRet;
+}
+
 OUString lcl_GetServiceType( ServicePtr pService )
 {
     INetProtocol aProtocol = pService->GetUrlObject().GetProtocol();
diff --git a/fpicker/source/office/RemoteFilesDialog.hxx b/fpicker/source/office/RemoteFilesDialog.hxx
index ba48b8e..ede30c7 100644
--- a/fpicker/source/office/RemoteFilesDialog.hxx
+++ b/fpicker/source/office/RemoteFilesDialog.hxx
@@ -64,6 +64,7 @@ public:
 
     virtual void dispose() SAL_OVERRIDE;
     virtual void Resize() SAL_OVERRIDE;
+    virtual short Execute() SAL_OVERRIDE;
 
     OUString GetPath() const;
 
commit 8cc2115c8cadf938166bb94038da6c1bc61f0fc5
Author: Szymon Kłos <eszkadev at gmail.com>
Date:   Mon Jul 20 10:04:09 2015 +0200

    accessibility: correct tab-order
    
    Change-Id: Ib554e8bb73367d5f85253f0deb083fbc5a5d454b

diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx
index 86be522..bb2587d 100644
--- a/fpicker/source/office/RemoteFilesDialog.cxx
+++ b/fpicker/source/office/RemoteFilesDialog.cxx
@@ -11,13 +11,22 @@
 
 class FileViewContainer : public vcl::Window
 {
+    enum FocusState
+    {
+        Prev = 0,
+        TreeView,
+        FileView,
+        Next,
+        FocusCount
+    };
+
     private:
     VclPtr< SvtFileView > m_pFileView;
     VclPtr< FolderTree > m_pTreeView;
     VclPtr< Splitter > m_pSplitter;
 
     int m_nCurrentFocus;
-    VclPtr<vcl::Window> m_pFocusWidgets[4];
+    VclPtr<vcl::Window> m_pFocusWidgets[FocusState::FocusCount];
 
     public:
     FileViewContainer( vcl::Window *pParent )
@@ -51,10 +60,10 @@ class FileViewContainer : public vcl::Window
         m_pFileView = pFileView;
         m_pTreeView = pTreeView;
         m_pSplitter = pSplitter;
-        m_pFocusWidgets[0] = pPrevSibling;
-        m_pFocusWidgets[1] = pTreeView;
-        m_pFocusWidgets[2] = pFileView;
-        m_pFocusWidgets[3] = pNextSibling;
+        m_pFocusWidgets[FocusState::Prev] = pPrevSibling;
+        m_pFocusWidgets[FocusState::TreeView] = pTreeView;
+        m_pFocusWidgets[FocusState::FileView] = pFileView;
+        m_pFocusWidgets[FocusState::Next] = pNextSibling;
     }
 
     virtual void Resize() SAL_OVERRIDE
@@ -89,14 +98,20 @@ class FileViewContainer : public vcl::Window
         if( !m_pFileView || !m_pTreeView )
             return;
 
-        if( !bReverse && m_nCurrentFocus < 3 )
+        if( bReverse && m_nCurrentFocus > FocusState::Prev && m_nCurrentFocus <= FocusState::Next )
         {
-            m_pFocusWidgets[++m_nCurrentFocus]->SetFakeFocus( true );
+            m_pFocusWidgets[m_nCurrentFocus]->SetFakeFocus(false);
+            m_pFocusWidgets[m_nCurrentFocus]->LoseFocus();
+
+            m_pFocusWidgets[--m_nCurrentFocus]->SetFakeFocus( true );
             m_pFocusWidgets[m_nCurrentFocus]->GrabFocus();
         }
-        else if( m_nCurrentFocus > 0 )
+        else if( !bReverse && m_nCurrentFocus >= FocusState::Prev && m_nCurrentFocus < FocusState::Next )
         {
-            m_pFocusWidgets[--m_nCurrentFocus]->SetFakeFocus( true );
+            m_pFocusWidgets[m_nCurrentFocus]->SetFakeFocus(false);
+            m_pFocusWidgets[m_nCurrentFocus]->LoseFocus();
+
+            m_pFocusWidgets[++m_nCurrentFocus]->SetFakeFocus( true );
             m_pFocusWidgets[m_nCurrentFocus]->GrabFocus();
         }
     }
@@ -106,13 +121,38 @@ class FileViewContainer : public vcl::Window
         if( !m_pFileView || !m_pTreeView )
             return;
 
-        m_nCurrentFocus = 1;
-        m_pFocusWidgets[m_nCurrentFocus]->SetFakeFocus( true );
-        m_pFocusWidgets[m_nCurrentFocus]->GrabFocus();
+        GetFocusFlags aFlags = GetGetFocusFlags();
+
+        if( aFlags & GetFocusFlags::Forward )
+            m_nCurrentFocus = FocusState::TreeView;
+        else if( aFlags & GetFocusFlags::Backward )
+            m_nCurrentFocus = FocusState::FileView;
+
+        if( m_nCurrentFocus >= FocusState::Prev && m_nCurrentFocus <= FocusState::Next )
+        {
+            m_pFocusWidgets[m_nCurrentFocus]->SetFakeFocus( true );
+            m_pFocusWidgets[m_nCurrentFocus]->GrabFocus();
+        }
     }
 
     virtual bool Notify( NotifyEvent& rNEvt ) SAL_OVERRIDE
     {
+        if( rNEvt.GetType() == MouseNotifyEvent::GETFOCUS )
+        {
+            // we must also update counter when user change focus using mouse
+            for(int i = FocusState::Prev; i <= FocusState::Next; i++)
+            {
+                if( rNEvt.GetWindow() == m_pFocusWidgets[i] )
+                {
+                    m_nCurrentFocus = i;
+                    return true;
+                }
+            }
+
+            // GETFOCUS for one of FileView's subcontrols
+            m_nCurrentFocus = FocusState::FileView;
+            return true;
+        }
         if( rNEvt.GetType() == MouseNotifyEvent::KEYINPUT )
         {
             const KeyEvent* pKeyEvent = rNEvt.GetKeyEvent();
commit 24ad90870931b9aa4482469f0d03cb4fc1df9feb
Author: Maxim Monastirsky <momonasmon at gmail.com>
Date:   Fri Jul 17 10:12:06 2015 +0300

    Don't show open remote entry in the recent doc menu
    
    We use the same menu controller for both the Open toolbar
    button and the Recent Documents menu. While it's
    reasonable to put the open remote file command under the
    open button, it has nothing to do with recent documents,
    so it shouldn't appear there.
    
    Also don't add the "No Document" entry in case the open
    remote entry is visible. The whole point of the "No
    Document" entry is that we can't leave the menu empty,
    but if there is another visible entry, it's not needed.
    
    Change-Id: Ibefbdc6dc7d1d49f555d8ee23f67b47eba19b445
    
    Signed-off-by: Szymon Kłos <eszkadev at gmail.com>

diff --git a/framework/source/uielement/recentfilesmenucontroller.cxx b/framework/source/uielement/recentfilesmenucontroller.cxx
index a2c3432..61d2f02 100644
--- a/framework/source/uielement/recentfilesmenucontroller.cxx
+++ b/framework/source/uielement/recentfilesmenucontroller.cxx
@@ -60,7 +60,8 @@ class RecentFilesMenuController :  public svt::PopupMenuControllerBase
     using svt::PopupMenuControllerBase::disposing;
 
 public:
-    RecentFilesMenuController( const uno::Reference< uno::XComponentContext >& xContext );
+    RecentFilesMenuController( const uno::Reference< uno::XComponentContext >& xContext,
+                               const uno::Sequence< uno::Any >& args );
     virtual ~RecentFilesMenuController();
 
     // XServiceInfo
@@ -115,12 +116,25 @@ private:
 
     std::vector< RecentFile > m_aRecentFilesItems;
     bool                  m_bDisabled : 1;
+    bool m_bShowRemote;
 };
 
-RecentFilesMenuController::RecentFilesMenuController( const uno::Reference< uno::XComponentContext >& xContext ) :
+RecentFilesMenuController::RecentFilesMenuController( const uno::Reference< uno::XComponentContext >& xContext,
+                                                      const uno::Sequence< uno::Any >& args ) :
     svt::PopupMenuControllerBase( xContext ),
-    m_bDisabled( false )
+    m_bDisabled( false ),
+    m_bShowRemote( false )
 {
+    css::beans::PropertyValue aPropValue;
+    for ( sal_Int32 i = 0; i < args.getLength(); ++i )
+    {
+        args[i] >>= aPropValue;
+        if ( aPropValue.Name == "ShowRemote" )
+        {
+            aPropValue.Value >>= m_bShowRemote;
+            break;
+        }
+    }
 }
 
 RecentFilesMenuController::~RecentFilesMenuController()
@@ -227,26 +241,30 @@ void RecentFilesMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >
                                         FWK_RESSTR(STR_CLEAR_RECENT_FILES_HELP) );
 
             // Open remote menu entry
-            pVCLPopupMenu->InsertItem( sal_uInt16( nCount + 2 ),
-                                       FWK_RESSTR(STR_OPEN_REMOTE) );
-            pVCLPopupMenu->SetItemCommand( sal_uInt16( nCount + 2 ),
-                                           OUString( CMD_OPEN_REMOTE ) );
+            if ( m_bShowRemote )
+            {
+                pVCLPopupMenu->InsertItem( sal_uInt16( nCount + 2 ),
+                                           FWK_RESSTR(STR_OPEN_REMOTE) );
+                pVCLPopupMenu->SetItemCommand( sal_uInt16( nCount + 2 ),
+                                               OUString( CMD_OPEN_REMOTE ) );
+            }
         }
         else
         {
-            // No recent documents => insert "no document" string
-            pVCLPopupMenu->InsertItem( 1, FWK_RESSTR(STR_NODOCUMENT) );
-            // Do not disable it, otherwise the Toolbar controller and MenuButton
-            // will display SV_RESID_STRING_NOSELECTIONPOSSIBLE instead of STR_NODOCUMENT
-            pVCLPopupMenu->SetItemBits( 1, pVCLPopupMenu->GetItemBits( 1 ) | MenuItemBits::NOSELECT );
-
-            pVCLPopupMenu->InsertSeparator();
-
-            // Open remote menu entry
-            pVCLPopupMenu->InsertItem( sal_uInt16( 2 ),
-                                       FWK_RESSTR(STR_OPEN_REMOTE) );
-            pVCLPopupMenu->SetItemCommand( sal_uInt16( 2 ),
-                                           OUString( CMD_OPEN_REMOTE ) );
+            if ( m_bShowRemote )
+            {
+                // Open remote menu entry
+                pVCLPopupMenu->InsertItem( 1, FWK_RESSTR(STR_OPEN_REMOTE) );
+                pVCLPopupMenu->SetItemCommand( 1, CMD_OPEN_REMOTE );
+            }
+            else
+            {
+                // No recent documents => insert "no document" string
+                pVCLPopupMenu->InsertItem( 1, FWK_RESSTR(STR_NODOCUMENT) );
+                // Do not disable it, otherwise the Toolbar controller and MenuButton
+                // will display SV_RESID_STRING_NOSELECTIONPOSSIBLE instead of STR_NODOCUMENT
+                pVCLPopupMenu->SetItemBits( 1, pVCLPopupMenu->GetItemBits( 1 ) | MenuItemBits::NOSELECT );
+            }
         }
     }
 }
@@ -444,9 +462,9 @@ IMPL_STATIC_LINK( RecentFilesMenuController, ExecuteHdl_Impl, LoadRecentFile*, p
 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
 com_sun_star_comp_framework_RecentFilesMenuController_get_implementation(
     css::uno::XComponentContext *context,
-    css::uno::Sequence<css::uno::Any> const &)
+    css::uno::Sequence<css::uno::Any> const &args)
 {
-    return cppu::acquire(new RecentFilesMenuController(context));
+    return cppu::acquire(new RecentFilesMenuController(context, args));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/toolbox/tbxitem.cxx b/sfx2/source/toolbox/tbxitem.cxx
index ed53d96..2906100 100644
--- a/sfx2/source/toolbox/tbxitem.cxx
+++ b/sfx2/source/toolbox/tbxitem.cxx
@@ -1153,6 +1153,10 @@ VclPtr<SfxPopupWindow> SfxRecentFilesToolBoxControl::CreatePopupWindow()
     aPropValue.Value <<= m_xFrame;
     aArgs[1] <<= aPropValue;
 
+    aPropValue.Name = "ShowRemote";
+    aPropValue.Value <<= true;
+    aArgs[2] <<= aPropValue;
+
     uno::Reference< frame::XPopupMenuController > xPopupController( m_xContext->getServiceManager()->createInstanceWithArgumentsAndContext(
                 "com.sun.star.comp.framework.RecentFilesMenuController", aArgs, m_xContext ), UNO_QUERY );
 
@@ -1191,7 +1195,7 @@ VclPtr<SfxPopupWindow> SfxSaveAsToolBoxControl::CreatePopupWindow()
     sal_uInt16 nItemId = GetId();
     ::Rectangle aRect( rBox.GetItemRect( nItemId ) );
 
-    Sequence< Any > aArgs( 2 );
+    Sequence< Any > aArgs( 3 );
     PropertyValue aPropValue;
 
     aPropValue.Name = "CommandURL";
commit 4963c4b5cf23e9bbc84ee4e3551de9d0100f6c92
Author: Szymon Kłos <eszkadev at gmail.com>
Date:   Fri Jul 17 12:09:05 2015 +0200

    File > Save As Remote - Calc and Writer
    
    Change-Id: I03dc6592015dea4b4c5e77650ec8378ee0853a63

diff --git a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
index a8d5d1f..3ee4ec3 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
@@ -1972,6 +1972,14 @@
           <value>1</value>
         </prop>
       </node>
+      <node oor:name=".uno:SaveAsRemote" oor:op="replace">
+        <prop oor:name="Label" oor:type="xs:string">
+          <value xml:lang="en-US">~Save As Remote File...</value>
+        </prop>
+        <prop oor:name="Properties" oor:type="xs:int">
+          <value>1</value>
+        </prop>
+      </node>
       <node oor:name=".uno:CircleCut" oor:op="replace">
         <prop oor:name="Label" oor:type="xs:string">
           <value xml:lang="en-US">Circle Segment</value>
diff --git a/sc/uiconfig/scalc/menubar/menubar.xml b/sc/uiconfig/scalc/menubar/menubar.xml
index 8369c10..43d6392 100644
--- a/sc/uiconfig/scalc/menubar/menubar.xml
+++ b/sc/uiconfig/scalc/menubar/menubar.xml
@@ -40,6 +40,7 @@
             <menu:menuitem menu:id=".uno:Save"/>
             <menu:menuitem menu:id=".uno:SaveAs"/>
             <menu:menuitem menu:id=".uno:SaveACopy"/>
+            <menu:menuitem menu:id=".uno:SaveAsRemote"/>
             <menu:menuitem menu:id=".uno:SaveAll"/>
             <menu:menuitem menu:id=".uno:CheckOut"/>
             <menu:menuitem menu:id=".uno:CancelCheckOut"/>
diff --git a/sw/uiconfig/swriter/menubar/menubar.xml b/sw/uiconfig/swriter/menubar/menubar.xml
index fd233cf..8300196 100644
--- a/sw/uiconfig/swriter/menubar/menubar.xml
+++ b/sw/uiconfig/swriter/menubar/menubar.xml
@@ -39,6 +39,7 @@
       <menu:menuitem menu:id=".uno:Save"/>
       <menu:menuitem menu:id=".uno:SaveAs"/>
       <menu:menuitem menu:id=".uno:SaveACopy"/>
+      <menu:menuitem menu:id=".uno:SaveAsRemote"/>
       <menu:menuitem menu:id=".uno:SaveAll"/>
       <menu:menuitem menu:id=".uno:CheckOut"/>
       <menu:menuitem menu:id=".uno:CancelCheckOut"/>
commit e6e193afd56c7f1bb4625576d538573caf0f2bf1
Author: Szymon Kłos <eszkadev at gmail.com>
Date:   Fri Jul 17 10:42:31 2015 +0200

    Open Remote file in Calc's menubar
    
    Change-Id: Ie0e98768724edca02cfe7dc9fda682ce125e1a9e

diff --git a/sc/uiconfig/scalc/menubar/menubar.xml b/sc/uiconfig/scalc/menubar/menubar.xml
index a474f98..8369c10 100644
--- a/sc/uiconfig/scalc/menubar/menubar.xml
+++ b/sc/uiconfig/scalc/menubar/menubar.xml
@@ -21,6 +21,7 @@
         <menu:menupopup>
             <menu:menuitem menu:id=".uno:AddDirect"/>
             <menu:menuitem menu:id=".uno:OpenFromCalc"/>
+            <menu:menuitem menu:id=".uno:OpenRemote"/>
             <menu:menuitem menu:id=".uno:RecentFileList"/>
             <menu:menuitem menu:id=".uno:CloseDoc"/>
             <menu:menuseparator/>
commit a301a2528ca9bfc1ade3d2f6dbdcc04785ea73b6
Author: Szymon Kłos <eszkadev at gmail.com>
Date:   Fri Jul 17 10:01:19 2015 +0200

    Open Remote file in Writer's menubar
    
    Change-Id: I5cda8661a44e4c33fab3263c17c1a7900241e70b

diff --git a/sw/uiconfig/swriter/menubar/menubar.xml b/sw/uiconfig/swriter/menubar/menubar.xml
index 7ae2617..fd233cf 100644
--- a/sw/uiconfig/swriter/menubar/menubar.xml
+++ b/sw/uiconfig/swriter/menubar/menubar.xml
@@ -21,6 +21,7 @@
     <menu:menupopup>
       <menu:menuitem menu:id=".uno:AddDirect"/>
       <menu:menuitem menu:id=".uno:OpenFromWriter"/>
+      <menu:menuitem menu:id=".uno:OpenRemote"/>
       <menu:menuitem menu:id=".uno:RecentFileList"/>
       <menu:menuitem menu:id=".uno:CloseDoc"/>
       <menu:menuseparator/>
commit b4823f17c08c3ac208ae1389eef346205ae5889c
Author: Szymon Kłos <eszkadev at gmail.com>
Date:   Fri Jul 17 09:34:06 2015 +0200

    Separator should not be the default selection
    
    Change-Id: Id879e795d3b6722ca0d86f8f6a8a32b0ef6f12bd

diff --git a/svtools/source/dialogs/PlaceEditDialog.cxx b/svtools/source/dialogs/PlaceEditDialog.cxx
index 482b763..15034dd 100644
--- a/svtools/source/dialogs/PlaceEditDialog.cxx
+++ b/svtools/source/dialogs/PlaceEditDialog.cxx
@@ -140,7 +140,6 @@ void PlaceEditDialog::InitDetails( )
     bool bSkipOneDrive= OUString( ONEDRIVE_CLIENT_ID ).isEmpty() ||
                        OUString( ONEDRIVE_CLIENT_SECRET ).isEmpty();
 
-
     Sequence< OUString > aTypesUrlsList( officecfg::Office::Common::Misc::CmisServersUrls::get( xContext ) );
     Sequence< OUString > aTypesNamesList( officecfg::Office::Common::Misc::CmisServersNames::get( xContext ) );
 
@@ -182,6 +181,10 @@ void PlaceEditDialog::InitDetails( )
 
     // Set default to first value
     m_pLBServerType->SelectEntryPos( 0 );
+
+    if ( m_pLBServerType->GetSelectEntry() == "--------------------" )
+        m_pLBServerType->SelectEntryPos( 1 );
+
     SelectTypeHdl( m_pLBServerType );
 }
 
commit 2960438dc7ad0d73ec4e285a659bedd36b811887
Author: Szymon Kłos <eszkadev at gmail.com>
Date:   Fri Jul 17 08:46:31 2015 +0200

    question if delete the service
    
    Change-Id: I49e5a93ba1d58b898ec1c7b9a4682c9e86302bd0

diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx
index 2fabadc..86be522 100644
--- a/fpicker/source/office/RemoteFilesDialog.cxx
+++ b/fpicker/source/office/RemoteFilesDialog.cxx
@@ -581,21 +581,26 @@ IMPL_LINK_TYPED ( RemoteFilesDialog, EditServiceMenuHdl, MenuButton *, pButton,
 
         if( nPos >= 0 )
         {
-            // TODO: Confirm dialog
-
-            m_aServices.erase( m_aServices.begin() + nPos );
-            m_pServices_lb->RemoveEntry( nSelected );
+            OUString sMsg = ResId( STR_SVT_DELETESERVICE, *ResMgrHolder::getOrCreate() );
+            sMsg = sMsg.replaceFirst( "$servicename$", m_pServices_lb->GetSelectEntry() );
+            ScopedVclPtrInstance< MessageDialog > aBox( this, sMsg, VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO );
 
-            if( m_pServices_lb->GetEntryCount() > 0 )
+            if( aBox->Execute() == RET_YES )
             {
-                m_pServices_lb->SelectEntryPos( 0 );
-            }
-            else
-            {
-                m_pServices_lb->SetNoSelection();
-            }
+                m_aServices.erase( m_aServices.begin() + nPos );
+                m_pServices_lb->RemoveEntry( nSelected );
 
-            m_bIsUpdated = true;
+                if( m_pServices_lb->GetEntryCount() > 0 )
+                {
+                    m_pServices_lb->SelectEntryPos( 0 );
+                }
+                else
+                {
+                    m_pServices_lb->SetNoSelection();
+                }
+
+                m_bIsUpdated = true;
+            }
         }
     }
 
diff --git a/fpicker/source/office/iodlg.src b/fpicker/source/office/iodlg.src
index e09fe0b..bc43b98 100644
--- a/fpicker/source/office/iodlg.src
+++ b/fpicker/source/office/iodlg.src
@@ -105,6 +105,11 @@ String STR_SVT_ALREADYEXISTOVERWRITE
     Text [ en-US ] = "A file named \"$filename$\" already exists.\n\nDo you want to replace it?" ;
 };
 
+String STR_SVT_DELETESERVICE
+{
+    Text [ en-US ] = "Are you sure you want to delete the service?\n\"$servicename$\"" ;
+};
+
 String STR_SVT_NEW_FOLDER
 {
     Text [ en-US ] = "Folder" ;
diff --git a/include/vcl/fpicker.hrc b/include/vcl/fpicker.hrc
index 387b389..7d4bd16 100644
--- a/include/vcl/fpicker.hrc
+++ b/include/vcl/fpicker.hrc
@@ -27,6 +27,7 @@
 #define STR_SVT_FOLDERPICKER_DEFAULT_TITLE          (STR_SVT_FILEPICKER_START+12)
 #define STR_SVT_FOLDERPICKER_DEFAULT_DESCRIPTION    (STR_SVT_FILEPICKER_START+13)
 #define STR_SVT_ALREADYEXISTOVERWRITE               (STR_SVT_FILEPICKER_START+14)
+#define STR_SVT_DELETESERVICE                       (STR_SVT_FILEPICKER_START+15)
 
 #endif
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 6246755d1cd82a66669a16509dd766c1a8b80e8e
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Fri Jul 24 12:16:33 2015 +0200

    -Werror,-Wunused-private-field
    
    Change-Id: Ib32a73e4f74ce7ccd19327ecaed84c16b5c60779

diff --git a/include/svx/dlgctl3d.hxx b/include/svx/dlgctl3d.hxx
index c6f5315..669154b 100644
--- a/include/svx/dlgctl3d.hxx
+++ b/include/svx/dlgctl3d.hxx
@@ -66,8 +66,6 @@ public:
 class SVX_DLLPUBLIC SAL_WARN_UNUSED Svx3DLightControl : public Svx3DPreviewControl
 {
     // Callback for interactive changes
-    Link<>                      maUserInteractiveChangeCallback;
-    Link<>                      maUserSelectionChangeCallback;
     Link<>                      maChangeCallback;
     Link<>                      maSelectionChangeCallback;
 
diff --git a/include/svx/fontworkgallery.hxx b/include/svx/fontworkgallery.hxx
index b415f35..f570f82 100644
--- a/include/svx/fontworkgallery.hxx
+++ b/include/svx/fontworkgallery.hxx
@@ -68,7 +68,6 @@ class SVX_DLLPUBLIC SAL_WARN_UNUSED FontWorkGalleryDialog : public ModalDialog
     sal_uInt16          mnThemeId;
 
     SdrView*            mpSdrView;
-    FmFormModel*        mpModel;
 
     DECL_LINK( DoubleClickFavoriteHdl, void * );
     DECL_LINK( ClickOKHdl, void * );
diff --git a/include/svx/pagectrl.hxx b/include/svx/pagectrl.hxx
index 3d7475b..7fb124a 100644
--- a/include/svx/pagectrl.hxx
+++ b/include/svx/pagectrl.hxx
@@ -68,9 +68,6 @@ private:
 
     sal_uInt16 eUsage;
 
-    OUString aLeftText;
-    OUString aRightText;
-
 protected:
     virtual void Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect) SAL_OVERRIDE;
 
diff --git a/svx/source/accessibility/svxpixelctlaccessiblecontext.cxx b/svx/source/accessibility/svxpixelctlaccessiblecontext.cxx
index 5357656..70dab35 100644
--- a/svx/source/accessibility/svxpixelctlaccessiblecontext.cxx
+++ b/svx/source/accessibility/svxpixelctlaccessiblecontext.cxx
@@ -482,19 +482,11 @@ void SvxPixelCtlAccessible::NotifyChild(long nIndex,bool bSelect ,bool bCheck)
 
 uno::Reference<XAccessible> SvxPixelCtlAccessible::CreateChild (long nIndex,Point mPoint)
 {
-    long nX = mPoint.X();
-    long nY = mPoint.Y();
-    if( AllSettings::GetLayoutRTL())
-    {
-        nX = (sal_uInt16) mrPixelCtl.GetWidth() - 1 - nX;
-    }
-
     bool bPixelColorOrBG = mrPixelCtl.GetBitmapPixel(sal_uInt16(nIndex)) != 0;
     Size size(mrPixelCtl.GetWidth() / mrPixelCtl.GetLineCount(),mrPixelCtl.GetHeight() / mrPixelCtl.GetLineCount());
     uno::Reference<XAccessible> xChild;
     xChild = new SvxPixelCtlAccessibleChild(mrPixelCtl,
                 bPixelColorOrBG,
-                Point(nX,nY),
                 Rectangle(mPoint,size),
                 this,
                 nIndex);
@@ -557,7 +549,6 @@ void SvxPixelCtlAccessibleChild::FireAccessibleEvent (
 SvxPixelCtlAccessibleChild::SvxPixelCtlAccessibleChild(
     SvxPixelCtl& rWindow,
     bool bPixelColorOrBG,
-    const Point &aPoint,
     const Rectangle& rBoundingBox,
     const uno::Reference<XAccessible>&  rxParent,
     long nIndexInParent ) :
@@ -565,7 +556,6 @@ SvxPixelCtlAccessibleChild::SvxPixelCtlAccessibleChild(
     mrParentWindow( rWindow ),
     mxParent(rxParent),
     m_bPixelColorOrBG(bPixelColorOrBG),
-    maPoint(aPoint),
     mpBoundingBox( new Rectangle( rBoundingBox ) ),
     mnIndexInParent( nIndexInParent ),
     mnClientId( 0 )
diff --git a/svx/source/dialog/dlgctl3d.cxx b/svx/source/dialog/dlgctl3d.cxx
index b4b8bea..37d0b6e 100644
--- a/svx/source/dialog/dlgctl3d.cxx
+++ b/svx/source/dialog/dlgctl3d.cxx
@@ -252,8 +252,6 @@ void Svx3DPreviewControl::Set3DAttributes( const SfxItemSet& rAttr )
 
 Svx3DLightControl::Svx3DLightControl(vcl::Window* pParent, WinBits nStyle)
 :   Svx3DPreviewControl(pParent, nStyle),
-    maUserInteractiveChangeCallback(),
-    maUserSelectionChangeCallback(),
     maChangeCallback(),
     maSelectionChangeCallback(),
     maSelectedLight(NO_LIGHT_SELECTED),
diff --git a/svx/source/dialog/pagectrl.cxx b/svx/source/dialog/pagectrl.cxx
index ed61268..2e73bef 100644
--- a/svx/source/dialog/pagectrl.cxx
+++ b/svx/source/dialog/pagectrl.cxx
@@ -73,10 +73,7 @@ SvxPageWindow::SvxPageWindow(vcl::Window* pParent)
     bTable(false),
     bHorz(false),
     bVert(false),
-    eUsage(SVX_PAGE_ALL),
-
-    aLeftText(),
-    aRightText()
+    eUsage(SVX_PAGE_ALL)
 {
     // Count in Twips by default
     SetMapMode(MapMode(MAP_TWIP));
diff --git a/svx/source/inc/svxpixelctlaccessiblecontext.hxx b/svx/source/inc/svxpixelctlaccessiblecontext.hxx
index c64309a..c67ad53 100644
--- a/svx/source/inc/svxpixelctlaccessiblecontext.hxx
+++ b/svx/source/inc/svxpixelctlaccessiblecontext.hxx
@@ -71,7 +71,6 @@ class SvxPixelCtlAccessibleChild :
     SvxPixelCtl& mrParentWindow;
     ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > mxParent;
     bool m_bPixelColorOrBG;//Pixel Color Or BackGround Color
-    Point maPoint;
     Rectangle*  mpBoundingBox;
     /// index of child in parent
     long                                mnIndexInParent;
@@ -81,7 +80,6 @@ public:
     SvxPixelCtlAccessibleChild(
                 SvxPixelCtl& rWindow,
                 bool bPixelColorOrBG,
-                const Point& aPoint,
                 const Rectangle& rBounds,
                 const ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible >& xParent,
                 long nIndexInParent );
diff --git a/svx/source/sidebar/graphic/GraphicPropertyPanel.hxx b/svx/source/sidebar/graphic/GraphicPropertyPanel.hxx
index 87064e0..f2b6260 100644
--- a/svx/source/sidebar/graphic/GraphicPropertyPanel.hxx
+++ b/svx/source/sidebar/graphic/GraphicPropertyPanel.hxx
@@ -84,11 +84,6 @@ private:
     ::sfx2::sidebar::ControllerItem                     maGammaControl;
     ::sfx2::sidebar::ControllerItem                     maModeControl;
 
-    OUString                                            msNormal;
-    OUString                                            msBW;
-    OUString                                            msGray;
-    OUString                                            msWater;
-
     css::uno::Reference<css::frame::XFrame>                 mxFrame;
     SfxBindings*                                        mpBindings;
 
diff --git a/svx/source/tbxctrls/fontworkgallery.cxx b/svx/source/tbxctrls/fontworkgallery.cxx
index 191c9a8..aefc47d 100644
--- a/svx/source/tbxctrls/fontworkgallery.cxx
+++ b/svx/source/tbxctrls/fontworkgallery.cxx
@@ -73,7 +73,6 @@ FontWorkGalleryDialog::FontWorkGalleryDialog( SdrView* pSdrView, vcl::Window* pP
         ModalDialog(pParent, "FontworkGalleryDialog", "svx/ui/fontworkgallerydialog.ui" ),
         mnThemeId           ( 0xffff ),
         mpSdrView           ( pSdrView ),
-        mpModel             ( static_cast<FmFormModel*>(pSdrView->GetModel()) ),
         mppSdrObject        ( NULL ),
         mpDestModel         ( NULL )
 {
commit 6c853a986444294dd937cd570a4dc0a31943e432
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date:   Fri Jul 24 16:54:44 2015 +0900

    Add "styles" template folder + content to installation
    
    Change-Id: Ibb674e17eedfc325d3e335aa074391ad7b2b2aa2

diff --git a/scp2/source/ooo/directory_ooo.scp b/scp2/source/ooo/directory_ooo.scp
index 1337098..0f76c94 100644
--- a/scp2/source/ooo/directory_ooo.scp
+++ b/scp2/source/ooo/directory_ooo.scp
@@ -588,6 +588,11 @@ Directory gid_Dir_Template_Common_Presnt
     DosName = "presnt";
 End
 
+Directory gid_Dir_Template_Common_Styles
+    ParentID = gid_Dir_Template_Common;
+    DosName = "styles";
+End
+
 Directory gid_Brand_Dir_Program_Services
 #if defined MACOSX
     ParentID = gid_Brand_Dir_Share;
diff --git a/scp2/source/ooo/file_extra_ooo.scp b/scp2/source/ooo/file_extra_ooo.scp
index c2cc985..f56c028 100644
--- a/scp2/source/ooo/file_extra_ooo.scp
+++ b/scp2/source/ooo/file_extra_ooo.scp
@@ -192,6 +192,13 @@ File gid_File_Extra_Tplpresnt
     Name = "extras_tplpresnt.filelist";
 End
 
+File gid_File_Extra_Tpl_styles
+    Dir = FILELIST_DIR;
+    TXT_FILE_BODY;
+    Styles = (FILELIST);
+    Name = "extras_tpl_styles.filelist";
+End
+
 File gid_File_Extra_Tplpersonal
     Dir = FILELIST_DIR;
     TXT_FILE_BODY;
diff --git a/scp2/source/ooo/module_ooo.scp b/scp2/source/ooo/module_ooo.scp
index 50066d3..9acfbe8 100644
--- a/scp2/source/ooo/module_ooo.scp
+++ b/scp2/source/ooo/module_ooo.scp
@@ -80,6 +80,7 @@ Module gid_Module_Root
              gid_File_Extra_Tplofficorr,
              gid_File_Extra_Tploffimisc,
              gid_File_Extra_Tplpresnt,
+             gid_File_Extra_Tpl_styles,
              gid_File_Extra_Tplpersonal,
              gid_File_Extra_Tplwizbitmap,
              gid_File_Extra_Tplwizletter,
commit 1c28c59f927361ef85c8aea8b575d274c532a34d
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date:   Fri Jul 24 16:08:01 2015 +0900

    opengl: don't cache checkboxes for now
    
    Change-Id: I67d0dcb48d1843587abbc1dc0f7da1f8057b281e

diff --git a/vcl/opengl/x11/gdiimpl.cxx b/vcl/opengl/x11/gdiimpl.cxx
index 2114419..bf5e6f6 100644
--- a/vcl/opengl/x11/gdiimpl.cxx
+++ b/vcl/opengl/x11/gdiimpl.cxx
@@ -238,8 +238,15 @@ bool X11OpenGLSalGraphicsImpl::RenderAndCacheNativeControl(X11Pixmap* pPixmap, X
 {
     std::unique_ptr<TextureCombo> pCombo(new TextureCombo);
     bool bResult = RenderPixmap(pPixmap, pMask, nX, nY, *pCombo);
+    if (!bResult)
+        return false;
+
+    if (aControlCacheKey.mnType == CTRL_CHECKBOX)
+        return true;
+
     ControlCachePair pair(aControlCacheKey, std::move(pCombo));
     gTextureCache.insert(std::move(pair));
+
     return bResult;
 }
 
commit 3bc00eca4acf9dfc3b2834077cee552f32c8f107
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date:   Fri Jul 24 14:19:35 2015 +0900

    Use LRU map for caching of native widgets
    
    Change-Id: Ia0423dac5309aabc5e81357cf4f67b5ee14bab31

diff --git a/vcl/opengl/x11/gdiimpl.cxx b/vcl/opengl/x11/gdiimpl.cxx
index 3890b64..2114419 100644
--- a/vcl/opengl/x11/gdiimpl.cxx
+++ b/vcl/opengl/x11/gdiimpl.cxx
@@ -25,6 +25,8 @@
 #include <vcl/opengl/OpenGLContext.hxx>
 #include <vcl/opengl/OpenGLHelper.hxx>
 
+#include <o3tl/lru_map.hxx>
+
 X11OpenGLSalGraphicsImpl::X11OpenGLSalGraphicsImpl( X11SalGraphics& rParent ):
     OpenGLSalGraphicsImpl(rParent,rParent.GetGeometryProvider()),
     mrParent(rParent)
@@ -117,9 +119,10 @@ struct TextureCombo
     std::unique_ptr<OpenGLTexture> mpMask;
 };
 
-typedef std::unordered_map<ControlCacheKey, std::unique_ptr<TextureCombo>, ControlCacheHashFunction> ControlCacheType;
+typedef typename std::pair<ControlCacheKey, std::unique_ptr<TextureCombo>> ControlCachePair;
+typedef o3tl::lru_map<ControlCacheKey, std::unique_ptr<TextureCombo>, ControlCacheHashFunction> ControlCacheType;
 
-ControlCacheType gTextureCache;
+ControlCacheType gTextureCache(200);
 
 bool X11OpenGLSalGraphicsImpl::RenderPixmap(X11Pixmap* pPixmap, X11Pixmap* pMask, int nX, int nY, TextureCombo& rCombo)
 {
@@ -235,7 +238,8 @@ bool X11OpenGLSalGraphicsImpl::RenderAndCacheNativeControl(X11Pixmap* pPixmap, X
 {
     std::unique_ptr<TextureCombo> pCombo(new TextureCombo);
     bool bResult = RenderPixmap(pPixmap, pMask, nX, nY, *pCombo);
-    gTextureCache[aControlCacheKey] = std::move(pCombo);
+    ControlCachePair pair(aControlCacheKey, std::move(pCombo));
+    gTextureCache.insert(std::move(pair));
     return bResult;
 }
 
commit 80a92134806a876287818530eb61c6bb536a05f9
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date:   Fri Jul 24 13:39:22 2015 +0900

    LRU map (cache) implementation to o3tl + tests
    
    Change-Id: I6b1a39918e6c8c67712be2c8e9907266dcfefedb

diff --git a/include/o3tl/lru_map.hxx b/include/o3tl/lru_map.hxx
new file mode 100644
index 0000000..6d3b725
--- /dev/null
+++ b/include/o3tl/lru_map.hxx
@@ -0,0 +1,141 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ */
+
+#ifndef INCLUDED_O3TL_LRU_MAP_HXX
+#define INCLUDED_O3TL_LRU_MAP_HXX
+
+#include <list>
+#include <unordered_map>
+
+namespace o3tl
+{
+
+/** LRU map
+ *
+ * Similar to unordered_map (it actually uses it) with additionaly functionality
+ * which removes the entries that have been "least recently used" when the size
+ * hits the specified capacity.
+ *
+ * It only implements the minimal methods needed and the implementation is NOT
+ * thread safe.
+ *
+ * The implementation is as simple as possible but it still uses O(1) complexity
+ * for most of the operations with a combination unordered map and linked list.
+ *
+ **/
+template<typename Key, typename Value, class KeyHash = std::hash<Key>>
+class lru_map SAL_FINAL
+{
+private:
+    typedef typename std::pair<Key, Value> key_value_pair_t;
+    typedef std::list<key_value_pair_t> list_t;
+    typedef typename list_t::iterator list_iterator_t;
+    typedef typename list_t::const_iterator list_const_iterator_t;
+
+    typedef std::unordered_map<Key, list_iterator_t, KeyHash> map_t;
+    typedef typename map_t::iterator map_iterator_t;
+    typedef typename map_t::const_iterator map_const_iterator_t;
+
+    list_t mLruList;
+    map_t mLruMap;
+    const size_t mMaxSize;
+
+    inline void checkLRU()
+    {
+        if (mLruMap.size() > mMaxSize)
+        {
+            // remove from map
+            mLruMap.erase(mLruList.back().first);
+            // remove from list
+            mLruList.pop_back();
+        }
+    }
+public:
+    typedef list_iterator_t iterator;
+    typedef list_const_iterator_t const_iterator;
+
+    lru_map(size_t nMaxSize)
+        : mMaxSize(nMaxSize)
+    {}
+
+    void insert(key_value_pair_t& rPair)
+    {
+        map_iterator_t iterator = mLruMap.find(rPair.first);
+
+        if (iterator == mLruMap.end()) // doesn't exist -> add to queue and map
+        {
+            // add to front of the list
+            mLruList.push_front(rPair);
+            // add the list position (iterator) to the map
+            mLruMap[rPair.first] = mLruList.begin();
+            checkLRU();
+        }
+        else // already exists -> replace value
+        {
+            // replace value
+            iterator->second->second = rPair.second;
+            // bring to front of the lru list
+            mLruList.splice(mLruList.begin(), mLruList, iterator->second);
+        }
+    }
+
+    void insert(key_value_pair_t&& rPair)
+    {
+        map_iterator_t iterator = mLruMap.find(rPair.first);
+
+        if (iterator == mLruMap.end()) // doesn't exist -> add to list and map
+        {
+            // add to front of the list
+            mLruList.push_front(std::move(rPair));
+            // add the list position (iterator) to the map
+            mLruMap[rPair.first] = mLruList.begin();
+            checkLRU();
+        }
+        else // already exists -> replace value
+        {
+            // replace value
+            iterator->second->second = std::move(rPair.second);
+            // push to back of the lru list
+            mLruList.splice(mLruList.begin(), mLruList, iterator->second);
+        }
+    }
+
+    const list_const_iterator_t find(const Key& key)
+    {
+        const map_iterator_t iterator = mLruMap.find(key);
+        if (iterator == mLruMap.cend()) // can't find entry for the key
+        {
+            // return empty iterator
+            return mLruList.cend();
+        }
+        else
+        {
+            // push to back of the lru list
+            mLruList.splice(mLruList.begin(), mLruList, iterator->second);
+            return iterator->second;
+        }
+    }
+
+    const list_const_iterator_t end() const
+    {
+        return mLruList.end();
+    }
+
+    size_t size() const
+    {
+        return mLruList.size();
+    }
+};
+
+}
+
+#endif /* INCLUDED_O3TL_LRU_MAP_HXX */
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/o3tl/CppunitTest_o3tl_tests.mk b/o3tl/CppunitTest_o3tl_tests.mk
index 66f2951..c8f8f6b 100644
--- a/o3tl/CppunitTest_o3tl_tests.mk
+++ b/o3tl/CppunitTest_o3tl_tests.mk
@@ -33,6 +33,7 @@ $(eval $(call gb_CppunitTest_add_exception_objects,o3tl_tests,\
 	o3tl/qa/test-vector_pool \
 	o3tl/qa/test-sorted_vector \
 	o3tl/qa/test-typed_flags \
+	o3tl/qa/test-lru_map \
 ))
 
 # vim: set noet sw=4:
diff --git a/o3tl/qa/test-lru_map.cxx b/o3tl/qa/test-lru_map.cxx
new file mode 100644
index 0000000..d9428e3
--- /dev/null
+++ b/o3tl/qa/test-lru_map.cxx
@@ -0,0 +1,239 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ */
+
+#include <sal/types.h>
+#include "cppunit/TestAssert.h"
+#include "cppunit/TestFixture.h"
+#include "cppunit/extensions/HelperMacros.h"
+
+#include <o3tl/lru_map.hxx>
+
+#include <boost/functional/hash.hpp>
+
+using namespace ::o3tl;
+
+class lru_map_test : public CppUnit::TestFixture
+{
+public:
+    void testBaseUsage();
+    void testReplaceKey();
+    void testReplaceValue();
+    void testLruRemoval();
+    void testCustomHash();
+
+    CPPUNIT_TEST_SUITE(lru_map_test);
+    CPPUNIT_TEST(testBaseUsage);
+    CPPUNIT_TEST(testReplaceKey);
+    CPPUNIT_TEST(testReplaceValue);
+    CPPUNIT_TEST(testLruRemoval);
+    CPPUNIT_TEST(testCustomHash);
+    CPPUNIT_TEST_SUITE_END();
+};
+
+void lru_map_test::testBaseUsage()
+{
+    o3tl::lru_map<int, int> lru(10);
+    lru.insert(std::make_pair<int, int>(1, 1));
+
+    std::pair<int, int> pair;
+    for (int i = 2; i < 7; i++)
+    {
+        pair.first = pair.second = i;
+        lru.insert(pair);
+    }
+
+    CPPUNIT_ASSERT_EQUAL(size_t(6), lru.size());
+
+    o3tl::lru_map<int, int>::const_iterator it;
+
+    it = lru.find(2);
+    CPPUNIT_ASSERT(it != lru.end());
+    CPPUNIT_ASSERT_EQUAL(2, it->second);
+
+    it = lru.find(5);
+    CPPUNIT_ASSERT(it != lru.end());
+    CPPUNIT_ASSERT_EQUAL(5, it->second);
+
+    it = lru.find(0);
+    CPPUNIT_ASSERT(it == lru.end());
+}
+
+void lru_map_test::testReplaceValue()
+{
+    o3tl::lru_map<int, int> lru(2);
+    // check if map is empty
+    CPPUNIT_ASSERT_EQUAL(size_t(0), lru.size());
+
+    // check if inserting entry with with same key replaces the value
+
+    // inserting new entry
+    lru.insert(std::make_pair<int, int>(1, 2));
+    CPPUNIT_ASSERT_EQUAL(size_t(1), lru.size());
+    CPPUNIT_ASSERT_EQUAL(2, lru.find(1)->second);
+
+    // inserting new entry with key that alreay exists
+    lru.insert(std::make_pair<int, int>(1, 4));
+    CPPUNIT_ASSERT_EQUAL(size_t(1), lru.size());
+    CPPUNIT_ASSERT_EQUAL(4, lru.find(1)->second);
+
+    // inserting new entry
+    lru.insert(std::make_pair<int, int>(2, 200));
+    CPPUNIT_ASSERT_EQUAL(size_t(2), lru.size());
+    CPPUNIT_ASSERT_EQUAL(4, lru.find(1)->second);
+    CPPUNIT_ASSERT_EQUAL(200, lru.find(2)->second);
+
+    // check if insert with same key, moves the entry back of the lru queu
+
+    // inserting new entry with key that alreay exists
+    lru.insert(std::make_pair<int, int>(1, 6));
+    // inserting new entry, lru removed
+    lru.insert(std::make_pair<int, int>(3, 300));
+
+    CPPUNIT_ASSERT_EQUAL(size_t(2), lru.size());
+    CPPUNIT_ASSERT_EQUAL(6, lru.find(1)->second);
+    CPPUNIT_ASSERT_EQUAL(300, lru.find(3)->second);
+
+}
+
+void lru_map_test::testReplaceKey()
+{
+    o3tl::lru_map<int, int> lru(2);
+
+    // inserting new entry
+    lru.insert(std::make_pair<int, int>(1, 100));
+    CPPUNIT_ASSERT_EQUAL(size_t(1), lru.size());
+    CPPUNIT_ASSERT_EQUAL(100, lru.find(1)->second);
+    CPPUNIT_ASSERT(lru.find(2) == lru.end());
+    CPPUNIT_ASSERT(lru.find(3) == lru.end());
+
+    // inserting new entry
+    lru.insert(std::make_pair<int, int>(2, 200));

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list