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

#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
 

Protected 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)
 
- Protected Member Functions inherited from sdr::table::ICellRange
 ~ICellRange ()
 

Private Member Functions

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

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

Definition at line 103 of file tablemodel.cxx.

References m_aMutex.

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

Definition at line 112 of file tablemodel.cxx.

References getCell(), init(), m_aMutex, maColumns, maRows, and svx::nColCount.

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

Definition at line 148 of file tablemodel.cxx.

Member Function Documentation

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

Definition at line 355 of file tablemodel.cxx.

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

Definition at line 446 of file tablemodel.cxx.

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

Definition at line 456 of file tablemodel.cxx.

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

Definition at line 587 of file tablemodel.cxx.

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

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

Definition at line 281 of file tablemodel.cxx.

References createCursorByRange().

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

Definition at line 324 of file tablemodel.cxx.

void sdr::table::TableModel::disposing ( )
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 1105 of file tablemodel.cxx.

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

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

Implements sdr::table::ICellRange.

Definition at line 196 of file tablemodel.cxx.

References getRowCount().

CellRef sdr::table::TableModel::getCell ( ::sal_Int32  nCol,
::sal_Int32  nRow 
) const
protected
Reference< XCell > SAL_CALL sdr::table::TableModel::getCellByPosition ( ::sal_Int32  nColumn,
::sal_Int32  nRow 
)
overridevirtual

Definition at line 393 of file tablemodel.cxx.

References getCell().

Referenced by merge(), and optimize().

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

Definition at line 419 of file tablemodel.cxx.

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

Definition at line 405 of file tablemodel.cxx.

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

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

Definition at line 946 of file tablemodel.cxx.

References getColumnCountImpl(), and maColumns.

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

Definition at line 307 of file tablemodel.cxx.

References getColumnCountImpl().

Referenced by getRight(), and merge().

sal_Int32 sdr::table::TableModel::getColumnCountImpl ( ) const
protected
Reference< XTableColumns > SAL_CALL sdr::table::TableModel::getColumns ( )
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.

References maColumns, and xColumn.

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

Definition at line 474 of file tablemodel.cxx.

References Any.

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

Implements sdr::table::ICellRange.

Definition at line 178 of file tablemodel.cxx.

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

Definition at line 428 of file tablemodel.cxx.

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

Definition at line 440 of file tablemodel.cxx.

References Any.

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

Implements sdr::table::ICellRange.

Definition at line 190 of file tablemodel.cxx.

References getColumnCount().

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

Definition at line 937 of file tablemodel.cxx.

References getRowCountImpl(), and maRows.

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

Definition at line 301 of file tablemodel.cxx.

References getRowCountImpl().

Referenced by getBottom(), and merge().

sal_Int32 sdr::table::TableModel::getRowCountImpl ( ) const
protected
Reference< XTableRows > SAL_CALL sdr::table::TableModel::getRows ( )
overridevirtual

Definition at line 380 of file tablemodel.cxx.

References mxTableRows.

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

Definition at line 76 of file tablemodel.hxx.

References mpTableObj.

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

Implements sdr::table::ICellRange.

Definition at line 202 of file tablemodel.cxx.

sal_Int32 sdr::table::TableModel::getTop ( )
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().

void sdr::table::TableModel::insertColumns ( sal_Int32  nIndex,
sal_Int32  nCount 
)
protected
void sdr::table::TableModel::insertRows ( sal_Int32  nIndex,
sal_Int32  nCount 
)
protected
sal_Bool SAL_CALL sdr::table::TableModel::isModified ( )
overridevirtual

Definition at line 334 of file tablemodel.cxx.

References mbModified.

void sdr::table::TableModel::lockBroadcasts ( )
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 1043 of file tablemodel.cxx.

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

Referenced by insertColumns(), and insertRows().

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

deletes rows and columns that are completely merged.

Must be called between BegUndo/EndUndo!

Definition at line 956 of file tablemodel.cxx.

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

void sdr::table::TableModel::removeColumns ( sal_Int32  nIndex,
sal_Int32  nCount 
)
protected
void SAL_CALL sdr::table::TableModel::removeModifyListener ( const css::uno::Reference< css::util::XModifyListener > &  aListener)
overridevirtual

Definition at line 361 of file tablemodel.cxx.

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

Definition at line 451 of file tablemodel.cxx.

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

Definition at line 461 of file tablemodel.cxx.

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

Definition at line 469 of file tablemodel.cxx.

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

Definition at line 435 of file tablemodel.cxx.

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

Definition at line 235 of file tablemodel.cxx.

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

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

Definition at line 208 of file tablemodel.cxx.

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

void sdr::table::TableModel::UndoRemoveColumns ( sal_Int32  nIndex,
ColumnVector aNewCols,
CellVector aCells 
)
protected
void sdr::table::TableModel::UndoRemoveRows ( sal_Int32  nIndex,
RowVector aNewRows 
)
protected

Definition at line 219 of file tablemodel.cxx.

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

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

Definition at line 538 of file tablemodel.cxx.

References mbNotifyPending, mnNotifyLock, and notifyModification().

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

Definition at line 1096 of file tablemodel.cxx.

References maColumns.

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

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

Definition at line 1087 of file tablemodel.cxx.

References maRows.

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

Friends And Related Function Documentation

friend class InsertColUndo
friend

Definition at line 59 of file tablemodel.hxx.

friend class InsertRowUndo
friend

Definition at line 57 of file tablemodel.hxx.

friend class RemoveColUndo
friend

Definition at line 60 of file tablemodel.hxx.

friend class RemoveRowUndo
friend

Definition at line 58 of file tablemodel.hxx.

friend class TableColumn
friend

Definition at line 63 of file tablemodel.hxx.

Referenced by init(), and insertColumns().

friend class TableColumns
friend

Definition at line 66 of file tablemodel.hxx.

friend class TableColumnUndo
friend

Definition at line 61 of file tablemodel.hxx.

friend class TableModelNotifyGuard
friend

Definition at line 67 of file tablemodel.hxx.

friend class TableRow
friend

Definition at line 64 of file tablemodel.hxx.

Referenced by init(), and insertRows().

friend class TableRows
friend

Definition at line 65 of file tablemodel.hxx.

friend class TableRowUndo
friend

Definition at line 62 of file tablemodel.hxx.

Member Data Documentation

ColumnVector sdr::table::TableModel::maColumns
private
RowVector sdr::table::TableModel::maRows
private
bool sdr::table::TableModel::mbModified
private

Definition at line 179 of file tablemodel.hxx.

Referenced by isModified(), and setModified().

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

Definition at line 180 of file tablemodel.hxx.

Referenced by notifyModification(), and unlockBroadcasts().

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

Definition at line 182 of file tablemodel.hxx.

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

SdrTableObj* sdr::table::TableModel::mpTableObj
private
rtl::Reference< TableColumns > sdr::table::TableModel::mxTableColumns
private

Definition at line 174 of file tablemodel.hxx.

Referenced by disposing(), and getColumns().

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: