diff options
-rw-r--r-- | filter/Library_filtertracer.mk | 1 | ||||
-rw-r--r-- | filter/source/filtertracer/filtertracer.cxx | 8 | ||||
-rw-r--r-- | unotools/source/i18n/textsearch.cxx | 7 |
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; } |