offapi/UnoApi_offapi.mk | 4 + offapi/com/sun/star/accessibility/AccessBridge.idl | 11 +-- vcl/inc/svdata.hxx | 3 - vcl/source/app/svdata.cxx | 61 ++++++++------------- vcl/source/app/svmain.cxx | 5 - 5 files changed, 36 insertions(+), 48 deletions(-)
New commits: commit c78f40a6d837a5d84bd8c2ef9e4916fa64ec58c3 Author: Stephan Bergmann <[email protected]> Date: Fri Mar 8 15:37:56 2013 +0100 Make use of new-style AccessBridge ctor Change-Id: I9239fb1c8b139ee2bdb27cdf55222d54e488f6d5 diff --git a/vcl/inc/svdata.hxx b/vcl/inc/svdata.hxx index 7f89f9f..fe6b7e1 100644 --- a/vcl/inc/svdata.hxx +++ b/vcl/inc/svdata.hxx @@ -41,6 +41,7 @@ #include "xconnection.hxx" +#include "com/sun/star/lang/XComponent.hpp" #include "com/sun/star/uno/Reference.hxx" #include <boost/unordered_map.hpp> @@ -339,7 +340,7 @@ struct ImplSVData oslThreadIdentifier mnMainThreadId; rtl::Reference< vcl::DisplayConnection > mxDisplayConnection; - ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > mxAccessBridge; + ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > mxAccessBridge; ::vcl::SettingsConfigItem* mpSettingsConfigItem; std::list< vcl::DeleteOnDeinitBase* >* mpDeinitDeleteList; boost::unordered_map< int, rtl::OUString >* mpPaperNames; diff --git a/vcl/source/app/svdata.cxx b/vcl/source/app/svdata.cxx index 8aa8d70..9540529 100644 --- a/vcl/source/app/svdata.cxx +++ b/vcl/source/app/svdata.cxx @@ -45,7 +45,7 @@ #include "salsys.hxx" #include "svids.hrc" -#include "com/sun/star/lang/XMultiServiceFactory.hpp" +#include "com/sun/star/accessibility/AccessBridge.hpp" #include "com/sun/star/awt/XExtendedToolkit.hpp" #include "com/sun/star/java/JavaNotConfiguredException.hpp" #include "com/sun/star/java/JavaVMCreationFailureException.hpp" @@ -303,8 +303,6 @@ bool ImplInitAccessBridge(bool bAllowCancel, bool &rCancelled) try { - bool bSuccess = true; - // No error messages when env var is set .. static const char* pEnv = getenv("SAL_ACCESSIBILITY_ENABLED" ); if( pEnv && *pEnv ) @@ -315,45 +313,34 @@ bool ImplInitAccessBridge(bool bAllowCancel, bool &rCancelled) ImplSVData* pSVData = ImplGetSVData(); if( ! pSVData->mxAccessBridge.is() ) { - css::uno::Reference< XMultiServiceFactory > xFactory(comphelper::getProcessServiceFactory()); - - if( xFactory.is() ) - { - css::uno::Reference< XExtendedToolkit > xToolkit = - css::uno::Reference< XExtendedToolkit >(Application::GetVCLToolkit(), UNO_QUERY); + css::uno::Reference< XComponentContext > xContext(comphelper::getProcessComponentContext()); - Sequence< Any > arguments(1); - arguments[0] = makeAny(xToolkit); + css::uno::Reference< XExtendedToolkit > xToolkit = + css::uno::Reference< XExtendedToolkit >(Application::GetVCLToolkit(), UNO_QUERY); - // Disable default java error messages on startup, because they were probably unreadable - // for a disabled user. Use native message boxes which are accessible without java support. - // No need to do this when activated by Tools-Options dialog .. - if( bAllowCancel ) - { - // customize the java-not-available-interaction-handler entry within the - // current context when called at startup. - com::sun::star::uno::ContextLayer layer( - new AccessBridgeCurrentContext( com::sun::star::uno::getCurrentContext() ) ); - - pSVData->mxAccessBridge = xFactory->createInstanceWithArguments( - OUString("com.sun.star.accessibility.AccessBridge"), - arguments - ); - } - else - { - pSVData->mxAccessBridge = xFactory->createInstanceWithArguments( - OUString("com.sun.star.accessibility.AccessBridge"), - arguments - ); - } - - if( !pSVData->mxAccessBridge.is() ) - bSuccess = false; + // Disable default java error messages on startup, because they were probably unreadable + // for a disabled user. Use native message boxes which are accessible without java support. + // No need to do this when activated by Tools-Options dialog .. + if( bAllowCancel ) + { + // customize the java-not-available-interaction-handler entry within the + // current context when called at startup. + com::sun::star::uno::ContextLayer layer( + new AccessBridgeCurrentContext( com::sun::star::uno::getCurrentContext() ) ); + + pSVData->mxAccessBridge + = css::accessibility::AccessBridge::createWithToolkit( + xContext, xToolkit); + } + else + { + pSVData->mxAccessBridge + = css::accessibility::AccessBridge::createWithToolkit( + xContext, xToolkit); } } - return bSuccess; + return true; } catch (const ::com::sun::star::java::JavaNotConfiguredException&) { diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx index 2f01094..303c099 100644 --- a/vcl/source/app/svmain.cxx +++ b/vcl/source/app/svmain.cxx @@ -175,11 +175,10 @@ int ImplSVMain() // be some events in the AWT EventQueue, which need the SolarMutex which // - on the other hand - is destroyed in DeInitVCL(). So empty the queue // here .. - uno::Reference< lang::XComponent > xComponent(pSVData->mxAccessBridge, uno::UNO_QUERY); - if( xComponent.is() ) + if( pSVData->mxAccessBridge.is() ) { sal_uLong nCount = Application::ReleaseSolarMutex(); - xComponent->dispose(); + pSVData->mxAccessBridge->dispose(); Application::AcquireSolarMutex(nCount); pSVData->mxAccessBridge.clear(); } commit f6c8220f5c14be8ebacd146d2775b4594efea043 Author: GergÅ Mocsi <[email protected]> Date: Thu Feb 14 12:16:58 2013 +0100 fdo#46808, Adapt UNO services to the new style, Part 1-2 Written constructor for opffapi/com/sun/star/accessibility/AccessBridge.idl and rewritten to new style in offapi/com/sun/star/awt/tab/UnoControlTabPageModel.idl Signed-off-by Stephan Bergmann <[email protected]>: * Moved offapi/com/sun/star/accessibility/AccessBridge.idl from _noheader to _nohdl, as necessary for a new-style service. * Left out changes to offapi/com/sun/star/awt/tab/UnoControlTabPageModel.idl, as that appears to never be instantiated at the global component context/service manager, but rather via some local ControlModelContainerBase::createInstance in toolkit/source/controls/controlmodelcontainerbase.cxx, so does not look like it qualifies for a new-style service. Conflicts: offapi/com/sun/star/accessibility/AccessBridge.idl Change-Id: I88dc745cddf9956c930c1216c697dd142e33c846 diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk index 1c631a3..e5513f63 100644 --- a/offapi/UnoApi_offapi.mk +++ b/offapi/UnoApi_offapi.mk @@ -30,6 +30,9 @@ $(eval $(call gb_UnoApi_set_include,offapi,\ )) +$(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/accessibility,\ + AccessBridge \ +)) $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/animations,\ SequenceTimeContainer \ TargetPropertiesCreator \ @@ -404,7 +407,6 @@ $(eval $(call gb_UnoApi_add_idlfiles_noheader,offapi,offapi/com/sun/star,\ modules \ )) $(eval $(call gb_UnoApi_add_idlfiles_noheader,offapi,offapi/com/sun/star/accessibility,\ - AccessBridge \ Accessible \ AccessibleContext \ )) diff --git a/offapi/com/sun/star/accessibility/AccessBridge.idl b/offapi/com/sun/star/accessibility/AccessBridge.idl index 44703ed..f9205c0 100644 --- a/offapi/com/sun/star/accessibility/AccessBridge.idl +++ b/offapi/com/sun/star/accessibility/AccessBridge.idl @@ -19,9 +19,9 @@ #ifndef __com_sun_star_accessibility_AccessBridge_idl__ #define __com_sun_star_accessibility_AccessBridge_idl__ -module com { module sun { module star { module lang { - published interface XInitialization; -}; }; }; }; +#include <com/sun/star/lang/XComponent.idl> +#include <com/sun/star/awt/XExtendedToolkit.idl> + module com { module sun { module star { module accessibility { @@ -35,10 +35,9 @@ module com { module sun { module star { module accessibility { @since OOo 1.1.2 */ -service AccessBridge +service AccessBridge : com::sun::star::lang::XComponent { - /** Expects and instance of XExtendedToolkit as first parameter */ - interface ::com::sun::star::lang::XInitialization; + createWithToolkit([in] com::sun::star::awt::XExtendedToolkit toolkit); }; }; }; }; };
_______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
