Skip to content

Commit

Permalink
- discard print
Browse files Browse the repository at this point in the history
- discard peer creation in update
- add check for peer existence in expand node function
  • Loading branch information
jdittrich committed Jul 15, 2017
1 parent 3eb135d commit 8c5aab9
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/pythonpath/ui_logic/qdaTreePanel.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def getHeight(self):

def updateTree(self): #why is self implicitly passed?
def convertAbstractToUiTree(abstractTree,parent,gui_treemodel):
print(abstractTree)

if not abstractTree: #if abstract tree is empty, show some into to the user
branch = treemodel.createNode("if you create comments write a #hashtag, they will be listed here", False)
parent.appendChild(branch)
Expand Down Expand Up @@ -110,9 +110,7 @@ def convertAbstractToUiTree(abstractTree,parent,gui_treemodel):
self.TreeControl1.DataModel = treemodel

toolkit = self.ServiceManager.createInstance("com.sun.star.awt.Toolkit")

treeControl.createPeer(toolkit,None)


expandAllNodesGuiTree(treeControl.Model.DataModel.Root, treeControl)

# the variable single has been imported by "from com.sun.star.view.SelectionType import SINGLE". Just "SINGLE" (as string) or the corrseponding enumeration number did not work.
Expand Down Expand Up @@ -291,7 +289,7 @@ def expandAllNodesGuiTree(root,treeControl):
for count in range(0,root.ChildCount):
child = root.getChildAt(count)

if child.ChildCount > 0:
if child.ChildCount > 0 and treeControl.Peer:
treeControl.expandNode(child)
expandAllNodesGuiTree(child, treeControl)

Expand Down

0 comments on commit 8c5aab9

Please sign in to comment.