summaryrefslogtreecommitdiff
path: root/cui/source/customize
diff options
context:
space:
mode:
authorHenry Castro <hcastro@collabora.com>2021-03-17 07:35:39 -0400
committerHenry Castro <hcastro@collabora.com>2021-04-07 18:33:15 +0200
commit07d858f63b4e3f5a23eab4eef9b0e7edf30250ba (patch)
treed53a1c7d6789c0bd83cf125a8d62b6919c840587 /cui/source/customize
parentbd78ce123cd65fb8d0843df1d2530a168d5d464d (diff)
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@collabora.com> Reviewed-by: Szymon Kłos <szymon.klos@collabora.com> Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113693 Tested-by: Jenkins Reviewed-by: Henry Castro <hcastro@collabora.com>
Diffstat (limited to 'cui/source/customize')
-rw-r--r--cui/source/customize/cfgutil.cxx17
1 files changed, 5 insertions, 12 deletions
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;
}