1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 #include "vbamenuitem.hxx"
11 using namespace com::sun::star
;
12 using namespace ooo::vba
;
14 ScVbaMenuItem::ScVbaMenuItem( const uno::Reference
< ov::XHelperInterface
>& rParent
, const uno::Reference
< uno::XComponentContext
>& rContext
, const uno::Reference
< XCommandBarControl
>& rCommandBarControl
) throw( uno::RuntimeException
) : MenuItem_BASE( rParent
, rContext
), m_xCommandBarControl( rCommandBarControl
)
19 ScVbaMenuItem::getCaption() throw ( uno::RuntimeException
, std::exception
)
21 return m_xCommandBarControl
->getCaption();
25 ScVbaMenuItem::setCaption( const OUString
& _caption
) throw (uno::RuntimeException
, std::exception
)
27 m_xCommandBarControl
->setCaption( _caption
);
31 ScVbaMenuItem::getOnAction() throw ( uno::RuntimeException
, std::exception
)
33 return m_xCommandBarControl
->getOnAction();
37 ScVbaMenuItem::setOnAction( const OUString
& _onaction
) throw (uno::RuntimeException
, std::exception
)
39 m_xCommandBarControl
->setOnAction( _onaction
);
43 ScVbaMenuItem::Delete( ) throw (script::BasicErrorException
, uno::RuntimeException
, std::exception
)
45 m_xCommandBarControl
->Delete();
49 ScVbaMenuItem::getServiceImplName()
51 return OUString("ScVbaMenuItem");
54 uno::Sequence
<OUString
>
55 ScVbaMenuItem::getServiceNames()
57 static uno::Sequence
< OUString
> aServiceNames
;
58 if ( aServiceNames
.getLength() == 0 )
60 aServiceNames
.realloc( 1 );
61 aServiceNames
[ 0 ] = "ooo.vba.excel.MenuItem";
66 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */