diff options
author | Daniel Rentz <dr@openoffice.org> | 2010-06-15 20:19:01 +0200 |
---|---|---|
committer | Daniel Rentz <dr@openoffice.org> | 2010-06-15 20:19:01 +0200 |
commit | 02799da3b58265a3051b2b4f7626daf0feee2b78 (patch) | |
tree | ecaf2efc6b64d1851641c7ee9aba4981a3d9d10e /vbahelper | |
parent | 5ed103d2dd5f8ee2f13183263c0930f84437bdc7 (diff) |
mib16: contributed bugfixes and various new symbols in VBA compatibility implementation
Diffstat (limited to 'vbahelper')
-rwxr-xr-x | vbahelper/source/msforms/vbasystemaxcontrol.cxx | 101 | ||||
-rwxr-xr-x | vbahelper/source/msforms/vbasystemaxcontrol.hxx | 58 |
2 files changed, 159 insertions, 0 deletions
diff --git a/vbahelper/source/msforms/vbasystemaxcontrol.cxx b/vbahelper/source/msforms/vbasystemaxcontrol.cxx new file mode 100755 index 000000000000..ed2fc70164ac --- /dev/null +++ b/vbahelper/source/msforms/vbasystemaxcontrol.cxx @@ -0,0 +1,101 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * ( a copy is included in the LICENSE file that accompanied this code ). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#include "vbasystemaxcontrol.hxx" + +using namespace com::sun::star; +using namespace ooo::vba; + +//---------------------------------------------------------- +VbaSystemAXControl::VbaSystemAXControl( const uno::Reference< ov::XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl, const uno::Reference< frame::XModel >& xModel, AbstractGeometryAttributes* pGeomHelper ) +: SystemAXControlImpl_BASE( xParent, xContext, xControl, xModel, pGeomHelper ) +, m_xControlInvocation( xControl, uno::UNO_QUERY_THROW ) +{ +} + +//---------------------------------------------------------- +uno::Reference< beans::XIntrospectionAccess > SAL_CALL VbaSystemAXControl::getIntrospection() + throw ( uno::RuntimeException ) +{ + return m_xControlInvocation->getIntrospection(); +} + +//---------------------------------------------------------- +uno::Any SAL_CALL VbaSystemAXControl::invoke( const ::rtl::OUString& aFunctionName, const uno::Sequence< uno::Any >& aParams, uno::Sequence< ::sal_Int16 >& aOutParamIndex, uno::Sequence< uno::Any >& aOutParam ) + throw ( lang::IllegalArgumentException, script::CannotConvertException, reflection::InvocationTargetException, uno::RuntimeException ) +{ + return m_xControlInvocation->invoke( aFunctionName, aParams, aOutParamIndex, aOutParam ); +} + +//---------------------------------------------------------- +void SAL_CALL VbaSystemAXControl::setValue( const ::rtl::OUString& aPropertyName, const uno::Any& aValue ) + throw ( beans::UnknownPropertyException, script::CannotConvertException, reflection::InvocationTargetException, uno::RuntimeException ) +{ + m_xControlInvocation->setValue( aPropertyName, aValue ); +} + +//---------------------------------------------------------- +uno::Any SAL_CALL VbaSystemAXControl::getValue( const ::rtl::OUString& aPropertyName ) + throw ( beans::UnknownPropertyException, uno::RuntimeException ) +{ + return m_xControlInvocation->getValue( aPropertyName ); +} + +//---------------------------------------------------------- +::sal_Bool SAL_CALL VbaSystemAXControl::hasMethod( const ::rtl::OUString& aName ) + throw ( uno::RuntimeException ) +{ + return m_xControlInvocation->hasMethod( aName ); +} + +//---------------------------------------------------------- +::sal_Bool SAL_CALL VbaSystemAXControl::hasProperty( const ::rtl::OUString& aName ) + throw ( uno::RuntimeException ) +{ + return m_xControlInvocation->hasProperty( aName ); +} + +//---------------------------------------------------------- +rtl::OUString& +VbaSystemAXControl::getServiceImplName() +{ + static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM( "VbaSystemAXControl" ) ); + return sImplName; +} + +//---------------------------------------------------------- +uno::Sequence< rtl::OUString > +VbaSystemAXControl::getServiceNames() +{ + static uno::Sequence< rtl::OUString > aServiceNames; + if ( aServiceNames.getLength() == 0 ) + { + aServiceNames.realloc( 1 ); + aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.msforms.Frame" ) ); + } + return aServiceNames; +} + diff --git a/vbahelper/source/msforms/vbasystemaxcontrol.hxx b/vbahelper/source/msforms/vbasystemaxcontrol.hxx new file mode 100755 index 000000000000..bffe5b99c4f1 --- /dev/null +++ b/vbahelper/source/msforms/vbasystemaxcontrol.hxx @@ -0,0 +1,58 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * ( a copy is included in the LICENSE file that accompanied this code ). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ +#ifndef VBA_SYSTEMAXCONTROL_HXX +#define VBA_SYSTEMAXCONTROL_HXX + +#include <cppuhelper/implbase1.hxx> +#include <com/sun/star/script/XInvocation.hpp> + +#include "vbacontrol.hxx" +#include <vbahelper/vbahelper.hxx> + +typedef cppu::ImplInheritanceHelper1< ScVbaControl, css::script::XInvocation > SystemAXControlImpl_BASE; + +class VbaSystemAXControl : public SystemAXControlImpl_BASE +{ + css::uno::Reference< css::script::XInvocation > m_xControlInvocation; + +public: + VbaSystemAXControl( const css::uno::Reference< ov::XHelperInterface >& xParent, const css::uno::Reference< css::uno::XComponentContext >& xContext, const css::uno::Reference< css::uno::XInterface >& xControl, const css::uno::Reference< css::frame::XModel >& xModel, ov::AbstractGeometryAttributes* pGeomHelper ); + + // XInvocation + virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XIntrospectionAccess > SAL_CALL getIntrospection( ) throw ( ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Any SAL_CALL invoke( const ::rtl::OUString& aFunctionName, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aParams, ::com::sun::star::uno::Sequence< ::sal_Int16 >& aOutParamIndex, ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aOutParam ) throw ( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::script::CannotConvertException, ::com::sun::star::reflection::InvocationTargetException, ::com::sun::star::uno::RuntimeException ); + virtual void SAL_CALL setValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw ( ::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::script::CannotConvertException, ::com::sun::star::reflection::InvocationTargetException, ::com::sun::star::uno::RuntimeException ); + virtual ::com::sun::star::uno::Any SAL_CALL getValue( const ::rtl::OUString& aPropertyName ) throw ( ::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException ); + virtual ::sal_Bool SAL_CALL hasMethod( const ::rtl::OUString& aName ) throw ( ::com::sun::star::uno::RuntimeException ); + virtual ::sal_Bool SAL_CALL hasProperty( const ::rtl::OUString& aName ) throw ( ::com::sun::star::uno::RuntimeException ); + + //XHelperInterface + virtual rtl::OUString& getServiceImplName(); + virtual css::uno::Sequence<rtl::OUString> getServiceNames(); +}; + +#endif |