LibreOffice Module svx (master) 1
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
sdr::table::TableModel Class Referencefinal

#include <tablemodel.hxx>

Inheritance diagram for sdr::table::TableModel:
[legend]
Collaboration diagram for sdr::table::TableModel:
[legend]

Public Member Functions

 TableModel (SdrTableObj *pTableObj)
 
 TableModel (SdrTableObj *pTableObj, const TableModelRef &xSourceTable)
 
virtual ~TableModel () override
 
void init (sal_Int32 nColumns, sal_Int32 nRows)
 
SdrTableObjgetSdrTableObj () 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< TableColumnsmxTableColumns
 
rtl::Reference< TableRowsmxTableRows
 
SdrTableObjmpTableObj
 
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

- Protected Attributes inherited from cppu::BaseMutex
mutable::osl::Mutex m_aMutex
 

Detailed Description

Definition at line 53 of file tablemodel.hxx.

Constructor & Destructor Documentation

◆ TableModel() [1/2]

sdr::table::TableModel::TableModel ( SdrTableObj pTableObj)
explicit

Definition at line 97 of file tablemodel.cxx.

References m_aMutex.

◆ TableModel() [2/2]

sdr::table::TableModel::TableModel ( SdrTableObj pTableObj,
const TableModelRef xSourceTable 
)

Definition at line 106 of file tablemodel.cxx.

References getCell(), init(), m_aMutex, maColumns, and maRows.

◆ ~TableModel()

sdr::table::TableModel::~TableModel ( )
overridevirtual

Definition at line 142 of file tablemodel.cxx.

Member Function Documentation

◆ addModifyListener()

void SAL_CALL sdr::table::TableModel::addModifyListener ( const css::uno::Reference< css::util::XModifyListener > &  aListener)
overridevirtual

Definition at line 349 of file tablemodel.cxx.

◆ addPropertyChangeListener()

void SAL_CALL sdr::table::TableModel::addPropertyChangeListener ( const OUString &  aPropertyName,
const css::uno::Reference< css::beans::XPropertyChangeListener > &  xListener 
)
overridevirtual

Definition at line 440 of file tablemodel.cxx.

◆ addVetoableChangeListener()

void SAL_CALL sdr::table::TableModel::addVetoableChangeListener ( const OUString &  PropertyName,
const css::uno::Reference< css::beans::XVetoableChangeListener > &  aListener 
)
overridevirtual

Definition at line 450 of file tablemodel.cxx.

◆ createCell()

CellRef sdr::table::TableModel::createCell ( )
private

Definition at line 581 of file tablemodel.cxx.

References sdr::table::SdrTableObj::createCell(), and mpTableObj.

◆ createCursor()

uno::Reference< css::table::XCellCursor > SAL_CALL sdr::table::TableModel::createCursor ( )
overridevirtual

Definition at line 275 of file tablemodel.cxx.

References createCursorByRange().

◆ createCursorByRange()

uno::Reference< css::table::XCellCursor > SAL_CALL sdr::table::TableModel::createCursorByRange ( const css::uno::Reference< css::table::XCellRange > &  rRange)
overridevirtual

Definition at line 282 of file tablemodel.cxx.

References xModel.

Referenced by createCursor().

◆ dispose()

void sdr::table::TableModel::dispose ( void  )
overridevirtual

Definition at line 318 of file tablemodel.cxx.

◆ disposing()

void sdr::table::TableModel::disposing ( )
overrideprivatevirtual

this function is called upon disposing the component

Definition at line 490 of file tablemodel.cxx.

References maColumns, maRows, mpTableObj, mxTableColumns, and mxTableRows.

◆ dumpAsXml()

void sdr::table::TableModel::dumpAsXml ( xmlTextWriterPtr  pWriter) const

Definition at line 1108 of file tablemodel.cxx.

References getColumnCountImpl(), getRowCountImpl(), and maRows.

◆ getBottom()

sal_Int32 sdr::table::TableModel::getBottom ( )
overridevirtual

Definition at line 190 of file tablemodel.cxx.

References getRowCount().

◆ getCell()

CellRef sdr::table::TableModel::getCell ( ::sal_Int32  nCol,
::sal_Int32  nRow 
) const
private

◆ getCellByPosition()

