diff options
-rw-r--r-- | sc/source/core/data/document.cxx | 20 | ||||
-rw-r--r-- | sc/source/ui/view/viewfun3.cxx | 26 |
2 files changed, 23 insertions, 23 deletions
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index 2014f09b9e71..9335bb31957e 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -3126,22 +3126,22 @@ void ScDocument::GetClipArea(SCCOL& nClipX, SCROW& nClipY, bool bIncludeFiltered // No clip range. Bail out. return; - ScRange & rRange = rClipRanges.front(); + ScRange const & rRange = rClipRanges.front(); SCCOL nStartCol = rRange.aStart.Col(); SCCOL nEndCol = rRange.aEnd.Col(); SCROW nStartRow = rRange.aStart.Row(); SCROW nEndRow = rRange.aEnd.Row(); for ( size_t i = 1, n = rClipRanges.size(); i < n; ++i ) { - rRange = rClipRanges[ i ]; - if (rRange.aStart.Col() < nStartCol) - nStartCol = rRange.aStart.Col(); - if (rRange.aStart.Row() < nStartRow) - nStartRow = rRange.aStart.Row(); - if (rRange.aEnd.Col() > nEndCol) - nEndCol = rRange.aEnd.Col(); - if (rRange.aEnd.Row() < nEndRow) - nEndRow = rRange.aEnd.Row(); + ScRange const rRange2 = rClipRanges[ i ]; + if (rRange2.aStart.Col() < nStartCol) + nStartCol = rRange2.aStart.Col(); + if (rRange2.aStart.Row() < nStartRow) + nStartRow = rRange2.aStart.Row(); + if (rRange2.aEnd.Col() > nEndCol) + nEndCol = rRange2.aEnd.Col(); + if (rRange2.aEnd.Row() < nEndRow) + nEndRow = rRange2.aEnd.Row(); } nClipX = nEndCol - nStartCol; diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx index 3cfccc50c760..6435f617ecaa 100644 --- a/sc/source/ui/view/viewfun3.cxx +++ b/sc/source/ui/view/viewfun3.cxx @@ -306,26 +306,26 @@ bool ScViewFunc::CopyToClip( ScDocument* pClipDoc, const ScRangeList& rRanges, b // Check for geometrical feasibility of the ranges. bool bValidRanges = true; - ScRange & r = aClipParam.maRanges.front(); + ScRange const * p = &aClipParam.maRanges.front(); SCCOL nPrevColDelta = 0; SCROW nPrevRowDelta = 0; - SCCOL nPrevCol = r.aStart.Col(); - SCROW nPrevRow = r.aStart.Row(); - SCCOL nPrevColSize = r.aEnd.Col() - r.aStart.Col() + 1; - SCROW nPrevRowSize = r.aEnd.Row() - r.aStart.Row() + 1; + SCCOL nPrevCol = p->aStart.Col(); + SCROW nPrevRow = p->aStart.Row(); + SCCOL nPrevColSize = p->aEnd.Col() - p->aStart.Col() + 1; + SCROW nPrevRowSize = p->aEnd.Row() - p->aStart.Row() + 1; for ( size_t i = 1; i < aClipParam.maRanges.size(); ++i ) { - r = aClipParam.maRanges[i]; + p = &aClipParam.maRanges[i]; if ( pDoc->HasSelectedBlockMatrixFragment( - r.aStart.Col(), r.aStart.Row(), r.aEnd.Col(), r.aEnd.Row(), rMark) ) + p->aStart.Col(), p->aStart.Row(), p->aEnd.Col(), p->aEnd.Row(), rMark) ) { if (!bApi) ErrorMessage(STR_MATRIXFRAGMENTERR); return false; } - SCCOL nColDelta = r.aStart.Col() - nPrevCol; - SCROW nRowDelta = r.aStart.Row() - nPrevRow; + SCCOL nColDelta = p->aStart.Col() - nPrevCol; + SCROW nRowDelta = p->aStart.Row() - nPrevRow; if ((nColDelta && nRowDelta) || (nPrevColDelta && nRowDelta) || (nPrevRowDelta && nColDelta)) { @@ -341,8 +341,8 @@ bool ScViewFunc::CopyToClip( ScDocument* pClipDoc, const ScRangeList& rRanges, b aClipParam.meDirection = ScClipParam::Row; } - SCCOL nColSize = r.aEnd.Col() - r.aStart.Col() + 1; - SCROW nRowSize = r.aEnd.Row() - r.aStart.Row() + 1; + SCCOL nColSize = p->aEnd.Col() - p->aStart.Col() + 1; + SCROW nRowSize = p->aEnd.Row() - p->aStart.Row() + 1; if (aClipParam.meDirection == ScClipParam::Column && nRowSize != nPrevRowSize) { @@ -358,8 +358,8 @@ bool ScViewFunc::CopyToClip( ScDocument* pClipDoc, const ScRangeList& rRanges, b break; } - nPrevCol = r.aStart.Col(); - nPrevRow = r.aStart.Row(); + nPrevCol = p->aStart.Col(); + nPrevRow = p->aStart.Row(); nPrevColDelta = nColDelta; nPrevRowDelta = nRowDelta; nPrevColSize = nColSize; |