Date: prev next · Thread: first prev next last
2017 Archives by date, by thread · List index


Hello Libreoffice Devs,

I’m writing on an extension [0] 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 [1], expandNode
It takes an XTreeNode as argument. To implement the tree I use the
mutableTreeDataModel [2], 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 [3])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
[… callstack…]

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)

https://github.com/jdittrich/Office-QDA-TagTree/blob/master/src/pythonpath/ui_logic/qdaTreePanel.py#L110

from where I would call
expandAllNodesGuiTree(treeControl.Model.DataModel.Root, treeControl)

which calls

def expandAllNodesGuiTree(root,treeControl):
    for count in range(0,root.ChildCount):
        child = root.getChildAt(count)
        treeControl.expandNode(child)
        if child.ChildCount > 0:
            expandAllNodesGuiTree(child, treeControl)

Is this problem known? I assume I messed up the types somewhere, but I
was unable to find the source of the problem.

Kind Regards,
 Jan


LINKS:
[0]: https://github.com/jdittrich/Office-QDA-TagTree
[1]:
http://api.libreoffice.org/docs/idl/ref/interfacecom_1_1sun_1_1star_1_1awt_1_1tree_1_1XTreeControl.html#ab31fac529713c7b31a0758f42d54dcc4
[2]:
http://api.libreoffice.org/docs/idl/ref/servicecom_1_1sun_1_1star_1_1awt_1_1tree_1_1MutableTreeDataModel.html
[3]
http://api.libreoffice.org/docs/idl/ref/interfacecom_1_1sun_1_1star_1_1awt_1_1tree_1_1XMutableTreeNode.html

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.