toolkit: Drop RowPos and ColPos typedefs for sal_Int32
Those are partially used in TableControl_Impl and elsewhere. On the other hand, TableControl uses sal_Int32 directly, i.e. the TableControl methods using sal_Int32 call the TableControl_Impl equivalents using the typedefs. Unify this to consistently use sal_Int32 directly. This will also make merging TableControl and TableControl_Impl more straightforward, which is planned for an upcoming commit. Change-Id: I96c83bcd69ad84012194865f19ad0fc507f11e1e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211157 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
This commit is contained in:
@@ -32,7 +32,7 @@ class TableFunctionSet : public FunctionSet
|
||||
{
|
||||
private:
|
||||
TableControl_Impl* m_pTableControl;
|
||||
RowPos m_nCurrentRow;
|
||||
sal_Int32 m_nCurrentRow;
|
||||
|
||||
public:
|
||||
explicit TableFunctionSet(TableControl_Impl* _pTableControl);
|
||||
|
||||
@@ -69,19 +69,18 @@ namespace svt::table
|
||||
vcl::RenderContext& _rDevice, const tools::Rectangle& _rArea,
|
||||
bool _bIsColHeaderArea, bool _bIsRowHeaderArea,
|
||||
const StyleSettings& _rStyle ) override;
|
||||
virtual void PaintColumnHeader( ColPos _nCol,
|
||||
vcl::RenderContext& _rDevice, const tools::Rectangle& _rArea,
|
||||
const StyleSettings& _rStyle ) override;
|
||||
virtual void PrepareRow( RowPos _nRow, bool i_hasControlFocus, bool _bSelected,
|
||||
vcl::RenderContext& _rDevice, const tools::Rectangle& _rRowArea,
|
||||
const StyleSettings& _rStyle ) override;
|
||||
virtual void PaintColumnHeader(sal_Int32 _nCol, vcl::RenderContext& _rDevice,
|
||||
const tools::Rectangle& _rArea,
|
||||
const StyleSettings& _rStyle) override;
|
||||
virtual void PrepareRow(sal_Int32 _nRow, bool i_hasControlFocus, bool _bSelected,
|
||||
vcl::RenderContext& _rDevice, const tools::Rectangle& _rRowArea,
|
||||
const StyleSettings& _rStyle) override;
|
||||
virtual void PaintRowHeader(
|
||||
vcl::RenderContext& _rDevice, const tools::Rectangle& _rArea,
|
||||
const StyleSettings& _rStyle ) override;
|
||||
virtual void PaintCell( ColPos const i_col,
|
||||
bool i_hasControlFocus, bool _bSelected,
|
||||
vcl::RenderContext& _rDevice, const tools::Rectangle& _rArea,
|
||||
const StyleSettings& _rStyle ) override;
|
||||
virtual void PaintCell(sal_Int32 const i_col, bool i_hasControlFocus, bool _bSelected,
|
||||
vcl::RenderContext& _rDevice, const tools::Rectangle& _rArea,
|
||||
const StyleSettings& _rStyle) override;
|
||||
virtual void ShowCellCursor( vcl::Window& _rView, const tools::Rectangle& _rCursorRect) override;
|
||||
virtual void HideCellCursor( vcl::Window& _rView ) override;
|
||||
virtual bool FitsIntoCell(
|
||||
|
||||
@@ -82,7 +82,7 @@ public:
|
||||
MouseEvent const& i_event) override;
|
||||
|
||||
private:
|
||||
ColPos m_nResizingColumn;
|
||||
sal_Int32 m_nResizingColumn;
|
||||
};
|
||||
|
||||
//= RowSelection
|
||||
@@ -128,7 +128,7 @@ public:
|
||||
MouseEvent const& i_event) override;
|
||||
|
||||
private:
|
||||
ColPos m_nActiveColumn;
|
||||
sal_Int32 m_nActiveColumn;
|
||||
};
|
||||
|
||||
} // namespace svt::table
|
||||
|
||||
@@ -104,10 +104,10 @@ private:
|
||||
/// the number of rows in the table control. Cached model value.
|
||||
TableSize m_nRowCount;
|
||||
|
||||
ColPos m_nCurColumn;
|
||||
RowPos m_nCurRow;
|
||||
ColPos m_nLeftColumn;
|
||||
RowPos m_nTopRow;
|
||||
sal_Int32 m_nCurColumn;
|
||||
sal_Int32 m_nCurRow;
|
||||
sal_Int32 m_nLeftColumn;
|
||||
sal_Int32 m_nTopRow;
|
||||
|
||||
sal_Int32 m_nCursorHidden;
|
||||
|
||||
@@ -125,11 +125,11 @@ private:
|
||||
//selection engine - for determining selection range, e.g. single, multiple
|
||||
std::unique_ptr<SelectionEngine> m_pSelEngine;
|
||||
//vector which contains the selected rows
|
||||
std::vector<RowPos> m_aSelectedRows;
|
||||
std::vector<sal_Int32> m_aSelectedRows;
|
||||
//part of selection engine
|
||||
std::unique_ptr<TableFunctionSet> m_pTableFunctionSet;
|
||||
//part of selection engine
|
||||
RowPos m_nAnchor;
|
||||
sal_Int32 m_nAnchor;
|
||||
bool m_bUpdatingColWidths;
|
||||
|
||||
rtl::Reference<accessibility::AccessibleGridControl> m_xAccessibleTable;
|
||||
@@ -139,13 +139,13 @@ public:
|
||||
|
||||
const PTableInputHandler& getInputHandler() const { return m_pInputHandler; }
|
||||
|
||||
RowPos getCurRow() const { return m_nCurRow; }
|
||||
sal_Int32 getCurRow() const { return m_nCurRow; }
|
||||
|
||||
RowPos getAnchor() const { return m_nAnchor; }
|
||||
void setAnchor(RowPos const i_anchor) { m_nAnchor = i_anchor; }
|
||||
sal_Int32 getAnchor() const { return m_nAnchor; }
|
||||
void setAnchor(sal_Int32 const i_anchor) { m_nAnchor = i_anchor; }
|
||||
|
||||
RowPos getTopRow() const { return m_nTopRow; }
|
||||
ColPos getLeftColumn() const { return m_nLeftColumn; }
|
||||
sal_Int32 getTopRow() const { return m_nTopRow; }
|
||||
sal_Int32 getLeftColumn() const { return m_nLeftColumn; }
|
||||
|
||||
const TableControl& getAntiImpl() const { return m_rAntiImpl; }
|
||||
TableControl& getAntiImpl() { return m_rAntiImpl; }
|
||||
@@ -166,7 +166,7 @@ public:
|
||||
To ease the caller's code, the coordinates must not necessarily denote a
|
||||
valid position. If they don't, <FALSE/> will be returned.
|
||||
*/
|
||||
bool goTo(ColPos _nColumn, RowPos _nRow);
|
||||
bool goTo(sal_Int32 _nColumn, sal_Int32 _nRow);
|
||||
|
||||
/** ensures that the given coordinate is visible
|
||||
@param _nColumn
|
||||
@@ -176,19 +176,20 @@ public:
|
||||
the row position which should be visibleMust be non-negative, and smaller
|
||||
than the row count.
|
||||
*/
|
||||
void ensureVisible(ColPos _nColumn, RowPos _nRow);
|
||||
void ensureVisible(sal_Int32 _nColumn, sal_Int32 _nRow);
|
||||
|
||||
/** retrieves the content of the given cell, converted to a string
|
||||
*/
|
||||
OUString getCellContentAsString(RowPos const i_row, ColPos const i_col);
|
||||
OUString getCellContentAsString(sal_Int32 const i_row, sal_Int32 const i_col);
|
||||
|
||||
/** returns the position of the current row in the selection vector */
|
||||
static int getRowSelectedNumber(const ::std::vector<RowPos>& selectedRows, RowPos current);
|
||||
static int getRowSelectedNumber(const ::std::vector<sal_Int32>& selectedRows,
|
||||
sal_Int32 current);
|
||||
|
||||
void invalidateRect(const tools::Rectangle& rInvalidateRect);
|
||||
|
||||
/** ??? */
|
||||
void invalidateSelectedRegion(RowPos _nPrevRow, RowPos _nCurRow);
|
||||
void invalidateSelectedRegion(sal_Int32 _nPrevRow, sal_Int32 _nCurRow);
|
||||
|
||||
/** invalidates the part of the data window which is covered by the given rows
|
||||
@param i_firstRow
|
||||
@@ -197,10 +198,10 @@ public:
|
||||
the index of the last row to include in the invalidation, or ROW_INVALID if the invalidation
|
||||
should happen down to the bottom of the data window.
|
||||
*/
|
||||
void invalidateRowRange(RowPos const i_firstRow, RowPos const i_lastRow);
|
||||
void invalidateRowRange(sal_Int32 const i_firstRow, sal_Int32 const i_lastRow);
|
||||
|
||||
/** invalidates the part of the data window which is covered by the given row */
|
||||
void invalidateRow(RowPos const i_row) { invalidateRowRange(i_row, i_row); }
|
||||
void invalidateRow(sal_Int32 const i_row) { invalidateRowRange(i_row, i_row); }
|
||||
|
||||
/** invalidates all selected rows */
|
||||
void invalidateSelectedRows();
|
||||
@@ -217,20 +218,20 @@ public:
|
||||
|
||||
bool hasRowSelection() const { return !m_aSelectedRows.empty(); }
|
||||
size_t getSelectedRowCount() const { return m_aSelectedRows.size(); }
|
||||
RowPos getSelectedRowIndex(size_t const i_selectionIndex) const;
|
||||
sal_Int32 getSelectedRowIndex(size_t const i_selectionIndex) const;
|
||||
|
||||
/** removes the given row index from m_aSelectedRows
|
||||
|
||||
@return
|
||||
<TRUE/> if and only if the row was previously marked as selected
|
||||
*/
|
||||
bool markRowAsDeselected(RowPos const i_rowIndex);
|
||||
bool markRowAsDeselected(sal_Int32 const i_rowIndex);
|
||||
|
||||
/** marks the given row as selected, by putting it into m_aSelectedRows
|
||||
@return
|
||||
<TRUE/> if and only if the row was previously <em>not</em> marked as selected
|
||||
*/
|
||||
bool markRowAsSelected(RowPos const i_rowIndex);
|
||||
bool markRowAsSelected(sal_Int32 const i_rowIndex);
|
||||
|
||||
/** marks all rows as deselected
|
||||
@return
|
||||
@@ -288,13 +289,13 @@ public:
|
||||
PTableModel getModel() const;
|
||||
|
||||
/// returns the index of the currently active column
|
||||
ColPos getCurrentColumn() const;
|
||||
sal_Int32 getCurrentColumn() const;
|
||||
|
||||
/// returns the index of the currently active row
|
||||
RowPos getCurrentRow() const;
|
||||
sal_Int32 getCurrentRow() const;
|
||||
|
||||
/// activates the given cell
|
||||
void activateCell(ColPos const i_col, RowPos const i_row);
|
||||
void activateCell(sal_Int32 const i_col, sal_Int32 const i_row);
|
||||
|
||||
/// retrieves the size of the table window, in pixels
|
||||
Size getTableSizePixel() const;
|
||||
@@ -320,17 +321,17 @@ public:
|
||||
/// shows a tracking rectangle
|
||||
void showTracking(tools::Rectangle const& i_location, ShowTrackFlags const i_flags);
|
||||
|
||||
RowPos getRowAtPoint(const Point& rPoint) const;
|
||||
ColPos getColAtPoint(const Point& rPoint) const;
|
||||
sal_Int32 getRowAtPoint(const Point& rPoint) const;
|
||||
sal_Int32 getColAtPoint(const Point& rPoint) const;
|
||||
|
||||
/// does a hit test for the given pixel coordinates
|
||||
TableCell hitTest(const Point& rPoint) const;
|
||||
|
||||
/// retrieves the metrics for a given column
|
||||
ColumnMetrics getColumnMetrics(ColPos const i_column) const;
|
||||
ColumnMetrics getColumnMetrics(sal_Int32 const i_column) const;
|
||||
|
||||
/// determines whether a given row is selected
|
||||
bool isRowSelected(RowPos i_row) const;
|
||||
bool isRowSelected(sal_Int32 i_row) const;
|
||||
|
||||
void selectRow(sal_Int32 nRowIndex, bool bSelect);
|
||||
void selectAllRows(bool bSelect);
|
||||
@@ -361,13 +362,13 @@ public:
|
||||
sal_uInt16 nColumnPos) const;
|
||||
|
||||
// ITableModelListener
|
||||
virtual void rowsInserted(RowPos first, RowPos last) override;
|
||||
virtual void rowsRemoved(RowPos first, RowPos last) override;
|
||||
virtual void rowsInserted(sal_Int32 first, sal_Int32 last) override;
|
||||
virtual void rowsRemoved(sal_Int32 first, sal_Int32 last) override;
|
||||
virtual void columnInserted() override;
|
||||
virtual void columnRemoved() override;
|
||||
virtual void allColumnsRemoved() override;
|
||||
virtual void cellsUpdated(RowPos const i_firstRow, RowPos const i_lastRow) override;
|
||||
virtual void columnChanged(ColPos const i_column,
|
||||
virtual void cellsUpdated(sal_Int32 const i_firstRow, sal_Int32 const i_lastRow) override;
|
||||
virtual void columnChanged(sal_Int32 const i_column,
|
||||
ColumnAttributeGroup const i_attributeGroup) override;
|
||||
virtual void tableMetricsChanged() override;
|
||||
|
||||
@@ -422,7 +423,7 @@ private:
|
||||
the index of a column up to which all columns should be considered as inflexible, or
|
||||
<code>COL_INVALID</code>.
|
||||
*/
|
||||
void impl_ni_relayout(ColPos const i_assumeInflexibleColumnsUpToIncluding = COL_INVALID);
|
||||
void impl_ni_relayout(sal_Int32 const i_assumeInflexibleColumnsUpToIncluding = COL_INVALID);
|
||||
|
||||
/** calculates the new width of our columns, taking into account their min and max widths, and their relative
|
||||
flexibility.
|
||||
@@ -440,7 +441,7 @@ private:
|
||||
the overall width of the grid, which is available for columns
|
||||
*/
|
||||
tools::Long
|
||||
impl_ni_calculateColumnWidths(ColPos const i_assumeInflexibleColumnsUpToIncluding,
|
||||
impl_ni_calculateColumnWidths(sal_Int32 const i_assumeInflexibleColumnsUpToIncluding,
|
||||
bool const i_assumeVerticalScrollbar,
|
||||
::std::vector<tools::Long>& o_newColWidthsPixel) const;
|
||||
|
||||
@@ -498,14 +499,14 @@ private:
|
||||
tools::Rectangle impl_getAllVisibleDataCellArea() const;
|
||||
|
||||
/** retrieves the column which covers the given ordinate */
|
||||
ColPos impl_getColumnForOrdinate(tools::Long const i_ordinate) const;
|
||||
sal_Int32 impl_getColumnForOrdinate(tools::Long const i_ordinate) const;
|
||||
|
||||
/** retrieves the row which covers the given abscissa
|
||||
*/
|
||||
RowPos impl_getRowForAbscissa(tools::Long const i_abscissa) const;
|
||||
sal_Int32 impl_getRowForAbscissa(tools::Long const i_abscissa) const;
|
||||
|
||||
/// invalidates the window area occupied by the given column
|
||||
void impl_invalidateColumn(ColPos const i_column);
|
||||
void impl_invalidateColumn(sal_Int32 const i_column);
|
||||
|
||||
DECL_LINK(OnScroll, ScrollBar*, void);
|
||||
DECL_LINK(OnUpdateScrollbars, void*, void);
|
||||
|
||||
@@ -81,11 +81,11 @@ namespace svt::table
|
||||
|
||||
struct TableCell
|
||||
{
|
||||
ColPos nColumn;
|
||||
RowPos nRow;
|
||||
sal_Int32 nColumn;
|
||||
sal_Int32 nRow;
|
||||
TableCellArea eArea;
|
||||
|
||||
TableCell( ColPos const i_column, RowPos const i_row )
|
||||
TableCell( sal_Int32 const i_column, sal_Int32 const i_row )
|
||||
:nColumn( i_column )
|
||||
,nRow( i_row )
|
||||
,eArea( CellContent )
|
||||
|
||||
@@ -90,7 +90,7 @@ namespace svt::table
|
||||
the index of the last newly inserted row. Must not be smaller
|
||||
than ->first
|
||||
*/
|
||||
virtual void rowsInserted( RowPos first, RowPos last ) = 0;
|
||||
virtual void rowsInserted(sal_Int32 first, sal_Int32 last) = 0;
|
||||
|
||||
/** notifies the listener that one or more rows have been removed from
|
||||
the table
|
||||
@@ -102,7 +102,7 @@ namespace svt::table
|
||||
the old index of the last removed row. Must not be smaller
|
||||
than ->first
|
||||
*/
|
||||
virtual void rowsRemoved( RowPos first, RowPos last ) = 0;
|
||||
virtual void rowsRemoved(sal_Int32 first, sal_Int32 last) = 0;
|
||||
|
||||
/** notifies the listener that one or more columns have been inserted into
|
||||
the table
|
||||
@@ -125,7 +125,7 @@ namespace svt::table
|
||||
they have about the cells in question, in particular any possibly
|
||||
cached cell values.
|
||||
*/
|
||||
virtual void cellsUpdated( RowPos const i_firstRow, RowPos const i_lastRow ) = 0;
|
||||
virtual void cellsUpdated(sal_Int32 const i_firstRow, sal_Int32 const i_lastRow) = 0;
|
||||
|
||||
/** notifies the listener that attributes of a given column changed
|
||||
|
||||
@@ -135,7 +135,9 @@ namespace svt::table
|
||||
a combination of one or more <code>COL_ATTRS_*</code> flags, denoting the attribute group(s)
|
||||
in which changes occurred.
|
||||
*/
|
||||
virtual void columnChanged( ColPos const i_column, ColumnAttributeGroup const i_attributeGroup ) = 0;
|
||||
virtual void columnChanged(sal_Int32 const i_column,
|
||||
ColumnAttributeGroup const i_attributeGroup)
|
||||
= 0;
|
||||
|
||||
/** notifies the listener that the metrics of the table changed.
|
||||
|
||||
@@ -275,7 +277,7 @@ namespace svt::table
|
||||
@return
|
||||
the model of the column in question. Must not be <NULL/>
|
||||
*/
|
||||
virtual PColumnModel getColumnModel( ColPos column ) = 0;
|
||||
virtual PColumnModel getColumnModel(sal_Int32 column) = 0;
|
||||
|
||||
/** returns a renderer which is able to paint the table represented
|
||||
by this table model
|
||||
@@ -338,7 +340,9 @@ namespace svt::table
|
||||
|
||||
/** retrieves the content of the given cell
|
||||
*/
|
||||
virtual void getCellContent( ColPos const i_col, RowPos const i_row, css::uno::Any& o_cellContent ) = 0;
|
||||
virtual void getCellContent(sal_Int32 const i_col, sal_Int32 const i_row,
|
||||
css::uno::Any& o_cellContent)
|
||||
= 0;
|
||||
|
||||
/** returns an object which should be displayed as tooltip for the given cell
|
||||
|
||||
@@ -355,11 +359,13 @@ namespace svt::table
|
||||
@param o_cellToolTip
|
||||
takes the tooltip object upon return.
|
||||
*/
|
||||
virtual void getCellToolTip( ColPos const i_col, RowPos const i_row, css::uno::Any & o_cellToolTip ) = 0;
|
||||
virtual void getCellToolTip(sal_Int32 const i_col, sal_Int32 const i_row,
|
||||
css::uno::Any& o_cellToolTip)
|
||||
= 0;
|
||||
|
||||
/** retrieves title of a given row
|
||||
*/
|
||||
virtual css::uno::Any getRowHeading( RowPos const i_rowPos ) const = 0;
|
||||
virtual css::uno::Any getRowHeading(sal_Int32 const i_rowPos) const = 0;
|
||||
|
||||
/** returns the color to be used for rendering the grid lines.
|
||||
|
||||
|
||||
@@ -106,9 +106,9 @@ namespace svt::table
|
||||
@param _rStyle
|
||||
the style to be used for drawing
|
||||
*/
|
||||
virtual void PaintColumnHeader( ColPos _nCol,
|
||||
vcl::RenderContext& _rDevice, const tools::Rectangle& _rArea,
|
||||
const StyleSettings& _rStyle ) = 0;
|
||||
virtual void PaintColumnHeader(sal_Int32 _nCol, vcl::RenderContext& _rDevice,
|
||||
const tools::Rectangle& _rArea, const StyleSettings& _rStyle)
|
||||
= 0;
|
||||
|
||||
/** prepares a row for painting
|
||||
|
||||
@@ -141,9 +141,10 @@ namespace svt::table
|
||||
@param _rStyle
|
||||
the style to be used for drawing
|
||||
*/
|
||||
virtual void PrepareRow( RowPos _nRow, bool i_hasControlFocus, bool _bSelected,
|
||||
vcl::RenderContext& _rDevice, const tools::Rectangle& _rRowArea,
|
||||
const StyleSettings& _rStyle ) = 0;
|
||||
virtual void PrepareRow(sal_Int32 _nRow, bool i_hasControlFocus, bool _bSelected,
|
||||
vcl::RenderContext& _rDevice, const tools::Rectangle& _rRowArea,
|
||||
const StyleSettings& _rStyle)
|
||||
= 0;
|
||||
|
||||
/** paints the header of a row
|
||||
|
||||
@@ -187,10 +188,10 @@ namespace svt::table
|
||||
@param _rStyle
|
||||
the style to be used for drawing
|
||||
*/
|
||||
virtual void PaintCell( ColPos const i_col,
|
||||
bool i_hasControlFocus, bool _bSelected,
|
||||
vcl::RenderContext& _rDevice, const tools::Rectangle& _rArea,
|
||||
const StyleSettings& _rStyle ) = 0;
|
||||
virtual void PaintCell(sal_Int32 const i_col, bool i_hasControlFocus, bool _bSelected,
|
||||
vcl::RenderContext& _rDevice, const tools::Rectangle& _rArea,
|
||||
const StyleSettings& _rStyle)
|
||||
= 0;
|
||||
|
||||
/** draws a cell cursor in the given rectangle
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace svt::table
|
||||
|
||||
struct ColumnSort
|
||||
{
|
||||
ColPos nColumnPos;
|
||||
sal_Int32 nColumnPos;
|
||||
ColumnSortDirection eSortDirection;
|
||||
|
||||
ColumnSort()
|
||||
@@ -59,7 +59,9 @@ namespace svt::table
|
||||
public:
|
||||
/** sorts the rows in the model by the given column's data, in the given direction.
|
||||
*/
|
||||
virtual void sortByColumn( ColPos const i_column, ColumnSortDirection const i_sortDirection ) = 0;
|
||||
virtual void sortByColumn(sal_Int32 const i_column,
|
||||
ColumnSortDirection const i_sortDirection)
|
||||
= 0;
|
||||
|
||||
/** retrieves the current sort order of the data
|
||||
|
||||
|
||||
@@ -28,23 +28,17 @@ namespace svt::table
|
||||
/// a value denoting the size of a table
|
||||
typedef sal_Int32 TableSize;
|
||||
|
||||
/// a value denoting a column position within a table
|
||||
typedef sal_Int32 ColPos;
|
||||
/// a value denoting a row position within a table
|
||||
typedef sal_Int32 RowPos;
|
||||
|
||||
typedef sal_Int32 TableMetrics;
|
||||
|
||||
/// denotes the column containing the row headers
|
||||
#define COL_ROW_HEADERS (::svt::table::ColPos(-1))
|
||||
#define COL_ROW_HEADERS (sal_Int32(-1))
|
||||
/// denotes the row containing the column headers
|
||||
#define ROW_COL_HEADERS (::svt::table::RowPos(-1))
|
||||
#define ROW_COL_HEADERS (sal_Int32(-1))
|
||||
|
||||
/// denotes an invalid column index
|
||||
#define COL_INVALID (::svt::table::ColPos(-2))
|
||||
#define COL_INVALID (sal_Int32(-2))
|
||||
/// denotes an invalid row index
|
||||
#define ROW_INVALID (::svt::table::RowPos(-2))
|
||||
|
||||
#define ROW_INVALID (sal_Int32(-2))
|
||||
|
||||
} // namespace svt::table
|
||||
|
||||
|
||||
@@ -39,11 +39,11 @@ void TableFunctionSet::DestroyAnchor() { m_pTableControl->setAnchor(ROW_INVALID)
|
||||
void TableFunctionSet::SetCursorAtPoint(const Point& rPoint, bool bDontSelectAtCursor)
|
||||
{
|
||||
// newRow is the row which includes the point, getCurRow() is the last selected row, before the mouse click
|
||||
RowPos newRow = m_pTableControl->getRowAtPoint(rPoint);
|
||||
sal_Int32 newRow = m_pTableControl->getRowAtPoint(rPoint);
|
||||
if (newRow == ROW_COL_HEADERS)
|
||||
newRow = m_pTableControl->getTopRow();
|
||||
|
||||
ColPos newCol = m_pTableControl->getColAtPoint(rPoint);
|
||||
sal_Int32 newCol = m_pTableControl->getColAtPoint(rPoint);
|
||||
if (newCol == COL_ROW_HEADERS)
|
||||
newCol = m_pTableControl->getLeftColumn();
|
||||
|
||||
@@ -113,7 +113,7 @@ bool TableFunctionSet::IsSelectionAtPoint(const Point& rPoint)
|
||||
return false;
|
||||
else
|
||||
{
|
||||
RowPos curRow = m_pTableControl->getRowAtPoint(rPoint);
|
||||
sal_Int32 curRow = m_pTableControl->getRowAtPoint(rPoint);
|
||||
m_pTableControl->setAnchor(ROW_INVALID);
|
||||
bool selected = m_pTableControl->isRowSelected(curRow);
|
||||
m_nCurrentRow = curRow;
|
||||
@@ -133,7 +133,7 @@ void TableFunctionSet::DeselectAll()
|
||||
{
|
||||
for (size_t i = 0; i < m_pTableControl->getSelectedRowCount(); ++i)
|
||||
{
|
||||
RowPos const rowIndex = m_pTableControl->getSelectedRowIndex(i);
|
||||
sal_Int32 const rowIndex = m_pTableControl->getSelectedRowIndex(i);
|
||||
m_pTableControl->invalidateRow(rowIndex);
|
||||
}
|
||||
|
||||
|
||||
@@ -106,7 +106,7 @@ namespace svt::table
|
||||
struct GridTableRenderer_Impl
|
||||
{
|
||||
ITableModel& rModel;
|
||||
RowPos nCurrentRow;
|
||||
sal_Int32 nCurrentRow;
|
||||
bool bUseGridLines;
|
||||
CachedSortIndicator aSortIndicator;
|
||||
CellValueConversion aStringConverter;
|
||||
@@ -144,7 +144,8 @@ namespace svt::table
|
||||
return aTextArea;
|
||||
}
|
||||
|
||||
DrawTextFlags lcl_getAlignmentTextDrawFlags( GridTableRenderer_Impl const & i_impl, ColPos const i_columnPos )
|
||||
DrawTextFlags lcl_getAlignmentTextDrawFlags(GridTableRenderer_Impl const& i_impl,
|
||||
sal_Int32 const i_columnPos)
|
||||
{
|
||||
DrawTextFlags nVertFlag = DrawTextFlags::Top;
|
||||
VerticalAlignment const eVertAlign = i_impl.rModel.getVerticalAlign();
|
||||
@@ -235,11 +236,9 @@ namespace svt::table
|
||||
rRenderContext.DrawLine(_rArea.BottomRight(), _rArea.TopRight());
|
||||
}
|
||||
|
||||
|
||||
void GridTableRenderer::PaintColumnHeader(
|
||||
ColPos _nCol,
|
||||
vcl::RenderContext& rRenderContext,
|
||||
const tools::Rectangle& _rArea, const StyleSettings& _rStyle)
|
||||
void GridTableRenderer::PaintColumnHeader(sal_Int32 _nCol, vcl::RenderContext& rRenderContext,
|
||||
const tools::Rectangle& _rArea,
|
||||
const StyleSettings& _rStyle)
|
||||
{
|
||||
auto popIt = rRenderContext.ScopedPush(vcl::PushFlags::LINECOLOR);
|
||||
|
||||
@@ -293,9 +292,10 @@ namespace svt::table
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void GridTableRenderer::PrepareRow(RowPos _nRow, bool i_hasControlFocus, bool _bSelected, vcl::RenderContext& rRenderContext,
|
||||
const tools::Rectangle& _rRowArea, const StyleSettings& _rStyle)
|
||||
void GridTableRenderer::PrepareRow(sal_Int32 _nRow, bool i_hasControlFocus, bool _bSelected,
|
||||
vcl::RenderContext& rRenderContext,
|
||||
const tools::Rectangle& _rRowArea,
|
||||
const StyleSettings& _rStyle)
|
||||
{
|
||||
// remember the row for subsequent calls to the other ->ITableRenderer methods
|
||||
m_pImpl->nCurrentRow = _nRow;
|
||||
@@ -386,12 +386,12 @@ namespace svt::table
|
||||
OutputDevice& rDevice;
|
||||
tools::Rectangle const aContentArea;
|
||||
StyleSettings const & rStyle;
|
||||
ColPos const nColumn;
|
||||
sal_Int32 const nColumn;
|
||||
bool const bSelected;
|
||||
bool const bHasControlFocus;
|
||||
|
||||
CellRenderContext( OutputDevice& i_device, tools::Rectangle const & i_contentArea,
|
||||
StyleSettings const & i_style, ColPos const i_column, bool const i_selected, bool const i_hasControlFocus )
|
||||
StyleSettings const & i_style, sal_Int32 const i_column, bool const i_selected, bool const i_hasControlFocus )
|
||||
:rDevice( i_device )
|
||||
,aContentArea( i_contentArea )
|
||||
,rStyle( i_style )
|
||||
@@ -402,9 +402,9 @@ namespace svt::table
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
void GridTableRenderer::PaintCell(ColPos const i_column, bool _bSelected, bool i_hasControlFocus,
|
||||
vcl::RenderContext& rRenderContext, const tools::Rectangle& _rArea, const StyleSettings& _rStyle)
|
||||
void GridTableRenderer::PaintCell(sal_Int32 const i_column, bool _bSelected,
|
||||
bool i_hasControlFocus, vcl::RenderContext& rRenderContext,
|
||||
const tools::Rectangle& _rArea, const StyleSettings& _rStyle)
|
||||
{
|
||||
auto popIt = rRenderContext.ScopedPush(vcl::PushFlags::LINECOLOR | vcl::PushFlags::FILLCOLOR);
|
||||
|
||||
|
||||
@@ -93,7 +93,7 @@ public:
|
||||
virtual TableSize getRowCount() const override { return 0; }
|
||||
virtual bool hasColumnHeaders() const override { return false; }
|
||||
virtual bool hasRowHeaders() const override { return false; }
|
||||
virtual PColumnModel getColumnModel(ColPos) override
|
||||
virtual PColumnModel getColumnModel(sal_Int32) override
|
||||
{
|
||||
OSL_FAIL("EmptyTableModel::getColumnModel: invalid call!");
|
||||
return PColumnModel();
|
||||
@@ -159,12 +159,13 @@ public:
|
||||
}
|
||||
virtual ITableDataSort* getSortAdapter() override { return nullptr; }
|
||||
virtual bool isEnabled() const override { return true; }
|
||||
virtual void getCellContent(ColPos const, RowPos const, css::uno::Any& o_cellContent) override
|
||||
virtual void getCellContent(sal_Int32 const, sal_Int32 const,
|
||||
css::uno::Any& o_cellContent) override
|
||||
{
|
||||
o_cellContent.clear();
|
||||
}
|
||||
virtual void getCellToolTip(ColPos const, RowPos const, css::uno::Any&) override {}
|
||||
virtual Any getRowHeading(RowPos const) const override { return Any(); }
|
||||
virtual void getCellToolTip(sal_Int32 const, sal_Int32 const, css::uno::Any&) override {}
|
||||
virtual Any getRowHeading(sal_Int32 const) const override { return Any(); }
|
||||
};
|
||||
}
|
||||
|
||||
@@ -239,8 +240,8 @@ void TableControl_Impl::setModel(const PTableModel& _pModel)
|
||||
|
||||
namespace
|
||||
{
|
||||
bool lcl_adjustSelectedRows(::std::vector<RowPos>& io_selectionIndexes,
|
||||
RowPos const i_firstAffectedRowIndex, TableSize const i_offset)
|
||||
bool lcl_adjustSelectedRows(::std::vector<sal_Int32>& io_selectionIndexes,
|
||||
sal_Int32 const i_firstAffectedRowIndex, TableSize const i_offset)
|
||||
{
|
||||
bool didChanges = false;
|
||||
for (auto& selectionIndex : io_selectionIndexes)
|
||||
@@ -254,7 +255,7 @@ bool lcl_adjustSelectedRows(::std::vector<RowPos>& io_selectionIndexes,
|
||||
}
|
||||
}
|
||||
|
||||
void TableControl_Impl::rowsInserted(RowPos i_first, RowPos i_last)
|
||||
void TableControl_Impl::rowsInserted(sal_Int32 i_first, sal_Int32 i_last)
|
||||
{
|
||||
OSL_PRECOND(i_last >= i_first, "TableControl_Impl::rowsInserted: invalid row indexes!");
|
||||
|
||||
@@ -287,7 +288,7 @@ void TableControl_Impl::rowsInserted(RowPos i_first, RowPos i_last)
|
||||
m_rAntiImpl.Select();
|
||||
}
|
||||
|
||||
void TableControl_Impl::rowsRemoved(RowPos i_first, RowPos i_last)
|
||||
void TableControl_Impl::rowsRemoved(sal_Int32 i_first, sal_Int32 i_last)
|
||||
{
|
||||
sal_Int32 firstRemovedRow = i_first;
|
||||
sal_Int32 lastRemovedRow = i_last;
|
||||
@@ -386,7 +387,7 @@ void TableControl_Impl::allColumnsRemoved()
|
||||
m_rAntiImpl.Invalidate();
|
||||
}
|
||||
|
||||
void TableControl_Impl::cellsUpdated(RowPos const i_firstRow, RowPos const i_lastRow)
|
||||
void TableControl_Impl::cellsUpdated(sal_Int32 const i_firstRow, sal_Int32 const i_lastRow)
|
||||
{
|
||||
invalidateRowRange(i_firstRow, i_lastRow);
|
||||
}
|
||||
@@ -398,7 +399,7 @@ void TableControl_Impl::tableMetricsChanged()
|
||||
m_rAntiImpl.Invalidate();
|
||||
}
|
||||
|
||||
void TableControl_Impl::impl_invalidateColumn(ColPos const i_column)
|
||||
void TableControl_Impl::impl_invalidateColumn(sal_Int32 const i_column)
|
||||
{
|
||||
tools::Rectangle const aAllCellsArea(impl_getAllVisibleCellsArea());
|
||||
|
||||
@@ -407,7 +408,7 @@ void TableControl_Impl::impl_invalidateColumn(ColPos const i_column)
|
||||
m_rAntiImpl.Invalidate(aColumn.getRect());
|
||||
}
|
||||
|
||||
void TableControl_Impl::columnChanged(ColPos const i_column,
|
||||
void TableControl_Impl::columnChanged(sal_Int32 const i_column,
|
||||
ColumnAttributeGroup const i_attributeGroup)
|
||||
{
|
||||
ColumnAttributeGroup nGroup(i_attributeGroup);
|
||||
@@ -591,7 +592,8 @@ TableSize lcl_getRowsFittingInto(tools::Long _nOverallHeight, tools::Long _nRowH
|
||||
with the first visible column as given. Partially fitting columns are counted, too,
|
||||
if the respective parameter says so.
|
||||
*/
|
||||
TableSize lcl_getColumnsVisibleWithin(const tools::Rectangle& _rArea, ColPos _nFirstVisibleColumn,
|
||||
TableSize lcl_getColumnsVisibleWithin(const tools::Rectangle& _rArea,
|
||||
sal_Int32 _nFirstVisibleColumn,
|
||||
const TableControl_Impl& _rControl, bool _bAcceptPartialRow)
|
||||
{
|
||||
TableSize visibleColumns = 0;
|
||||
@@ -611,7 +613,7 @@ TableSize lcl_getColumnsVisibleWithin(const tools::Rectangle& _rArea, ColPos _nF
|
||||
}
|
||||
|
||||
tools::Long TableControl_Impl::impl_ni_calculateColumnWidths(
|
||||
ColPos const i_assumeInflexibleColumnsUpToIncluding, bool const i_assumeVerticalScrollbar,
|
||||
sal_Int32 const i_assumeInflexibleColumnsUpToIncluding, bool const i_assumeVerticalScrollbar,
|
||||
::std::vector<tools::Long>& o_newColWidthsPixel) const
|
||||
{
|
||||
// the available horizontal space
|
||||
@@ -653,7 +655,7 @@ tools::Long TableControl_Impl::impl_ni_calculateColumnWidths(
|
||||
columnFlexibilities.reserve(colCount);
|
||||
tools::Long flexibilityDenominator = 0;
|
||||
size_t flexibleColumnCount = 0;
|
||||
for (ColPos col = 0; col < colCount; ++col)
|
||||
for (sal_Int32 col = 0; col < colCount; ++col)
|
||||
{
|
||||
PColumnModel const pColumn = m_pModel->getColumnModel(col);
|
||||
ENSURE_OR_THROW(!!pColumn, "invalid column returned by the model!");
|
||||
@@ -878,7 +880,7 @@ tools::Long TableControl_Impl::impl_ni_calculateColumnWidths(
|
||||
return gridWidthPixel;
|
||||
}
|
||||
|
||||
void TableControl_Impl::impl_ni_relayout(ColPos const i_assumeInflexibleColumnsUpToIncluding)
|
||||
void TableControl_Impl::impl_ni_relayout(sal_Int32 const i_assumeInflexibleColumnsUpToIncluding)
|
||||
{
|
||||
ENSURE_OR_RETURN_VOID(!m_bUpdatingColWidths,
|
||||
"TableControl_Impl::impl_ni_relayout: recursive call detected!");
|
||||
@@ -971,7 +973,7 @@ void TableControl_Impl::impl_ni_relayout(ColPos const i_assumeInflexibleColumnsU
|
||||
m_aColumnWidths.reserve(colCount);
|
||||
tools::Long accumulatedWidthPixel = m_nRowHeaderWidthPixel;
|
||||
bool anyColumnWidthChanged = false;
|
||||
for (ColPos col = 0; col < colCount; ++col)
|
||||
for (sal_Int32 col = 0; col < colCount; ++col)
|
||||
{
|
||||
const tools::Long columnStart = accumulatedWidthPixel;
|
||||
const tools::Long columnEnd = columnStart + newWidthsPixel[col];
|
||||
@@ -1325,14 +1327,14 @@ bool TableControl_Impl::dispatchAction(TableControlAction _eAction)
|
||||
|
||||
case TableControlAction::cursorPageUp:
|
||||
{
|
||||
RowPos nNewRow = ::std::max(RowPos(0), m_nCurRow - impl_getVisibleRows(false));
|
||||
sal_Int32 nNewRow = ::std::max(sal_Int32(0), m_nCurRow - impl_getVisibleRows(false));
|
||||
bSuccess = goTo(m_nCurColumn, nNewRow);
|
||||
}
|
||||
break;
|
||||
|
||||
case TableControlAction::cursorPageDown:
|
||||
{
|
||||
RowPos nNewRow = ::std::min(m_nRowCount - 1, m_nCurRow + impl_getVisibleRows(false));
|
||||
sal_Int32 nNewRow = ::std::min(m_nRowCount - 1, m_nCurRow + impl_getVisibleRows(false));
|
||||
bSuccess = goTo(m_nCurColumn, nNewRow);
|
||||
}
|
||||
break;
|
||||
@@ -1542,7 +1544,7 @@ bool TableControl_Impl::dispatchAction(TableControlAction _eAction)
|
||||
else
|
||||
{
|
||||
//select the region between the current and the upper row
|
||||
RowPos iter = m_nCurRow;
|
||||
sal_Int32 iter = m_nCurRow;
|
||||
invalidateSelectedRegion(m_nCurRow, 0);
|
||||
//put the rows in vector
|
||||
while (iter >= 0)
|
||||
@@ -1568,7 +1570,7 @@ bool TableControl_Impl::dispatchAction(TableControlAction _eAction)
|
||||
else if (m_pSelEngine->GetSelectionMode() == SelectionMode::Single)
|
||||
return false;
|
||||
//select the region between the current and the last row
|
||||
RowPos iter = m_nCurRow;
|
||||
sal_Int32 iter = m_nCurRow;
|
||||
invalidateSelectedRegion(m_nCurRow, m_nRowCount - 1);
|
||||
//put the rows in the vector
|
||||
while (iter <= m_nRowCount)
|
||||
@@ -1611,12 +1613,12 @@ void TableControl_Impl::impl_ni_doSwitchCursor(bool _bShow)
|
||||
}
|
||||
}
|
||||
|
||||
RowPos TableControl_Impl::getRowAtPoint(const Point& rPoint) const
|
||||
sal_Int32 TableControl_Impl::getRowAtPoint(const Point& rPoint) const
|
||||
{
|
||||
return impl_getRowForAbscissa(rPoint.Y());
|
||||
}
|
||||
|
||||
ColPos TableControl_Impl::getColAtPoint(const Point& rPoint) const
|
||||
sal_Int32 TableControl_Impl::getColAtPoint(const Point& rPoint) const
|
||||
{
|
||||
return impl_getColumnForOrdinate(rPoint.X());
|
||||
}
|
||||
@@ -1637,7 +1639,7 @@ TableCell TableControl_Impl::hitTest(Point const& i_point) const
|
||||
return aCell;
|
||||
}
|
||||
|
||||
ColumnMetrics TableControl_Impl::getColumnMetrics(ColPos const i_column) const
|
||||
ColumnMetrics TableControl_Impl::getColumnMetrics(sal_Int32 const i_column) const
|
||||
{
|
||||
ENSURE_OR_RETURN((i_column >= 0) && (i_column < m_pModel->getColumnCount()),
|
||||
"TableControl_Impl::getColumnMetrics: illegal column index!", ColumnMetrics());
|
||||
@@ -1646,9 +1648,9 @@ ColumnMetrics TableControl_Impl::getColumnMetrics(ColPos const i_column) const
|
||||
|
||||
PTableModel TableControl_Impl::getModel() const { return m_pModel; }
|
||||
|
||||
ColPos TableControl_Impl::getCurrentColumn() const { return m_nCurColumn; }
|
||||
sal_Int32 TableControl_Impl::getCurrentColumn() const { return m_nCurColumn; }
|
||||
|
||||
RowPos TableControl_Impl::getCurrentRow() const { return m_nCurRow; }
|
||||
sal_Int32 TableControl_Impl::getCurrentRow() const { return m_nCurRow; }
|
||||
|
||||
::Size TableControl_Impl::getTableSizePixel() const { return m_pDataWindow->GetOutputSizePixel(); }
|
||||
|
||||
@@ -1696,9 +1698,12 @@ void TableControl_Impl::showTracking(tools::Rectangle const& i_location,
|
||||
m_pDataWindow->ShowTracking(i_location, i_flags);
|
||||
}
|
||||
|
||||
void TableControl_Impl::activateCell(ColPos const i_col, RowPos const i_row) { goTo(i_col, i_row); }
|
||||
void TableControl_Impl::activateCell(sal_Int32 const i_col, sal_Int32 const i_row)
|
||||
{
|
||||
goTo(i_col, i_row);
|
||||
}
|
||||
|
||||
void TableControl_Impl::invalidateSelectedRegion(RowPos _nPrevRow, RowPos _nCurRow)
|
||||
void TableControl_Impl::invalidateSelectedRegion(sal_Int32 _nPrevRow, sal_Int32 _nCurRow)
|
||||
{
|
||||
// get the visible area of the table control and set the Left and right border of the region to be repainted
|
||||
tools::Rectangle const aAllCells(impl_getAllVisibleCellsArea());
|
||||
@@ -1748,11 +1753,11 @@ void TableControl_Impl::invalidateSelectedRows()
|
||||
}
|
||||
}
|
||||
|
||||
void TableControl_Impl::invalidateRowRange(RowPos const i_firstRow, RowPos const i_lastRow)
|
||||
void TableControl_Impl::invalidateRowRange(sal_Int32 const i_firstRow, sal_Int32 const i_lastRow)
|
||||
{
|
||||
RowPos const firstRow = i_firstRow < m_nTopRow ? m_nTopRow : i_firstRow;
|
||||
RowPos const lastVisibleRow = m_nTopRow + impl_getVisibleRows(true) - 1;
|
||||
RowPos const lastRow
|
||||
sal_Int32 const firstRow = i_firstRow < m_nTopRow ? m_nTopRow : i_firstRow;
|
||||
sal_Int32 const lastVisibleRow = m_nTopRow + impl_getVisibleRows(true) - 1;
|
||||
sal_Int32 const lastRow
|
||||
= ((i_lastRow == ROW_INVALID) || (i_lastRow > lastVisibleRow)) ? lastVisibleRow : i_lastRow;
|
||||
|
||||
tools::Rectangle aInvalidateRect;
|
||||
@@ -1814,7 +1819,7 @@ TableSize TableControl_Impl::impl_getVisibleColumns(bool _bAcceptPartialCol) con
|
||||
_bAcceptPartialCol);
|
||||
}
|
||||
|
||||
bool TableControl_Impl::goTo(ColPos _nColumn, RowPos _nRow)
|
||||
bool TableControl_Impl::goTo(sal_Int32 _nColumn, sal_Int32 _nRow)
|
||||
{
|
||||
// TODO: give veto listeners a chance
|
||||
|
||||
@@ -1833,7 +1838,7 @@ bool TableControl_Impl::goTo(ColPos _nColumn, RowPos _nRow)
|
||||
return true;
|
||||
}
|
||||
|
||||
void TableControl_Impl::ensureVisible(ColPos _nColumn, RowPos _nRow)
|
||||
void TableControl_Impl::ensureVisible(sal_Int32 _nColumn, sal_Int32 _nRow)
|
||||
{
|
||||
DBG_ASSERT((_nColumn >= 0) && (_nColumn < m_nColumnCount) && (_nRow >= 0)
|
||||
&& (_nRow < m_nRowCount),
|
||||
@@ -1864,7 +1869,7 @@ void TableControl_Impl::ensureVisible(ColPos _nColumn, RowPos _nRow)
|
||||
}
|
||||
}
|
||||
|
||||
OUString TableControl_Impl::getCellContentAsString(RowPos const i_row, ColPos const i_col)
|
||||
OUString TableControl_Impl::getCellContentAsString(sal_Int32 const i_row, sal_Int32 const i_col)
|
||||
{
|
||||
Any aCellValue;
|
||||
m_pModel->getCellContent(i_col, i_row, aCellValue);
|
||||
@@ -1878,11 +1883,11 @@ OUString TableControl_Impl::getCellContentAsString(RowPos const i_row, ColPos co
|
||||
TableSize TableControl_Impl::impl_ni_ScrollRows(TableSize _nRowDelta)
|
||||
{
|
||||
// compute new top row
|
||||
RowPos nNewTopRow = ::std::max(::std::min(static_cast<RowPos>(m_nTopRow + _nRowDelta),
|
||||
static_cast<RowPos>(m_nRowCount - 1)),
|
||||
RowPos(0));
|
||||
sal_Int32 nNewTopRow = ::std::max(::std::min(static_cast<sal_Int32>(m_nTopRow + _nRowDelta),
|
||||
static_cast<sal_Int32>(m_nRowCount - 1)),
|
||||
sal_Int32(0));
|
||||
|
||||
RowPos nOldTopRow = m_nTopRow;
|
||||
sal_Int32 nOldTopRow = m_nTopRow;
|
||||
m_nTopRow = nNewTopRow;
|
||||
|
||||
// if updates are enabled currently, scroll the viewport
|
||||
@@ -1939,12 +1944,12 @@ TableSize TableControl_Impl::impl_scrollRows(TableSize const i_rowDelta)
|
||||
TableSize TableControl_Impl::impl_ni_ScrollColumns(TableSize _nColumnDelta)
|
||||
{
|
||||
// compute new left column
|
||||
const ColPos nNewLeftColumn
|
||||
= ::std::max(::std::min(static_cast<ColPos>(m_nLeftColumn + _nColumnDelta),
|
||||
static_cast<ColPos>(m_nColumnCount - 1)),
|
||||
ColPos(0));
|
||||
const sal_Int32 nNewLeftColumn
|
||||
= ::std::max(::std::min(static_cast<sal_Int32>(m_nLeftColumn + _nColumnDelta),
|
||||
static_cast<sal_Int32>(m_nColumnCount - 1)),
|
||||
sal_Int32(0));
|
||||
|
||||
const ColPos nOldLeftColumn = m_nLeftColumn;
|
||||
const sal_Int32 nOldLeftColumn = m_nLeftColumn;
|
||||
m_nLeftColumn = nNewLeftColumn;
|
||||
|
||||
// if updates are enabled currently, scroll the viewport
|
||||
@@ -2024,23 +2029,23 @@ bool TableControl_Impl::hasRowHeader() { return m_pModel->hasRowHeaders(); }
|
||||
|
||||
bool TableControl_Impl::hasColumnHeader() { return m_pModel->hasColumnHeaders(); }
|
||||
|
||||
bool TableControl_Impl::isRowSelected(RowPos i_row) const
|
||||
bool TableControl_Impl::isRowSelected(sal_Int32 i_row) const
|
||||
{
|
||||
return ::std::find(m_aSelectedRows.begin(), m_aSelectedRows.end(), i_row)
|
||||
!= m_aSelectedRows.end();
|
||||
}
|
||||
|
||||
RowPos TableControl_Impl::getSelectedRowIndex(size_t const i_selectionIndex) const
|
||||
sal_Int32 TableControl_Impl::getSelectedRowIndex(size_t const i_selectionIndex) const
|
||||
{
|
||||
if (i_selectionIndex < m_aSelectedRows.size())
|
||||
return m_aSelectedRows[i_selectionIndex];
|
||||
return ROW_INVALID;
|
||||
}
|
||||
|
||||
int TableControl_Impl::getRowSelectedNumber(const ::std::vector<RowPos>& selectedRows,
|
||||
RowPos current)
|
||||
int TableControl_Impl::getRowSelectedNumber(const ::std::vector<sal_Int32>& selectedRows,
|
||||
sal_Int32 current)
|
||||
{
|
||||
std::vector<RowPos>::const_iterator it
|
||||
std::vector<sal_Int32>::const_iterator it
|
||||
= ::std::find(selectedRows.begin(), selectedRows.end(), current);
|
||||
if (it != selectedRows.end())
|
||||
{
|
||||
@@ -2089,7 +2094,7 @@ void TableControl_Impl::selectAllRows(bool bSelect)
|
||||
m_rAntiImpl.Select();
|
||||
}
|
||||
|
||||
ColPos TableControl_Impl::impl_getColumnForOrdinate(tools::Long const i_ordinate) const
|
||||
sal_Int32 TableControl_Impl::impl_getColumnForOrdinate(tools::Long const i_ordinate) const
|
||||
{
|
||||
if ((m_aColumnWidths.empty()) || (i_ordinate < 0))
|
||||
return COL_INVALID;
|
||||
@@ -2111,7 +2116,7 @@ ColPos TableControl_Impl::impl_getColumnForOrdinate(tools::Long const i_ordinate
|
||||
return lowerBound - m_aColumnWidths.begin();
|
||||
}
|
||||
|
||||
RowPos TableControl_Impl::impl_getRowForAbscissa(tools::Long const i_abscissa) const
|
||||
sal_Int32 TableControl_Impl::impl_getRowForAbscissa(tools::Long const i_abscissa) const
|
||||
{
|
||||
if (i_abscissa < 0)
|
||||
return ROW_INVALID;
|
||||
@@ -2124,9 +2129,9 @@ RowPos TableControl_Impl::impl_getRowForAbscissa(tools::Long const i_abscissa) c
|
||||
return row < m_pModel->getRowCount() ? row : ROW_INVALID;
|
||||
}
|
||||
|
||||
bool TableControl_Impl::markRowAsDeselected(RowPos const i_rowIndex)
|
||||
bool TableControl_Impl::markRowAsDeselected(sal_Int32 const i_rowIndex)
|
||||
{
|
||||
::std::vector<RowPos>::iterator selPos
|
||||
::std::vector<sal_Int32>::iterator selPos
|
||||
= ::std::find(m_aSelectedRows.begin(), m_aSelectedRows.end(), i_rowIndex);
|
||||
if (selPos == m_aSelectedRows.end())
|
||||
return false;
|
||||
@@ -2135,7 +2140,7 @@ bool TableControl_Impl::markRowAsDeselected(RowPos const i_rowIndex)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool TableControl_Impl::markRowAsSelected(RowPos const i_rowIndex)
|
||||
bool TableControl_Impl::markRowAsSelected(sal_Int32 const i_rowIndex)
|
||||
{
|
||||
if (isRowSelected(i_rowIndex))
|
||||
return false;
|
||||
@@ -2196,7 +2201,7 @@ bool TableControl_Impl::markAllRowsAsSelected()
|
||||
}
|
||||
|
||||
m_aSelectedRows.clear();
|
||||
for (RowPos i = 0; i < m_pModel->getRowCount(); ++i)
|
||||
for (sal_Int32 i = 0; i < m_pModel->getRowCount(); ++i)
|
||||
m_aSelectedRows.push_back(i);
|
||||
|
||||
return true;
|
||||
|
||||
@@ -73,8 +73,8 @@ namespace svt::table
|
||||
QuickHelpFlags nHelpStyle = QuickHelpFlags::NONE;
|
||||
|
||||
Point const aMousePos( ScreenToOutputPixel( rHEvt.GetMousePosPixel() ) );
|
||||
RowPos const hitRow = m_rTableControl.getRowAtPoint( aMousePos );
|
||||
ColPos const hitCol = m_rTableControl.getColAtPoint( aMousePos );
|
||||
sal_Int32 const hitRow = m_rTableControl.getRowAtPoint(aMousePos);
|
||||
sal_Int32 const hitCol = m_rTableControl.getColAtPoint(aMousePos);
|
||||
|
||||
PTableModel const pTableModel( m_rTableControl.getModel() );
|
||||
if ( ( hitCol >= 0 ) && ( hitCol < pTableModel->getColumnCount() ) )
|
||||
@@ -149,7 +149,7 @@ namespace svt::table
|
||||
impl_hideTipWindow();
|
||||
|
||||
Point const aPoint = rMEvt.GetPosPixel();
|
||||
RowPos const hitRow = m_rTableControl.getRowAtPoint( aPoint );
|
||||
sal_Int32 const hitRow = m_rTableControl.getRowAtPoint(aPoint);
|
||||
bool const wasRowSelected = m_rTableControl.isRowSelected( hitRow );
|
||||
size_t const nPrevSelRowCount = m_rTableControl.getSelectedRowCount();
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace svt::table
|
||||
|
||||
|
||||
TableRowGeometry::TableRowGeometry( TableControl_Impl const & _rControl, tools::Rectangle const & _rBoundaries,
|
||||
RowPos const _nRow, bool const i_allowVirtualRows )
|
||||
sal_Int32 const _nRow, bool const i_allowVirtualRows )
|
||||
:TableGeometry( _rControl, _rBoundaries )
|
||||
,m_nRowPos( _nRow )
|
||||
,m_bAllowVirtualRows( i_allowVirtualRows )
|
||||
@@ -57,8 +57,7 @@ namespace svt::table
|
||||
m_aRect.SetEmpty();
|
||||
}
|
||||
|
||||
|
||||
bool TableRowGeometry::impl_isValidRow( RowPos const i_row ) const
|
||||
bool TableRowGeometry::impl_isValidRow(sal_Int32 const i_row) const
|
||||
{
|
||||
return m_bAllowVirtualRows || ( i_row < m_rControl.m_pModel->getRowCount() );
|
||||
}
|
||||
@@ -86,7 +85,7 @@ namespace svt::table
|
||||
|
||||
|
||||
TableColumnGeometry::TableColumnGeometry( TableControl_Impl const & _rControl, tools::Rectangle const & _rBoundaries,
|
||||
ColPos const _nCol )
|
||||
sal_Int32 const _nCol )
|
||||
:TableGeometry( _rControl, _rBoundaries )
|
||||
,m_nColPos( _nCol )
|
||||
{
|
||||
@@ -104,13 +103,13 @@ namespace svt::table
|
||||
|
||||
void TableColumnGeometry::impl_initRect()
|
||||
{
|
||||
ColPos nLeftColumn = m_rControl.m_nLeftColumn;
|
||||
sal_Int32 nLeftColumn = m_rControl.m_nLeftColumn;
|
||||
if ( ( m_nColPos >= nLeftColumn ) && impl_isValidColumn( m_nColPos ) )
|
||||
{
|
||||
m_aRect.SetLeft( m_rControl.m_nRowHeaderWidthPixel );
|
||||
// TODO: take into account any possibly frozen columns
|
||||
|
||||
for ( ColPos col = nLeftColumn; col < m_nColPos; ++col )
|
||||
for (sal_Int32 col = nLeftColumn; col < m_nColPos; ++col)
|
||||
m_aRect.AdjustLeft(m_rControl.m_aColumnWidths[ col ].getWidth() );
|
||||
m_aRect.SetRight( m_aRect.Left() + m_rControl.m_aColumnWidths[ m_nColPos ].getWidth() - 1 );
|
||||
}
|
||||
@@ -118,10 +117,9 @@ namespace svt::table
|
||||
m_aRect.SetEmpty();
|
||||
}
|
||||
|
||||
|
||||
bool TableColumnGeometry::impl_isValidColumn( ColPos const i_column ) const
|
||||
bool TableColumnGeometry::impl_isValidColumn(sal_Int32 const i_column) const
|
||||
{
|
||||
return i_column < ColPos( m_rControl.m_aColumnWidths.size() );
|
||||
return i_column < sal_Int32(m_rControl.m_aColumnWidths.size());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -67,21 +67,21 @@ namespace svt::table
|
||||
TableRowGeometry(
|
||||
TableControl_Impl const & _rControl,
|
||||
tools::Rectangle const & _rBoundaries,
|
||||
RowPos const _nRow,
|
||||
sal_Int32 const _nRow,
|
||||
bool const i_allowVirtualRows = false
|
||||
// allow rows >= getRowCount()?
|
||||
);
|
||||
|
||||
// status
|
||||
RowPos getRow() const { return m_nRowPos; }
|
||||
sal_Int32 getRow() const { return m_nRowPos; }
|
||||
// operations
|
||||
bool moveDown();
|
||||
|
||||
private:
|
||||
void impl_initRect();
|
||||
bool impl_isValidRow( RowPos const i_row ) const;
|
||||
bool impl_isValidRow(sal_Int32 const i_row) const;
|
||||
|
||||
RowPos m_nRowPos;
|
||||
sal_Int32 m_nRowPos;
|
||||
bool m_bAllowVirtualRows;
|
||||
};
|
||||
|
||||
@@ -91,22 +91,19 @@ namespace svt::table
|
||||
class TableColumnGeometry final : public TableGeometry
|
||||
{
|
||||
public:
|
||||
TableColumnGeometry(
|
||||
TableControl_Impl const & _rControl,
|
||||
tools::Rectangle const & _rBoundaries,
|
||||
ColPos const _nCol
|
||||
);
|
||||
TableColumnGeometry(TableControl_Impl const& _rControl,
|
||||
tools::Rectangle const& _rBoundaries, sal_Int32 const _nCol);
|
||||
|
||||
// status
|
||||
ColPos getCol() const { return m_nColPos; }
|
||||
sal_Int32 getCol() const { return m_nColPos; }
|
||||
// operations
|
||||
bool moveRight();
|
||||
|
||||
private:
|
||||
void impl_initRect();
|
||||
bool impl_isValidColumn( ColPos const i_column ) const;
|
||||
bool impl_isValidColumn(sal_Int32 const i_column) const;
|
||||
|
||||
ColPos m_nColPos;
|
||||
sal_Int32 m_nColPos;
|
||||
};
|
||||
|
||||
|
||||
@@ -124,8 +121,8 @@ namespace svt::table
|
||||
TableCellGeometry(
|
||||
TableControl_Impl const & _rControl,
|
||||
tools::Rectangle const & _rBoundaries,
|
||||
ColPos const _nCol,
|
||||
RowPos const _nRow
|
||||
sal_Int32 const _nCol,
|
||||
sal_Int32 const _nRow
|
||||
)
|
||||
:m_aRow( _rControl, _rBoundaries, _nRow, false/*allowVirtualCells*/ )
|
||||
,m_aCol( _rControl, _rBoundaries, _nCol )
|
||||
@@ -134,7 +131,7 @@ namespace svt::table
|
||||
|
||||
TableCellGeometry(
|
||||
const TableRowGeometry& _rRow,
|
||||
ColPos _nCol
|
||||
sal_Int32 _nCol
|
||||
)
|
||||
:m_aRow( _rRow )
|
||||
,m_aCol( _rRow.getControl(), _rRow.getRect(), _nCol )
|
||||
@@ -142,7 +139,7 @@ namespace svt::table
|
||||
}
|
||||
|
||||
tools::Rectangle getRect() const { return m_aRow.getRect().GetIntersection( m_aCol.getRect() ); }
|
||||
ColPos getColumn() const { return m_aCol.getCol(); }
|
||||
sal_Int32 getColumn() const { return m_aCol.getCol(); }
|
||||
bool isValid() const { return !getRect().IsEmpty(); }
|
||||
|
||||
bool moveRight() {return m_aCol.moveRight(); }
|
||||
|
||||
@@ -136,7 +136,7 @@ void UnoControlTableModel::setColumnHeaders(bool _bColumnHeaders)
|
||||
impl_notifyTableMetricsChanged();
|
||||
}
|
||||
|
||||
PColumnModel UnoControlTableModel::getColumnModel(ColPos column)
|
||||
PColumnModel UnoControlTableModel::getColumnModel(sal_Int32 column)
|
||||
{
|
||||
DBG_TESTSOLARMUTEX();
|
||||
ENSURE_OR_RETURN((column >= 0) && (column < getColumnCount()),
|
||||
@@ -150,7 +150,7 @@ void UnoControlTableModel::appendColumn(Reference<XGridColumn> const& i_column)
|
||||
insertColumn(aColumns.size(), i_column);
|
||||
}
|
||||
|
||||
void UnoControlTableModel::insertColumn(ColPos const i_position,
|
||||
void UnoControlTableModel::insertColumn(sal_Int32 const i_position,
|
||||
Reference<XGridColumn> const& i_column)
|
||||
{
|
||||
DBG_TESTSOLARMUTEX();
|
||||
@@ -168,7 +168,7 @@ void UnoControlTableModel::insertColumn(ColPos const i_position,
|
||||
}
|
||||
}
|
||||
|
||||
void UnoControlTableModel::removeColumn(ColPos const i_position)
|
||||
void UnoControlTableModel::removeColumn(sal_Int32 const i_position)
|
||||
{
|
||||
DBG_TESTSOLARMUTEX();
|
||||
ENSURE_OR_RETURN_VOID((i_position >= 0) && (o3tl::make_unsigned(i_position) <= aColumns.size()),
|
||||
@@ -370,7 +370,7 @@ Reference<XGridColumnModel> UnoControlTableModel::getColumnModel() const
|
||||
|
||||
bool UnoControlTableModel::hasColumnModel() const { return getColumnModel().is(); }
|
||||
|
||||
void UnoControlTableModel::getCellContent(ColPos const i_col, RowPos const i_row,
|
||||
void UnoControlTableModel::getCellContent(sal_Int32 const i_col, sal_Int32 const i_row,
|
||||
Any& o_cellContent)
|
||||
{
|
||||
DBG_TESTSOLARMUTEX();
|
||||
@@ -413,7 +413,7 @@ void UnoControlTableModel::getCellContent(ColPos const i_col, RowPos const i_row
|
||||
}
|
||||
}
|
||||
|
||||
void UnoControlTableModel::getCellToolTip(ColPos const i_col, RowPos const i_row,
|
||||
void UnoControlTableModel::getCellToolTip(sal_Int32 const i_col, sal_Int32 const i_row,
|
||||
Any& o_cellToolTip)
|
||||
{
|
||||
DBG_TESTSOLARMUTEX();
|
||||
@@ -430,7 +430,7 @@ void UnoControlTableModel::getCellToolTip(ColPos const i_col, RowPos const i_row
|
||||
}
|
||||
}
|
||||
|
||||
Any UnoControlTableModel::getRowHeading(RowPos const i_rowPos) const
|
||||
Any UnoControlTableModel::getRowHeading(sal_Int32 const i_rowPos) const
|
||||
{
|
||||
DBG_TESTSOLARMUTEX();
|
||||
|
||||
@@ -615,10 +615,10 @@ void UnoControlTableModel::setVerticalAlign(VerticalAlignment _xAlign)
|
||||
m_eVerticalAlign = _xAlign;
|
||||
}
|
||||
|
||||
ColPos UnoControlTableModel::getColumnPos(UnoGridColumnFacade const& i_column) const
|
||||
sal_Int32 UnoControlTableModel::getColumnPos(UnoGridColumnFacade const& i_column) const
|
||||
{
|
||||
DBG_TESTSOLARMUTEX();
|
||||
ColPos nPos = 0;
|
||||
sal_Int32 nPos = 0;
|
||||
for (auto const& col : aColumns)
|
||||
{
|
||||
if (&i_column == col.get())
|
||||
@@ -651,7 +651,7 @@ void UnoControlTableModel::setEnabled(bool _bEnabled)
|
||||
bEnabled = _bEnabled;
|
||||
}
|
||||
|
||||
void UnoControlTableModel::sortByColumn(ColPos const i_column,
|
||||
void UnoControlTableModel::sortByColumn(sal_Int32 const i_column,
|
||||
ColumnSortDirection const i_sortDirection)
|
||||
{
|
||||
DBG_TESTSOLARMUTEX();
|
||||
@@ -687,7 +687,7 @@ ColumnSort UnoControlTableModel::getCurrentSortOrder() const
|
||||
return currentSort;
|
||||
}
|
||||
|
||||
void UnoControlTableModel::notifyColumnChange(ColPos const i_columnPos,
|
||||
void UnoControlTableModel::notifyColumnChange(sal_Int32 const i_columnPos,
|
||||
ColumnAttributeGroup const i_attributeGroup) const
|
||||
{
|
||||
DBG_TESTSOLARMUTEX();
|
||||
@@ -749,8 +749,8 @@ void UnoControlTableModel::notifyRowsRemoved(GridDataEvent const& i_event) const
|
||||
|
||||
void UnoControlTableModel::notifyDataChanged(css::awt::grid::GridDataEvent const& i_event) const
|
||||
{
|
||||
RowPos const firstRow = i_event.FirstRow == -1 ? 0 : i_event.FirstRow;
|
||||
RowPos const lastRow = i_event.FirstRow == -1 ? getRowCount() - 1 : i_event.LastRow;
|
||||
sal_Int32 const firstRow = i_event.FirstRow == -1 ? 0 : i_event.FirstRow;
|
||||
sal_Int32 const lastRow = i_event.FirstRow == -1 ? getRowCount() - 1 : i_event.LastRow;
|
||||
|
||||
ModellListeners aListeners(m_aListeners);
|
||||
for (auto const& listener : aListeners)
|
||||
|
||||
@@ -47,7 +47,7 @@ public:
|
||||
virtual TableSize getRowCount() const override;
|
||||
virtual bool hasColumnHeaders() const override;
|
||||
virtual bool hasRowHeaders() const override;
|
||||
virtual PColumnModel getColumnModel(ColPos column) override;
|
||||
virtual PColumnModel getColumnModel(sal_Int32 column) override;
|
||||
virtual PTableRenderer getRenderer() const override;
|
||||
virtual PTableInputHandler getInputHandler() const override;
|
||||
virtual TableMetrics getRowHeight() const override;
|
||||
@@ -59,11 +59,11 @@ public:
|
||||
addTableModelListener(const std::shared_ptr<TableControl_Impl>& i_listener) override;
|
||||
virtual void
|
||||
removeTableModelListener(const std::shared_ptr<TableControl_Impl>& i_listener) override;
|
||||
virtual void getCellContent(ColPos const i_col, RowPos const i_row,
|
||||
virtual void getCellContent(sal_Int32 const i_col, sal_Int32 const i_row,
|
||||
css::uno::Any& o_cellContent) override;
|
||||
virtual void getCellToolTip(ColPos const i_col, RowPos const i_row,
|
||||
virtual void getCellToolTip(sal_Int32 const i_col, sal_Int32 const i_row,
|
||||
css::uno::Any& o_cellToolTip) override;
|
||||
virtual css::uno::Any getRowHeading(RowPos const i_rowPos) const override;
|
||||
virtual css::uno::Any getRowHeading(sal_Int32 const i_rowPos) const override;
|
||||
virtual ::std::optional<::Color> getLineColor() const override;
|
||||
virtual ::std::optional<::Color> getHeaderBackgroundColor() const override;
|
||||
virtual ::std::optional<::Color> getHeaderTextColor() const override;
|
||||
@@ -79,15 +79,15 @@ public:
|
||||
virtual bool isEnabled() const override;
|
||||
|
||||
// ITableDataSort overridables
|
||||
virtual void sortByColumn(ColPos const i_column,
|
||||
virtual void sortByColumn(sal_Int32 const i_column,
|
||||
ColumnSortDirection const i_sortDirection) override;
|
||||
virtual ColumnSort getCurrentSortOrder() const override;
|
||||
|
||||
// column write access
|
||||
void appendColumn(css::uno::Reference<css::awt::grid::XGridColumn> const& i_column);
|
||||
void insertColumn(ColPos const i_position,
|
||||
void insertColumn(sal_Int32 const i_position,
|
||||
css::uno::Reference<css::awt::grid::XGridColumn> const& i_column);
|
||||
void removeColumn(ColPos const i_position);
|
||||
void removeColumn(sal_Int32 const i_position);
|
||||
void removeAllColumns();
|
||||
|
||||
// other operations
|
||||
@@ -129,10 +129,10 @@ public:
|
||||
void notifyDataChanged(css::awt::grid::GridDataEvent const& i_event) const;
|
||||
|
||||
/// retrieves the index of a column within the model
|
||||
ColPos getColumnPos(UnoGridColumnFacade const& i_column) const;
|
||||
sal_Int32 getColumnPos(UnoGridColumnFacade const& i_column) const;
|
||||
|
||||
/// notifies a change in a column belonging to the model
|
||||
void notifyColumnChange(ColPos const i_columnPos,
|
||||
void notifyColumnChange(sal_Int32 const i_columnPos,
|
||||
ColumnAttributeGroup const i_attributeGroup) const;
|
||||
|
||||
/** notifies a change in all data represented by the model. To be used if you cannot specified the changed data
|
||||
|
||||
Reference in New Issue
Block a user