1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
21 #include "vbacell.hxx"
22 #include "vbatablehelper.hxx"
25 using namespace ::ooo::vba
;
26 using namespace ::com::sun::star
;
28 SwVbaCell::SwVbaCell( const uno::Reference
< ooo::vba::XHelperInterface
>& rParent
, const uno::Reference
< uno::XComponentContext
>& rContext
, uno::Reference
< text::XTextTable
> xTextTable
, sal_Int32 nColumn
, sal_Int32 nRow
) :
29 SwVbaCell_BASE( rParent
, rContext
), mxTextTable(std::move( xTextTable
)), mnColumn( nColumn
), mnRow( nRow
)
33 SwVbaCell::~SwVbaCell()
37 ::sal_Int32 SAL_CALL
SwVbaCell::getWidth()
39 SwVbaTableHelper
aTableHelper( mxTextTable
);
40 return aTableHelper
.GetColWidth( mnColumn
, mnRow
);
43 void SAL_CALL
SwVbaCell::setWidth( ::sal_Int32 _width
)
45 SwVbaTableHelper
aTableHelper( mxTextTable
);
46 aTableHelper
.SetColWidth( _width
, mnColumn
, mnRow
, true );
49 uno::Any SAL_CALL
SwVbaCell::getHeight()
51 uno::Reference
< word::XRow
> xRow( new SwVbaRow( getParent(), mxContext
, mxTextTable
, mnRow
) );
52 return xRow
->getHeight();
55 void SAL_CALL
SwVbaCell::setHeight( const uno::Any
& _height
)
57 uno::Reference
< word::XRow
> xRow( new SwVbaRow( getParent(), mxContext
, mxTextTable
, mnRow
) );
58 xRow
->setHeight( _height
);
61 ::sal_Int32 SAL_CALL
SwVbaCell::getHeightRule()
63 uno::Reference
< word::XRow
> xRow( new SwVbaRow( getParent(), mxContext
, mxTextTable
, mnRow
) );
64 return xRow
->getHeightRule();
67 void SAL_CALL
SwVbaCell::setHeightRule( ::sal_Int32 _heightrule
)
69 uno::Reference
< word::XRow
> xRow( new SwVbaRow( getParent(), mxContext
, mxTextTable
, mnRow
) );
70 xRow
->setHeightRule( _heightrule
);
73 void SAL_CALL
SwVbaCell::SetWidth( float width
, sal_Int32
/*rulestyle*/ )
75 // FIXME: handle the argument: rulestyle
76 setWidth( static_cast<sal_Int32
>(width
) );
79 void SAL_CALL
SwVbaCell::SetHeight( float height
, sal_Int32 heightrule
)
81 // FIXME: handle the argument: heightrule
82 setHeightRule( heightrule
);
83 setHeight( uno::Any( height
) );
87 SwVbaCell::getServiceImplName()
92 uno::Sequence
< OUString
>
93 SwVbaCell::getServiceNames()
95 static uno::Sequence
< OUString
> const aServiceNames
102 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */