[Libreoffice-commits] core.git: 7 commits - basic/source cui/source editeng/source framework/inc framework/source include/editeng include/linguistic linguistic/inc linguistic/source offapi/com offapi/type_reference offapi/UnoApi_offapi.mk
Noel Grandin
noel at peralex.com
Mon May 13 23:10:14 PDT 2013
basic/source/inc/dlgcont.hxx | 4
basic/source/inc/namecont.hxx | 8
basic/source/inc/scriptcont.hxx | 4
basic/source/uno/dlgcont.cxx | 46 +-
basic/source/uno/namecont.cxx | 28 -
basic/source/uno/scriptcont.cxx | 16
cui/source/customize/cfg.cxx | 8
cui/source/dialogs/insdlg.cxx | 51 +-
cui/source/options/certpath.cxx | 7
cui/source/options/optlingu.cxx | 15
cui/source/options/treeopt.cxx | 34 -
editeng/source/editeng/edtspell.cxx | 1
editeng/source/misc/splwrap.cxx | 19 -
editeng/source/misc/unolingu.cxx | 13
framework/inc/services.h | 2
framework/source/uiconfiguration/imagemanager.cxx | 3
include/editeng/unolingu.hxx | 9
include/linguistic/misc.hxx | 4
linguistic/inc/iprcache.hxx | 5
linguistic/source/convdic.cxx | 1
linguistic/source/gciterator.cxx | 14
linguistic/source/gciterator.hxx | 5
linguistic/source/hyphdsp.cxx | 192 +++++------
linguistic/source/hyphdsp.hxx | 6
linguistic/source/iprcache.cxx | 10
linguistic/source/lngopt.cxx | 26 +
linguistic/source/lngopt.hxx | 81 ++++
linguistic/source/lngsvcmgr.cxx | 324 ++++++++-----------
linguistic/source/misc.cxx | 33 -
linguistic/source/spelldsp.cxx | 240 ++++++--------
linguistic/source/thesdsp.cxx | 65 +--
offapi/UnoApi_offapi.mk | 5
offapi/com/sun/star/linguistic2/LinguProperties.idl | 110 ------
offapi/com/sun/star/linguistic2/XLinguProperties.idl | 122 +++++++
offapi/com/sun/star/setup/UpdateCheck.idl | 39 ++
offapi/com/sun/star/ui/ImageManager.idl | 37 ++
offapi/type_reference/offapi.rdb |binary
37 files changed, 840 insertions(+), 747 deletions(-)
New commits:
commit 4460f213df777f569fa2a2091885c29c7653637f
Author: Noel Grandin <noel at peralex.com>
Date: Mon May 13 16:51:26 2013 +0200
fdo#46808, use XComponentContext in SfxLibraryContainer
Change-Id: I6f66fc69a40e2cd2ef2372e0413ff95b6202c5c5
diff --git a/basic/source/inc/namecont.hxx b/basic/source/inc/namecont.hxx
index 5bbb4ff..4ac8d09 100644
--- a/basic/source/inc/namecont.hxx
+++ b/basic/source/inc/namecont.hxx
@@ -218,7 +218,7 @@ class SfxLibraryContainer : public SfxLibraryContainer_BASE, public ::utl::OEven
sal_Bool mbVBACompat;
OUString msProjectName;
protected:
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxMSF;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > mxContext;
::com::sun::star::uno::Reference< ::com::sun::star::ucb::XSimpleFileAccess3 > mxSFI;
::com::sun::star::uno::Reference< ::com::sun::star::util::XMacroExpander > mxMacroExpander;
::com::sun::star::uno::Reference< ::com::sun::star::util::XStringSubstitution > mxStringSubstitution;
diff --git a/basic/source/uno/dlgcont.cxx b/basic/source/uno/dlgcont.cxx
index bc598c4..1193756 100644
--- a/basic/source/uno/dlgcont.cxx
+++ b/basic/source/uno/dlgcont.cxx
@@ -87,7 +87,7 @@ SfxDialogLibraryContainer::SfxDialogLibraryContainer( const uno::Reference< embe
// Methods to get library instances of the correct type
SfxLibrary* SfxDialogLibraryContainer::implCreateLibrary( const OUString& aName )
{
- SfxLibrary* pRet = new SfxDialogLibrary( maModifiable, aName, comphelper::getComponentContext(mxMSF), mxSFI, this );
+ SfxLibrary* pRet = new SfxDialogLibrary( maModifiable, aName, mxContext, mxSFI, this );
return pRet;
}
@@ -96,7 +96,7 @@ SfxLibrary* SfxDialogLibraryContainer::implCreateLibraryLink
const OUString& StorageURL, sal_Bool ReadOnly )
{
SfxLibrary* pRet = new SfxDialogLibrary
- ( maModifiable, aName, comphelper::getComponentContext(mxMSF), mxSFI, aLibInfoFileURL, StorageURL, ReadOnly, this );
+ ( maModifiable, aName, mxContext, mxSFI, aLibInfoFileURL, StorageURL, ReadOnly, this );
return pRet;
}
@@ -236,17 +236,17 @@ void SfxDialogLibraryContainer::storeLibrariesToStorage( const uno::Reference< e
if ( xISP.is() )
{
Reference< io::XInputStream > xInput( xISP->createInputStream() );
- Reference< XNameContainer > xDialogModel( mxMSF->createInstance
- ( OUString( "com.sun.star.awt.UnoControlDialogModel" ) ) , UNO_QUERY );
- Reference< XComponentContext > xContext( comphelper::getComponentContext( mxMSF ) );
- ::xmlscript::importDialogModel( xInput, xDialogModel, xContext, mxOwnerDocument );
+ Reference< XNameContainer > xDialogModel(
+ mxContext->getServiceManager()->createInstanceWithContext("com.sun.star.awt.UnoControlDialogModel", mxContext),
+ UNO_QUERY );
+ ::xmlscript::importDialogModel( xInput, xDialogModel, mxContext, mxOwnerDocument );
std::vector< OUString > vEmbeddedImageURLs;
GraphicObject::InspectForGraphicObjectImageURL( Reference< XInterface >( xDialogModel, UNO_QUERY ), vEmbeddedImageURLs );
if ( !vEmbeddedImageURLs.empty() )
{
// Export the images to the storage
Reference< document::XGraphicObjectResolver > xGraphicResolver =
- document::GraphicObjectResolver::createWithStorage( xContext, xStorage );
+ document::GraphicObjectResolver::createWithStorage( mxContext, xStorage );
std::vector< OUString >::iterator it = vEmbeddedImageURLs.begin();
std::vector< OUString >::iterator it_end = vEmbeddedImageURLs.end();
if ( xGraphicResolver.is() )
@@ -278,10 +278,11 @@ Any SAL_CALL SfxDialogLibraryContainer::importLibraryElement
// return aRetAny;
//}
- Reference< XParser > xParser = xml::sax::Parser::create( comphelper::getComponentContext(mxMSF) );
+ Reference< XParser > xParser = xml::sax::Parser::create( mxContext );
- Reference< XNameContainer > xDialogModel( mxMSF->createInstance
- ( OUString( "com.sun.star.awt.UnoControlDialogModel" ) ), UNO_QUERY );
+ Reference< XNameContainer > xDialogModel(
+ mxContext->getServiceManager()->createInstanceWithContext("com.sun.star.awt.UnoControlDialogModel", mxContext),
+ UNO_QUERY );
if( !xDialogModel.is() )
{
OSL_FAIL( "### couldn't create com.sun.star.awt.UnoControlDialogModel component\n" );
@@ -312,16 +313,13 @@ Any SAL_CALL SfxDialogLibraryContainer::importLibraryElement
if( !xInput.is() )
return aRetAny;
- Reference< XComponentContext > xContext(
- comphelper::getComponentContext( mxMSF ) );
-
InputSource source;
source.aInputStream = xInput;
source.sSystemId = aFile;
try {
// start parsing
- xParser->setDocumentHandler( ::xmlscript::importDialogModel( xDialogModel, xContext, mxOwnerDocument ) );
+ xParser->setDocumentHandler( ::xmlscript::importDialogModel( xDialogModel, mxContext, mxOwnerDocument ) );
xParser->parseStream( source );
}
catch(const Exception& )
@@ -335,7 +333,7 @@ Any SAL_CALL SfxDialogLibraryContainer::importLibraryElement
// Create InputStream, TODO: Implement own InputStreamProvider
// to avoid creating the DialogModel here!
- Reference< XInputStreamProvider > xISP = ::xmlscript::exportDialogModel( xDialogModel, xContext, mxOwnerDocument );
+ Reference< XInputStreamProvider > xISP = ::xmlscript::exportDialogModel( xDialogModel, mxContext, mxOwnerDocument );
aRetAny <<= xISP;
return aRetAny;
}
@@ -377,8 +375,9 @@ Reference< ::com::sun::star::resource::XStringResourcePersistence >
aArgs[4] <<= aComment;
// TODO: Ctor
- xRet = Reference< resource::XStringResourcePersistence >( mxMSF->createInstance
- ( OUString("com.sun.star.resource.StringResourceWithStorage") ), UNO_QUERY );
+ xRet = Reference< resource::XStringResourcePersistence >(
+ mxContext->getServiceManager()->createInstanceWithContext("com.sun.star.resource.StringResourceWithStorage", mxContext),
+ UNO_QUERY );
uno::Reference< embed::XStorage > xLibrariesStor;
uno::Reference< embed::XStorage > xLibraryStor;
@@ -425,8 +424,9 @@ Reference< ::com::sun::star::resource::XStringResourcePersistence >
aArgs[5] <<= xDummyHandler;
// TODO: Ctor
- xRet = Reference< resource::XStringResourcePersistence >( mxMSF->createInstance
- ( OUString("com.sun.star.resource.StringResourceWithLocation") ), UNO_QUERY );
+ xRet = Reference< resource::XStringResourcePersistence >(
+ mxContext->getServiceManager()->createInstanceWithContext("com.sun.star.resource.StringResourceWithLocation", mxContext),
+ UNO_QUERY );
// TODO: Ctor
if( xRet.is() )
diff --git a/basic/source/uno/namecont.cxx b/basic/source/uno/namecont.cxx
index 2e0a8f2..69e8fbf 100644
--- a/basic/source/uno/namecont.cxx
+++ b/basic/source/uno/namecont.cxx
@@ -387,12 +387,11 @@ SfxLibraryContainer::SfxLibraryContainer( void )
{
DBG_CTOR( SfxLibraryContainer, NULL );
- mxMSF = comphelper::getProcessServiceFactory();
- SAL_WARN_IF(!mxMSF.is(), "basic", "couldn't get ProcessServiceFactory");
+ mxContext = comphelper::getProcessComponentContext();
- mxSFI = ucb::SimpleFileAccess::create( comphelper::getComponentContext(mxMSF) );
+ mxSFI = ucb::SimpleFileAccess::create( mxContext );
- mxStringSubstitution = util::PathSubstitution::create( comphelper::getComponentContext(mxMSF) );
+ mxStringSubstitution = util::PathSubstitution::create( mxContext );
}
SfxLibraryContainer::~SfxLibraryContainer()
@@ -686,7 +685,7 @@ void SfxLibraryContainer::init_Impl( const OUString& rInitialDocumentURL,
maLibraryPath = SvtPathOptions().GetBasicPath();
}
- Reference< XParser > xParser = xml::sax::Parser::create(comphelper::getComponentContext(mxMSF));
+ Reference< XParser > xParser = xml::sax::Parser::create(mxContext);
uno::Reference< io::XInputStream > xInput;
@@ -1578,7 +1577,7 @@ void SfxLibraryContainer::implStoreLibraryIndexFile( SfxLibrary* pLib,
Reference< XSimpleFileAccess3 > xToUseSFI )
{
// Create sax writer
- Reference< XWriter > xWriter = xml::sax::Writer::create(comphelper::getComponentContext(mxMSF));
+ Reference< XWriter > xWriter = xml::sax::Writer::create(mxContext);
sal_Bool bLink = pLib->mbLink;
bool bStorage = xStorage.is() && !bLink;
@@ -1678,7 +1677,7 @@ bool SfxLibraryContainer::implLoadLibraryIndexFile( SfxLibrary* pLib,
const uno::Reference< embed::XStorage >& xStorage,
const OUString& aIndexFileName )
{
- Reference< XParser > xParser = xml::sax::Parser::create(comphelper::getComponentContext(mxMSF));
+ Reference< XParser > xParser = xml::sax::Parser::create(mxContext);
sal_Bool bLink = sal_False;
bool bStorage = false;
@@ -2051,7 +2050,7 @@ void SfxLibraryContainer::storeLibraries_Impl( const uno::Reference< embed::XSto
// Write library container info
// Create sax writer
- Reference< XWriter > xWriter = xml::sax::Writer::create(comphelper::getComponentContext(mxMSF));
+ Reference< XWriter > xWriter = xml::sax::Writer::create(mxContext);
// Write info file
uno::Reference< io::XOutputStream > xOut;
@@ -2800,7 +2799,7 @@ void SAL_CALL SfxLibraryContainer::exportLibrary( const OUString& Name, const OU
Reference< XSimpleFileAccess3 > xToUseSFI;
if( Handler.is() )
{
- xToUseSFI = ucb::SimpleFileAccess::create( comphelper::getComponentContext(mxMSF) );
+ xToUseSFI = ucb::SimpleFileAccess::create( mxContext );
xToUseSFI->setInteractionHandler( Handler );
}
@@ -2834,8 +2833,7 @@ OUString SfxLibraryContainer::expand_url( const OUString& url )
{
if( !mxMacroExpander.is() )
{
- Reference< XComponentContext > xContext(comphelper::getComponentContext( mxMSF ) );
- Reference< util::XMacroExpander > xExpander = util::theMacroExpander::get(xContext);
+ Reference< util::XMacroExpander > xExpander = util::theMacroExpander::get(mxContext);
MutexGuard guard( Mutex::getGlobalMutex() );
if( !mxMacroExpander.is() )
{
diff --git a/basic/source/uno/scriptcont.cxx b/basic/source/uno/scriptcont.cxx
index 982913c..793577f 100644
--- a/basic/source/uno/scriptcont.cxx
+++ b/basic/source/uno/scriptcont.cxx
@@ -144,7 +144,7 @@ SfxScriptLibraryContainer::SfxScriptLibraryContainer( const uno::Reference< embe
SfxLibrary* SfxScriptLibraryContainer::implCreateLibrary( const OUString& aName )
{
(void)aName; // Only needed for SfxDialogLibrary
- SfxLibrary* pRet = new SfxScriptLibrary( maModifiable, comphelper::getComponentContext(mxMSF), mxSFI );
+ SfxLibrary* pRet = new SfxScriptLibrary( maModifiable, mxContext, mxSFI );
return pRet;
}
@@ -154,7 +154,7 @@ SfxLibrary* SfxScriptLibraryContainer::implCreateLibraryLink( const OUString& aN
sal_Bool ReadOnly )
{
(void)aName; // Only needed for SfxDialogLibrary
- SfxLibrary* pRet = new SfxScriptLibrary( maModifiable, comphelper::getComponentContext(mxMSF), mxSFI,
+ SfxLibrary* pRet = new SfxScriptLibrary( maModifiable, mxContext, mxSFI,
aLibInfoFileURL, StorageURL, ReadOnly );
return pRet;
}
@@ -178,7 +178,7 @@ void SAL_CALL SfxScriptLibraryContainer::writeLibraryElement( const Reference <
throw(Exception)
{
// Create sax writer
- Reference< XWriter > xWriter = xml::sax::Writer::create(comphelper::getComponentContext(mxMSF));
+ Reference< XWriter > xWriter = xml::sax::Writer::create(mxContext);
Reference< XTruncate > xTruncate( xOutput, UNO_QUERY );
OSL_ENSURE( xTruncate.is(), "Currently only the streams that can be truncated are expected!" );
@@ -229,7 +229,7 @@ Any SAL_CALL SfxScriptLibraryContainer::importLibraryElement
{
Any aRetAny;
- Reference< XParser > xParser = xml::sax::Parser::create( comphelper::getComponentContext(mxMSF) );
+ Reference< XParser > xParser = xml::sax::Parser::create( mxContext );
// Read from storage?
sal_Bool bStorage = xInStream.is();
commit 67042f1f0314da51dbea6602ddcdd0a4ab347bc7
Author: Noel Grandin <noel at peralex.com>
Date: Mon May 13 16:29:28 2013 +0200
fdo#46808, replace XMultiServiceFactory with XComponentContext is SfxLibrary
Change-Id: I150d86b4ae4004e7c39ec6a3ed7fba31029f8ab1
diff --git a/basic/source/inc/dlgcont.hxx b/basic/source/inc/dlgcont.hxx
index 7b7fcdd..9c5256b 100644
--- a/basic/source/inc/dlgcont.hxx
+++ b/basic/source/inc/dlgcont.hxx
@@ -124,7 +124,7 @@ public:
(
ModifiableHelper& _rModifiable,
const OUString& aName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xMSF,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext,
const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XSimpleFileAccess3 >& xSFI,
SfxDialogLibraryContainer* pParent
);
@@ -133,7 +133,7 @@ public:
(
ModifiableHelper& _rModifiable,
const OUString& aName,
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xMSF,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext,
const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XSimpleFileAccess3 >& xSFI,
const OUString& aLibInfoFileURL, const OUString& aStorageURL, sal_Bool ReadOnly,
SfxDialogLibraryContainer* pParent
diff --git a/basic/source/inc/namecont.hxx b/basic/source/inc/namecont.hxx
index 8db2839..5bbb4ff 100644
--- a/basic/source/inc/namecont.hxx
+++ b/basic/source/inc/namecont.hxx
@@ -559,7 +559,7 @@ class SfxLibrary
friend class SfxDialogLibraryContainer;
friend class SfxScriptLibraryContainer;
- ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxMSF;
+ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > mxContext;
::com::sun::star::uno::Reference< ::com::sun::star::ucb::XSimpleFileAccess3 > mxSFI;
ModifiableHelper& mrModifiable;
@@ -620,13 +620,13 @@ public:
SfxLibrary(
ModifiableHelper& _rModifiable,
const ::com::sun::star::uno::Type& aType,
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xMSF,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext,
const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XSimpleFileAccess3 >& xSFI
);
SfxLibrary(
ModifiableHelper& _rModifiable,
const ::com::sun::star::uno::Type& aType,
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xMSF,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext,
const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XSimpleFileAccess3 >& xSFI,
const OUString& aLibInfoFileURL,
const OUString& aStorageURL,
diff --git a/basic/source/inc/scriptcont.hxx b/basic/source/inc/scriptcont.hxx
index f332612..3e72904 100644
--- a/basic/source/inc/scriptcont.hxx
+++ b/basic/source/inc/scriptcont.hxx
@@ -159,14 +159,14 @@ public:
SfxScriptLibrary
(
ModifiableHelper& _rModifiable,
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xMSF,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext,
const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XSimpleFileAccess3 >& xSFI
);
SfxScriptLibrary
(
ModifiableHelper& _rModifiable,
- const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xMSF,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext,
const ::com::sun::star::uno::Reference< ::com::sun::star::ucb::XSimpleFileAccess3 >& xSFI,
const OUString& aLibInfoFileURL, const OUString& aStorageURL, sal_Bool ReadOnly
);
diff --git a/basic/source/uno/dlgcont.cxx b/basic/source/uno/dlgcont.cxx
index 2c0054d..bc598c4 100644
--- a/basic/source/uno/dlgcont.cxx
+++ b/basic/source/uno/dlgcont.cxx
@@ -87,7 +87,7 @@ SfxDialogLibraryContainer::SfxDialogLibraryContainer( const uno::Reference< embe
// Methods to get library instances of the correct type
SfxLibrary* SfxDialogLibraryContainer::implCreateLibrary( const OUString& aName )
{
- SfxLibrary* pRet = new SfxDialogLibrary( maModifiable, aName, mxMSF, mxSFI, this );
+ SfxLibrary* pRet = new SfxDialogLibrary( maModifiable, aName, comphelper::getComponentContext(mxMSF), mxSFI, this );
return pRet;
}
@@ -96,7 +96,7 @@ SfxLibrary* SfxDialogLibraryContainer::implCreateLibraryLink
const OUString& StorageURL, sal_Bool ReadOnly )
{
SfxLibrary* pRet = new SfxDialogLibrary
- ( maModifiable, aName, mxMSF, mxSFI, aLibInfoFileURL, StorageURL, ReadOnly, this );
+ ( maModifiable, aName, comphelper::getComponentContext(mxMSF), mxSFI, aLibInfoFileURL, StorageURL, ReadOnly, this );
return pRet;
}
@@ -533,10 +533,10 @@ Reference< XInterface > SAL_CALL SfxDialogLibraryContainer::Create( const Refere
// Ctor
SfxDialogLibrary::SfxDialogLibrary( ModifiableHelper& _rModifiable,
const OUString& aName,
- const Reference< XMultiServiceFactory >& xMSF,
+ const Reference< XComponentContext >& xContext,
const Reference< XSimpleFileAccess3 >& xSFI,
SfxDialogLibraryContainer* pParent )
- : SfxLibrary( _rModifiable, getCppuType( (const Reference< XInputStreamProvider > *)0 ), xMSF, xSFI )
+ : SfxLibrary( _rModifiable, getCppuType( (const Reference< XInputStreamProvider > *)0 ), xContext, xSFI )
, m_pParent( pParent )
, m_aName( aName )
{
@@ -544,14 +544,14 @@ SfxDialogLibrary::SfxDialogLibrary( ModifiableHelper& _rModifiable,
SfxDialogLibrary::SfxDialogLibrary( ModifiableHelper& _rModifiable,
const OUString& aName,
- const Reference< XMultiServiceFactory >& xMSF,
+ const Reference< XComponentContext >& xContext,
const Reference< XSimpleFileAccess3 >& xSFI,
const OUString& aLibInfoFileURL,
const OUString& aStorageURL,
sal_Bool ReadOnly,
SfxDialogLibraryContainer* pParent )
: SfxLibrary( _rModifiable, getCppuType( (const Reference< XInputStreamProvider > *)0 ),
- xMSF, xSFI, aLibInfoFileURL, aStorageURL, ReadOnly)
+ xContext, xSFI, aLibInfoFileURL, aStorageURL, ReadOnly)
, m_pParent( pParent )
, m_aName( aName )
{
diff --git a/basic/source/uno/namecont.cxx b/basic/source/uno/namecont.cxx
index 8c01873..2e0a8f2 100644
--- a/basic/source/uno/namecont.cxx
+++ b/basic/source/uno/namecont.cxx
@@ -2999,9 +2999,9 @@ sal_Bool SAL_CALL SfxLibraryContainer::supportsService( const OUString& _rServic
// Ctor
SfxLibrary::SfxLibrary( ModifiableHelper& _rModifiable, const Type& aType,
- const Reference< XMultiServiceFactory >& xMSF, const Reference< XSimpleFileAccess3 >& xSFI )
+ const Reference< XComponentContext >& xContext, const Reference< XSimpleFileAccess3 >& xSFI )
: OComponentHelper( m_aMutex )
- , mxMSF( xMSF )
+ , mxContext( xContext )
, mxSFI( xSFI )
, mrModifiable( _rModifiable )
, maNameContainer( aType )
@@ -3021,10 +3021,10 @@ SfxLibrary::SfxLibrary( ModifiableHelper& _rModifiable, const Type& aType,
}
SfxLibrary::SfxLibrary( ModifiableHelper& _rModifiable, const Type& aType,
- const Reference< XMultiServiceFactory >& xMSF, const Reference< XSimpleFileAccess3 >& xSFI,
+ const Reference< XComponentContext >& xContext, const Reference< XSimpleFileAccess3 >& xSFI,
const OUString& aLibInfoFileURL, const OUString& aStorageURL, sal_Bool ReadOnly )
: OComponentHelper( m_aMutex )
- , mxMSF( xMSF )
+ , mxContext( xContext )
, mxSFI( xSFI )
, mrModifiable( _rModifiable )
, maNameContainer( aType )
diff --git a/basic/source/uno/scriptcont.cxx b/basic/source/uno/scriptcont.cxx
index 75b3828..982913c 100644
--- a/basic/source/uno/scriptcont.cxx
+++ b/basic/source/uno/scriptcont.cxx
@@ -144,7 +144,7 @@ SfxScriptLibraryContainer::SfxScriptLibraryContainer( const uno::Reference< embe
SfxLibrary* SfxScriptLibraryContainer::implCreateLibrary( const OUString& aName )
{
(void)aName; // Only needed for SfxDialogLibrary
- SfxLibrary* pRet = new SfxScriptLibrary( maModifiable, mxMSF, mxSFI );
+ SfxLibrary* pRet = new SfxScriptLibrary( maModifiable, comphelper::getComponentContext(mxMSF), mxSFI );
return pRet;
}
@@ -154,7 +154,7 @@ SfxLibrary* SfxScriptLibraryContainer::implCreateLibraryLink( const OUString& aN
sal_Bool ReadOnly )
{
(void)aName; // Only needed for SfxDialogLibrary
- SfxLibrary* pRet = new SfxScriptLibrary( maModifiable, mxMSF, mxSFI,
+ SfxLibrary* pRet = new SfxScriptLibrary( maModifiable, comphelper::getComponentContext(mxMSF), mxSFI,
aLibInfoFileURL, StorageURL, ReadOnly );
return pRet;
}
@@ -1231,21 +1231,21 @@ Reference< XInterface > SAL_CALL SfxScriptLibraryContainer::Create( const Refere
// Ctor
SfxScriptLibrary::SfxScriptLibrary( ModifiableHelper& _rModifiable,
- const Reference< XMultiServiceFactory >& xMSF,
+ const Reference< XComponentContext >& xContext,
const Reference< XSimpleFileAccess3 >& xSFI )
- : SfxLibrary( _rModifiable, getCppuType( (const OUString *)0 ), xMSF, xSFI )
+ : SfxLibrary( _rModifiable, getCppuType( (const OUString *)0 ), xContext, xSFI )
, mbLoadedSource( false )
, mbLoadedBinary( false )
{
}
SfxScriptLibrary::SfxScriptLibrary( ModifiableHelper& _rModifiable,
- const Reference< XMultiServiceFactory >& xMSF,
+ const Reference< XComponentContext >& xContext,
const Reference< XSimpleFileAccess3 >& xSFI,
const OUString& aLibInfoFileURL,
const OUString& aStorageURL,
sal_Bool ReadOnly )
- : SfxLibrary( _rModifiable, getCppuType( (const OUString *)0 ), xMSF, xSFI,
+ : SfxLibrary( _rModifiable, getCppuType( (const OUString *)0 ), xContext, xSFI,
aLibInfoFileURL, aStorageURL, ReadOnly)
, mbLoadedSource( false )
, mbLoadedBinary( false )
commit 0fd6fc3776ada4682e7286f9a0aaaf4c07b42643
Author: Noel Grandin <noel at peralex.com>
Date: Mon May 13 15:13:34 2013 +0200
fdo#46808, Convert some XMultiServiceFactory to XComponentContext
Change-Id: Ia66283321d4d18d929b2e3406ad420627f73a3fd
diff --git a/linguistic/source/convdic.cxx b/linguistic/source/convdic.cxx
index 502a1b6..c21df30 100644
--- a/linguistic/source/convdic.cxx
+++ b/linguistic/source/convdic.cxx
@@ -237,7 +237,6 @@ void ConvDic::Save()
DBG_ASSERT(!INetURLObject( aMainURL ).HasError(), "invalid URL");
uno::Reference< uno::XComponentContext > xContext( comphelper::getProcessComponentContext() );
- uno::Reference< lang::XMultiServiceFactory > xServiceFactory( comphelper::getProcessServiceFactory() );
// get XOutputStream stream
uno::Reference< io::XStream > xStream;
diff --git a/linguistic/source/gciterator.cxx b/linguistic/source/gciterator.cxx
index 41214d6..4c08a9e 100644
--- a/linguistic/source/gciterator.cxx
+++ b/linguistic/source/gciterator.cxx
@@ -233,8 +233,7 @@ static lang::Locale lcl_GetPrimaryLanguageOfSentence(
}
-GrammarCheckingIterator::GrammarCheckingIterator( const uno::Reference< lang::XMultiServiceFactory > & rxMgr ) :
- m_xMSF( rxMgr ),
+GrammarCheckingIterator::GrammarCheckingIterator() :
m_bEnd( sal_False ),
m_aCurCheckedDocId(),
m_bGCServicesChecked( sal_False ),
@@ -459,10 +458,10 @@ uno::Reference< linguistic2::XProofreader > GrammarCheckingIterator::GetGrammarC
{
try
{
- uno::Reference< lang::XMultiServiceFactory > xMgr(
- comphelper::getProcessServiceFactory(), uno::UNO_QUERY_THROW );
+ uno::Reference< uno::XComponentContext > xContext( comphelper::getProcessComponentContext() );
uno::Reference< linguistic2::XProofreader > xGC(
- xMgr->createInstance( aSvcImplName ), uno::UNO_QUERY_THROW );
+ xContext->getServiceManager()->createInstanceWithContext(aSvcImplName, xContext),
+ uno::UNO_QUERY_THROW );
uno::Reference< linguistic2::XSupportedLocales > xSuppLoc( xGC, uno::UNO_QUERY_THROW );
if (xSuppLoc->hasLocale( rLocale ))
@@ -901,7 +900,6 @@ throw (uno::RuntimeException)
// releaase all UNO references
- m_xMSF.clear();
m_xBreakIterator.clear();
// clear containers with UNO references AND have those references released
@@ -1131,10 +1129,10 @@ static uno::Sequence< OUString > GrammarCheckingIterator_getSupportedServiceName
static uno::Reference< uno::XInterface > SAL_CALL GrammarCheckingIterator_createInstance(
- const uno::Reference< lang::XMultiServiceFactory > & rxSMgr )
+ const uno::Reference< lang::XMultiServiceFactory > & /*rxSMgr*/ )
throw(uno::Exception)
{
- return static_cast< ::cppu::OWeakObject * >(new GrammarCheckingIterator( rxSMgr ));
+ return static_cast< ::cppu::OWeakObject * >(new GrammarCheckingIterator());
}
diff --git a/linguistic/source/gciterator.hxx b/linguistic/source/gciterator.hxx
index 59680bb..cf2f807 100644
--- a/linguistic/source/gciterator.hxx
+++ b/linguistic/source/gciterator.hxx
@@ -83,9 +83,6 @@ class GrammarCheckingIterator:
>,
public LinguDispatcher
{
- com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > m_xMSF;
-
-
//the queue is keeping track of all senteces to be checked
//every element of this queue is a FlatParagraphEntry struct-object
typedef std::deque< FPEntry > FPQueue_t;
@@ -153,7 +150,7 @@ public:
void DequeueAndCheck();
- explicit GrammarCheckingIterator( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > & rxMgr );
+ explicit GrammarCheckingIterator();
virtual ~GrammarCheckingIterator();
// XProofreadingIterator
diff --git a/linguistic/source/hyphdsp.cxx b/linguistic/source/hyphdsp.cxx
index 75cd945..7b5c0a9 100644
--- a/linguistic/source/hyphdsp.cxx
+++ b/linguistic/source/hyphdsp.cxx
@@ -321,44 +321,43 @@ Reference< XHyphenatedWord > SAL_CALL
{
Reference< XHyphenator > *pRef = pEntry->aSvcRefs.getArray();
- Reference< XMultiServiceFactory > xMgr(
- comphelper::getProcessServiceFactory() );
- if (xMgr.is())
- {
- // build service initialization argument
- Sequence< Any > aArgs(2);
- aArgs.getArray()[0] <<= GetPropSet();
+ Reference< XComponentContext > xContext(
+ comphelper::getProcessComponentContext() );
- // create specific service via it's implementation name
- try
- {
- xHyph = Reference< XHyphenator >(
- xMgr->createInstanceWithArguments(
- pEntry->aSvcImplNames[0], aArgs ), UNO_QUERY );
- }
- catch (uno::Exception &)
- {
- DBG_ASSERT( 0, "createInstanceWithArguments failed" );
- }
- pRef [i] = xHyph;
+ // build service initialization argument
+ Sequence< Any > aArgs(2);
+ aArgs.getArray()[0] <<= GetPropSet();
- Reference< XLinguServiceEventBroadcaster >
- xBroadcaster( xHyph, UNO_QUERY );
- if (xBroadcaster.is())
- rMgr.AddLngSvcEvtBroadcaster( xBroadcaster );
+ // create specific service via it's implementation name
+ try
+ {
+ xHyph = Reference< XHyphenator >(
+ xContext->getServiceManager()->createInstanceWithArgumentsAndContext(
+ pEntry->aSvcImplNames[0], aArgs, xContext ),
+ UNO_QUERY );
+ }
+ catch (uno::Exception &)
+ {
+ DBG_ASSERT( 0, "createInstanceWithArguments failed" );
+ }
+ pRef [i] = xHyph;
- if (xHyph.is() && xHyph->hasLocale( rLocale ))
- xRes = xHyph->hyphenate( aChkWord, rLocale, nChkMaxLeading,
- rProperties );
+ Reference< XLinguServiceEventBroadcaster >
+ xBroadcaster( xHyph, UNO_QUERY );
+ if (xBroadcaster.is())
+ rMgr.AddLngSvcEvtBroadcaster( xBroadcaster );
+
+ if (xHyph.is() && xHyph->hasLocale( rLocale ))
+ xRes = xHyph->hyphenate( aChkWord, rLocale, nChkMaxLeading,
+ rProperties );
- pEntry->nLastTriedSvcIndex = (sal_Int16) i;
- ++i;
+ pEntry->nLastTriedSvcIndex = (sal_Int16) i;
+ ++i;
- // if language is not supported by the services
- // remove it from the list.
- if (xHyph.is() && !xHyph->hasLocale( rLocale ))
- aSvcMap.erase( nLanguage );
- }
+ // if language is not supported by the services
+ // remove it from the list.
+ if (xHyph.is() && !xHyph->hasLocale( rLocale ))
+ aSvcMap.erase( nLanguage );
}
} // if (xEntry.is())
}
@@ -453,44 +452,42 @@ Reference< XHyphenatedWord > SAL_CALL
{
Reference< XHyphenator > *pRef = pEntry->aSvcRefs.getArray();
- Reference< XMultiServiceFactory > xMgr(
- comphelper::getProcessServiceFactory() );
- if (xMgr.is())
- {
- // build service initialization argument
- Sequence< Any > aArgs(2);
- aArgs.getArray()[0] <<= GetPropSet();
+ Reference< XComponentContext > xContext(
+ comphelper::getProcessComponentContext() );
- // create specific service via it's implementation name
- try
- {
- xHyph = Reference< XHyphenator >(
- xMgr->createInstanceWithArguments(
- pEntry->aSvcImplNames[0], aArgs ), UNO_QUERY );
- }
- catch (uno::Exception &)
- {
- DBG_ASSERT( 0, "createInstanceWithArguments failed" );
- }
- pRef [i] = xHyph;
+ // build service initialization argument
+ Sequence< Any > aArgs(2);
+ aArgs.getArray()[0] <<= GetPropSet();
- Reference< XLinguServiceEventBroadcaster >
- xBroadcaster( xHyph, UNO_QUERY );
- if (xBroadcaster.is())
- rMgr.AddLngSvcEvtBroadcaster( xBroadcaster );
+ // create specific service via it's implementation name
+ try
+ {
+ xHyph = Reference< XHyphenator >(
+ xContext->getServiceManager()->createInstanceWithArgumentsAndContext(
+ pEntry->aSvcImplNames[0], aArgs, xContext ), UNO_QUERY );
+ }
+ catch (uno::Exception &)
+ {
+ DBG_ASSERT( 0, "createInstanceWithArguments failed" );
+ }
+ pRef [i] = xHyph;
- if (xHyph.is() && xHyph->hasLocale( rLocale ))
- xRes = xHyph->queryAlternativeSpelling( aChkWord, rLocale,
- nChkIndex, rProperties );
+ Reference< XLinguServiceEventBroadcaster >
+ xBroadcaster( xHyph, UNO_QUERY );
+ if (xBroadcaster.is())
+ rMgr.AddLngSvcEvtBroadcaster( xBroadcaster );
- pEntry->nLastTriedSvcIndex = (sal_Int16) i;
- ++i;
+ if (xHyph.is() && xHyph->hasLocale( rLocale ))
+ xRes = xHyph->queryAlternativeSpelling( aChkWord, rLocale,
+ nChkIndex, rProperties );
- // if language is not supported by the services
- // remove it from the list.
- if (xHyph.is() && !xHyph->hasLocale( rLocale ))
- aSvcMap.erase( nLanguage );
- }
+ pEntry->nLastTriedSvcIndex = (sal_Int16) i;
+ ++i;
+
+ // if language is not supported by the services
+ // remove it from the list.
+ if (xHyph.is() && !xHyph->hasLocale( rLocale ))
+ aSvcMap.erase( nLanguage );
}
} // if (xEntry.is())
}
@@ -578,43 +575,42 @@ Reference< XPossibleHyphens > SAL_CALL
{
Reference< XHyphenator > *pRef = pEntry->aSvcRefs.getArray();
- Reference< XMultiServiceFactory > xMgr(
- comphelper::getProcessServiceFactory() );
- if (xMgr.is())
- {
- // build service initialization argument
- Sequence< Any > aArgs(2);
- aArgs.getArray()[0] <<= GetPropSet();
+ Reference< XComponentContext > xContext(
+ comphelper::getProcessComponentContext() );
- // create specific service via it's implementation name
- try
- {
- xHyph = Reference< XHyphenator >(
- xMgr->createInstanceWithArguments(
- pEntry->aSvcImplNames[0], aArgs ), UNO_QUERY );
- }
- catch (uno::Exception &)
- {
- DBG_ASSERT( 0, "createWithArguments failed" );
- }
- pRef [i] = xHyph;
+ // build service initialization argument
+ Sequence< Any > aArgs(2);
+ aArgs.getArray()[0] <<= GetPropSet();
+
+ // create specific service via it's implementation name
+ try
+ {
+ xHyph = Reference< XHyphenator >(
+ xContext->getServiceManager()->createInstanceWithArgumentsAndContext(
+ pEntry->aSvcImplNames[0], aArgs, xContext ),
+ UNO_QUERY );
+ }
+ catch (uno::Exception &)
+ {
+ DBG_ASSERT( 0, "createWithArguments failed" );
+ }
+ pRef [i] = xHyph;
- Reference< XLinguServiceEventBroadcaster >
- xBroadcaster( xHyph, UNO_QUERY );
- if (xBroadcaster.is())
- rMgr.AddLngSvcEvtBroadcaster( xBroadcaster );
+ Reference< XLinguServiceEventBroadcaster >
+ xBroadcaster( xHyph, UNO_QUERY );
+ if (xBroadcaster.is())
+ rMgr.AddLngSvcEvtBroadcaster( xBroadcaster );
- if (xHyph.is() && xHyph->hasLocale( rLocale ))
- xRes = xHyph->createPossibleHyphens( aChkWord, rLocale, rProperties );
+ if (xHyph.is() && xHyph->hasLocale( rLocale ))
+ xRes = xHyph->createPossibleHyphens( aChkWord, rLocale, rProperties );
- pEntry->nLastTriedSvcIndex = (sal_Int16) i;
- ++i;
+ pEntry->nLastTriedSvcIndex = (sal_Int16) i;
+ ++i;
- // if language is not supported by the services
- // remove it from the list.
- if (xHyph.is() && !xHyph->hasLocale( rLocale ))
- aSvcMap.erase( nLanguage );
- }
+ // if language is not supported by the services
+ // remove it from the list.
+ if (xHyph.is() && !xHyph->hasLocale( rLocale ))
+ aSvcMap.erase( nLanguage );
}
} // if (xEntry.is())
}
diff --git a/linguistic/source/lngsvcmgr.cxx b/linguistic/source/lngsvcmgr.cxx
index 04ee168..2f20fc4 100644
--- a/linguistic/source/lngsvcmgr.cxx
+++ b/linguistic/source/lngsvcmgr.cxx
@@ -79,9 +79,9 @@ static uno::Sequence< lang::Locale > GetAvailLocales(
{
uno::Sequence< lang::Locale > aRes;
- uno::Reference< lang::XMultiServiceFactory > xFac( comphelper::getProcessServiceFactory() );
+ uno::Reference< uno::XComponentContext > xContext( comphelper::getProcessComponentContext() );
sal_Int32 nNames = rSvcImplNames.getLength();
- if (nNames && xFac.is())
+ if( nNames )
{
std::set< LanguageType > aLanguages;
@@ -101,7 +101,9 @@ static uno::Sequence< lang::Locale > GetAvailLocales(
try
{
xSuppLoc = uno::Reference< linguistic2::XSupportedLocales >(
- xFac->createInstanceWithArguments( pImplNames[i], aArgs ), uno::UNO_QUERY );
+ xContext->getServiceManager()->createInstanceWithArgumentsAndContext(
+ pImplNames[i], aArgs, xContext ),
+ uno::UNO_QUERY );
}
catch (uno::Exception &)
{
@@ -1059,56 +1061,51 @@ void LngSvcMgr::GetAvailableSpellSvcs_Impl()
{
pAvailSpellSvcs = new SvcInfoArray;
- uno::Reference< lang::XMultiServiceFactory > xFac( comphelper::getProcessServiceFactory() );
- if (xFac.is())
- {
- uno::Reference< container::XContentEnumerationAccess > xEnumAccess( xFac, uno::UNO_QUERY );
- uno::Reference< container::XEnumeration > xEnum;
- if (xEnumAccess.is())
- xEnum = xEnumAccess->createContentEnumeration( SN_SPELLCHECKER );
+ uno::Reference< uno::XComponentContext > xContext( comphelper::getProcessComponentContext() );
+
+ uno::Reference< container::XContentEnumerationAccess > xEnumAccess( xContext->getServiceManager(), uno::UNO_QUERY );
+ uno::Reference< container::XEnumeration > xEnum;
+ if (xEnumAccess.is())
+ xEnum = xEnumAccess->createContentEnumeration( SN_SPELLCHECKER );
- if (xEnum.is())
+ if (xEnum.is())
+ {
+ while (xEnum->hasMoreElements())
{
- while (xEnum->hasMoreElements())
- {
- uno::Any aCurrent = xEnum->nextElement();
- uno::Reference< lang::XSingleComponentFactory > xCompFactory;
- uno::Reference< lang::XSingleServiceFactory > xFactory;
+ uno::Any aCurrent = xEnum->nextElement();
+ uno::Reference< lang::XSingleComponentFactory > xCompFactory;
+ uno::Reference< lang::XSingleServiceFactory > xFactory;
- uno::Reference< linguistic2::XSpellChecker > xSvc;
- if ( cppu::extractInterface( xCompFactory, aCurrent ) || ::cppu::extractInterface( xFactory, aCurrent ) )
+ uno::Reference< linguistic2::XSpellChecker > xSvc;
+ if ( cppu::extractInterface( xCompFactory, aCurrent ) || ::cppu::extractInterface( xFactory, aCurrent ) )
+ {
+ try
{
- try
- {
- uno::Reference < uno::XComponentContext > xContext(
- comphelper::getComponentContext( xFac ) );
- xSvc = uno::Reference< linguistic2::XSpellChecker >( ( xCompFactory.is() ? xCompFactory->createInstanceWithContext( xContext ) : xFactory->createInstance() ), uno::UNO_QUERY );
- }
- catch (const uno::Exception &)
- {
- DBG_ASSERT( 0, "createInstance failed" );
- }
+ xSvc = uno::Reference< linguistic2::XSpellChecker >( ( xCompFactory.is() ? xCompFactory->createInstanceWithContext( xContext ) : xFactory->createInstance() ), uno::UNO_QUERY );
}
-
- if (xSvc.is())
+ catch (const uno::Exception &)
{
- OUString aImplName;
- uno::Sequence< sal_Int16 > aLanguages;
- uno::Reference< XServiceInfo > xInfo( xSvc, uno::UNO_QUERY );
- if (xInfo.is())
- aImplName = xInfo->getImplementationName();
- DBG_ASSERT( !aImplName.isEmpty(),
- "empty implementation name" );
- uno::Reference< linguistic2::XSupportedLocales > xSuppLoc( xSvc, uno::UNO_QUERY );
- DBG_ASSERT( xSuppLoc.is(), "interfaces not supported" );
- if (xSuppLoc.is()) {
- uno::Sequence<lang::Locale> aLocaleSequence(xSuppLoc->getLocales());
- aLanguages = LocaleSeqToLangSeq( aLocaleSequence );
- }
-
- pAvailSpellSvcs->push_back( new SvcInfo( aImplName, aLanguages ) );
+ DBG_ASSERT( 0, "createInstance failed" );
}
}
+
+ if (xSvc.is())
+ {
+ OUString aImplName;
+ uno::Sequence< sal_Int16 > aLanguages;
+ uno::Reference< XServiceInfo > xInfo( xSvc, uno::UNO_QUERY );
+ if (xInfo.is())
+ aImplName = xInfo->getImplementationName();
+ DBG_ASSERT( !aImplName.isEmpty(), "empty implementation name" );
+ uno::Reference< linguistic2::XSupportedLocales > xSuppLoc( xSvc, uno::UNO_QUERY );
+ DBG_ASSERT( xSuppLoc.is(), "interfaces not supported" );
+ if (xSuppLoc.is()) {
+ uno::Sequence<lang::Locale> aLocaleSequence(xSuppLoc->getLocales());
+ aLanguages = LocaleSeqToLangSeq( aLocaleSequence );
+ }
+
+ pAvailSpellSvcs->push_back( new SvcInfo( aImplName, aLanguages ) );
+ }
}
}
}
@@ -1121,55 +1118,51 @@ void LngSvcMgr::GetAvailableGrammarSvcs_Impl()
{
pAvailGrammarSvcs = new SvcInfoArray;
- uno::Reference< lang::XMultiServiceFactory > xFac( comphelper::getProcessServiceFactory() );
- if (xFac.is())
- {
- uno::Reference< container::XContentEnumerationAccess > xEnumAccess( xFac, uno::UNO_QUERY );
- uno::Reference< container::XEnumeration > xEnum;
- if (xEnumAccess.is())
- xEnum = xEnumAccess->createContentEnumeration( SN_GRAMMARCHECKER );
+ uno::Reference< uno::XComponentContext > xContext( comphelper::getProcessComponentContext() );
+
+ uno::Reference< container::XContentEnumerationAccess > xEnumAccess( xContext->getServiceManager(), uno::UNO_QUERY );
+ uno::Reference< container::XEnumeration > xEnum;
+ if (xEnumAccess.is())
+ xEnum = xEnumAccess->createContentEnumeration( SN_GRAMMARCHECKER );
- if (xEnum.is())
+ if (xEnum.is())
+ {
+ while (xEnum->hasMoreElements())
{
- while (xEnum->hasMoreElements())
- {
- uno::Any aCurrent = xEnum->nextElement();
- uno::Reference< lang::XSingleComponentFactory > xCompFactory;
- uno::Reference< lang::XSingleServiceFactory > xFactory;
+ uno::Any aCurrent = xEnum->nextElement();
+ uno::Reference< lang::XSingleComponentFactory > xCompFactory;
+ uno::Reference< lang::XSingleServiceFactory > xFactory;
- uno::Reference< linguistic2::XProofreader > xSvc;
- if ( cppu::extractInterface( xCompFactory, aCurrent ) || ::cppu::extractInterface( xFactory, aCurrent ) )
+ uno::Reference< linguistic2::XProofreader > xSvc;
+ if ( cppu::extractInterface( xCompFactory, aCurrent ) || ::cppu::extractInterface( xFactory, aCurrent ) )
+ {
+ try
{
- try
- {
- uno::Reference < uno::XComponentContext > xContext(
- comphelper::getComponentContext( xFac ) );
- xSvc = uno::Reference< linguistic2::XProofreader >( ( xCompFactory.is() ? xCompFactory->createInstanceWithContext( xContext ) : xFactory->createInstance() ), uno::UNO_QUERY );
- }
- catch (const uno::Exception &)
- {
- DBG_ASSERT( 0, "createInstance failed" );
- }
+ xSvc = uno::Reference< linguistic2::XProofreader >( ( xCompFactory.is() ? xCompFactory->createInstanceWithContext( xContext ) : xFactory->createInstance() ), uno::UNO_QUERY );
}
+ catch (const uno::Exception &)
+ {
+ DBG_ASSERT( 0, "createInstance failed" );
+ }
+ }
- if (xSvc.is())
+ if (xSvc.is())
+ {
+ OUString aImplName;
+ uno::Sequence< sal_Int16 > aLanguages;
+ uno::Reference< XServiceInfo > xInfo( xSvc, uno::UNO_QUERY );
+ if (xInfo.is())
+ aImplName = xInfo->getImplementationName();
+ DBG_ASSERT( !aImplName.isEmpty(),"empty implementation name" );
+ uno::Reference< linguistic2::XSupportedLocales > xSuppLoc( xSvc, uno::UNO_QUERY );
+ DBG_ASSERT( xSuppLoc.is(), "interfaces not supported" );
+ if (xSuppLoc.is())
{
- OUString aImplName;
- uno::Sequence< sal_Int16 > aLanguages;
- uno::Reference< XServiceInfo > xInfo( xSvc, uno::UNO_QUERY );
- if (xInfo.is())
- aImplName = xInfo->getImplementationName();
- DBG_ASSERT( !aImplName.isEmpty(),
- "empty implementation name" );
- uno::Reference< linguistic2::XSupportedLocales > xSuppLoc( xSvc, uno::UNO_QUERY );
- DBG_ASSERT( xSuppLoc.is(), "interfaces not supported" );
- if (xSuppLoc.is()) {
- uno::Sequence<lang::Locale> aLocaleSequence(xSuppLoc->getLocales());
- aLanguages = LocaleSeqToLangSeq( aLocaleSequence );
- }
-
- pAvailGrammarSvcs->push_back( new SvcInfo( aImplName, aLanguages ) );
+ uno::Sequence<lang::Locale> aLocaleSequence(xSuppLoc->getLocales());
+ aLanguages = LocaleSeqToLangSeq( aLocaleSequence );
}
+
+ pAvailGrammarSvcs->push_back( new SvcInfo( aImplName, aLanguages ) );
}
}
}
@@ -1182,57 +1175,50 @@ void LngSvcMgr::GetAvailableHyphSvcs_Impl()
if (!pAvailHyphSvcs)
{
pAvailHyphSvcs = new SvcInfoArray;
- uno::Reference< lang::XMultiServiceFactory > xFac( comphelper::getProcessServiceFactory() );
- if (xFac.is())
- {
- uno::Reference< container::XContentEnumerationAccess > xEnumAccess( xFac, uno::UNO_QUERY );
- uno::Reference< container::XEnumeration > xEnum;
- if (xEnumAccess.is())
- xEnum = xEnumAccess->createContentEnumeration( SN_HYPHENATOR );
+ uno::Reference< uno::XComponentContext > xContext( comphelper::getProcessComponentContext() );
- if (xEnum.is())
+ uno::Reference< container::XContentEnumerationAccess > xEnumAccess( xContext->getServiceManager(), uno::UNO_QUERY );
+ uno::Reference< container::XEnumeration > xEnum;
+ if (xEnumAccess.is())
+ xEnum = xEnumAccess->createContentEnumeration( SN_HYPHENATOR );
+
+ if (xEnum.is())
+ {
+ while (xEnum->hasMoreElements())
{
- while (xEnum->hasMoreElements())
- {
- uno::Any aCurrent = xEnum->nextElement();
- uno::Reference< lang::XSingleComponentFactory > xCompFactory;
- uno::Reference< lang::XSingleServiceFactory > xFactory;
+ uno::Any aCurrent = xEnum->nextElement();
+ uno::Reference< lang::XSingleComponentFactory > xCompFactory;
+ uno::Reference< lang::XSingleServiceFactory > xFactory;
- uno::Reference< linguistic2::XHyphenator > xSvc;
- if ( cppu::extractInterface( xCompFactory, aCurrent ) || ::cppu::extractInterface( xFactory, aCurrent ) )
+ uno::Reference< linguistic2::XHyphenator > xSvc;
+ if ( cppu::extractInterface( xCompFactory, aCurrent ) || ::cppu::extractInterface( xFactory, aCurrent ) )
+ {
+ try
{
- try
- {
- uno::Reference < uno::XComponentContext > xContext(
- comphelper::getComponentContext( xFac ) );
- xSvc = uno::Reference< linguistic2::XHyphenator >( ( xCompFactory.is() ? xCompFactory->createInstanceWithContext( xContext ) : xFactory->createInstance() ), uno::UNO_QUERY );
-
- }
- catch (const uno::Exception &)
- {
- DBG_ASSERT( 0, "createInstance failed" );
- }
+ xSvc = uno::Reference< linguistic2::XHyphenator >( ( xCompFactory.is() ? xCompFactory->createInstanceWithContext( xContext ) : xFactory->createInstance() ), uno::UNO_QUERY );
}
-
- if (xSvc.is())
+ catch (const uno::Exception &)
{
- OUString aImplName;
- uno::Sequence< sal_Int16 > aLanguages;
- uno::Reference< XServiceInfo > xInfo( xSvc, uno::UNO_QUERY );
- if (xInfo.is())
- aImplName = xInfo->getImplementationName();
- DBG_ASSERT( !aImplName.isEmpty(),
- "empty implementation name" );
- uno::Reference< linguistic2::XSupportedLocales > xSuppLoc( xSvc, uno::UNO_QUERY );
- DBG_ASSERT( xSuppLoc.is(), "interfaces not supported" );
- if (xSuppLoc.is()) {
- uno::Sequence<lang::Locale> aLocaleSequence(xSuppLoc->getLocales());
- aLanguages = LocaleSeqToLangSeq( aLocaleSequence );
- }
-
- pAvailHyphSvcs->push_back( new SvcInfo( aImplName, aLanguages ) );
+ DBG_ASSERT( 0, "createInstance failed" );
}
}
+ if (xSvc.is())
+ {
+ OUString aImplName;
+ uno::Sequence< sal_Int16 > aLanguages;
+ uno::Reference< XServiceInfo > xInfo( xSvc, uno::UNO_QUERY );
+ if (xInfo.is())
+ aImplName = xInfo->getImplementationName();
+ DBG_ASSERT( !aImplName.isEmpty(), "empty implementation name" );
+ uno::Reference< linguistic2::XSupportedLocales > xSuppLoc( xSvc, uno::UNO_QUERY );
+ DBG_ASSERT( xSuppLoc.is(), "interfaces not supported" );
+ if (xSuppLoc.is())
+ {
+ uno::Sequence<lang::Locale> aLocaleSequence(xSuppLoc->getLocales());
+ aLanguages = LocaleSeqToLangSeq( aLocaleSequence );
+ }
+ pAvailHyphSvcs->push_back( new SvcInfo( aImplName, aLanguages ) );
+ }
}
}
}
@@ -1245,57 +1231,51 @@ void LngSvcMgr::GetAvailableThesSvcs_Impl()
{
pAvailThesSvcs = new SvcInfoArray;
- uno::Reference< lang::XMultiServiceFactory > xFac( comphelper::getProcessServiceFactory() );
- if (xFac.is())
- {
- uno::Reference< container::XContentEnumerationAccess > xEnumAccess( xFac, uno::UNO_QUERY );
- uno::Reference< container::XEnumeration > xEnum;
- if (xEnumAccess.is())
- xEnum = xEnumAccess->createContentEnumeration( SN_THESAURUS );
+ uno::Reference< uno::XComponentContext > xContext( comphelper::getProcessComponentContext() );
- if (xEnum.is())
- {
- while (xEnum->hasMoreElements())
- {
- uno::Any aCurrent = xEnum->nextElement();
+ uno::Reference< container::XContentEnumerationAccess > xEnumAccess( xContext->getServiceManager(), uno::UNO_QUERY );
+ uno::Reference< container::XEnumeration > xEnum;
+ if (xEnumAccess.is())
+ xEnum = xEnumAccess->createContentEnumeration( SN_THESAURUS );
- uno::Reference< lang::XSingleComponentFactory > xCompFactory;
- uno::Reference< lang::XSingleServiceFactory > xFactory;
+ if (xEnum.is())
+ {
+ while (xEnum->hasMoreElements())
+ {
+ uno::Any aCurrent = xEnum->nextElement();
+ uno::Reference< lang::XSingleComponentFactory > xCompFactory;
+ uno::Reference< lang::XSingleServiceFactory > xFactory;
- uno::Reference< linguistic2::XThesaurus > xSvc;
- if ( cppu::extractInterface( xCompFactory, aCurrent ) || ::cppu::extractInterface( xFactory, aCurrent ) )
+ uno::Reference< linguistic2::XThesaurus > xSvc;
+ if ( cppu::extractInterface( xCompFactory, aCurrent ) || ::cppu::extractInterface( xFactory, aCurrent ) )
+ {
+ try
{
- try
- {
- uno::Reference < uno::XComponentContext > xContext(
- comphelper::getComponentContext( xFac ) );
- xSvc = uno::Reference< linguistic2::XThesaurus >( ( xCompFactory.is() ? xCompFactory->createInstanceWithContext( xContext ) : xFactory->createInstance() ), uno::UNO_QUERY );
- }
- catch (const uno::Exception &)
- {
- DBG_ASSERT( 0, "createInstance failed" );
- }
+ xSvc = uno::Reference< linguistic2::XThesaurus >( ( xCompFactory.is() ? xCompFactory->createInstanceWithContext( xContext ) : xFactory->createInstance() ), uno::UNO_QUERY );
}
-
- if (xSvc.is())
+ catch (const uno::Exception &)
{
- OUString aImplName;
- uno::Sequence< sal_Int16 > aLanguages;
- uno::Reference< XServiceInfo > xInfo( xSvc, uno::UNO_QUERY );
- if (xInfo.is())
- aImplName = xInfo->getImplementationName();
- DBG_ASSERT( !aImplName.isEmpty(),
- "empty implementation name" );
- uno::Reference< linguistic2::XSupportedLocales > xSuppLoc( xSvc, uno::UNO_QUERY );
- DBG_ASSERT( xSuppLoc.is(), "interfaces not supported" );
- if (xSuppLoc.is()) {
- uno::Sequence<lang::Locale> aLocaleSequence(xSuppLoc->getLocales());
- aLanguages = LocaleSeqToLangSeq( aLocaleSequence );
- }
-
- pAvailThesSvcs->push_back( new SvcInfo( aImplName, aLanguages ) );
+ DBG_ASSERT( 0, "createInstance failed" );
}
}
+ if (xSvc.is())
+ {
+ OUString aImplName;
+ uno::Sequence< sal_Int16 > aLanguages;
+ uno::Reference< XServiceInfo > xInfo( xSvc, uno::UNO_QUERY );
+ if (xInfo.is())
+ aImplName = xInfo->getImplementationName();
+ DBG_ASSERT( !aImplName.isEmpty(), "empty implementation name" );
+ uno::Reference< linguistic2::XSupportedLocales > xSuppLoc( xSvc, uno::UNO_QUERY );
+ DBG_ASSERT( xSuppLoc.is(), "interfaces not supported" );
+ if (xSuppLoc.is())
+ {
+ uno::Sequence<lang::Locale> aLocaleSequence(xSuppLoc->getLocales());
+ aLanguages = LocaleSeqToLangSeq( aLocaleSequence );
+ }
+
+ pAvailThesSvcs->push_back( new SvcInfo( aImplName, aLanguages ) );
+ }
}
}
}
diff --git a/linguistic/source/spelldsp.cxx b/linguistic/source/spelldsp.cxx
index eb41f25..a1d697e 100644
--- a/linguistic/source/spelldsp.cxx
+++ b/linguistic/source/spelldsp.cxx
@@ -360,67 +360,64 @@ sal_Bool SpellCheckerDispatcher::isValid_Impl(
const OUString *pImplNames = pEntry->aSvcImplNames.getConstArray();
Reference< XSpellChecker > *pRef = pEntry->aSvcRefs .getArray();
- Reference< XMultiServiceFactory > xMgr(
- comphelper::getProcessServiceFactory() );
- if (xMgr.is())
- {
- // build service initialization argument
- Sequence< Any > aArgs(2);
- aArgs.getArray()[0] <<= GetPropSet();
+ Reference< XComponentContext > xContext(
+ comphelper::getProcessComponentContext() );
+
+ // build service initialization argument
+ Sequence< Any > aArgs(2);
+ aArgs.getArray()[0] <<= GetPropSet();
- while (i < nLen && (!bTmpResValid || sal_False == bTmpRes))
+ while (i < nLen && (!bTmpResValid || sal_False == bTmpRes))
+ {
+ // create specific service via it's implementation name
+ Reference< XSpellChecker > xSpell;
+ try
{
- // create specific service via it's implementation name
- Reference< XSpellChecker > xSpell;
- try
- {
- xSpell = Reference< XSpellChecker >(
- xMgr->createInstanceWithArguments(
- pImplNames[i], aArgs ), UNO_QUERY );
- }
- catch (uno::Exception &)
- {
- DBG_ASSERT( 0, "createInstanceWithArguments failed" );
- }
- pRef [i] = xSpell;
+ xSpell = Reference< XSpellChecker >(
+ xContext->getServiceManager()->createInstanceWithArgumentsAndContext(
+ pImplNames[i], aArgs, xContext ),
+ UNO_QUERY );
+ }
+ catch (uno::Exception &)
+ {
+ DBG_ASSERT( 0, "createInstanceWithArguments failed" );
+ }
+ pRef [i] = xSpell;
- Reference< XLinguServiceEventBroadcaster >
- xBroadcaster( xSpell, UNO_QUERY );
- if (xBroadcaster.is())
- rMgr.AddLngSvcEvtBroadcaster( xBroadcaster );
+ Reference< XLinguServiceEventBroadcaster >
+ xBroadcaster( xSpell, UNO_QUERY );
+ if (xBroadcaster.is())
+ rMgr.AddLngSvcEvtBroadcaster( xBroadcaster );
- bTmpResValid = sal_True;
- if (xSpell.is() && xSpell->hasLocale( aLocale ))
+ bTmpResValid = sal_True;
+ if (xSpell.is() && xSpell->hasLocale( aLocale ))
+ {
+ bTmpRes = GetCache().CheckWord( aChkWord, nLanguage );
+ if (!bTmpRes)
{
- bTmpRes = GetCache().CheckWord( aChkWord, nLanguage );
- if (!bTmpRes)
- {
- bTmpRes = xSpell->isValid( aChkWord, aLocale, rProperties );
-
- // Add correct words to the cache.
- // But not those that are correct only because of
- // the temporary supplied settings.
- if (bTmpRes && 0 == rProperties.getLength())
- GetCache().AddWord( aChkWord, nLanguage );
- }
+ bTmpRes = xSpell->isValid( aChkWord, aLocale, rProperties );
+ // Add correct words to the cache.
+ // But not those that are correct only because of
+ // the temporary supplied settings.
+ if (bTmpRes && 0 == rProperties.getLength())
+ GetCache().AddWord( aChkWord, nLanguage );
}
- else
- bTmpResValid = sal_False;
-
- if (bTmpResValid)
- bRes = bTmpRes;
-
- pEntry->nLastTriedSvcIndex = (sal_Int16) i;
- ++i;
}
+ else
+ bTmpResValid = sal_False;
+ if (bTmpResValid)
+ bRes = bTmpRes;
- // if language is not supported by any of the services
- // remove it from the list.
- if (i == nLen)
- {
- if (!SvcListHasLanguage( *pEntry, nLanguage ))
- aSvcMap.erase( nLanguage );
- }
+ pEntry->nLastTriedSvcIndex = (sal_Int16) i;
+ ++i;
+ }
+
+ // if language is not supported by any of the services
+ // remove it from the list.
+ if (i == nLen)
+ {
+ if (!SvcListHasLanguage( *pEntry, nLanguage ))
+ aSvcMap.erase( nLanguage );
}
}
@@ -548,86 +545,85 @@ Reference< XSpellAlternatives > SpellCheckerDispatcher::spell_Impl(
const OUString *pImplNames = pEntry->aSvcImplNames.getConstArray();
Reference< XSpellChecker > *pRef = pEntry->aSvcRefs .getArray();
- Reference< XMultiServiceFactory > xMgr(
- comphelper::getProcessServiceFactory() );
- if (xMgr.is())
- {
- // build service initialization argument
- Sequence< Any > aArgs(2);
- aArgs.getArray()[0] <<= GetPropSet();
+ Reference< XComponentContext > xContext(
+ comphelper::getProcessComponentContext() );
+
+ // build service initialization argument
+ Sequence< Any > aArgs(2);
+ aArgs.getArray()[0] <<= GetPropSet();
- sal_Int32 nNumSugestions = -1;
- while (i < nLen && (!bTmpResValid || xTmpRes.is()))
+ sal_Int32 nNumSugestions = -1;
+ while (i < nLen && (!bTmpResValid || xTmpRes.is()))
+ {
+ // create specific service via it's implementation name
+ Reference< XSpellChecker > xSpell;
+ try
{
- // create specific service via it's implementation name
- Reference< XSpellChecker > xSpell;
- try
- {
- xSpell = Reference< XSpellChecker >(
- xMgr->createInstanceWithArguments(
- pImplNames[i], aArgs ), UNO_QUERY );
- }
- catch (uno::Exception &)
- {
- DBG_ASSERT( 0, "createInstanceWithArguments failed" );
- }
- pRef [i] = xSpell;
+ xSpell = Reference< XSpellChecker >(
+ xContext->getServiceManager()->createInstanceWithArgumentsAndContext(
+ pImplNames[i], aArgs, xContext ),
+ UNO_QUERY );
+ }
+ catch (uno::Exception &)
+ {
+ DBG_ASSERT( 0, "createInstanceWithArguments failed" );
+ }
+ pRef [i] = xSpell;
- Reference< XLinguServiceEventBroadcaster >
- xBroadcaster( xSpell, UNO_QUERY );
- if (xBroadcaster.is())
- rMgr.AddLngSvcEvtBroadcaster( xBroadcaster );
+ Reference< XLinguServiceEventBroadcaster >
+ xBroadcaster( xSpell, UNO_QUERY );
+ if (xBroadcaster.is())
+ rMgr.AddLngSvcEvtBroadcaster( xBroadcaster );
- bTmpResValid = sal_True;
- if (xSpell.is() && xSpell->hasLocale( aLocale ))
- {
- sal_Bool bOK = GetCache().CheckWord( aChkWord, nLanguage );
- if (bOK)
- xTmpRes = NULL;
- else
- {
- xTmpRes = xSpell->spell( aChkWord, aLocale, rProperties );
-
- // Add correct words to the cache.
- // But not those that are correct only because of
- // the temporary supplied settings.
- if (!xTmpRes.is() && 0 == rProperties.getLength())
- GetCache().AddWord( aChkWord, nLanguage );
- }
- }
+ bTmpResValid = sal_True;
+ if (xSpell.is() && xSpell->hasLocale( aLocale ))
+ {
+ sal_Bool bOK = GetCache().CheckWord( aChkWord, nLanguage );
+ if (bOK)
+ xTmpRes = NULL;
else
- bTmpResValid = sal_False;
-
- // return first found result if the word is not known by any checker.
- // But if that result has no suggestions use the first one that does
- // provide suggestions for the misspelled word.
- if (!xRes.is() && bTmpResValid)
- {
- xRes = xTmpRes;
- nNumSugestions = 0;
- if (xRes.is())
- nNumSugestions = xRes->getAlternatives().getLength();
- }
- sal_Int32 nTmpNumSugestions = 0;
- if (xTmpRes.is() && bTmpResValid)
- nTmpNumSugestions = xTmpRes->getAlternatives().getLength();
- if (xRes.is() && nNumSugestions == 0 && nTmpNumSugestions > 0)
{
- xRes = xTmpRes;
- nNumSugestions = nTmpNumSugestions;
- }
+ xTmpRes = xSpell->spell( aChkWord, aLocale, rProperties );
- pEntry->nLastTriedSvcIndex = (sal_Int16) i;
- ++i;
+ // Add correct words to the cache.
+ // But not those that are correct only because of
+ // the temporary supplied settings.
+ if (!xTmpRes.is() && 0 == rProperties.getLength())
+ GetCache().AddWord( aChkWord, nLanguage );
+ }
}
+ else
+ bTmpResValid = sal_False;
- // if language is not supported by any of the services
- // remove it from the list.
- if (i == nLen)
+ // return first found result if the word is not known by any checker.
+ // But if that result has no suggestions use the first one that does
+ // provide suggestions for the misspelled word.
+ if (!xRes.is() && bTmpResValid)
+ {
+ xRes = xTmpRes;
+ nNumSugestions = 0;
+ if (xRes.is())
+ nNumSugestions = xRes->getAlternatives().getLength();
+ }
+ sal_Int32 nTmpNumSugestions = 0;
+ if (xTmpRes.is() && bTmpResValid)
+ nTmpNumSugestions = xTmpRes->getAlternatives().getLength();
+ if (xRes.is() && nNumSugestions == 0 && nTmpNumSugestions > 0)
{
- if (!SvcListHasLanguage( *pEntry, nLanguage ))
- aSvcMap.erase( nLanguage );
+ xRes = xTmpRes;
+ nNumSugestions = nTmpNumSugestions;
}
+
+ pEntry->nLastTriedSvcIndex = (sal_Int16) i;
+ ++i;
+ }
+
+ // if language is not supported by any of the services
+ // remove it from the list.
+ if (i == nLen)
+ {
+ if (!SvcListHasLanguage( *pEntry, nLanguage ))
+ aSvcMap.erase( nLanguage );
}
}
diff --git a/linguistic/source/thesdsp.cxx b/linguistic/source/thesdsp.cxx
index a734d89..c8d31ca 100644
--- a/linguistic/source/thesdsp.cxx
+++ b/linguistic/source/thesdsp.cxx
@@ -158,44 +158,43 @@ Sequence< Reference< XMeaning > > SAL_CALL
const OUString *pImplNames = pEntry->aSvcImplNames.getConstArray();
Reference< XThesaurus > *pRef = pEntry->aSvcRefs.getArray();
- Reference< XMultiServiceFactory > xMgr(
- comphelper::getProcessServiceFactory() );
- if (xMgr.is())
- {
- // build service initialization argument
- Sequence< Any > aArgs(1);
- aArgs.getArray()[0] <<= GetPropSet();
+ Reference< XComponentContext > xContext(
+ comphelper::getProcessComponentContext() );
+
+ // build service initialization argument
+ Sequence< Any > aArgs(1);
+ aArgs.getArray()[0] <<= GetPropSet();
- while (i < nLen && aMeanings.getLength() == 0)
+ while (i < nLen && aMeanings.getLength() == 0)
+ {
+ // create specific service via it's implementation name
+ Reference< XThesaurus > xThes;
+ try
{
- // create specific service via it's implementation name
- Reference< XThesaurus > xThes;
- try
- {
- xThes = Reference< XThesaurus >(
- xMgr->createInstanceWithArguments(
- pImplNames[i], aArgs ), UNO_QUERY );
- }
- catch (uno::Exception &)
- {
- DBG_ASSERT( 0, "createInstanceWithArguments failed" );
- }
- pRef[i] = xThes;
-
- if (xThes.is() && xThes->hasLocale( rLocale ))
- aMeanings = xThes->queryMeanings( aChkWord, rLocale, rProperties );
-
- pEntry->nLastTriedSvcIndex = (sal_Int16) i;
- ++i;
+ xThes = Reference< XThesaurus >(
+ xContext->getServiceManager()->createInstanceWithArgumentsAndContext(
+ pImplNames[i], aArgs, xContext ),
+ UNO_QUERY );
}
-
- // if language is not supported by any of the services
- // remove it from the list.
- if (i == nLen && aMeanings.getLength() == 0)
+ catch (uno::Exception &)
{
- if (!SvcListHasLanguage( pEntry->aSvcRefs, rLocale ))
- aSvcMap.erase( nLanguage );
+ DBG_ASSERT( 0, "createInstanceWithArguments failed" );
}
+ pRef[i] = xThes;
+
+ if (xThes.is() && xThes->hasLocale( rLocale ))
+ aMeanings = xThes->queryMeanings( aChkWord, rLocale, rProperties );
+
+ pEntry->nLastTriedSvcIndex = (sal_Int16) i;
+ ++i;
+ }
+
+ // if language is not supported by any of the services
+ // remove it from the list.
+ if (i == nLen && aMeanings.getLength() == 0)
+ {
+ if (!SvcListHasLanguage( pEntry->aSvcRefs, rLocale ))
+ aSvcMap.erase( nLanguage );
}
}
}
commit 0394cb37a2d378511f265004b285fd93df37e5ca
Author: Noel Grandin <noel at peralex.com>
Date: Mon May 13 15:09:45 2013 +0200
fdo#46808, Convert ui::ImageManager to new style
The service already existed, it just needed an IDL file.
Change-Id: I5bdc3064b0a3caa5a0d2abf4ef5ba3159889c7af
diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx
index 4aad676..5566dce 100644
--- a/cui/source/customize/cfg.cxx
+++ b/cui/source/customize/cfg.cxx
@@ -75,6 +75,7 @@
#include <com/sun/star/graphic/GraphicProvider.hpp>
#include <com/sun/star/ui/ItemType.hpp>
#include <com/sun/star/ui/ItemStyle.hpp>
+#include <com/sun/star/ui/ImageManager.hpp>
#include <com/sun/star/ui/ModuleUIConfigurationManagerSupplier.hpp>
#include <com/sun/star/ui/XUIConfiguration.hpp>
#include <com/sun/star/ui/XUIConfigurationListener.hpp>
@@ -5006,8 +5007,6 @@ SvxIconSelectorDialog::SvxIconSelectorDialog( Window *pWindow,
aFtNote.SetText( replaceSixteen( aFtNote.GetText(), m_nExpectedSize ) );
}
- uno::Reference< lang::XMultiServiceFactory > xServiceManager =
- ::comphelper::getProcessServiceFactory();
uno::Reference< uno::XComponentContext > xComponentContext =
::comphelper::getProcessComponentContext();
@@ -5058,10 +5057,7 @@ SvxIconSelectorDialog::SvxIconSelectorDialog( Window *pWindow,
aPropValue.Value <<= com::sun::star::embed::ElementModes::READWRITE;
aProp[ 1 ] <<= aPropValue;
- m_xImportedImageManager = uno::Reference< com::sun::star::ui::XImageManager >(
- xServiceManager->createInstanceWithArguments(
- OUString("com.sun.star.ui.ImageManager" ), aProp ),
- uno::UNO_QUERY );
+ m_xImportedImageManager = css::ui::ImageManager::create( xComponentContext );
ImageInfo mImageInfo;
uno::Sequence< OUString > names;
diff --git a/framework/inc/services.h b/framework/inc/services.h
index 810bc99..cda8d13 100644
--- a/framework/inc/services.h
+++ b/framework/inc/services.h
@@ -52,7 +52,6 @@ namespace framework{
#define SERVICENAME_TABWINFACTORY DECLARE_ASCII("com.sun.star.frame.TabWindowFactory" )
#define SERVICENAME_TABWINDOW DECLARE_ASCII("com.sun.star.frame.TabWindow" )
#define SERVICENAME_STRINGABBREVIATION DECLARE_ASCII("com.sun.star.util.UriAbbreviation" )
-#define SERVICENAME_IMAGEMANAGER DECLARE_ASCII("com.sun.star.ui.ImageManager" )
#define SERVICENAME_TABWINDOWSERVICE DECLARE_ASCII("com.sun.star.ui.dialogs.TabContainerWindow" )
//_________________________________________________________________________________________________________________
@@ -120,7 +119,6 @@ namespace framework{
#define IMPLEMENTATIONNAME_POPUPMENUDISPATCHER DECLARE_ASCII("com.sun.star.comp.framework.PopupMenuControllerDispatcher" )
#define IMPLEMENTATIONNAME_LANGSELECTIONSTATUSBARCONTROLLER DECLARE_ASCII("com.sun.star.comp.framework.LangSelectionStatusbarController" )
#define IMPLEMENTATIONNAME_LANGUAGESELECTIONMENUCONTROLLER DECLARE_ASCII("com.sun.star.comp.framework.LanguageSelectionMenuController" )
-#define IMPLEMENTATIONNAME_IMAGEMANAGER DECLARE_ASCII("com.sun.star.comp.framework.ImageManager" )
#define IMPLEMENTATIONNAME_TABWINDOWSERVICE DECLARE_ASCII("com.sun.star.comp.framework.TabWindowService" )
#define IMPLEMENTATIONNAME_WINDOWCONTENTFACTORYMANAGER DECLARE_ASCII("com.sun.star.comp.framework.WindowContentFactoryManager" )
diff --git a/framework/source/uiconfiguration/imagemanager.cxx b/framework/source/uiconfiguration/imagemanager.cxx
index 2a38252..6e5aae6 100644
--- a/framework/source/uiconfiguration/imagemanager.cxx
+++ b/framework/source/uiconfiguration/imagemanager.cxx
@@ -74,6 +74,9 @@ const sal_Int16 MAX_IMAGETYPE_VALUE = ::com::sun::star::ui::ImageType::COL
namespace framework
{
+#define SERVICENAME_IMAGEMANAGER DECLARE_ASCII("com.sun.star.ui.ImageManager" )
+#define IMPLEMENTATIONNAME_IMAGEMANAGER DECLARE_ASCII("com.sun.star.comp.framework.ImageManager" )
+
//*****************************************************************************************************************
// XInterface, XTypeProvider, XServiceInfo
//*****************************************************************************************************************
diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk
index 7beadf6..90a54de 100644
--- a/offapi/UnoApi_offapi.mk
+++ b/offapi/UnoApi_offapi.mk
@@ -3938,6 +3938,7 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,offapi/com/sun/star/ui,\
ContextMenuExecuteEvent \
ContextMenuInterceptorAction \
DockingArea \
+ ImageManager \
ImageType \
ItemStyle \
ItemType \
diff --git a/offapi/com/sun/star/ui/ImageManager.idl b/offapi/com/sun/star/ui/ImageManager.idl
new file mode 100644
index 0000000..f8b5b1a
--- /dev/null
+++ b/offapi/com/sun/star/ui/ImageManager.idl
@@ -0,0 +1,37 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+#ifndef __com_sun_star_ui_ImageManager_idl__
+#define __com_sun_star_ui_ImageManager_idl__
+
+#include <com/sun/star/ui/XImageManager.idl>
+
+module com { module sun { module star { module ui {
+
+
+/**
+
+ @since LibreOffice 4.1
+*/
+service ImageManager : XImageManager;
+
+}; }; }; }; // com.sun.star.ui
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 4481f5d4bcf0ba5b5d02c1dbff6d24d1e5301ff6
Author: Noel Grandin <noel at peralex.com>
Date: Mon May 13 13:57:25 2013 +0200
fdo#46808, Replace some XMultiServiceFactory with XComponentContext
Change-Id: Ifbf8041ef9ffbecb88dacc9757895d777805372f
diff --git a/cui/source/dialogs/insdlg.cxx b/cui/source/dialogs/insdlg.cxx
index 02282e4..3d53af2 100644
--- a/cui/source/dialogs/insdlg.cxx
+++ b/cui/source/dialogs/insdlg.cxx
@@ -355,40 +355,27 @@ IMPL_LINK_NOARG(SvInsertPlugInDialog, BrowseHdl)
void fillNetscapePluginFilters( Sequence< OUString >& rNames, Sequence< OUString >& rTypes );
fillNetscapePluginFilters( aFilterNames, aFilterTypes );
- Reference< XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() );
- if( xFactory.is() )
- {
- Reference< XFilePicker > xFilePicker( xFactory->createInstance( "com.sun.star.ui.dialogs.FilePicker" ), UNO_QUERY );
- DBG_ASSERT( xFilePicker.is(), "could not get FilePicker service" );
-
- Reference< XInitialization > xInit( xFilePicker, UNO_QUERY );
- Reference< XFilterManager > xFilterMgr( xFilePicker, UNO_QUERY );
- if( xInit.is() && xFilePicker.is() && xFilterMgr.is() )
- {
- Sequence< Any > aServiceType( 1 );
- aServiceType[0] <<= TemplateDescription::FILEOPEN_SIMPLE;
- xInit->initialize( aServiceType );
+ Reference< XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
+ Reference< XFilePicker3 > xFilePicker = ui::dialogs::FilePicker::createWithMode( xContext, ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE );
- // add the filters
- try
- {
- const OUString* pNames = aFilterNames.getConstArray();
- const OUString* pTypes = aFilterTypes.getConstArray();
- for( int i = 0; i < aFilterNames.getLength(); i++ )
- xFilterMgr->appendFilter( pNames[i], pTypes[i] );
- }
- catch( IllegalArgumentException& )
- {
- DBG_ASSERT( 0, "caught IllegalArgumentException when registering filter\n" );
- }
+ // add the filters
+ try
+ {
+ const OUString* pNames = aFilterNames.getConstArray();
+ const OUString* pTypes = aFilterTypes.getConstArray();
+ for( int i = 0; i < aFilterNames.getLength(); i++ )
+ xFilePicker->appendFilter( pNames[i], pTypes[i] );
+ }
+ catch( IllegalArgumentException& )
+ {
+ DBG_ASSERT( 0, "caught IllegalArgumentException when registering filter\n" );
+ }
- if( xFilePicker->execute() == ExecutableDialogResults::OK )
- {
- Sequence< OUString > aPathSeq( xFilePicker->getFiles() );
- INetURLObject aObj( aPathSeq[0] );
- m_pEdFileurl->SetText(aObj.PathToFileName());
- }
- }
+ if( xFilePicker->execute() == ExecutableDialogResults::OK )
+ {
+ Sequence< OUString > aPathSeq( xFilePicker->getFiles() );
+ INetURLObject aObj( aPathSeq[0] );
+ m_pEdFileurl->SetText(aObj.PathToFileName());
}
return 0;
diff --git a/cui/source/options/certpath.cxx b/cui/source/options/certpath.cxx
index 0a477ca..e3ebcbe 100644
--- a/cui/source/options/certpath.cxx
+++ b/cui/source/options/certpath.cxx
@@ -18,7 +18,7 @@
#include "certpath.hrc"
#include "dialmgr.hxx"
-#include <com/sun/star/mozilla/XMozillaBootstrap.hpp>
+#include <com/sun/star/mozilla/MozillaBootstrap.hpp>
#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
#include <com/sun/star/ui/dialogs/FolderPicker.hpp>
#include <comphelper/processfactory.hxx>
@@ -71,10 +71,7 @@ CertPathDialog::CertPathDialog( Window* pParent ) :
"mozilla" };
sal_Int32 nProduct = SAL_N_ELEMENTS(productTypes);
- uno::Reference<uno::XInterface> xInstance = comphelper::getProcessServiceFactory()->createInstance(
- "com.sun.star.mozilla.MozillaBootstrap");
-
- uno::Reference<mozilla::XMozillaBootstrap> xMozillaBootstrap(xInstance, uno::UNO_QUERY_THROW);
+ uno::Reference<mozilla::XMozillaBootstrap> xMozillaBootstrap = mozilla::MozillaBootstrap::create( comphelper::getProcessComponentContext() );
for (sal_Int32 i = 0; i < nProduct; ++i)
{
diff --git a/cui/source/options/optlingu.cxx b/cui/source/options/optlingu.cxx
index 9ab17cf..75fd722 100644
--- a/cui/source/options/optlingu.cxx
+++ b/cui/source/options/optlingu.cxx
@@ -517,7 +517,6 @@ class SvxLinguData_Impl
LangImplNameTable aCfgHyphTable;
LangImplNameTable aCfgThesTable;
LangImplNameTable aCfgGrammarTable;
- uno::Reference< XMultiServiceFactory > xMSF;
uno::Reference< XLinguServiceManager2 > xLinguSrvcMgr;
@@ -730,8 +729,8 @@ static void lcl_MergeDisplayArray(
SvxLinguData_Impl::SvxLinguData_Impl() :
nDisplayServices (0)
{
- xMSF = ::comphelper::getProcessServiceFactory();
- xLinguSrvcMgr = LinguServiceManager::create(comphelper::getComponentContext(xMSF));
+ uno::Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext();
+ xLinguSrvcMgr = LinguServiceManager::create(xContext);
const Locale& rCurrentLocale = Application::GetSettings().GetLanguageTag().getLocale();
Sequence<Any> aArgs(2);//second arguments has to be empty!
@@ -748,7 +747,7 @@ SvxLinguData_Impl::SvxLinguData_Impl() :
ServiceInfo_Impl aInfo;
aInfo.sSpellImplName = pSpellNames[nIdx];
aInfo.xSpell = uno::Reference<XSpellChecker>(
- xMSF->createInstanceWithArguments(aInfo.sSpellImplName, aArgs), UNO_QUERY);
+ xContext->getServiceManager()->createInstanceWithArgumentsAndContext(aInfo.sSpellImplName, aArgs, xContext), UNO_QUERY);
uno::Reference<XServiceDisplayName> xDispName(aInfo.xSpell, UNO_QUERY);
if(xDispName.is())
@@ -772,7 +771,7 @@ SvxLinguData_Impl::SvxLinguData_Impl() :
ServiceInfo_Impl aInfo;
aInfo.sGrammarImplName = pGrammarNames[nIdx];
aInfo.xGrammar = uno::Reference<XProofreader>(
- xMSF->createInstanceWithArguments(aInfo.sGrammarImplName, aArgs), UNO_QUERY);
+ xContext->getServiceManager()->createInstanceWithArgumentsAndContext(aInfo.sGrammarImplName, aArgs, xContext), UNO_QUERY);
uno::Reference<XServiceDisplayName> xDispName(aInfo.xGrammar, UNO_QUERY);
if(xDispName.is())
@@ -796,7 +795,7 @@ SvxLinguData_Impl::SvxLinguData_Impl() :
ServiceInfo_Impl aInfo;
aInfo.sHyphImplName = pHyphNames[nIdx];
aInfo.xHyph = uno::Reference<XHyphenator>(
- xMSF->createInstanceWithArguments(aInfo.sHyphImplName, aArgs), UNO_QUERY);
+ xContext->getServiceManager()->createInstanceWithArgumentsAndContext(aInfo.sHyphImplName, aArgs, xContext), UNO_QUERY);
uno::Reference<XServiceDisplayName> xDispName(aInfo.xHyph, UNO_QUERY);
if(xDispName.is())
@@ -820,7 +819,7 @@ SvxLinguData_Impl::SvxLinguData_Impl() :
ServiceInfo_Impl aInfo;
aInfo.sThesImplName = pThesNames[nIdx];
aInfo.xThes = uno::Reference<XThesaurus>(
- xMSF->createInstanceWithArguments(aInfo.sThesImplName, aArgs), UNO_QUERY);
+ xContext->getServiceManager()->createInstanceWithArgumentsAndContext(aInfo.sThesImplName, aArgs, xContext), UNO_QUERY);
uno::Reference<XServiceDisplayName> xDispName(aInfo.xThes, UNO_QUERY);
if(xDispName.is())
@@ -871,14 +870,12 @@ SvxLinguData_Impl::SvxLinguData_Impl( const SvxLinguData_Impl &rData ) :
aCfgHyphTable (rData.aCfgHyphTable),
aCfgThesTable (rData.aCfgThesTable),
aCfgGrammarTable (rData.aCfgGrammarTable),
- xMSF (rData.xMSF),
xLinguSrvcMgr (rData.xLinguSrvcMgr)
{
}
SvxLinguData_Impl & SvxLinguData_Impl::operator = (const SvxLinguData_Impl &rData)
{
- xMSF = rData.xMSF;
xLinguSrvcMgr = rData.xLinguSrvcMgr;
aAllServiceLocales = rData.aAllServiceLocales;
aCfgSpellTable = rData.aCfgSpellTable;
commit 357e1c0f8dc6efc9ef05d635173dd32a617e1708
Author: Noel Grandin <noel at peralex.com>
Date: Mon May 13 13:51:44 2013 +0200
fdo#46808, Convert setup::UpdateCheck service to new style
The service already existed, it just needed an IDL file
Change-Id: Ide9fe23861d43845e242d4637b3ef9673b30e068
diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx
index 78e127b..6d31b46 100644
--- a/cui/source/options/treeopt.cxx
+++ b/cui/source/options/treeopt.cxx
@@ -60,6 +60,7 @@
#include <com/sun/star/loader/CannotActivateFactoryException.hpp>
#include <com/sun/star/linguistic2/LinguProperties.hpp>
#include <com/sun/star/util/theMacroExpander.hpp>
+#include <com/sun/star/setup/UpdateCheck.hpp>
#include <comphelper/processfactory.hxx>
#include <editeng/langitem.hxx>
#include <editeng/optitems.hxx>
@@ -1553,17 +1554,13 @@ void OfaTreeOptionsDialog::Initialize( const Reference< XFrame >& _xFrame )
// Disable Online Update page if service not installed
if( RID_SVXPAGE_ONLINEUPDATE == nPageId )
{
- const OUString sService = "com.sun.star.setup.UpdateCheck";
-
try
{
- Reference < XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory() );
- Reference < XInterface > xService( xFactory->createInstance( sService ) );
-
+ Reference < XInterface > xService( setup::UpdateCheck::create( ::comphelper::getProcessComponentContext() ) );
if( ! xService.is() )
continue;
}
- catch ( ::com::sun::star::loader::CannotActivateFactoryException& )
+ catch ( ::com::sun::star::uno::DeploymentException& )
{
continue;
}
diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk
index e01b64d..7beadf6 100644
--- a/offapi/UnoApi_offapi.mk
+++ b/offapi/UnoApi_offapi.mk
@@ -344,6 +344,7 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/security,\
SerialNumberAdapter \
))
$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/setup,\
+ UpdateCheck \
UpdateCheckConfig \
))
$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/sheet,\
diff --git a/offapi/com/sun/star/setup/UpdateCheck.idl b/offapi/com/sun/star/setup/UpdateCheck.idl
new file mode 100644
index 0000000..ee908dc
--- /dev/null
+++ b/offapi/com/sun/star/setup/UpdateCheck.idl
@@ -0,0 +1,39 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef __com_sun_star_setup_UpdateCheck_idl__
+#define __com_sun_star_setup_UpdateCheck_idl__
+
+#include <com/sun/star/task/XJob.idl>
+
+
+module com { module sun { module star { module setup {
+
+
+/**
+ @since LibreOffice 4.1
+*/
+service UpdateCheck : com::sun::star::task::XJob;
+
+
+}; }; }; };
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit ef0af5032ad283ffb3b4521eb097a118d58f332a
Author: Noel Grandin <noel at peralex.com>
Date: Mon May 13 10:43:34 2013 +0200
fdo#46808, Convert linguistic2::LingProperties to new style
API-CHANGE:
Removed the following interfaces from the IDL because no-one was
using them:
interface com::sun::star::beans::XFastPropertySet;
interface com::sun::star::lang::XComponent;
But the service still implements them, so old code should keep on
working.
Change-Id: Iab058fb42bd1a54e0b9632e99e564fdc0869fe6e
diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx
index 8f5c20f..78e127b 100644
--- a/cui/source/options/treeopt.cxx
+++ b/cui/source/options/treeopt.cxx
@@ -58,6 +58,7 @@
#include <com/sun/star/frame/Desktop.hpp>
#include <com/sun/star/frame/ModuleManager.hpp>
#include <com/sun/star/loader/CannotActivateFactoryException.hpp>
+#include <com/sun/star/linguistic2/LinguProperties.hpp>
#include <com/sun/star/util/theMacroExpander.hpp>
#include <comphelper/processfactory.hxx>
#include <editeng/langitem.hxx>
@@ -1436,23 +1437,14 @@ void OfaTreeOptionsDialog::ApplyLanguageOptions(const SfxItemSet& rSet)
{
bSaveSpellCheck = ( (const SfxBoolItem*)pItem )->GetValue();
}
- Reference< XMultiServiceFactory > xMgr( ::comphelper::getProcessServiceFactory() );
- Reference< XPropertySet > xProp(
- xMgr->createInstance( OUString( "com.sun.star.linguistic2.LinguProperties" ) ),
- UNO_QUERY );
+ Reference< XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
+ Reference< XLinguProperties > xProp = LinguProperties::create( xContext );
if ( SFX_ITEM_SET == rSet.GetItemState(SID_ATTR_HYPHENREGION, sal_False, &pItem ) )
{
const SfxHyphenRegionItem* pHyphenItem = (const SfxHyphenRegionItem*)pItem;
- if (xProp.is())
- {
- xProp->setPropertyValue(
- OUString(UPN_HYPH_MIN_LEADING),
- makeAny((sal_Int16) pHyphenItem->GetMinLead()) );
- xProp->setPropertyValue(
- OUString(UPN_HYPH_MIN_TRAILING),
- makeAny((sal_Int16) pHyphenItem->GetMinTrail()) );
- }
+ xProp->setHyphMinLeading( (sal_Int16) pHyphenItem->GetMinLead() );
+ xProp->setHyphMinTrailing( (sal_Int16) pHyphenItem->GetMinTrail() );
bSaveSpellCheck = sal_True;
}
@@ -1483,12 +1475,7 @@ void OfaTreeOptionsDialog::ApplyLanguageOptions(const SfxItemSet& rSet)
pDispatch->Execute(SID_AUTOSPELL_CHECK,
SFX_CALLMODE_ASYNCHRON|SFX_CALLMODE_RECORD, pItem, 0L);
- if (xProp.is())
- {
- xProp->setPropertyValue(
- OUString(UPN_IS_SPELL_AUTO),
- makeAny(bOnlineSpelling) );
- }
+ xProp->setIsSpellAuto( bOnlineSpelling );
}
if( bSaveSpellCheck )
diff --git a/editeng/source/editeng/edtspell.cxx b/editeng/source/editeng/edtspell.cxx
index 5e9503e..3e1a3c9 100644
--- a/editeng/source/editeng/edtspell.cxx
+++ b/editeng/source/editeng/edtspell.cxx
@@ -136,7 +136,6 @@ sal_Bool EditSpellWrapper::SpellMore()
{
// The text has been entered into the engine, when backwords then
// it must be behind the selection.
- Reference< XPropertySet > xProp( SvxGetLinguPropertySet() );
pEditView->GetImpEditView()->SetEditSelection(
pEE->GetEditDoc().GetStartPaM() );
}
diff --git a/editeng/source/misc/splwrap.cxx b/editeng/source/misc/splwrap.cxx
index 6b81098..3189984 100644
--- a/editeng/source/misc/splwrap.cxx
+++ b/editeng/source/misc/splwrap.cxx
@@ -160,11 +160,8 @@ SvxSpellWrapper::SvxSpellWrapper( Window* pWn,
bRevAllowed ( bRevAllow ),
bAllRight ( bIsAllRight )
{
- Reference< beans::XPropertySet > xProp( SvxGetLinguPropertySet() );
- sal_Bool bWrapReverse = xProp.is() ?
- *(sal_Bool*)xProp->getPropertyValue(
- OUString(UPN_IS_WRAP_REVERSE) ).getValue()
- : sal_False;
+ Reference< linguistic2::XLinguProperties > xProp( SvxGetLinguPropertySet() );
+ sal_Bool bWrapReverse = xProp.is() ? xProp->getIsWrapReverse() : sal_False;
bReverse = bRevAllow && bWrapReverse;
bStartDone = bOther || ( !bReverse && bStart );
bEndDone = bReverse && bStart && !bOther;
@@ -399,11 +396,8 @@ void SvxSpellWrapper::SpellDocument( )
sal_Bool SvxSpellWrapper::SpellNext( )
{
- Reference< beans::XPropertySet > xProp( SvxGetLinguPropertySet() );
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list