diff options
-rw-r--r-- | fpicker/source/office/iodlg.cxx | 43 | ||||
-rw-r--r-- | fpicker/source/office/iodlg.hxx | 29 | ||||
-rw-r--r-- | include/svtools/inettbc.hxx | 6 | ||||
-rw-r--r-- | sfx2/inc/inettbc.hxx | 2 | ||||
-rw-r--r-- | sfx2/source/inet/inettbc.cxx | 4 |
5 files changed, 39 insertions, 45 deletions
diff --git a/fpicker/source/office/iodlg.cxx b/fpicker/source/office/iodlg.cxx index 156d103142d7..bee5c608ce51 100644 --- a/fpicker/source/office/iodlg.cxx +++ b/fpicker/source/office/iodlg.cxx @@ -523,7 +523,7 @@ void SvtFileDialog::Init_Impl // Create control element, the order defines the tab control. _pImp->_pEdFileName->SetSelectHdl( LINK( this, SvtFileDialog, EntrySelectHdl_Impl ) ); - _pImp->_pEdFileName->SetOpenHdl( LINK( this, SvtFileDialog, OpenHdl_Impl ) ); + _pImp->_pEdFileName->SetOpenHdl( LINK( this, SvtFileDialog, OpenUrlHdl_Impl ) ); // in folder picker mode, only auto-complete directories (no files) bool bIsFolderPicker = ( _pImp->_eDlgType == FILEDLG_TYPE_PATHDLG ); @@ -832,13 +832,17 @@ IMPL_LINK_TYPED( SvtFileDialog, OpenClickHdl_Impl, Button*, pVoid, void ) { OpenHdl_Impl(pVoid); } -IMPL_LINK( SvtFileDialog, OpenHdl_Impl, void*, pVoid ) +IMPL_LINK_TYPED( SvtFileDialog, OpenUrlHdl_Impl, SvtURLBox*, pVoid, void ) +{ + OpenHdl_Impl(pVoid); +} +void SvtFileDialog::OpenHdl_Impl(void* pVoid) { if ( _pImp->_bMultiSelection && _pFileView->GetSelectionCount() > 1 ) { // special open in case of multiselection OpenMultiSelection_Impl(); - return 0; + return; } OUString aFileName; @@ -860,7 +864,7 @@ IMPL_LINK( SvtFileDialog, OpenHdl_Impl, void*, pVoid ) { if ( _pImp->_eMode == FILEDLG_MODE_OPEN && _pImp->_pEdFileName->IsTravelSelect() ) // OpenHdl called from URLBox; travelling through the list of URLs should not cause an opening - return 0; // MBA->PB: seems to be called never ?! + return; // MBA->PB: seems to be called never ?! // get the URL from the edit field ( if not empty ) if ( !_pImp->_pEdFileName->GetText().isEmpty() ) @@ -873,7 +877,7 @@ IMPL_LINK( SvtFileDialog, OpenHdl_Impl, void*, pVoid ) if ( ( aText.getLength() == 2 && aText == ".." ) || ( aText.getLength() == 3 && ( aText == "..\\" || aText == "../" ) ) ) // don't go higher than the root - return 0; + return; } #if defined( UNX ) @@ -891,7 +895,7 @@ IMPL_LINK( SvtFileDialog, OpenHdl_Impl, void*, pVoid ) aFileName = _pImp->_pEdFileName->GetURL(); } } - else if ( pVoid == _pImp->_pBtnFileOpen ) + else if ( pVoid == _pImp->_pBtnFileOpen.get() ) // OpenHdl was called for the "Open" Button; if edit field is empty, use selected element in the view aFileName = _pFileView->GetCurrentURL(); } @@ -900,7 +904,7 @@ IMPL_LINK( SvtFileDialog, OpenHdl_Impl, void*, pVoid ) if ( aFileName.isEmpty() && pVoid == _pImp->_pEdFileName && _pImp->_pUserFilter ) { DELETEZ( _pImp->_pUserFilter ); - return 0; + return; } sal_Int32 nLen = aFileName.getLength(); @@ -914,7 +918,7 @@ IMPL_LINK( SvtFileDialog, OpenHdl_Impl, void*, pVoid ) } else // no file selected ! - return 0; + return; } // mark input as selected @@ -923,7 +927,7 @@ IMPL_LINK( SvtFileDialog, OpenHdl_Impl, void*, pVoid ) // if a path with wildcards is given, divide the string into path and wildcards OUString aFilter; if ( !SvtFileDialog::IsolateFilterFromPath_Impl( aFileName, aFilter ) ) - return 0; + return; // if a filter was retrieved, there were wildcards ! sal_uInt16 nNewFilterFlags = adjustFilter( aFilter ); @@ -976,7 +980,7 @@ IMPL_LINK( SvtFileDialog, OpenHdl_Impl, void*, pVoid ) OSL_ENSURE( pHandler, "Got no Interaction Handler!!!" ); if ( pHandler->wasAccessDenied() ) - return 0; + return; if ( m_aContent.isInvalid() && ( _pImp->_eMode == FILEDLG_MODE_OPEN ) ) @@ -984,7 +988,7 @@ IMPL_LINK( SvtFileDialog, OpenHdl_Impl, void*, pVoid ) if ( !pHandler->wasUsed() ) ErrorHandler::HandleError( ERRCODE_IO_NOTEXISTS ); - return 0; + return; } // restore previous Interaction Handler @@ -1032,7 +1036,7 @@ IMPL_LINK( SvtFileDialog, OpenHdl_Impl, void*, pVoid ) ExecuteFilter(); } - return 0; + return; } } else if ( !( nNewFilterFlags & FLT_NONEMPTY ) ) @@ -1045,14 +1049,14 @@ IMPL_LINK( SvtFileDialog, OpenHdl_Impl, void*, pVoid ) // if applicable filter again if ( nNewFilterFlags & FLT_CHANGED ) ExecuteFilter(); - return 0; + return; } INetURLObject aFileObj( aFileName ); if ( aFileObj.HasError() ) { ErrorHandler::HandleError( ERRCODE_IO_GENERAL ); - return 0; + return; } switch ( _pImp->_eMode ) @@ -1068,7 +1072,7 @@ IMPL_LINK( SvtFileDialog, OpenHdl_Impl, void*, pVoid ) ); ScopedVclPtrInstance< MessageDialog > aBox(this, aMsg, VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO); if ( aBox->Execute() != RET_YES ) - return 0; + return; } else { @@ -1082,7 +1086,7 @@ IMPL_LINK( SvtFileDialog, OpenHdl_Impl, void*, pVoid ) if ( !bFolder ) { ErrorHandler::HandleError( ERRCODE_IO_NOTEXISTSPATH ); - return 0; + return; } } } @@ -1113,7 +1117,7 @@ IMPL_LINK( SvtFileDialog, OpenHdl_Impl, void*, pVoid ) ScopedVclPtrInstance< MessageDialog > aError(this, sError); aError->Execute(); - return 0; + return; } } } @@ -1135,8 +1139,6 @@ IMPL_LINK( SvtFileDialog, OpenHdl_Impl, void*, pVoid ) { EndDialog( RET_OK ); } - - return nRet; } @@ -1245,11 +1247,10 @@ IMPL_LINK_NOARG( SvtFileDialog, FileNameModifiedHdl_Impl ) -IMPL_LINK_NOARG( SvtFileDialog, URLBoxModifiedHdl_Impl ) +IMPL_LINK_NOARG_TYPED( SvtFileDialog, URLBoxModifiedHdl_Impl, SvtURLBox*, void ) { OUString aPath = _pImp->_pEdCurrentPath->GetURL(); OpenURL_Impl(aPath); - return 0; } diff --git a/fpicker/source/office/iodlg.hxx b/fpicker/source/office/iodlg.hxx index f9950a0c05ea..41e8b88a95aa 100644 --- a/fpicker/source/office/iodlg.hxx +++ b/fpicker/source/office/iodlg.hxx @@ -43,17 +43,11 @@ #include <set> -// @@@ using namespace com::sun::star::ucb; - - class SvTabListBox; class SvtFileView; class SvtFileDialogFilter_Impl; - -// SvtFileDialog - - +class SvtURLBox; class SvtExpFileDlg_Impl; class CustomContainer; @@ -91,21 +85,22 @@ private: ::com::sun::star::uno::Reference < com::sun::star::uno::XComponentContext > m_context; DECL_LINK( FilterSelectHdl_Impl, void* ); - DECL_LINK_TYPED( FilterSelectTimerHdl_Impl, Timer*, void ); - DECL_LINK_TYPED( NewFolderHdl_Impl, Button*, void ); - DECL_LINK( OpenHdl_Impl, void* ); - DECL_LINK_TYPED( OpenClickHdl_Impl, Button*, void ); - DECL_LINK_TYPED( CancelHdl_Impl, Button*, void ); + DECL_LINK_TYPED( FilterSelectTimerHdl_Impl, Timer*, void ); + DECL_LINK_TYPED( NewFolderHdl_Impl, Button*, void ); + DECL_LINK_TYPED( OpenUrlHdl_Impl, SvtURLBox*, void ); + DECL_LINK_TYPED( OpenClickHdl_Impl, Button*, void ); + DECL_LINK_TYPED( CancelHdl_Impl, Button*, void ); DECL_LINK( FileNameGetFocusHdl_Impl, void* ); DECL_LINK( FileNameModifiedHdl_Impl, void* ); - DECL_LINK( URLBoxModifiedHdl_Impl, void* ); - DECL_LINK_TYPED( ConnectToServerPressed_Hdl, Button*, void ); + DECL_LINK_TYPED( URLBoxModifiedHdl_Impl, SvtURLBox*, void ); + DECL_LINK_TYPED( ConnectToServerPressed_Hdl, Button*, void ); - DECL_LINK_TYPED( AddPlacePressed_Hdl, Button*, void ); - DECL_LINK_TYPED( RemovePlacePressed_Hdl, Button*, void ); - DECL_LINK ( Split_Hdl, void* ); + DECL_LINK_TYPED( AddPlacePressed_Hdl, Button*, void ); + DECL_LINK_TYPED( RemovePlacePressed_Hdl, Button*, void ); + DECL_LINK ( Split_Hdl, void* ); + void OpenHdl_Impl(void* pVoid); void Init_Impl( WinBits nBits ); /** find a filter with the given wildcard @param _rFilter diff --git a/include/svtools/inettbc.hxx b/include/svtools/inettbc.hxx index 3619ef6eda63..1d91621290fe 100644 --- a/include/svtools/inettbc.hxx +++ b/include/svtools/inettbc.hxx @@ -32,7 +32,7 @@ class SVT_DLLPUBLIC SvtURLBox : public ComboBox { friend class SvtMatchContext_Impl; friend class SvtURLBox_Impl; - Link<> aOpenHdl; + Link<SvtURLBox*,void> aOpenHdl; OUString aBaseURL; OUString aPlaceHolder; rtl::Reference< SvtMatchContext_Impl > pCtx; @@ -67,8 +67,8 @@ public: void SetBaseURL( const OUString& rURL ); const OUString& GetBaseURL() const { return aBaseURL; } - void SetOpenHdl( const Link<>& rLink ) { aOpenHdl = rLink; } - const Link<>& GetOpenHdl() const { return aOpenHdl; } + void SetOpenHdl( const Link<SvtURLBox*,void>& rLink ) { aOpenHdl = rLink; } + const Link<SvtURLBox*,void>& GetOpenHdl() const { return aOpenHdl; } void SetOnlyDirectories( bool bDir = true ); void SetNoURLSelection( bool bSet = true ); INetProtocol GetSmartProtocol() const { return eSmartProtocol; } diff --git a/sfx2/inc/inettbc.hxx b/sfx2/inc/inettbc.hxx index 8562b7f43b19..caa197be626c 100644 --- a/sfx2/inc/inettbc.hxx +++ b/sfx2/inc/inettbc.hxx @@ -34,7 +34,7 @@ private: SvtURLBox* GetURLBox() const; void OpenURL( const OUString& rName, bool bNew ) const; - DECL_LINK( OpenHdl, void* ); + DECL_LINK_TYPED( OpenHdl, SvtURLBox*, void ); DECL_LINK( SelectHdl, void* ); struct ExecuteInfo diff --git a/sfx2/source/inet/inettbc.cxx b/sfx2/source/inet/inettbc.cxx index 8ba12b55e3ca..47d361e7ca87 100644 --- a/sfx2/source/inet/inettbc.cxx +++ b/sfx2/source/inet/inettbc.cxx @@ -170,7 +170,7 @@ IMPL_LINK_NOARG(SfxURLToolBoxControl_Impl, SelectHdl) return 1L; } -IMPL_LINK_NOARG(SfxURLToolBoxControl_Impl, OpenHdl) +IMPL_LINK_NOARG_TYPED(SfxURLToolBoxControl_Impl, OpenHdl, SvtURLBox*, void) { SvtURLBox* pURLBox = GetURLBox(); OpenURL( pURLBox->GetURL(), pURLBox->IsCtrlOpen() ); @@ -186,8 +186,6 @@ IMPL_LINK_NOARG(SfxURLToolBoxControl_Impl, OpenHdl) pWin->ToTop( ToTopFlags::RestoreWhenMin ); } } - - return 1L; } |