From 1b43307b0c0a3ad6a2e5b20a139bd0801f9e0874 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=BCdiger=20Timm?= Date: Mon, 6 Mar 2006 09:14:22 +0000 Subject: [PATCH] INTEGRATION: CWS dbo510 (1.4.24); FILE MERGED 2006/02/15 10:11:17 dbo 1.4.24.1: #i59034# adding C function for component context retrieval --- .../source/processfactory/processfactory.cxx | 27 +++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/comphelper/source/processfactory/processfactory.cxx b/comphelper/source/processfactory/processfactory.cxx index 2f74505734d3..bac3643b6517 100644 --- a/comphelper/source/processfactory/processfactory.cxx +++ b/comphelper/source/processfactory/processfactory.cxx @@ -4,9 +4,9 @@ * * $RCSfile: processfactory.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: rt $ $Date: 2005-09-08 02:55:10 $ + * last change: $Author: rt $ $Date: 2006-03-06 10:14:22 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -45,6 +45,10 @@ #include #endif +#include "com/sun/star/beans/XPropertySet.hpp" + + +using namespace ::com::sun::star; using namespace com::sun::star::uno; using namespace com::sun::star::lang; using namespace osl; @@ -107,3 +111,22 @@ Reference< XInterface > createProcessComponentWithArguments( const ::rtl::OUStri } // namesapce comphelper +extern "C" { +uno::Reference comphelper_getProcessComponentContext() +{ + uno::Reference xRet; + uno::Reference const xProps( + comphelper::getProcessServiceFactory(), uno::UNO_QUERY ); + if (xProps.is()) { + try { + xRet.set( xProps->getPropertyValue( + rtl::OUString( + RTL_CONSTASCII_USTRINGPARAM("DefaultContext") ) ), + uno::UNO_QUERY ); + } + catch (beans::UnknownPropertyException const&) { + } + } + return xRet; +} +} // extern "C"