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

New commits:
commit c8881fa20aa7b194cc2b87b78903d6d2e5780120
Author:     Henry Castro <hcas...@collabora.com>
AuthorDate: Wed Mar 17 07:35:39 2021 -0400
Commit:     Szymon Kłos <szymon.k...@collabora.com>
CommitDate: Wed Mar 17 16:18:24 2021 +0100

    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.si...@collabora.com>
    Reviewed-by: Szymon Kłos <szymon.k...@collabora.com>
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>

diff --git a/cui/source/customize/cfgutil.cxx b/cui/source/customize/cfgutil.cxx
index 24fec3396858..758dd2adb700 100644
--- a/cui/source/customize/cfgutil.cxx
+++ b/cui/source/customize/cfgutil.cxx
@@ -481,7 +481,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() )
@@ -544,7 +544,7 @@ void CuiConfigGroupListBox::FillScriptList(const 
css::uno::Reference< css::scrip
                     theChild->acquire();
 
                     bool bChildOnDemand = false;
-                    if ( !bCheapChildrenOnDemand && 
children[n]->hasChildNodes() )
+                    if ( children[n]->hasChildNodes() )
                     {
                         Sequence< Reference< browse::XBrowseNode > > 
grandchildren =
                             children[n]->getChildNodes();
@@ -558,14 +558,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);
 
@@ -651,7 +643,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);
         }
     }
 
@@ -938,7 +930,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 20da0fc6f4a6..f6301f4e09bb 100644
--- a/cui/source/inc/cfgutil.hxx
+++ b/cui/source/inc/cfgutil.hxx
@@ -203,7 +203,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);
 
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to