[Libreoffice-commits] core.git: cui/source

Henry Castro (via logerrit) logerrit at kemper.freedesktop.org
Wed Apr 7 16:33:56 UTC 2021


 cui/source/customize/cfgutil.cxx |   17 +++++------------
 cui/source/inc/cfgutil.hxx       |    2 +-
 2 files changed, 6 insertions(+), 13 deletions(-)

New commits:
commit 07d858f63b4e3f5a23eab4eef9b0e7edf30250ba
Author:     Henry Castro <hcastro at collabora.com>
AuthorDate: Wed Mar 17 07:35:39 2021 -0400
Commit:     Henry Castro <hcastro at collabora.com>
CommitDate: Wed Apr 7 18:33:15 2021 +0200

    lok: fix the empty script node type container without "+" symbol expander
    
    According to description in https://bz.apache.org/ooo/show_bug.cgi?id=30923
    
    "In this case I think it's an acceptable solution to display a '+' symbol for all
    library nodes, and if a library has no children and the user clicks on the '+'
    symbol, the '+' will disappear".
    
    Unfortunately this behaviour is not well driven for final users'
    client side, so they misinterpret as a bug.
    
    After tracing the method hasChildNodes(), the log result indicates
    that this method does not load the libraries, but it is necessary
    to iterate applying the method getChildNodes(), which will cause
    to load all libraries and determine if the child has a script
    CONTAINER node type to assign the '+' symbol.
    
    Also, I have traced the loading libraries when the Macro Selector
    dialog pops up and the result it load once, so I do not think it
    is a problem loading a small finite number of libraries today.
    
    Change-Id: I4ae5395b6afa7b7d6ff2b2ec692771e93c46c529
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112636
    Reviewed-by: Pedro Silva <pedro.silva at collabora.com>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113693
    Tested-by: Jenkins
    Reviewed-by: Henry Castro <hcastro at collabora.com>

diff --git a/cui/source/customize/cfgutil.cxx b/cui/source/customize/cfgutil.cxx
index 4d17928b3b39..0d9491c7ddac 100644
--- a/cui/source/customize/cfgutil.cxx
+++ b/cui/source/customize/cfgutil.cxx
@@ -506,7 +506,7 @@ void CuiConfigGroupListBox::InitModule()
 }
 
 void CuiConfigGroupListBox::FillScriptList(const css::uno::Reference< css::script::browse::XBrowseNode >& xRootNode,
-                                           const weld::TreeIter* pParentEntry, bool bCheapChildrenOnDemand)
+                                           const weld::TreeIter* pParentEntry)
 {
     try {
         if ( xRootNode->hasChildNodes() )
@@ -568,7 +568,8 @@ void CuiConfigGroupListBox::FillScriptList(const css::uno::Reference< css::scrip
                     theChild->acquire();
 
                     bool bChildOnDemand = false;
-                    if ( !bCheapChildrenOnDemand && theChild->hasChildNodes() )
+
+                    if ( theChild->hasChildNodes() )
                     {
                         const Sequence< Reference< browse::XBrowseNode > > grandchildren =
                             theChild->getChildNodes();
@@ -582,14 +583,6 @@ void CuiConfigGroupListBox::FillScriptList(const css::uno::Reference< css::scrip
                             }
                         }
                     }
-                    else
-                    {
-                        /* i30923 - Would be nice if there was a better
-                        * way to determine if a basic lib had children
-                        * without having to ask for them (which forces
-                        * the library to be loaded */
-                        bChildOnDemand = true;
-                    }
 
                     OUString aImage = GetImage(theChild, m_xContext, bIsRootNode);
 
@@ -679,7 +672,7 @@ void CuiConfigGroupListBox::Init(const css::uno::Reference< css::uno::XComponent
         {
              //We are only showing scripts not slot APIs so skip
              //Root node and show location nodes
-            FillScriptList(rootNode, nullptr, false);
+            FillScriptList(rootNode, nullptr);
         }
     }
 
@@ -966,7 +959,7 @@ IMPL_LINK(CuiConfigGroupListBox, ExpandingHdl, const weld::TreeIter&, rIter, boo
             {
                 Reference< browse::XBrowseNode > rootNode(
                     static_cast< browse::XBrowseNode* >( pInfo->pObject ) ) ;
-                FillScriptList(rootNode, &rIter, true /* i30923 */ );
+                FillScriptList(rootNode, &rIter);
             }
             break;
         }
diff --git a/cui/source/inc/cfgutil.hxx b/cui/source/inc/cfgutil.hxx
index bd4e8e8e2d76..66ffe4809659 100644
--- a/cui/source/inc/cfgutil.hxx
+++ b/cui/source/inc/cfgutil.hxx
@@ -202,7 +202,7 @@ class CuiConfigGroupListBox
 
     void InitModule();
     void FillScriptList(const css::uno::Reference< css::script::browse::XBrowseNode >& xRootNode,
-                        const weld::TreeIter* pParentEntry, bool bCheapChildrenOnDemand);
+                        const weld::TreeIter* pParentEntry);
     void FillFunctionsList(const css::uno::Sequence< css::frame::DispatchInformation >& xCommands);
     OUString MapCommand2UIName(const OUString& sCommand);
 


More information about the Libreoffice-commits mailing list