uno::Reference< css::table::XCell > SAL_CALL sdr::table::TableModel::getCellByPosition ( ::sal_Int32  nColumn,
::sal_Int32  nRow 
)
overridevirtual

Definition at line 387 of file tablemodel.cxx.

References getCell().

Referenced by merge(), and optimize().

◆ getCellRangeByName()

uno::Reference< css::table::XCellRange > SAL_CALL sdr::table::TableModel::getCellRangeByName ( const OUString &  aRange)
overridevirtual

Definition at line 413 of file tablemodel.cxx.

◆ getCellRangeByPosition()

uno::Reference< css::table::XCellRange > SAL_CALL sdr::table::TableModel::getCellRangeByPosition ( ::sal_Int32  nLeft,
::sal_Int32  nTop,
::sal_Int32  nRight,
::sal_Int32  nBottom 
)
overridevirtual

Definition at line 399 of file tablemodel.cxx.

References getColumnCountImpl(), getRowCountImpl(), and xModel.

◆ getColumn()

TableColumnRef const & sdr::table::TableModel::getColumn ( sal_Int32  nColumn) const
private
Exceptions
css::lang::IndexOutOfBoundsException

Definition at line 949 of file tablemodel.cxx.

References getColumnCountImpl(), and maColumns.

◆ getColumnCount()

sal_Int32 SAL_CALL sdr::table::TableModel::getColumnCount ( )
override

Definition at line 301 of file tablemodel.cxx.

References getColumnCountImpl().

Referenced by getRight(), and merge().

◆ getColumnCountImpl()

sal_Int32 sdr::table::TableModel::getColumnCountImpl ( ) const
private

◆ getColumns()

uno::Reference< css::table::XTableColumns > SAL_CALL sdr::table::TableModel::getColumns ( )
overridevirtual

Definition at line 364 of file tablemodel.cxx.

References mxTableColumns, and TableColumns.

◆ getColumnWidths()

std::vector< sal_Int32 > sdr::table::TableModel::getColumnWidths ( )

Get the width of all columns in this table.

Definition at line 307 of file tablemodel.cxx.

References maColumns, and xColumn.

◆ getFastPropertyValue()

uno::Any SAL_CALL sdr::table::TableModel::getFastPropertyValue ( ::sal_Int32  nHandle)
overridevirtual

Definition at line 468 of file tablemodel.cxx.

◆ getLeft()

sal_Int32 sdr::table::TableModel::getLeft ( )
overridevirtual

Definition at line 172 of file tablemodel.cxx.

◆ getPropertySetInfo()

uno::Reference< beans::XPropertySetInfo > SAL_CALL sdr::table::TableModel::getPropertySetInfo ( )
overridevirtual

Definition at line 422 of file tablemodel.cxx.

◆ getPropertyValue()

uno::Any SAL_CALL sdr::table::TableModel::getPropertyValue ( const OUString &  PropertyName)
overridevirtual

Definition at line 434 of file tablemodel.cxx.

◆ getRight()

sal_Int32 sdr::table::TableModel::getRight ( )
overridevirtual

Definition at line 184 of file tablemodel.cxx.

References getColumnCount().

◆ getRow()

TableRowRef const & sdr::table::TableModel::getRow ( sal_Int32  nRow) const
private
Exceptions
css::lang::IndexOutOfBoundsException

Definition at line 940 of file tablemodel.cxx.

References getRowCountImpl(), and maRows.

◆ getRowCount()

sal_Int32 SAL_CALL sdr::table::TableModel::getRowCount ( )
override

Definition at line 295 of file tablemodel.cxx.

References getRowCountImpl().

Referenced by getBottom(), and merge().

◆ getRowCountImpl()

sal_Int32 sdr::table::TableModel::getRowCountImpl ( ) const
private

◆ getRows()

uno::Reference< css::table::XTableRows > SAL_CALL sdr::table::TableModel::getRows ( )
overridevirtual

Definition at line 374 of file tablemodel.cxx.

References mxTableRows, and TableRows.

◆ getSdrTableObj()

SdrTableObj * sdr::table::TableModel::getSdrTableObj ( ) const
inline

Definition at line 76 of file tablemodel.hxx.

References mpTableObj.

◆ getTable()

