summaryrefslogtreecommitdiff
path: root/sfx2/source/dialog/dinfdlg.cxx
diff options
context:
space:
mode:
authorHeiko Tietze <tietze.heiko@gmail.com>2021-04-09 11:25:54 +0200
committerHeiko Tietze <heiko.tietze@documentfoundation.org>2021-04-12 08:24:45 +0200
commitdc78803e2fc757fc3ddd97b59e698bf1385c5555 (patch)
treea4a628092243501be67dd3fe38179fcf6f2efc7d /sfx2/source/dialog/dinfdlg.cxx
parent334838efc12cd1e4a451a8dd7542b93fdaf30bb9 (diff)
Resolves tdf#135896 - Add hyperlink to file location
File > Properties: Document Location is now a hyperlink opening the file browser for local files or the internet browser for remote content Change-Id: If3de16172e12aa1a3f4acc7504a2b3dd78677c09 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113839 Tested-by: Jenkins Reviewed-by: Heiko Tietze <heiko.tietze@documentfoundation.org>
Diffstat (limited to 'sfx2/source/dialog/dinfdlg.cxx')
-rw-r--r--sfx2/source/dialog/dinfdlg.cxx12
1 files changed, 8 insertions, 4 deletions
diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index c08c0dfa5cd8..ca5897df8a0a 100644
--- a/sfx2/source/dialog/dinfdlg.cxx
+++ b/sfx2/source/dialog/dinfdlg.cxx
@@ -689,7 +689,7 @@ SfxDocumentPage::SfxDocumentPage(weld::Container* pPage, weld::DialogController*
, m_xNameED(m_xBuilder->weld_label("nameed"))
, m_xChangePassBtn(m_xBuilder->weld_button("changepass"))
, m_xShowTypeFT(m_xBuilder->weld_label("showtype"))
- , m_xFileValEd(m_xBuilder->weld_label("showlocation"))
+ , m_xFileValEd(m_xBuilder->weld_link_button("showlocation"))
, m_xShowSizeFT(m_xBuilder->weld_label("showsize"))
, m_xCreateValFt(m_xBuilder->weld_label("showcreate"))
, m_xChangeValFt(m_xBuilder->weld_label("showmodify"))
@@ -974,10 +974,14 @@ void SfxDocumentPage::Reset( const SfxItemSet* rSet )
// we know it's a folder -> don't need the final slash, but it's better for WB_PATHELLIPSIS
aPath.removeFinalSlash();
OUString aText( aPath.PathToFileName() ); //! (pb) MaxLen?
- m_xFileValEd->set_label( aText );
+ m_xFileValEd->set_label(aText);
+ m_xFileValEd->set_uri("file://" + aText);
+ }
+ else if (aURL.GetProtocol() != INetProtocol::PrivSoffice)
+ {
+ m_xFileValEd->set_label(aURL.GetPartBeforeLastName());
+ m_xFileValEd->set_uri(m_xFileValEd->get_label());
}
- else if ( aURL.GetProtocol() != INetProtocol::PrivSoffice )
- m_xFileValEd->set_label( aURL.GetPartBeforeLastName() );
// handle access data
bool bUseUserData = rInfoItem.IsUseUserData();