diff options
author | Noel Power <noel.power@novell.com> | 2010-10-13 09:48:44 +0100 |
---|---|---|
committer | Noel Power <noel.power@novell.com> | 2010-10-13 10:01:42 +0100 |
commit | be3ca836cb9a7f189759571d15ec8762cfb130fd (patch) | |
tree | edd9751cdedea19453796cba3e5fbe38bc82b6ea /sc/source/ui/vba/vbamenu.cxx | |
parent | 4b33c0d44fe85064d73ebe39eba4ea2d8ed018b9 (diff) | |
parent | 6196c60c78c0a66e79d283450830e3df92f10bde (diff) |
Merge branch 'vba' fix conflics, trailing ws & tab issues
additionally the following iz patches are rolled up with this commit i#113356, i#112998 i#113955 i#113358 i#113515 i#112531 i#112596 i#112530
Diffstat (limited to 'sc/source/ui/vba/vbamenu.cxx')
-rw-r--r-- | sc/source/ui/vba/vbamenu.cxx | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/sc/source/ui/vba/vbamenu.cxx b/sc/source/ui/vba/vbamenu.cxx new file mode 100644 index 000000000000..fa3dc1779ef3 --- /dev/null +++ b/sc/source/ui/vba/vbamenu.cxx @@ -0,0 +1,57 @@ +#include "vbamenu.hxx" +#include "vbamenuitems.hxx" + +using namespace com::sun::star; +using namespace ooo::vba; + +ScVbaMenu::ScVbaMenu( const uno::Reference< ov::XHelperInterface > xParent, const uno::Reference< uno::XComponentContext > xContext, const uno::Reference< XCommandBarControl >& xCommandBarControl ) throw( uno::RuntimeException ) : Menu_BASE( xParent, xContext ), m_xCommandBarControl( xCommandBarControl ) +{ +} + +::rtl::OUString SAL_CALL +ScVbaMenu::getCaption() throw ( uno::RuntimeException ) +{ + return m_xCommandBarControl->getCaption(); +} + +void SAL_CALL +ScVbaMenu::setCaption( const ::rtl::OUString& _caption ) throw (uno::RuntimeException) +{ + m_xCommandBarControl->setCaption( _caption ); +} + +void SAL_CALL +ScVbaMenu::Delete( ) throw (script::BasicErrorException, uno::RuntimeException) +{ + m_xCommandBarControl->Delete(); +} + +uno::Any SAL_CALL +ScVbaMenu::MenuItems( const uno::Any& aIndex ) throw (script::BasicErrorException, uno::RuntimeException) +{ + uno::Reference< XCommandBarControls > xCommandBarControls( m_xCommandBarControl->Controls( uno::Any() ), uno::UNO_QUERY_THROW ); + uno::Reference< excel::XMenuItems > xMenuItems( new ScVbaMenuItems( this, mxContext, xCommandBarControls ) ); + if( aIndex.hasValue() ) + { + return xMenuItems->Item( aIndex, uno::Any() ); + } + return uno::makeAny( xMenuItems ); +} + +rtl::OUString& +ScVbaMenu::getServiceImplName() +{ + static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaMenu") ); + return sImplName; +} +uno::Sequence<rtl::OUString> +ScVbaMenu::getServiceNames() +{ + static uno::Sequence< rtl::OUString > aServiceNames; + if ( aServiceNames.getLength() == 0 ) + { + aServiceNames.realloc( 1 ); + aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.excel.Menu" ) ); + } + return aServiceNames; +} |