fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / sc / source / ui / vba / vbamenu.cxx
blobf0088b8af2894237c32fb8916c80ab9225e2be5e
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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/.
8 */
10 #include "vbamenu.hxx"
11 #include "vbamenuitems.hxx"
13 using namespace com::sun::star;
14 using namespace ooo::vba;
16 ScVbaMenu::ScVbaMenu( const uno::Reference< ov::XHelperInterface >& rParent, const uno::Reference< uno::XComponentContext >& rContext, const uno::Reference< XCommandBarControl >& rCommandBarControl ) throw( uno::RuntimeException ) : Menu_BASE( rParent, rContext ), m_xCommandBarControl( rCommandBarControl )
20 OUString SAL_CALL
21 ScVbaMenu::getCaption() throw ( uno::RuntimeException, std::exception )
23 return m_xCommandBarControl->getCaption();
26 void SAL_CALL
27 ScVbaMenu::setCaption( const OUString& _caption ) throw (uno::RuntimeException, std::exception)
29 m_xCommandBarControl->setCaption( _caption );
32 void SAL_CALL
33 ScVbaMenu::Delete( ) throw (script::BasicErrorException, uno::RuntimeException, std::exception)
35 m_xCommandBarControl->Delete();
38 uno::Any SAL_CALL
39 ScVbaMenu::MenuItems( const uno::Any& aIndex ) throw (script::BasicErrorException, uno::RuntimeException, std::exception)
41 uno::Reference< XCommandBarControls > xCommandBarControls( m_xCommandBarControl->Controls( uno::Any() ), uno::UNO_QUERY_THROW );
42 uno::Reference< excel::XMenuItems > xMenuItems( new ScVbaMenuItems( this, mxContext, xCommandBarControls ) );
43 if( aIndex.hasValue() )
45 return xMenuItems->Item( aIndex, uno::Any() );
47 return uno::makeAny( xMenuItems );
50 OUString
51 ScVbaMenu::getServiceImplName()
53 return OUString("ScVbaMenu");
56 uno::Sequence<OUString>
57 ScVbaMenu::getServiceNames()
59 static uno::Sequence< OUString > aServiceNames;
60 if ( aServiceNames.getLength() == 0 )
62 aServiceNames.realloc( 1 );
63 aServiceNames[ 0 ] = "ooo.vba.excel.Menu";
65 return aServiceNames;
68 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */