LibreOffice Module svx (master)
1
|
#include <tablemodel.hxx>
Public Member Functions | |
TableModel (SdrTableObj *pTableObj) | |
TableModel (SdrTableObj *pTableObj, const TableModelRef &xSourceTable) | |
virtual | ~TableModel () override |
void | init (sal_Int32 nColumns, sal_Int32 nRows) |
SdrTableObj * | getSdrTableObj () const |
void | optimize () |
deletes rows and columns that are completely merged. More... | |
void | merge (sal_Int32 nCol, sal_Int32 nRow, sal_Int32 nColSpan, sal_Int32 nRowSpan) |
merges the cell at the given position with the given span More... | |
std::vector< sal_Int32 > | getColumnWidths () |
Get the width of all columns in this table. More... | |
void | dumpAsXml (xmlTextWriterPtr pWriter) const |
virtual sal_Int32 | getLeft () override |
virtual sal_Int32 | getTop () override |
virtual sal_Int32 | getRight () override |
virtual sal_Int32 | getBottom () override |
virtual css::uno::Reference< css::table::XTable > | getTable () override |
virtual css::uno::Reference< css::table::XCellCursor > SAL_CALL | createCursor () override |
virtual css::uno::Reference< css::table::XCellCursor > SAL_CALL | createCursorByRange (const css::uno::Reference< css::table::XCellRange > &rRange) override |
virtual ::sal_Int32 SAL_CALL | getRowCount () override |
virtual ::sal_Int32 SAL_CALL | getColumnCount () override |
virtual void SAL_CALL | dispose () override |
virtual sal_Bool SAL_CALL | isModified () override |
virtual void SAL_CALL | setModified (sal_Bool bModified) override |
virtual void SAL_CALL | addModifyListener (const css::uno::Reference< css::util::XModifyListener > &aListener) override |
virtual void SAL_CALL | removeModifyListener (const css::uno::Reference< css::util::XModifyListener > &aListener) override |
virtual css::uno::Reference< css::table::XTableColumns > SAL_CALL | getColumns () override |
virtual css::uno::Reference< css::table::XTableRows > SAL_CALL | getRows () override |
virtual css::uno::Reference< css::table::XCell > SAL_CALL | getCellByPosition (::sal_Int32 nColumn,::sal_Int32 nRow) override |
virtual css::uno::Reference< css::table::XCellRange > SAL_CALL | getCellRangeByPosition (::sal_Int32 nLeft,::sal_Int32 nTop,::sal_Int32 nRight,::sal_Int32 nBottom) override |
virtual css::uno::Reference< css::table::XCellRange > SAL_CALL | getCellRangeByName (const OUString &aRange) override |
virtual css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL | getPropertySetInfo () override |
virtual void SAL_CALL | setPropertyValue (const OUString &aPropertyName, const css::uno::Any &aValue) override |
virtual css::uno::Any SAL_CALL | getPropertyValue (const OUString &PropertyName) override |
virtual void SAL_CALL | addPropertyChangeListener (const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener) override |
virtual void SAL_CALL | removePropertyChangeListener (const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &aListener) override |
virtual void SAL_CALL | addVetoableChangeListener (const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override |
virtual void SAL_CALL | removeVetoableChangeListener (const OUString &PropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &aListener) override |
virtual void SAL_CALL | setFastPropertyValue (::sal_Int32 nHandle, const css::uno::Any &aValue) override |
virtual css::uno::Any SAL_CALL | getFastPropertyValue (::sal_Int32 nHandle) override |
virtual void SAL_CALL | lockBroadcasts () override |
virtual void SAL_CALL | unlockBroadcasts () override |
Private Member Functions | |
void | notifyModification () |
void | insertColumns (sal_Int32 nIndex, sal_Int32 nCount) |
void | removeColumns (sal_Int32 nIndex, sal_Int32 nCount) |
void | insertRows (sal_Int32 nIndex, sal_Int32 nCount) |
void | removeRows (sal_Int32 nIndex, sal_Int32 nCount) |
sal_Int32 | getRowCountImpl () const |
sal_Int32 | getColumnCountImpl () const |
CellRef | createCell () |
CellRef | getCell (::sal_Int32 nCol,::sal_Int32 nRow) const |
void | UndoInsertRows (sal_Int32 nIndex, sal_Int32 nCount) |
void | UndoRemoveRows (sal_Int32 nIndex, RowVector &aNewRows) |
void | UndoInsertColumns (sal_Int32 nIndex, sal_Int32 nCount) |
void | UndoRemoveColumns (sal_Int32 nIndex, ColumnVector &aNewCols, CellVector &aCells) |
virtual void SAL_CALL | disposing () override |
this function is called upon disposing the component More... | |
TableRowRef const & | getRow (sal_Int32 nRow) const |
TableColumnRef const & | getColumn (sal_Int32 nColumn) const |
void | updateRows () |
void | updateColumns () |
Private Attributes | |
RowVector | maRows |
ColumnVector | maColumns |
rtl::Reference< TableColumns > | mxTableColumns |
rtl::Reference< TableRows > | mxTableRows |
SdrTableObj * | mpTableObj |
bool | mbModified |
bool | mbNotifyPending |
sal_Int32 | mnNotifyLock |
Friends | |
class | InsertRowUndo |
class | RemoveRowUndo |
class | InsertColUndo |
class | RemoveColUndo |
class | TableColumnUndo |
class | TableRowUndo |
class | TableColumn |
class | TableRow |
class | TableRows |
class | TableColumns |
class | TableModelNotifyGuard |
Additional Inherited Members | |
![]() | |
~ICellRange () | |
![]() | |
mutable::osl::Mutex | m_aMutex |
Definition at line 53 of file tablemodel.hxx.
|
explicit |
Definition at line 103 of file tablemodel.cxx.
sdr::table::TableModel::TableModel | ( | SdrTableObj * | pTableObj, |
const TableModelRef & | xSourceTable | ||
) |
|
overridevirtual |
Definition at line 148 of file tablemodel.cxx.
|
overridevirtual |
Definition at line 355 of file tablemodel.cxx.
|
overridevirtual |
Definition at line 446 of file tablemodel.cxx.
|
overridevirtual |
Definition at line 456 of file tablemodel.cxx.
|
private |
Definition at line 587 of file tablemodel.cxx.
References sdr::table::SdrTableObj::createCell(), and mpTableObj.
|
overridevirtual |
Definition at line 281 of file tablemodel.cxx.
References createCursorByRange().
|
overridevirtual |
Definition at line 288 of file tablemodel.cxx.
References sdr::table::ICellRange::getBottom(), sdr::table::ICellRange::getLeft(), sdr::table::ICellRange::getRight(), sdr::table::ICellRange::getTable(), sdr::table::ICellRange::getTop(), and xModel.
Referenced by createCursor().
Definition at line 324 of file tablemodel.cxx.
|
overrideprivatevirtual |
this function is called upon disposing the component
Definition at line 496 of file tablemodel.cxx.
References maColumns, maRows, mpTableObj, mxTableColumns, and mxTableRows.
void sdr::table::TableModel::dumpAsXml | ( | xmlTextWriterPtr | pWriter | ) | const |
Definition at line 1114 of file tablemodel.cxx.
References getColumnCountImpl(), getRowCountImpl(), maRows, and void().
|
overridevirtual |
Implements sdr::table::ICellRange.
Definition at line 196 of file tablemodel.cxx.
References getRowCount().
|
private |
Definition at line 573 of file tablemodel.cxx.
References getColumnCountImpl(), getRowCountImpl(), and maRows.
Referenced by getCellByPosition(), insertColumns(), insertRows(), removeColumns(), removeRows(), and TableModel().
|
overridevirtual |
Definition at line 393 of file tablemodel.cxx.
References getCell().
Referenced by merge(), and optimize().
|
overridevirtual |
Definition at line 419 of file tablemodel.cxx.
|
overridevirtual |
Definition at line 405 of file tablemodel.cxx.
References getColumnCountImpl(), getRowCountImpl(), and xModel.
|
private |
css::lang::IndexOutOfBoundsException |
Definition at line 955 of file tablemodel.cxx.
References getColumnCountImpl(), and maColumns.
|
override |
Definition at line 307 of file tablemodel.cxx.
References getColumnCountImpl().
Referenced by getRight(), and merge().
|
private |
Definition at line 490 of file tablemodel.cxx.
References maColumns.
Referenced by dumpAsXml(), getCell(), getCellRangeByPosition(), getColumn(), getColumnCount(), insertRows(), optimize(), removeColumns(), and removeRows().
|
overridevirtual |
Definition at line 370 of file tablemodel.cxx.
References mxTableColumns.
std::vector< sal_Int32 > sdr::table::TableModel::getColumnWidths | ( | ) |
Get the width of all columns in this table.
Definition at line 313 of file tablemodel.cxx.
|
overridevirtual |
Definition at line 474 of file tablemodel.cxx.
References Any.
|
overridevirtual |
Implements sdr::table::ICellRange.
Definition at line 178 of file tablemodel.cxx.
|
overridevirtual |
Definition at line 428 of file tablemodel.cxx.
|
overridevirtual |
Definition at line 440 of file tablemodel.cxx.
References Any.
|
overridevirtual |
Implements sdr::table::ICellRange.
Definition at line 190 of file tablemodel.cxx.
References getColumnCount().
|
private |
css::lang::IndexOutOfBoundsException |
Definition at line 946 of file tablemodel.cxx.
References getRowCountImpl(), and maRows.
|
override |
Definition at line 301 of file tablemodel.cxx.
References getRowCountImpl().
Referenced by getBottom(), and merge().
|
private |
Definition at line 484 of file tablemodel.cxx.
References maRows.
Referenced by dumpAsXml(), getCell(), getCellRangeByPosition(), getRow(), getRowCount(), insertColumns(), optimize(), removeColumns(), removeRows(), UndoInsertColumns(), and UndoRemoveColumns().
|
overridevirtual |
Definition at line 380 of file tablemodel.cxx.
References mxTableRows.
|
inline |
Definition at line 76 of file tablemodel.hxx.
References mpTableObj.
|
overridevirtual |
Implements sdr::table::ICellRange.
Definition at line 202 of file tablemodel.cxx.
|
overridevirtual |
Implements sdr::table::ICellRange.
Definition at line 184 of file tablemodel.cxx.
void sdr::table::TableModel::init | ( | sal_Int32 | nColumns, |
sal_Int32 | nRows | ||
) |
Definition at line 153 of file tablemodel.cxx.
References maColumns, maRows, TableColumn, and TableRow.
Referenced by TableModel().
|
private |
Definition at line 596 of file tablemodel.cxx.
References Exception, getCell(), getRowCountImpl(), SdrObject::getSdrModelFromSdrObject(), SdrObject::IsInserted(), maColumns, maRows, merge(), mpTableObj, setModified(), SvxResId(), TableColumn, TOOLS_WARN_EXCEPTION, and updateColumns().
|
private |
Definition at line 786 of file tablemodel.cxx.
References Exception, getCell(), getColumnCountImpl(), SdrObject::getSdrModelFromSdrObject(), SdrObject::IsInserted(), maRows, merge(), mpTableObj, setModified(), SvxResId(), TableRow, TOOLS_WARN_EXCEPTION, and updateRows().
|
overridevirtual |
Definition at line 334 of file tablemodel.cxx.
References mbModified.
|
overridevirtual |
Definition at line 531 of file tablemodel.cxx.
References mnNotifyLock.
void sdr::table::TableModel::merge | ( | sal_Int32 | nCol, |
sal_Int32 | nRow, | ||
sal_Int32 | nColSpan, | ||
sal_Int32 | nRowSpan | ||
) |
merges the cell at the given position with the given span
Definition at line 1052 of file tablemodel.cxx.
References getCellByPosition(), getColumnCount(), getRowCount(), SdrObject::getSdrModelFromSdrObject(), SdrObject::IsInserted(), and mpTableObj.
Referenced by insertColumns(), and insertRows().
|
private |
Definition at line 551 of file tablemodel.cxx.
References cppu::BaseMutex::m_aMutex, mbNotifyPending, mnNotifyLock, mpTableObj, and cppu::OInterfaceContainerHelper::notifyEach().
Referenced by setModified(), and unlockBroadcasts().
void sdr::table::TableModel::optimize | ( | ) |
deletes rows and columns that are completely merged.
Must be called between BegUndo/EndUndo!
Definition at line 965 of file tablemodel.cxx.
References Any, Exception, getCellByPosition(), getColumnCountImpl(), getRowCountImpl(), maColumns, maRows, removeColumns(), removeRows(), o3tl::saturating_add(), setModified(), TOOLS_WARN_EXCEPTION, and u.
|
private |
Definition at line 674 of file tablemodel.cxx.
References SdrModel::BegUndo(), Exception, getCell(), getColumnCountImpl(), getRowCountImpl(), SdrObject::getSdrModelFromSdrObject(), SdrObject::IsInserted(), maColumns, maRows, mpTableObj, setModified(), SvxResId(), TOOLS_WARN_EXCEPTION, and updateColumns().
Referenced by optimize().
|
overridevirtual |
Definition at line 361 of file tablemodel.cxx.
|
overridevirtual |
Definition at line 451 of file tablemodel.cxx.
|
private |
Definition at line 848 of file tablemodel.cxx.
References Exception, getCell(), getColumnCountImpl(), getRowCountImpl(), SdrObject::getSdrModelFromSdrObject(), SdrObject::IsInserted(), maRows, mpTableObj, setModified(), SvxResId(), TOOLS_WARN_EXCEPTION, and updateRows().
Referenced by optimize().
|
overridevirtual |
Definition at line 461 of file tablemodel.cxx.
|
overridevirtual |
Definition at line 469 of file tablemodel.cxx.
Definition at line 341 of file tablemodel.cxx.
References mbModified, and notifyModification().
Referenced by insertColumns(), insertRows(), optimize(), removeColumns(), removeRows(), UndoInsertColumns(), UndoInsertRows(), UndoRemoveColumns(), and UndoRemoveRows().
|
overridevirtual |
Definition at line 435 of file tablemodel.cxx.
|
private |
Definition at line 235 of file tablemodel.cxx.
References getRowCountImpl(), maColumns, maRows, setModified(), and updateColumns().
|
private |
Definition at line 208 of file tablemodel.cxx.
References maRows, setModified(), and updateRows().
|
private |
Definition at line 250 of file tablemodel.cxx.
References DBG_ASSERT, getRowCountImpl(), maColumns, maRows, nCount, setModified(), and updateColumns().
Definition at line 219 of file tablemodel.cxx.
References maRows, nCount, setModified(), and updateRows().
|
overridevirtual |
Definition at line 538 of file tablemodel.cxx.
References mbNotifyPending, mnNotifyLock, and notifyModification().
|
private |
Definition at line 1105 of file tablemodel.cxx.
References maColumns.
Referenced by insertColumns(), removeColumns(), UndoInsertColumns(), and UndoRemoveColumns().
|
private |
Definition at line 1096 of file tablemodel.cxx.
References maRows.
Referenced by insertRows(), removeRows(), UndoInsertRows(), and UndoRemoveRows().
|
friend |
Definition at line 59 of file tablemodel.hxx.
|
friend |
Definition at line 57 of file tablemodel.hxx.
|
friend |
Definition at line 60 of file tablemodel.hxx.
|
friend |
Definition at line 58 of file tablemodel.hxx.
|
friend |
Definition at line 63 of file tablemodel.hxx.
Referenced by init(), and insertColumns().
|
friend |
Definition at line 66 of file tablemodel.hxx.
|
friend |
Definition at line 61 of file tablemodel.hxx.
|
friend |
Definition at line 67 of file tablemodel.hxx.
|
friend |
Definition at line 64 of file tablemodel.hxx.
Referenced by init(), and insertRows().
|
friend |
Definition at line 65 of file tablemodel.hxx.
|
friend |
Definition at line 62 of file tablemodel.hxx.
|
private |
Definition at line 172 of file tablemodel.hxx.
Referenced by disposing(), getColumn(), getColumnCountImpl(), getColumnWidths(), init(), insertColumns(), optimize(), removeColumns(), TableModel(), UndoInsertColumns(), UndoRemoveColumns(), and updateColumns().
|
private |
Definition at line 171 of file tablemodel.hxx.
Referenced by disposing(), dumpAsXml(), getCell(), getRow(), getRowCountImpl(), init(), insertColumns(), insertRows(), optimize(), removeColumns(), removeRows(), TableModel(), UndoInsertColumns(), UndoInsertRows(), UndoRemoveColumns(), UndoRemoveRows(), and updateRows().
|
private |
Definition at line 179 of file tablemodel.hxx.
Referenced by isModified(), and setModified().
|
private |
Definition at line 180 of file tablemodel.hxx.
Referenced by notifyModification(), and unlockBroadcasts().
|
private |
Definition at line 182 of file tablemodel.hxx.
Referenced by lockBroadcasts(), notifyModification(), and unlockBroadcasts().
|
private |
Definition at line 177 of file tablemodel.hxx.
Referenced by createCell(), disposing(), getSdrTableObj(), insertColumns(), insertRows(), merge(), notifyModification(), removeColumns(), and removeRows().
|
private |
Definition at line 174 of file tablemodel.hxx.
Referenced by disposing(), and getColumns().
|
private |
Definition at line 175 of file tablemodel.hxx.
Referenced by disposing(), and getRows().