Kaydet (Commit) 30c466d3 authored tarafından Noel Grandin's avatar Noel Grandin

fdo#46808, convert to XComponentContext

Change-Id: I51e98ac96815d6d7348d53a191400e608768d6b7
üst ccb77a73
......@@ -39,7 +39,6 @@
#include "svx/svdstr.hrc"
#include <algorithm>
using namespace ::comphelper;
using namespace ::accessibility;
using namespace ::com::sun::star::accessibility;
using namespace ::com::sun::star::uno;
......@@ -123,7 +122,7 @@ AccessibleControlShape::AccessibleControlShape (
, m_bDisposeNativeContext( false )
, m_bWaitingForControl( false )
{
m_pChildManager = new OWrappedAccessibleChildrenManager( getProcessComponentContext() );
m_pChildManager = new comphelper::OWrappedAccessibleChildrenManager( comphelper::getProcessComponentContext() );
m_pChildManager->acquire();
osl_atomic_increment( &m_refCount );
......@@ -260,7 +259,7 @@ void AccessibleControlShape::Init()
// .................................................................
// finally, aggregate a proxy for the control context
// first a factory for the proxy
Reference< XProxyFactory > xFactory = ProxyFactory::create( comphelper::getComponentContext(getProcessServiceFactory()) );
Reference< XProxyFactory > xFactory = ProxyFactory::create( comphelper::getProcessComponentContext() );
// then the proxy itself
if ( xNativeControlContext.is() )
{
......@@ -438,7 +437,7 @@ Sequence< Type > SAL_CALL AccessibleControlShape::getTypes() throw (RuntimeExcep
if ( m_xControlContextTypeAccess.is() )
aAggregateTypes = m_xControlContextTypeAccess->getTypes();
Sequence< Type > aAllTypes = concatSequences( aShapeTypes, aOwnTypes, aAggregateTypes );
Sequence< Type > aAllTypes = comphelper::concatSequences( aShapeTypes, aOwnTypes, aAggregateTypes );
// remove duplicates
Type* pBegin = aAllTypes.getArray();
......
......@@ -452,9 +452,8 @@ void SvxSearchDialog::Construct_Impl()
{
try
{
uno::Reference< lang::XMultiServiceFactory > xMgr = getProcessServiceFactory();
uno::Reference< lang::XMultiServiceFactory > xConfigurationProvider =
configuration::theDefaultProvider::get( comphelper::getComponentContext(xMgr) );
configuration::theDefaultProvider::get( comphelper::getProcessComponentContext() );
uno::Sequence< uno::Any > aArgs(1);
OUString sPath( "/org.openoffice.Office.Common/SearchOptions/");
aArgs[0] <<= sPath;
......
......@@ -28,20 +28,21 @@
using namespace ::svxform;
//-----------------------------------------------------------------------------
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL SvxFmMSFactory::createInstance(const OUString& ServiceSpecifier) throw( ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException )
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL SvxFmMSFactory::createInstance(const OUString& rServiceSpecifier) throw( ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException )
{
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xRet;
if ( ServiceSpecifier.indexOf( "com.sun.star.form.component." ) == 0 )
if ( rServiceSpecifier.startsWith( "com.sun.star.form.component." ) )
{
xRet = ::comphelper::getProcessServiceFactory()->createInstance(ServiceSpecifier);
css::uno::Reference<css::uno::XComponentContext> xContext = comphelper::getProcessComponentContext();
xRet = xContext->getServiceManager()->createInstanceWithContext(rServiceSpecifier, xContext);
}
else if ( ServiceSpecifier == "com.sun.star.drawing.ControlShape" )
else if ( rServiceSpecifier == "com.sun.star.drawing.ControlShape" )
{
SdrObject* pObj = new FmFormObj();
xRet = static_cast<cppu::OWeakObject*>(static_cast<SvxShape_UnoImplHelper*>(new SvxShapeControl(pObj)));
}
if (!xRet.is())
xRet = SvxUnoDrawMSFactory::createInstance(ServiceSpecifier);
xRet = SvxUnoDrawMSFactory::createInstance(rServiceSpecifier);
return xRet;
}
......
......@@ -329,11 +329,11 @@ const Reference< XNameContainer >& FmFormPageImpl::getForms( bool _bForceCreate
m_bAttemptedFormCreation = true;
const OUString sFormsCollectionServiceName("com.sun.star.form.Forms");
m_xForms = Reference< XNameContainer > (
::comphelper::getProcessServiceFactory()->createInstance( sFormsCollectionServiceName ),
UNO_QUERY
Reference<XComponentContext> xContext = comphelper::getProcessComponentContext();
m_xForms.set(
xContext->getServiceManager()->createInstanceWithContext( sFormsCollectionServiceName, xContext),
UNO_QUERY_THROW
);
DBG_ASSERT( m_xForms.is(), "FmFormPageImpl::getForms: could not create a forms collection!" );
if ( m_aFormsCreationHdl.IsSet() )
{
......
......@@ -1166,7 +1166,8 @@ bool FmXFormShell::executeControlConversionSlot( const Reference< XFormComponent
return false;
OUString sNewName( getServiceNameByControlType( nObjectTypes[ lookupSlot ] ) );
Reference< XControlModel> xNewModel( ::comphelper::getProcessServiceFactory()->createInstance( sNewName ), UNO_QUERY );
Reference<XComponentContext> xContext = comphelper::getProcessComponentContext();
Reference< XControlModel> xNewModel( xContext->getServiceManager()->createInstanceWithContext(sNewName, xContext), UNO_QUERY );
if (!xNewModel.is())
return false;
......
......@@ -1429,7 +1429,8 @@ namespace svxform
//////////////////////////////////////////////////////////////////////
// Neue Component erzeugen
Reference< XFormComponent > xNewComponent(::comphelper::getProcessServiceFactory()->createInstance(rServiceName), UNO_QUERY);
Reference<XComponentContext> xContext = comphelper::getProcessComponentContext();
Reference<XFormComponent> xNewComponent( xContext->getServiceManager()->createInstanceWithContext(rServiceName, xContext), UNO_QUERY);
if (!xNewComponent.is())
return NULL;
......
......@@ -395,33 +395,30 @@ GalleryProgress::GalleryProgress( GraphicFilter* pFilter ) :
uno::Reference< lang::XMultiServiceFactory > xMgr( ::comphelper::getProcessServiceFactory() );
if( xMgr.is() )
{
uno::Reference< awt::XProgressMonitor > xMonitor( xMgr->createInstance(
uno::Reference< awt::XProgressMonitor > xMonitor( xMgr->createInstance(
OUString("com.sun.star.awt.XProgressMonitor") ),
uno::UNO_QUERY );
if ( xMonitor.is() )
if ( xMonitor.is() )
{
mxProgressBar = uno::Reference< awt::XProgressBar >( xMonitor, uno::UNO_QUERY );
if( mxProgressBar.is() )
{
mxProgressBar = uno::Reference< awt::XProgressBar >( xMonitor, uno::UNO_QUERY );
String aProgressText;
if( mxProgressBar.is() )
if( mpFilter )
{
String aProgressText;
if( mpFilter )
{
aProgressText = GAL_RESSTR(RID_SVXSTR_GALLERY_FILTER);
// mpFilter->SetUpdatePercentHdl( LINK( this, GalleryProgress, Update ) ); // sj: progress wasn't working up from SO7 at all
// // so I am removing this. The gallery progress should
// // be changed to use the XStatusIndicator instead of XProgressMonitor
}
else
aProgressText = String( RTL_CONSTASCII_USTRINGPARAM( "Gallery" ) );
xMonitor->addText( String( RTL_CONSTASCII_USTRINGPARAM( "Gallery" ) ), aProgressText, sal_False ) ;
mxProgressBar->setRange( 0, GALLERY_PROGRESS_RANGE );
aProgressText = GAL_RESSTR(RID_SVXSTR_GALLERY_FILTER);
// mpFilter->SetUpdatePercentHdl( LINK( this, GalleryProgress, Update ) ); // sj: progress wasn't working up from SO7 at all
// // so I am removing this. The gallery progress should
// // be changed to use the XStatusIndicator instead of XProgressMonitor
}
else
aProgressText = String( RTL_CONSTASCII_USTRINGPARAM( "Gallery" ) );
xMonitor->addText( String( RTL_CONSTASCII_USTRINGPARAM( "Gallery" ) ), aProgressText, sal_False ) ;
mxProgressBar->setRange( 0, GALLERY_PROGRESS_RANGE );
}
}
}
......
......@@ -1205,8 +1205,8 @@ namespace sdr { namespace contact {
{
const OUString sControlServiceName( _rUnoObject.GetUnoControlTypeName() );
Reference< XMultiServiceFactory > xFactory( ::comphelper::getProcessServiceFactory(), UNO_SET_THROW );
_out_rControl = Reference< XControl >( xFactory->createInstance( sControlServiceName ), UNO_QUERY_THROW );
Reference< css::uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
_out_rControl = Reference<XControl>( xContext->getServiceManager()->createInstanceWithContext(sControlServiceName, xContext), UNO_QUERY_THROW );
// knit the model and the control
_out_rControl.setModel( xControlModel );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment