22#include <com/sun/star/frame/XModel.hpp>
23#include <com/sun/star/text/XTextViewCursorSupplier.hpp>
24#include <com/sun/star/view/XSelectionSupplier.hpp>
25#include <com/sun/star/text/XTextTable.hpp>
26#include <com/sun/star/table/XTableRows.hpp>
27#include <com/sun/star/container/XNamed.hpp>
28#include <com/sun/star/beans/XPropertySet.hpp>
29#include <com/sun/star/table/TableBorderDistances.hpp>
44SwVbaTable::SwVbaTable(
const uno::Reference< ooo::vba::XHelperInterface >& rParent,
const uno::Reference< uno::XComponentContext >& rContext, uno::Reference< text::XTextDocument > xDocument,
const uno::Reference< text::XTextTable >& xTextTable) :
SwVbaTable_BASE( rParent, rContext ), mxTextDocument(
std::move( xDocument ))
49uno::Reference< word::XRange > SAL_CALL
59 uno::Reference< frame::XController >
xController =
xModel->getCurrentController();
61 uno::Reference< text::XTextViewCursorSupplier > xViewCursorSupplier(
xController, uno::UNO_QUERY_THROW );
62 uno::Reference< view::XSelectionSupplier > xSelectionSupplier(
xController, uno::UNO_QUERY_THROW );
68 uno::Reference< text::XTextViewCursor > xCursor = xViewCursorSupplier->getViewCursor();
69 xCursor->gotoEnd(
true);
76 uno::Reference< table::XTableRows > xRows(
mxTextTable->getRows() );
77 xRows->removeByIndex( 0, xRows->getCount() );
83 uno::Reference< container::XNamed > xNamed(
mxTextTable, uno::UNO_QUERY_THROW );
84 return xNamed->getName();
90 uno::Reference< table::XCellRange > aCellRange(
mxTextTable, uno::UNO_QUERY_THROW );
93 if (
index.hasValue() )
101 uno::Reference< beans::XPropertySet > xPropertySet(
mxTextTable, uno::UNO_QUERY_THROW);
102 table::TableBorderDistances aTableBorderDistances;
103 xPropertySet->getPropertyValue(
"TableBorderDistances") >>= aTableBorderDistances;
110 uno::Reference< beans::XPropertySet > xPropertySet(
mxTextTable, uno::UNO_QUERY_THROW);
111 table::TableBorderDistances aTableBorderDistances;
112 aTableBorderDistances.IsBottomDistanceValid =
true;
114 xPropertySet->setPropertyValue(
"TableBorderDistances",
uno::Any( aTableBorderDistances ) );
120 uno::Reference< beans::XPropertySet > xPropertySet(
mxTextTable, uno::UNO_QUERY_THROW);
121 table::TableBorderDistances aTableBorderDistances;
122 xPropertySet->getPropertyValue(
"TableBorderDistances") >>= aTableBorderDistances;
129 uno::Reference< beans::XPropertySet > xPropertySet(
mxTextTable, uno::UNO_QUERY_THROW);
130 table::TableBorderDistances aTableBorderDistances;
131 aTableBorderDistances.IsLeftDistanceValid =
true;
133 xPropertySet->setPropertyValue(
"TableBorderDistances",
uno::Any( aTableBorderDistances ) );
139 uno::Reference< beans::XPropertySet > xPropertySet(
mxTextTable, uno::UNO_QUERY_THROW);
140 table::TableBorderDistances aTableBorderDistances;
141 xPropertySet->getPropertyValue(
"TableBorderDistances") >>= aTableBorderDistances;
148 uno::Reference< beans::XPropertySet > xPropertySet(
mxTextTable, uno::UNO_QUERY_THROW);
149 table::TableBorderDistances aTableBorderDistances;
150 aTableBorderDistances.IsRightDistanceValid =
true;
152 xPropertySet->setPropertyValue(
"TableBorderDistances",
uno::Any( aTableBorderDistances ) );
158 uno::Reference< beans::XPropertySet > xPropertySet(
mxTextTable, uno::UNO_QUERY_THROW);
159 table::TableBorderDistances aTableBorderDistances;
160 xPropertySet->getPropertyValue(
"TableBorderDistances") >>= aTableBorderDistances;
167 uno::Reference< beans::XPropertySet > xPropertySet(
mxTextTable, uno::UNO_QUERY_THROW);
168 table::TableBorderDistances aTableBorderDistances;
169 aTableBorderDistances.IsTopDistanceValid =
true;
171 xPropertySet->setPropertyValue(
"TableBorderDistances",
uno::Any( aTableBorderDistances ) );
177 uno::Reference< table::XTableRows > xTableRows(
mxTextTable->getRows(), uno::UNO_SET_THROW );
179 if (
index.hasValue() )
187 uno::Reference< table::XTableColumns > xTableColumns(
mxTextTable->getColumns(), uno::UNO_SET_THROW );
189 if (
index.hasValue() )
201uno::Sequence<OUString>
constexpr auto convertPointToMm100(N n)
constexpr auto convertMm100ToPoint(N n)
css::uno::Reference< css::uno::XComponentContext > mxContext
css::uno::WeakReference< ov::XHelperInterface > mxParent
virtual double SAL_CALL getBottomPadding() override
virtual css::uno::Any SAL_CALL Borders(const css::uno::Any &aIndex) override
SwVbaTable(const css::uno::Reference< ooo::vba::XHelperInterface > &rParent, const css::uno::Reference< css::uno::XComponentContext > &rContext, css::uno::Reference< css::text::XTextDocument > xDocument, const css::uno::Reference< css::text::XTextTable > &xTextTable)
virtual void SAL_CALL Select() override
virtual css::uno::Sequence< OUString > getServiceNames() override
virtual void SAL_CALL setTopPadding(double fValue) override
virtual double SAL_CALL getRightPadding() override
virtual css::uno::Any SAL_CALL Columns(const css::uno::Any &aIndex) override
virtual void SAL_CALL Delete() override
css::uno::Reference< css::text::XTextDocument > mxTextDocument
virtual double SAL_CALL getTopPadding() override
virtual OUString SAL_CALL getName() override
virtual void SAL_CALL setLeftPadding(double fValue) override
virtual css::uno::Reference< ::ooo::vba::word::XRange > SAL_CALL Range() override
virtual void SAL_CALL setBottomPadding(double fValue) override
virtual css::uno::Any SAL_CALL Rows(const css::uno::Any &aIndex) override
virtual double SAL_CALL getLeftPadding() override
virtual void SAL_CALL setRightPadding(double fValue) override
virtual OUString getServiceImplName() override
css::uno::Reference< css::text::XTextTable > mxTextTable
Sequence< OUString > aServiceNames
Reference< XController > xController
Reference< XModel > xModel