LanguageTool: don't crash if REST protocol isn't set
[LibreOffice.git] / vbahelper / source / msforms / vbascrollbar.cxx
blob4968c72826b6fa02c3b2c108d89834c63245fd32
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 "vbascrollbar.hxx"
22 using namespace com::sun::star;
23 using namespace ooo::vba;
25 ScVbaScrollBar::ScVbaScrollBar( 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, std::unique_ptr<AbstractGeometryAttributes> pGeomHelper )
26 : ScrollBarImpl_BASE( xParent, xContext, xControl, xModel, std::move(pGeomHelper) )
30 // Attributes
31 uno::Any SAL_CALL
32 ScVbaScrollBar::getValue()
34 return m_xProps->getPropertyValue( "ScrollValue" );
37 void SAL_CALL
38 ScVbaScrollBar::setValue( const uno::Any& _value )
40 m_xProps->setPropertyValue( "ScrollValue", _value );
43 ::sal_Int32 SAL_CALL
44 ScVbaScrollBar::getMax()
46 sal_Int32 nMax = 0;
47 m_xProps->getPropertyValue( "ScrollValueMax" ) >>= nMax;
48 return nMax;
51 void SAL_CALL
52 ScVbaScrollBar::setMax( sal_Int32 nVal )
54 m_xProps->setPropertyValue( "ScrollValueMax", uno::makeAny( nVal ) );
57 ::sal_Int32 SAL_CALL
58 ScVbaScrollBar::getMin()
60 sal_Int32 nVal = 0;
61 m_xProps->getPropertyValue( "ScrollValueMin" ) >>= nVal;
62 return nVal;
65 void SAL_CALL
66 ScVbaScrollBar::setMin( sal_Int32 nVal )
68 m_xProps->setPropertyValue( "ScrollValueMin", uno::makeAny( nVal ) );
71 void SAL_CALL
72 ScVbaScrollBar::setLargeChange( ::sal_Int32 _largechange )
74 m_xProps->setPropertyValue( "BlockIncrement", uno::makeAny( _largechange ) );
77 ::sal_Int32 SAL_CALL
78 ScVbaScrollBar::getLargeChange()
80 sal_Int32 nVal = 0;
81 m_xProps->getPropertyValue( "BlockIncrement" ) >>= nVal;
82 return nVal;
85 ::sal_Int32 SAL_CALL
86 ScVbaScrollBar::getSmallChange()
88 sal_Int32 nSmallChange = 0;
89 m_xProps->getPropertyValue( "LineIncrement" ) >>= nSmallChange;
90 return nSmallChange;
93 void SAL_CALL
94 ScVbaScrollBar::setSmallChange( ::sal_Int32 _smallchange )
96 m_xProps->setPropertyValue( "LineIncrement", uno::makeAny( _smallchange ) );
99 OUString
100 ScVbaScrollBar::getServiceImplName()
102 return "ScVbaScrollBar";
105 uno::Sequence< OUString >
106 ScVbaScrollBar::getServiceNames()
108 static uno::Sequence< OUString > const aServiceNames
110 "ooo.vba.msforms.Frame"
112 return aServiceNames;
115 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */