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>
diff --git a/include/sfx2/dinfdlg.hxx b/include/sfx2/dinfdlg.hxx
index 04fe413..6f332f7 100644
--- a/include/sfx2/dinfdlg.hxx
+++ b/include/sfx2/dinfdlg.hxx
@@ -167,7 +167,7 @@ private:
    std::unique_ptr<weld::Button> m_xChangePassBtn;

    std::unique_ptr<weld::Label> m_xShowTypeFT;
    std::unique_ptr<weld::Label> m_xFileValEd;
    std::unique_ptr<weld::LinkButton> m_xFileValEd;
    std::unique_ptr<weld::Label> m_xShowSizeFT;

    std::unique_ptr<weld::Label> m_xCreateValFt;
diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx
index c08c0df..ca5897d 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() );
    else if (aURL.GetProtocol() != INetProtocol::PrivSoffice)
    {
        m_xFileValEd->set_label(aURL.GetPartBeforeLastName());
        m_xFileValEd->set_uri(m_xFileValEd->get_label());
    }

    // handle access data
    bool bUseUserData = rInfoItem.IsUseUserData();
diff --git a/sfx2/uiconfig/ui/documentinfopage.ui b/sfx2/uiconfig/ui/documentinfopage.ui
index 7fd64c4..49a4f8a 100644
--- a/sfx2/uiconfig/ui/documentinfopage.ui
+++ b/sfx2/uiconfig/ui/documentinfopage.ui
@@ -1,191 +1,191 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.36.0 -->
<!-- Generated with glade 3.38.2 -->
<interface domain="sfx">
  <requires lib="gtk+" version="3.20"/>
  <!-- n-columns=1 n-rows=1 -->
  <!-- n-columns=3 n-rows=13 -->
  <object class="GtkGrid" id="DocumentInfoPage">
    <property name="visible">True</property>
    <property name="can_focus">False</property>
    <property name="can-focus">False</property>
    <property name="hexpand">True</property>
    <property name="vexpand">True</property>
    <property name="border_width">12</property>
    <property name="row_spacing">6</property>
    <property name="column_spacing">12</property>
    <property name="border-width">12</property>
    <property name="row-spacing">6</property>
    <property name="column-spacing">12</property>
    <child>
      <object class="GtkLabel" id="label13">
        <property name="visible">True</property>
        <property name="can_focus">False</property>
        <property name="can-focus">False</property>
        <property name="halign">end</property>
        <property name="label" translatable="yes" context="documentinfopage|label13">_Created:</property>
        <property name="use_underline">True</property>
        <property name="mnemonic_widget">showcreate</property>
        <property name="use-underline">True</property>
        <property name="mnemonic-widget">showcreate</property>
      </object>
      <packing>
        <property name="left_attach">0</property>
        <property name="top_attach">4</property>
        <property name="left-attach">0</property>
        <property name="top-attach">4</property>
      </packing>
    </child>
    <child>
      <object class="GtkLabel" id="label14">
        <property name="visible">True</property>
        <property name="can_focus">False</property>
        <property name="can-focus">False</property>
        <property name="halign">end</property>
        <property name="label" translatable="yes" context="documentinfopage|label14">_Modified:</property>
        <property name="use_underline">True</property>
        <property name="mnemonic_widget">showmodify</property>
        <property name="use-underline">True</property>
        <property name="mnemonic-widget">showmodify</property>
      </object>
      <packing>
        <property name="left_attach">0</property>
        <property name="top_attach">5</property>
        <property name="left-attach">0</property>
        <property name="top-attach">5</property>
      </packing>
    </child>
    <child>
      <object class="GtkLabel" id="label15">
        <property name="visible">True</property>
        <property name="can_focus">False</property>
        <property name="can-focus">False</property>
        <property name="halign">end</property>
        <property name="label" translatable="yes" context="documentinfopage|label15">_Digitally signed:</property>
        <property name="use_underline">True</property>
        <property name="mnemonic_widget">showsigned</property>
        <property name="use-underline">True</property>
        <property name="mnemonic-widget">showsigned</property>
      </object>
      <packing>
        <property name="left_attach">0</property>
        <property name="top_attach">7</property>
        <property name="left-attach">0</property>
        <property name="top-attach">7</property>
      </packing>
    </child>
    <child>
      <object class="GtkLabel" id="label16">
        <property name="visible">True</property>
        <property name="can_focus">False</property>
        <property name="can-focus">False</property>
        <property name="halign">end</property>
        <property name="label" translatable="yes" context="documentinfopage|label16">Last pri_nted:</property>
        <property name="use_underline">True</property>
        <property name="mnemonic_widget">showprint</property>
        <property name="use-underline">True</property>
        <property name="mnemonic-widget">showprint</property>
      </object>
      <packing>
        <property name="left_attach">0</property>
        <property name="top_attach">8</property>
        <property name="left-attach">0</property>
        <property name="top-attach">8</property>
      </packing>
    </child>
    <child>
      <object class="GtkLabel" id="label17">
        <property name="visible">True</property>
        <property name="can_focus">False</property>
        <property name="can-focus">False</property>
        <property name="halign">end</property>
        <property name="label" translatable="yes" context="documentinfopage|label17">Total _editing time:</property>
        <property name="use_underline">True</property>
        <property name="mnemonic_widget">showedittime</property>
        <property name="use-underline">True</property>
        <property name="mnemonic-widget">showedittime</property>
      </object>
      <packing>
        <property name="left_attach">0</property>
        <property name="top_attach">9</property>
        <property name="left-attach">0</property>
        <property name="top-attach">9</property>
      </packing>
    </child>
    <child>
      <object class="GtkLabel" id="label18">
        <property name="visible">True</property>
        <property name="can_focus">False</property>
        <property name="can-focus">False</property>
        <property name="halign">end</property>
        <property name="label" translatable="yes" context="documentinfopage|label18">Re_vision number:</property>
        <property name="use_underline">True</property>
        <property name="mnemonic_widget">showrevision</property>
        <property name="use-underline">True</property>
        <property name="mnemonic-widget">showrevision</property>
      </object>
      <packing>
        <property name="left_attach">0</property>
        <property name="top_attach">10</property>
        <property name="left-attach">0</property>
        <property name="top-attach">10</property>
      </packing>
    </child>
    <child>
      <object class="GtkLabel" id="showcreate">
        <property name="visible">True</property>
        <property name="can_focus">False</property>
        <property name="can-focus">False</property>
        <property name="hexpand">True</property>
        <property name="selectable">True</property>
        <property name="xalign">0</property>
      </object>
      <packing>
        <property name="left_attach">1</property>
        <property name="top_attach">4</property>
        <property name="left-attach">1</property>
        <property name="top-attach">4</property>
        <property name="width">2</property>
      </packing>
    </child>
    <child>
      <object class="GtkLabel" id="showmodify">
        <property name="visible">True</property>
        <property name="can_focus">False</property>
        <property name="can-focus">False</property>
        <property name="hexpand">True</property>
        <property name="selectable">True</property>
        <property name="xalign">0</property>
      </object>
      <packing>
        <property name="left_attach">1</property>
        <property name="top_attach">5</property>
        <property name="left-attach">1</property>
        <property name="top-attach">5</property>
        <property name="width">2</property>
      </packing>
    </child>
    <child>
      <object class="GtkLabel" id="showsigned">
        <property name="visible">True</property>
        <property name="can_focus">False</property>
        <property name="can-focus">False</property>
        <property name="hexpand">True</property>
        <property name="label" translatable="yes" context="documentinfopage|showsigned">Multiply signed document</property>
        <property name="selectable">True</property>
        <property name="xalign">0</property>
      </object>
      <packing>
        <property name="left_attach">1</property>
        <property name="top_attach">7</property>
        <property name="left-attach">1</property>
        <property name="top-attach">7</property>
      </packing>
    </child>
    <child>
      <object class="GtkLabel" id="showprint">
        <property name="visible">True</property>
        <property name="can_focus">False</property>
        <property name="can-focus">False</property>
        <property name="hexpand">True</property>
        <property name="selectable">True</property>
        <property name="xalign">0</property>
      </object>
      <packing>
        <property name="left_attach">1</property>
        <property name="top_attach">8</property>
        <property name="left-attach">1</property>
        <property name="top-attach">8</property>
      </packing>
    </child>
    <child>
      <object class="GtkLabel" id="showedittime">
        <property name="visible">True</property>
        <property name="can_focus">False</property>
        <property name="can-focus">False</property>
        <property name="hexpand">True</property>
        <property name="selectable">True</property>
        <property name="xalign">0</property>
      </object>
      <packing>
        <property name="left_attach">1</property>
        <property name="top_attach">9</property>
        <property name="left-attach">1</property>
        <property name="top-attach">9</property>
        <property name="width">2</property>
      </packing>
    </child>
    <child>
      <object class="GtkLabel" id="showrevision">
        <property name="visible">True</property>
        <property name="can_focus">False</property>
        <property name="can-focus">False</property>
        <property name="hexpand">True</property>
        <property name="selectable">True</property>
        <property name="xalign">0</property>
      </object>
      <packing>
        <property name="left_attach">1</property>
        <property name="top_attach">10</property>
        <property name="left-attach">1</property>
        <property name="top-attach">10</property>
        <property name="width">2</property>
      </packing>
    </child>
    <child>
      <object class="GtkCheckButton" id="userdatacb">
        <property name="label" translatable="yes" context="documentinfopage|userdatacb">_Apply user data</property>
        <property name="can_focus">True</property>
        <property name="receives_default">False</property>
        <property name="no_show_all">True</property>
        <property name="use_underline">True</property>
        <property name="draw_indicator">True</property>
        <property name="can-focus">True</property>
        <property name="receives-default">False</property>
        <property name="no-show-all">True</property>
        <property name="use-underline">True</property>
        <property name="draw-indicator">True</property>
        <child internal-child="accessible">
          <object class="AtkObject" id="userdatacb-atkobject">
            <property name="AtkObject::accessible-description" translatable="yes" context="documentinfopage|extended_tip|userdatacb">Saves the user's full name with the file. You can edit the name by choosing Tools - Options - %PRODUCTNAME - User Data.</property>
@@ -193,31 +193,31 @@
        </child>
      </object>
      <packing>
        <property name="left_attach">1</property>
        <property name="top_attach">11</property>
        <property name="left-attach">1</property>
        <property name="top-attach">11</property>
      </packing>
    </child>
    <child>
      <object class="GtkCheckButton" id="thumbnailsavecb">
        <property name="label" translatable="yes" context="documentinfopage|thumbnailsavecb">Save preview image with this document</property>
        <property name="visible">True</property>
        <property name="can_focus">True</property>
        <property name="receives_default">False</property>
        <property name="no_show_all">True</property>
        <property name="use_underline">True</property>
        <property name="draw_indicator">True</property>
        <property name="can-focus">True</property>
        <property name="receives-default">False</property>
        <property name="no-show-all">True</property>
        <property name="use-underline">True</property>
        <property name="draw-indicator">True</property>
      </object>
      <packing>
        <property name="left_attach">1</property>
        <property name="top_attach">12</property>
        <property name="left-attach">1</property>
        <property name="top-attach">12</property>
      </packing>
    </child>
    <child>
      <object class="GtkButton" id="reset">
        <property name="label" translatable="yes" context="documentinfopage|reset">Reset Properties</property>
        <property name="can_focus">True</property>
        <property name="receives_default">True</property>
        <property name="no_show_all">True</property>
        <property name="can-focus">True</property>
        <property name="receives-default">True</property>
        <property name="no-show-all">True</property>
        <property name="valign">center</property>
        <child internal-child="accessible">
          <object class="AtkObject" id="reset-atkobject">
@@ -226,8 +226,8 @@
        </child>
      </object>
      <packing>
        <property name="left_attach">2</property>
        <property name="top_attach">11</property>
        <property name="left-attach">2</property>
        <property name="top-attach">11</property>
        <property name="height">2</property>
      </packing>
    </child>
@@ -235,169 +235,152 @@
      <object class="GtkButton" id="signature">
        <property name="label" translatable="yes" context="documentinfopage|signature">Di_gital Signatures...</property>
        <property name="visible">True</property>
        <property name="can_focus">True</property>
        <property name="has_focus">True</property>
        <property name="receives_default">True</property>
        <property name="can-focus">True</property>
        <property name="has-focus">True</property>
        <property name="receives-default">True</property>
        <property name="valign">center</property>
        <property name="use_underline">True</property>
        <property name="use-underline">True</property>
      </object>
      <packing>
        <property name="left_attach">2</property>
        <property name="top_attach">6</property>
        <property name="left-attach">2</property>
        <property name="top-attach">6</property>
        <property name="height">3</property>
      </packing>
    </child>
    <child>
      <object class="GtkLabel" id="label11">
        <property name="visible">True</property>
        <property name="can_focus">False</property>
        <property name="can-focus">False</property>
        <property name="halign">end</property>
        <property name="label" translatable="yes" context="documentinfopage|label11">_Size:</property>
        <property name="use_underline">True</property>
        <property name="mnemonic_widget">showsize</property>
        <property name="use-underline">True</property>
        <property name="mnemonic-widget">showsize</property>
      </object>
      <packing>
        <property name="left_attach">0</property>
        <property name="top_attach">3</property>
        <property name="left-attach">0</property>
        <property name="top-attach">3</property>
      </packing>
    </child>
    <child>
      <object class="GtkLabel" id="showsize">
        <property name="visible">True</property>
        <property name="can_focus">False</property>
        <property name="can-focus">False</property>
        <property name="label" translatable="yes" context="documentinfopage|showsize">unknown</property>
        <property name="selectable">True</property>
        <property name="xalign">0</property>
      </object>
      <packing>
        <property name="left_attach">1</property>
        <property name="top_attach">3</property>
        <property name="left-attach">1</property>
        <property name="top-attach">3</property>
        <property name="width">2</property>
      </packing>
    </child>
    <child>
      <object class="GtkLabel" id="label8">
        <property name="visible">True</property>
        <property name="can_focus">False</property>
        <property name="can-focus">False</property>
        <property name="halign">end</property>
        <property name="label" translatable="yes" context="documentinfopage|label8">_Location:</property>
        <property name="use_underline">True</property>
        <property name="mnemonic_widget">showlocation</property>
        <property name="use-underline">True</property>
      </object>
      <packing>
        <property name="left_attach">0</property>
        <property name="top_attach">2</property>
      </packing>
    </child>
    <child>
      <object class="GtkLabel" id="showlocation">
        <property name="visible">True</property>
        <property name="can_focus">True</property>
        <property name="hexpand">True</property>
        <property name="selectable">True</property>
        <property name="ellipsize">middle</property>
        <property name="max_width_chars">50</property>
        <property name="xalign">0</property>
      </object>
      <packing>
        <property name="left_attach">1</property>
        <property name="top_attach">2</property>
        <property name="width">2</property>
        <property name="left-attach">0</property>
        <property name="top-attach">2</property>
      </packing>
    </child>
    <child>
      <object class="GtkLabel" id="label7">
        <property name="visible">True</property>
        <property name="can_focus">False</property>
        <property name="can-focus">False</property>
        <property name="halign">end</property>
        <property name="label" translatable="yes" context="documentinfopage|label7">_Type:</property>
        <property name="use_underline">True</property>
        <property name="mnemonic_widget">showtype</property>
        <property name="use-underline">True</property>
        <property name="mnemonic-widget">showtype</property>
      </object>
      <packing>
        <property name="left_attach">0</property>
        <property name="top_attach">1</property>
        <property name="left-attach">0</property>
        <property name="top-attach">1</property>
      </packing>
    </child>
    <child>
      <object class="GtkLabel" id="showtype">
        <property name="visible">True</property>
        <property name="can_focus">False</property>
        <property name="can-focus">False</property>
        <property name="selectable">True</property>
        <property name="xalign">0</property>
      </object>
      <packing>
        <property name="left_attach">1</property>
        <property name="top_attach">1</property>
        <property name="left-attach">1</property>
        <property name="top-attach">1</property>
      </packing>
    </child>
    <child>
      <object class="GtkButton" id="changepass">
        <property name="label" translatable="yes" context="documentinfopage|changepass">Change _Password</property>
        <property name="visible">True</property>
        <property name="can_focus">True</property>
        <property name="receives_default">True</property>
        <property name="can-focus">True</property>
        <property name="receives-default">True</property>
        <property name="valign">start</property>
        <property name="use_underline">True</property>
        <property name="use-underline">True</property>
      </object>
      <packing>
        <property name="left_attach">2</property>
        <property name="top_attach">0</property>
        <property name="left-attach">2</property>
        <property name="top-attach">0</property>
        <property name="height">2</property>
      </packing>
    </child>
    <child>
      <object class="GtkLabel" id="templateft">
        <property name="visible">True</property>
        <property name="can_focus">False</property>
        <property name="can-focus">False</property>
        <property name="halign">end</property>
        <property name="label" translatable="yes" context="documentinfopage|templateft">Template:</property>
        <property name="use_underline">True</property>
        <property name="mnemonic_widget">showtemplate</property>
        <property name="use-underline">True</property>
        <property name="mnemonic-widget">showtemplate</property>
      </object>
      <packing>
        <property name="left_attach">0</property>
        <property name="top_attach">6</property>
        <property name="left-attach">0</property>
        <property name="top-attach">6</property>
      </packing>
    </child>
    <child>
      <object class="GtkLabel" id="showtemplate">
        <property name="visible">True</property>
        <property name="can_focus">False</property>
        <property name="can-focus">False</property>
        <property name="selectable">True</property>
        <property name="max_width_chars">56</property>
        <property name="max-width-chars">56</property>
        <property name="xalign">0</property>
      </object>
      <packing>
        <property name="left_attach">1</property>
        <property name="top_attach">6</property>
        <property name="left-attach">1</property>
        <property name="top-attach">6</property>
      </packing>
    </child>
    <child>
      <!-- n-columns=1 n-rows=1 -->
      <!-- n-columns=2 n-rows=1 -->
      <object class="GtkGrid" id="grid1">
        <property name="visible">True</property>
        <property name="can_focus">False</property>
        <property name="column_spacing">12</property>
        <property name="can-focus">False</property>
        <property name="column-spacing">12</property>
        <child>
          <object class="GtkImage" id="icon">
            <property name="visible">True</property>
            <property name="can_focus">False</property>
            <property name="can-focus">False</property>
            <property name="valign">center</property>
            <property name="icon-name">missing-image</property>
          </object>
          <packing>
            <property name="left_attach">0</property>
            <property name="top_attach">0</property>
            <property name="left-attach">0</property>
            <property name="top-attach">0</property>
          </packing>
        </child>
        <child>
          <object class="GtkLabel" id="nameed">
            <property name="visible">True</property>
            <property name="can_focus">False</property>
            <property name="can-focus">False</property>
            <property name="selectable">True</property>
            <property name="single_line_mode">True</property>
            <property name="max_width_chars">56</property>
            <property name="single-line-mode">True</property>
            <property name="max-width-chars">56</property>
            <child internal-child="accessible">
              <object class="AtkObject" id="nameed-atkobject">
                <property name="AtkObject::accessible-description" translatable="yes" context="documentinfopage|extended_tip|nameed">Displays the file name.</property>
@@ -405,14 +388,28 @@
            </child>
          </object>
          <packing>
            <property name="left_attach">1</property>
            <property name="top_attach">0</property>
            <property name="left-attach">1</property>
            <property name="top-attach">0</property>
          </packing>
        </child>
      </object>
      <packing>
        <property name="left_attach">1</property>
        <property name="top_attach">0</property>
        <property name="left-attach">1</property>
        <property name="top-attach">0</property>
      </packing>
    </child>
    <child>
      <object class="GtkLinkButton" id="showlocation">
        <property name="visible">True</property>
        <property name="can-focus">True</property>
        <property name="receives-default">True</property>
        <property name="relief">none</property>
        <property name="xalign">0</property>
      </object>
      <packing>
        <property name="left-attach">1</property>
        <property name="top-attach">2</property>
        <property name="width">2</property>
      </packing>
    </child>
    <child>