uno::Reference< css::table::XTable > sdr::table::TableModel::getTable ( )
overridevirtual

Definition at line 196 of file tablemodel.cxx.

◆ getTop()

sal_Int32 sdr::table::TableModel::getTop ( )
overridevirtual

Definition at line 178 of file tablemodel.cxx.

◆ init()

void sdr::table::TableModel::init ( sal_Int32  nColumns,
sal_Int32  nRows 
)

Definition at line 147 of file tablemodel.cxx.

References maColumns, maRows, TableColumn, and TableRow.

Referenced by TableModel().

◆ insertColumns()

void sdr::table::TableModel::insertColumns ( sal_Int32  nIndex,
sal_Int32  nCount 
)
private

◆ insertRows()

void sdr::table::TableModel::insertRows ( sal_Int32  nIndex,
sal_Int32  nCount 
)
private

◆ isModified()

sal_Bool SAL_CALL sdr::table::TableModel::isModified ( )
overridevirtual

Definition at line 328 of file tablemodel.cxx.

References mbModified.

◆ lockBroadcasts()

void sdr::table::TableModel::lockBroadcasts ( )
overridevirtual

Definition at line 525 of file tablemodel.cxx.

References mnNotifyLock.

◆ merge()

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 1046 of file tablemodel.cxx.

References get(), getCellByPosition(), getColumnCount(), getRowCount(), SdrObject::getSdrModelFromSdrObject(), SdrObject::IsInserted(), SdrModel::IsUndoEnabled(), and mpTableObj.

Referenced by insertColumns(), and insertRows().

◆ notifyModification()

void sdr::table::TableModel::notifyModification ( )
private

◆ optimize()

void sdr::table::TableModel::optimize ( )

deletes rows and columns that are completely merged.

Must be called between BegUndo/EndUndo!

Definition at line 959 of file tablemodel.cxx.

References get(), getCellByPosition(), getColumnCountImpl(), getRowCountImpl(), maColumns, maRows, removeColumns(), removeRows(), o3tl::saturating_add(), setModified(), TOOLS_WARN_EXCEPTION, and u.

◆ removeColumns()

void sdr::table::TableModel::removeColumns ( sal_Int32  nIndex,
sal_Int32  nCount 
)
private

◆ removeModifyListener()

void SAL_CALL sdr::table::TableModel::removeModifyListener ( const css::uno::Reference< css::util::XModifyListener > &  aListener)
overridevirtual

Definition at line 355 of file tablemodel.cxx.

◆ removePropertyChangeListener()

void SAL_CALL sdr::table::TableModel::removePropertyChangeListener ( const OUString &  aPropertyName,
const css::uno::Reference< css::beans::XPropertyChangeListener > &  aListener 
)
overridevirtual

Definition at line 445 of file tablemodel.cxx.

◆ removeRows()

void sdr::table::TableModel::removeRows ( sal_Int32  nIndex,
sal_Int32  nCount 
)
private

◆ removeVetoableChangeListener()

void SAL_CALL sdr::table::TableModel::removeVetoableChangeListener ( const OUString &  PropertyName,
const css::uno::Reference< css::beans::XVetoableChangeListener > &  aListener 
)
overridevirtual

Definition at line 455 of file tablemodel.cxx.

◆ setFastPropertyValue()

void SAL_CALL sdr::table::TableModel::setFastPropertyValue ( ::sal_Int32  nHandle,
const css::uno::Any &  aValue 
)
overridevirtual

Definition at line 463 of file tablemodel.cxx.

◆ setModified()

void SAL_CALL sdr::table::TableModel::setModified ( sal_Bool  bModified)
overridevirtual

◆ setPropertyValue()

void SAL_CALL sdr::table::TableModel::setPropertyValue ( const OUString &  aPropertyName,
const css::uno::Any &  aValue 
)
overridevirtual

Definition at line 429 of file tablemodel.cxx.

◆ UndoInsertColumns()

void sdr::table::TableModel::UndoInsertColumns ( sal_Int32  nIndex,
sal_Int32  nCount 
)
private

Definition at line 229 of file tablemodel.cxx.

References getRowCountImpl(), maColumns, maRows, nCount, nIndex, setModified(), and updateColumns().

◆ UndoInsertRows()

