diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-10-27 16:17:59 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-10-29 14:14:04 +0100 |
commit | 07bde58988705ca45a619eb7a4e670a5d951abf6 (patch) | |
tree | b3e76af23a024d7549d31b5df0642a79b769028d /fpicker | |
parent | 09e3d45cdc5c739e5246388a83ccfc6d76bf66e9 (diff) |
use activate-link instead of clicked
so we can return true to consume the event and not continue to the
default url dispatch handler
Change-Id: I66400363a57d528a25d68a7f9314a8bc7d95876e
Reviewed-on: https://gerrit.libreoffice.org/81555
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'fpicker')
-rw-r--r-- | fpicker/source/office/RemoteFilesDialog.cxx | 3 | ||||
-rw-r--r-- | fpicker/source/office/RemoteFilesDialog.hxx | 2 | ||||
-rw-r--r-- | fpicker/source/office/breadcrumb.cxx | 8 | ||||
-rw-r--r-- | fpicker/source/office/breadcrumb.hxx | 6 |
4 files changed, 10 insertions, 9 deletions
diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx index a795338581f4..3adf45987975 100644 --- a/fpicker/source/office/RemoteFilesDialog.cxx +++ b/fpicker/source/office/RemoteFilesDialog.cxx @@ -787,9 +787,10 @@ IMPL_LINK(RemoteFilesDialog, TreeSelectHdl, weld::TreeView&, rBox, void) m_xFileView->grab_focus(); } -IMPL_LINK ( RemoteFilesDialog, SelectBreadcrumbHdl, Breadcrumb*, pPtr, void ) +IMPL_LINK(RemoteFilesDialog, SelectBreadcrumbHdl, Breadcrumb*, pPtr, bool) { OpenURL( pPtr->GetHdlURL() ); + return true; } IMPL_LINK_NOARG ( RemoteFilesDialog, NewFolderHdl, weld::Button&, void ) diff --git a/fpicker/source/office/RemoteFilesDialog.hxx b/fpicker/source/office/RemoteFilesDialog.hxx index 349a3f7d5d64..aae53a121ddf 100644 --- a/fpicker/source/office/RemoteFilesDialog.hxx +++ b/fpicker/source/office/RemoteFilesDialog.hxx @@ -181,7 +181,7 @@ private: DECL_LINK( TreeSelectHdl, weld::TreeView&, void ); - DECL_LINK( SelectBreadcrumbHdl, Breadcrumb *, void ); + DECL_LINK( SelectBreadcrumbHdl, Breadcrumb*, bool ); DECL_LINK( NewFolderHdl, weld::Button&, void ); DECL_LINK( IconViewHdl, weld::Button&, void ); diff --git a/fpicker/source/office/breadcrumb.cxx b/fpicker/source/office/breadcrumb.cxx index 1216a543a00d..76bc0f1d17d3 100644 --- a/fpicker/source/office/breadcrumb.cxx +++ b/fpicker/source/office/breadcrumb.cxx @@ -40,7 +40,7 @@ void Breadcrumb::EnableFields( bool bEnable ) } } -void Breadcrumb::connect_clicked( const Link<Breadcrumb*,void>& rLink ) +void Breadcrumb::connect_clicked( const Link<Breadcrumb*,bool>& rLink ) { m_aClickHdl = rLink; } @@ -214,7 +214,7 @@ void Breadcrumb::appendField() m_aSegments.emplace_back(std::make_unique<BreadcrumbPath>(m_pParent)); size_t nIndex = m_aSegments.size() - 1; m_aSegments[nIndex]->m_xLink->hide(); - m_aSegments[nIndex]->m_xLink->connect_clicked( LINK( this, Breadcrumb, ClickLinkHdl ) ); + m_aSegments[nIndex]->m_xLink->connect_activate_link(LINK(this, Breadcrumb, ClickLinkHdl)); m_aSegments[nIndex]->m_xSeparator->set_label( ">" ); m_aSegments[nIndex]->m_xSeparator->hide(); } @@ -242,10 +242,10 @@ bool Breadcrumb::showField( unsigned int nIndex, unsigned int nWidthMax ) return true; } -IMPL_LINK( Breadcrumb, ClickLinkHdl, weld::LinkButton&, rLink, void ) +IMPL_LINK(Breadcrumb, ClickLinkHdl, weld::LinkButton&, rLink, bool) { m_sClickedURL = m_aUris[&rLink]; - m_aClickHdl.Call( this ); + return m_aClickHdl.Call(this); } BreadcrumbPath::BreadcrumbPath(weld::Container* pContainer) diff --git a/fpicker/source/office/breadcrumb.hxx b/fpicker/source/office/breadcrumb.hxx index 784ef32b9391..9fc66f9bcd7b 100644 --- a/fpicker/source/office/breadcrumb.hxx +++ b/fpicker/source/office/breadcrumb.hxx @@ -46,13 +46,13 @@ private: SvtBreadcrumbMode m_eMode; - Link<Breadcrumb*,void> m_aClickHdl; + Link<Breadcrumb*,bool> m_aClickHdl; void appendField(); bool showField( unsigned int nIndex, unsigned int nWidthMax ); DECL_LINK(SizeAllocHdl, const Size&, void); - DECL_LINK(ClickLinkHdl, weld::LinkButton&, void); + DECL_LINK(ClickLinkHdl, weld::LinkButton&, bool); public: Breadcrumb(weld::Container* pParent); @@ -60,7 +60,7 @@ public: void EnableFields( bool bEnable ); - void connect_clicked( const Link<Breadcrumb*,void>& rLink ); + void connect_clicked( const Link<Breadcrumb*,bool>& rLink ); const OUString& GetHdlURL() const; void SetRootName( const OUString& rURL ); |