diff options
author | Noel <noelgrandin@gmail.com> | 2020-11-04 08:43:46 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-11-04 13:57:38 +0100 |
commit | c76c4e74810e152fa5a6befe73ce4167b6b98267 (patch) | |
tree | f3f5d59f48eb08ba5077b226c4c8eb56701151bb /sc | |
parent | d1232ee6b5e5cc3c811ef3ad72c83e9bd884bfe3 (diff) |
loplugin:constantparam
Change-Id: Ia2fea86f940d0d2d1dba5ed56660584f3d3fb028
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105280
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/inc/drwlayer.hxx | 2 | ||||
-rw-r--r-- | sc/source/core/data/drwlayer.cxx | 11 | ||||
-rw-r--r-- | sc/source/core/inc/interpre.hxx | 2 | ||||
-rw-r--r-- | sc/source/core/tool/interpr1.cxx | 49 |
4 files changed, 22 insertions, 42 deletions
diff --git a/sc/inc/drwlayer.hxx b/sc/inc/drwlayer.hxx index 1aa0998e2648..d0efb68513fa 100644 --- a/sc/inc/drwlayer.hxx +++ b/sc/inc/drwlayer.hxx @@ -100,7 +100,7 @@ private: void MoveCells( SCTAB nTab, SCCOL nCol1,SCROW nRow1, SCCOL nCol2,SCROW nRow2, SCCOL nDx,SCROW nDy, bool bUpdateNoteCaptionPos ); - void ResizeLastRectFromAnchor( const SdrObject* pObj, ScDrawObjData& rData, bool bUseLogicRect, bool bNegativePage, bool bCanResize, bool bHiddenAsZero = true ); + void ResizeLastRectFromAnchor( const SdrObject* pObj, ScDrawObjData& rData, bool bUseLogicRect, bool bNegativePage, bool bCanResize ); public: ScDrawLayer( ScDocument* pDocument, const OUString& rName ); diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx index 7701358562d0..35a377813b4e 100644 --- a/sc/source/core/data/drwlayer.cxx +++ b/sc/source/core/data/drwlayer.cxx @@ -715,8 +715,7 @@ void lcl_SetLogicRectFromAnchor(SdrObject* pObj, ScDrawObjData& rAnchor, ScDocum } // namespace void ScDrawLayer::ResizeLastRectFromAnchor(const SdrObject* pObj, ScDrawObjData& rData, - bool bUseLogicRect, bool bNegativePage, bool bCanResize, - bool bHiddenAsZero) + bool bUseLogicRect, bool bNegativePage, bool bCanResize) { tools::Rectangle aRect = bUseLogicRect ? pObj->GetLogicRect() : pObj->GetSnapRect(); SCCOL nCol1 = rData.maStart.Col(); @@ -725,8 +724,8 @@ void ScDrawLayer::ResizeLastRectFromAnchor(const SdrObject* pObj, ScDrawObjData& SCCOL nCol2 = rData.maEnd.Col(); SCROW nRow2 = rData.maEnd.Row(); SCTAB nTab2 = rData.maEnd.Tab(); - Point aPos(pDoc->GetColOffset(nCol1, nTab1, bHiddenAsZero), - pDoc->GetRowOffset(nRow1, nTab1, bHiddenAsZero)); + Point aPos(pDoc->GetColOffset(nCol1, nTab1, /*bHiddenAsZero*/true), + pDoc->GetRowOffset(nRow1, nTab1, /*bHiddenAsZero*/true)); aPos.setX(TwipsToHmm(aPos.X())); aPos.setY(TwipsToHmm(aPos.Y())); aPos += lcl_calcAvailableDiff(*pDoc, nCol1, nRow1, nTab1, rData.maStartOffset); @@ -745,8 +744,8 @@ void ScDrawLayer::ResizeLastRectFromAnchor(const SdrObject* pObj, ScDrawObjData& // Also when the end point is set, we need to consider it. if (rData.mbWasInHiddenRow || aLastCellRect.IsEmpty() || nRow1 != nRow2 || nCol1 != nCol2) { - Point aEnd(pDoc->GetColOffset(nCol2, nTab2, bHiddenAsZero), - pDoc->GetRowOffset(nRow2, nTab2, bHiddenAsZero)); + Point aEnd(pDoc->GetColOffset(nCol2, nTab2, /*bHiddenAsZero*/true), + pDoc->GetRowOffset(nRow2, nTab2, /*bHiddenAsZero*/true)); aEnd.setX(TwipsToHmm(aEnd.X())); aEnd.setY(TwipsToHmm(aEnd.Y())); aEnd += lcl_calcAvailableDiff(*pDoc, nCol2, nRow2, nTab2, rData.maEndOffset); diff --git a/sc/source/core/inc/interpre.hxx b/sc/source/core/inc/interpre.hxx index a8a5d0e1038e..4e986daf8453 100644 --- a/sc/source/core/inc/interpre.hxx +++ b/sc/source/core/inc/interpre.hxx @@ -156,7 +156,7 @@ public: /// Could string be a regular expression? /// if regularExpressions are disabled the function returns false regardless /// of the string content. - static bool MayBeRegExp( const OUString& rStr, bool bIgnoreWildcards = false ); + static bool MayBeRegExp( const OUString& rStr ); /** Could string be a wildcard (*,?,~) expression? If wildcards are disabled the function returns false regardless of the diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index 1bcc37478eb5..132686ca4a91 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -4724,50 +4724,32 @@ sal_Int32 lcl_CompareMatrix2Query( /** returns the last item with the identical value as the original item value. */ void lcl_GetLastMatch( SCSIZE& rIndex, const VectorMatrixAccessor& rMat, - SCSIZE nMatCount, bool bReverse) + SCSIZE nMatCount) { if (rMat.IsValue(rIndex)) { double nVal = rMat.GetDouble(rIndex); - if (bReverse) - while (rIndex > 0 && rMat.IsValue(rIndex-1) && - nVal == rMat.GetDouble(rIndex-1)) - --rIndex; - else - while (rIndex < nMatCount-1 && rMat.IsValue(rIndex+1) && - nVal == rMat.GetDouble(rIndex+1)) - ++rIndex; + while (rIndex < nMatCount-1 && rMat.IsValue(rIndex+1) && + nVal == rMat.GetDouble(rIndex+1)) + ++rIndex; } // Order of IsEmptyPath, IsEmpty, IsStringOrEmpty is significant! else if (rMat.IsEmptyPath(rIndex)) { - if (bReverse) - while (rIndex > 0 && rMat.IsEmptyPath(rIndex-1)) - --rIndex; - else - while (rIndex < nMatCount-1 && rMat.IsEmptyPath(rIndex+1)) - ++rIndex; + while (rIndex < nMatCount-1 && rMat.IsEmptyPath(rIndex+1)) + ++rIndex; } else if (rMat.IsEmpty(rIndex)) { - if (bReverse) - while (rIndex > 0 && rMat.IsEmpty(rIndex-1)) - --rIndex; - else - while (rIndex < nMatCount-1 && rMat.IsEmpty(rIndex+1)) - ++rIndex; + while (rIndex < nMatCount-1 && rMat.IsEmpty(rIndex+1)) + ++rIndex; } else if (rMat.IsStringOrEmpty(rIndex)) { OUString aStr( rMat.GetString(rIndex)); - if (bReverse) - while (rIndex > 0 && rMat.IsStringOrEmpty(rIndex-1) && - aStr == rMat.GetString(rIndex-1)) - --rIndex; - else - while (rIndex < nMatCount-1 && rMat.IsStringOrEmpty(rIndex+1) && - aStr == rMat.GetString(rIndex+1)) - ++rIndex; + while (rIndex < nMatCount-1 && rMat.IsStringOrEmpty(rIndex+1) && + aStr == rMat.GetString(rIndex+1)) + ++rIndex; } else { @@ -4982,7 +4964,7 @@ void ScInterpreter::ScMatch() if (nCmp == 0) { // exact match. find the last item with the same value. - lcl_GetLastMatch( nMid, aMatAcc, nMatCount, false); + lcl_GetLastMatch( nMid, aMatAcc, nMatCount); PushDouble( nMid+1); return; } @@ -6933,7 +6915,7 @@ void ScInterpreter::ScLookup() if (nCmp == 0) { // exact match. find the last item with the same value. - lcl_GetLastMatch( nMid, aMatAcc2, nLenMajor, false); + lcl_GetLastMatch( nMid, aMatAcc2, nLenMajor); nDelta = nMid; bFound = true; break; @@ -9926,18 +9908,17 @@ void ScInterpreter::ScErrorType_ODF() PushNA(); } -bool ScInterpreter::MayBeRegExp( const OUString& rStr, bool bIgnoreWildcards ) +bool ScInterpreter::MayBeRegExp( const OUString& rStr ) { if ( rStr.isEmpty() || (rStr.getLength() == 1 && !rStr.startsWith(".")) ) return false; // single meta characters can not be a regexp // First two characters are wildcard '?' and '*' characters. static const sal_Unicode cre[] = { '?','*','+','.','[',']','^','$','\\','<','>','(',')','|', 0 }; - const sal_Unicode* const pre = bIgnoreWildcards ? cre + 2 : cre; const sal_Unicode* p1 = rStr.getStr(); sal_Unicode c1; while ( ( c1 = *p1++ ) != 0 ) { - const sal_Unicode* p2 = pre; + const sal_Unicode* p2 = cre; while ( *p2 ) { if ( c1 == *p2++ ) |