update dev300-m58
[ooovba.git] / vbahelper / source / msforms / vbabutton.cxx
blob0e4d749e178bab15c87499b1aa553034dcd2899b
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: vbabutton.cxx,v $
10 * $Revision: 1.3 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #include "vbabutton.hxx"
31 #include <vector>
33 using namespace com::sun::star;
34 using namespace ooo::vba;
37 const static rtl::OUString LABEL( RTL_CONSTASCII_USTRINGPARAM("Label") );
38 ScVbaButton::ScVbaButton( const uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl, const uno::Reference< frame::XModel >& xModel, AbstractGeometryAttributes* pGeomHelper ) : ButtonImpl_BASE( xParent, xContext, xControl, xModel, pGeomHelper )
42 // Attributes
43 rtl::OUString SAL_CALL
44 ScVbaButton::getCaption() throw (css::uno::RuntimeException)
46 rtl::OUString Label;
47 m_xProps->getPropertyValue( LABEL ) >>= Label;
48 return Label;
51 void SAL_CALL
52 ScVbaButton::setCaption( const rtl::OUString& _caption ) throw (::com::sun::star::uno::RuntimeException)
54 m_xProps->setPropertyValue( LABEL, uno::makeAny( _caption ) );
57 rtl::OUString&
58 ScVbaButton::getServiceImplName()
60 static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaButton") );
61 return sImplName;
64 uno::Sequence< rtl::OUString >
65 ScVbaButton::getServiceNames()
67 static uno::Sequence< rtl::OUString > aServiceNames;
68 if ( aServiceNames.getLength() == 0 )
70 aServiceNames.realloc( 1 );
71 aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msforms.Button" ) );
73 return aServiceNames;