[Libreoffice-commits] core.git: Branch 'feature/cib_contract57c' - cui/source cui/uiconfig officecfg/registry solenv/sanitizers

Samuel Mehrbrodt (via logerrit) logerrit at kemper.freedesktop.org
Tue Jul 2 12:21:19 UTC 2019


 cui/source/options/optpath.cxx                            |   27 ++++++++---
 cui/uiconfig/ui/optpathspage.ui                           |   34 ++++++++------
 officecfg/registry/schema/org/openoffice/Office/Paths.xcs |    2 
 solenv/sanitizers/ui/cui.suppr                            |    2 
 4 files changed, 44 insertions(+), 21 deletions(-)

New commits:
commit bf8f47684d270b986a6f1d6f21b161a07388ba23
Author:     Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
AuthorDate: Mon Jul 1 12:35:43 2019 +0200
Commit:     Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
CommitDate: Tue Jul 2 14:20:13 2019 +0200

    tdf#126088 Display InternalPaths in UI
    
    Reviewed-on: https://gerrit.libreoffice.org/74952
    Tested-by: Jenkins
    Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
    (cherry picked from commit ed7e547e1241cf913e138436fa3d7bca8319ec1d)
    
    Change-Id: Ib729be9ff79a3e43d7ec838646b530be8beff2d8

diff --git a/cui/source/options/optpath.cxx b/cui/source/options/optpath.cxx
index 59c93cf9d216..885ee6f171fa 100644
--- a/cui/source/options/optpath.cxx
+++ b/cui/source/options/optpath.cxx
@@ -63,7 +63,8 @@ using namespace svx;
 
 #define TAB_WIDTH_MIN   10
 #define ITEMID_TYPE       1
-#define ITEMID_PATH       2
+#define ITEMID_USER_PATHS 2
+#define ITEMID_INTERNAL_PATHS 3
 
 #define POSTFIX_INTERNAL    "_internal"
 #define POSTFIX_USER        "_user"
@@ -94,6 +95,7 @@ struct PathUserData_Impl
     sal_uInt16      nRealId;
     SfxItemState    eState;
     OUString        sUserPath;
+    OUString        sInternalPath;
     OUString        sWritablePath;
 
     explicit PathUserData_Impl( sal_uInt16 nId ) :
@@ -215,17 +217,22 @@ SvxPathTabPage::SvxPathTabPage(vcl::Window* pParent, const SfxItemSet& rSet)
 
     rBar.InsertItem( ITEMID_TYPE, get<FixedText>("type")->GetText(),
                             0,
-                            HeaderBarItemBits::LEFT | HeaderBarItemBits::VCENTER | HeaderBarItemBits::CLICKABLE | HeaderBarItemBits::UPARROW );
-    rBar.InsertItem( ITEMID_PATH, get<FixedText>("path")->GetText(),
+                            HeaderBarItemBits::LEFT | HeaderBarItemBits::CLICKABLE | HeaderBarItemBits::UPARROW );
+    rBar.InsertItem( ITEMID_USER_PATHS, get<FixedText>("user_paths")->GetText(),
+                            0,
+                            HeaderBarItemBits::LEFT );
+    rBar.InsertItem( ITEMID_INTERNAL_PATHS, get<FixedText>("internal_paths")->GetText(),
                             0,
                             HeaderBarItemBits::LEFT | HeaderBarItemBits::VCENTER );
 
     long nWidth1 = rBar.GetTextWidth(rBar.GetItemText(ITEMID_TYPE));
-    long nWidth2 = rBar.GetTextWidth(rBar.GetItemText(ITEMID_PATH));
+    long nWidth2 = rBar.GetTextWidth(rBar.GetItemText(ITEMID_USER_PATHS));
+    long nWidth3 = rBar.GetTextWidth(rBar.GetItemText(ITEMID_INTERNAL_PATHS));
 
