Get rid of vcl::unohelper::GetMultiServiceFactory

...which effectively is just a glorious wrapper around
comphelper::getProcessServiceFactory.

In turn gets also rid of ImplSVAppData's mxMSF and mpMSFTempFileName and the
rSMgr parameter to InitVCL.

All the VCL users "soffice", "spadmin", and "unopkg gui" appear to still work
fine.

Change-Id: I797d48f7d0d8c35bb82124c9ab0ee63850c4d863
This commit is contained in:
Stephan Bergmann 2012-10-31 09:22:53 +01:00
parent 6bc62f4f43
commit ced1151a1a
43 changed files with 189 additions and 347 deletions

View File

@ -680,7 +680,7 @@ void DemoApp::Main()
::ucb::UniversalContentBroker::create( ::ucb::UniversalContentBroker::create(
comphelper::getProcessComponentContext() ); comphelper::getProcessComponentContext() );
InitVCL( xFactory ); InitVCL();
TestWindow pWindow; TestWindow pWindow;
pWindow.Execute(); pWindow.Execute();
DeInitVCL(); DeInitVCL();

View File

@ -244,9 +244,7 @@ void ServiceImpl::startExecuteModal(
if (! bOfficePipePresent) { if (! bOfficePipePresent) {
OSL_ASSERT( ! bAppUp ); OSL_ASSERT( ! bAppUp );
app.reset( new MyApp ); app.reset( new MyApp );
if (! InitVCL( Reference<lang::XMultiServiceFactory>( if (! InitVCL() )
m_xComponentContext->getServiceManager(),
UNO_QUERY_THROW ) ))
throw RuntimeException( OUSTR("Cannot initialize VCL!"), throw RuntimeException( OUSTR("Cannot initialize VCL!"),
static_cast<OWeakObject *>(this) ); static_cast<OWeakObject *>(this) );
AllSettings as = app->GetSettings(); AllSettings as = app->GetSettings();

View File

@ -490,9 +490,7 @@ Reference<XComponentContext> getUNO(
{ {
//We show a message box or print to the console that there //We show a message box or print to the console that there
//is another instance already running //is another instance already running
if ( ! InitVCL( Reference<lang::XMultiServiceFactory>( if ( ! InitVCL() )
xComponentContext->getServiceManager(),
UNO_QUERY_THROW ) ))
throw RuntimeException( OUSTR("Cannot initialize VCL!"), throw RuntimeException( OUSTR("Cannot initialize VCL!"),
NULL ); NULL );
{ {

View File

@ -79,9 +79,9 @@ SAL_IMPLEMENT_MAIN()
xMSch.set(xComponentContext->getServiceManager(), com::sun::star::uno::UNO_QUERY); xMSch.set(xComponentContext->getServiceManager(), com::sun::star::uno::UNO_QUERY);
comphelper::setProcessServiceFactory(xMSch); comphelper::setProcessServiceFactory(xMSch);
// comphelper::setProcessServiceFactory( xMS); comphelper::setProcessServiceFactory(xMS);
InitVCL( xMS ); InitVCL();
::Main(); ::Main();
DeInitVCL(); DeInitVCL();

View File

@ -31,9 +31,9 @@
#include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <comphelper/processfactory.hxx> #include <comphelper/processfactory.hxx>
#include <comphelper/string.hxx> #include <comphelper/string.hxx>
#include <comphelper/processfactory.hxx>
#include <tools/urlobj.hxx> #include <tools/urlobj.hxx>
#include <unotools/confignode.hxx> #include <unotools/confignode.hxx>
#include <vcl/unohelp.hxx>
#include <i18npool/mslangid.hxx> #include <i18npool/mslangid.hxx>
#include <rtl/ustrbuf.hxx> #include <rtl/ustrbuf.hxx>
@ -62,7 +62,7 @@ ResId padmin::PaResId( sal_uInt32 nId )
utl::OConfigurationNode aNode = utl::OConfigurationNode aNode =
utl::OConfigurationTreeRoot::tryCreateWithServiceFactory( utl::OConfigurationTreeRoot::tryCreateWithServiceFactory(
vcl::unohelper::GetMultiServiceFactory(), comphelper::getProcessServiceFactory(),
OUString("org.openoffice.Setup/L10N") ); OUString("org.openoffice.Setup/L10N") );
if ( aNode.isValid() ) if ( aNode.isValid() )
{ {

View File

@ -80,7 +80,7 @@ Test::Test()
//of retaining references to the root ServiceFactory as its passed around //of retaining references to the root ServiceFactory as its passed around
comphelper::setProcessServiceFactory(xSM); comphelper::setProcessServiceFactory(xSM);
InitVCL(xSM); InitVCL();
SdDLL::Init(); SdDLL::Init();
} }

View File

@ -145,7 +145,7 @@ Test::Test()
//of retaining references to the root ServiceFactory as its passed around //of retaining references to the root ServiceFactory as its passed around
comphelper::setProcessServiceFactory(xSM); comphelper::setProcessServiceFactory(xSM);
InitVCL(xSM); InitVCL();
SmGlobals::ensure(); SmGlobals::ensure();
} }

View File

@ -115,7 +115,7 @@ Test::Test()
//of retaining references to the root ServiceFactory as its passed around //of retaining references to the root ServiceFactory as its passed around
comphelper::setProcessServiceFactory(xSM); comphelper::setProcessServiceFactory(xSM);
InitVCL(xSM); InitVCL();
SmGlobals::ensure(); SmGlobals::ensure();
} }

View File

@ -235,7 +235,7 @@ int main( int nArgCount, char* ppArgs[] )
::std::vector< String > aArgs; ::std::vector< String > aArgs;
BmpApp aBmpApp; BmpApp aBmpApp;
InitVCL( com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >() ); InitVCL();
for( int i = 1; i < nArgCount; i++ ) for( int i = 1; i < nArgCount; i++ )
aArgs.push_back( String( ppArgs[ i ], RTL_TEXTENCODING_ASCII_US ) ); aArgs.push_back( String( ppArgs[ i ], RTL_TEXTENCODING_ASCII_US ) );

View File

@ -468,7 +468,7 @@ int main( int nArgCount, char* ppArgs[] )
::std::vector< String > aArgs; ::std::vector< String > aArgs;
BmpSum aBmpSum; BmpSum aBmpSum;
InitVCL( com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >() ); InitVCL();
for( int i = 1; i < nArgCount; i++ ) for( int i = 1; i < nArgCount; i++ )
aArgs.push_back( String( ppArgs[ i ], RTL_TEXTENCODING_ASCII_US ) ); aArgs.push_back( String( ppArgs[ i ], RTL_TEXTENCODING_ASCII_US ) );

View File

@ -239,7 +239,7 @@ int main( int nArgCount, char* ppArgs[] )
::std::vector< String > aArgs; ::std::vector< String > aArgs;
G2GApp aG2GApp; G2GApp aG2GApp;
InitVCL( com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >() ); InitVCL();
for( int i = 1; i < nArgCount; i++ ) for( int i = 1; i < nArgCount; i++ )
aArgs.push_back( String( ppArgs[ i ], RTL_TEXTENCODING_ASCII_US ) ); aArgs.push_back( String( ppArgs[ i ], RTL_TEXTENCODING_ASCII_US ) );

View File

@ -55,7 +55,7 @@ SAL_IMPLEMENT_MAIN()
comphelper::setProcessServiceFactory(xSFactory); comphelper::setProcessServiceFactory(xSFactory);
InitVCL(xSFactory); InitVCL();
{ {
SvtLanguageTable aTable; SvtLanguageTable aTable;

View File

@ -31,7 +31,7 @@
#include <svtools/filectrl.hxx> #include <svtools/filectrl.hxx>
#include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/ui/dialogs/XFilePicker.hpp> #include <com/sun/star/ui/dialogs/XFilePicker.hpp>
#include <vcl/unohelp.hxx> #include <comphelper/processfactory.hxx>
#include <tools/urlobj.hxx> #include <tools/urlobj.hxx>
#include <osl/file.h> #include <osl/file.h>
#include <vcl/stdtext.hxx> #include <vcl/stdtext.hxx>
@ -48,7 +48,7 @@ void FileControl::ImplBrowseFile( )
const ::rtl::OUString sServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.dialogs.FilePicker" )); const ::rtl::OUString sServiceName( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ui.dialogs.FilePicker" ));
Reference< XMultiServiceFactory > xMSF = vcl::unohelper::GetMultiServiceFactory(); Reference< XMultiServiceFactory > xMSF = comphelper::getProcessServiceFactory();
Reference < dialogs::XFilePicker > xFilePicker( xMSF->createInstance( sServiceName ), UNO_QUERY ); Reference < dialogs::XFilePicker > xFilePicker( xMSF->createInstance( sServiceName ), UNO_QUERY );
if ( xFilePicker.is() ) if ( xFilePicker.is() )
{ {

View File

@ -1119,7 +1119,7 @@ void MSViewerWorkWindow::Resize()
} }
comphelper::setProcessServiceFactory( xMSF ); comphelper::setProcessServiceFactory( xMSF );
InitVCL( xMSF ); InitVCL();
String aConfigURL; String aConfigURL;
if( ::utl::LocalFileHelper::ConvertPhysicalNameToURL( Application::GetAppFileName(), aConfigURL ) ) if( ::utl::LocalFileHelper::ConvertPhysicalNameToURL( Application::GetAppFileName(), aConfigURL ) )

View File

@ -83,7 +83,7 @@ void test::BootstrapFixture::setUp()
aLocalOptions.SetLocaleConfigString( aLangISO ); aLocalOptions.SetLocaleConfigString( aLangISO );
aLocalOptions.SetUILocaleConfigString( aLangISO ); aLocalOptions.SetUILocaleConfigString( aLangISO );
InitVCL(m_xSFactory); InitVCL();
if (Application::IsHeadlessModeRequested()) if (Application::IsHeadlessModeRequested())
Application::EnableHeadlessMode(true); Application::EnableHeadlessMode(true);

View File

@ -106,7 +106,7 @@ protected:
public: public:
VCLXToolkit( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & ); VCLXToolkit();
~VCLXToolkit(); ~VCLXToolkit();
// ::com::sun::star::awt::XToolkitExperimental // ::com::sun::star::awt::XToolkitExperimental

View File

@ -414,27 +414,15 @@ static osl::Condition & getInitCondition()
return *pC; return *pC;
} }
struct ToolkitThreadData
{
VCLXToolkit * pTk;
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xSMgr;
ToolkitThreadData( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rSMgr, VCLXToolkit * pTk_ )
: pTk( pTk_ )
, xSMgr( rSMgr )
{
}
};
extern "C" extern "C"
{ {
static void SAL_CALL ToolkitWorkerFunction( void* pArgs ) static void SAL_CALL ToolkitWorkerFunction( void* pArgs )
{ {
ToolkitThreadData * pTTD = (ToolkitThreadData *)pArgs; VCLXToolkit * pTk = (VCLXToolkit *)pArgs;
bInitedByVCLToolkit = InitVCL( pTTD->xSMgr ); bInitedByVCLToolkit = InitVCL();
if( bInitedByVCLToolkit ) if( bInitedByVCLToolkit )
{ {
UnoWrapper* pUnoWrapper = new UnoWrapper( pTTD->pTk ); UnoWrapper* pUnoWrapper = new UnoWrapper( pTk );
Application::SetUnoWrapper( pUnoWrapper ); Application::SetUnoWrapper( pUnoWrapper );
} }
getInitCondition().set(); getInitCondition().set();
@ -446,7 +434,7 @@ static void SAL_CALL ToolkitWorkerFunction( void* pArgs )
} }
try try
{ {
pTTD->pTk->dispose(); pTk->dispose();
} }
catch( com::sun::star::uno::Exception & ) catch( com::sun::star::uno::Exception & )
{ {
@ -457,12 +445,11 @@ static void SAL_CALL ToolkitWorkerFunction( void* pArgs )
{ {
JoinMainLoopThread(); JoinMainLoopThread();
} }
delete pTTD;
} }
} }
// contructor, which might initialize VCL // contructor, which might initialize VCL
VCLXToolkit::VCLXToolkit( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rSMgr ): VCLXToolkit::VCLXToolkit():
cppu::WeakComponentImplHelper2< cppu::WeakComponentImplHelper2<
::com::sun::star::awt::XToolkitExperimental, ::com::sun::star::awt::XToolkitExperimental,
::com::sun::star::lang::XServiceInfo>( GetMutex() ), ::com::sun::star::lang::XServiceInfo>( GetMutex() ),
@ -482,7 +469,7 @@ VCLXToolkit::VCLXToolkit( const ::com::sun::star::uno::Reference< ::com::sun::st
if( ( nVCLToolkitInstanceCount == 1 ) && ( !Application::IsInMain() ) ) if( ( nVCLToolkitInstanceCount == 1 ) && ( !Application::IsInMain() ) )
{ {
// setup execute thread // setup execute thread
CreateMainLoopThread( ToolkitWorkerFunction, new ToolkitThreadData( rSMgr, this ) ); CreateMainLoopThread( ToolkitWorkerFunction, this );
getInitCondition().wait(); getInitCondition().wait();
} }
} }

View File

@ -114,7 +114,7 @@ namespace toolkit
using namespace toolkit; using namespace toolkit;
IMPL_CREATEINSTANCE2( VCLXToolkit ) IMPL_CREATEINSTANCE( VCLXToolkit )
IMPL_CREATEINSTANCE( StdTabController ) IMPL_CREATEINSTANCE( StdTabController )
IMPL_CREATEINSTANCE( StdTabControllerModel ) IMPL_CREATEINSTANCE( StdTabControllerModel )
IMPL_CREATEINSTANCE2( UnoButtonControl ) IMPL_CREATEINSTANCE2( UnoButtonControl )

View File

@ -26,7 +26,6 @@
* *
************************************************************************/ ************************************************************************/
#include "vcl/unohelp.hxx"
#include <DataFlavorMapping.hxx> #include <DataFlavorMapping.hxx>
#include "HtmlFmtFlt.hxx" #include "HtmlFmtFlt.hxx"
#include "PictToBmpFlt.hxx" #include "PictToBmpFlt.hxx"
@ -34,6 +33,7 @@
#include "com/sun/star/datatransfer/XMimeContentType.hpp" #include "com/sun/star/datatransfer/XMimeContentType.hpp"
#include "com/sun/star/lang/XMultiServiceFactory.hpp" #include "com/sun/star/lang/XMultiServiceFactory.hpp"
#include "com/sun/star/uno/Sequence.hxx" #include "com/sun/star/uno/Sequence.hxx"
#include "comphelper/processfactory.hxx"
#include <rtl/ustring.hxx> #include <rtl/ustring.hxx>
#include <osl/endian.h> #include <osl/endian.h>
@ -510,7 +510,7 @@ Any FileListDataProvider::getOOoData()
DataFlavorMapper::DataFlavorMapper() DataFlavorMapper::DataFlavorMapper()
{ {
Reference<XMultiServiceFactory> mrServiceManager = vcl::unohelper::GetMultiServiceFactory(); Reference<XMultiServiceFactory> mrServiceManager = comphelper::getProcessServiceFactory();
mrXMimeCntFactory = Reference<XMimeContentTypeFactory>(mrServiceManager->createInstance( mrXMimeCntFactory = Reference<XMimeContentTypeFactory>(mrServiceManager->createInstance(
OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.MimeContentTypeFactory"))), UNO_QUERY); OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.MimeContentTypeFactory"))), UNO_QUERY);

View File

@ -31,9 +31,8 @@
#include "DataFlavorMapping.hxx" #include "DataFlavorMapping.hxx"
#include "OSXTransferable.hxx" #include "OSXTransferable.hxx"
#include "vcl/unohelp.hxx"
#include "comphelper/makesequence.hxx" #include "comphelper/makesequence.hxx"
#include "comphelper/processfactory.hxx"
#include <boost/assert.hpp> #include <boost/assert.hpp>
@ -95,7 +94,7 @@ AquaClipboard::AquaClipboard(NSPasteboard* pasteboard, bool bUseSystemPasteboard
WeakComponentImplHelper4<XClipboardEx, XClipboardNotifier, XFlushableClipboard, XServiceInfo>(m_aMutex), WeakComponentImplHelper4<XClipboardEx, XClipboardNotifier, XFlushableClipboard, XServiceInfo>(m_aMutex),
mIsSystemPasteboard(bUseSystemPasteboard) mIsSystemPasteboard(bUseSystemPasteboard)
{ {
Reference<XMultiServiceFactory> mrServiceMgr = vcl::unohelper::GetMultiServiceFactory(); Reference<XMultiServiceFactory> mrServiceMgr = comphelper::getProcessServiceFactory();
mrXMimeCntFactory = Reference<XMimeContentTypeFactory>(mrServiceMgr->createInstance( mrXMimeCntFactory = Reference<XMimeContentTypeFactory>(mrServiceMgr->createInstance(
OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.MimeContentTypeFactory"))), UNO_QUERY); OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.MimeContentTypeFactory"))), UNO_QUERY);

View File

@ -53,10 +53,6 @@
#include <boost/unordered_map.hpp> #include <boost/unordered_map.hpp>
namespace com { namespace sun { namespace star { namespace lang {
class XMultiServiceFactory;
} } } }
struct ImplTimerData; struct ImplTimerData;
struct ImplConfigData; struct ImplConfigData;
class ImplDirectFontSubstitution; class ImplDirectFontSubstitution;
@ -124,8 +120,6 @@ struct ImplSVAppData
ImeStatusWindowMode_SHOW ImeStatusWindowMode_SHOW
}; };
::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxMSF;
String* mpMSFTempFileName;
AllSettings* mpSettings; // Application settings AllSettings* mpSettings; // Application settings
LocaleConfigurationListener* mpCfgListener; LocaleConfigurationListener* mpCfgListener;
VclEventListeners* mpEventListeners; // listeners for vcl events (eg, extended toolkit) VclEventListeners* mpEventListeners; // listeners for vcl events (eg, extended toolkit)

View File

@ -551,7 +551,7 @@ public:
VCL_DLLPUBLIC Application* GetpApp(); VCL_DLLPUBLIC Application* GetpApp();
VCL_DLLPUBLIC sal_Bool InitVCL( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & ); VCL_DLLPUBLIC sal_Bool InitVCL();
VCL_DLLPUBLIC void DeInitVCL(); VCL_DLLPUBLIC void DeInitVCL();
VCL_DLLPUBLIC bool InitAccessBridge( bool bAllowCancel, bool &rCancelled ); VCL_DLLPUBLIC bool InitAccessBridge( bool bAllowCancel, bool &rCancelled );

View File

@ -40,11 +40,7 @@ namespace i18n {
class XBreakIterator; class XBreakIterator;
class XCharacterClassification; class XCharacterClassification;
class XCollator; class XCollator;
} }}}}
namespace lang {
class XMultiServiceFactory;
}
}}}
namespace com { namespace com {
namespace sun { namespace sun {
@ -63,7 +59,6 @@ namespace vcl
{ {
namespace unohelper namespace unohelper
{ {
VCL_DLLPUBLIC ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > GetMultiServiceFactory();
VCL_DLLPUBLIC ::com::sun::star::uno::Reference < ::com::sun::star::i18n::XBreakIterator > CreateBreakIterator(); VCL_DLLPUBLIC ::com::sun::star::uno::Reference < ::com::sun::star::i18n::XBreakIterator > CreateBreakIterator();
VCL_DLLPUBLIC ::com::sun::star::uno::Reference < ::com::sun::star::i18n::XCharacterClassification> CreateCharacterClassification(); VCL_DLLPUBLIC ::com::sun::star::uno::Reference < ::com::sun::star::i18n::XCharacterClassification> CreateCharacterClassification();
//Get access to singleton Natural String Sorter collating for Application::GetLocale //Get access to singleton Natural String Sorter collating for Application::GetLocale

View File

@ -30,9 +30,8 @@
#include "iOSTransferable.hxx" #include "iOSTransferable.hxx"
#include "vcl/unohelp.hxx"
#include "comphelper/makesequence.hxx" #include "comphelper/makesequence.hxx"
#include "comphelper/processfactory.hxx"
#include <boost/assert.hpp> #include <boost/assert.hpp>
@ -94,7 +93,7 @@ IosClipboard::IosClipboard(UIPasteboard* pasteboard, bool bUseSystemPasteboard)
WeakComponentImplHelper4<XClipboardEx, XClipboardNotifier, XFlushableClipboard, XServiceInfo>(m_aMutex), WeakComponentImplHelper4<XClipboardEx, XClipboardNotifier, XFlushableClipboard, XServiceInfo>(m_aMutex),
mIsSystemPasteboard(bUseSystemPasteboard) mIsSystemPasteboard(bUseSystemPasteboard)
{ {
Reference<XMultiServiceFactory> mrServiceMgr = vcl::unohelper::GetMultiServiceFactory(); Reference<XMultiServiceFactory> mrServiceMgr = comphelper::getProcessServiceFactory();
mrXMimeCntFactory = Reference<XMimeContentTypeFactory>(mrServiceMgr->createInstance( mrXMimeCntFactory = Reference<XMimeContentTypeFactory>(mrServiceMgr->createInstance(
OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.MimeContentTypeFactory"))), UNO_QUERY); OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.MimeContentTypeFactory"))), UNO_QUERY);

View File

@ -27,6 +27,7 @@
************************************************************************/ ************************************************************************/
#include <svsys.h> #include <svsys.h>
#include "comphelper/processfactory.hxx"
#include "tools/debug.hxx" #include "tools/debug.hxx"
#include "i18npool/mslangid.hxx" #include "i18npool/mslangid.hxx"
@ -37,7 +38,6 @@
#include "vcl/i18nhelp.hxx" #include "vcl/i18nhelp.hxx"
#include "vcl/configsettings.hxx" #include "vcl/configsettings.hxx"
#include "vcl/gradient.hxx" #include "vcl/gradient.hxx"
#include "vcl/unohelp.hxx"
#include "vcl/bitmapex.hxx" #include "vcl/bitmapex.hxx"
#include "unotools/fontcfg.hxx" #include "unotools/fontcfg.hxx"
@ -1512,7 +1512,7 @@ bool AllSettings::GetLayoutRTL() const
{ {
nUIMirroring = 0; // ask configuration only once nUIMirroring = 0; // ask configuration only once
utl::OConfigurationNode aNode = utl::OConfigurationTreeRoot::tryCreateWithServiceFactory( utl::OConfigurationNode aNode = utl::OConfigurationTreeRoot::tryCreateWithServiceFactory(
vcl::unohelper::GetMultiServiceFactory(), comphelper::getProcessServiceFactory(),
OUString("org.openoffice.Office.Common/I18N/CTL") ); // note: case sensitive ! OUString("org.openoffice.Office.Common/I18N/CTL") ); // note: case sensitive !
if ( aNode.isValid() ) if ( aNode.isValid() )
{ {
@ -1585,7 +1585,7 @@ LanguageType AllSettings::GetUILanguage() const
const LocaleDataWrapper& AllSettings::GetLocaleDataWrapper() const const LocaleDataWrapper& AllSettings::GetLocaleDataWrapper() const
{ {
if ( !mpData->mpLocaleDataWrapper ) if ( !mpData->mpLocaleDataWrapper )
((AllSettings*)this)->mpData->mpLocaleDataWrapper = new LocaleDataWrapper( vcl::unohelper::GetMultiServiceFactory(), GetLocale() ); ((AllSettings*)this)->mpData->mpLocaleDataWrapper = new LocaleDataWrapper( comphelper::getProcessServiceFactory(), GetLocale() );
return *mpData->mpLocaleDataWrapper; return *mpData->mpLocaleDataWrapper;
} }
@ -1594,7 +1594,7 @@ const LocaleDataWrapper& AllSettings::GetLocaleDataWrapper() const
const LocaleDataWrapper& AllSettings::GetUILocaleDataWrapper() const const LocaleDataWrapper& AllSettings::GetUILocaleDataWrapper() const
{ {
if ( !mpData->mpUILocaleDataWrapper ) if ( !mpData->mpUILocaleDataWrapper )
((AllSettings*)this)->mpData->mpUILocaleDataWrapper = new LocaleDataWrapper( vcl::unohelper::GetMultiServiceFactory(), GetUILocale() ); ((AllSettings*)this)->mpData->mpUILocaleDataWrapper = new LocaleDataWrapper( comphelper::getProcessServiceFactory(), GetUILocale() );
return *mpData->mpUILocaleDataWrapper; return *mpData->mpUILocaleDataWrapper;
} }
@ -1603,7 +1603,7 @@ const LocaleDataWrapper& AllSettings::GetUILocaleDataWrapper() const
const vcl::I18nHelper& AllSettings::GetLocaleI18nHelper() const const vcl::I18nHelper& AllSettings::GetLocaleI18nHelper() const
{ {
if ( !mpData->mpI18nHelper ) { if ( !mpData->mpI18nHelper ) {
::com::sun::star::uno::Reference<com::sun::star::lang::XMultiServiceFactory> aFactory(vcl::unohelper::GetMultiServiceFactory()); ::com::sun::star::uno::Reference<com::sun::star::lang::XMultiServiceFactory> aFactory(comphelper::getProcessServiceFactory());
((AllSettings*)this)->mpData->mpI18nHelper = new vcl::I18nHelper( aFactory, GetLocale() ); ((AllSettings*)this)->mpData->mpI18nHelper = new vcl::I18nHelper( aFactory, GetLocale() );
} }
return *mpData->mpI18nHelper; return *mpData->mpI18nHelper;
@ -1614,7 +1614,7 @@ const vcl::I18nHelper& AllSettings::GetLocaleI18nHelper() const
const vcl::I18nHelper& AllSettings::GetUILocaleI18nHelper() const const vcl::I18nHelper& AllSettings::GetUILocaleI18nHelper() const
{ {
if ( !mpData->mpUII18nHelper ) { if ( !mpData->mpUII18nHelper ) {
::com::sun::star::uno::Reference<com::sun::star::lang::XMultiServiceFactory> aFactory(vcl::unohelper::GetMultiServiceFactory()); ::com::sun::star::uno::Reference<com::sun::star::lang::XMultiServiceFactory> aFactory(comphelper::getProcessServiceFactory());
((AllSettings*)this)->mpData->mpUII18nHelper = new vcl::I18nHelper( aFactory, GetUILocale() ); ((AllSettings*)this)->mpData->mpUII18nHelper = new vcl::I18nHelper( aFactory, GetUILocale() );
} }
return *mpData->mpUII18nHelper; return *mpData->mpUII18nHelper;

View File

@ -31,9 +31,9 @@
#include <boost/ptr_container/ptr_vector.hpp> #include <boost/ptr_container/ptr_vector.hpp>
#include <comphelper/processfactory.hxx>
#include <comphelper/string.hxx> #include <comphelper/string.hxx>
#include <osl/file.hxx>
#include <osl/mutex.hxx> #include <osl/mutex.hxx>
#include <rtl/process.h> #include <rtl/process.h>
#include "tools/debug.hxx" #include "tools/debug.hxx"
@ -49,7 +49,6 @@
#include "vcl/svapp.hxx" #include "vcl/svapp.hxx"
#include "vcl/wrkwin.hxx" #include "vcl/wrkwin.hxx"
#include "vcl/msgbox.hxx" #include "vcl/msgbox.hxx"
#include "vcl/unohelp.hxx"
#include "vcl/button.hxx" // for Button::GetStandardText #include "vcl/button.hxx" // for Button::GetStandardText
#include "vcl/dockwin.hxx" // for DockingManager #include "vcl/dockwin.hxx" // for DockingManager
#include "salinst.hxx" #include "salinst.hxx"
@ -61,7 +60,6 @@
#include "svids.hrc" #include "svids.hrc"
#include "com/sun/star/lang/XMultiServiceFactory.hpp" #include "com/sun/star/lang/XMultiServiceFactory.hpp"
#include "com/sun/star/lang/XComponent.hpp"
#include "com/sun/star/awt/XExtendedToolkit.hpp" #include "com/sun/star/awt/XExtendedToolkit.hpp"
#include "com/sun/star/java/JavaNotConfiguredException.hpp" #include "com/sun/star/java/JavaNotConfiguredException.hpp"
#include "com/sun/star/java/JavaVMCreationFailureException.hpp" #include "com/sun/star/java/JavaVMCreationFailureException.hpp"
@ -141,22 +139,6 @@ void ImplDeInitSVData()
if( pSVData->maGDIData.mpFontSubstConfiguration ) if( pSVData->maGDIData.mpFontSubstConfiguration )
delete pSVData->maGDIData.mpFontSubstConfiguration; delete pSVData->maGDIData.mpFontSubstConfiguration;
if ( pSVData->maAppData.mpMSFTempFileName )
{
if ( pSVData->maAppData.mxMSF.is() )
{
::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > xComp( pSVData->maAppData.mxMSF, ::com::sun::star::uno::UNO_QUERY );
xComp->dispose();
pSVData->maAppData.mxMSF = NULL;
}
::rtl::OUString aFileUrl;
::osl::File::getFileURLFromSystemPath( *pSVData->maAppData.mpMSFTempFileName, aFileUrl );
osl::File::remove( aFileUrl );
delete pSVData->maAppData.mpMSFTempFileName;
pSVData->maAppData.mpMSFTempFileName = NULL;
}
if( pSVData->maCtrlData.mpFieldUnitStrings ) if( pSVData->maCtrlData.mpFieldUnitStrings )
delete pSVData->maCtrlData.mpFieldUnitStrings, pSVData->maCtrlData.mpFieldUnitStrings = NULL; delete pSVData->maCtrlData.mpFieldUnitStrings, pSVData->maCtrlData.mpFieldUnitStrings = NULL;
if( pSVData->maCtrlData.mpCleanUnitStrings ) if( pSVData->maCtrlData.mpCleanUnitStrings )
@ -353,7 +335,7 @@ bool ImplInitAccessBridge(bool bAllowCancel, bool &rCancelled)
ImplSVData* pSVData = ImplGetSVData(); ImplSVData* pSVData = ImplGetSVData();
if( ! pSVData->mxAccessBridge.is() ) if( ! pSVData->mxAccessBridge.is() )
{ {
css::uno::Reference< XMultiServiceFactory > xFactory(vcl::unohelper::GetMultiServiceFactory()); css::uno::Reference< XMultiServiceFactory > xFactory(comphelper::getProcessServiceFactory());
if( xFactory.is() ) if( xFactory.is() )
{ {

View File

@ -160,11 +160,9 @@ int ImplSVMain()
DBG_ASSERT( pSVData->mpApp, "no instance of class Application" ); DBG_ASSERT( pSVData->mpApp, "no instance of class Application" );
uno::Reference<lang::XMultiServiceFactory> xMS;
int nReturn = EXIT_FAILURE; int nReturn = EXIT_FAILURE;
sal_Bool bInit = InitVCL( xMS ); sal_Bool bInit = InitVCL();
if( bInit ) if( bInit )
{ {
@ -251,7 +249,7 @@ uno::Any SAL_CALL DesktopEnvironmentContext::getValueByName( const rtl::OUString
return retVal; return retVal;
} }
sal_Bool InitVCL( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > & rSMgr ) sal_Bool InitVCL()
{ {
RTL_LOGFILE_CONTEXT( aLog, "vcl (ss112471) ::InitVCL" ); RTL_LOGFILE_CONTEXT( aLog, "vcl (ss112471) ::InitVCL" );
@ -277,9 +275,6 @@ sal_Bool InitVCL( const ::com::sun::star::uno::Reference< ::com::sun::star::lang
// SV bei den Tools anmelden // SV bei den Tools anmelden
InitTools(); InitTools();
DBG_ASSERT( !pSVData->maAppData.mxMSF.is(), "VCL service factory already set" );
pSVData->maAppData.mxMSF = rSMgr;
// Main-Thread-Id merken // Main-Thread-Id merken
pSVData->mnMainThreadId = ::osl::Thread::getCurrentIdentifier(); pSVData->mnMainThreadId = ::osl::Thread::getCurrentIdentifier();
@ -335,7 +330,7 @@ InitVCLWrapper()
comphelper::setProcessServiceFactory( xSM ); comphelper::setProcessServiceFactory( xSM );
InitVCL( xSM ); InitVCL();
} }
#endif #endif
@ -499,8 +494,6 @@ void DeInitVCL()
} }
} }
pSVData->maAppData.mxMSF.clear();
if( pSVData->mpApp ) if( pSVData->mpApp )
{ {
sal_uLong nCount = Application::ReleaseSolarMutex(); sal_uLong nCount = Application::ReleaseSolarMutex();

View File

@ -27,18 +27,11 @@
************************************************************************/ ************************************************************************/
#include <tools/tempfile.hxx>
#include <osl/file.hxx>
#include <cppuhelper/servicefactory.hxx>
#include <vcl/svapp.hxx> #include <vcl/svapp.hxx>
#include <vcl/unohelp.hxx> #include <vcl/unohelp.hxx>
#include <svdata.hxx> #include <svdata.hxx>
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <comphelper/processfactory.hxx> #include <comphelper/processfactory.hxx>
@ -47,8 +40,6 @@
#include <com/sun/star/awt/XExtendedToolkit.hpp> #include <com/sun/star/awt/XExtendedToolkit.hpp>
#include <com/sun/star/accessibility/AccessibleEventObject.hpp> #include <com/sun/star/accessibility/AccessibleEventObject.hpp>
#include <com/sun/star/accessibility/AccessibleStateType.hpp> #include <com/sun/star/accessibility/AccessibleStateType.hpp>
#include <com/sun/star/registry/ImplementationRegistration.hpp>
using namespace ::com::sun::star; using namespace ::com::sun::star;
using namespace ::rtl; using namespace ::rtl;
@ -56,103 +47,22 @@ using namespace ::rtl;
#define DOSTRING( x ) #x #define DOSTRING( x ) #x
#define STRING( x ) DOSTRING( x ) #define STRING( x ) DOSTRING( x )
struct VCLRegServiceInfo
{
const sal_Char* pLibName;
sal_Bool bHasSUPD;
};
static VCLRegServiceInfo aVCLComponentsArray[] =
{
{"i18n", sal_True},
{"i18npool", sal_True},
#ifdef UNX
#ifdef MACOSX
{"dtransaqua", sal_True},
#else
{"dtransX11", sal_True},
#endif
#endif
#if defined(WNT)
{"sysdtrans", sal_False},
#endif
{"dtrans", sal_False},
{"mcnttype", sal_False},
{"ftransl", sal_False},
{"dnd", sal_False},
{NULL, sal_False}
};
uno::Reference< lang::XMultiServiceFactory > vcl::unohelper::GetMultiServiceFactory()
{
ImplSVData* pSVData = ImplGetSVData();
if ( !pSVData->maAppData.mxMSF.is() )
{
pSVData->maAppData.mxMSF = ::comphelper::getProcessServiceFactory();
}
if ( !pSVData->maAppData.mxMSF.is() )
{
TempFile aTempFile;
OUString aTempFileName;
osl::FileBase::getSystemPathFromFileURL( aTempFile.GetName(), aTempFileName );
pSVData->maAppData.mpMSFTempFileName = new String(aTempFileName);
try
{
pSVData->maAppData.mxMSF = ::cppu::createRegistryServiceFactory( aTempFileName, rtl::OUString(), sal_False );
uno::Reference < registry::XImplementationRegistration > xReg(
registry::ImplementationRegistration::create( comphelper::getComponentContext(pSVData->maAppData.mxMSF) ) );
if( xReg.is() )
{
sal_Int32 nCompCount = 0;
while ( aVCLComponentsArray[ nCompCount ].pLibName )
{
OUString aComponentPathString = CreateLibraryName( aVCLComponentsArray[ nCompCount ].pLibName, aVCLComponentsArray[ nCompCount ].bHasSUPD );
if (!aComponentPathString.isEmpty() )
{
try
{
xReg->registerImplementation(
OUString("com.sun.star.loader.SharedLibrary"),aComponentPathString, NULL );
}
catch( ::com::sun::star::uno::Exception & )
{
}
}
nCompCount++;
}
}
}
catch( ::com::sun::star::uno::Exception & )
{
delete pSVData->maAppData.mpMSFTempFileName;
pSVData->maAppData.mpMSFTempFileName = NULL;
}
}
return pSVData->maAppData.mxMSF;
}
uno::Reference < i18n::XBreakIterator > vcl::unohelper::CreateBreakIterator() uno::Reference < i18n::XBreakIterator > vcl::unohelper::CreateBreakIterator()
{ {
uno::Reference< uno::XComponentContext > xContext = comphelper::getComponentContext(GetMultiServiceFactory()); uno::Reference< uno::XComponentContext > xContext = comphelper::getProcessComponentContext();
return i18n::BreakIterator::create(xContext); return i18n::BreakIterator::create(xContext);
} }
uno::Reference < i18n::XCharacterClassification > vcl::unohelper::CreateCharacterClassification() uno::Reference < i18n::XCharacterClassification > vcl::unohelper::CreateCharacterClassification()
{ {
uno::Reference < i18n::XCharacterClassification > xB; uno::Reference < i18n::XCharacterClassification > xB;
uno::Reference< lang::XMultiServiceFactory > xMSF = GetMultiServiceFactory(); uno::Reference< lang::XMultiServiceFactory > xMSF = comphelper::getProcessServiceFactory();
if ( xMSF.is() )
{
uno::Reference < uno::XInterface > xI = xMSF->createInstance( ::rtl::OUString("com.sun.star.i18n.CharacterClassification") ); uno::Reference < uno::XInterface > xI = xMSF->createInstance( ::rtl::OUString("com.sun.star.i18n.CharacterClassification") );
if ( xI.is() ) if ( xI.is() )
{ {
uno::Any x = xI->queryInterface( ::getCppuType((const uno::Reference< i18n::XCharacterClassification >*)0) ); uno::Any x = xI->queryInterface( ::getCppuType((const uno::Reference< i18n::XCharacterClassification >*)0) );
x >>= xB; x >>= xB;
} }
}
return xB; return xB;
} }

View File

@ -26,7 +26,9 @@
* *
************************************************************************/ ************************************************************************/
#include "sal/config.h"
#include <comphelper/processfactory.hxx>
#include <comphelper/string.hxx> #include <comphelper/string.hxx>
#include "tools/debug.hxx" #include "tools/debug.hxx"
@ -37,7 +39,6 @@
#include "vcl/field.hxx" #include "vcl/field.hxx"
#include "vcl/event.hxx" #include "vcl/event.hxx"
#include "vcl/svapp.hxx" #include "vcl/svapp.hxx"
#include "vcl/unohelp.hxx"
#include "svids.hrc" #include "svids.hrc"
#include "svdata.hxx" #include "svdata.hxx"
@ -317,7 +318,7 @@ LocaleDataWrapper& FormatterBase::ImplGetLocaleDataWrapper() const
{ {
if ( !mpLocaleDataWrapper ) if ( !mpLocaleDataWrapper )
{ {
((FormatterBase*)this)->mpLocaleDataWrapper = new LocaleDataWrapper( vcl::unohelper::GetMultiServiceFactory(), GetLocale() ); ((FormatterBase*)this)->mpLocaleDataWrapper = new LocaleDataWrapper( comphelper::getProcessServiceFactory(), GetLocale() );
} }
return *mpLocaleDataWrapper; return *mpLocaleDataWrapper;
} }

View File

@ -1580,7 +1580,7 @@ CalendarWrapper& DateFormatter::GetCalendarWrapper() const
{ {
if ( !mpCalendarWrapper ) if ( !mpCalendarWrapper )
{ {
((DateFormatter*)this)->mpCalendarWrapper = new CalendarWrapper( comphelper::getComponentContext( vcl::unohelper::GetMultiServiceFactory() ) ); ((DateFormatter*)this)->mpCalendarWrapper = new CalendarWrapper( comphelper::getComponentContext( comphelper::getProcessServiceFactory() ) );
mpCalendarWrapper->loadDefaultCalendar( GetLocale() ); mpCalendarWrapper->loadDefaultCalendar( GetLocale() );
} }

View File

@ -2979,7 +2979,7 @@ void TextEngine::SetLocale( const ::com::sun::star::lang::Locale& rLocale )
LocaleDataWrapper* TextEngine::ImpGetLocaleDataWrapper() LocaleDataWrapper* TextEngine::ImpGetLocaleDataWrapper()
{ {
if ( !mpLocaleDataWrapper ) if ( !mpLocaleDataWrapper )
mpLocaleDataWrapper = new LocaleDataWrapper( vcl::unohelper::GetMultiServiceFactory(), GetLocale() ); mpLocaleDataWrapper = new LocaleDataWrapper( comphelper::getProcessServiceFactory(), GetLocale() );
return mpLocaleDataWrapper; return mpLocaleDataWrapper;
} }

View File

@ -39,7 +39,6 @@
#include <vcl/gdimtf.hxx> #include <vcl/gdimtf.hxx>
#include <vcl/graphictools.hxx> #include <vcl/graphictools.hxx>
#include <vcl/canvastools.hxx> #include <vcl/canvastools.hxx>
#include <vcl/unohelp.hxx>
#include <salbmp.hxx> #include <salbmp.hxx>
#include <salinst.hxx> #include <salinst.hxx>
@ -55,6 +54,7 @@
#include <com/sun/star/awt/XGraphics.hpp> #include <com/sun/star/awt/XGraphics.hpp>
#include <com/sun/star/graphic/XGraphic.hpp> #include <com/sun/star/graphic/XGraphic.hpp>
#include <com/sun/star/graphic/XGraphicRenderer.hpp> #include <com/sun/star/graphic/XGraphicRenderer.hpp>
#include <comphelper/processfactory.hxx>
using namespace com::sun::star; using namespace com::sun::star;
@ -462,8 +462,8 @@ bool GDIMetaFile::ImplPlayWithRenderer( OutputDevice* pOut, const Point& rPos, S
Size aSize (rDestSize.Width () + 1, rDestSize.Height () + 1); Size aSize (rDestSize.Width () + 1, rDestSize.Height () + 1);
uno::Reference<rendering::XBitmap> xBitmap = xCanvas->getDevice ()->createCompatibleAlphaBitmap (vcl::unotools::integerSize2DFromSize( aSize)); uno::Reference<rendering::XBitmap> xBitmap = xCanvas->getDevice ()->createCompatibleAlphaBitmap (vcl::unotools::integerSize2DFromSize( aSize));
uno::Reference< lang::XMultiServiceFactory > xFactory = vcl::unohelper::GetMultiServiceFactory(); uno::Reference< lang::XMultiServiceFactory > xFactory = comphelper::getProcessServiceFactory();
if( xFactory.is() && xBitmap.is () ) if( xBitmap.is () )
{ {
uno::Reference< rendering::XMtfRenderer > xMtfRenderer; uno::Reference< rendering::XMtfRenderer > xMtfRenderer;
uno::Sequence< uno::Any > args (1); uno::Sequence< uno::Any > args (1);
@ -553,8 +553,8 @@ void GDIMetaFile::ImplDelegate2PluggableRenderer( const MetaCommentAction* pAct,
const ::rtl::OUString aGraphicServiceName=aBuffer.makeStringAndClear(); const ::rtl::OUString aGraphicServiceName=aBuffer.makeStringAndClear();
++pData; ++pData;
uno::Reference< lang::XMultiServiceFactory > xFactory = vcl::unohelper::GetMultiServiceFactory(); uno::Reference< lang::XMultiServiceFactory > xFactory = comphelper::getProcessServiceFactory();
if( pData<pEndData && xFactory.is() ) if( pData<pEndData )
{ {
try try
{ {

View File

@ -68,7 +68,7 @@
#include <com/sun/star/uno/Sequence.hxx> #include <com/sun/star/uno/Sequence.hxx>
#include <com/sun/star/rendering/XCanvas.hpp> #include <com/sun/star/rendering/XCanvas.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <vcl/unohelp.hxx> #include <comphelper/processfactory.hxx>
#include <numeric> #include <numeric>
@ -2677,30 +2677,22 @@ SystemGraphicsData OutputDevice::GetSystemGfxData() const
aArg[ 3 ] = uno::makeAny( sal_False ); aArg[ 3 ] = uno::makeAny( sal_False );
aArg[ 5 ] = GetSystemGfxDataAny(); aArg[ 5 ] = GetSystemGfxDataAny();
uno::Reference<lang::XMultiServiceFactory> xFactory = vcl::unohelper::GetMultiServiceFactory(); uno::Reference<lang::XMultiServiceFactory> xFactory = comphelper::getProcessServiceFactory();
uno::Reference<rendering::XCanvas> xCanvas; uno::Reference<rendering::XCanvas> xCanvas;
// Create canvas instance with window handle // Create canvas instance with window handle
// ========================================= // =========================================
if ( xFactory.is() )
{
static uno::Reference<lang::XMultiServiceFactory> xCanvasFactory( static uno::Reference<lang::XMultiServiceFactory> xCanvasFactory(
xFactory->createInstance( xFactory->createInstance( "com.sun.star.rendering.CanvasFactory" ),
OUString( RTL_CONSTASCII_USTRINGPARAM(
"com.sun.star."
"rendering.CanvasFactory") ) ),
uno::UNO_QUERY ); uno::UNO_QUERY );
if(xCanvasFactory.is()) if(xCanvasFactory.is())
{ {
xCanvas.set( xCanvas.set(
xCanvasFactory->createInstanceWithArguments( xCanvasFactory->createInstanceWithArguments(
OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.rendering.Canvas", aArg ),
"com.sun.star.rendering.Canvas" )),
aArg ),
uno::UNO_QUERY ); uno::UNO_QUERY );
} }
}
return xCanvas; return xCanvas;
} }

View File

@ -195,7 +195,7 @@ void PDFWriterImpl::implWriteBitmapEx( const Point& i_rPoint, const Size& i_rSiz
{ {
uno::Reference < io::XStream > xStream = new utl::OStreamWrapper( aStrm ); uno::Reference < io::XStream > xStream = new utl::OStreamWrapper( aStrm );
uno::Reference< io::XSeekable > xSeekable( xStream, UNO_QUERY_THROW ); uno::Reference< io::XSeekable > xSeekable( xStream, UNO_QUERY_THROW );
uno::Reference< uno::XComponentContext > xContext( comphelper::getComponentContext(ImplGetSVData()->maAppData.mxMSF) ); uno::Reference< uno::XComponentContext > xContext( comphelper::getProcessComponentContext() );
uno::Reference< graphic::XGraphicProvider > xGraphicProvider( graphic::GraphicProvider::create(xContext) ); uno::Reference< graphic::XGraphicProvider > xGraphicProvider( graphic::GraphicProvider::create(xContext) );
uno::Reference< graphic::XGraphic > xGraphic( aGraphic.GetXGraphic() ); uno::Reference< graphic::XGraphic > xGraphic( aGraphic.GetXGraphic() );
uno::Reference < io::XOutputStream > xOut( xStream->getOutputStream() ); uno::Reference < io::XOutputStream > xOut( xStream->getOutputStream() );

View File

@ -39,7 +39,6 @@
#include <vcl/sysdata.hxx> #include <vcl/sysdata.hxx>
#include <vcl/svapp.hxx> #include <vcl/svapp.hxx>
#include <vcl/syschild.hxx> #include <vcl/syschild.hxx>
#include <vcl/unohelp.hxx>
#include <window.h> #include <window.h>
#include <salinst.hxx> #include <salinst.hxx>
@ -245,9 +244,9 @@ sal_IntPtr SystemChildWindow::GetParentWindowHandle( sal_Bool bUseJava )
#ifdef SOLAR_JAVA #ifdef SOLAR_JAVA
else else
{ {
uno::Reference< lang::XMultiServiceFactory > xFactory( vcl::unohelper::GetMultiServiceFactory() ); uno::Reference< lang::XMultiServiceFactory > xFactory( comphelper::getProcessServiceFactory() );
if( xFactory.is() && ( GetSystemData()->aWindow > 0 ) ) if( GetSystemData()->aWindow > 0 )
{ {
try try
{ {

View File

@ -26,7 +26,9 @@
* *
************************************************************************/ ************************************************************************/
#include "sal/config.h"
#include <comphelper/processfactory.hxx>
#include <comphelper/string.hxx> #include <comphelper/string.hxx>
#include <tools/debug.hxx> #include <tools/debug.hxx>
#include <tools/rc.h> #include <tools/rc.h>
@ -37,7 +39,6 @@
#include <vcl/toolbox.hxx> #include <vcl/toolbox.hxx>
#include <vcl/mnemonic.hxx> #include <vcl/mnemonic.hxx>
#include <vcl/menu.hxx> #include <vcl/menu.hxx>
#include <vcl/unohelp.hxx>
#include <vcl/ImageListProvider.hxx> #include <vcl/ImageListProvider.hxx>
#include <svdata.hxx> #include <svdata.hxx>
@ -2139,7 +2140,7 @@ sal_Bool ToolBox::AlwaysLocked()
nAlwaysLocked = 0; // ask configuration only once nAlwaysLocked = 0; // ask configuration only once
utl::OConfigurationNode aNode = utl::OConfigurationTreeRoot::tryCreateWithServiceFactory( utl::OConfigurationNode aNode = utl::OConfigurationTreeRoot::tryCreateWithServiceFactory(
vcl::unohelper::GetMultiServiceFactory(), comphelper::getProcessServiceFactory(),
OUString("/org.openoffice.Office.UI.GlobalSettings/Toolbars") ); // note: case sensitive ! OUString("/org.openoffice.Office.UI.GlobalSettings/Toolbars") ); // note: case sensitive !
if ( aNode.isValid() ) if ( aNode.isValid() )
{ {
@ -2152,7 +2153,7 @@ sal_Bool ToolBox::AlwaysLocked()
{ {
// now read the locking state // now read the locking state
utl::OConfigurationNode aNode2 = utl::OConfigurationTreeRoot::tryCreateWithServiceFactory( utl::OConfigurationNode aNode2 = utl::OConfigurationTreeRoot::tryCreateWithServiceFactory(
vcl::unohelper::GetMultiServiceFactory(), comphelper::getProcessServiceFactory(),
OUString("/org.openoffice.Office.UI.GlobalSettings/Toolbars/States") ); // note: case sensitive ! OUString("/org.openoffice.Office.UI.GlobalSettings/Toolbars/States") ); // note: case sensitive !
sal_Bool bLocked = sal_Bool(); sal_Bool bLocked = sal_Bool();

View File

@ -36,7 +36,6 @@
#include "unotools/confignode.hxx" #include "unotools/confignode.hxx"
#include "vcl/layout.hxx" #include "vcl/layout.hxx"
#include "vcl/unohelp.hxx"
#include "vcl/salgtype.hxx" #include "vcl/salgtype.hxx"
#include "vcl/event.hxx" #include "vcl/event.hxx"
#include "vcl/help.hxx" #include "vcl/help.hxx"
@ -486,7 +485,7 @@ void Window::ImplUpdateGlobalSettings( AllSettings& rSettings, sal_Bool bCallHdl
{ {
sal_Bool bTmp = sal_False, bAutoHCMode = sal_True; sal_Bool bTmp = sal_False, bAutoHCMode = sal_True;
utl::OConfigurationNode aNode = utl::OConfigurationTreeRoot::tryCreateWithServiceFactory( utl::OConfigurationNode aNode = utl::OConfigurationTreeRoot::tryCreateWithServiceFactory(
vcl::unohelper::GetMultiServiceFactory(), comphelper::getProcessServiceFactory(),
OUString("org.openoffice.Office.Common/Accessibility") ); // note: case sensitive ! OUString("org.openoffice.Office.Common/Accessibility") ); // note: case sensitive !
if ( aNode.isValid() ) if ( aNode.isValid() )
{ {
@ -8355,9 +8354,7 @@ uno::Reference< XDragSource > Window::GetDragSource()
{ {
try try
{ {
uno::Reference< XMultiServiceFactory > xFactory = vcl::unohelper::GetMultiServiceFactory(); uno::Reference< XMultiServiceFactory > xFactory = comphelper::getProcessServiceFactory();
if ( xFactory.is() )
{
const SystemEnvData * pEnvData = GetSystemData(); const SystemEnvData * pEnvData = GetSystemData();
if( pEnvData ) if( pEnvData )
@ -8405,7 +8402,6 @@ uno::Reference< XDragSource > Window::GetDragSource()
mpWindowImpl->mpFrameData->mxDropTarget = uno::Reference< XDropTarget > ( xFactory->createInstanceWithArguments( aDropTargetSN, aDropTargetAL ), UNO_QUERY ); mpWindowImpl->mpFrameData->mxDropTarget = uno::Reference< XDropTarget > ( xFactory->createInstanceWithArguments( aDropTargetSN, aDropTargetAL ), UNO_QUERY );
} }
} }
}
// createInstance can throw any exception // createInstance can throw any exception
catch (const Exception&) catch (const Exception&)
@ -8441,10 +8437,8 @@ uno::Reference< XClipboard > Window::GetClipboard()
{ {
try try
{ {
uno::Reference< XMultiServiceFactory > xFactory( vcl::unohelper::GetMultiServiceFactory() ); uno::Reference< XMultiServiceFactory > xFactory( comphelper::getProcessServiceFactory() );
if( xFactory.is() )
{
mpWindowImpl->mpFrameData->mxClipboard = uno::Reference< XClipboard >( xFactory->createInstance( OUString("com.sun.star.datatransfer.clipboard.SystemClipboardExt") ), UNO_QUERY ); mpWindowImpl->mpFrameData->mxClipboard = uno::Reference< XClipboard >( xFactory->createInstance( OUString("com.sun.star.datatransfer.clipboard.SystemClipboardExt") ), UNO_QUERY );
if( !mpWindowImpl->mpFrameData->mxClipboard.is() ) if( !mpWindowImpl->mpFrameData->mxClipboard.is() )
@ -8467,7 +8461,6 @@ uno::Reference< XClipboard > Window::GetClipboard()
} }
#endif #endif
} }
}
// createInstance can throw any exception // createInstance can throw any exception
catch (const Exception&) catch (const Exception&)
@ -8495,10 +8488,8 @@ uno::Reference< XClipboard > Window::GetPrimarySelection()
{ {
try try
{ {
uno::Reference< XMultiServiceFactory > xFactory( vcl::unohelper::GetMultiServiceFactory() ); uno::Reference< XMultiServiceFactory > xFactory( comphelper::getProcessServiceFactory() );
if( xFactory.is() )
{
#if defined(UNX) && !defined(QUARTZ) #if defined(UNX) && !defined(QUARTZ)
Sequence< Any > aArgumentList( 3 ); Sequence< Any > aArgumentList( 3 );
aArgumentList[ 0 ] = makeAny( Application::GetDisplayConnection() ); aArgumentList[ 0 ] = makeAny( Application::GetDisplayConnection() );
@ -8519,7 +8510,6 @@ uno::Reference< XClipboard > Window::GetPrimarySelection()
mpWindowImpl->mpFrameData->mxSelection = s_xSelection; mpWindowImpl->mpFrameData->mxSelection = s_xSelection;
# endif # endif
} }
}
// createInstance can throw any exception // createInstance can throw any exception
catch (const Exception&) catch (const Exception&)
@ -9451,12 +9441,10 @@ uno::Reference< rendering::XCanvas > Window::ImplGetCanvas( const Size& rFullscr
const_cast<Window*>(this)->GetComponentInterface(), const_cast<Window*>(this)->GetComponentInterface(),
uno::UNO_QUERY )); uno::UNO_QUERY ));
uno::Reference< XMultiServiceFactory > xFactory = vcl::unohelper::GetMultiServiceFactory(); uno::Reference< XMultiServiceFactory > xFactory = comphelper::getProcessServiceFactory();
// Create canvas instance with window handle // Create canvas instance with window handle
// ========================================= // =========================================
if ( xFactory.is() )
{
static ::vcl::DeleteUnoReferenceOnDeinit<lang::XMultiServiceFactory> xStaticCanvasFactory( static ::vcl::DeleteUnoReferenceOnDeinit<lang::XMultiServiceFactory> xStaticCanvasFactory(
uno::Reference<lang::XMultiServiceFactory>( uno::Reference<lang::XMultiServiceFactory>(
xFactory->createInstance( xFactory->createInstance(
@ -9481,7 +9469,6 @@ uno::Reference< rendering::XCanvas > Window::ImplGetCanvas( const Size& rFullscr
OUString( "com.sun.star.rendering.Canvas" ), OUString( "com.sun.star.rendering.Canvas" ),
aArg ), aArg ),
UNO_QUERY ); UNO_QUERY );
} }
else else
{ {
@ -9499,7 +9486,6 @@ uno::Reference< rendering::XCanvas > Window::ImplGetCanvas( const Size& rFullscr
mpWindowImpl->mxCanvas = xCanvas; mpWindowImpl->mxCanvas = xCanvas;
} }
}
// no factory??? Empty reference, then. // no factory??? Empty reference, then.
return xCanvas; return xCanvas;

View File

@ -78,7 +78,9 @@ SAL_IMPLEMENT_MAIN()
rtl::OUString( "applicat.rdb" ), rtl::OUString( "applicat.rdb" ),
sal_True ); sal_True );
InitVCL( xMS ); comphelper::setProcessServiceFactory( xMS );
InitVCL();
::Main(); ::Main();
DeInitVCL(); DeInitVCL();

View File

@ -47,7 +47,9 @@ SAL_IMPLEMENT_MAIN()
Reference< XMultiServiceFactory > xMS; Reference< XMultiServiceFactory > xMS;
xMS = cppu::createRegistryServiceFactory( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "types.rdb" ) ), rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "applicat.rdb" ) ), sal_True ); xMS = cppu::createRegistryServiceFactory( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "types.rdb" ) ), rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "applicat.rdb" ) ), sal_True );
InitVCL( xMS ); comphelper::setProcessServiceFactory( xMS );
InitVCL();
::Main(); ::Main();
DeInitVCL(); DeInitVCL();

View File

@ -100,7 +100,7 @@ SAL_IMPLEMENT_MAIN()
exit( 1 ); exit( 1 );
} }
InitVCL( xFactory ); InitVCL();
::Main(); ::Main();
DeInitVCL(); DeInitVCL();

View File

@ -66,7 +66,9 @@ SAL_IMPLEMENT_MAIN()
Reference< XMultiServiceFactory > xMS; Reference< XMultiServiceFactory > xMS;
xMS = cppu::createRegistryServiceFactory( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "types.rdb" ) ), rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "applicat.rdb" ) ), sal_True ); xMS = cppu::createRegistryServiceFactory( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "types.rdb" ) ), rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "applicat.rdb" ) ), sal_True );
InitVCL( xMS ); comphelper::setProcessServiceFactory( xMS );
InitVCL();
::Main(); ::Main();
DeInitVCL(); DeInitVCL();

View File

@ -59,7 +59,9 @@ SAL_IMPLEMENT_MAIN()
Reference< XMultiServiceFactory > xMS; Reference< XMultiServiceFactory > xMS;
xMS = cppu::createRegistryServiceFactory( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "types.rdb" ) ), rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "applicat.rdb" ) ), sal_True ); xMS = cppu::createRegistryServiceFactory( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "types.rdb" ) ), rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "applicat.rdb" ) ), sal_True );
InitVCL( xMS ); comphelper::setProcessServiceFactory( xMS );
InitVCL();
::Main(); ::Main();
DeInitVCL(); DeInitVCL();

View File

@ -96,7 +96,7 @@ void Main();
} }
comphelper::setProcessServiceFactory( xMSF ); comphelper::setProcessServiceFactory( xMSF );
InitVCL( xMSF ); InitVCL();
::Main(); ::Main();
DeInitVCL(); DeInitVCL();