summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-02-11 15:59:15 +0200
committerNoel Grandin <noel@peralex.com>2013-03-04 10:13:18 +0200
commitfcd01fba69db6de6cfc983fae65b6ba6764de0d6 (patch)
tree501c6598058b5fb3828feb416d6d40ddda4320d7
parent929baa03c33084eaca51e02a131cc835048543c4 (diff)
fdo#46808, create IDL for awt::tree::DefaultTreeDataModel
The service already existed. Change-Id: I2acf73b772a7e9cbcb8915561f19c32768459f5c
-rw-r--r--offapi/UnoApi_offapi.mk1
-rw-r--r--offapi/com/sun/star/awt/tree/DefaultTreeDataModel.idl38
-rw-r--r--svtools/source/uno/treecontrolpeer.cxx10
3 files changed, 43 insertions, 6 deletions
diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk
index 5854aafdc108..21e050fbe16d 100644
--- a/offapi/UnoApi_offapi.mk
+++ b/offapi/UnoApi_offapi.mk
@@ -57,6 +57,7 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/awt/tab,\
UnoControlTabPageModel \
))
$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/awt/tree,\
+ DefaultTreeDataModel \
MutableTreeDataModel \
MutableTreeNode \
TreeControl \
diff --git a/offapi/com/sun/star/awt/tree/DefaultTreeDataModel.idl b/offapi/com/sun/star/awt/tree/DefaultTreeDataModel.idl
new file mode 100644
index 000000000000..c709a0b871e7
--- /dev/null
+++ b/offapi/com/sun/star/awt/tree/DefaultTreeDataModel.idl
@@ -0,0 +1,38 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef __com_sun_star_awt_tree_DefaultTreeDataModel_idl__
+#define __com_sun_star_awt_tree_DefaultTreeDataModel_idl__
+
+#include <com/sun/star/awt/tree/XTreeDataModel.idl>
+
+
+module com { module sun { module star { module awt { module tree {
+
+
+/**
+ @since LibreOffice 4.1
+ */
+service DefaultTreeDataModel : XTreeDataModel;
+
+
+}; }; }; }; };
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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;