summaryrefslogtreecommitdiff
path: root/linguistic
diff options
context:
space:
mode:
authorIvo Hinkelmann <ihi@openoffice.org>2008-07-16 12:48:06 +0000
committerIvo Hinkelmann <ihi@openoffice.org>2008-07-16 12:48:06 +0000
commitad6a483c754f37142ab6738d967d763dcb230643 (patch)
tree7f8ec143f163f6792b1d732825065ff2ed494916 /linguistic
parentd738b91efc7db8040260ffb35d12bbfd69f662f8 (diff)
INTEGRATION: CWS tl55 (1.31.2); FILE MERGED
2008/06/13 15:20:17 tl 1.31.2.2: #i85999# grammart checking framework 2008/06/11 08:17:41 mba 1.31.2.1: some fixes
Diffstat (limited to 'linguistic')
-rw-r--r--linguistic/source/lngsvcmgr.cxx82
1 files changed, 47 insertions, 35 deletions
diff --git a/linguistic/source/lngsvcmgr.cxx b/linguistic/source/lngsvcmgr.cxx
index 185389338f..26787164bf 100644
--- a/linguistic/source/lngsvcmgr.cxx
+++ b/linguistic/source/lngsvcmgr.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: lngsvcmgr.cxx,v $
- * $Revision: 1.31 $
+ * $Revision: 1.32 $
*
* This file is part of OpenOffice.org.
*
@@ -858,20 +858,24 @@ void LngSvcMgr::GetAvailableSpellSvcs_Impl()
while (xEnum->hasMoreElements())
{
Any aCurrent = xEnum->nextElement();
+ Reference< XSingleComponentFactory > xCompFactory;
Reference< XSingleServiceFactory > xFactory;
- if (!::cppu::extractInterface( xFactory, aCurrent ) ||
- !xFactory.is())
- continue;
-
Reference< XSpellChecker > xSvc;
- try
- {
- xSvc = Reference< XSpellChecker >( xFactory->createInstance(), UNO_QUERY );
- }
- catch (uno::Exception &)
+ if ( cppu::extractInterface( xCompFactory, aCurrent ) || ::cppu::extractInterface( xFactory, aCurrent ) )
{
- DBG_ERROR( "createInstance failed" );
+ try
+ {
+ Reference < XComponentContext > xContext;
+ Reference< XPropertySet > xProps( xFac, UNO_QUERY );
+
+ xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ))) >>= xContext;
+ xSvc = Reference< XSpellChecker >( ( xCompFactory.is() ? xCompFactory->createInstanceWithContext( xContext ) : xFactory->createInstance() ), UNO_QUERY );
+ }
+ catch (uno::Exception &)
+ {
+ DBG_ERROR( "createInstance failed" );
+ }
}
if (xSvc.is())
@@ -905,35 +909,38 @@ void LngSvcMgr::GetAvailableHyphSvcs_Impl()
if (!pAvailHyphSvcs)
{
pAvailHyphSvcs = new SvcInfoArray;
-
Reference< XMultiServiceFactory > xFac( getProcessServiceFactory() );
if (xFac.is())
{
Reference< XContentEnumerationAccess > xEnumAccess( xFac, UNO_QUERY );
Reference< XEnumeration > xEnum;
if (xEnumAccess.is())
- xEnum = xEnumAccess->createContentEnumeration(
- A2OU( SN_HYPHENATOR ) );
+ xEnum = xEnumAccess->createContentEnumeration( A2OU( SN_HYPHENATOR ) );
if (xEnum.is())
{
while (xEnum->hasMoreElements())
{
Any aCurrent = xEnum->nextElement();
+ Reference< XSingleComponentFactory > xCompFactory;
Reference< XSingleServiceFactory > xFactory;
- if (!::cppu::extractInterface( xFactory, aCurrent ) ||
- !xFactory.is())
- continue;
-
Reference< XHyphenator > xSvc;
- try
+ if ( cppu::extractInterface( xCompFactory, aCurrent ) || ::cppu::extractInterface( xFactory, aCurrent ) )
{
- xSvc = Reference< XHyphenator >( xFactory->createInstance(), UNO_QUERY );
- }
- catch (uno::Exception &)
- {
- DBG_ERROR( "createInstance failed" );
+ try
+ {
+ Reference < XComponentContext > xContext;
+ Reference< XPropertySet > xProps( xFac, UNO_QUERY );
+
+ xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ))) >>= xContext;
+ xSvc = Reference< XHyphenator >( ( xCompFactory.is() ? xCompFactory->createInstanceWithContext( xContext ) : xFactory->createInstance() ), UNO_QUERY );
+
+ }
+ catch (uno::Exception &)
+ {
+ DBG_ERROR( "createInstance failed" );
+ }
}
if (xSvc.is())
@@ -982,22 +989,27 @@ void LngSvcMgr::GetAvailableThesSvcs_Impl()
while (xEnum->hasMoreElements())
{
Any aCurrent = xEnum->nextElement();
- Reference< XSingleServiceFactory > xFactory;
- if (!::cppu::extractInterface( xFactory, aCurrent ) ||
- !xFactory.is())
- continue;
+ Reference< XSingleComponentFactory > xCompFactory;
+ Reference< XSingleServiceFactory > xFactory;
Reference< XThesaurus > xSvc;
- try
- {
- xSvc = Reference< XThesaurus >( xFactory->createInstance(), UNO_QUERY );
- }
- catch (uno::Exception &)
+ if ( cppu::extractInterface( xCompFactory, aCurrent ) || ::cppu::extractInterface( xFactory, aCurrent ) )
{
- DBG_ERROR( "createInstance failed" );
+ try
+ {
+ Reference < XComponentContext > xContext;
+ Reference< XPropertySet > xProps( xFac, UNO_QUERY );
+
+ xProps->getPropertyValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ))) >>= xContext;
+ xSvc = Reference< XThesaurus >( ( xCompFactory.is() ? xCompFactory->createInstanceWithContext( xContext ) : xFactory->createInstance() ), UNO_QUERY );
+ }
+ catch (uno::Exception &)
+ {
+ DBG_ERROR( "createInstance failed" );
+ }
}
-
+
if (xSvc.is())
{
OUString aImplName;