summaryrefslogtreecommitdiff
path: root/svtools/source/uno/treecontrolpeer.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'svtools/source/uno/treecontrolpeer.cxx')
-rw-r--r--svtools/source/uno/treecontrolpeer.cxx20
1 files changed, 18 insertions, 2 deletions
diff --git a/svtools/source/uno/treecontrolpeer.cxx b/svtools/source/uno/treecontrolpeer.cxx
index a46b9605a00d..7fb1a007960f 100644
--- a/svtools/source/uno/treecontrolpeer.cxx
+++ b/svtools/source/uno/treecontrolpeer.cxx
@@ -34,6 +34,7 @@
#include <com/sun/star/lang/DisposedException.hpp>
#include <com/sun/star/view/SelectionType.hpp>
#include <toolkit/helper/property.hxx>
+#include <toolkit/helper/vclunohelper.hxx>
#include <com/sun/star/awt/tree/XMutableTreeNode.hpp>
#include <treecontrolpeer.hxx>
@@ -208,7 +209,9 @@ void TreeControlPeer::removeEntry( UnoTreeListEntry* pEntry )
{
TreeNodeMap::iterator aIter( mpTreeNodeMap->find( pEntry->mxNode ) );
if( aIter != mpTreeNodeMap->end() )
+ {
mpTreeNodeMap->erase( aIter );
+ }
}
}
@@ -280,14 +283,14 @@ UnoTreeListEntry* TreeControlPeer::createEntry( const Reference< XTreeNode >& xN
pEntry->AddItem( pUnoItem );
+ mpTreeImpl->insert( pEntry, pParent, nPos );
+
if( msDefaultExpandedGraphicURL.getLength() )
mpTreeImpl->SetExpandedEntryBmp( pEntry, maDefaultExpandedImage );
if( msDefaultCollapsedGraphicURL.getLength() )
mpTreeImpl->SetCollapsedEntryBmp( pEntry, maDefaultCollapsedImage );
- mpTreeImpl->insert( pEntry, pParent, nPos );
-
updateEntry( pEntry );
}
return pEntry;
@@ -915,6 +918,19 @@ Reference< XTreeNode > SAL_CALL TreeControlPeer::getClosestNodeForLocation( sal_
// -------------------------------------------------------------------
+awt::Rectangle SAL_CALL TreeControlPeer::getNodeRect( const Reference< XTreeNode >& i_Node ) throw (IllegalArgumentException, RuntimeException)
+{
+ ::vos::OGuard aGuard( GetMutex() );
+
+ UnoTreeListBoxImpl& rTree = getTreeListBoxOrThrow();
+ UnoTreeListEntry* pEntry = getEntry( i_Node, true );
+
+ ::Rectangle aEntryRect( rTree.GetFocusRect( pEntry, rTree.GetEntryPosition( pEntry ).Y() ) );
+ return VCLUnoHelper::ConvertToAWTRect( aEntryRect );
+}
+
+// -------------------------------------------------------------------
+
sal_Bool SAL_CALL TreeControlPeer::isEditing( ) throw (RuntimeException)
{
::vos::OGuard aGuard( GetMutex() );