summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2012-11-02 15:13:28 +0200
committerStephan Bergmann <sbergman@redhat.com>2012-11-05 18:05:00 +0100
commit0666e43c45876199ddc71e378554878cca6f0539 (patch)
tree39fd44bd26cceaa71a86a06c480d80c8351b5e0f
parentebc61e11cdb02f5cc33aeabead3d191eaf0d23d3 (diff)
fdo#46808, use service constructor for i18n::CharacterClassification
Change-Id: I0499ad7de27b1539e97f01ab8aa0ef2d6713ae76
-rw-r--r--basctl/source/basicide/baside2b.cxx2
-rw-r--r--comphelper/source/misc/accessibletexthelper.cxx8
-rw-r--r--connectivity/inc/connectivity/predicateinput.hxx6
-rw-r--r--connectivity/inc/connectivity/sqlparse.hxx4
-rw-r--r--connectivity/inc/connectivity/virtualdbtools.hxx2
-rw-r--r--connectivity/source/commontools/ParamterSubstitution.cxx3
-rw-r--r--connectivity/source/commontools/predicateinput.cxx19
-rw-r--r--connectivity/source/drivers/file/FStatement.cxx3
-rw-r--r--connectivity/source/drivers/flat/ETable.cxx2
-rw-r--r--connectivity/source/drivers/jdbc/JConnection.cxx2
-rw-r--r--connectivity/source/drivers/kab/KDriver.hxx5
-rw-r--r--connectivity/source/drivers/kab/KStatement.cxx2
-rw-r--r--connectivity/source/drivers/mork/MStatement.cxx3
-rw-r--r--connectivity/source/drivers/odbcbase/OPreparedStatement.cxx3
-rw-r--r--connectivity/source/parse/sqlnode.cxx13
-rw-r--r--connectivity/source/simpledbt/dbtfactory.cxx4
-rw-r--r--connectivity/source/simpledbt/dbtfactory.hxx2
-rw-r--r--connectivity/source/simpledbt/parser_s.cxx4
-rw-r--r--connectivity/source/simpledbt/parser_s.hxx2
-rw-r--r--dbaccess/source/core/api/OptimisticSet.cxx2
-rw-r--r--dbaccess/source/core/api/RowSetCache.cxx2
-rw-r--r--dbaccess/source/core/api/SingleSelectQueryComposer.cxx6
-rw-r--r--dbaccess/source/ui/browser/brwctrlr.cxx2
-rw-r--r--dbaccess/source/ui/dlg/paramdialog.cxx32
-rw-r--r--dbaccess/source/ui/dlg/queryfilter.cxx4
-rw-r--r--dbaccess/source/ui/inc/paramdialog.hxx2
-rw-r--r--dbaccess/source/ui/inc/queryfilter.hxx2
-rw-r--r--dbaccess/source/ui/querydesign/querycontroller.cxx2
-rw-r--r--dbaccess/source/ui/uno/composerdialogs.cxx2
-rw-r--r--dbaccess/source/ui/uno/dbinteraction.cxx2
-rw-r--r--editeng/source/misc/hangulhanja.cxx2
-rw-r--r--forms/source/component/Filter.cxx7
-rw-r--r--i18npool/source/collator/chaptercollator.cxx6
-rw-r--r--i18npool/source/search/textsearch.cxx33
-rw-r--r--i18npool/source/search/textsearch.hxx5
-rw-r--r--offapi/UnoApi_offapi.mk2
-rw-r--r--sc/source/core/tool/compiler.cxx2
-rw-r--r--sdext/source/pdfimport/tree/drawtreevisiting.cxx7
-rw-r--r--sot/CppunitTest_sot_test_sot.mk4
-rw-r--r--svl/CppunitTest_svl_urihelper.mk4
-rw-r--r--svl/qa/unit/test_URIHelper.cxx5
-rw-r--r--svl/source/numbers/zforlist.cxx2
-rw-r--r--svtools/source/control/ctrlbox.cxx2
-rw-r--r--svx/source/fmcomp/gridcell.cxx6
-rw-r--r--svx/source/form/filtnav.cxx2
-rw-r--r--svx/source/form/fmsrcimp.cxx4
-rw-r--r--svx/source/form/formcontroller.cxx3
-rw-r--r--svx/source/form/sqlparserclient.cxx6
-rw-r--r--svx/source/inc/gridcell.hxx2
-rw-r--r--svx/source/inc/sqlparserclient.hxx4
-rw-r--r--sw/source/core/bastyp/calc.cxx2
-rw-r--r--sw/source/core/bastyp/init.cxx4
-rw-r--r--unotools/inc/unotools/charclass.hxx7
-rw-r--r--unotools/source/i18n/charclass.cxx14
-rw-r--r--unotools/source/misc/syslocale.cxx2
-rw-r--r--vcl/source/app/unohelp.cxx12
-rw-r--r--xmloff/source/core/xmluconv.cxx20
-rw-r--r--xmloff/source/style/xmlnumfe.cxx8
-rw-r--r--xmloff/source/transform/TransformerBase.cxx62
59 files changed, 166 insertions, 220 deletions
diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx
index 8fdf123d3c60..a56956500fa3 100644
--- a/basctl/source/basicide/baside2b.cxx
+++ b/basctl/source/basicide/baside2b.cxx
@@ -278,7 +278,7 @@ String EditorWindow::GetWordAtCursor()
const TextPaM& rSelStart = rSelection.GetStart();
const TextPaM& rSelEnd = rSelection.GetEnd();
String aText = pTextEngine->GetText( rSelEnd.GetPara() );
- CharClass aClass( ::comphelper::getProcessServiceFactory() , Application::GetSettings().GetLocale() );
+ CharClass aClass( ::comphelper::getProcessComponentContext() , Application::GetSettings().GetLocale() );
xub_StrLen nSelStart = static_cast< xub_StrLen >( rSelStart.GetIndex() );
xub_StrLen nSelEnd = static_cast< xub_StrLen >( rSelEnd.GetIndex() );
xub_StrLen nLength = static_cast< xub_StrLen >( aText.Len() );
diff --git a/comphelper/source/misc/accessibletexthelper.cxx b/comphelper/source/misc/accessibletexthelper.cxx
index 6098abc2e3c8..ab77650a7710 100644
--- a/comphelper/source/misc/accessibletexthelper.cxx
+++ b/comphelper/source/misc/accessibletexthelper.cxx
@@ -21,6 +21,7 @@
#include <com/sun/star/accessibility/AccessibleTextType.hpp>
#include <com/sun/star/i18n/BreakIterator.hpp>
#include <com/sun/star/i18n/CharacterIteratorMode.hpp>
+#include <com/sun/star/i18n/CharacterClassification.hpp>
#include <com/sun/star/i18n/WordType.hpp>
#include <com/sun/star/i18n/KCharacterType.hpp>
#include <comphelper/processfactory.hxx>
@@ -72,12 +73,7 @@ namespace comphelper
{
if ( !m_xCharClass.is() )
{
- Reference< lang::XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
- if ( xMSF.is() )
- {
- m_xCharClass = Reference< i18n::XCharacterClassification >
- ( xMSF->createInstance( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.i18n.CharacterClassification" ) ) ), UNO_QUERY );
- }
+ m_xCharClass = i18n::CharacterClassification::create( ::comphelper::getProcessComponentContext() );
}
return m_xCharClass;
diff --git a/connectivity/inc/connectivity/predicateinput.hxx b/connectivity/inc/connectivity/predicateinput.hxx
index 56abc6e2959a..776e357261b2 100644
--- a/connectivity/inc/connectivity/predicateinput.hxx
+++ b/connectivity/inc/connectivity/predicateinput.hxx
@@ -21,7 +21,7 @@
#define CONNECTIVITY_PREDICATEINPUT_HXX
#include <com/sun/star/beans/XPropertySet.hpp>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/sdbc/XConnection.hpp>
#include <com/sun/star/util/XNumberFormatter.hpp>
#include <com/sun/star/i18n/XLocaleData4.hpp>
@@ -42,8 +42,6 @@ namespace dbtools
class OOO_DLLPUBLIC_DBTOOLS OPredicateInputController
{
private:
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >
- m_xORB;
::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >
m_xConnection;
::com::sun::star::uno::Reference< ::com::sun::star::util::XNumberFormatter >
@@ -56,7 +54,7 @@ namespace dbtools
public:
OPredicateInputController(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection >& _rxConnection,
const ::connectivity::IParseContext* _pParseContext = NULL
);
diff --git a/connectivity/inc/connectivity/sqlparse.hxx b/connectivity/inc/connectivity/sqlparse.hxx
index a4a64b3a2480..e67aa7d034ce 100644
--- a/connectivity/inc/connectivity/sqlparse.hxx
+++ b/connectivity/inc/connectivity/sqlparse.hxx
@@ -163,7 +163,7 @@ namespace connectivity
m_xFormatter; // current number formatter
sal_Int32 m_nFormatKey; // numberformat, which should be used
sal_Int32 m_nDateFormatKey;
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceFactory;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
::com::sun::star::uno::Reference< ::com::sun::star::i18n::XCharacterClassification> m_xCharClass;
static ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XLocaleData4> s_xLocaleData;
::com::sun::star::uno::Reference< ::com::sun::star::i18n::XLocaleData> xDummy; // can be deleted after 627
@@ -183,7 +183,7 @@ namespace connectivity
public:
// if NULL, a default context will be used
// the context must live as long as the parser
- OSQLParser(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _xServiceFactory,const IParseContext* _pContext = NULL);
+ OSQLParser(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext, const IParseContext* _pContext = NULL);
~OSQLParser();
// Parsing an SQLStatement
diff --git a/connectivity/inc/connectivity/virtualdbtools.hxx b/connectivity/inc/connectivity/virtualdbtools.hxx
index 0f6f6520ed7b..7551bedac8d6 100644
--- a/connectivity/inc/connectivity/virtualdbtools.hxx
+++ b/connectivity/inc/connectivity/virtualdbtools.hxx
@@ -335,7 +335,7 @@ namespace connectivity
public:
/// creates a simple version of the class OSQLParser
virtual ::rtl::Reference< ISQLParser > createSQLParser(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxServiceFactory,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
const IParseContext* _pContext
) const = 0;
diff --git a/connectivity/source/commontools/ParamterSubstitution.cxx b/connectivity/source/commontools/ParamterSubstitution.cxx
index 5a31a9308cab..68f1e163c7be 100644
--- a/connectivity/source/commontools/ParamterSubstitution.cxx
+++ b/connectivity/source/commontools/ParamterSubstitution.cxx
@@ -86,8 +86,7 @@ namespace connectivity
{
try
{
- uno::Reference< XMultiServiceFactory> xFac(m_xContext->getServiceManager(),uno::UNO_QUERY_THROW);
- OSQLParser aParser( xFac );
+ OSQLParser aParser( m_xContext );
::rtl::OUString sErrorMessage;
::rtl::OUString sNewSql;
OSQLParseNode* pNode = aParser.parseTree(sErrorMessage,_sText);
diff --git a/connectivity/source/commontools/predicateinput.cxx b/connectivity/source/commontools/predicateinput.cxx
index f8f89601f21c..8b6220ba6107 100644
--- a/connectivity/source/commontools/predicateinput.cxx
+++ b/connectivity/source/commontools/predicateinput.cxx
@@ -39,12 +39,12 @@ namespace dbtools
//.........................................................................
using ::com::sun::star::sdbc::XConnection;
- using ::com::sun::star::lang::XMultiServiceFactory;
using ::com::sun::star::util::XNumberFormatsSupplier;
using ::com::sun::star::util::NumberFormatter;
using ::com::sun::star::util::XNumberFormatter;
using ::com::sun::star::uno::UNO_QUERY;
using ::com::sun::star::uno::UNO_QUERY_THROW;
+ using ::com::sun::star::uno::XComponentContext;
using ::com::sun::star::beans::XPropertySet;
using ::com::sun::star::beans::XPropertySetInfo;
using ::com::sun::star::lang::Locale;
@@ -100,19 +100,18 @@ namespace dbtools
//---------------------------------------------------------------------
OPredicateInputController::OPredicateInputController(
- const Reference< XMultiServiceFactory >& _rxORB, const Reference< XConnection >& _rxConnection, const IParseContext* _pParseContext )
- :m_xORB( _rxORB )
- ,m_xConnection( _rxConnection )
- ,m_aParser( m_xORB, _pParseContext )
+ const Reference< XComponentContext >& rxContext, const Reference< XConnection >& _rxConnection, const IParseContext* _pParseContext )
+ : m_xConnection( _rxConnection )
+ ,m_aParser( rxContext, _pParseContext )
{
try
{
// create a number formatter / number formats supplier pair
- OSL_ENSURE( m_xORB.is(), "OPredicateInputController::OPredicateInputController: need a service factory!" );
- if ( m_xORB.is() )
+ OSL_ENSURE( rxContext.is(), "OPredicateInputController::OPredicateInputController: need a service factory!" );
+ if ( rxContext.is() )
{
m_xFormatter = Reference< XNumberFormatter >(
- NumberFormatter::create(comphelper::getComponentContext(m_xORB)),
+ NumberFormatter::create(rxContext),
UNO_QUERY_THROW
);
}
@@ -124,9 +123,9 @@ namespace dbtools
m_xFormatter->attachNumberFormatsSupplier( xNumberFormats );
// create the locale data
- if ( m_xORB.is() )
+ if ( rxContext.is() )
{
- m_xLocaleData = LocaleData::create( comphelper::getComponentContext(m_xORB) );
+ m_xLocaleData = LocaleData::create( rxContext );
}
}
catch( const Exception& )
diff --git a/connectivity/source/drivers/file/FStatement.cxx b/connectivity/source/drivers/file/FStatement.cxx
index c606bbfe9dfc..49c604664d9b 100644
--- a/connectivity/source/drivers/file/FStatement.cxx
+++ b/connectivity/source/drivers/file/FStatement.cxx
@@ -29,6 +29,7 @@
#include <com/sun/star/sdbc/ResultSetType.hpp>
#include <com/sun/star/sdbc/FetchDirection.hpp>
#include <com/sun/star/lang/DisposedException.hpp>
+#include <comphelper/processfactory.hxx>
#include <comphelper/sequence.hxx>
#include <cppuhelper/typeprovider.hxx>
#include "connectivity/dbexception.hxx"
@@ -57,7 +58,7 @@ OStatement_Base::OStatement_Base(OConnection* _pConnection )
:OStatement_BASE(m_aMutex)
,::comphelper::OPropertyContainer(OStatement_BASE::rBHelper)
,m_xDBMetaData(_pConnection->getMetaData())
- ,m_aParser(_pConnection->getDriver()->getFactory())
+ ,m_aParser( comphelper::getComponentContext(_pConnection->getDriver()->getFactory()) )
,m_aSQLIterator( _pConnection, _pConnection->createCatalog()->getTables(), m_aParser, NULL )
,m_pConnection(_pConnection)
,m_pParseTree(NULL)
diff --git a/connectivity/source/drivers/flat/ETable.cxx b/connectivity/source/drivers/flat/ETable.cxx
index 110f40195be4..0d57cb18b971 100644
--- a/connectivity/source/drivers/flat/ETable.cxx
+++ b/connectivity/source/drivers/flat/ETable.cxx
@@ -109,7 +109,7 @@ void OFlatTable::fillColumns(const ::com::sun::star::lang::Locale& _aLocale)
m_aScales.assign(nFieldCount+1,-1);
const sal_Bool bCase = m_pConnection->getMetaData()->supportsMixedCaseQuotedIdentifiers();
- CharClass aCharClass(pConnection->getDriver()->getFactory(),_aLocale);
+ CharClass aCharClass( comphelper::getComponentContext(pConnection->getDriver()->getFactory()), _aLocale);
// read description
const sal_Unicode cDecimalDelimiter = pConnection->getDecimalDelimiter();
const sal_Unicode cThousandDelimiter = pConnection->getThousandDelimiter();
diff --git a/connectivity/source/drivers/jdbc/JConnection.cxx b/connectivity/source/drivers/jdbc/JConnection.cxx
index 6921c0d96050..a814c1b6665d 100644
--- a/connectivity/source/drivers/jdbc/JConnection.cxx
+++ b/connectivity/source/drivers/jdbc/JConnection.cxx
@@ -469,7 +469,7 @@ Reference< XStatement > SAL_CALL java_sql_Connection::createStatement( ) throw(
{
try
{
- OSQLParser aParser( m_pDriver->getContext().getLegacyServiceFactory() );
+ OSQLParser aParser( m_pDriver->getContext().getUNOContext() );
::rtl::OUString sErrorMessage;
::rtl::OUString sNewSql;
OSQLParseNode* pNode = aParser.parseTree(sErrorMessage,_sSQL);
diff --git a/connectivity/source/drivers/kab/KDriver.hxx b/connectivity/source/drivers/kab/KDriver.hxx
index b51058151279..1243f7425185 100644
--- a/connectivity/source/drivers/kab/KDriver.hxx
+++ b/connectivity/source/drivers/kab/KDriver.hxx
@@ -23,6 +23,7 @@
#include <com/sun/star/sdbc/XDriver.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/frame/XTerminateListener.hpp>
+#include <comphelper/processfactory.hxx>
#include <cppuhelper/compbase3.hxx>
#include <osl/module.h>
@@ -161,8 +162,8 @@ namespace connectivity
static ::rtl::OUString getImplementationName_Static( ) throw(::com::sun::star::uno::RuntimeException);
static ::com::sun::star::uno::Sequence< ::rtl::OUString > getSupportedServiceNames_Static( ) throw (::com::sun::star::uno::RuntimeException);
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >&
- getMSFactory() const { return m_xMSFactory; }
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
+ getComponentContext() const { return comphelper::getComponentContext(m_xMSFactory); }
/** returns the driver's implementation name (being pure ASCII) for reference in various places
*/
diff --git a/connectivity/source/drivers/kab/KStatement.cxx b/connectivity/source/drivers/kab/KStatement.cxx
index e898ee48f62f..a5babf0c2de3 100644
--- a/connectivity/source/drivers/kab/KStatement.cxx
+++ b/connectivity/source/drivers/kab/KStatement.cxx
@@ -62,7 +62,7 @@ IMPLEMENT_SERVICE_INFO(KabStatement, "com.sun.star.sdbc.drivers.KabStatement", "
KabCommonStatement::KabCommonStatement(KabConnection* _pConnection )
: KabCommonStatement_BASE(m_aMutex),
OPropertySetHelper(KabCommonStatement_BASE::rBHelper),
- m_aParser(_pConnection->getDriver()->getMSFactory()),
+ m_aParser(_pConnection->getDriver()->getComponentContext()),
m_aSQLIterator(_pConnection, _pConnection->createCatalog()->getTables(), m_aParser, NULL ),
m_pParseTree(NULL),
m_pConnection(_pConnection),
diff --git a/connectivity/source/drivers/mork/MStatement.cxx b/connectivity/source/drivers/mork/MStatement.cxx
index 342ac2add17b..2beacfecd95a 100644
--- a/connectivity/source/drivers/mork/MStatement.cxx
+++ b/connectivity/source/drivers/mork/MStatement.cxx
@@ -30,6 +30,7 @@
#include <com/sun/star/lang/DisposedException.hpp>
#include <comphelper/sequence.hxx>
#include <cppuhelper/typeprovider.hxx>
+#include <comphelper/processfactory.hxx>
#include <comphelper/extract.hxx>
#include <comphelper/types.hxx>
#include <connectivity/dbexception.hxx>
@@ -79,7 +80,7 @@ OCommonStatement::OCommonStatement(OConnection* _pConnection )
,OCommonStatement_SBASE((::cppu::OWeakObject*)_pConnection, this)
,m_pTable(NULL)
,m_pConnection(_pConnection)
- ,m_aParser(_pConnection->getDriver()->getFactory())
+ ,m_aParser( comphelper::getComponentContext(_pConnection->getDriver()->getFactory()) )
,m_pSQLIterator( new OSQLParseTreeIterator( _pConnection, _pConnection->createCatalog()->getTables(), m_aParser, NULL ) )
,rBHelper(OCommonStatement_IBASE::rBHelper)
{
diff --git a/connectivity/source/drivers/odbcbase/OPreparedStatement.cxx b/connectivity/source/drivers/odbcbase/OPreparedStatement.cxx
index 206369840936..f5c05b80f76f 100644
--- a/connectivity/source/drivers/odbcbase/OPreparedStatement.cxx
+++ b/connectivity/source/drivers/odbcbase/OPreparedStatement.cxx
@@ -30,6 +30,7 @@
#include "odbc/OResultSet.hxx"
#include "odbc/OResultSetMetaData.hxx"
#include <cppuhelper/typeprovider.hxx>
+#include <comphelper/processfactory.hxx>
#include <comphelper/sequence.hxx>
#include <com/sun/star/lang/DisposedException.hpp>
#include "connectivity/dbtools.hxx"
@@ -73,7 +74,7 @@ OPreparedStatement::OPreparedStatement( OConnection* _pConnection,const ::rtl::O
{
if(_pConnection->isParameterSubstitutionEnabled())
{
- OSQLParser aParser(_pConnection->getDriver()->getORB());
+ OSQLParser aParser( comphelper::getComponentContext(_pConnection->getDriver()->getORB()) );
::rtl::OUString sErrorMessage;
::rtl::OUString sNewSql;
::std::auto_ptr<OSQLParseNode> pNode( aParser.parseTree(sErrorMessage,sql) );
diff --git a/connectivity/source/parse/sqlnode.cxx b/connectivity/source/parse/sqlnode.cxx
index daf8ff5e768a..73fd5101c7cb 100644
--- a/connectivity/source/parse/sqlnode.cxx
+++ b/connectivity/source/parse/sqlnode.cxx
@@ -44,6 +44,7 @@
#include <com/sun/star/util/NumberFormat.hpp>
#include <com/sun/star/i18n/KParseType.hpp>
#include <com/sun/star/i18n/KParseTokens.hpp>
+#include <com/sun/star/i18n/CharacterClassification.hpp>
#include "connectivity/dbconversion.hxx"
#include <com/sun/star/util/DateTime.hpp>
#include <com/sun/star/util/Time.hpp>
@@ -1068,8 +1069,8 @@ OSQLParseNode* OSQLParser::buildNode_STR_NUM(OSQLParseNode*& _pLiteral)
{
::rtl::OUString aValue;
if(!m_xCharClass.is())
- m_xCharClass = Reference<XCharacterClassification>(m_xServiceFactory->createInstance(::rtl::OUString("com.sun.star.i18n.CharacterClassification")),UNO_QUERY);
- if(m_xCharClass.is() && s_xLocaleData.is())
+ m_xCharClass = CharacterClassification::create( m_xContext );
+ if( s_xLocaleData.is() )
{
try
{
@@ -1259,13 +1260,13 @@ OSQLParseNode* OSQLParser::predicateTree(::rtl::OUString& rErrorMessage, const :
//=============================================================================
//-----------------------------------------------------------------------------
-OSQLParser::OSQLParser(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _xServiceFactory,const IParseContext* _pContext)
+OSQLParser::OSQLParser(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext, const IParseContext* _pContext)
:m_pContext(_pContext)
,m_pParseTree(NULL)
- ,m_pData( new OSQLParser_Data( _xServiceFactory ) )
+ ,m_pData( new OSQLParser_Data( uno::Reference<lang::XMultiServiceFactory>(rxContext->getServiceManager(), uno::UNO_QUERY_THROW) ) )
,m_nFormatKey(0)
,m_nDateFormatKey(0)
- ,m_xServiceFactory(_xServiceFactory)
+ ,m_xContext(rxContext)
{
@@ -1286,7 +1287,7 @@ OSQLParser::OSQLParser(const ::com::sun::star::uno::Reference< ::com::sun::star:
s_pGarbageCollector = new OSQLParseNodesGarbageCollector();
if(!s_xLocaleData.is())
- s_xLocaleData = LocaleData::create(comphelper::getComponentContext(m_xServiceFactory));
+ s_xLocaleData = LocaleData::create(m_xContext);
// reset to 0
memset(OSQLParser::s_nRuleIDs,0,sizeof(OSQLParser::s_nRuleIDs[0]) * (OSQLParseNode::rule_count+1));
diff --git a/connectivity/source/simpledbt/dbtfactory.cxx b/connectivity/source/simpledbt/dbtfactory.cxx
index 616a7fa6dded..29d000423ed0 100644
--- a/connectivity/source/simpledbt/dbtfactory.cxx
+++ b/connectivity/source/simpledbt/dbtfactory.cxx
@@ -94,9 +94,9 @@ namespace connectivity
SAL_WNODEPRECATED_DECLARATIONS_POP
//----------------------------------------------------------------
- ::rtl::Reference< simple::ISQLParser > ODataAccessToolsFactory::createSQLParser(const Reference< XMultiServiceFactory >& _rxServiceFactory,const IParseContext* _pContext) const
+ ::rtl::Reference< simple::ISQLParser > ODataAccessToolsFactory::createSQLParser(const Reference< XComponentContext >& rxContext, const IParseContext* _pContext) const
{
- return new OSimpleSQLParser(_rxServiceFactory,_pContext);
+ return new OSimpleSQLParser(rxContext, _pContext);
}
//........................................................................
diff --git a/connectivity/source/simpledbt/dbtfactory.hxx b/connectivity/source/simpledbt/dbtfactory.hxx
index ba9d9c7e532f..40005ecbdd9f 100644
--- a/connectivity/source/simpledbt/dbtfactory.hxx
+++ b/connectivity/source/simpledbt/dbtfactory.hxx
@@ -44,7 +44,7 @@ namespace connectivity
// IDataAccessToolsFactory
virtual ::rtl::Reference< simple::ISQLParser > createSQLParser(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxServiceFactory,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
const IParseContext* _pContext
) const;
diff --git a/connectivity/source/simpledbt/parser_s.cxx b/connectivity/source/simpledbt/parser_s.cxx
index 302099d53622..b49c4bfe9a49 100644
--- a/connectivity/source/simpledbt/parser_s.cxx
+++ b/connectivity/source/simpledbt/parser_s.cxx
@@ -35,8 +35,8 @@ namespace connectivity
//= OSimpleSQLParser
//================================================================
//----------------------------------------------------------------
- OSimpleSQLParser::OSimpleSQLParser(const Reference< XMultiServiceFactory >& _rxServiceFactory,const IParseContext* _pContext)
- :m_aFullParser(_rxServiceFactory,_pContext)
+ OSimpleSQLParser::OSimpleSQLParser(const Reference< XComponentContext >& rxContext, const IParseContext* _pContext)
+ :m_aFullParser(rxContext, _pContext)
{
}
diff --git a/connectivity/source/simpledbt/parser_s.hxx b/connectivity/source/simpledbt/parser_s.hxx
index 6d2555e7b099..155ef739b233 100644
--- a/connectivity/source/simpledbt/parser_s.hxx
+++ b/connectivity/source/simpledbt/parser_s.hxx
@@ -40,7 +40,7 @@ namespace connectivity
OSQLParser m_aFullParser;
public:
- OSimpleSQLParser(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxServiceFactory,const IParseContext* _pContext);
+ OSimpleSQLParser(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext, const IParseContext* _pContext);
// ISQLParser
virtual ::rtl::Reference< simple::ISQLParseNode > predicateTree(
diff --git a/dbaccess/source/core/api/OptimisticSet.cxx b/dbaccess/source/core/api/OptimisticSet.cxx
index a814950817ef..ca6f1b59cf33 100644
--- a/dbaccess/source/core/api/OptimisticSet.cxx
+++ b/dbaccess/source/core/api/OptimisticSet.cxx
@@ -92,7 +92,7 @@ OptimisticSet::OptimisticSet(const ::comphelper::ComponentContext& _rContext,
sal_Int32 i_nMaxRows,
sal_Int32& o_nRowCount)
:OKeySet(NULL,NULL,::rtl::OUString(),_xComposer,_aParameterValueForCache,i_nMaxRows,o_nRowCount)
- ,m_aSqlParser( _rContext.getLegacyServiceFactory() )
+ ,m_aSqlParser( _rContext.getUNOContext() )
,m_aSqlIterator( i_xConnection, Reference<XTablesSupplier>(_xComposer,UNO_QUERY)->getTables(), m_aSqlParser, NULL )
,m_bResultSetChanged(false)
{
diff --git a/dbaccess/source/core/api/RowSetCache.cxx b/dbaccess/source/core/api/RowSetCache.cxx
index 0a18b04af516..34896882182e 100644
--- a/dbaccess/source/core/api/RowSetCache.cxx
+++ b/dbaccess/source/core/api/RowSetCache.cxx
@@ -1580,7 +1580,7 @@ sal_Bool ORowSetCache::checkJoin(const Reference< XConnection>& _xConnection,
sal_Bool bOk = sal_False;
::rtl::OUString sSql = _xAnalyzer->getQuery();
::rtl::OUString sErrorMsg;
- ::connectivity::OSQLParser aSqlParser( m_aContext.getLegacyServiceFactory() );
+ ::connectivity::OSQLParser aSqlParser( m_aContext.getUNOContext() );
SAL_WNODEPRECATED_DECLARATIONS_PUSH
::std::auto_ptr< ::connectivity::OSQLParseNode> pSqlParseNode( aSqlParser.parseTree(sErrorMsg,sSql));
SAL_WNODEPRECATED_DECLARATIONS_POP
diff --git a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx
index b3caf704db5e..e078e1e28c4c 100644
--- a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx
+++ b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx
@@ -234,7 +234,7 @@ OSingleSelectQueryComposer::OSingleSelectQueryComposer(const Reference< XNameAcc
const ::comphelper::ComponentContext& _rContext )
:OSubComponent(m_aMutex,_xConnection)
,OPropertyContainer(m_aBHelper)
- ,m_aSqlParser( _rContext.getLegacyServiceFactory() )
+ ,m_aSqlParser( _rContext.getUNOContext() )
,m_aSqlIterator( _xConnection, _rxTables, m_aSqlParser, NULL )
,m_aAdditiveIterator( _xConnection, _rxTables, m_aSqlParser, NULL )
,m_aElementaryParts( (size_t)SQLPartCount )
@@ -1518,14 +1518,14 @@ namespace
void SAL_CALL OSingleSelectQueryComposer::setStructuredFilter( const Sequence< Sequence< PropertyValue > >& filter ) throw (SQLException, ::com::sun::star::lang::IllegalArgumentException, RuntimeException)
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OSingleSelectQueryComposer::setStructuredFilter" );
- OPredicateInputController aPredicateInput(m_aContext.getLegacyServiceFactory(),m_xConnection);
+ OPredicateInputController aPredicateInput(m_aContext.getUNOContext(),m_xConnection);
setFilter(lcl_getCondition(filter,aPredicateInput,getColumns()));
}
void SAL_CALL OSingleSelectQueryComposer::setStructuredHavingClause( const Sequence< Sequence< PropertyValue > >& filter ) throw (SQLException, RuntimeException)
{
RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen@sun.com", "OSingleSelectQueryComposer::setStructuredHavingClause" );
- OPredicateInputController aPredicateInput(m_aContext.getLegacyServiceFactory(),m_xConnection);
+ OPredicateInputController aPredicateInput(m_aContext.getUNOContext(),m_xConnection);
setHavingClause(lcl_getCondition(filter,aPredicateInput,getColumns()));
}
diff --git a/dbaccess/source/ui/browser/brwctrlr.cxx b/dbaccess/source/ui/browser/brwctrlr.cxx
index 460b09354860..8fec4ff329c1 100644
--- a/dbaccess/source/ui/browser/brwctrlr.cxx
+++ b/dbaccess/source/ui/browser/brwctrlr.cxx
@@ -1923,7 +1923,7 @@ void SbaXDataBrowserController::ExecuteFilterSortCrit(sal_Bool bFilter)
Reference< XConnection> xCon(xFormSet->getPropertyValue(PROPERTY_ACTIVE_CONNECTION),UNO_QUERY);
if(bFilter)
{
- DlgFilterCrit aDlg( getBrowserView(), getORB(), xCon, xParser, xSup->getColumns() );
+ DlgFilterCrit aDlg( getBrowserView(), comphelper::getComponentContext(getORB()), xCon, xParser, xSup->getColumns() );
String aFilter;
if ( !aDlg.Execute() )
return; // if so we don't need to update the grid
diff --git a/dbaccess/source/ui/dlg/paramdialog.cxx b/dbaccess/source/ui/dlg/paramdialog.cxx
index 94895690ea92..1453c8434291 100644
--- a/dbaccess/source/ui/dlg/paramdialog.cxx
+++ b/dbaccess/source/ui/dlg/paramdialog.cxx
@@ -56,19 +56,6 @@ namespace dbaui
//==================================================================
//------------------------------------------------------------------------------
- #define INIT_MEMBERS() \
- :ModalDialog( pParent, ModuleRes(DLG_PARAMETERS)) \
- ,m_aNamesFrame (this, ModuleRes(FL_PARAMS)) \
- ,m_aAllParams (this, ModuleRes(LB_ALLPARAMS)) \
- ,m_aValueFrame (this, ModuleRes(FT_VALUE)) \
- ,m_aParam (this, ModuleRes(ET_PARAM)) \
- ,m_aTravelNext (this, ModuleRes(BT_TRAVELNEXT)) \
- ,m_aOKBtn (this, ModuleRes(BT_OK)) \
- ,m_aCancelBtn (this, ModuleRes(BT_CANCEL)) \
- ,m_nCurrentlySelected(LISTBOX_ENTRY_NOTFOUND) \
- ,m_xConnection(_rxConnection) \
- ,m_aPredicateInput( _rxORB, _rxConnection, getParseContext() ) \
- ,m_bNeedErrorOnCurrent(sal_True) \
//------------------------------------------------------------------------------
@@ -76,13 +63,24 @@ DBG_NAME(OParameterDialog)
OParameterDialog::OParameterDialog(
Window* pParent, const Reference< XIndexAccess > & rParamContainer,
- const Reference< XConnection > & _rxConnection, const Reference< XMultiServiceFactory >& _rxORB)
- INIT_MEMBERS()
+ const Reference< XConnection > & _rxConnection, const Reference< XComponentContext >& rxContext)
+ :ModalDialog( pParent, ModuleRes(DLG_PARAMETERS))
+ ,m_aNamesFrame (this, ModuleRes(FL_PARAMS))
+ ,m_aAllParams (this, ModuleRes(LB_ALLPARAMS))
+ ,m_aValueFrame (this, ModuleRes(FT_VALUE))
+ ,m_aParam (this, ModuleRes(ET_PARAM))
+ ,m_aTravelNext (this, ModuleRes(BT_TRAVELNEXT))
+ ,m_aOKBtn (this, ModuleRes(BT_OK))
+ ,m_aCancelBtn (this, ModuleRes(BT_CANCEL))
+ ,m_nCurrentlySelected(LISTBOX_ENTRY_NOTFOUND)
+ ,m_xConnection(_rxConnection)
+ ,m_aPredicateInput( rxContext, _rxConnection, getParseContext() )
+ ,m_bNeedErrorOnCurrent(sal_True)
{
DBG_CTOR(OParameterDialog,NULL);
- if (_rxORB.is())
- m_xFormatter = Reference< XNumberFormatter>( NumberFormatter::create(comphelper::getComponentContext(_rxORB)), UNO_QUERY_THROW);
+ if (rxContext.is())
+ m_xFormatter = Reference< XNumberFormatter>( NumberFormatter::create( rxContext ), UNO_QUERY_THROW);
else {
OSL_FAIL("OParameterDialog::OParameterDialog: need a service factory!");
}
diff --git a/dbaccess/source/ui/dlg/queryfilter.cxx b/dbaccess/source/ui/dlg/queryfilter.cxx
index a8696374338d..c6a38f75ba16 100644
--- a/dbaccess/source/ui/dlg/queryfilter.cxx
+++ b/dbaccess/source/ui/dlg/queryfilter.cxx
@@ -66,7 +66,7 @@ void Replace_SQL_PlaceHolder(String& aString)
DBG_NAME(DlgFilterCrit);
DlgFilterCrit::DlgFilterCrit(Window * pParent,
- const Reference< XMultiServiceFactory >& _rxORB,
+ const Reference< XComponentContext >& rxContext,
const Reference< XConnection>& _rxConnection,
const Reference< XSingleSelectQueryComposer >& _rxComposer,
const Reference< XNameAccess>& _rxCols
@@ -97,7 +97,7 @@ DlgFilterCrit::DlgFilterCrit(Window * pParent,
,m_xColumns( _rxCols )
,m_xConnection( _rxConnection )
,m_xMetaData( _rxConnection->getMetaData() )
- ,m_aPredicateInput( _rxORB, _rxConnection, getParseContext() )
+ ,m_aPredicateInput( rxContext, _rxConnection, getParseContext() )
{
DBG_CTOR(DlgFilterCrit,NULL);
// Write the String for noEntry into the ListBoxes of the field names
diff --git a/dbaccess/source/ui/inc/paramdialog.hxx b/dbaccess/source/ui/inc/paramdialog.hxx
index 34b783a82cdb..45596df04ebb 100644
--- a/dbaccess/source/ui/inc/paramdialog.hxx
+++ b/dbaccess/source/ui/inc/paramdialog.hxx
@@ -88,7 +88,7 @@ namespace dbaui
OParameterDialog(Window* _pParent,
const ::com::sun::star::uno::Reference< ::com::sun::star::container::XIndexAccess > & _rParamContainer,
const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection > & _rxConnection,
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB);
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext);
~OParameterDialog();
::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >
diff --git a/dbaccess/source/ui/inc/queryfilter.hxx b/dbaccess/source/ui/inc/queryfilter.hxx
index 29bf4667bf29..04856f0a7ac3 100644
--- a/dbaccess/source/ui/inc/queryfilter.hxx
+++ b/dbaccess/source/ui/inc/queryfilter.hxx
@@ -119,7 +119,7 @@ namespace dbaui
public:
DlgFilterCrit( Window * pParent,
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XConnection>& _rxConnection,
const ::com::sun::star::uno::Reference< ::com::sun::star::sdb::XSingleSelectQueryComposer>& _rxComposer,
const ::com::sun::star::uno::Reference< ::com::sun::star::container::XNameAccess>& _rxCols
diff --git a/dbaccess/source/ui/querydesign/querycontroller.cxx b/dbaccess/source/ui/querydesign/querycontroller.cxx
index be43be186163..752031dc377e 100644
--- a/dbaccess/source/ui/querydesign/querycontroller.cxx
+++ b/dbaccess/source/ui/querydesign/querycontroller.cxx
@@ -324,7 +324,7 @@ OQueryController::OQueryController(const Reference< XMultiServiceFactory >& _rM)
:OJoinController(_rM)
,OQueryController_PBase( getBroadcastHelper() )
,m_pParseContext( new svxform::OSystemParseContext )
- ,m_aSqlParser( _rM, m_pParseContext )
+ ,m_aSqlParser( comphelper::getComponentContext(_rM), m_pParseContext )
,m_pSqlIterator(NULL)
,m_nVisibleRows(0x400)
,m_nSplitPos(-1)
diff --git a/dbaccess/source/ui/uno/composerdialogs.cxx b/dbaccess/source/ui/uno/composerdialogs.cxx
index ca5fdd188ec6..0a2cb1e87274 100644
--- a/dbaccess/source/ui/uno/composerdialogs.cxx
+++ b/dbaccess/source/ui/uno/composerdialogs.cxx
@@ -146,7 +146,7 @@ namespace dbaui
//---------------------------------------------------------------------
Dialog* RowsetFilterDialog::createComposerDialog( Window* _pParent, const Reference< XConnection >& _rxConnection, const Reference< XNameAccess >& _rxColumns )
{
- return new DlgFilterCrit( _pParent, m_aContext.getLegacyServiceFactory(), _rxConnection, m_xComposer, _rxColumns );
+ return new DlgFilterCrit( _pParent, m_aContext.getUNOContext(), _rxConnection, m_xComposer, _rxColumns );
}
//---------------------------------------------------------------------
diff --git a/dbaccess/source/ui/uno/dbinteraction.cxx b/dbaccess/source/ui/uno/dbinteraction.cxx
index 8cb12b91397a..e992ae06de5d 100644
--- a/dbaccess/source/ui/uno/dbinteraction.cxx
+++ b/dbaccess/source/ui/uno/dbinteraction.cxx
@@ -139,7 +139,7 @@ namespace dbaui
xParamCallback = Reference< XInteractionSupplyParameters >(_rContinuations[nParamPos], UNO_QUERY);
OSL_ENSURE(xParamCallback.is(), "BasicInteractionHandler::implHandle(ParametersRequest): can't set the parameters without an appropriate interaction handler!s");
- OParameterDialog aDlg(NULL, _rParamRequest.Parameters, _rParamRequest.Connection, m_xORB);
+ OParameterDialog aDlg(NULL, _rParamRequest.Parameters, _rParamRequest.Connection, comphelper::getComponentContext(m_xORB));
sal_Int16 nResult = aDlg.Execute();
try
{
diff --git a/editeng/source/misc/hangulhanja.cxx b/editeng/source/misc/hangulhanja.cxx
index 2c2d736cc7a8..f44605500fad 100644
--- a/editeng/source/misc/hangulhanja.cxx
+++ b/editeng/source/misc/hangulhanja.cxx
@@ -623,7 +623,7 @@ namespace editeng
{ // found asian text
// determine if it's Hangul
- CharClass aCharClassificaton( m_xORB, m_aSourceLocale );
+ CharClass aCharClassificaton( comphelper::getComponentContext(m_xORB), m_aSourceLocale );
sal_Int16 nScript = aCharClassificaton.getScript( m_sCurrentPortion, sal::static_int_cast< sal_uInt16 >(nNextAsianScript) );
if ( ( UnicodeScript_kHangulJamo == nScript )
|| ( UnicodeScript_kHangulCompatibilityJamo == nScript )
diff --git a/forms/source/component/Filter.cxx b/forms/source/component/Filter.cxx
index 298bf90cae4c..ba3f208f99a2 100644
--- a/forms/source/component/Filter.cxx
+++ b/forms/source/component/Filter.cxx
@@ -57,6 +57,7 @@
#include <com/sun/star/awt/XItemList.hpp>
#include <comphelper/numbers.hxx>
+#include <comphelper/processfactory.hxx>
#include <comphelper/property.hxx>
#include <connectivity/dbconversion.hxx>
#include <connectivity/dbtools.hxx>
@@ -102,7 +103,7 @@ namespace frm
OFilterControl::OFilterControl( const Reference< XMultiServiceFactory >& _rxORB )
:UnoControl( _rxORB )
,m_aTextListeners( *this )
- ,m_aParser( _rxORB )
+ ,m_aParser( comphelper::getComponentContext(_rxORB) )
,m_nControlClass( FormComponentType::TEXTFIELD )
,m_bFilterList( sal_False )
,m_bMultiLine( sal_False )
@@ -348,7 +349,7 @@ namespace frm
sItemText = itemPos->second;
if ( !sItemText.isEmpty() )
{
- ::dbtools::OPredicateInputController aPredicateInput( maContext.getLegacyServiceFactory(), m_xConnection, getParseContext() );
+ ::dbtools::OPredicateInputController aPredicateInput( maContext.getUNOContext(), m_xConnection, getParseContext() );
::rtl::OUString sErrorMessage;
OSL_VERIFY( aPredicateInput.normalizePredicateString( sItemText, m_xField, &sErrorMessage ) );
}
@@ -533,7 +534,7 @@ namespace frm
aNewText.trim();
if ( !aNewText.isEmpty() )
{
- ::dbtools::OPredicateInputController aPredicateInput( maContext.getLegacyServiceFactory(), m_xConnection, getParseContext() );
+ ::dbtools::OPredicateInputController aPredicateInput( maContext.getUNOContext(), m_xConnection, getParseContext() );
::rtl::OUString sErrorMessage;
if ( !aPredicateInput.normalizePredicateString( aNewText, m_xField, &sErrorMessage ) )
{
diff --git a/i18npool/source/collator/chaptercollator.cxx b/i18npool/source/collator/chaptercollator.cxx
index 837cdc639f7f..8c0c1100c308 100644
--- a/i18npool/source/collator/chaptercollator.cxx
+++ b/i18npool/source/collator/chaptercollator.cxx
@@ -24,6 +24,7 @@
#include <chaptercollator.hxx>
#include <com/sun/star/i18n/KCharacterType.hpp>
#include <com/sun/star/i18n/ParseResult.hpp>
+#include <com/sun/star/i18n/CharacterClassification.hpp>
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::uno;
@@ -33,10 +34,7 @@ using namespace ::rtl;
ChapterCollator::ChapterCollator( const Reference < XMultiServiceFactory >& rxMSF ) : CollatorImpl(rxMSF)
{
if ( rxMSF.is()) {
- Reference < XInterface > xI =
- rxMSF->createInstance( OUString("com.sun.star.i18n.CharacterClassification"));
- if ( xI.is() )
- xI->queryInterface(::getCppuType((const Reference< XCharacterClassification>*)0)) >>= cclass;
+ cclass = CharacterClassification::create( comphelper::getComponentContext( rxMSF ) );
}
}
diff --git a/i18npool/source/search/textsearch.cxx b/i18npool/source/search/textsearch.cxx
index b28c23a4539b..1469cead0d75 100644
--- a/i18npool/source/search/textsearch.cxx
+++ b/i18npool/source/search/textsearch.cxx
@@ -39,6 +39,7 @@
#include <com/sun/star/i18n/WordType.hpp>
#include <com/sun/star/i18n/ScriptType.hpp>
#include <com/sun/star/i18n/CharacterIteratorMode.hpp>
+#include <com/sun/star/i18n/CharacterClassification.hpp>
#include <com/sun/star/i18n/KCharacterType.hpp>
#include <com/sun/star/i18n/Transliteration.hpp>
#include <com/sun/star/registry/XRegistryKey.hpp>
@@ -77,8 +78,8 @@ static const sal_Int32 COMPLEX_TRANS_MASK =
// Above 2 transliteration is simple but need to take effect in
// complex transliteration
-TextSearch::TextSearch(const Reference < XMultiServiceFactory > & rxMSF)
- : xMSF( rxMSF )
+TextSearch::TextSearch(const Reference < XComponentContext > & rxContext)
+ : m_xContext( rxContext )
, pJumpTable( 0 )
, pJumpTable2( 0 )
, pRegExp( 0 )
@@ -113,7 +114,7 @@ void TextSearch::setOptions( const SearchOptions& rOptions ) throw( RuntimeExcep
{
if( !xTranslit.is() )
{
- xTranslit.set( Transliteration::create( comphelper::getComponentContext(xMSF) ) );
+ xTranslit.set( Transliteration::create( m_xContext ) );
}
// Load transliteration module
xTranslit->loadModule(
@@ -128,7 +129,7 @@ void TextSearch::setOptions( const SearchOptions& rOptions ) throw( RuntimeExcep
{
if( !xTranslit2.is() )
{
- xTranslit2.set( Transliteration::create( comphelper::getComponentContext(xMSF) ) );
+ xTranslit2.set( Transliteration::create( m_xContext ) );
}
// Load transliteration module
xTranslit2->loadModule(
@@ -138,7 +139,7 @@ void TextSearch::setOptions( const SearchOptions& rOptions ) throw( RuntimeExcep
if ( !xBreak.is() )
{
- xBreak = BreakIterator::create(comphelper::getComponentContext(xMSF));
+ xBreak = BreakIterator::create(m_xContext);
}
sSrchStr = aSrchPara.searchString;
@@ -393,21 +394,13 @@ bool TextSearch::IsDelimiter( const OUString& rStr, sal_Int32 nPos ) const
{
if ( !xCharClass.is() )
{
- Reference < XInterface > xI = xMSF->createInstance(
- OUString("com.sun.star.i18n.CharacterClassification"));
- if( xI.is() )
- xI->queryInterface( ::getCppuType(
- (const Reference< XCharacterClassification >*)0))
- >>= xCharClass;
- }
- if ( xCharClass.is() )
- {
- sal_Int32 nCType = xCharClass->getCharacterType( rStr, nPos,
- aSrchPara.Locale );
- if( 0 != (( KCharacterType::DIGIT | KCharacterType::ALPHA |
- KCharacterType::LETTER ) & nCType ) )
- bRet = 0;
+ xCharClass = CharacterClassification::create( m_xContext );
}
+ sal_Int32 nCType = xCharClass->getCharacterType( rStr, nPos,
+ aSrchPara.Locale );
+ if( 0 != (( KCharacterType::DIGIT | KCharacterType::ALPHA |
+ KCharacterType::LETTER ) & nCType ) )
+ bRet = 0;
}
return bRet;
}
@@ -957,7 +950,7 @@ SAL_CALL TextSearch_CreateInstance(
{
return ::com::sun::star::uno::Reference<
::com::sun::star::uno::XInterface >(
- (::cppu::OWeakObject*) new TextSearch( rxMSF ) );
+ (::cppu::OWeakObject*) new TextSearch( comphelper::getComponentContext(rxMSF) ) );
}
extern "C"
diff --git a/i18npool/source/search/textsearch.hxx b/i18npool/source/search/textsearch.hxx
index 32b4d2e5af18..ca28435945f5 100644
--- a/i18npool/source/search/textsearch.hxx
+++ b/i18npool/source/search/textsearch.hxx
@@ -36,6 +36,7 @@
#include <com/sun/star/i18n/XExtendedTransliteration.hpp>
#include <com/sun/star/i18n/XCharacterClassification.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/uno/XComponentContext.hpp>
#include <map>
@@ -52,7 +53,7 @@ class TextSearch: public cppu::WeakImplHelper2
::com::sun::star::lang::XServiceInfo
>
{
- ::com::sun::star::uno::Reference < ::com::sun::star::lang::XMultiServiceFactory > xMSF;
+ ::com::sun::star::uno::Reference < ::com::sun::star::uno::XComponentContext > m_xContext;
::com::sun::star::util::SearchOptions aSrchPara;
::rtl::OUString sSrchStr;
@@ -125,7 +126,7 @@ class TextSearch: public cppu::WeakImplHelper2
public:
TextSearch(
- const ::com::sun::star::uno::Reference < ::com::sun::star::lang::XMultiServiceFactory >& rxMSF );
+ const ::com::sun::star::uno::Reference < ::com::sun::star::uno::XComponentContext >& rxContext );
virtual ~TextSearch();
diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk
index 27025bb53a2b..7502af1beb48 100644
--- a/offapi/UnoApi_offapi.mk
+++ b/offapi/UnoApi_offapi.mk
@@ -153,6 +153,7 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/inspection
))
$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/i18n,\
BreakIterator \
+ CharacterClassification \
LocaleCalendar \
LocaleData \
Transliteration \
@@ -864,7 +865,6 @@ $(eval $(call gb_UnoApi_add_idlfiles_noheader,offapi,offapi/com/sun/star/graphic
))
$(eval $(call gb_UnoApi_add_idlfiles_noheader,offapi,offapi/com/sun/star/i18n,\
ChapterCollator \
- CharacterClassification \
Collator \
IndexEntrySupplier \
InputSequenceChecker \
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index c8e317c6a5e7..9771136c5512 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -216,7 +216,7 @@ void ScCompiler::InitCharClassEnglish()
OUString( RTL_CONSTASCII_USTRINGPARAM( "US")),
OUString());
pCharClassEnglish = new CharClass(
- ::comphelper::getProcessServiceFactory(), aLocale);
+ ::comphelper::getProcessComponentContext(), aLocale);
}
diff --git a/sdext/source/pdfimport/tree/drawtreevisiting.cxx b/sdext/source/pdfimport/tree/drawtreevisiting.cxx
index 4333dabab350..4a8e6a9d985f 100644
--- a/sdext/source/pdfimport/tree/drawtreevisiting.cxx
+++ b/sdext/source/pdfimport/tree/drawtreevisiting.cxx
@@ -30,6 +30,7 @@
#include "basegfx/range/b2drange.hxx"
#include "com/sun/star/i18n/BreakIterator.hpp"
+#include "com/sun/star/i18n/CharacterClassification.hpp"
#include "com/sun/star/lang/XMultiServiceFactory.hpp"
#include "comphelper/processfactory.hxx"
#include "com/sun/star/i18n/ScriptType.hpp"
@@ -56,14 +57,12 @@ const Reference< XBreakIterator >& DrawXmlOptimizer::GetBreakIterator()
return mxBreakIter;
}
-const ::com::sun::star::uno::Reference< ::com::sun::star::i18n::XCharacterClassification >& DrawXmlEmitter::GetCharacterClassification()
+const Reference< XCharacterClassification >& DrawXmlEmitter::GetCharacterClassification()
{
if ( !mxCharClass.is() )
{
Reference< XComponentContext > xContext( m_rEmitContext.m_xContext, uno::UNO_SET_THROW );
- Reference< XMultiComponentFactory > xMSF( xContext->getServiceManager(), uno::UNO_SET_THROW );
- Reference < XInterface > xInterface = xMSF->createInstanceWithContext(::rtl::OUString("com.sun.star.i18n.CharacterClassification"), xContext);
- mxCharClass = uno::Reference< i18n::XCharacterClassification >( xInterface, uno::UNO_QUERY );
+ mxCharClass = CharacterClassification::create(xContext);
}
return mxCharClass;
}
diff --git a/sot/CppunitTest_sot_test_sot.mk b/sot/CppunitTest_sot_test_sot.mk
index 62b1b28980f0..ad7cd55877a2 100644
--- a/sot/CppunitTest_sot_test_sot.mk
+++ b/sot/CppunitTest_sot_test_sot.mk
@@ -54,4 +54,8 @@ $(eval $(call gb_CppunitTest_use_api,sot_test_sot,\
$(eval $(call gb_CppunitTest_use_ure,sot_test_sot))
+$(eval $(call gb_CppunitTest_use_components,sot_test_sot,\
+ i18npool/util/i18npool \
+))
+
# vim: set noet sw=4 ts=4:
diff --git a/svl/CppunitTest_svl_urihelper.mk b/svl/CppunitTest_svl_urihelper.mk
index b432734626cc..0312e7ab40dc 100644
--- a/svl/CppunitTest_svl_urihelper.mk
+++ b/svl/CppunitTest_svl_urihelper.mk
@@ -52,3 +52,7 @@ $(eval $(call gb_CppunitTest_use_libraries,svl_urihelper, \
))
$(eval $(call gb_CppunitTest_use_ure,svl_urihelper))
+
+$(eval $(call gb_CppunitTest_use_components,svl_urihelper,\
+ i18npool/util/i18npool \
+))
diff --git a/svl/qa/unit/test_URIHelper.cxx b/svl/qa/unit/test_URIHelper.cxx
index 98c25a6d6eb8..52828b99a8e6 100644
--- a/svl/qa/unit/test_URIHelper.cxx
+++ b/svl/qa/unit/test_URIHelper.cxx
@@ -387,10 +387,7 @@ void Test::testFindFirstURLInText() {
{ "generic:path", 0, 0, 0 },
{ "wfs:", 0, 0, 0 }
};
- CharClass charClass(
- css::uno::Reference< css::lang::XMultiServiceFactory >(
- m_context->getServiceManager(), css::uno::UNO_QUERY_THROW),
- com::sun::star::lang::Locale("en", "US", ""));
+ CharClass charClass( m_context, com::sun::star::lang::Locale("en", "US", ""));
for (std::size_t i = 0; i < SAL_N_ELEMENTS(tests); ++i) {
rtl::OUString input(rtl::OUString::createFromAscii(tests[i].input));
xub_StrLen begin = 0;
diff --git a/svl/source/numbers/zforlist.cxx b/svl/source/numbers/zforlist.cxx
index 9919cf9d0ad6..8d73e68a19d5 100644
--- a/svl/source/numbers/zforlist.cxx
+++ b/svl/source/numbers/zforlist.cxx
@@ -234,7 +234,7 @@ void SvNumberFormatter::ImpConstruct( LanguageType eLang )
nDefaultSystemCurrencyFormat = NUMBERFORMAT_ENTRY_NOT_FOUND;
aLocale = MsLangId::convertLanguageToLocale( eLang );
- pCharClass = new CharClass( xServiceManager, aLocale );
+ pCharClass = new CharClass( comphelper::getComponentContext(xServiceManager), aLocale );
xLocaleData.init( xServiceManager, aLocale, eLang );
xCalendar.init( comphelper::getComponentContext(xServiceManager), aLocale );
xTransliteration.init( xServiceManager, eLang,
diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx
index b4709df3d7dc..4f6384d6ef15 100644
--- a/svtools/source/control/ctrlbox.cxx
+++ b/svtools/source/control/ctrlbox.cxx
@@ -1468,7 +1468,7 @@ void FontStyleBox::LoseFocus()
void FontStyleBox::Modify()
{
- CharClass aChrCls( ::comphelper::getProcessServiceFactory(),
+ CharClass aChrCls( ::comphelper::getProcessComponentContext(),
GetSettings().GetLocale() );
XubString aStr = GetText();
sal_uInt16 nEntryCount = GetEntryCount();
diff --git a/svx/source/fmcomp/gridcell.cxx b/svx/source/fmcomp/gridcell.cxx
index 5c5772101b81..47ac9d70e189 100644
--- a/svx/source/fmcomp/gridcell.cxx
+++ b/svx/source/fmcomp/gridcell.cxx
@@ -187,7 +187,7 @@ void DbGridColumn::CreateControl(sal_Int32 _nFieldPos, const Reference< ::com::s
DbCellControl* pCellControl = NULL;
if (m_rParent.IsFilterMode())
{
- pCellControl = new DbFilterField(m_rParent.getServiceManager(),*this);
+ pCellControl = new DbFilterField(comphelper::getComponentContext(m_rParent.getServiceManager()),*this);
}
else
{
@@ -2747,9 +2747,9 @@ sal_Bool DbListBox::commitControl()
DBG_NAME(DbFilterField);
/*************************************************************************/
-DbFilterField::DbFilterField(const Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB,DbGridColumn& _rColumn)
+DbFilterField::DbFilterField(const Reference< ::com::sun::star::uno::XComponentContext >& rxContext,DbGridColumn& _rColumn)
:DbCellControl(_rColumn)
- ,OSQLParserClient(_rxORB)
+ ,OSQLParserClient(rxContext)
,m_nControlClass(::com::sun::star::form::FormComponentType::TEXTFIELD)
,m_bFilterList(sal_False)
,m_bFilterListFilled(sal_False)
diff --git a/svx/source/form/filtnav.cxx b/svx/source/form/filtnav.cxx
index 919ec65ea37a..a9ab319df386 100644
--- a/svx/source/form/filtnav.cxx
+++ b/svx/source/form/filtnav.cxx
@@ -553,7 +553,7 @@ TYPEINIT1(FmFilterModel, FmParentData);
//------------------------------------------------------------------------
FmFilterModel::FmFilterModel(const Reference< XMultiServiceFactory >& _rxFactory)
:FmParentData(_rxFactory,NULL, ::rtl::OUString())
- ,OSQLParserClient(_rxFactory)
+ ,OSQLParserClient(comphelper::getComponentContext(_rxFactory))
,m_xORB(_rxFactory)
,m_pAdapter(NULL)
,m_pCurrentItems(NULL)
diff --git a/svx/source/form/fmsrcimp.cxx b/svx/source/form/fmsrcimp.cxx
index 63d04a43a343..14fb1fca3639 100644
--- a/svx/source/form/fmsrcimp.cxx
+++ b/svx/source/form/fmsrcimp.cxx
@@ -686,7 +686,7 @@ FmSearchEngine::FmSearchEngine(const Reference< XMultiServiceFactory >& _rxORB,
:m_xSearchCursor(xCursor)
,m_xFormatSupplier(xFormatSupplier)
- ,m_aCharacterClassficator( _rxORB, SvtSysLocale().GetLocaleData().getLocale() )
+ ,m_aCharacterClassficator( comphelper::getComponentContext(_rxORB), SvtSysLocale().GetLocaleData().getLocale() )
,m_aStringCompare( _rxORB )
,m_nCurrentFieldIndex(-2) // -1 hat schon eine Bedeutung, also nehme ich -2 fuer 'ungueltig'
,m_bUsingTextComponents(sal_False)
@@ -723,7 +723,7 @@ FmSearchEngine::FmSearchEngine(const Reference< XMultiServiceFactory >& _rxORB,
const Reference< XResultSet > & xCursor, const ::rtl::OUString& sVisibleFields,
const InterfaceArray& arrFields, FMSEARCH_MODE eMode)
:m_xSearchCursor(xCursor)
- ,m_aCharacterClassficator( _rxORB, SvtSysLocale().GetLocaleData().getLocale() )
+ ,m_aCharacterClassficator( comphelper::getComponentContext(_rxORB), SvtSysLocale().GetLocaleData().getLocale() )
,m_aStringCompare( _rxORB )
,m_nCurrentFieldIndex(-2) // -1 hat schon eine Bedeutung, also nehme ich -2 fuer 'ungueltig'
,m_bUsingTextComponents(sal_True)
diff --git a/svx/source/form/formcontroller.cxx b/svx/source/form/formcontroller.cxx
index fb5f281cb80e..8c7fc1e70f98 100644
--- a/svx/source/form/formcontroller.cxx
+++ b/svx/source/form/formcontroller.cxx
@@ -75,6 +75,7 @@
#include <comphelper/extract.hxx>
#include <comphelper/interaction.hxx>
#include <comphelper/namedvaluecollection.hxx>
+#include <comphelper/processfactory.hxx>
#include <comphelper/propagg.hxx>
#include <comphelper/property.hxx>
#include <comphelper/sequence.hxx>
@@ -559,7 +560,7 @@ DBG_NAME( FormController )
FormController::FormController(const Reference< XMultiServiceFactory > & _rxORB )
:FormController_BASE( m_aMutex )
,OPropertySetHelper( FormController_BASE::rBHelper )
- ,OSQLParserClient( _rxORB )
+ ,OSQLParserClient( comphelper::getComponentContext(_rxORB) )
,m_aContext( _rxORB )
,m_aActivateListeners(m_aMutex)
,m_aModifyListeners(m_aMutex)
diff --git a/svx/source/form/sqlparserclient.cxx b/svx/source/form/sqlparserclient.cxx
index f9eb42ee1e6e..ea3ffc9d847a 100644
--- a/svx/source/form/sqlparserclient.cxx
+++ b/svx/source/form/sqlparserclient.cxx
@@ -32,16 +32,16 @@ namespace svxform
//= OSQLParserClient
//====================================================================
//--------------------------------------------------------------------
- OSQLParserClient::OSQLParserClient(const Reference< XMultiServiceFactory >& _rxORB)
+ OSQLParserClient::OSQLParserClient(const Reference< XComponentContext >& rxContext)
{
- m_xORB = _rxORB;
+ m_xContext = rxContext;
}
//--------------------------------------------------------------------
bool OSQLParserClient::ensureLoaded() const
{
if ( !ODbtoolsClient::ensureLoaded() )
return false;
- m_xParser = getFactory()->createSQLParser(m_xORB,getParseContext());
+ m_xParser = getFactory()->createSQLParser(m_xContext,getParseContext());
return m_xParser.is();
}
diff --git a/svx/source/inc/gridcell.hxx b/svx/source/inc/gridcell.hxx
index 3e56d9895d51..49e8ada74b54 100644
--- a/svx/source/inc/gridcell.hxx
+++ b/svx/source/inc/gridcell.hxx
@@ -708,7 +708,7 @@ class DbFilterField
public:
TYPEINFO();
- DbFilterField(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB,DbGridColumn& _rColumn);
+ DbFilterField(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext, DbGridColumn& _rColumn);
virtual ~DbFilterField();
virtual void Init( Window& rParent, const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XRowSet >& xCursor );
diff --git a/svx/source/inc/sqlparserclient.hxx b/svx/source/inc/sqlparserclient.hxx
index d97ee70b53e0..0630eda44450 100644
--- a/svx/source/inc/sqlparserclient.hxx
+++ b/svx/source/inc/sqlparserclient.hxx
@@ -46,14 +46,14 @@ namespace svxform
{
private:
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xORB;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext;
protected:
mutable ::rtl::Reference< ::connectivity::simple::ISQLParser > m_xParser;
protected:
OSQLParserClient(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rxORB);
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext);
virtual bool ensureLoaded() const;
protected:
diff --git a/sw/source/core/bastyp/calc.cxx b/sw/source/core/bastyp/calc.cxx
index 65c3eac6b771..03149d5eeff4 100644
--- a/sw/source/core/bastyp/calc.cxx
+++ b/sw/source/core/bastyp/calc.cxx
@@ -260,7 +260,7 @@ SwCalc::SwCalc( SwDoc& rD )
::com::sun::star::lang::Locale aLocale( SvxCreateLocale( eLang ));
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xMSF(
::comphelper::getProcessServiceFactory() );
- pCharClass = new CharClass( xMSF, aLocale );
+ pCharClass = new CharClass( ::comphelper::getProcessComponentContext(), aLocale );
pLclData = new LocaleDataWrapper( xMSF, aLocale );
}
diff --git a/sw/source/core/bastyp/init.cxx b/sw/source/core/bastyp/init.cxx
index 3a725a731c09..117b7e02f3ef 100644
--- a/sw/source/core/bastyp/init.cxx
+++ b/sw/source/core/bastyp/init.cxx
@@ -810,9 +810,9 @@ CharClass& GetAppCharClass()
{
if ( !pAppCharClass )
{
- uno::Reference< lang::XMultiServiceFactory > xMSF = ::comphelper::getProcessServiceFactory();
pAppCharClass = new CharClass(
- xMSF, SwBreakIt::Get()->GetLocale( (LanguageType)GetAppLanguage() ));
+ ::comphelper::getProcessComponentContext(),
+ SwBreakIt::Get()->GetLocale( (LanguageType)GetAppLanguage() ));
}
return *pAppCharClass;
}
diff --git a/unotools/inc/unotools/charclass.hxx b/unotools/inc/unotools/charclass.hxx
index 5538e68f6351..744321091230 100644
--- a/unotools/inc/unotools/charclass.hxx
+++ b/unotools/inc/unotools/charclass.hxx
@@ -34,8 +34,8 @@
class String;
namespace com { namespace sun { namespace star {
- namespace lang {
- class XMultiServiceFactory;
+ namespace uno {
+ class XComponentContext;
}
}}}
@@ -70,13 +70,12 @@ class UNOTOOLS_DLLPUBLIC CharClass : private boost::noncopyable
{
::com::sun::star::lang::Locale aLocale;
::com::sun::star::uno::Reference< ::com::sun::star::i18n::XCharacterClassification > xCC;
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xSMgr;
mutable ::osl::Mutex aMutex;
public:
/// Preferred ctor with service manager specified
CharClass(
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & xSF,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > & rxContext,
const ::com::sun::star::lang::Locale& rLocale);
/// Depricated ctor, tries to get a process service manager or to load the
diff --git a/unotools/source/i18n/charclass.cxx b/unotools/source/i18n/charclass.cxx
index 7a873abd566d..fa718cb119d3 100644
--- a/unotools/source/i18n/charclass.cxx
+++ b/unotools/source/i18n/charclass.cxx
@@ -18,13 +18,12 @@
*/
+#include <comphelper/processfactory.hxx>
#include <unotools/charclass.hxx>
#include <tools/string.hxx>
#include <tools/debug.hxx>
-#include "instance.hxx"
-
-#define CHARCLASS_SERVICENAME "com.sun.star.i18n.CharacterClassification"
+#include <com/sun/star/i18n/CharacterClassification.hpp>
using namespace ::com::sun::star;
using namespace ::com::sun::star::i18n;
@@ -32,14 +31,12 @@ using namespace ::com::sun::star::uno;
CharClass::CharClass(
- const Reference< lang::XMultiServiceFactory > & xSF,
+ const Reference< uno::XComponentContext > & rxContext,
const lang::Locale& rLocale
)
- :
- xSMgr( xSF )
{
setLocale( rLocale );
- xCC = Reference< XCharacterClassification > ( intl_createInstance( xSMgr, CHARCLASS_SERVICENAME, "CharClass" ), uno::UNO_QUERY );
+ xCC = CharacterClassification::create( rxContext );
}
@@ -47,8 +44,7 @@ CharClass::CharClass(
const ::com::sun::star::lang::Locale& rLocale )
{
setLocale( rLocale );
- Reference< lang::XMultiServiceFactory > xNil;
- xCC = Reference< XCharacterClassification > ( intl_createInstance( xNil, CHARCLASS_SERVICENAME, "CharClass" ), uno::UNO_QUERY );
+ xCC = CharacterClassification::create( comphelper::getProcessComponentContext() );
}
diff --git a/unotools/source/misc/syslocale.cxx b/unotools/source/misc/syslocale.cxx
index ead6e92eeb3e..43950737e4b5 100644
--- a/unotools/source/misc/syslocale.cxx
+++ b/unotools/source/misc/syslocale.cxx
@@ -75,7 +75,7 @@ SvtSysLocale_Impl::~SvtSysLocale_Impl()
CharClass* SvtSysLocale_Impl::GetCharClass()
{
if ( !pCharClass )
- pCharClass = new CharClass(::comphelper::getProcessServiceFactory(), aSysLocaleOptions.GetRealLocale() );
+ pCharClass = new CharClass( aSysLocaleOptions.GetRealLocale() );
return pCharClass;
}
diff --git a/vcl/source/app/unohelp.cxx b/vcl/source/app/unohelp.cxx
index b0a30b188e38..c63bcc646cd4 100644
--- a/vcl/source/app/unohelp.cxx
+++ b/vcl/source/app/unohelp.cxx
@@ -36,7 +36,7 @@
#include <comphelper/processfactory.hxx>
#include <com/sun/star/i18n/BreakIterator.hpp>
-#include <com/sun/star/i18n/XCharacterClassification.hpp>
+#include <com/sun/star/i18n/CharacterClassification.hpp>
#include <com/sun/star/awt/XExtendedToolkit.hpp>
#include <com/sun/star/accessibility/AccessibleEventObject.hpp>
#include <com/sun/star/accessibility/AccessibleStateType.hpp>
@@ -55,15 +55,7 @@ uno::Reference < i18n::XBreakIterator > vcl::unohelper::CreateBreakIterator()
uno::Reference < i18n::XCharacterClassification > vcl::unohelper::CreateCharacterClassification()
{
- uno::Reference < i18n::XCharacterClassification > xB;
- uno::Reference< lang::XMultiServiceFactory > xMSF = comphelper::getProcessServiceFactory();
- uno::Reference < uno::XInterface > xI = xMSF->createInstance( ::rtl::OUString("com.sun.star.i18n.CharacterClassification") );
- if ( xI.is() )
- {
- uno::Any x = xI->queryInterface( ::getCppuType((const uno::Reference< i18n::XCharacterClassification >*)0) );
- x >>= xB;
- }
- return xB;
+ return i18n::CharacterClassification::create( comphelper::getProcessComponentContext() );
}
::rtl::OUString vcl::unohelper::CreateLibraryName( const sal_Char* pModName, sal_Bool bSUPD )
diff --git a/xmloff/source/core/xmluconv.cxx b/xmloff/source/core/xmluconv.cxx
index 7aa93280c769..fc8303d97af9 100644
--- a/xmloff/source/core/xmluconv.cxx
+++ b/xmloff/source/core/xmluconv.cxx
@@ -47,7 +47,7 @@
#include <com/sun/star/text/XDefaultNumberingProvider.hpp>
#include <com/sun/star/text/XNumberingTypeInfo.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/i18n/XCharacterClassification.hpp>
+#include <com/sun/star/i18n/CharacterClassification.hpp>
#include <com/sun/star/i18n/UnicodeType.hpp>
#include <basegfx/vector/b3dvector.hxx>
#include <comphelper/processfactory.hxx>
@@ -810,21 +810,9 @@ OUString SvXMLUnitConverter::encodeStyleName(
{
if (m_pImpl->m_xServiceFactory.is())
{
- try
- {
- const_cast < SvXMLUnitConverter * >(this)
- ->m_pImpl->m_xCharClass =
- Reference < XCharacterClassification >(
- m_pImpl->m_xServiceFactory->createInstance(
- OUString( "com.sun.star.i18n.CharacterClassification_Unicode") ),
- UNO_QUERY );
-
- OSL_ENSURE( m_pImpl->m_xCharClass.is(),
- "can't instantiate character clossification component" );
- }
- catch( com::sun::star::uno::Exception& )
- {
- }
+ const_cast < SvXMLUnitConverter * >(this)
+ ->m_pImpl->m_xCharClass = CharacterClassification::create(
+ comphelper::getComponentContext(m_pImpl->m_xServiceFactory) );
}
}
if (m_pImpl->m_xCharClass.is())
diff --git a/xmloff/source/style/xmlnumfe.cxx b/xmloff/source/style/xmlnumfe.cxx
index d2c1782890fa..4d6373d1f30b 100644
--- a/xmloff/source/style/xmlnumfe.cxx
+++ b/xmloff/source/style/xmlnumfe.cxx
@@ -245,7 +245,7 @@ SvXMLNumFmtExport::SvXMLNumFmtExport(
if ( pFormatter )
{
- pCharClass = new CharClass( pFormatter->GetServiceManager(),
+ pCharClass = new CharClass( comphelper::getComponentContext(pFormatter->GetServiceManager()),
pFormatter->GetLocale() );
pLocaleData = new LocaleDataWrapper( pFormatter->GetServiceManager(),
pFormatter->GetLocale() );
@@ -254,7 +254,7 @@ SvXMLNumFmtExport::SvXMLNumFmtExport(
{
lang::Locale aLocale( MsLangId::convertLanguageToLocale( MsLangId::getSystemLanguage() ) );
- pCharClass = new CharClass( rExport.getServiceFactory(), aLocale );
+ pCharClass = new CharClass( comphelper::getComponentContext(rExport.getServiceFactory()), aLocale );
pLocaleData = new LocaleDataWrapper( rExport.getServiceFactory(), aLocale );
}
@@ -280,7 +280,7 @@ SvXMLNumFmtExport::SvXMLNumFmtExport(
if ( pFormatter )
{
- pCharClass = new CharClass( pFormatter->GetServiceManager(),
+ pCharClass = new CharClass( comphelper::getComponentContext(pFormatter->GetServiceManager()),
pFormatter->GetLocale() );
pLocaleData = new LocaleDataWrapper( pFormatter->GetServiceManager(),
pFormatter->GetLocale() );
@@ -289,7 +289,7 @@ SvXMLNumFmtExport::SvXMLNumFmtExport(
{
lang::Locale aLocale( MsLangId::convertLanguageToLocale( MsLangId::getSystemLanguage() ) );
- pCharClass = new CharClass( rExport.getServiceFactory(), aLocale );
+ pCharClass = new CharClass( comphelper::getComponentContext(rExport.getServiceFactory()), aLocale );
pLocaleData = new LocaleDataWrapper( rExport.getServiceFactory(), aLocale );
}
diff --git a/xmloff/source/transform/TransformerBase.cxx b/xmloff/source/transform/TransformerBase.cxx
index 53323118c6cf..851ec4442e3f 100644
--- a/xmloff/source/transform/TransformerBase.cxx
+++ b/xmloff/source/transform/TransformerBase.cxx
@@ -28,7 +28,7 @@
#include <rtl/ref.hxx>
#include <rtl/ustrbuf.hxx>
-#include <com/sun/star/i18n/XCharacterClassification.hpp>
+#include <com/sun/star/i18n/CharacterClassification.hpp>
#include <com/sun/star/i18n/UnicodeType.hpp>
#include <com/sun/star/util/MeasureUnit.hpp>
#include <sax/tools/converter.hxx>
@@ -1062,49 +1062,27 @@ sal_Bool XMLTransformerBase::EncodeStyleName( OUString& rName ) const
{
if( !xCharClass.is() )
{
- Reference< XMultiServiceFactory > xFactory =
- comphelper::getProcessServiceFactory();
- if( xFactory.is() )
- {
- try
- {
- const_cast < XMLTransformerBase * >(this)
- ->xCharClass =
- Reference < XCharacterClassification >(
- xFactory->createInstance(
- OUString(
- "com.sun.star.i18n.CharacterClassification_Unicode") ),
- UNO_QUERY );
-
- OSL_ENSURE( xCharClass.is(),
- "can't instantiate character clossification component" );
- }
- catch( com::sun::star::uno::Exception& )
- {
- }
- }
+ const_cast < XMLTransformerBase * >(this)
+ ->xCharClass = CharacterClassification::create( comphelper::getProcessComponentContext() );
}
- if( xCharClass.is() )
- {
- sal_Int16 nType = xCharClass->getType( rName, i );
+ sal_Int16 nType = xCharClass->getType( rName, i );
- switch( nType )
- {
- case UnicodeType::UPPERCASE_LETTER: // Lu
- case UnicodeType::LOWERCASE_LETTER: // Ll
- case UnicodeType::TITLECASE_LETTER: // Lt
- case UnicodeType::OTHER_LETTER: // Lo
- case UnicodeType::LETTER_NUMBER: // Nl
- bValidChar = sal_True;
- break;
- case UnicodeType::NON_SPACING_MARK: // Ms
- case UnicodeType::ENCLOSING_MARK: // Me
- case UnicodeType::COMBINING_SPACING_MARK: //Mc
- case UnicodeType::MODIFIER_LETTER: // Lm
- case UnicodeType::DECIMAL_DIGIT_NUMBER: // Nd
- bValidChar = i > 0;
- break;
- }
+ switch( nType )
+ {
+ case UnicodeType::UPPERCASE_LETTER: // Lu
+ case UnicodeType::LOWERCASE_LETTER: // Ll
+ case UnicodeType::TITLECASE_LETTER: // Lt
+ case UnicodeType::OTHER_LETTER: // Lo
+ case UnicodeType::LETTER_NUMBER: // Nl
+ bValidChar = sal_True;
+ break;
+ case UnicodeType::NON_SPACING_MARK: // Ms
+ case UnicodeType::ENCLOSING_MARK: // Me
+ case UnicodeType::COMBINING_SPACING_MARK: //Mc
+ case UnicodeType::MODIFIER_LETTER: // Lm
+ case UnicodeType::DECIMAL_DIGIT_NUMBER: // Nd
+ bValidChar = i > 0;
+ break;
}
}
}