summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-05-30 17:06:05 +0200
committerStephan Bergmann <sbergman@redhat.com>2012-06-06 10:01:22 +0200
commit8a95074eaefd01621dc55db8567b19c8e6157f95 (patch)
treee7558360206acbce87718207ee8b7f4aaab69991
parent392a483e1040787857fa09fead0547d567c570b5 (diff)
fdo#46808, Adapt UNO services to new style, Part 7, updating ::create
Update code to use factory method TextSearch::create Change-Id: I7a8b607ed397158ca1e2b834ce61b8b196c8019a
-rw-r--r--filter/Library_filtertracer.mk1
-rw-r--r--filter/source/filtertracer/filtertracer.cxx8
-rw-r--r--unotools/source/i18n/textsearch.cxx7
3 files changed, 10 insertions, 6 deletions
diff --git a/filter/Library_filtertracer.mk b/filter/Library_filtertracer.mk
index 58b451bdff7e..264ca0120e00 100644
--- a/filter/Library_filtertracer.mk
+++ b/filter/Library_filtertracer.mk
@@ -31,6 +31,7 @@ $(eval $(call gb_Library_set_include,filtertracer,\
$(eval $(call gb_Library_use_libraries,filtertracer,\
utl \
tl \
+ comphelper \
cppuhelper \
cppu \
sal \
diff --git a/filter/source/filtertracer/filtertracer.cxx b/filter/source/filtertracer/filtertracer.cxx
index 72781252dc6e..2b7ec476f254 100644
--- a/filter/source/filtertracer/filtertracer.cxx
+++ b/filter/source/filtertracer/filtertracer.cxx
@@ -30,10 +30,14 @@
#include <uno/mapping.hxx>
#include <unotools/streamwrap.hxx>
#include <unotools/ucbstreamhelper.hxx>
+#include <com/sun/star/util/TextSearch.hpp>
+#include <comphelper/componentcontext.hxx>
// ----------------
// - FILTERTRACER -
// ----------------
+using namespace ::com::sun::star;
+
rtl::OUString FilterTracer_getImplementationName()
throw( NMSP_UNO::RuntimeException )
{
@@ -60,8 +64,8 @@ FilterTracer::FilterTracer( const REF( NMSP_LANG::XMultiServiceFactory )& rxMgr
mpStream ( NULL ),
mnLogLevel ( NMSP_LOGGING::LogLevel::ALL )
{
- REF( NMSP_UNO::XInterface ) xObj( rxMgr->createInstance( ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.util.TextSearch" )) ) );
- mxTextSearch = REF( NMSP_UTIL::XTextSearch )( xObj, ::com::sun::star::uno::UNO_QUERY );
+ uno::Reference< uno::XComponentContext > xContext( comphelper::ComponentContext(rxMgr).getUNOContext() );
+ mxTextSearch = com::sun::star::util::TextSearch::create(xContext);
}
FilterTracer::~FilterTracer()
{
diff --git a/unotools/source/i18n/textsearch.cxx b/unotools/source/i18n/textsearch.cxx
index 4e94226ed194..cabbba4ca136 100644
--- a/unotools/source/i18n/textsearch.cxx
+++ b/unotools/source/i18n/textsearch.cxx
@@ -28,6 +28,7 @@
#include <i18npool/mslangid.hxx>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/util/TextSearch.hpp>
#include <com/sun/star/util/SearchFlags.hdl>
#include <com/sun/star/i18n/TransliterationModules.hpp>
#include <unotools/charclass.hxx>
@@ -123,10 +124,8 @@ Reference<XTextSearch> TextSearch::getXTextSearch( const SearchOptions& rPara )
try
{
- Reference< XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
- rCache.xTextSearch.set( xMSF->createInstance(
- ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "com.sun.star.util.TextSearch" ) ) ), UNO_QUERY_THROW );
+ Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext();
+ rCache.xTextSearch.set( ::TextSearch::create(xContext) );
rCache.xTextSearch->setOptions( rPara );
rCache.Options = rPara;
}