diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2012-10-31 09:22:53 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2012-10-31 09:22:53 +0100 |
commit | ced1151a1ad00fb2913a4c0f54e4544f4e566c05 (patch) | |
tree | 416403e0c91acc4cbfe6219f1930ea0273a856e0 /vcl | |
parent | 6bc62f4f43c7458399169ddb2cba30ae4188b1bd (diff) |
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
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/aqua/source/dtrans/DataFlavorMapping.cxx | 4 | ||||
-rw-r--r-- | vcl/aqua/source/dtrans/aqua_clipboard.cxx | 5 | ||||
-rw-r--r-- | vcl/inc/svdata.hxx | 6 | ||||
-rw-r--r-- | vcl/inc/vcl/svapp.hxx | 2 | ||||
-rw-r--r-- | vcl/inc/vcl/unohelp.hxx | 7 | ||||
-rw-r--r-- | vcl/ios/source/dtrans/ios_clipboard.cxx | 5 | ||||
-rw-r--r-- | vcl/source/app/settings.cxx | 12 | ||||
-rw-r--r-- | vcl/source/app/svdata.cxx | 22 | ||||
-rw-r--r-- | vcl/source/app/svmain.cxx | 13 | ||||
-rw-r--r-- | vcl/source/app/unohelp.cxx | 102 | ||||
-rw-r--r-- | vcl/source/control/field.cxx | 5 | ||||
-rw-r--r-- | vcl/source/control/field2.cxx | 2 | ||||
-rw-r--r-- | vcl/source/edit/texteng.cxx | 2 | ||||
-rw-r--r-- | vcl/source/gdi/gdimtf.cxx | 10 | ||||
-rw-r--r-- | vcl/source/gdi/outdev.cxx | 28 | ||||
-rw-r--r-- | vcl/source/gdi/pdfwriter_impl2.cxx | 2 | ||||
-rw-r--r-- | vcl/source/window/syschild.cxx | 5 | ||||
-rw-r--r-- | vcl/source/window/toolbox2.cxx | 7 | ||||
-rw-r--r-- | vcl/source/window/window.cxx | 204 | ||||
-rw-r--r-- | vcl/test/canvasbitmaptest.cxx | 4 | ||||
-rw-r--r-- | vcl/workben/svdem.cxx | 4 | ||||
-rw-r--r-- | vcl/workben/svpclient.cxx | 2 | ||||
-rw-r--r-- | vcl/workben/svptest.cxx | 4 | ||||
-rw-r--r-- | vcl/workben/vcldemo.cxx | 4 |
24 files changed, 160 insertions, 301 deletions
diff --git a/vcl/aqua/source/dtrans/DataFlavorMapping.cxx b/vcl/aqua/source/dtrans/DataFlavorMapping.cxx index ee9a02016e61..4ad67404bd4a 100644 --- a/vcl/aqua/source/dtrans/DataFlavorMapping.cxx +++ b/vcl/aqua/source/dtrans/DataFlavorMapping.cxx @@ -26,7 +26,6 @@ * ************************************************************************/ -#include "vcl/unohelp.hxx" #include <DataFlavorMapping.hxx> #include "HtmlFmtFlt.hxx" #include "PictToBmpFlt.hxx" @@ -34,6 +33,7 @@ #include "com/sun/star/datatransfer/XMimeContentType.hpp" #include "com/sun/star/lang/XMultiServiceFactory.hpp" #include "com/sun/star/uno/Sequence.hxx" +#include "comphelper/processfactory.hxx" #include <rtl/ustring.hxx> #include <osl/endian.h> @@ -510,7 +510,7 @@ Any FileListDataProvider::getOOoData() DataFlavorMapper::DataFlavorMapper() { - Reference<XMultiServiceFactory> mrServiceManager = vcl::unohelper::GetMultiServiceFactory(); + Reference<XMultiServiceFactory> mrServiceManager = comphelper::getProcessServiceFactory(); mrXMimeCntFactory = Reference<XMimeContentTypeFactory>(mrServiceManager->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.MimeContentTypeFactory"))), UNO_QUERY); diff --git a/vcl/aqua/source/dtrans/aqua_clipboard.cxx b/vcl/aqua/source/dtrans/aqua_clipboard.cxx index a33e1564d51c..2fa1ddfd3eda 100644 --- a/vcl/aqua/source/dtrans/aqua_clipboard.cxx +++ b/vcl/aqua/source/dtrans/aqua_clipboard.cxx @@ -31,9 +31,8 @@ #include "DataFlavorMapping.hxx" #include "OSXTransferable.hxx" -#include "vcl/unohelp.hxx" - #include "comphelper/makesequence.hxx" +#include "comphelper/processfactory.hxx" #include <boost/assert.hpp> @@ -95,7 +94,7 @@ AquaClipboard::AquaClipboard(NSPasteboard* pasteboard, bool bUseSystemPasteboard WeakComponentImplHelper4<XClipboardEx, XClipboardNotifier, XFlushableClipboard, XServiceInfo>(m_aMutex), mIsSystemPasteboard(bUseSystemPasteboard) { - Reference<XMultiServiceFactory> mrServiceMgr = vcl::unohelper::GetMultiServiceFactory(); + Reference<XMultiServiceFactory> mrServiceMgr = comphelper::getProcessServiceFactory(); mrXMimeCntFactory = Reference<XMimeContentTypeFactory>(mrServiceMgr->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.MimeContentTypeFactory"))), UNO_QUERY); diff --git a/vcl/inc/svdata.hxx b/vcl/inc/svdata.hxx index 76c465021234..015e44545a59 100644 --- a/vcl/inc/svdata.hxx +++ b/vcl/inc/svdata.hxx @@ -53,10 +53,6 @@ #include <boost/unordered_map.hpp> -namespace com { namespace sun { namespace star { namespace lang { - class XMultiServiceFactory; -} } } } - struct ImplTimerData; struct ImplConfigData; class ImplDirectFontSubstitution; @@ -124,8 +120,6 @@ struct ImplSVAppData ImeStatusWindowMode_SHOW }; - ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > mxMSF; - String* mpMSFTempFileName; AllSettings* mpSettings; // Application settings LocaleConfigurationListener* mpCfgListener; VclEventListeners* mpEventListeners; // listeners for vcl events (eg, extended toolkit) diff --git a/vcl/inc/vcl/svapp.hxx b/vcl/inc/vcl/svapp.hxx index 2083250b9757..9f1c7aa19f6e 100644 --- a/vcl/inc/vcl/svapp.hxx +++ b/vcl/inc/vcl/svapp.hxx @@ -551,7 +551,7 @@ public: 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 bool InitAccessBridge( bool bAllowCancel, bool &rCancelled ); diff --git a/vcl/inc/vcl/unohelp.hxx b/vcl/inc/vcl/unohelp.hxx index 823ee477355a..f95e1d9d9b63 100644 --- a/vcl/inc/vcl/unohelp.hxx +++ b/vcl/inc/vcl/unohelp.hxx @@ -40,11 +40,7 @@ namespace i18n { class XBreakIterator; class XCharacterClassification; class XCollator; -} -namespace lang { - class XMultiServiceFactory; -} -}}} +}}}} namespace com { namespace sun { @@ -63,7 +59,6 @@ namespace vcl { 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::XCharacterClassification> CreateCharacterClassification(); //Get access to singleton Natural String Sorter collating for Application::GetLocale diff --git a/vcl/ios/source/dtrans/ios_clipboard.cxx b/vcl/ios/source/dtrans/ios_clipboard.cxx index b82e67fd4eb2..90c0990e8412 100644 --- a/vcl/ios/source/dtrans/ios_clipboard.cxx +++ b/vcl/ios/source/dtrans/ios_clipboard.cxx @@ -30,9 +30,8 @@ #include "iOSTransferable.hxx" -#include "vcl/unohelp.hxx" - #include "comphelper/makesequence.hxx" +#include "comphelper/processfactory.hxx" #include <boost/assert.hpp> @@ -94,7 +93,7 @@ IosClipboard::IosClipboard(UIPasteboard* pasteboard, bool bUseSystemPasteboard) WeakComponentImplHelper4<XClipboardEx, XClipboardNotifier, XFlushableClipboard, XServiceInfo>(m_aMutex), mIsSystemPasteboard(bUseSystemPasteboard) { - Reference<XMultiServiceFactory> mrServiceMgr = vcl::unohelper::GetMultiServiceFactory(); + Reference<XMultiServiceFactory> mrServiceMgr = comphelper::getProcessServiceFactory(); mrXMimeCntFactory = Reference<XMimeContentTypeFactory>(mrServiceMgr->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.MimeContentTypeFactory"))), UNO_QUERY); diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx index a18a9dabd425..487ad67ca16a 100644 --- a/vcl/source/app/settings.cxx +++ b/vcl/source/app/settings.cxx @@ -27,6 +27,7 @@ ************************************************************************/ #include <svsys.h> +#include "comphelper/processfactory.hxx" #include "tools/debug.hxx" #include "i18npool/mslangid.hxx" @@ -37,7 +38,6 @@ #include "vcl/i18nhelp.hxx" #include "vcl/configsettings.hxx" #include "vcl/gradient.hxx" -#include "vcl/unohelp.hxx" #include "vcl/bitmapex.hxx" #include "unotools/fontcfg.hxx" @@ -1512,7 +1512,7 @@ bool AllSettings::GetLayoutRTL() const { nUIMirroring = 0; // ask configuration only once utl::OConfigurationNode aNode = utl::OConfigurationTreeRoot::tryCreateWithServiceFactory( - vcl::unohelper::GetMultiServiceFactory(), + comphelper::getProcessServiceFactory(), OUString("org.openoffice.Office.Common/I18N/CTL") ); // note: case sensitive ! if ( aNode.isValid() ) { @@ -1585,7 +1585,7 @@ LanguageType AllSettings::GetUILanguage() const const LocaleDataWrapper& AllSettings::GetLocaleDataWrapper() const { 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; } @@ -1594,7 +1594,7 @@ const LocaleDataWrapper& AllSettings::GetLocaleDataWrapper() const const LocaleDataWrapper& AllSettings::GetUILocaleDataWrapper() const { 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; } @@ -1603,7 +1603,7 @@ const LocaleDataWrapper& AllSettings::GetUILocaleDataWrapper() const const vcl::I18nHelper& AllSettings::GetLocaleI18nHelper() const { 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() ); } return *mpData->mpI18nHelper; @@ -1614,7 +1614,7 @@ const vcl::I18nHelper& AllSettings::GetLocaleI18nHelper() const const vcl::I18nHelper& AllSettings::GetUILocaleI18nHelper() const { 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() ); } return *mpData->mpUII18nHelper; diff --git a/vcl/source/app/svdata.cxx b/vcl/source/app/svdata.cxx index a3851c7999e4..5874943d4edd 100644 --- a/vcl/source/app/svdata.cxx +++ b/vcl/source/app/svdata.cxx @@ -31,9 +31,9 @@ #include <boost/ptr_container/ptr_vector.hpp> +#include <comphelper/processfactory.hxx> #include <comphelper/string.hxx> -#include <osl/file.hxx> #include <osl/mutex.hxx> #include <rtl/process.h> #include "tools/debug.hxx" @@ -49,7 +49,6 @@ #include "vcl/svapp.hxx" #include "vcl/wrkwin.hxx" #include "vcl/msgbox.hxx" -#include "vcl/unohelp.hxx" #include "vcl/button.hxx" // for Button::GetStandardText #include "vcl/dockwin.hxx" // for DockingManager #include "salinst.hxx" @@ -61,7 +60,6 @@ #include "svids.hrc" #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/java/JavaNotConfiguredException.hpp" #include "com/sun/star/java/JavaVMCreationFailureException.hpp" @@ -141,22 +139,6 @@ void ImplDeInitSVData() if( 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 ) delete pSVData->maCtrlData.mpFieldUnitStrings, pSVData->maCtrlData.mpFieldUnitStrings = NULL; if( pSVData->maCtrlData.mpCleanUnitStrings ) @@ -353,7 +335,7 @@ bool ImplInitAccessBridge(bool bAllowCancel, bool &rCancelled) ImplSVData* pSVData = ImplGetSVData(); if( ! pSVData->mxAccessBridge.is() ) { - css::uno::Reference< XMultiServiceFactory > xFactory(vcl::unohelper::GetMultiServiceFactory()); + css::uno::Reference< XMultiServiceFactory > xFactory(comphelper::getProcessServiceFactory()); if( xFactory.is() ) { diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx index 285f7137ccd4..dc2d46360138 100644 --- a/vcl/source/app/svmain.cxx +++ b/vcl/source/app/svmain.cxx @@ -160,11 +160,9 @@ int ImplSVMain() DBG_ASSERT( pSVData->mpApp, "no instance of class Application" ); - uno::Reference<lang::XMultiServiceFactory> xMS; - int nReturn = EXIT_FAILURE; - sal_Bool bInit = InitVCL( xMS ); + sal_Bool bInit = InitVCL(); if( bInit ) { @@ -251,7 +249,7 @@ uno::Any SAL_CALL DesktopEnvironmentContext::getValueByName( const rtl::OUString 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" ); @@ -277,9 +275,6 @@ sal_Bool InitVCL( const ::com::sun::star::uno::Reference< ::com::sun::star::lang // SV bei den Tools anmelden InitTools(); - DBG_ASSERT( !pSVData->maAppData.mxMSF.is(), "VCL service factory already set" ); - pSVData->maAppData.mxMSF = rSMgr; - // Main-Thread-Id merken pSVData->mnMainThreadId = ::osl::Thread::getCurrentIdentifier(); @@ -335,7 +330,7 @@ InitVCLWrapper() comphelper::setProcessServiceFactory( xSM ); - InitVCL( xSM ); + InitVCL(); } #endif @@ -499,8 +494,6 @@ void DeInitVCL() } } - pSVData->maAppData.mxMSF.clear(); - if( pSVData->mpApp ) { sal_uLong nCount = Application::ReleaseSolarMutex(); diff --git a/vcl/source/app/unohelp.cxx b/vcl/source/app/unohelp.cxx index a7ba55577b07..b0a30b188e38 100644 --- a/vcl/source/app/unohelp.cxx +++ b/vcl/source/app/unohelp.cxx @@ -27,18 +27,11 @@ ************************************************************************/ -#include <tools/tempfile.hxx> - -#include <osl/file.hxx> - -#include <cppuhelper/servicefactory.hxx> - #include <vcl/svapp.hxx> #include <vcl/unohelp.hxx> #include <svdata.hxx> -#include <com/sun/star/lang/XSingleServiceFactory.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <comphelper/processfactory.hxx> @@ -47,8 +40,6 @@ #include <com/sun/star/awt/XExtendedToolkit.hpp> #include <com/sun/star/accessibility/AccessibleEventObject.hpp> #include <com/sun/star/accessibility/AccessibleStateType.hpp> -#include <com/sun/star/registry/ImplementationRegistration.hpp> - using namespace ::com::sun::star; using namespace ::rtl; @@ -56,102 +47,21 @@ using namespace ::rtl; #define DOSTRING( x ) #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< uno::XComponentContext > xContext = comphelper::getComponentContext(GetMultiServiceFactory()); + uno::Reference< uno::XComponentContext > xContext = comphelper::getProcessComponentContext(); return i18n::BreakIterator::create(xContext); } uno::Reference < i18n::XCharacterClassification > vcl::unohelper::CreateCharacterClassification() { uno::Reference < i18n::XCharacterClassification > xB; - uno::Reference< lang::XMultiServiceFactory > xMSF = GetMultiServiceFactory(); - if ( xMSF.is() ) + uno::Reference< lang::XMultiServiceFactory > xMSF = comphelper::getProcessServiceFactory(); + uno::Reference < uno::XInterface > xI = xMSF->createInstance( ::rtl::OUString("com.sun.star.i18n.CharacterClassification") ); + if ( xI.is() ) { - uno::Reference < uno::XInterface > xI = xMSF->createInstance( ::rtl::OUString("com.sun.star.i18n.CharacterClassification") ); - if ( xI.is() ) - { - uno::Any x = xI->queryInterface( ::getCppuType((const uno::Reference< i18n::XCharacterClassification >*)0) ); - x >>= xB; - } + uno::Any x = xI->queryInterface( ::getCppuType((const uno::Reference< i18n::XCharacterClassification >*)0) ); + x >>= xB; } return xB; } diff --git a/vcl/source/control/field.cxx b/vcl/source/control/field.cxx index 93c3a1c2c098..f74e84e4bdee 100644 --- a/vcl/source/control/field.cxx +++ b/vcl/source/control/field.cxx @@ -26,7 +26,9 @@ * ************************************************************************/ +#include "sal/config.h" +#include <comphelper/processfactory.hxx> #include <comphelper/string.hxx> #include "tools/debug.hxx" @@ -37,7 +39,6 @@ #include "vcl/field.hxx" #include "vcl/event.hxx" #include "vcl/svapp.hxx" -#include "vcl/unohelp.hxx" #include "svids.hrc" #include "svdata.hxx" @@ -317,7 +318,7 @@ LocaleDataWrapper& FormatterBase::ImplGetLocaleDataWrapper() const { if ( !mpLocaleDataWrapper ) { - ((FormatterBase*)this)->mpLocaleDataWrapper = new LocaleDataWrapper( vcl::unohelper::GetMultiServiceFactory(), GetLocale() ); + ((FormatterBase*)this)->mpLocaleDataWrapper = new LocaleDataWrapper( comphelper::getProcessServiceFactory(), GetLocale() ); } return *mpLocaleDataWrapper; } diff --git a/vcl/source/control/field2.cxx b/vcl/source/control/field2.cxx index be162a457548..9cc4c96308c6 100644 --- a/vcl/source/control/field2.cxx +++ b/vcl/source/control/field2.cxx @@ -1580,7 +1580,7 @@ CalendarWrapper& DateFormatter::GetCalendarWrapper() const { if ( !mpCalendarWrapper ) { - ((DateFormatter*)this)->mpCalendarWrapper = new CalendarWrapper( comphelper::getComponentContext( vcl::unohelper::GetMultiServiceFactory() ) ); + ((DateFormatter*)this)->mpCalendarWrapper = new CalendarWrapper( comphelper::getComponentContext( comphelper::getProcessServiceFactory() ) ); mpCalendarWrapper->loadDefaultCalendar( GetLocale() ); } diff --git a/vcl/source/edit/texteng.cxx b/vcl/source/edit/texteng.cxx index bd6d1791bd3a..4d4299f1ba60 100644 --- a/vcl/source/edit/texteng.cxx +++ b/vcl/source/edit/texteng.cxx @@ -2979,7 +2979,7 @@ void TextEngine::SetLocale( const ::com::sun::star::lang::Locale& rLocale ) LocaleDataWrapper* TextEngine::ImpGetLocaleDataWrapper() { if ( !mpLocaleDataWrapper ) - mpLocaleDataWrapper = new LocaleDataWrapper( vcl::unohelper::GetMultiServiceFactory(), GetLocale() ); + mpLocaleDataWrapper = new LocaleDataWrapper( comphelper::getProcessServiceFactory(), GetLocale() ); return mpLocaleDataWrapper; } diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx index 627cd7d1d778..eda6570a75a4 100644 --- a/vcl/source/gdi/gdimtf.cxx +++ b/vcl/source/gdi/gdimtf.cxx @@ -39,7 +39,6 @@ #include <vcl/gdimtf.hxx> #include <vcl/graphictools.hxx> #include <vcl/canvastools.hxx> -#include <vcl/unohelp.hxx> #include <salbmp.hxx> #include <salinst.hxx> @@ -55,6 +54,7 @@ #include <com/sun/star/awt/XGraphics.hpp> #include <com/sun/star/graphic/XGraphic.hpp> #include <com/sun/star/graphic/XGraphicRenderer.hpp> +#include <comphelper/processfactory.hxx> 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); uno::Reference<rendering::XBitmap> xBitmap = xCanvas->getDevice ()->createCompatibleAlphaBitmap (vcl::unotools::integerSize2DFromSize( aSize)); - uno::Reference< lang::XMultiServiceFactory > xFactory = vcl::unohelper::GetMultiServiceFactory(); - if( xFactory.is() && xBitmap.is () ) + uno::Reference< lang::XMultiServiceFactory > xFactory = comphelper::getProcessServiceFactory(); + if( xBitmap.is () ) { uno::Reference< rendering::XMtfRenderer > xMtfRenderer; uno::Sequence< uno::Any > args (1); @@ -553,8 +553,8 @@ void GDIMetaFile::ImplDelegate2PluggableRenderer( const MetaCommentAction* pAct, const ::rtl::OUString aGraphicServiceName=aBuffer.makeStringAndClear(); ++pData; - uno::Reference< lang::XMultiServiceFactory > xFactory = vcl::unohelper::GetMultiServiceFactory(); - if( pData<pEndData && xFactory.is() ) + uno::Reference< lang::XMultiServiceFactory > xFactory = comphelper::getProcessServiceFactory(); + if( pData<pEndData ) { try { diff --git a/vcl/source/gdi/outdev.cxx b/vcl/source/gdi/outdev.cxx index c8a03459c837..0c66aeab5dde 100644 --- a/vcl/source/gdi/outdev.cxx +++ b/vcl/source/gdi/outdev.cxx @@ -68,7 +68,7 @@ #include <com/sun/star/uno/Sequence.hxx> #include <com/sun/star/rendering/XCanvas.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> -#include <vcl/unohelp.hxx> +#include <comphelper/processfactory.hxx> #include <numeric> @@ -2677,29 +2677,21 @@ SystemGraphicsData OutputDevice::GetSystemGfxData() const aArg[ 3 ] = uno::makeAny( sal_False ); aArg[ 5 ] = GetSystemGfxDataAny(); - uno::Reference<lang::XMultiServiceFactory> xFactory = vcl::unohelper::GetMultiServiceFactory(); + uno::Reference<lang::XMultiServiceFactory> xFactory = comphelper::getProcessServiceFactory(); uno::Reference<rendering::XCanvas> xCanvas; // Create canvas instance with window handle // ========================================= - if ( xFactory.is() ) - { - static uno::Reference<lang::XMultiServiceFactory> xCanvasFactory( - xFactory->createInstance( - OUString( RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star." - "rendering.CanvasFactory") ) ), + static uno::Reference<lang::XMultiServiceFactory> xCanvasFactory( + xFactory->createInstance( "com.sun.star.rendering.CanvasFactory" ), + uno::UNO_QUERY ); + if(xCanvasFactory.is()) + { + xCanvas.set( + xCanvasFactory->createInstanceWithArguments( + "com.sun.star.rendering.Canvas", aArg ), uno::UNO_QUERY ); - if(xCanvasFactory.is()) - { - xCanvas.set( - xCanvasFactory->createInstanceWithArguments( - OUString( RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star.rendering.Canvas" )), - aArg ), - uno::UNO_QUERY ); - } } return xCanvas; diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx b/vcl/source/gdi/pdfwriter_impl2.cxx index f167c044522c..97480d6c4e34 100644 --- a/vcl/source/gdi/pdfwriter_impl2.cxx +++ b/vcl/source/gdi/pdfwriter_impl2.cxx @@ -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::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::XGraphic > xGraphic( aGraphic.GetXGraphic() ); uno::Reference < io::XOutputStream > xOut( xStream->getOutputStream() ); diff --git a/vcl/source/window/syschild.cxx b/vcl/source/window/syschild.cxx index 4022f2cefd7f..c941e2c1e084 100644 --- a/vcl/source/window/syschild.cxx +++ b/vcl/source/window/syschild.cxx @@ -39,7 +39,6 @@ #include <vcl/sysdata.hxx> #include <vcl/svapp.hxx> #include <vcl/syschild.hxx> -#include <vcl/unohelp.hxx> #include <window.h> #include <salinst.hxx> @@ -245,9 +244,9 @@ sal_IntPtr SystemChildWindow::GetParentWindowHandle( sal_Bool bUseJava ) #ifdef SOLAR_JAVA 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 { diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx index d7920cfe4ab7..73c1fbc4b495 100644 --- a/vcl/source/window/toolbox2.cxx +++ b/vcl/source/window/toolbox2.cxx @@ -26,7 +26,9 @@ * ************************************************************************/ +#include "sal/config.h" +#include <comphelper/processfactory.hxx> #include <comphelper/string.hxx> #include <tools/debug.hxx> #include <tools/rc.h> @@ -37,7 +39,6 @@ #include <vcl/toolbox.hxx> #include <vcl/mnemonic.hxx> #include <vcl/menu.hxx> -#include <vcl/unohelp.hxx> #include <vcl/ImageListProvider.hxx> #include <svdata.hxx> @@ -2139,7 +2140,7 @@ sal_Bool ToolBox::AlwaysLocked() nAlwaysLocked = 0; // ask configuration only once utl::OConfigurationNode aNode = utl::OConfigurationTreeRoot::tryCreateWithServiceFactory( - vcl::unohelper::GetMultiServiceFactory(), + comphelper::getProcessServiceFactory(), OUString("/org.openoffice.Office.UI.GlobalSettings/Toolbars") ); // note: case sensitive ! if ( aNode.isValid() ) { @@ -2152,7 +2153,7 @@ sal_Bool ToolBox::AlwaysLocked() { // now read the locking state utl::OConfigurationNode aNode2 = utl::OConfigurationTreeRoot::tryCreateWithServiceFactory( - vcl::unohelper::GetMultiServiceFactory(), + comphelper::getProcessServiceFactory(), OUString("/org.openoffice.Office.UI.GlobalSettings/Toolbars/States") ); // note: case sensitive ! sal_Bool bLocked = sal_Bool(); diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index b154eab540a7..2663644579c0 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -36,7 +36,6 @@ #include "unotools/confignode.hxx" #include "vcl/layout.hxx" -#include "vcl/unohelp.hxx" #include "vcl/salgtype.hxx" #include "vcl/event.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; utl::OConfigurationNode aNode = utl::OConfigurationTreeRoot::tryCreateWithServiceFactory( - vcl::unohelper::GetMultiServiceFactory(), + comphelper::getProcessServiceFactory(), OUString("org.openoffice.Office.Common/Accessibility") ); // note: case sensitive ! if ( aNode.isValid() ) { @@ -8355,55 +8354,52 @@ uno::Reference< XDragSource > Window::GetDragSource() { try { - uno::Reference< XMultiServiceFactory > xFactory = vcl::unohelper::GetMultiServiceFactory(); - if ( xFactory.is() ) - { - const SystemEnvData * pEnvData = GetSystemData(); + uno::Reference< XMultiServiceFactory > xFactory = comphelper::getProcessServiceFactory(); + const SystemEnvData * pEnvData = GetSystemData(); - if( pEnvData ) - { - Sequence< Any > aDragSourceAL( 2 ), aDropTargetAL( 2 ); - OUString aDragSourceSN, aDropTargetSN; + if( pEnvData ) + { + Sequence< Any > aDragSourceAL( 2 ), aDropTargetAL( 2 ); + OUString aDragSourceSN, aDropTargetSN; #if defined WNT - aDragSourceSN = OUString("com.sun.star.datatransfer.dnd.OleDragSource"); - aDropTargetSN = OUString("com.sun.star.datatransfer.dnd.OleDropTarget"); - aDragSourceAL[ 1 ] = makeAny( (sal_uInt32) pEnvData->hWnd ); - aDropTargetAL[ 0 ] = makeAny( (sal_uInt32) pEnvData->hWnd ); + aDragSourceSN = OUString("com.sun.star.datatransfer.dnd.OleDragSource"); + aDropTargetSN = OUString("com.sun.star.datatransfer.dnd.OleDropTarget"); + aDragSourceAL[ 1 ] = makeAny( (sal_uInt32) pEnvData->hWnd ); + aDropTargetAL[ 0 ] = makeAny( (sal_uInt32) pEnvData->hWnd ); #elif defined QUARTZ /* FIXME: Mac OS X specific dnd interface does not exist! * * Using Windows based dnd as a temporary solution */ - aDragSourceSN = OUString("com.sun.star.datatransfer.dnd.OleDragSource"); - aDropTargetSN = OUString("com.sun.star.datatransfer.dnd.OleDropTarget"); - aDragSourceAL[ 1 ] = makeAny( static_cast<sal_uInt64>( reinterpret_cast<sal_IntPtr>(pEnvData->pView) ) ); - aDropTargetAL[ 0 ] = makeAny( static_cast<sal_uInt64>( reinterpret_cast<sal_IntPtr>(pEnvData->pView) ) ); + aDragSourceSN = OUString("com.sun.star.datatransfer.dnd.OleDragSource"); + aDropTargetSN = OUString("com.sun.star.datatransfer.dnd.OleDropTarget"); + aDragSourceAL[ 1 ] = makeAny( static_cast<sal_uInt64>( reinterpret_cast<sal_IntPtr>(pEnvData->pView) ) ); + aDropTargetAL[ 0 ] = makeAny( static_cast<sal_uInt64>( reinterpret_cast<sal_IntPtr>(pEnvData->pView) ) ); #elif defined IOS /* What does LibreOffice's use of DND concepts mean on * iOS, huh, is this both inter-app DND (which clearly is * meaningless), or intra-app? Anyway, use the same code * as for MacOSX for now, even if meaningless... */ - aDragSourceSN = OUString("com.sun.star.datatransfer.dnd.OleDragSource"); - aDropTargetSN = OUString("com.sun.star.datatransfer.dnd.OleDropTarget"); - aDragSourceAL[ 1 ] = makeAny( static_cast<sal_uInt64>( reinterpret_cast<sal_IntPtr>(pEnvData->pView) ) ); - aDropTargetAL[ 0 ] = makeAny( static_cast<sal_uInt64>( reinterpret_cast<sal_IntPtr>(pEnvData->pView) ) ); + aDragSourceSN = OUString("com.sun.star.datatransfer.dnd.OleDragSource"); + aDropTargetSN = OUString("com.sun.star.datatransfer.dnd.OleDropTarget"); + aDragSourceAL[ 1 ] = makeAny( static_cast<sal_uInt64>( reinterpret_cast<sal_IntPtr>(pEnvData->pView) ) ); + aDropTargetAL[ 0 ] = makeAny( static_cast<sal_uInt64>( reinterpret_cast<sal_IntPtr>(pEnvData->pView) ) ); #elif defined UNX - aDropTargetAL.realloc( 3 ); - aDragSourceAL.realloc( 3 ); - aDragSourceSN = OUString("com.sun.star.datatransfer.dnd.X11DragSource"); - aDropTargetSN = OUString("com.sun.star.datatransfer.dnd.X11DropTarget"); - - aDragSourceAL[ 0 ] = makeAny( Application::GetDisplayConnection() ); - aDragSourceAL[ 2 ] = makeAny( vcl::createBmpConverter() ); - aDropTargetAL[ 0 ] = makeAny( Application::GetDisplayConnection() ); - aDropTargetAL[ 1 ] = makeAny( (sal_Size)(pEnvData->aShellWindow) ); - aDropTargetAL[ 2 ] = makeAny( vcl::createBmpConverter() ); + aDropTargetAL.realloc( 3 ); + aDragSourceAL.realloc( 3 ); + aDragSourceSN = OUString("com.sun.star.datatransfer.dnd.X11DragSource"); + aDropTargetSN = OUString("com.sun.star.datatransfer.dnd.X11DropTarget"); + + aDragSourceAL[ 0 ] = makeAny( Application::GetDisplayConnection() ); + aDragSourceAL[ 2 ] = makeAny( vcl::createBmpConverter() ); + aDropTargetAL[ 0 ] = makeAny( Application::GetDisplayConnection() ); + aDropTargetAL[ 1 ] = makeAny( (sal_Size)(pEnvData->aShellWindow) ); + aDropTargetAL[ 2 ] = makeAny( vcl::createBmpConverter() ); #endif - if( !aDragSourceSN.isEmpty() ) - mpWindowImpl->mpFrameData->mxDragSource = uno::Reference< XDragSource > ( xFactory->createInstanceWithArguments( aDragSourceSN, aDragSourceAL ), UNO_QUERY ); + if( !aDragSourceSN.isEmpty() ) + mpWindowImpl->mpFrameData->mxDragSource = uno::Reference< XDragSource > ( xFactory->createInstanceWithArguments( aDragSourceSN, aDragSourceAL ), UNO_QUERY ); - if( !aDropTargetSN.isEmpty() ) - mpWindowImpl->mpFrameData->mxDropTarget = uno::Reference< XDropTarget > ( xFactory->createInstanceWithArguments( aDropTargetSN, aDropTargetAL ), UNO_QUERY ); - } + if( !aDropTargetSN.isEmpty() ) + mpWindowImpl->mpFrameData->mxDropTarget = uno::Reference< XDropTarget > ( xFactory->createInstanceWithArguments( aDropTargetSN, aDropTargetAL ), UNO_QUERY ); } } @@ -8441,32 +8437,29 @@ uno::Reference< XClipboard > Window::GetClipboard() { 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() ) - mpWindowImpl->mpFrameData->mxClipboard = uno::Reference< XClipboard >( xFactory->createInstance( OUString("com.sun.star.datatransfer.clipboard.SystemClipboard") ), UNO_QUERY ); + if( !mpWindowImpl->mpFrameData->mxClipboard.is() ) + mpWindowImpl->mpFrameData->mxClipboard = uno::Reference< XClipboard >( xFactory->createInstance( OUString("com.sun.star.datatransfer.clipboard.SystemClipboard") ), UNO_QUERY ); #if defined(UNX) && !defined(QUARTZ) // unix clipboard needs to be initialized - if( mpWindowImpl->mpFrameData->mxClipboard.is() ) - { - uno::Reference< XInitialization > xInit = uno::Reference< XInitialization >( mpWindowImpl->mpFrameData->mxClipboard, UNO_QUERY ); + if( mpWindowImpl->mpFrameData->mxClipboard.is() ) + { + uno::Reference< XInitialization > xInit = uno::Reference< XInitialization >( mpWindowImpl->mpFrameData->mxClipboard, UNO_QUERY ); - if( xInit.is() ) - { - Sequence< Any > aArgumentList( 3 ); - aArgumentList[ 0 ] = makeAny( Application::GetDisplayConnection() ); - aArgumentList[ 1 ] = makeAny( OUString("CLIPBOARD") ); - aArgumentList[ 2 ] = makeAny( vcl::createBmpConverter() ); + if( xInit.is() ) + { + Sequence< Any > aArgumentList( 3 ); + aArgumentList[ 0 ] = makeAny( Application::GetDisplayConnection() ); + aArgumentList[ 1 ] = makeAny( OUString("CLIPBOARD") ); + aArgumentList[ 2 ] = makeAny( vcl::createBmpConverter() ); - xInit->initialize( aArgumentList ); - } + xInit->initialize( aArgumentList ); } -#endif } +#endif } // createInstance can throw any exception @@ -8495,30 +8488,27 @@ uno::Reference< XClipboard > Window::GetPrimarySelection() { try { - uno::Reference< XMultiServiceFactory > xFactory( vcl::unohelper::GetMultiServiceFactory() ); + uno::Reference< XMultiServiceFactory > xFactory( comphelper::getProcessServiceFactory() ); - if( xFactory.is() ) - { #if defined(UNX) && !defined(QUARTZ) - Sequence< Any > aArgumentList( 3 ); - aArgumentList[ 0 ] = makeAny( Application::GetDisplayConnection() ); - aArgumentList[ 1 ] = makeAny( OUString("PRIMARY") ); - aArgumentList[ 2 ] = makeAny( vcl::createBmpConverter() ); + Sequence< Any > aArgumentList( 3 ); + aArgumentList[ 0 ] = makeAny( Application::GetDisplayConnection() ); + aArgumentList[ 1 ] = makeAny( OUString("PRIMARY") ); + aArgumentList[ 2 ] = makeAny( vcl::createBmpConverter() ); - mpWindowImpl->mpFrameData->mxSelection = uno::Reference< XClipboard >( xFactory->createInstanceWithArguments( - OUString("com.sun.star.datatransfer.clipboard.SystemClipboard"), aArgumentList ), UNO_QUERY ); + mpWindowImpl->mpFrameData->mxSelection = uno::Reference< XClipboard >( xFactory->createInstanceWithArguments( + OUString("com.sun.star.datatransfer.clipboard.SystemClipboard"), aArgumentList ), UNO_QUERY ); # else - static uno::Reference< XClipboard > s_xSelection; + static uno::Reference< XClipboard > s_xSelection; - if ( !s_xSelection.is() ) - s_xSelection = uno::Reference< XClipboard >( xFactory->createInstance( OUString("com.sun.star.datatransfer.clipboard.GenericClipboardExt") ), UNO_QUERY ); + if ( !s_xSelection.is() ) + s_xSelection = uno::Reference< XClipboard >( xFactory->createInstance( OUString("com.sun.star.datatransfer.clipboard.GenericClipboardExt") ), UNO_QUERY ); - if ( !s_xSelection.is() ) - s_xSelection = uno::Reference< XClipboard >( xFactory->createInstance( OUString("com.sun.star.datatransfer.clipboard.GenericClipboard") ), UNO_QUERY ); + if ( !s_xSelection.is() ) + s_xSelection = uno::Reference< XClipboard >( xFactory->createInstance( OUString("com.sun.star.datatransfer.clipboard.GenericClipboard") ), UNO_QUERY ); - mpWindowImpl->mpFrameData->mxSelection = s_xSelection; + mpWindowImpl->mpFrameData->mxSelection = s_xSelection; # endif - } } // createInstance can throw any exception @@ -9451,54 +9441,50 @@ uno::Reference< rendering::XCanvas > Window::ImplGetCanvas( const Size& rFullscr const_cast<Window*>(this)->GetComponentInterface(), uno::UNO_QUERY )); - uno::Reference< XMultiServiceFactory > xFactory = vcl::unohelper::GetMultiServiceFactory(); + uno::Reference< XMultiServiceFactory > xFactory = comphelper::getProcessServiceFactory(); // Create canvas instance with window handle // ========================================= - if ( xFactory.is() ) - { - static ::vcl::DeleteUnoReferenceOnDeinit<lang::XMultiServiceFactory> xStaticCanvasFactory( - uno::Reference<lang::XMultiServiceFactory>( - xFactory->createInstance( - OUString( "com.sun.star.rendering.CanvasFactory" ) ), - UNO_QUERY )); - uno::Reference<lang::XMultiServiceFactory> xCanvasFactory(xStaticCanvasFactory.get()); + static ::vcl::DeleteUnoReferenceOnDeinit<lang::XMultiServiceFactory> xStaticCanvasFactory( + uno::Reference<lang::XMultiServiceFactory>( + xFactory->createInstance( + OUString( "com.sun.star.rendering.CanvasFactory" ) ), + UNO_QUERY )); + uno::Reference<lang::XMultiServiceFactory> xCanvasFactory(xStaticCanvasFactory.get()); - if(xCanvasFactory.is()) - { + if(xCanvasFactory.is()) + { #ifdef WNT - // see #140456# - if we're running on a multiscreen setup, - // request special, multi-screen safe sprite canvas - // implementation (not DX5 canvas, as it cannot cope with - // surfaces spanning multiple displays). Note: canvas - // (without sprite) stays the same) - const sal_uInt32 nDisplay = static_cast< WinSalFrame* >( mpWindowImpl->mpFrame )->mnDisplay; - if( (nDisplay >= Application::GetScreenCount()) ) - { - xCanvas.set( xCanvasFactory->createInstanceWithArguments( - bSpriteCanvas ? - OUString( "com.sun.star.rendering.SpriteCanvas.MultiScreen" ) : - OUString( "com.sun.star.rendering.Canvas" ), - aArg ), - UNO_QUERY ); - - } - else - { + // see #140456# - if we're running on a multiscreen setup, + // request special, multi-screen safe sprite canvas + // implementation (not DX5 canvas, as it cannot cope with + // surfaces spanning multiple displays). Note: canvas + // (without sprite) stays the same) + const sal_uInt32 nDisplay = static_cast< WinSalFrame* >( mpWindowImpl->mpFrame )->mnDisplay; + if( (nDisplay >= Application::GetScreenCount()) ) + { + xCanvas.set( xCanvasFactory->createInstanceWithArguments( + bSpriteCanvas ? + OUString( "com.sun.star.rendering.SpriteCanvas.MultiScreen" ) : + OUString( "com.sun.star.rendering.Canvas" ), + aArg ), + UNO_QUERY ); + } + else + { #endif - xCanvas.set( xCanvasFactory->createInstanceWithArguments( - bSpriteCanvas ? - OUString( "com.sun.star.rendering.SpriteCanvas" ) : - OUString( "com.sun.star.rendering.Canvas" ), - aArg ), - UNO_QUERY ); + xCanvas.set( xCanvasFactory->createInstanceWithArguments( + bSpriteCanvas ? + OUString( "com.sun.star.rendering.SpriteCanvas" ) : + OUString( "com.sun.star.rendering.Canvas" ), + aArg ), + UNO_QUERY ); #ifdef WNT - } + } #endif - mpWindowImpl->mxCanvas = xCanvas; - } + mpWindowImpl->mxCanvas = xCanvas; } // no factory??? Empty reference, then. diff --git a/vcl/test/canvasbitmaptest.cxx b/vcl/test/canvasbitmaptest.cxx index 98a7d2471221..b49659032ab4 100644 --- a/vcl/test/canvasbitmaptest.cxx +++ b/vcl/test/canvasbitmaptest.cxx @@ -78,7 +78,9 @@ SAL_IMPLEMENT_MAIN() rtl::OUString( "applicat.rdb" ), sal_True ); - InitVCL( xMS ); + comphelper::setProcessServiceFactory( xMS ); + + InitVCL(); ::Main(); DeInitVCL(); diff --git a/vcl/workben/svdem.cxx b/vcl/workben/svdem.cxx index cbdea98c5f98..42ecc9cdd042 100644 --- a/vcl/workben/svdem.cxx +++ b/vcl/workben/svdem.cxx @@ -47,7 +47,9 @@ SAL_IMPLEMENT_MAIN() Reference< XMultiServiceFactory > xMS; 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(); DeInitVCL(); diff --git a/vcl/workben/svpclient.cxx b/vcl/workben/svpclient.cxx index 2f8c8561a948..a07bec606728 100644 --- a/vcl/workben/svpclient.cxx +++ b/vcl/workben/svpclient.cxx @@ -100,7 +100,7 @@ SAL_IMPLEMENT_MAIN() exit( 1 ); } - InitVCL( xFactory ); + InitVCL(); ::Main(); DeInitVCL(); diff --git a/vcl/workben/svptest.cxx b/vcl/workben/svptest.cxx index 6e08dc1e2831..996d6fc1093a 100644 --- a/vcl/workben/svptest.cxx +++ b/vcl/workben/svptest.cxx @@ -66,7 +66,9 @@ SAL_IMPLEMENT_MAIN() Reference< XMultiServiceFactory > xMS; 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(); DeInitVCL(); diff --git a/vcl/workben/vcldemo.cxx b/vcl/workben/vcldemo.cxx index b5fbb89089b0..448b5c30b721 100644 --- a/vcl/workben/vcldemo.cxx +++ b/vcl/workben/vcldemo.cxx @@ -59,7 +59,9 @@ SAL_IMPLEMENT_MAIN() Reference< XMultiServiceFactory > xMS; 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(); DeInitVCL(); |