bump product version to 5.0.4.1
[LibreOffice.git] / vbahelper / source / msforms / vbalabel.cxx
blobfc62e6924f5f1d41afac77a9750e8c4978acfdc7
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/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include "vbalabel.hxx"
21 #include "vbanewfont.hxx"
23 using namespace com::sun::star;
24 using namespace ooo::vba;
26 ScVbaLabel::ScVbaLabel( const css::uno::Reference< XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl, const uno::Reference< frame::XModel >& xModel, ov::AbstractGeometryAttributes* pGeomHelper ) : LabelImpl_BASE( xParent, xContext, xControl, xModel, pGeomHelper )
30 // Attributes
31 OUString SAL_CALL
32 ScVbaLabel::getCaption() throw (css::uno::RuntimeException, std::exception)
34 OUString Label;
35 m_xProps->getPropertyValue( "Label" ) >>= Label;
36 return Label;
39 void SAL_CALL
40 ScVbaLabel::setCaption( const OUString& _caption ) throw (::com::sun::star::uno::RuntimeException, std::exception)
42 m_xProps->setPropertyValue( "Label", uno::makeAny( _caption ) );
44 uno::Any SAL_CALL
45 ScVbaLabel::getValue() throw (css::uno::RuntimeException, std::exception)
47 return uno::makeAny( getCaption() );
50 void SAL_CALL
51 ScVbaLabel::setValue( const uno::Any& _value ) throw (::com::sun::star::uno::RuntimeException, std::exception)
53 OUString sCaption;
54 _value >>= sCaption;
55 setCaption( sCaption );
58 OUString SAL_CALL
59 ScVbaLabel::getAccelerator() throw (css::uno::RuntimeException, std::exception)
61 // #STUB
62 return OUString();
65 void SAL_CALL
66 ScVbaLabel::setAccelerator( const OUString& /*_accelerator*/ ) throw (::com::sun::star::uno::RuntimeException, std::exception)
68 // #STUB
71 uno::Reference< msforms::XNewFont > SAL_CALL ScVbaLabel::getFont() throw (uno::RuntimeException, std::exception)
73 return new VbaNewFont( m_xProps );
76 OUString ScVbaLabel::getServiceImplName()
78 return OUString( "ScVbaLabel" );
81 sal_Int32 SAL_CALL ScVbaLabel::getBackColor() throw (uno::RuntimeException, std::exception)
83 return ScVbaControl::getBackColor();
86 void SAL_CALL ScVbaLabel::setBackColor( sal_Int32 nBackColor ) throw (uno::RuntimeException, std::exception)
88 ScVbaControl::setBackColor( nBackColor );
91 sal_Bool SAL_CALL ScVbaLabel::getAutoSize() throw (uno::RuntimeException, std::exception)
93 return ScVbaControl::getAutoSize();
96 void SAL_CALL ScVbaLabel::setAutoSize( sal_Bool bAutoSize ) throw (uno::RuntimeException, std::exception)
98 ScVbaControl::setAutoSize( bAutoSize );
101 uno::Sequence< OUString >
102 ScVbaLabel::getServiceNames()
104 static uno::Sequence< OUString > aServiceNames;
105 if ( aServiceNames.getLength() == 0 )
107 aServiceNames.realloc( 1 );
108 aServiceNames[ 0 ] = "ooo.vba.msforms.Label";
110 return aServiceNames;
113 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */