update dev300-m58
[ooovba.git] / sc / source / ui / vba / vbamenuitem.cxx
blob48254ccd559e72c58dbec82797c373a2528c8325
1 /*************************************************************************
3 * OpenOffice.org - a multi-platform office productivity suite
5 * $RCSfile$
7 * $Revision$
9 * last change: $Author$ $Date$
11 * The Contents of this file are made available subject to
12 * the terms of GNU Lesser General Public License Version 2.1.
15 * GNU Lesser General Public License Version 2.1
16 * =============================================
17 * Copyright 2005 by Sun Microsystems, Inc.
18 * 901 San Antonio Road, Palo Alto, CA 94303, USA
20 * This library is free software; you can redistribute it and/or
21 * modify it under the terms of the GNU Lesser General Public
22 * License version 2.1, as published by the Free Software Foundation.
24 * This library is distributed in the hope that it will be useful,
25 * but WITHOUT ANY WARRANTY; without even the implied warranty of
26 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
27 * Lesser General Public License for more details.
29 * You should have received a copy of the GNU Lesser General Public
30 * License along with this library; if not, write to the Free Software
31 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
32 * MA 02111-1307 USA
34 ************************************************************************/
35 #include "vbamenuitem.hxx"
37 using namespace com::sun::star;
38 using namespace ooo::vba;
40 ScVbaMenuItem::ScVbaMenuItem( const uno::Reference< ov::XHelperInterface > xParent, const uno::Reference< uno::XComponentContext > xContext, const uno::Reference< XCommandBarControl >& xCommandBarControl ) throw( uno::RuntimeException ) : MenuItem_BASE( xParent, xContext ), m_xCommandBarControl( xCommandBarControl )
44 ::rtl::OUString SAL_CALL
45 ScVbaMenuItem::getCaption() throw ( uno::RuntimeException )
47 return m_xCommandBarControl->getCaption();
50 void SAL_CALL
51 ScVbaMenuItem::setCaption( const ::rtl::OUString& _caption ) throw (uno::RuntimeException)
53 m_xCommandBarControl->setCaption( _caption );
56 ::rtl::OUString SAL_CALL
57 ScVbaMenuItem::getOnAction() throw ( uno::RuntimeException )
59 return m_xCommandBarControl->getOnAction();
62 void SAL_CALL
63 ScVbaMenuItem::setOnAction( const ::rtl::OUString& _onaction ) throw (uno::RuntimeException)
65 m_xCommandBarControl->setOnAction( _onaction );
68 void SAL_CALL
69 ScVbaMenuItem::Delete( ) throw (script::BasicErrorException, uno::RuntimeException)
71 m_xCommandBarControl->Delete();
74 rtl::OUString&
75 ScVbaMenuItem::getServiceImplName()
77 static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaMenuItem") );
78 return sImplName;
80 uno::Sequence<rtl::OUString>
81 ScVbaMenuItem::getServiceNames()
83 static uno::Sequence< rtl::OUString > aServiceNames;
84 if ( aServiceNames.getLength() == 0 )
86 aServiceNames.realloc( 1 );
87 aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.excel.MenuItem" ) );
89 return aServiceNames;