summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-12-03 09:42:07 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-12-03 13:08:55 +0100
commit7563216425c1a43166db083d809073b268f7884f (patch)
tree928275cad10ccd7a762f6959ec6b98fae47578f1
parent7485e13b6a99eedc8730d1a3eb72599213208f26 (diff)
sal_Int32 is sufficient for svx::frame::Array
Change-Id: Icc1ebf769796d23e226b72a3decf74ab15e09e0c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126274 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--include/svx/framelinkarray.hxx104
-rw-r--r--svx/source/dialog/framelinkarray.cxx316
-rw-r--r--svx/source/dialog/frmsel.cxx4
3 files changed, 212 insertions, 212 deletions
diff --git a/include/svx/framelinkarray.hxx b/include/svx/framelinkarray.hxx
index 7cdfd90d794b..46b17c025641 100644
--- a/include/svx/framelinkarray.hxx
+++ b/include/svx/framelinkarray.hxx
@@ -71,57 +71,57 @@ public:
// array size and column/row indexes
/** Reinitializes the array with the specified size. Clears all styles. */
- void Initialize( size_t nWidth, size_t nHeight );
+ void Initialize( sal_Int32 nWidth, sal_Int32 nHeight );
/** Returns the number of columns in the array. */
- size_t GetColCount() const;
+ sal_Int32 GetColCount() const;
/** Returns the number of rows in the array. */
- size_t GetRowCount() const;
+ sal_Int32 GetRowCount() const;
/** Returns the number of cells in the array. */
- size_t GetCellCount() const;
+ sal_Int32 GetCellCount() const;
/** Returns the cell index from the cell address (nCol,nRow). */
- size_t GetCellIndex( size_t nCol, size_t nRow, bool bRTL) const;
+ sal_Int32 GetCellIndex( sal_Int32 nCol, sal_Int32 nRow, bool bRTL) const;
// cell border styles
/** Sets the left frame style of the cell (nCol,nRow). Ignores merged ranges. */
- void SetCellStyleLeft( size_t nCol, size_t nRow, const Style& rStyle );
+ void SetCellStyleLeft( sal_Int32 nCol, sal_Int32 nRow, const Style& rStyle );
/** Sets the right frame style of the cell (nCol,nRow). Ignores merged ranges. */
- void SetCellStyleRight( size_t nCol, size_t nRow, const Style& rStyle );
+ void SetCellStyleRight( sal_Int32 nCol, sal_Int32 nRow, const Style& rStyle );
/** Sets the top frame style of the cell (nCol,nRow). Ignores merged ranges. */
- void SetCellStyleTop( size_t nCol, size_t nRow, const Style& rStyle );
+ void SetCellStyleTop( sal_Int32 nCol, sal_Int32 nRow, const Style& rStyle );
/** Sets the bottom frame style of the specified cell (nCol,nRow). Ignores merged ranges. */
- void SetCellStyleBottom( size_t nCol, size_t nRow, const Style& rStyle );
+ void SetCellStyleBottom( sal_Int32 nCol, sal_Int32 nRow, const Style& rStyle );
/** Sets the top-left to bottom-right frame style of the cell (nCol,nRow). Ignores merged ranges. */
- void SetCellStyleTLBR( size_t nCol, size_t nRow, const Style& rStyle );
+ void SetCellStyleTLBR( sal_Int32 nCol, sal_Int32 nRow, const Style& rStyle );
/** Sets the bottom-left to top-right frame style of the cell (nCol,nRow). Ignores merged ranges. */
- void SetCellStyleBLTR( size_t nCol, size_t nRow, const Style& rStyle );
+ void SetCellStyleBLTR( sal_Int32 nCol, sal_Int32 nRow, const Style& rStyle );
/** Sets both diagonal frame styles of the specified cell (nCol,nRow). Ignores merged ranges. */
- void SetCellStyleDiag( size_t nCol, size_t nRow, const Style& rTLBR, const Style& rBLTR );
+ void SetCellStyleDiag( sal_Int32 nCol, sal_Int32 nRow, const Style& rTLBR, const Style& rBLTR );
/** Sets the left frame style of the specified column. Ignores merged ranges. */
- void SetColumnStyleLeft( size_t nCol, const Style& rStyle );
+ void SetColumnStyleLeft( sal_Int32 nCol, const Style& rStyle );
/** Sets the right frame style of the specified column. Ignores merged ranges. */
- void SetColumnStyleRight( size_t nCol, const Style& rStyle );
+ void SetColumnStyleRight( sal_Int32 nCol, const Style& rStyle );
/** Sets the top frame style of the specified row. Ignores merged ranges. */
- void SetRowStyleTop( size_t nRow, const Style& rStyle );
+ void SetRowStyleTop( sal_Int32 nRow, const Style& rStyle );
/** Sets the bottom frame style of the specified row. Ignores merged ranges. */
- void SetRowStyleBottom( size_t nRow, const Style& rStyle );
+ void SetRowStyleBottom( sal_Int32 nRow, const Style& rStyle );
/** Sets the rotation parameters of the cell (nCol,nRow). Ignores merged ranges. */
- void SetCellRotation(size_t nCol, size_t nRow, SvxRotateMode eRotMode, double fOrientation);
+ void SetCellRotation(sal_Int32 nCol, sal_Int32 nRow, SvxRotateMode eRotMode, double fOrientation);
/** Check if at least one cell is rotated */
bool HasCellRotation() const;
@@ -131,40 +131,40 @@ public:
Returns the style only if visible (i.e. at left border of a merged range).
@return
The left frame style or an invisible style for invalid cell addresses. */
- const Style& GetCellStyleLeft( size_t nCol, size_t nRow ) const;
+ const Style& GetCellStyleLeft( sal_Int32 nCol, sal_Int32 nRow ) const;
/** Returns the right frame style of the cell (nCol,nRow).
Returns thicker of own right style or left style of the cell to the right.
Returns the style only if visible (i.e. at right border of a merged range).
@return
The left frame style or an invisible style for invalid cell addresses. */
- const Style& GetCellStyleRight( size_t nCol, size_t nRow ) const;
+ const Style& GetCellStyleRight( sal_Int32 nCol, sal_Int32 nRow ) const;
/** Returns the top frame style of the cell (nCol,nRow).
Returns thicker of own top style or bottom style of the cell above.
Returns the style only if visible (i.e. at top border of a merged range).
@return
The top frame style or an invisible style for invalid cell addresses. */
- const Style& GetCellStyleTop( size_t nCol, size_t nRow ) const;
+ const Style& GetCellStyleTop( sal_Int32 nCol, sal_Int32 nRow ) const;
/** Returns the top frame style of the cell (nCol,nRow).
Returns thicker of own top style or bottom style of the cell above.
Returns the style only if visible (i.e. at top border of a merged range).
@return
The top frame style or an invisible style for invalid cell addresses. */
- const Style& GetCellStyleBottom( size_t nCol, size_t nRow ) const;
+ const Style& GetCellStyleBottom( sal_Int32 nCol, sal_Int32 nRow ) const;
/** Returns the top-left to bottom-right frame style of the cell (nCol,nRow).
Ignores merged ranges;
@return
The top-left to bottom-right frame style or an invisible style for invalid cell addresses. */
- const Style& GetCellStyleTLBR( size_t nCol, size_t nRow ) const;
+ const Style& GetCellStyleTLBR( sal_Int32 nCol, sal_Int32 nRow ) const;
/** Returns the bottom-left to top-right frame style of the cell (nCol,nRow).
Ignores merged ranges;
@return
The bottom-left to top-right frame style or an invisible style for invalid cell addresses. */
- const Style& GetCellStyleBLTR( size_t nCol, size_t nRow ) const;
+ const Style& GetCellStyleBLTR( sal_Int32 nCol, sal_Int32 nRow ) const;
/** Returns the top-left to bottom-right frame style of the cell (nCol,nRow).
@return
@@ -172,7 +172,7 @@ public:
a merged range, or if (nCol,nRow) is the top-left corner of a merged
range (useful to find connected frame styles).
An invisible style for invalid cell addresses. */
- const Style& GetCellStyleTL( size_t nCol, size_t nRow ) const;
+ const Style& GetCellStyleTL( sal_Int32 nCol, sal_Int32 nRow ) const;
/** Returns the top-left to bottom-right frame style of the cell (nCol,nRow).
@return
@@ -180,7 +180,7 @@ public:
a merged range, or if (nCol,nRow) is the bottom-right corner of a
merged range (useful to find connected frame styles).
An invisible style for invalid cell addresses. */
- const Style& GetCellStyleBR( size_t nCol, size_t nRow ) const;
+ const Style& GetCellStyleBR( sal_Int32 nCol, sal_Int32 nRow ) const;
/** Returns the bottom-left to top-right frame style of the cell (nCol,nRow).
@return
@@ -188,7 +188,7 @@ public:
a merged range, or if (nCol,nRow) is the bottom-left corner of a
merged range (useful to find connected frame styles).
An invisible style for invalid cell addresses. */
- const Style& GetCellStyleBL( size_t nCol, size_t nRow ) const;
+ const Style& GetCellStyleBL( sal_Int32 nCol, sal_Int32 nRow ) const;
/** Returns the bottom-left to top-right frame style of the cell (nCol,nRow).
@return
@@ -196,43 +196,43 @@ public:
a merged range, or if (nCol,nRow) is the top-right corner of a
merged range (useful to find connected frame styles).
An invisible style for invalid cell addresses. */
- const Style& GetCellStyleTR( size_t nCol, size_t nRow ) const;
+ const Style& GetCellStyleTR( sal_Int32 nCol, sal_Int32 nRow ) const;
// cell merging
/** Inserts a new merged cell range.
@precond The range must not intersect other merged ranges. */
- void SetMergedRange( size_t nFirstCol, size_t nFirstRow, size_t nLastCol, size_t nLastRow );
+ void SetMergedRange( sal_Int32 nFirstCol, sal_Int32 nFirstRow, sal_Int32 nLastCol, sal_Int32 nLastRow );
/** Sets an additional left width for the merged range that contains (nCol,nRow).
@descr Useful to handle merged ranges that are not completely part of the array.
@precond The merged range must be at the left border of the array. */
- void SetAddMergedLeftSize( size_t nCol, size_t nRow, tools::Long nAddSize );
+ void SetAddMergedLeftSize( sal_Int32 nCol, sal_Int32 nRow, sal_Int32 nAddSize );
/** Sets an additional right width for the merged range that contains (nCol,nRow).
@descr Useful to handle merged ranges that are not completely part of the array.
@precond The merged range must be at the right border of the array. */
- void SetAddMergedRightSize( size_t nCol, size_t nRow, tools::Long nAddSize );
+ void SetAddMergedRightSize( sal_Int32 nCol, sal_Int32 nRow, sal_Int32 nAddSize );
/** Sets an additional top height for the merged range that contains (nCol,nRow).
@descr Useful to handle merged ranges that are not completely part of the array.
@precond The merged range must be at the top border of the array. */
- void SetAddMergedTopSize( size_t nCol, size_t nRow, tools::Long nAddSize );
+ void SetAddMergedTopSize( sal_Int32 nCol, sal_Int32 nRow, sal_Int32 nAddSize );
/** Sets an additional bottom height for the merged range that contains (nCol,nRow).
@descr Useful to handle merged ranges that are not completely part of the array.
@precond The merged range must be at the bottom border of the array. */
- void SetAddMergedBottomSize( size_t nCol, size_t nRow, tools::Long nAddSize );
+ void SetAddMergedBottomSize( sal_Int32 nCol, sal_Int32 nRow, sal_Int32 nAddSize );
/** Returns true, if the cell (nCol,nRow) is part of a merged range. */
- bool IsMerged( size_t nCol, size_t nRow ) const;
+ bool IsMerged( sal_Int32 nCol, sal_Int32 nRow ) const;
/** Returns the address of the top-left cell of the merged range that contains (nCol,nRow). */
- void GetMergedOrigin( size_t& rnFirstCol, size_t& rnFirstRow, size_t nCol, size_t nRow ) const;
+ void GetMergedOrigin( sal_Int32& rnFirstCol, sal_Int32& rnFirstRow, sal_Int32 nCol, sal_Int32 nRow ) const;
/** Returns the top-left and bottom-right address of the merged range that contains (nCol,nRow). */
- void GetMergedRange( size_t& rnFirstCol, size_t& rnFirstRow,
- size_t& rnLastCol, size_t& rnLastRow, size_t nCol, size_t nRow ) const;
+ void GetMergedRange( sal_Int32& rnFirstCol, sal_Int32& rnFirstRow,
+ sal_Int32& rnLastCol, sal_Int32& rnLastRow, sal_Int32 nCol, sal_Int32 nRow ) const;
// clipping
@@ -245,53 +245,53 @@ public:
in Calc to print single pages and to draw the print preview.
Partly visible diagonal frame borders in merged ranges are correctly
clipped too. This array can handle only one clip range at a time. */
- void SetClipRange( size_t nFirstCol, size_t nFirstRow, size_t nLastCol, size_t nLastRow );
+ void SetClipRange( sal_Int32 nFirstCol, sal_Int32 nFirstRow, sal_Int32 nLastCol, sal_Int32 nLastRow );
// cell coordinates
/** Sets the X output coordinate of the left column. */
- void SetXOffset( tools::Long nXOffset );
+ void SetXOffset( sal_Int32 nXOffset );
/** Sets the Y output coordinate of the top row. */
- void SetYOffset( tools::Long nYOffset );
+ void SetYOffset( sal_Int32 nYOffset );
/** Sets the output width of the specified column. */
- void SetColWidth( size_t nCol, tools::Long nWidth );
+ void SetColWidth( sal_Int32 nCol, sal_Int32 nWidth );
/** Sets the output height of the specified row. */
- void SetRowHeight( size_t nRow, tools::Long nHeight );
+ void SetRowHeight( sal_Int32 nRow, sal_Int32 nHeight );
/** Sets the same output width for all columns. */
- void SetAllColWidths( tools::Long nWidth );
+ void SetAllColWidths( sal_Int32 nWidth );
/** Sets the same output height for all rows. */
- void SetAllRowHeights( tools::Long nHeight );
+ void SetAllRowHeights( sal_Int32 nHeight );
/** Returns the X output coordinate of the left border of the specified column.
@descr The column index <array-width> returns the X output coordinate
of the right array border. */
- tools::Long GetColPosition( size_t nCol ) const;
+ sal_Int32 GetColPosition( sal_Int32 nCol ) const;
/** Returns the Y output coordinate of the top border of the specified row.
@descr The row index <array-height> returns the Y output coordinate
of the bottom array border. */
- tools::Long GetRowPosition( size_t nRow ) const;
+ sal_Int32 GetRowPosition( sal_Int32 nRow ) const;
/** Returns the output width of the specified range of columns. */
- tools::Long GetColWidth( size_t nFirstCol, size_t nLastCol ) const;
+ sal_Int32 GetColWidth( sal_Int32 nFirstCol, sal_Int32 nLastCol ) const;
/** Returns the output height of the specified range of rows. */
- tools::Long GetRowHeight( size_t nFirstRow, size_t nLastRow ) const;
+ sal_Int32 GetRowHeight( sal_Int32 nFirstRow, sal_Int32 nLastRow ) const;
/** Returns the output width of the entire array. */
- tools::Long GetWidth() const;
+ sal_Int32 GetWidth() const;
/** Returns the output height of the entire array. */
- tools::Long GetHeight() const;
+ sal_Int32 GetHeight() const;
/** Returns the output range of the cell (nCol,nRow).
Returns total output range of merged ranges, if bExpandMerged is true. */
- basegfx::B2DRange GetCellRange( size_t nCol, size_t nRow, bool bExpandMerged ) const;
+ basegfx::B2DRange GetCellRange( sal_Int32 nCol, sal_Int32 nRow, bool bExpandMerged ) const;
// mirroring
@@ -304,8 +304,8 @@ public:
@param pForceColor
If not NULL, only this color will be used to draw all frame borders. */
drawinglayer::primitive2d::Primitive2DContainer CreateB2DPrimitiveRange(
- size_t nFirstCol, size_t nFirstRow,
- size_t nLastCol, size_t nLastRow,
+ sal_Int32 nFirstCol, sal_Int32 nFirstRow,
+ sal_Int32 nLastCol, sal_Int32 nLastRow,
const Color* pForceColor ) const;
/** Draws the part of the array, that is inside the clipping range. */
diff --git a/svx/source/dialog/framelinkarray.cxx b/svx/source/dialog/framelinkarray.cxx
index 6c06c303d204..5d146de5868d 100644
--- a/svx/source/dialog/framelinkarray.cxx
+++ b/svx/source/dialog/framelinkarray.cxx
@@ -44,10 +44,10 @@ private:
Style maBLTR;
public:
- tools::Long mnAddLeft;
- tools::Long mnAddRight;
- tools::Long mnAddTop;
- tools::Long mnAddBottom;
+ sal_Int32 mnAddLeft;
+ sal_Int32 mnAddRight;
+ sal_Int32 mnAddTop;
+ sal_Int32 mnAddBottom;
SvxRotateMode meRotMode;
double mfOrientation;
@@ -78,14 +78,14 @@ public:
void MirrorSelfX();
- basegfx::B2DHomMatrix CreateCoordinateSystem(const Array& rArray, size_t nCol, size_t nRow, bool bExpandMerged) const;
+ basegfx::B2DHomMatrix CreateCoordinateSystem(const Array& rArray, sal_Int32 nCol, sal_Int32 nRow, bool bExpandMerged) const;
};
}
typedef std::vector< Cell > CellVec;
-basegfx::B2DHomMatrix Cell::CreateCoordinateSystem(const Array& rArray, size_t nCol, size_t nRow, bool bExpandMerged) const
+basegfx::B2DHomMatrix Cell::CreateCoordinateSystem(const Array& rArray, sal_Int32 nCol, sal_Int32 nRow, bool bExpandMerged) const
{
basegfx::B2DHomMatrix aRetval;
const basegfx::B2DRange aRange(rArray.GetCellRange(nCol, nRow, bExpandMerged));
@@ -152,7 +152,7 @@ void Cell::MirrorSelfX()
}
-static void lclRecalcCoordVec( std::vector<tools::Long>& rCoords, const std::vector<tools::Long>& rSizes )
+static void lclRecalcCoordVec( std::vector<sal_Int32>& rCoords, const std::vector<sal_Int32>& rSizes )
{
DBG_ASSERT( rCoords.size() == rSizes.size() + 1, "lclRecalcCoordVec - inconsistent vectors" );
auto aCIt = rCoords.begin();
@@ -163,11 +163,11 @@ static void lclRecalcCoordVec( std::vector<tools::Long>& rCoords, const std::vec
}
}
-static void lclSetMergedRange( CellVec& rCells, size_t nWidth, size_t nFirstCol, size_t nFirstRow, size_t nLastCol, size_t nLastRow )
+static void lclSetMergedRange( CellVec& rCells, sal_Int32 nWidth, sal_Int32 nFirstCol, sal_Int32 nFirstRow, sal_Int32 nLastCol, sal_Int32 nLastRow )
{
- for( size_t nCol = nFirstCol; nCol <= nLastCol; ++nCol )
+ for( sal_Int32 nCol = nFirstCol; nCol <= nLastCol; ++nCol )
{
- for( size_t nRow = nFirstRow; nRow <= nLastRow; ++nRow )
+ for( sal_Int32 nRow = nFirstRow; nRow <= nLastRow; ++nRow )
{
Cell& rCell = rCells[ nRow * nWidth + nCol ];
rCell.mbMergeOrig = false;
@@ -185,55 +185,55 @@ const Cell OBJ_CELL_NONE;
struct ArrayImpl
{
CellVec maCells;
- std::vector<tools::Long> maWidths;
- std::vector<tools::Long> maHeights;
- mutable std::vector<tools::Long> maXCoords;
- mutable std::vector<tools::Long> maYCoords;
- size_t mnWidth;
- size_t mnHeight;
- size_t mnFirstClipCol;
- size_t mnFirstClipRow;
- size_t mnLastClipCol;
- size_t mnLastClipRow;
+ std::vector<sal_Int32> maWidths;
+ std::vector<sal_Int32> maHeights;
+ mutable std::vector<sal_Int32> maXCoords;
+ mutable std::vector<sal_Int32> maYCoords;
+ sal_Int32 mnWidth;
+ sal_Int32 mnHeight;
+ sal_Int32 mnFirstClipCol;
+ sal_Int32 mnFirstClipRow;
+ sal_Int32 mnLastClipCol;
+ sal_Int32 mnLastClipRow;
mutable bool mbXCoordsDirty;
mutable bool mbYCoordsDirty;
bool mbMayHaveCellRotation;
- explicit ArrayImpl( size_t nWidth, size_t nHeight );
+ explicit ArrayImpl( sal_Int32 nWidth, sal_Int32 nHeight );
- bool IsValidPos( size_t nCol, size_t nRow ) const
+ bool IsValidPos( sal_Int32 nCol, sal_Int32 nRow ) const
{ return (nCol < mnWidth) && (nRow < mnHeight); }
- size_t GetIndex( size_t nCol, size_t nRow ) const
+ sal_Int32 GetIndex( sal_Int32 nCol, sal_Int32 nRow ) const
{ return nRow * mnWidth + nCol; }
- const Cell& GetCell( size_t nCol, size_t nRow ) const;
- Cell& GetCellAcc( size_t nCol, size_t nRow );
+ const Cell& GetCell( sal_Int32 nCol, sal_Int32 nRow ) const;
+ Cell& GetCellAcc( sal_Int32 nCol, sal_Int32 nRow );
- size_t GetMergedFirstCol( size_t nCol, size_t nRow ) const;
- size_t GetMergedFirstRow( size_t nCol, size_t nRow ) const;
- size_t GetMergedLastCol( size_t nCol, size_t nRow ) const;
- size_t GetMergedLastRow( size_t nCol, size_t nRow ) const;
+ sal_Int32 GetMergedFirstCol( sal_Int32 nCol, sal_Int32 nRow ) const;
+ sal_Int32 GetMergedFirstRow( sal_Int32 nCol, sal_Int32 nRow ) const;
+ sal_Int32 GetMergedLastCol( sal_Int32 nCol, sal_Int32 nRow ) const;
+ sal_Int32 GetMergedLastRow( sal_Int32 nCol, sal_Int32 nRow ) const;
- const Cell& GetMergedOriginCell( size_t nCol, size_t nRow ) const;
+ const Cell& GetMergedOriginCell( sal_Int32 nCol, sal_Int32 nRow ) const;
- bool IsMergedOverlappedLeft( size_t nCol, size_t nRow ) const;
- bool IsMergedOverlappedRight( size_t nCol, size_t nRow ) const;
- bool IsMergedOverlappedTop( size_t nCol, size_t nRow ) const;
- bool IsMergedOverlappedBottom( size_t nCol, size_t nRow ) const;
+ bool IsMergedOverlappedLeft( sal_Int32 nCol, sal_Int32 nRow ) const;
+ bool IsMergedOverlappedRight( sal_Int32 nCol, sal_Int32 nRow ) const;
+ bool IsMergedOverlappedTop( sal_Int32 nCol, sal_Int32 nRow ) const;
+ bool IsMergedOverlappedBottom( sal_Int32 nCol, sal_Int32 nRow ) const;
- bool IsInClipRange( size_t nCol, size_t nRow ) const;
- bool IsColInClipRange( size_t nCol ) const;
- bool IsRowInClipRange( size_t nRow ) const;
+ bool IsInClipRange( sal_Int32 nCol, sal_Int32 nRow ) const;
+ bool IsColInClipRange( sal_Int32 nCol ) const;
+ bool IsRowInClipRange( sal_Int32 nRow ) const;
- size_t GetMirrorCol( size_t nCol ) const { return mnWidth - nCol - 1; }
+ sal_Int32 GetMirrorCol( sal_Int32 nCol ) const { return mnWidth - nCol - 1; }
- tools::Long GetColPosition( size_t nCol ) const;
- tools::Long GetRowPosition( size_t nRow ) const;
+ sal_Int32 GetColPosition( sal_Int32 nCol ) const;
+ sal_Int32 GetRowPosition( sal_Int32 nRow ) const;
bool HasCellRotation() const;
};
-ArrayImpl::ArrayImpl( size_t nWidth, size_t nHeight ) :
+ArrayImpl::ArrayImpl( sal_Int32 nWidth, sal_Int32 nHeight ) :
mnWidth( nWidth ),
mnHeight( nHeight ),
mnFirstClipCol( 0 ),
@@ -252,88 +252,88 @@ ArrayImpl::ArrayImpl( size_t nWidth, size_t nHeight ) :
maYCoords.resize( mnHeight + 1, 0 );
}
-const Cell& ArrayImpl::GetCell( size_t nCol, size_t nRow ) const
+const Cell& ArrayImpl::GetCell( sal_Int32 nCol, sal_Int32 nRow ) const
{
return IsValidPos( nCol, nRow ) ? maCells[ GetIndex( nCol, nRow ) ] : OBJ_CELL_NONE;
}
-Cell& ArrayImpl::GetCellAcc( size_t nCol, size_t nRow )
+Cell& ArrayImpl::GetCellAcc( sal_Int32 nCol, sal_Int32 nRow )
{
static Cell aDummy;
return IsValidPos( nCol, nRow ) ? maCells[ GetIndex( nCol, nRow ) ] : aDummy;
}
-size_t ArrayImpl::GetMergedFirstCol( size_t nCol, size_t nRow ) const
+sal_Int32 ArrayImpl::GetMergedFirstCol( sal_Int32 nCol, sal_Int32 nRow ) const
{
- size_t nFirstCol = nCol;
+ sal_Int32 nFirstCol = nCol;
while( (nFirstCol > 0) && GetCell( nFirstCol, nRow ).mbOverlapX ) --nFirstCol;
return nFirstCol;
}
-size_t ArrayImpl::GetMergedFirstRow( size_t nCol, size_t nRow ) const
+sal_Int32 ArrayImpl::GetMergedFirstRow( sal_Int32 nCol, sal_Int32 nRow ) const
{
- size_t nFirstRow = nRow;
+ sal_Int32 nFirstRow = nRow;
while( (nFirstRow > 0) && GetCell( nCol, nFirstRow ).mbOverlapY ) --nFirstRow;
return nFirstRow;
}
-size_t ArrayImpl::GetMergedLastCol( size_t nCol, size_t nRow ) const
+sal_Int32 ArrayImpl::GetMergedLastCol( sal_Int32 nCol, sal_Int32 nRow ) const
{
- size_t nLastCol = nCol + 1;
+ sal_Int32 nLastCol = nCol + 1;
while( (nLastCol < mnWidth) && GetCell( nLastCol, nRow ).mbOverlapX ) ++nLastCol;
return nLastCol - 1;
}
-size_t ArrayImpl::GetMergedLastRow( size_t nCol, size_t nRow ) const
+sal_Int32 ArrayImpl::GetMergedLastRow( sal_Int32 nCol, sal_Int32 nRow ) const
{
- size_t nLastRow = nRow + 1;
+ sal_Int32 nLastRow = nRow + 1;
while( (nLastRow < mnHeight) && GetCell( nCol, nLastRow ).mbOverlapY ) ++nLastRow;
return nLastRow - 1;
}
-const Cell& ArrayImpl::GetMergedOriginCell( size_t nCol, size_t nRow ) const
+const Cell& ArrayImpl::GetMergedOriginCell( sal_Int32 nCol, sal_Int32 nRow ) const
{
return GetCell( GetMergedFirstCol( nCol, nRow ), GetMergedFirstRow( nCol, nRow ) );
}
-bool ArrayImpl::IsMergedOverlappedLeft( size_t nCol, size_t nRow ) const
+bool ArrayImpl::IsMergedOverlappedLeft( sal_Int32 nCol, sal_Int32 nRow ) const
{
const Cell& rCell = GetCell( nCol, nRow );
return rCell.mbOverlapX || (rCell.mnAddLeft > 0);
}
-bool ArrayImpl::IsMergedOverlappedRight( size_t nCol, size_t nRow ) const
+bool ArrayImpl::IsMergedOverlappedRight( sal_Int32 nCol, sal_Int32 nRow ) const
{
return GetCell( nCol + 1, nRow ).mbOverlapX || (GetCell( nCol, nRow ).mnAddRight > 0);
}
-bool ArrayImpl::IsMergedOverlappedTop( size_t nCol, size_t nRow ) const
+bool ArrayImpl::IsMergedOverlappedTop( sal_Int32 nCol, sal_Int32 nRow ) const
{
const Cell& rCell = GetCell( nCol, nRow );
return rCell.mbOverlapY || (rCell.mnAddTop > 0);
}
-bool ArrayImpl::IsMergedOverlappedBottom( size_t nCol, size_t nRow ) const
+bool ArrayImpl::IsMergedOverlappedBottom( sal_Int32 nCol, sal_Int32 nRow ) const
{
return GetCell( nCol, nRow + 1 ).mbOverlapY || (GetCell( nCol, nRow ).mnAddBottom > 0);
}
-bool ArrayImpl::IsColInClipRange( size_t nCol ) const
+bool ArrayImpl::IsColInClipRange( sal_Int32 nCol ) const
{
return (mnFirstClipCol <= nCol) && (nCol <= mnLastClipCol);
}
-bool ArrayImpl::IsRowInClipRange( size_t nRow ) const
+bool ArrayImpl::IsRowInClipRange( sal_Int32 nRow ) const
{
return (mnFirstClipRow <= nRow) && (nRow <= mnLastClipRow);
}
-bool ArrayImpl::IsInClipRange( size_t nCol, size_t nRow ) const
+bool ArrayImpl::IsInClipRange( sal_Int32 nCol, sal_Int32 nRow ) const
{
return IsColInClipRange( nCol ) && IsRowInClipRange( nRow );
}
-tools::Long ArrayImpl::GetColPosition( size_t nCol ) const
+sal_Int32 ArrayImpl::GetColPosition( sal_Int32 nCol ) const
{
if( mbXCoordsDirty )
{
@@ -343,7 +343,7 @@ tools::Long ArrayImpl::GetColPosition( size_t nCol ) const
return maXCoords[ nCol ];
}
-tools::Long ArrayImpl::GetRowPosition( size_t nRow ) const
+sal_Int32 ArrayImpl::GetRowPosition( sal_Int32 nRow ) const
{
if( mbYCoordsDirty )
{
@@ -372,26 +372,26 @@ namespace {
class MergedCellIterator
{
public:
- explicit MergedCellIterator( const Array& rArray, size_t nCol, size_t nRow );
+ explicit MergedCellIterator( const Array& rArray, sal_Int32 nCol, sal_Int32 nRow );
bool Is() const { return (mnCol <= mnLastCol) && (mnRow <= mnLastRow); }
- size_t Col() const { return mnCol; }
- size_t Row() const { return mnRow; }
+ sal_Int32 Col() const { return mnCol; }
+ sal_Int32 Row() const { return mnRow; }
MergedCellIterator& operator++();
private:
- size_t mnFirstCol;
- size_t mnFirstRow;
- size_t mnLastCol;
- size_t mnLastRow;
- size_t mnCol;
- size_t mnRow;
+ sal_Int32 mnFirstCol;
+ sal_Int32 mnFirstRow;
+ sal_Int32 mnLastCol;
+ sal_Int32 mnLastRow;
+ sal_Int32 mnCol;
+ sal_Int32 mnRow;
};
}
-MergedCellIterator::MergedCellIterator( const Array& rArray, size_t nCol, size_t nRow )
+MergedCellIterator::MergedCellIterator( const Array& rArray, sal_Int32 nCol, sal_Int32 nRow )
{
DBG_ASSERT( rArray.IsMerged( nCol, nRow ), "svx::frame::MergedCellIterator::MergedCellIterator - not in merged range" );
rArray.GetMergedRange( mnFirstCol, mnFirstRow, mnLastCol, mnLastRow, nCol, nRow );
@@ -434,27 +434,27 @@ Array::~Array()
}
// array size and column/row indexes
-void Array::Initialize( size_t nWidth, size_t nHeight )
+void Array::Initialize( sal_Int32 nWidth, sal_Int32 nHeight )
{
mxImpl.reset( new ArrayImpl( nWidth, nHeight ) );
}
-size_t Array::GetColCount() const
+sal_Int32 Array::GetColCount() const
{
return mxImpl->mnWidth;
}
-size_t Array::GetRowCount() const
+sal_Int32 Array::GetRowCount() const
{
return mxImpl->mnHeight;
}
-size_t Array::GetCellCount() const
+sal_Int32 Array::GetCellCount() const
{
return mxImpl->maCells.size();
}
-size_t Array::GetCellIndex( size_t nCol, size_t nRow, bool bRTL ) const
+sal_Int32 Array::GetCellIndex( sal_Int32 nCol, sal_Int32 nRow, bool bRTL ) const
{
DBG_FRAME_CHECK_COLROW( nCol, nRow, "GetCellIndex" );
if (bRTL)
@@ -463,43 +463,43 @@ size_t Array::GetCellIndex( size_t nCol, size_t nRow, bool bRTL ) const
}
// cell border styles
-void Array::SetCellStyleLeft( size_t nCol, size_t nRow, const Style& rStyle )
+void Array::SetCellStyleLeft( sal_Int32 nCol, sal_Int32 nRow, const Style& rStyle )
{
DBG_FRAME_CHECK_COLROW( nCol, nRow, "SetCellStyleLeft" );
CELLACC( nCol, nRow ).SetStyleLeft(rStyle);
}
-void Array::SetCellStyleRight( size_t nCol, size_t nRow, const Style& rStyle )
+void Array::SetCellStyleRight( sal_Int32 nCol, sal_Int32 nRow, const Style& rStyle )
{
DBG_FRAME_CHECK_COLROW( nCol, nRow, "SetCellStyleRight" );
CELLACC( nCol, nRow ).SetStyleRight(rStyle);
}
-void Array::SetCellStyleTop( size_t nCol, size_t nRow, const Style& rStyle )
+void Array::SetCellStyleTop( sal_Int32 nCol, sal_Int32 nRow, const Style& rStyle )
{
DBG_FRAME_CHECK_COLROW( nCol, nRow, "SetCellStyleTop" );
CELLACC( nCol, nRow ).SetStyleTop(rStyle);
}
-void Array::SetCellStyleBottom( size_t nCol, size_t nRow, const Style& rStyle )
+void Array::SetCellStyleBottom( sal_Int32 nCol, sal_Int32 nRow, const Style& rStyle )
{
DBG_FRAME_CHECK_COLROW( nCol, nRow, "SetCellStyleBottom" );
CELLACC( nCol, nRow ).SetStyleBottom(rStyle);
}
-void Array::SetCellStyleTLBR( size_t nCol, size_t nRow, const Style& rStyle )
+void Array::SetCellStyleTLBR( sal_Int32 nCol, sal_Int32 nRow, const Style& rStyle )
{
DBG_FRAME_CHECK_COLROW( nCol, nRow, "SetCellStyleTLBR" );
CELLACC( nCol, nRow ).SetStyleTLBR(rStyle);
}
-void Array::SetCellStyleBLTR( size_t nCol, size_t nRow, const Style& rStyle )
+void Array::SetCellStyleBLTR( sal_Int32 nCol, sal_Int32 nRow, const Style& rStyle )
{
DBG_FRAME_CHECK_COLROW( nCol, nRow, "SetCellStyleBLTR" );
CELLACC( nCol, nRow ).SetStyleBLTR(rStyle);
}
-void Array::SetCellStyleDiag( size_t nCol, size_t nRow, const Style& rTLBR, const Style& rBLTR )
+void Array::SetCellStyleDiag( sal_Int32 nCol, sal_Int32 nRow, const Style& rTLBR, const Style& rBLTR )
{
DBG_FRAME_CHECK_COLROW( nCol, nRow, "SetCellStyleDiag" );
Cell& rCell = CELLACC( nCol, nRow );
@@ -507,35 +507,35 @@ void Array::SetCellStyleDiag( size_t nCol, size_t nRow, const Style& rTLBR, cons
rCell.SetStyleBLTR(rBLTR);
}
-void Array::SetColumnStyleLeft( size_t nCol, const Style& rStyle )
+void Array::SetColumnStyleLeft( sal_Int32 nCol, const Style& rStyle )
{
DBG_FRAME_CHECK_COL( nCol, "SetColumnStyleLeft" );
- for( size_t nRow = 0; nRow < mxImpl->mnHeight; ++nRow )
+ for( sal_Int32 nRow = 0; nRow < mxImpl->mnHeight; ++nRow )
SetCellStyleLeft( nCol, nRow, rStyle );
}
-void Array::SetColumnStyleRight( size_t nCol, const Style& rStyle )
+void Array::SetColumnStyleRight( sal_Int32 nCol, const Style& rStyle )
{
DBG_FRAME_CHECK_COL( nCol, "SetColumnStyleRight" );
- for( size_t nRow = 0; nRow < mxImpl->mnHeight; ++nRow )
+ for( sal_Int32 nRow = 0; nRow < mxImpl->mnHeight; ++nRow )
SetCellStyleRight( nCol, nRow, rStyle );
}
-void Array::SetRowStyleTop( size_t nRow, const Style& rStyle )
+void Array::SetRowStyleTop( sal_Int32 nRow, const Style& rStyle )
{
DBG_FRAME_CHECK_ROW( nRow, "SetRowStyleTop" );
- for( size_t nCol = 0; nCol < mxImpl->mnWidth; ++nCol )
+ for( sal_Int32 nCol = 0; nCol < mxImpl->mnWidth; ++nCol )
SetCellStyleTop( nCol, nRow, rStyle );
}
-void Array::SetRowStyleBottom( size_t nRow, const Style& rStyle )
+void Array::SetRowStyleBottom( sal_Int32 nRow, const Style& rStyle )
{
DBG_FRAME_CHECK_ROW( nRow, "SetRowStyleBottom" );
- for( size_t nCol = 0; nCol < mxImpl->mnWidth; ++nCol )
+ for( sal_Int32 nCol = 0; nCol < mxImpl->mnWidth; ++nCol )
SetCellStyleBottom( nCol, nRow, rStyle );
}
-void Array::SetCellRotation(size_t nCol, size_t nRow, SvxRotateMode eRotMode, double fOrientation)
+void Array::SetCellRotation(sal_Int32 nCol, sal_Int32 nRow, SvxRotateMode eRotMode, double fOrientation)
{
DBG_FRAME_CHECK_COLROW(nCol, nRow, "SetCellRotation");
Cell& rTarget = CELLACC(nCol, nRow);
@@ -561,7 +561,7 @@ bool Array::HasCellRotation() const
return mxImpl->HasCellRotation();
}
-const Style& Array::GetCellStyleLeft( size_t nCol, size_t nRow ) const
+const Style& Array::GetCellStyleLeft( sal_Int32 nCol, sal_Int32 nRow ) const
{
// outside clipping rows or overlapped in merged cells: invisible
if( !mxImpl->IsRowInClipRange( nRow ) || mxImpl->IsMergedOverlappedLeft( nCol, nRow ) )
@@ -579,7 +579,7 @@ const Style& Array::GetCellStyleLeft( size_t nCol, size_t nRow ) const
return std::max( ORIGCELL( nCol, nRow ).GetStyleLeft(), ORIGCELL( nCol - 1, nRow ).GetStyleRight() );
}
-const Style& Array::GetCellStyleRight( size_t nCol, size_t nRow ) const
+const Style& Array::GetCellStyleRight( sal_Int32 nCol, sal_Int32 nRow ) const
{
// outside clipping rows or overlapped in merged cells: invisible
if( !mxImpl->IsRowInClipRange( nRow ) || mxImpl->IsMergedOverlappedRight( nCol, nRow ) )
@@ -597,7 +597,7 @@ const Style& Array::GetCellStyleRight( size_t nCol, size_t nRow ) const
return std::max( ORIGCELL( nCol, nRow ).GetStyleRight(), ORIGCELL( nCol + 1, nRow ).GetStyleLeft() );
}
-const Style& Array::GetCellStyleTop( size_t nCol, size_t nRow ) const
+const Style& Array::GetCellStyleTop( sal_Int32 nCol, sal_Int32 nRow ) const
{
// outside clipping columns or overlapped in merged cells: invisible
if( !mxImpl->IsColInClipRange( nCol ) || mxImpl->IsMergedOverlappedTop( nCol, nRow ) )
@@ -615,7 +615,7 @@ const Style& Array::GetCellStyleTop( size_t nCol, size_t nRow ) const
return std::max( ORIGCELL( nCol, nRow ).GetStyleTop(), ORIGCELL( nCol, nRow - 1 ).GetStyleBottom() );
}
-const Style& Array::GetCellStyleBottom( size_t nCol, size_t nRow ) const
+const Style& Array::GetCellStyleBottom( sal_Int32 nCol, sal_Int32 nRow ) const
{
// outside clipping columns or overlapped in merged cells: invisible
if( !mxImpl->IsColInClipRange( nCol ) || mxImpl->IsMergedOverlappedBottom( nCol, nRow ) )
@@ -633,74 +633,74 @@ const Style& Array::GetCellStyleBottom( size_t nCol, size_t nRow ) const
return std::max( ORIGCELL( nCol, nRow ).GetStyleBottom(), ORIGCELL( nCol, nRow + 1 ).GetStyleTop() );
}
-const Style& Array::GetCellStyleTLBR( size_t nCol, size_t nRow ) const
+const Style& Array::GetCellStyleTLBR( sal_Int32 nCol, sal_Int32 nRow ) const
{
return CELL( nCol, nRow ).GetStyleTLBR();
}
-const Style& Array::GetCellStyleBLTR( size_t nCol, size_t nRow ) const
+const Style& Array::GetCellStyleBLTR( sal_Int32 nCol, sal_Int32 nRow ) const
{
return CELL( nCol, nRow ).GetStyleBLTR();
}
-const Style& Array::GetCellStyleTL( size_t nCol, size_t nRow ) const
+const Style& Array::GetCellStyleTL( sal_Int32 nCol, sal_Int32 nRow ) const
{
// not in clipping range: always invisible
if( !mxImpl->IsInClipRange( nCol, nRow ) )
return OBJ_STYLE_NONE;
// return style only for top-left cell
- size_t nFirstCol = mxImpl->GetMergedFirstCol( nCol, nRow );
- size_t nFirstRow = mxImpl->GetMergedFirstRow( nCol, nRow );
+ sal_Int32 nFirstCol = mxImpl->GetMergedFirstCol( nCol, nRow );
+ sal_Int32 nFirstRow = mxImpl->GetMergedFirstRow( nCol, nRow );
return ((nCol == nFirstCol) && (nRow == nFirstRow)) ?
CELL( nFirstCol, nFirstRow ).GetStyleTLBR() : OBJ_STYLE_NONE;
}
-const Style& Array::GetCellStyleBR( size_t nCol, size_t nRow ) const
+const Style& Array::GetCellStyleBR( sal_Int32 nCol, sal_Int32 nRow ) const
{
// not in clipping range: always invisible
if( !mxImpl->IsInClipRange( nCol, nRow ) )
return OBJ_STYLE_NONE;
// return style only for bottom-right cell
- size_t nLastCol = mxImpl->GetMergedLastCol( nCol, nRow );
- size_t nLastRow = mxImpl->GetMergedLastRow( nCol, nRow );
+ sal_Int32 nLastCol = mxImpl->GetMergedLastCol( nCol, nRow );
+ sal_Int32 nLastRow = mxImpl->GetMergedLastRow( nCol, nRow );
return ((nCol == nLastCol) && (nRow == nLastRow)) ?
CELL( mxImpl->GetMergedFirstCol( nCol, nRow ), mxImpl->GetMergedFirstRow( nCol, nRow ) ).GetStyleTLBR() : OBJ_STYLE_NONE;
}
-const Style& Array::GetCellStyleBL( size_t nCol, size_t nRow ) const
+const Style& Array::GetCellStyleBL( sal_Int32 nCol, sal_Int32 nRow ) const
{
// not in clipping range: always invisible
if( !mxImpl->IsInClipRange( nCol, nRow ) )
return OBJ_STYLE_NONE;
// return style only for bottom-left cell
- size_t nFirstCol = mxImpl->GetMergedFirstCol( nCol, nRow );
- size_t nLastRow = mxImpl->GetMergedLastRow( nCol, nRow );
+ sal_Int32 nFirstCol = mxImpl->GetMergedFirstCol( nCol, nRow );
+ sal_Int32 nLastRow = mxImpl->GetMergedLastRow( nCol, nRow );
return ((nCol == nFirstCol) && (nRow == nLastRow)) ?
CELL( nFirstCol, mxImpl->GetMergedFirstRow( nCol, nRow ) ).GetStyleBLTR() : OBJ_STYLE_NONE;
}
-const Style& Array::GetCellStyleTR( size_t nCol, size_t nRow ) const
+const Style& Array::GetCellStyleTR( sal_Int32 nCol, sal_Int32 nRow ) const
{
// not in clipping range: always invisible
if( !mxImpl->IsInClipRange( nCol, nRow ) )
return OBJ_STYLE_NONE;
// return style only for top-right cell
- size_t nFirstRow = mxImpl->GetMergedFirstRow( nCol, nRow );
- size_t nLastCol = mxImpl->GetMergedLastCol( nCol, nRow );
+ sal_Int32 nFirstRow = mxImpl->GetMergedFirstRow( nCol, nRow );
+ sal_Int32 nLastCol = mxImpl->GetMergedLastCol( nCol, nRow );
return ((nCol == nLastCol) && (nRow == nFirstRow)) ?
CELL( mxImpl->GetMergedFirstCol( nCol, nRow ), nFirstRow ).GetStyleBLTR() : OBJ_STYLE_NONE;
}
// cell merging
-void Array::SetMergedRange( size_t nFirstCol, size_t nFirstRow, size_t nLastCol, size_t nLastRow )
+void Array::SetMergedRange( sal_Int32 nFirstCol, sal_Int32 nFirstRow, sal_Int32 nLastCol, sal_Int32 nLastRow )
{
DBG_FRAME_CHECK_COLROW( nFirstCol, nFirstRow, "SetMergedRange" );
DBG_FRAME_CHECK_COLROW( nLastCol, nLastRow, "SetMergedRange" );
#if OSL_DEBUG_LEVEL >= 2
{
bool bFound = false;
- for( size_t nCurrCol = nFirstCol; !bFound && (nCurrCol <= nLastCol); ++nCurrCol )
- for( size_t nCurrRow = nFirstRow; !bFound && (nCurrRow <= nLastRow); ++nCurrRow )
+ for( sal_Int32 nCurrCol = nFirstCol; !bFound && (nCurrCol <= nLastCol); ++nCurrCol )
+ for( sal_Int32 nCurrRow = nFirstRow; !bFound && (nCurrRow <= nLastRow); ++nCurrRow )
bFound = CELL( nCurrCol, nCurrRow ).IsMerged();
DBG_FRAME_CHECK( !bFound, "SetMergedRange", "overlapping merged ranges" );
}
@@ -709,7 +709,7 @@ void Array::SetMergedRange( size_t nFirstCol, size_t nFirstRow, size_t nLastCol,
lclSetMergedRange( mxImpl->maCells, mxImpl->mnWidth, nFirstCol, nFirstRow, nLastCol, nLastRow );
}
-void Array::SetAddMergedLeftSize( size_t nCol, size_t nRow, tools::Long nAddSize )
+void Array::SetAddMergedLeftSize( sal_Int32 nCol, sal_Int32 nRow, sal_Int32 nAddSize )
{
DBG_FRAME_CHECK_COLROW( nCol, nRow, "SetAddMergedLeftSize" );
DBG_FRAME_CHECK( mxImpl->GetMergedFirstCol( nCol, nRow ) == 0, "SetAddMergedLeftSize", "additional border inside array" );
@@ -717,7 +717,7 @@ void Array::SetAddMergedLeftSize( size_t nCol, size_t nRow, tools::Long nAddSize
CELLACC( aIt.Col(), aIt.Row() ).mnAddLeft = nAddSize;
}
-void Array::SetAddMergedRightSize( size_t nCol, size_t nRow, tools::Long nAddSize )
+void Array::SetAddMergedRightSize( sal_Int32 nCol, sal_Int32 nRow, sal_Int32 nAddSize )
{
DBG_FRAME_CHECK_COLROW( nCol, nRow, "SetAddMergedRightSize" );
DBG_FRAME_CHECK( mxImpl->GetMergedLastCol( nCol, nRow ) + 1 == mxImpl->mnWidth, "SetAddMergedRightSize", "additional border inside array" );
@@ -725,7 +725,7 @@ void Array::SetAddMergedRightSize( size_t nCol, size_t nRow, tools::Long nAddSiz
CELLACC( aIt.Col(), aIt.Row() ).mnAddRight = nAddSize;
}
-void Array::SetAddMergedTopSize( size_t nCol, size_t nRow, tools::Long nAddSize )
+void Array::SetAddMergedTopSize( sal_Int32 nCol, sal_Int32 nRow, sal_Int32 nAddSize )
{
DBG_FRAME_CHECK_COLROW( nCol, nRow, "SetAddMergedTopSize" );
DBG_FRAME_CHECK( mxImpl->GetMergedFirstRow( nCol, nRow ) == 0, "SetAddMergedTopSize", "additional border inside array" );
@@ -733,7 +733,7 @@ void Array::SetAddMergedTopSize( size_t nCol, size_t nRow, tools::Long nAddSize
CELLACC( aIt.Col(), aIt.Row() ).mnAddTop = nAddSize;
}
-void Array::SetAddMergedBottomSize( size_t nCol, size_t nRow, tools::Long nAddSize )
+void Array::SetAddMergedBottomSize( sal_Int32 nCol, sal_Int32 nRow, sal_Int32 nAddSize )
{
DBG_FRAME_CHECK_COLROW( nCol, nRow, "SetAddMergedBottomSize" );
DBG_FRAME_CHECK( mxImpl->GetMergedLastRow( nCol, nRow ) + 1 == mxImpl->mnHeight, "SetAddMergedBottomSize", "additional border inside array" );
@@ -741,21 +741,21 @@ void Array::SetAddMergedBottomSize( size_t nCol, size_t nRow, tools::Long nAddSi
CELLACC( aIt.Col(), aIt.Row() ).mnAddBottom = nAddSize;
}
-bool Array::IsMerged( size_t nCol, size_t nRow ) const
+bool Array::IsMerged( sal_Int32 nCol, sal_Int32 nRow ) const
{
DBG_FRAME_CHECK_COLROW( nCol, nRow, "IsMerged" );
return CELL( nCol, nRow ).IsMerged();
}
-void Array::GetMergedOrigin( size_t& rnFirstCol, size_t& rnFirstRow, size_t nCol, size_t nRow ) const
+void Array::GetMergedOrigin( sal_Int32& rnFirstCol, sal_Int32& rnFirstRow, sal_Int32 nCol, sal_Int32 nRow ) const
{
DBG_FRAME_CHECK_COLROW( nCol, nRow, "GetMergedOrigin" );
rnFirstCol = mxImpl->GetMergedFirstCol( nCol, nRow );
rnFirstRow = mxImpl->GetMergedFirstRow( nCol, nRow );
}
-void Array::GetMergedRange( size_t& rnFirstCol, size_t& rnFirstRow,
- size_t& rnLastCol, size_t& rnLastRow, size_t nCol, size_t nRow ) const
+void Array::GetMergedRange( sal_Int32& rnFirstCol, sal_Int32& rnFirstRow,
+ sal_Int32& rnLastCol, sal_Int32& rnLastRow, sal_Int32 nCol, sal_Int32 nRow ) const
{
GetMergedOrigin( rnFirstCol, rnFirstRow, nCol, nRow );
rnLastCol = mxImpl->GetMergedLastCol( nCol, nRow );
@@ -763,7 +763,7 @@ void Array::GetMergedRange( size_t& rnFirstCol, size_t& rnFirstRow,
}
// clipping
-void Array::SetClipRange( size_t nFirstCol, size_t nFirstRow, size_t nLastCol, size_t nLastRow )
+void Array::SetClipRange( sal_Int32 nFirstCol, sal_Int32 nFirstRow, sal_Int32 nLastCol, sal_Int32 nLastRow )
{
DBG_FRAME_CHECK_COLROW( nFirstCol, nFirstRow, "SetClipRange" );
DBG_FRAME_CHECK_COLROW( nLastCol, nLastRow, "SetClipRange" );
@@ -774,89 +774,89 @@ void Array::SetClipRange( size_t nFirstCol, size_t nFirstRow, size_t nLastCol, s
}
// cell coordinates
-void Array::SetXOffset( tools::Long nXOffset )
+void Array::SetXOffset( sal_Int32 nXOffset )
{
mxImpl->maXCoords[ 0 ] = nXOffset;
mxImpl->mbXCoordsDirty = true;
}
-void Array::SetYOffset( tools::Long nYOffset )
+void Array::SetYOffset( sal_Int32 nYOffset )
{
mxImpl->maYCoords[ 0 ] = nYOffset;
mxImpl->mbYCoordsDirty = true;
}
-void Array::SetColWidth( size_t nCol, tools::Long nWidth )
+void Array::SetColWidth( sal_Int32 nCol, sal_Int32 nWidth )
{
DBG_FRAME_CHECK_COL( nCol, "SetColWidth" );
mxImpl->maWidths[ nCol ] = nWidth;
mxImpl->mbXCoordsDirty = true;
}
-void Array::SetRowHeight( size_t nRow, tools::Long nHeight )
+void Array::SetRowHeight( sal_Int32 nRow, sal_Int32 nHeight )
{
DBG_FRAME_CHECK_ROW( nRow, "SetRowHeight" );
mxImpl->maHeights[ nRow ] = nHeight;
mxImpl->mbYCoordsDirty = true;
}
-void Array::SetAllColWidths( tools::Long nWidth )
+void Array::SetAllColWidths( sal_Int32 nWidth )
{
std::fill( mxImpl->maWidths.begin(), mxImpl->maWidths.end(), nWidth );
mxImpl->mbXCoordsDirty = true;
}
-void Array::SetAllRowHeights( tools::Long nHeight )
+void Array::SetAllRowHeights( sal_Int32 nHeight )
{
std::fill( mxImpl->maHeights.begin(), mxImpl->maHeights.end(), nHeight );
mxImpl->mbYCoordsDirty = true;
}
-tools::Long Array::GetColPosition( size_t nCol ) const
+sal_Int32 Array::GetColPosition( sal_Int32 nCol ) const
{
DBG_FRAME_CHECK_COL_1( nCol, "GetColPosition" );
return mxImpl->GetColPosition( nCol );
}
-tools::Long Array::GetRowPosition( size_t nRow ) const
+sal_Int32 Array::GetRowPosition( sal_Int32 nRow ) const
{
DBG_FRAME_CHECK_ROW_1( nRow, "GetRowPosition" );
return mxImpl->GetRowPosition( nRow );
}
-tools::Long Array::GetColWidth( size_t nFirstCol, size_t nLastCol ) const
+sal_Int32 Array::GetColWidth( sal_Int32 nFirstCol, sal_Int32 nLastCol ) const
{
DBG_FRAME_CHECK_COL( nFirstCol, "GetColWidth" );
DBG_FRAME_CHECK_COL( nLastCol, "GetColWidth" );
return GetColPosition( nLastCol + 1 ) - GetColPosition( nFirstCol );
}
-tools::Long Array::GetRowHeight( size_t nFirstRow, size_t nLastRow ) const
+sal_Int32 Array::GetRowHeight( sal_Int32 nFirstRow, sal_Int32 nLastRow ) const
{
DBG_FRAME_CHECK_ROW( nFirstRow, "GetRowHeight" );
DBG_FRAME_CHECK_ROW( nLastRow, "GetRowHeight" );
return GetRowPosition( nLastRow + 1 ) - GetRowPosition( nFirstRow );
}
-tools::Long Array::GetWidth() const
+sal_Int32 Array::GetWidth() const
{
return GetColPosition( mxImpl->mnWidth ) - GetColPosition( 0 );
}
-tools::Long Array::GetHeight() const
+sal_Int32 Array::GetHeight() const
{
return GetRowPosition( mxImpl->mnHeight ) - GetRowPosition( 0 );
}
-basegfx::B2DRange Array::GetCellRange( size_t nCol, size_t nRow, bool bExpandMerged ) const
+basegfx::B2DRange Array::GetCellRange( sal_Int32 nCol, sal_Int32 nRow, bool bExpandMerged ) const
{
if(bExpandMerged)
{
// get the Range of the fully expanded cell (if merged)
- const size_t nFirstCol(mxImpl->GetMergedFirstCol( nCol, nRow ));
- const size_t nFirstRow(mxImpl->GetMergedFirstRow( nCol, nRow ));
- const size_t nLastCol(mxImpl->GetMergedLastCol( nCol, nRow ));
- const size_t nLastRow(mxImpl->GetMergedLastRow( nCol, nRow ));
+ const sal_Int32 nFirstCol(mxImpl->GetMergedFirstCol( nCol, nRow ));
+ const sal_Int32 nFirstRow(mxImpl->GetMergedFirstRow( nCol, nRow ));
+ const sal_Int32 nLastCol(mxImpl->GetMergedLastCol( nCol, nRow ));
+ const sal_Int32 nLastRow(mxImpl->GetMergedLastRow( nCol, nRow ));
const Point aPoint( GetColPosition( nFirstCol ), GetRowPosition( nFirstRow ) );
const Size aSize( GetColWidth( nFirstCol, nLastCol ) + 1, GetRowHeight( nFirstRow, nLastRow ) + 1 );
tools::Rectangle aRect(aPoint, aSize);
@@ -896,7 +896,7 @@ void Array::MirrorSelfX()
CellVec aNewCells;
aNewCells.reserve( GetCellCount() );
- size_t nCol, nRow;
+ sal_Int32 nCol, nRow;
for( nRow = 0; nRow < mxImpl->mnHeight; ++nRow )
{
for( nCol = 0; nCol < mxImpl->mnWidth; ++nCol )
@@ -911,8 +911,8 @@ void Array::MirrorSelfX()
{
if( CELL( nCol, nRow ).mbMergeOrig )
{
- size_t nLastCol = mxImpl->GetMergedLastCol( nCol, nRow );
- size_t nLastRow = mxImpl->GetMergedLastRow( nCol, nRow );
+ sal_Int32 nLastCol = mxImpl->GetMergedLastCol( nCol, nRow );
+ sal_Int32 nLastRow = mxImpl->GetMergedLastRow( nCol, nRow );
lclSetMergedRange( aNewCells, mxImpl->mnWidth,
mxImpl->GetMirrorCol( nLastCol ), nRow,
mxImpl->GetMirrorCol( nCol ), nLastRow );
@@ -929,8 +929,8 @@ void Array::MirrorSelfX()
static void HelperCreateHorizontalEntry(
const Array& rArray,
const Style& rStyle,
- size_t col,
- size_t row,
+ sal_Int32 col,
+ sal_Int32 row,
const basegfx::B2DPoint& rOrigin,
const basegfx::B2DVector& rX,
const basegfx::B2DVector& rY,
@@ -976,8 +976,8 @@ static void HelperCreateHorizontalEntry(
static void HelperCreateVerticalEntry(
const Array& rArray,
const Style& rStyle,
- size_t col,
- size_t row,
+ sal_Int32 col,
+ sal_Int32 row,
const basegfx::B2DPoint& rOrigin,
const basegfx::B2DVector& rX,
const basegfx::B2DVector& rY,
@@ -1021,7 +1021,7 @@ static void HelperCreateVerticalEntry(
}
drawinglayer::primitive2d::Primitive2DContainer Array::CreateB2DPrimitiveRange(
- size_t nFirstCol, size_t nFirstRow, size_t nLastCol, size_t nLastRow,
+ sal_Int32 nFirstCol, sal_Int32 nFirstRow, sal_Int32 nLastCol, sal_Int32 nLastRow,
const Color* pForceColor ) const
{
DBG_FRAME_CHECK_COLROW( nFirstCol, nFirstRow, "CreateB2DPrimitiveRange" );
@@ -1043,22 +1043,22 @@ drawinglayer::primitive2d::Primitive2DContainer Array::CreateB2DPrimitiveRange(
// Checked usages, this method is used in Calc EditView/Print/Export stuff and
// in UI (Dialog), not for Writer Tables and Draw/Impress tables. All usages
// seem okay with this change, so I will add it.
- const size_t nStartRow(nFirstRow > 0 ? nFirstRow - 1 : nFirstRow);
- const size_t nEndRow(nLastRow < GetRowCount() - 1 ? nLastRow + 1 : nLastRow);
- const size_t nStartCol(nFirstCol > 0 ? nFirstCol - 1 : nFirstCol);
- const size_t nEndCol(nLastCol < GetColCount() - 1 ? nLastCol + 1 : nLastCol);
+ const sal_Int32 nStartRow(nFirstRow > 0 ? nFirstRow - 1 : nFirstRow);
+ const sal_Int32 nEndRow(nLastRow < GetRowCount() - 1 ? nLastRow + 1 : nLastRow);
+ const sal_Int32 nStartCol(nFirstCol > 0 ? nFirstCol - 1 : nFirstCol);
+ const sal_Int32 nEndCol(nLastCol < GetColCount() - 1 ? nLastCol + 1 : nLastCol);
// prepare SdrFrameBorderDataVector
std::shared_ptr<drawinglayer::primitive2d::SdrFrameBorderDataVector> aData(
std::make_shared<drawinglayer::primitive2d::SdrFrameBorderDataVector>());
// remember for which merged cells crossed lines were already created. To
- // do so, hold the size_t cell index in a set for fast check
- std::set< size_t > aMergedCells;
+ // do so, hold the sal_Int32 cell index in a set for fast check
+ std::set< sal_Int32 > aMergedCells;
- for (size_t nRow(nStartRow); nRow <= nEndRow; ++nRow)
+ for (sal_Int32 nRow(nStartRow); nRow <= nEndRow; ++nRow)
{
- for (size_t nCol(nStartCol); nCol <= nEndCol; ++nCol)
+ for (sal_Int32 nCol(nStartCol); nCol <= nEndCol; ++nCol)
{
// get Cell and CoordinateSystem (*only* for this Cell, do *not* expand for
// merged cells (!)), check if used (non-empty vectors)
@@ -1156,9 +1156,9 @@ drawinglayer::primitive2d::Primitive2DContainer Array::CreateB2DPrimitiveRange(
{
// first check if this merged cell was already handled. To do so,
// calculate and use the index of the TopLeft cell
- const size_t _nMergedFirstCol(mxImpl->GetMergedFirstCol(nCol, nRow));
- const size_t _nMergedFirstRow(mxImpl->GetMergedFirstRow(nCol, nRow));
- const size_t nIndexOfMergedCell(mxImpl->GetIndex(_nMergedFirstCol, _nMergedFirstRow));
+ const sal_Int32 _nMergedFirstCol(mxImpl->GetMergedFirstCol(nCol, nRow));
+ const sal_Int32 _nMergedFirstRow(mxImpl->GetMergedFirstRow(nCol, nRow));
+ const sal_Int32 nIndexOfMergedCell(mxImpl->GetIndex(_nMergedFirstCol, _nMergedFirstRow));
bContinue = (aMergedCells.end() == aMergedCells.find(nIndexOfMergedCell));
if(bContinue)
diff --git a/svx/source/dialog/frmsel.cxx b/svx/source/dialog/frmsel.cxx
index 7f11b1b7708f..e2be7400f89c 100644
--- a/svx/source/dialog/frmsel.cxx
+++ b/svx/source/dialog/frmsel.cxx
@@ -676,8 +676,8 @@ void FrameSelectorImpl::DrawAllFrameBorders()
rBottomStyle.Type(), rBottomStyle.PatternScale() );
maArray.SetRowStyleBottom( mbHor ? 1 : 0, rInvertedBottom );
- for( size_t nCol = 0; nCol < maArray.GetColCount(); ++nCol )
- for( size_t nRow = 0; nRow < maArray.GetRowCount(); ++nRow )
+ for( sal_Int32 nCol = 0; nCol < maArray.GetColCount(); ++nCol )
+ for( sal_Int32 nRow = 0; nRow < maArray.GetRowCount(); ++nRow )
maArray.SetCellStyleDiag( nCol, nRow, maTLBR.GetUIStyle(), maBLTR.GetUIStyle() );
// This is used in the dialog/control for 'Border' attributes. When using