diff options
author | Szymon Kłos <eszkadev@gmail.com> | 2015-07-13 12:01:12 +0200 |
---|---|---|
committer | Szymon Kłos <eszkadev@gmail.com> | 2015-07-16 09:53:50 +0200 |
commit | 1abade4f92a6d1c70ab3e333770e1cb242f29063 (patch) | |
tree | 965b4b69956053b0d5363fa17a4e1130bd2386b8 /svtools/source/dialogs | |
parent | 1c25093f8abf518e9983b9d23f6f3964001a1aac (diff) |
moved the FolderTree class
Change-Id: I3231b32d3e3ade7dc3b366f03d6e189f5bc4d431
Diffstat (limited to 'svtools/source/dialogs')
-rw-r--r-- | svtools/source/dialogs/RemoteFilesDialog.cxx | 113 |
1 files changed, 0 insertions, 113 deletions
diff --git a/svtools/source/dialogs/RemoteFilesDialog.cxx b/svtools/source/dialogs/RemoteFilesDialog.cxx index 41391e72528d..2eea4599ff2c 100644 --- a/svtools/source/dialogs/RemoteFilesDialog.cxx +++ b/svtools/source/dialogs/RemoteFilesDialog.cxx @@ -8,119 +8,6 @@ */ #include <svtools/RemoteFilesDialog.hxx> -#include "../contnr/contentenumeration.hxx" - -class FolderTree : public SvTreeListBox -{ -private: - Reference< XCommandEnvironment > m_xEnv; - ::osl::Mutex m_aMutex; - Sequence< OUString > m_aBlackList; - Image m_aFolderImage; - -public: - FolderTree( vcl::Window* pParent, WinBits nBits ) - : SvTreeListBox( pParent, nBits | WB_SORT | WB_TABSTOP ) - , m_aFolderImage( SvtResId( IMG_SVT_FOLDER ) ) - { - Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext(); - Reference< XInteractionHandler > xInteractionHandler( - InteractionHandler::createWithParent( xContext, 0 ), UNO_QUERY_THROW ); - m_xEnv = new ::ucbhelper::CommandEnvironment( xInteractionHandler, Reference< XProgressHandler >() ); - - SetDefaultCollapsedEntryBmp( m_aFolderImage ); - SetDefaultExpandedEntryBmp( m_aFolderImage ); - } - - virtual void RequestingChildren( SvTreeListEntry* pEntry ) - { - FillTreeEntry( pEntry ); - } - - void FillTreeEntry( SvTreeListEntry* pEntry ) - { - // fill only empty entries - if( pEntry && GetChildCount( pEntry ) == 0 ) - { - ::std::vector< SortingData_Impl* > aContent; - - FileViewContentEnumerator* pContentEnumerator = new FileViewContentEnumerator( - m_xEnv, aContent, m_aMutex, NULL ); - - OUString* pURL = static_cast< OUString* >( pEntry->GetUserData() ); - - if( pURL ) - { - FolderDescriptor aFolder( *pURL ); - - EnumerationResult eResult = - pContentEnumerator->enumerateFolderContentSync( aFolder, m_aBlackList ); - - if ( SUCCESS == eResult ) - { - for( unsigned int i = 0; i < aContent.size(); i++ ) - { - if( aContent[i]->mbIsFolder ) - { - SvTreeListEntry* pNewEntry = InsertEntry( aContent[i]->GetTitle(), pEntry, true ); - - OUString* sData = new OUString( aContent[i]->maTargetURL ); - pNewEntry->SetUserData( static_cast< void* >( sData ) ); - } - } - } - } - } - } - - void SetTreePath( OUString sUrl ) - { - INetURLObject aUrl( sUrl ); - aUrl.setFinalSlash(); - - OUString sPath = aUrl.GetURLPath( INetURLObject::DECODE_WITH_CHARSET ); - - SvTreeListEntry* pEntry = First(); - bool end = false; - - while( pEntry && !end ) - { - if( pEntry->GetUserData() ) - { - OUString sNodeUrl = *static_cast< OUString* >( pEntry->GetUserData() ); - - INetURLObject aUrlObj( sNodeUrl ); - aUrlObj.setFinalSlash(); - - sNodeUrl = aUrlObj.GetURLPath( INetURLObject::DECODE_WITH_CHARSET ); - - if( sPath == sNodeUrl ) - { - Select( pEntry ); - end = true; - } - else if( sPath.startsWith( sNodeUrl ) ) - { - if( !IsExpanded( pEntry ) ) - Expand( pEntry ); - - pEntry = FirstChild( pEntry ); - } - else - { - pEntry = NextSibling( pEntry ); - } - } - else - break; - } - } - - void SetBlackList( const ::com::sun::star::uno::Sequence< OUString >& rBlackList ) - { - m_aBlackList = rBlackList; - } -}; class FileViewContainer : public vcl::Window { |