void sdr::table::TableModel::UndoInsertRows ( sal_Int32  nIndex,
sal_Int32  nCount 
)
private

Definition at line 202 of file tablemodel.cxx.

References maRows, nCount, nIndex, setModified(), and updateRows().

◆ UndoRemoveColumns()

void sdr::table::TableModel::UndoRemoveColumns ( sal_Int32  nIndex,
ColumnVector aNewCols,
CellVector aCells 
)
private

◆ UndoRemoveRows()

void sdr::table::TableModel::UndoRemoveRows ( sal_Int32  nIndex,
RowVector aNewRows 
)
private

Definition at line 213 of file tablemodel.cxx.

References maRows, nCount, nIndex, setModified(), and updateRows().

◆ unlockBroadcasts()

void sdr::table::TableModel::unlockBroadcasts ( )
overridevirtual

Definition at line 532 of file tablemodel.cxx.

References mbNotifyPending, mnNotifyLock, and notifyModification().

◆ updateColumns()

void sdr::table::TableModel::updateColumns ( )
private

Definition at line 1099 of file tablemodel.cxx.

References maColumns.

Referenced by insertColumns(), removeColumns(), UndoInsertColumns(), and UndoRemoveColumns().

◆ updateRows()

void sdr::table::TableModel::updateRows ( )
private

Definition at line 1090 of file tablemodel.cxx.

References maRows.

Referenced by insertRows(), removeRows(), UndoInsertRows(), and UndoRemoveRows().

Friends And Related Function Documentation

◆ InsertColUndo

friend class InsertColUndo
friend

Definition at line 59 of file tablemodel.hxx.

◆ InsertRowUndo

friend class InsertRowUndo
friend

Definition at line 57 of file tablemodel.hxx.

◆ RemoveColUndo

friend class RemoveColUndo
friend

Definition at line 60 of file tablemodel.hxx.

◆ RemoveRowUndo

friend class RemoveRowUndo
friend

Definition at line 58 of file tablemodel.hxx.

◆ TableColumn

friend class TableColumn
friend

Definition at line 63 of file tablemodel.hxx.

Referenced by init(), and insertColumns().

◆ TableColumns

friend class TableColumns
friend

Definition at line 66 of file tablemodel.hxx.

Referenced by getColumns().

◆ TableColumnUndo

friend class TableColumnUndo
friend

Definition at line 61 of file tablemodel.hxx.

◆ TableModelNotifyGuard

friend class TableModelNotifyGuard
friend

Definition at line 67 of file tablemodel.hxx.

◆ TableRow

friend class TableRow
friend

Definition at line 64 of file tablemodel.hxx.

Referenced by init(), and insertRows().

◆ TableRows

friend class TableRows
friend

Definition at line 65 of file tablemodel.hxx.

Referenced by getRows().

◆ TableRowUndo

friend class TableRowUndo
friend

Definition at line 62 of file tablemodel.hxx.

Member Data Documentation

◆ maColumns

ColumnVector sdr::table::TableModel::maColumns
private

◆ maRows

RowVector sdr::table::TableModel::maRows
private

◆ mbModified

bool sdr::table::TableModel::mbModified
private

Definition at line 179 of file tablemodel.hxx.

Referenced by isModified(), and setModified().

◆ mbNotifyPending

bool sdr::table::TableModel::mbNotifyPending
private

Definition at line 180 of file tablemodel.hxx.

Referenced by notifyModification(), and unlockBroadcasts().

◆ mnNotifyLock

sal_Int32 sdr::table::TableModel::mnNotifyLock
private

Definition at line 182 of file tablemodel.hxx.

Referenced by lockBroadcasts(), notifyModification(), and unlockBroadcasts().

◆ mpTableObj

SdrTableObj* sdr::table::TableModel::mpTableObj
private

◆ mxTableColumns

rtl::Reference< TableColumns > sdr::table::TableModel::mxTableColumns
private

Definition at line 174 of file tablemodel.hxx.

Referenced by disposing(), and getColumns().

◆ mxTableRows

rtl::Reference< TableRows > sdr::table::TableModel::mxTableRows
private

Definition at line 175 of file tablemodel.hxx.

Referenced by disposing(), and getRows().


The documentation for this class was generated from the following files: