22#include <com/sun/star/frame/XModel.hpp>
23#include <com/sun/star/table/XCellRange.hpp>
24#include <com/sun/star/view/XSelectionSupplier.hpp>
30SwVbaColumn::SwVbaColumn(
const uno::Reference< ooo::vba::XHelperInterface >& rParent,
const uno::Reference< uno::XComponentContext >& rContext, uno::Reference< text::XTextTable > xTextTable, sal_Int32 nIndex ) :
60void SwVbaColumn::SelectColumn(
const uno::Reference< frame::XModel >& xModel,
const uno::Reference< text::XTextTable >& xTextTable, sal_Int32 nStartColumn, sal_Int32 nEndColumn )
63 OUString aRangeName = sStartCol + OUString::number( 1 );
65 sal_Int32 nRowCount = xTextTable->getRows()->getCount();
66 aRangeName +=
":" + sEndCol + OUString::number(nRowCount);
68 uno::Reference< table::XCellRange > xCellRange( xTextTable, uno::UNO_QUERY_THROW );
69 uno::Reference< table::XCellRange > xSelRange = xCellRange->getCellRangeByName( aRangeName );
71 uno::Reference< view::XSelectionSupplier > xSelection(
xModel->getCurrentController(), uno::UNO_QUERY_THROW );
72 xSelection->select(
uno::Any( xSelRange ) );
81uno::Sequence< OUString >
css::uno::Reference< css::uno::XComponentContext > mxContext
virtual void SAL_CALL Select() override
virtual void SAL_CALL setWidth(sal_Int32 _width) override
virtual css::uno::Sequence< OUString > getServiceNames() override
static void SelectColumn(const css::uno::Reference< css::frame::XModel > &xModel, const css::uno::Reference< css::text::XTextTable > &xTextTable, sal_Int32 nStartColumn, sal_Int32 nEndColumn)
virtual sal_Int32 SAL_CALL getWidth() override
virtual ~SwVbaColumn() override
SwVbaColumn(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)
css::uno::Reference< css::text::XTextTable > mxTextTable
virtual OUString getServiceImplName() override
void SetColWidth(sal_Int32 _width, sal_Int32 nCol, sal_Int32 nRow=0, bool bCurRowOnly=false)
static OUString getColumnStr(sal_Int32 nCol)
static sal_Int32 GetColWidth(SwTabCols &rCols, sal_Int32 nNum)
Sequence< OUString > aServiceNames
VBAHELPER_DLLPUBLIC css::uno::Reference< css::frame::XModel > getCurrentWordDoc(const css::uno::Reference< css::uno::XComponentContext > &xContext)
Reference< XModel > xModel