-    long aTabs[] = {0, 0, 0};
+    long aTabs[] = {0, 0, 0, 0};
     aTabs[1] = nWidth1 + 12;
     aTabs[2] = aTabs[1] + nWidth2 + 12;
+    aTabs[3] = aTabs[2] + nWidth3 + 12;
     pPathBox->SetTabs(SAL_N_ELEMENTS(aTabs), aTabs, MapUnit::MapPixel);
 
     pPathBox->SetDoubleClickHdl( LINK( this, SvxPathTabPage, DoubleClickPathHdl_Impl ) );
@@ -282,6 +289,7 @@ void SvxPathTabPage::Reset( const SfxItemSet* )
     HeaderBar &rBar = pPathBox->GetTheHeaderBar();
     long nWidth1 = rBar.GetTextWidth(rBar.GetItemText(1));
     long nWidth2 = rBar.GetTextWidth(rBar.GetItemText(2));
+    long nWidth3 = rBar.GetTextWidth(rBar.GetItemText(3));
 
     for( sal_uInt16 i = 0; i <= sal_uInt16(SvtPathOptions::PATH_CLASSIFICATION); ++i )
     {
@@ -347,6 +355,10 @@ void SvxPathTabPage::Reset( const SfxItemSet* )
             const OUString aValue = Convert_Impl( sTmpPath );
             nWidth2 = std::max(nWidth2, pPathBox->GetTextWidth(aValue));
             aStr += aValue;
+            aStr += "\t";
+            const OUString aValueInternal = Convert_Impl( sInternal );
+            nWidth3 = std::max(nWidth3, pPathBox->GetTextWidth(aValueInternal));
+            aStr += aValueInternal;
             SvTreeListEntry* pEntry = pPathBox->InsertEntry( aStr );
             if ( bReadOnly )
             {
@@ -354,15 +366,16 @@ void SvxPathTabPage::Reset( const SfxItemSet* )
             }
             PathUserData_Impl* pPathImpl = new PathUserData_Impl(i);
             pPathImpl->sUserPath = sUser;
+            pPathImpl->sInternalPath = sInternal;
             pPathImpl->sWritablePath = sWritable;
             pEntry->SetUserData( pPathImpl );
         }
-
     }
 
-    long aTabs[] = {0, 0, 0};
+    long aTabs[] = {0, 0, 0, 0};
     aTabs[1] = nWidth1 + 12;
     aTabs[2] = aTabs[1] + nWidth2 + 12;
+    aTabs[3] = aTabs[2] + nWidth3 + 12;
     pPathBox->SetTabs(SAL_N_ELEMENTS(aTabs), aTabs, MapUnit::MapPixel);
 
     PathSelect_Impl( nullptr );
diff --git a/cui/uiconfig/ui/optpathspage.ui b/cui/uiconfig/ui/optpathspage.ui
index 0a24ebc201c2..383cdf4c6ab3 100644
--- a/cui/uiconfig/ui/optpathspage.ui
+++ b/cui/uiconfig/ui/optpathspage.ui
@@ -1,6 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.22.1 -->
 <interface domain="cui">
-  <!-- interface-requires gtk+ 3.0 -->
+  <requires lib="gtk+" version="3.18"/>
+  <requires lib="LibreOffice" version="1.0"/>
   <object class="GtkBox" id="OptPathsPage">
     <property name="visible">True</property>
     <property name="can_focus">False</property>
@@ -42,21 +44,17 @@
                       <packing>
                         <property name="left_attach">0</property>
                         <property name="top_attach">0</property>
-                        <property name="width">1</property>
-                        <property name="height">1</property>
                       </packing>
                     </child>
                     <child>
-                      <object class="GtkLabel" id="path">
+                      <object class="GtkLabel" id="user_paths">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="label" translatable="yes" context="optpathspage|path">Path</property>
+                        <property name="label" translatable="yes" context="optpathspage|user_paths">User Paths</property>
                       </object>
                       <packing>
                         <property name="left_attach">1</property>
                         <property name="top_attach">0</property>
-                        <property name="width">1</property>
-                        <property name="height">1</property>
                       </packing>
                     </child>
                     <child>
@@ -66,10 +64,8 @@
                         <property name="label" translatable="yes" context="optpathspage|editpaths">Edit Paths: %1</property>
                       </object>
                       <packing>
-                        <property name="left_attach">2</property>
+                        <property name="left_attach">3</property>
                         <property name="top_attach">0</property>
-                        <property name="width">1</property>
-                        <property name="height">1</property>
                       </packing>
                     </child>
                     <child>
@@ -79,10 +75,19 @@
                         <property name="pixbuf">res/lock.png</property>
                       </object>
                       <packing>
-                        <property name="left_attach">3</property>
+                        <property name="left_attach">4</property>
+                        <property name="top_attach">0</property>
+                      </packing>
+                    </child>
+                    <child>
+                      <object class="GtkLabel" id="internal_paths">
+                        <property name="visible">True</property>
+                        <property name="can_focus">False</property>
+                        <property name="label" translatable="yes" context="optpathspage|internal_paths
">Internal Paths</property>
+                      </object>
+                      <packing>
+                        <property name="left_attach">2</property>
                         <property name="top_attach">0</property>
-                        <property name="width">1</property>
-                        <property name="height">1</property>
                       </packing>
                     </child>
                   </object>
@@ -98,6 +103,9 @@
                     <property name="can_focus">False</property>
                     <property name="hexpand">True</property>
                     <property name="vexpand">True</property>
+                    <child internal-child="selection">
+                      <object class="GtkTreeSelection"/>
+                    </child>
                   </object>
                   <packing>
                     <property name="expand">True</property>
diff --git a/officecfg/registry/schema/org/openoffice/Office/Paths.xcs b/officecfg/registry/schema/org/openoffice/Office/Paths.xcs
index 02f6f21dc73c..759e0b7cdd0b 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Paths.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Paths.xcs
@@ -44,7 +44,7 @@
       </prop>
       <set oor:name="InternalPaths" oor:node-type="MultiPath">
         <info>
-          <desc>Contains path values configured by an administrator or package (not visible for the user).</desc>
+          <desc>Contains path values configured by an administrator or package (read-only for the user).</desc>
         </info>
       </set>
       <prop oor:name="UserPaths" oor:type="oor:string-list">
diff --git a/solenv/sanitizers/ui/cui.suppr b/solenv/sanitizers/ui/cui.suppr
index 4ad3ff4d457d..db76bb17fbab 100644
--- a/solenv/sanitizers/ui/cui.suppr
+++ b/solenv/sanitizers/ui/cui.suppr
@@ -96,6 +96,8 @@ cui/uiconfig/ui/optfontspage.ui://GtkLabel[@id='font'] orphan-label
 cui/uiconfig/ui/optfontspage.ui://GtkLabel[@id='replacewith'] orphan-label
 cui/uiconfig/ui/optfontspage.ui://GtkButton[@id='apply'] button-no-label
 cui/uiconfig/ui/optfontspage.ui://GtkButton[@id='delete'] button-no-label
+cui/uiconfig/ui/optpathspage.ui://GtkLabel[@id='user_paths'] orphan-label
+cui/uiconfig/ui/optpathspage.ui://GtkLabel[@id='internal_paths'] orphan-label
 cui/uiconfig/ui/optsavepage.ui://GtkSpinButton[@id='autosave_spin'] no-labelled-by
 cui/uiconfig/ui/optsavepage.ui://GtkLabel[@id='autosave_mins'] orphan-label
 cui/uiconfig/ui/optviewpage.ui://GtkComboBoxText[@id='iconsize'] duplicate-mnemonic


More information about the Libreoffice-commits mailing list