21 #include <com/sun/star/lang/DisposedException.hpp>
22 #include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
47 , mxTableModel( xTableModel )
50 , mbOptimalHeight( true )
52 , mbIsStartOfNewPage(
false )
86 throw DisposedException();
109 if( nIndex >= static_cast< sal_Int32 >(
maCells.size() ) )
110 nIndex =
static_cast< sal_Int32
>(
maCells.size() );
112 maCells.insert(
maCells.begin() + nIndex, *pIter, (*pIter) + nCount );
116 for ( sal_Int32
i = 0;
i < nCount;
i++ )
125 if( (nCount < 0) || ( nIndex < 0))
128 if( (nIndex + nCount) < static_cast< sal_Int32 >(
maCells.size() ) )
130 CellVector::iterator aBegin(
maCells.begin() );
131 std::advance(aBegin, nIndex);
135 CellVector::iterator aEnd( aBegin );
136 while( nCount-- && (aEnd !=
maCells.end()) )
163 throw IndexOutOfBoundsException();
172 if( (nLeft >= 0 ) && (nTop == 0) && (nRight >= nLeft) && (nBottom == 0) )
176 throw IndexOutOfBoundsException();
183 return Reference< XCellRange >();
211 SdrModel& rModel(rTableObj.getSdrModelFromSdrObject());
214 std::unique_ptr<TableRowUndo> pUndo;
215 const bool bUndo(rTableObj.IsInserted() && rModel.IsUndoEnabled());
225 case Property_Height:
228 bOk = aValue >>= nHeight;
238 case Property_OptimalHeight:
241 bOk = aValue >>= bOptimalHeight;
251 case Property_IsVisible:
254 bOk = aValue >>= bIsVisible;
263 case Property_IsStartOfNewPage:
266 bOk = aValue >>= bIsStartOfNewPage;
275 throw UnknownPropertyException( OUString::number(nHandle), static_cast<cppu::OWeakObject*>(
this));
280 throw IllegalArgumentException();
287 rModel.AddUndo( std::move(pUndo) );
302 default:
throw UnknownPropertyException( OUString::number(nHandle), static_cast<cppu::OWeakObject*>(
this));
312 aProperties[0].Name =
"Height";
315 aProperties[0].Attributes = 0;
317 aProperties[1].Name =
"OptimalHeight";
320 aProperties[1].Attributes = 0;
322 aProperties[2].Name =
"IsVisible";
325 aProperties[2].Attributes = 0;
327 aProperties[3].Name =
"IsStartOfNewPage";
330 aProperties[3].Attributes = 0;
332 aProperties[4].Name =
"Size";
335 aProperties[4].Attributes = 0;
337 aProperties[5].Name =
"OptimalSize";
340 aProperties[5].Attributes = 0;
std::vector< CellRef > CellVector
TableModelRef mxTableModel
virtual css::uno::Reference< css::table::XCell > SAL_CALL getCellByPosition(sal_Int32 nColumn, sal_Int32 nRow) override
std::vector< css::beans::Property > PropertyVector
const sal_Int32 Property_IsStartOfNewPage
void insertColumns(sal_Int32 nIndex, sal_Int32 nCount, CellVector::iterator const *pIter)
const sal_Int32 Property_IsVisible
PropertiesInfo aProperties
const TableModelRef & getModel() const
Reference to the table model containing this row.
void removeColumns(sal_Int32 nIndex, sal_Int32 nCount)
friend class TableRowUndo
virtual OUString SAL_CALL getName() override
virtual void SAL_CALL setFastPropertyValue(::sal_Int32 nHandle, const css::uno::Any &aValue) override
virtual css::uno::Reference< css::table::XCellRange > SAL_CALL getCellRangeByPosition(sal_Int32 nLeft, sal_Int32 nTop, sal_Int32 nRight, sal_Int32 nBottom) override
css::uno::Type const & get()
static rtl::Reference< FastPropertySetInfo > getStaticPropertySetInfo()
::cppu::ImplInheritanceHelper< FastPropertySet, css::table::XCellRange, css::container::XNamed > TableRowBase
virtual css::uno::Any SAL_CALL getFastPropertyValue(::sal_Int32 nHandle) override
virtual void SAL_CALL setName(const OUString &aName) override
const sal_Int32 Property_Height
virtual ~TableRow() override
void throwIfDisposed() const
TableRow & operator=(const TableRow &)
const sal_Int32 Property_OptimalHeight
virtual css::uno::Reference< css::table::XCellRange > SAL_CALL getCellRangeByName(const OUString &aRange) override
TableRow(const TableModelRef &xTableModel, sal_Int32 nRow, sal_Int32 nColumns)
bool m_bDetectedRangeSegmentation false