merge the formfield patch from ooo-build
[ooovba.git] / vbahelper / source / msforms / vbaspinbutton.cxx
blob05b6777a1ee1949e765385f36fc5d9ff15ae831f
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 "vbaspinbutton.hxx"
36 #include <vector>
38 using namespace com::sun::star;
39 using namespace ooo::vba;
42 const static rtl::OUString ORIENTATION( RTL_CONSTASCII_USTRINGPARAM("Orientation") );
43 const static rtl::OUString SPINVALUE( RTL_CONSTASCII_USTRINGPARAM("SpinValue") );
44 const static rtl::OUString SPINMAX( RTL_CONSTASCII_USTRINGPARAM("SpinValueMax") );
45 const static rtl::OUString SPINMIN( RTL_CONSTASCII_USTRINGPARAM("SpinValueMin") );
47 ScVbaSpinButton::ScVbaSpinButton( const css::uno::Reference< ov::XHelperInterface >& xParent, const uno::Reference< uno::XComponentContext >& xContext, const uno::Reference< uno::XInterface >& xControl, const uno::Reference< frame::XModel >& xModel, AbstractGeometryAttributes* pGeomHelper ) : SpinButtonImpl_BASE( xParent, xContext, xControl, xModel, pGeomHelper )
51 // Attributes
52 uno::Any SAL_CALL
53 ScVbaSpinButton::getValue() throw (css::uno::RuntimeException)
55 return m_xProps->getPropertyValue( SPINVALUE );
58 void SAL_CALL
59 ScVbaSpinButton::setValue( const uno::Any& _value ) throw (::com::sun::star::uno::RuntimeException)
61 m_xProps->setPropertyValue( SPINVALUE, _value );
64 ::sal_Int32 SAL_CALL
65 ScVbaSpinButton::getMax() throw (uno::RuntimeException)
67 sal_Int32 nMax = 0;
68 m_xProps->getPropertyValue( SPINMAX ) >>= nMax;
69 return nMax;
72 void SAL_CALL
73 ScVbaSpinButton::setMax( sal_Int32 nVal ) throw (uno::RuntimeException)
75 m_xProps->setPropertyValue( SPINMAX, uno::makeAny( nVal ) );
78 ::sal_Int32 SAL_CALL
79 ScVbaSpinButton::getMin() throw (uno::RuntimeException)
81 sal_Int32 nVal = 0;
82 m_xProps->getPropertyValue( SPINMIN ) >>= nVal;
83 return nVal;
86 void SAL_CALL
87 ScVbaSpinButton::setMin( sal_Int32 nVal ) throw (uno::RuntimeException)
89 m_xProps->setPropertyValue( SPINMIN, uno::makeAny( nVal ) );
92 rtl::OUString&
93 ScVbaSpinButton::getServiceImplName()
95 static rtl::OUString sImplName( RTL_CONSTASCII_USTRINGPARAM("ScVbaSpinButton") );
96 return sImplName;
99 uno::Sequence< rtl::OUString >
100 ScVbaSpinButton::getServiceNames()
102 static uno::Sequence< rtl::OUString > aServiceNames;
103 if ( aServiceNames.getLength() == 0 )
105 aServiceNames.realloc( 1 );
106 aServiceNames[ 0 ] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("ooo.vba.msforms.Frame" ) );
108 return aServiceNames;