Expanding Nodes in TreeControl, yields Error: "unsatisfied query for interface…
dittrich.c.jan at gmail.com
Sun Jul 9 10:51:06 UTC 2017
Hello Libreoffice Devs,
I’m writing on an extension  that uses a Tree Control in its user
interface. I want the nodes of the tree all expanded (Currently they are
collapsed, seemingly by default), but when I try to I get a
"unsatisfied query for interface…-Error.
DESCRIPTION OF USED OBJECTS/METHODS: The function to expand is
implemented in XTreeControl , expandNode
It takes an XTreeNode as argument. To implement the tree I use the
mutableTreeDataModel , I create nodes on this, attach the tree to the
control’s data model and then pass the DataModel’s root node and
TreeControl to a helper that recursively should traverse the tree and
expand all nodes.
ERROR: However, when I call treeControl.expandNode(someNode), (someNode
being a )I get the following error:
com.sun.star.uno.RuntimeException: unsatisfied query for interface of
type com.sun.star.awt.tree.XTreeControl! (Error during invoking function
I assumed, since the TreeControl has the method, the data model in the
one that is set for the TreeControl and XMutableTreeNode inherits from
XTreeNode, I should be able to do what I tried above.
CONTEXT: In the implementation, the critical part would be here:
("would" since I did not commit the code, but I can put it on a branch
if it helps)
from where I would call
for count in range(0,root.ChildCount):
child = root.getChildAt(count)
if child.ChildCount > 0:
Is this problem known? I assume I messed up the types somewhere, but I
was unable to find the source of the problem.
More information about the LibreOffice