summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-03-23 20:43:05 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-03-24 08:50:56 +0100
commit6ed4be1257ef76db4d0ac858a27ea6bd12bd3de1 (patch)
tree004f04f780ee8db5f60c077d18e7a650a73d2b09 /svx
parent7f4ecf3263db9f40fcb5f02e62fdb45c1fc355bc (diff)
loplugin:constantparam
Change-Id: Ib65abd0546f1219387fe3fd7ad4f6ba0eb029bd1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/131987 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/dialog/framelinkarray.cxx61
-rw-r--r--svx/source/dialog/frmsel.cxx4
2 files changed, 27 insertions, 38 deletions
diff --git a/svx/source/dialog/framelinkarray.cxx b/svx/source/dialog/framelinkarray.cxx
index 27e227c678ad..aabce64ba78e 100644
--- a/svx/source/dialog/framelinkarray.cxx
+++ b/svx/source/dialog/framelinkarray.cxx
@@ -919,46 +919,35 @@ sal_Int32 Array::GetHeight() const
return GetRowPosition( mxImpl->mnHeight ) - GetRowPosition( 0 );
}
-basegfx::B2DRange Array::GetCellRange( sal_Int32 nCol, sal_Int32 nRow, bool bExpandMerged ) const
+basegfx::B2DRange Array::GetCellRange( sal_Int32 nCol, sal_Int32 nRow ) const
{
- if(bExpandMerged)
- {
- // get the Range of the fully expanded cell (if merged)
- 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);
-
- // adjust rectangle for partly visible merged cells
- const Cell& rCell = CELL( nCol, nRow );
-
- if( rCell.IsMerged() )
- {
- // not *sure* what exactly this is good for,
- // it is just a hard set extension at merged cells,
- // probably *should* be included in the above extended
- // GetColPosition/GetColWidth already. This might be
- // added due to GetColPosition/GetColWidth not working
- // correctly over PageChanges (if used), but not sure.
- aRect.AdjustLeft( -(rCell.mnAddLeft) );
- aRect.AdjustRight(rCell.mnAddRight );
- aRect.AdjustTop( -(rCell.mnAddTop) );
- aRect.AdjustBottom(rCell.mnAddBottom );
- }
+ // get the Range of the fully expanded cell (if merged)
+ 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);
- return vcl::unotools::b2DRectangleFromRectangle(aRect);
- }
- else
- {
- const Point aPoint( GetColPosition( nCol ), GetRowPosition( nRow ) );
- const Size aSize( GetColWidth( nCol, nCol ) + 1, GetRowHeight( nRow, nRow ) + 1 );
- const tools::Rectangle aRect(aPoint, aSize);
+ // adjust rectangle for partly visible merged cells
+ const Cell& rCell = CELL( nCol, nRow );
- return vcl::unotools::b2DRectangleFromRectangle(aRect);
+ if( rCell.IsMerged() )
+ {
+ // not *sure* what exactly this is good for,
+ // it is just a hard set extension at merged cells,
+ // probably *should* be included in the above extended
+ // GetColPosition/GetColWidth already. This might be
+ // added due to GetColPosition/GetColWidth not working
+ // correctly over PageChanges (if used), but not sure.
+ aRect.AdjustLeft( -(rCell.mnAddLeft) );
+ aRect.AdjustRight(rCell.mnAddRight );
+ aRect.AdjustTop( -(rCell.mnAddTop) );
+ aRect.AdjustBottom(rCell.mnAddBottom );
}
+
+ return vcl::unotools::b2DRectangleFromRectangle(aRect);
}
// return output range of given row/col range in logical coordinates
diff --git a/svx/source/dialog/frmsel.cxx b/svx/source/dialog/frmsel.cxx
index d2c67d75f970..fed0d59d0d6d 100644
--- a/svx/source/dialog/frmsel.cxx
+++ b/svx/source/dialog/frmsel.cxx
@@ -424,7 +424,7 @@ void FrameSelectorImpl::InitBorderGeometry()
{
for( nRow = 0, nRows = maArray.GetRowCount(); nRow < nRows; ++nRow )
{
- const basegfx::B2DRange aCellRange(maArray.GetCellRange( nCol, nRow, true ));
+ const basegfx::B2DRange aCellRange(maArray.GetCellRange( nCol, nRow ));
const tools::Rectangle aRect(
basegfx::fround(aCellRange.getMinX()), basegfx::fround(aCellRange.getMinY()),
basegfx::fround(aCellRange.getMaxX()), basegfx::fround(aCellRange.getMaxY()));
@@ -484,7 +484,7 @@ void FrameSelectorImpl::InitBorderGeometry()
for( nRow = 0, nRows = maArray.GetRowCount(); nRow < nRows; ++nRow )
{
// the usable area between horizontal/vertical frame borders of current quadrant
- const basegfx::B2DRange aCellRange(maArray.GetCellRange( nCol, nRow, true ));
+ const basegfx::B2DRange aCellRange(maArray.GetCellRange( nCol, nRow ));
const tools::Rectangle aRect(
basegfx::fround(aCellRange.getMinX()) + nClV + 1, basegfx::fround(aCellRange.getMinY()) + nClH + 1,
basegfx::fround(aCellRange.getMaxX()) - nClV + 1, basegfx::fround(aCellRange.getMaxY()) - nClH + 1);