diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2013-05-14 19:07:34 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2013-05-14 19:14:34 +0200 |
commit | 03535b91605ae0cfdf3be5eb2dfdf5de5374bdb2 (patch) | |
tree | 20d1abc873bd805b28d94004f6d20874b5fc4721 /fpicker | |
parent | 09c20b2f623e2271a3ab9eb82c2419a8951320c1 (diff) |
Remove obsolete RestrictedPath env var support
Change-Id: Ia4ea7d60d7b69c863c1e891887060265e73e1cb6
Diffstat (limited to 'fpicker')
-rw-r--r-- | fpicker/source/office/iodlg.cxx | 25 | ||||
-rw-r--r-- | fpicker/source/office/iodlg.hxx | 17 | ||||
-rw-r--r-- | fpicker/source/office/iodlgimp.cxx | 32 |
3 files changed, 15 insertions, 59 deletions
diff --git a/fpicker/source/office/iodlg.cxx b/fpicker/source/office/iodlg.cxx index 6787f8da947b..1ed7a8c6db89 100644 --- a/fpicker/source/office/iodlg.cxx +++ b/fpicker/source/office/iodlg.cxx @@ -508,7 +508,6 @@ void SvtFileDialog::Init_Impl _pImp->_pFtFileName = new FixedText( this, SvtResId( FT_EXPLORERFILE_FILENAME ) ); SvtURLBox* pURLBox = new SvtURLBox( this, SvtResId( ED_EXPLORERFILE_FILENAME ) ); - pURLBox->SetUrlFilter( &m_aURLFilter ); _pImp->_pEdFileName = pURLBox; _pImp->_pEdFileName->Show(); pURLBox->SetSelectHdl( LINK( this, SvtFileDialog, EntrySelectHdl_Impl ) ); @@ -545,7 +544,6 @@ void SvtFileDialog::Init_Impl } _pImp->_pEdCurrentPath = new SvtURLBox( this, SvtResId(ED_EXPLORERFILE_CURRENTPATH) ); - _pImp->_pEdCurrentPath->SetUrlFilter( &m_aURLFilter ); _pImp->_pEdCurrentPath->Show(); _pImp->_pBtnFileOpen = new PushButton( this, SvtResId( BTN_EXPLORERFILE_OPEN ) ); @@ -568,7 +566,6 @@ void SvtFileDialog::Init_Impl _pFileView = new SvtFileView( this, SvtResId( CTL_EXPLORERFILE_FILELIST ), FILEDLG_TYPE_PATHDLG == _pImp->_eDlgType, _pImp->_bMultiSelection ); - _pFileView->SetUrlFilter( &m_aURLFilter ); _pFileView->EnableAutoResize(); _pFileView->SetHelpId( HID_FILEDLG_STANDARD ); @@ -1141,12 +1138,6 @@ IMPL_STATIC_LINK( SvtFileDialog, OpenHdl_Impl, void*, pVoid ) { if ( aFileName != pThis->_pFileView->GetViewURL() ) { - if ( !pThis->m_aURLFilter.isUrlAllowed( aFileName ) ) - { - pThis->simulateAccessDenied( aFileName ); - return 0; - } - pThis->OpenURL_Impl( aFileName ); } else @@ -1178,13 +1169,6 @@ IMPL_STATIC_LINK( SvtFileDialog, OpenHdl_Impl, void*, pVoid ) return 0; } - // if restrictions for the allowed folders are in place, we need to do a check here - if ( !pThis->m_aURLFilter.isUrlAllowed( aFileObj.GetMainURL( INetURLObject::NO_DECODE ) ) ) - { - pThis->simulateAccessDenied( aFileName ); - return 0; - } - switch ( pThis->_pImp->_eMode ) { case FILEDLG_MODE_SAVE: @@ -1669,7 +1653,7 @@ IMPL_LINK( SvtFileDialog, OpenDoneHdl_Impl, SvtFileView*, pView ) { String sCurrentFolder( pView->GetViewURL() ); // check if we can create new folders - EnableControl( _pImp->_pBtnNewFolder, ContentCanMakeFolder( sCurrentFolder ) && m_aURLFilter.isUrlAllowed( sCurrentFolder, false ) ); + EnableControl( _pImp->_pBtnNewFolder, ContentCanMakeFolder( sCurrentFolder ) ); // check if we can travel one level up bool bCanTravelUp = ContentHasParentFolder( pView->GetViewURL() ); @@ -1681,7 +1665,6 @@ IMPL_LINK( SvtFileDialog, OpenDoneHdl_Impl, SvtFileView*, pView ) "SvtFileDialog::OpenDoneHdl_Impl: invalid current URL!" ); aCurrentFolder.removeSegment(); - bCanTravelUp &= m_aURLFilter.isUrlAllowed( aCurrentFolder.GetMainURL( INetURLObject::NO_DECODE ) ); } EnableControl( _pImp->_pBtnUp, bCanTravelUp ); @@ -2131,11 +2114,6 @@ short SvtFileDialog::PrepareExecute() // - finally we're going to save that file, aren't we? m_aContent.enableOwnInteractionHandler(::svt::OFilePickerInteractionHandler::E_DOESNOTEXIST); - //..................................................................... - // care for possible restrictions on the paths we're allowed to show - if ( !m_aURLFilter.isUrlAllowed( _aPath ) ) - _aPath = m_aURLFilter.getFilter()[0]; - // if applicable show filter _pImp->InitFilterList(); @@ -2327,7 +2305,6 @@ void SvtFileDialog::OpenURL_Impl( const String& _rURL ) { _pFileView->EndInplaceEditing( false ); - DBG_ASSERT( m_aURLFilter.isUrlAllowed( _rURL ), "SvtFileDialog::OpenURL_Impl: forbidden URL! Should have been handled by the caller!" ); executeAsync( AsyncPickerAction::eOpenURL, _rURL, getMostCurrentFilter( _pImp ) ); } diff --git a/fpicker/source/office/iodlg.hxx b/fpicker/source/office/iodlg.hxx index 21a2afd27ee7..208517a7b196 100644 --- a/fpicker/source/office/iodlg.hxx +++ b/fpicker/source/office/iodlg.hxx @@ -34,8 +34,6 @@ #include <com/sun/star/ui/dialogs/XDialogClosedListener.hpp> #include <unotools/confignode.hxx> #include "svl/inettype.hxx" -#include "svl/urlfilter.hxx" -#include <svl/restrictedpaths.hxx> #include "asyncfilepicker.hxx" #include "OfficeControlAccess.hxx" #include "fpsmartcontent.hxx" @@ -105,7 +103,6 @@ private: ImageList m_aImages; ::svt::SmartContent m_aContent; - ::svt::RestrictedPaths m_aURLFilter; ::std::set< Control* > m_aDisabledControls; ::utl::OConfigurationNode m_aConfiguration; @@ -262,10 +259,6 @@ public: void RemovablePlaceSelected(bool enable = true); void displayIOException( const String& _rURL, ::com::sun::star::ucb::IOErrorCode _eCode ); - void simulateAccessDenied( const String& _rURL ) - { - displayIOException( _rURL, ::com::sun::star::ucb::IOErrorCode_ACCESS_DENIED ); - } // originally from VclFileDialog virtual sal_Bool AddControl( Window* pControl, sal_Bool bNewLine = sal_False ); @@ -298,16 +291,6 @@ public: */ void updateListboxLabelSizes(); - /** checks URL access permissions - - <p>with the "restriction" feature we have in the file dialog, it's possible that - only certain URLs can be browsed. This method checks whether a given URL belongs - to this set of permitted URLs.</p> - - <p>If no "access restriction" is effective, this method always returns <TRUE/>.</p> - */ - inline bool isUrlAllowed( const String& _rURL ) const { return m_aURLFilter.isUrlAllowed( _rURL ); } - private: SvtFileDialogFilter_Impl* implAddFilter( const String& _rFilter, const String& _rType ); diff --git a/fpicker/source/office/iodlgimp.cxx b/fpicker/source/office/iodlgimp.cxx index 7848df7f9970..310f5013de92 100644 --- a/fpicker/source/office/iodlgimp.cxx +++ b/fpicker/source/office/iodlgimp.cxx @@ -182,26 +182,22 @@ void SvtUpButton_Impl::FillURLMenu( PopupMenu* _pMenu ) aObject.removeSegment(); String aParentURL(aObject.GetMainURL(INetURLObject::NO_DECODE)); - if (GetDialogParent()->isUrlAllowed(aParentURL)) + String aTitle; + // 97148# -------------------------------- + if (!GetDialogParent()->ContentGetTitle(aParentURL, aTitle) || aTitle.Len() == 0) + aTitle = aObject.getName(); + + Image aImage = ( nCount > 1 ) // if nCount == 1 means workplace, which detects the wrong image + ? SvFileInformationManager::GetImage( aObject ) : aVolumeImage; + + _pMenu->InsertItem( nItemId++, aTitle, aImage ); + _aURLs.push_back(aParentURL); + + if ( nCount == 1 ) { - String aTitle; - // 97148# -------------------------------- - if (!GetDialogParent()->ContentGetTitle(aParentURL, aTitle) || aTitle.Len() == 0) - aTitle = aObject.getName(); - - Image aImage = ( nCount > 1 ) // if nCount == 1 means workplace, which detects the wrong image - ? SvFileInformationManager::GetImage( aObject ) : aVolumeImage; - - _pMenu->InsertItem( nItemId++, aTitle, aImage ); - _aURLs.push_back(aParentURL); - - if ( nCount == 1 ) - { - // adjust the title of the top level entry (the workspace) - _pMenu->SetItemText( --nItemId, SvtSimpleResId( STR_SVT_MIMETYPE_CNT_FSYSBOX ) ); - } + // adjust the title of the top level entry (the workspace) + _pMenu->SetItemText( --nItemId, SvtSimpleResId( STR_SVT_MIMETYPE_CNT_FSYSBOX ) ); } - --nCount; } } |