diff options
Diffstat (limited to 'svtools/source/uno/treecontrolpeer.cxx')
-rw-r--r-- | svtools/source/uno/treecontrolpeer.cxx | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/svtools/source/uno/treecontrolpeer.cxx b/svtools/source/uno/treecontrolpeer.cxx index 186490c6135a..809cf61c83ba 100644 --- a/svtools/source/uno/treecontrolpeer.cxx +++ b/svtools/source/uno/treecontrolpeer.cxx @@ -22,6 +22,8 @@ #include <com/sun/star/lang/XServiceInfo.hpp> #include <com/sun/star/lang/DisposedException.hpp> #include <com/sun/star/view/SelectionType.hpp> +#include <com/sun/star/awt/tree/DefaultTreeDataModel.hpp> + #include <toolkit/helper/property.hxx> #include <toolkit/helper/vclunohelper.hxx> @@ -1229,12 +1231,8 @@ void TreeControlPeer::onChangeDataModel( UnoTreeListBoxImpl& rTree, const Refere if( !xDataModel.is() ) { - static const OUString aSN( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.awt.tree.DefaultTreeDataModel" ) ); - Reference< XMultiServiceFactory > xORB( ::comphelper::getProcessServiceFactory() ); - if( xORB.is() ) - { - mxDataModel.query( xORB->createInstance( aSN ) ); - } + Reference< XComponentContext > xORB( ::comphelper::getProcessComponentContext() ); + mxDataModel.query( DefaultTreeDataModel::create(xORB)); } mxDataModel = xDataModel; |