22#include <com/sun/star/frame/XModel.hpp>
23#include <com/sun/star/beans/XPropertySet.hpp>
24#include <com/sun/star/table/XCellRange.hpp>
25#include <com/sun/star/view/XSelectionSupplier.hpp>
26#include <ooo/vba/word/WdRowHeightRule.hpp>
27#include <ooo/vba/word/WdConstants.hpp>
33SwVbaRow::SwVbaRow(
const uno::Reference< ooo::vba::XHelperInterface >& rParent,
const uno::Reference< uno::XComponentContext >& rContext,uno::Reference< text::XTextTable > xTextTable, sal_Int32 nIndex ) :
46 if(
getHeightRule() == word::WdRowHeightRule::wdRowHeightAuto )
47 return uno::Any( sal_Int32( word::WdConstants::wdUndefined ) );
49 sal_Int32 nHeight = 0;
50 mxRowProps->getPropertyValue(
"Height") >>= nHeight;
51 return uno::Any(
static_cast<float>(Millimeter::getInPoints( nHeight )) );
59 sal_Int32 nHeight = Millimeter::getInHundredthsOfOneMillimeter( height );
65 bool isAutoHeight =
false;
66 mxRowProps->getPropertyValue(
"IsAutoHeight") >>= isAutoHeight;
67 return isAutoHeight ? word::WdRowHeightRule::wdRowHeightAuto : word::WdRowHeightRule::wdRowHeightExactly;
72 bool isAutoHeight = ( _heightrule == word::WdRowHeightRule::wdRowHeightAuto );
82void SwVbaRow::SelectRow(
const uno::Reference< frame::XModel >& xModel,
const uno::Reference< text::XTextTable >& xTextTable, sal_Int32 nStartRow, sal_Int32 nEndRow )
84 OUString sRangeName =
"A" + OUString::number(nStartRow + 1);
90 sRangeName +=
":" + sCol + OUString::number(nEndRow + 1);
92 uno::Reference< table::XCellRange > xCellRange( xTextTable, uno::UNO_QUERY_THROW );
93 uno::Reference< table::XCellRange > xSelRange = xCellRange->getCellRangeByName( sRangeName );
95 uno::Reference< view::XSelectionSupplier > xSelection(
xModel->getCurrentController(), uno::UNO_QUERY_THROW );
96 xSelection->select(
uno::Any( xSelRange ) );
111uno::Sequence< OUString >
css::uno::Reference< css::uno::XComponentContext > mxContext
css::uno::Reference< css::table::XTableRows > mxTableRows
virtual void SAL_CALL setHeightRule(::sal_Int32 _heightrule) override
static void SelectRow(const css::uno::Reference< css::frame::XModel > &xModel, const css::uno::Reference< css::text::XTextTable > &xTextTable, sal_Int32 nStartRow, sal_Int32 nEndRow)
virtual void SAL_CALL Select() override
virtual ::sal_Int32 SAL_CALL getHeightRule() override
virtual ~SwVbaRow() override
virtual OUString getServiceImplName() override
virtual void SAL_CALL SetHeight(float height, sal_Int32 heightrule) override
SwVbaRow(const css::uno::Reference< ooo::vba::XHelperInterface > &rParent, const css::uno::Reference< css::uno::XComponentContext > &rContext, css::uno::Reference< css::text::XTextTable > xTextTable, sal_Int32 nIndex)
virtual css::uno::Sequence< OUString > getServiceNames() override
css::uno::Reference< css::text::XTextTable > mxTextTable
virtual void SAL_CALL setHeight(const css::uno::Any &_height) override
virtual css::uno::Any SAL_CALL getHeight() override
css::uno::Reference< css::beans::XPropertySet > mxRowProps
sal_Int32 getTabColumnsCount(sal_Int32 nRowIndex)
static OUString getColumnStr(sal_Int32 nCol)
Sequence< OUString > aServiceNames
VBAHELPER_DLLPUBLIC css::uno::Reference< css::frame::XModel > getCurrentWordDoc(const css::uno::Reference< css::uno::XComponentContext > &xContext)
Reference< XModel > xModel