diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-06-22 10:21:21 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-06-28 10:47:34 +0200 |
commit | bfc1600c6ade6f006eb774bffe7caa9c948e8603 (patch) | |
tree | c660fa18fc6a9e5f05c3cc58fa34411cdc4f4257 /sc/source/core | |
parent | f9514beb9bfed51aee69227797e74504afed31c6 (diff) |
loplugin:indentation improve checks for brace alignment
Change-Id: I333100fda7e181f68f36b03279b3fbb8cb768310
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117615
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/core')
-rw-r--r-- | sc/source/core/data/documen2.cxx | 2 | ||||
-rw-r--r-- | sc/source/core/data/postit.cxx | 4 | ||||
-rw-r--r-- | sc/source/core/data/table1.cxx | 4 | ||||
-rw-r--r-- | sc/source/core/data/table2.cxx | 16 | ||||
-rw-r--r-- | sc/source/core/opencl/op_financial.cxx | 16 | ||||
-rw-r--r-- | sc/source/core/opencl/op_logical.cxx | 24 | ||||
-rw-r--r-- | sc/source/core/opencl/op_math.cxx | 4 | ||||
-rw-r--r-- | sc/source/core/opencl/op_statistical.cxx | 14 |
8 files changed, 42 insertions, 42 deletions
diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx index 3191e3d5f816..1db11be0c777 100644 --- a/sc/source/core/data/documen2.cxx +++ b/sc/source/core/data/documen2.cxx @@ -835,7 +835,7 @@ bool ScDocument::CopyTab( SCTAB nOldPos, SCTAB nNewPos, const ScMarkData* pOnlyM if (pValidationList) pValidationList->UpdateInsertTab(aCxt); - } + } else bValid = false; } diff --git a/sc/source/core/data/postit.cxx b/sc/source/core/data/postit.cxx index 882cc8c190bb..a4ec79b2c909 100644 --- a/sc/source/core/data/postit.cxx +++ b/sc/source/core/data/postit.cxx @@ -462,7 +462,7 @@ ScCaptionPtr::ScCaptionPtr( SdrCaptionObj* p ) : if (p) { newHead(); - } + } } ScCaptionPtr::ScCaptionPtr( const ScCaptionPtr& r ) : @@ -805,7 +805,7 @@ void ScCaptionPtr::dissolve() ScCaptionPtr* p = pThat->mpNext; pThat->clear(); pThat = p; - } + } assert(!mpHead && !mpNext && !mpCaption); // should had been cleared during list walk delete pHead; } diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx index 40aeab42cfa2..b0885b08e5cb 100644 --- a/sc/source/core/data/table1.cxx +++ b/sc/source/core/data/table1.cxx @@ -516,7 +516,7 @@ bool ScTable::GetCellArea( SCCOL& rEndCol, SCROW& rEndRow ) const SCCOL nMaxX = 0; SCROW nMaxY = 0; for (SCCOL i=0; i<aCol.size(); i++) - { + { if (!aCol[i].IsEmptyData()) { bFound = true; @@ -539,7 +539,7 @@ bool ScTable::GetCellArea( SCCOL& rEndCol, SCROW& rEndRow ) const nMaxX = i; } } - } + } rEndCol = nMaxX; rEndRow = nMaxY; diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx index af36f60f0d9e..1074fe1f65a1 100644 --- a/sc/source/core/data/table2.cxx +++ b/sc/source/core/data/table2.cxx @@ -964,10 +964,10 @@ public: { mnFilteredRows++; continue; -} + } if (mbAsLink && mnFlags == InsertDeleteFlags::ALL) -{ + { // with InsertDeleteFlags::ALL, also create links (formulas) for empty cells setLink(nRow); continue; @@ -1043,12 +1043,12 @@ void ScTable::TransposeColPatterns(ScTable* pTransClip, SCCOL nCol1, SCCOL nCol, SCROW nRow2, SCROW nCombinedStartRow, bool bIncludeFiltered, const std::vector<SCROW>& rFilteredRows, SCROW nRowDestOffset) { - SCROW nAttrRow1 = {}; // spurious -Werror=maybe-uninitialized - SCROW nAttrRow2 = {}; // spurious -Werror=maybe-uninitialized - const ScPatternAttr* pPattern; - std::unique_ptr<ScAttrIterator> pAttrIter(aCol[nCol].CreateAttrIterator( nRow1, nRow2 )); - while ( (pPattern = pAttrIter->Next( nAttrRow1, nAttrRow2 )) != nullptr ) - { + SCROW nAttrRow1 = {}; // spurious -Werror=maybe-uninitialized + SCROW nAttrRow2 = {}; // spurious -Werror=maybe-uninitialized + const ScPatternAttr* pPattern; + std::unique_ptr<ScAttrIterator> pAttrIter(aCol[nCol].CreateAttrIterator( nRow1, nRow2 )); + while ( (pPattern = pAttrIter->Next( nAttrRow1, nAttrRow2 )) != nullptr ) + { if ( !IsDefaultItem( pPattern ) ) { const SfxItemSet& rSet = pPattern->GetItemSet(); diff --git a/sc/source/core/opencl/op_financial.cxx b/sc/source/core/opencl/op_financial.cxx index 6d44271f1203..30a47cbfbd93 100644 --- a/sc/source/core/opencl/op_financial.cxx +++ b/sc/source/core/opencl/op_financial.cxx @@ -412,11 +412,11 @@ void OpFV::GenSlidingWindowFunction(std::stringstream& ss, ss << " double arg4 = " << GetBottom() << ";\n"; unsigned j = vSubArguments.size(); while (j--) - { + { FormulaToken* pCur = vSubArguments[j]->GetFormulaToken(); assert(pCur); if(pCur->GetType() == formula::svSingleVectorRef) - { + { const formula::SingleVectorRefToken* pSVR = static_cast< const formula::SingleVectorRefToken* >(pCur); ss << " if(gid0 >= " << pSVR->GetArrayLength() << " || isnan("; @@ -427,8 +427,8 @@ void OpFV::GenSlidingWindowFunction(std::stringstream& ss, ss << " arg" << j << " = "; ss << vSubArguments[j]->GenSlidingWindowDeclRef(); ss << ";\n"; - } } + } ss << " tmp = GetFV(arg0, arg1, arg2, arg3, arg4);\n"; ss << " return tmp;\n"; ss << "}"; @@ -463,11 +463,11 @@ void OpIPMT::GenSlidingWindowFunction(std::stringstream& ss, ss << " double arg5 = " << GetBottom() << ";\n"; unsigned j = vSubArguments.size(); while (j--) - { + { FormulaToken* pCur = vSubArguments[j]->GetFormulaToken(); assert(pCur); if(pCur->GetType() == formula::svSingleVectorRef) - { + { const formula::SingleVectorRefToken* pSVR = static_cast< const formula::SingleVectorRefToken* >(pCur); ss << " if(gid0 >= " << pSVR->GetArrayLength() << " || isnan("; @@ -478,8 +478,8 @@ void OpIPMT::GenSlidingWindowFunction(std::stringstream& ss, ss << " arg" << j << " = "; ss << vSubArguments[j]->GenSlidingWindowDeclRef(); ss << ";\n"; - } } + } ss << " double pmt ;\n"; ss << " if(arg0 == 0.0)\n"; ss << " return 0;\n"; @@ -666,8 +666,8 @@ void OpDuration_ADD::GenSlidingWindowFunction(std::stringstream& ss, ss << " arg" << j << " = "; ss << vSubArguments[j]->GenSlidingWindowDeclRef(); ss << ";\n"; - } } + } ss << " int nNullDate = GetNullDate();\n"; ss << " tmp = GetDuration( nNullDate, (int)arg0, (int)arg1, arg2,"; ss << " arg3, (int)arg4, (int)arg5);\n"; @@ -4428,7 +4428,7 @@ tmpCur3); ss<< " int buffer_fv_len = "; ss<< tmpCurDVR3->GetArrayLength(); ss << ";\n"; - } + } if(vSubArguments.size()>4) { diff --git a/sc/source/core/opencl/op_logical.cxx b/sc/source/core/opencl/op_logical.cxx index 2d91b169723f..b9c70a1c7413 100644 --- a/sc/source/core/opencl/op_logical.cxx +++ b/sc/source/core/opencl/op_logical.cxx @@ -71,19 +71,19 @@ void OpAnd::GenSlidingWindowFunction(std::stringstream &ss, ss << "0; i < " << nCurWindowSize << "; i++) {\n"; } if(!pCurDVR->IsStartFixed() && !pCurDVR->IsEndFixed()) - { + { ss <<" if(isnan("<<vSubArguments[j]->GenSlidingWindowDeclRef(); ss <<")||i+gid0>="<<pCurDVR->GetArrayLength(); ss <<")\n"; ss <<" tmp = 1;\n else\n"; - } + } else - { + { ss <<" if(isnan("<<vSubArguments[j]->GenSlidingWindowDeclRef(); ss <<")||i>="<<pCurDVR->GetArrayLength(); ss <<")\n"; ss <<" tmp = 1;\n else\n"; - } + } ss <<" tmp = "; ss <<vSubArguments[j]->GenSlidingWindowDeclRef()<<";\n"; ss <<" tmp"<<j<<" = tmp"<<j<<" && tmp;\n"; @@ -156,19 +156,19 @@ void OpOr::GenSlidingWindowFunction(std::stringstream &ss, ss << "0; i < " << nCurWindowSize << "; i++) {\n"; } if(!pCurDVR->IsStartFixed() && !pCurDVR->IsEndFixed()) - { + { ss <<" if(isnan("<<vSubArguments[j]->GenSlidingWindowDeclRef(); ss <<")||i+gid0>="<<pCurDVR->GetArrayLength(); ss <<")\n"; ss <<" tmp = 0;\n else\n"; - } + } else - { + { ss <<" if(isnan("<<vSubArguments[j]->GenSlidingWindowDeclRef(); ss <<")||i>="<<pCurDVR->GetArrayLength(); ss <<")\n"; ss <<" tmp = 0;\n else\n"; - } + } ss <<" tmp = "; ss <<vSubArguments[j]->GenSlidingWindowDeclRef()<<";\n"; ss <<" tmp"<<j<<" = tmp"<<j<<" || tmp;\n"; @@ -272,19 +272,19 @@ void OpXor::GenSlidingWindowFunction(std::stringstream &ss, ss << "0; i < " << nCurWindowSize << "; i++) {\n"; } if(!pCurDVR->IsStartFixed() && !pCurDVR->IsEndFixed()) - { + { ss <<" if(isnan("<<rArg->GenSlidingWindowDeclRef(); ss <<")||i+gid0>="<<pCurDVR->GetArrayLength(); ss <<")\n"; ss <<" tmp = 0;\n else\n"; - } + } else - { + { ss <<" if(isnan("<<rArg->GenSlidingWindowDeclRef(); ss <<")||i>="<<pCurDVR->GetArrayLength(); ss <<")\n"; ss <<" tmp = 0;\n else\n"; - } + } ss <<" tmp = "; ss <<rArg->GenSlidingWindowDeclRef()<<";\n"; ss <<" tmp0 = (tmp != 0);\n"; diff --git a/sc/source/core/opencl/op_math.cxx b/sc/source/core/opencl/op_math.cxx index 01658ce987d1..4042e2511177 100644 --- a/sc/source/core/opencl/op_math.cxx +++ b/sc/source/core/opencl/op_math.cxx @@ -875,13 +875,13 @@ void OpAverageIfs::GenSlidingWindowFunction(std::stringstream &ss, tmpss << " tmp += tmp0;\n"; tmpss << " count++;\n"; for(size_t j=1;j<vSubArguments.size();j+=2,m--) - { + { for(int n = 0;n<m+1;n++) { tmpss << " "; } tmpss<< "}\n"; - } + } UnrollDoubleVector(ss,tmpss,pCurDVR,nCurWindowSize); diff --git a/sc/source/core/opencl/op_statistical.cxx b/sc/source/core/opencl/op_statistical.cxx index 273f37dcc204..3de4417fb240 100644 --- a/sc/source/core/opencl/op_statistical.cxx +++ b/sc/source/core/opencl/op_statistical.cxx @@ -3081,7 +3081,7 @@ void OpCorrel::GenSlidingWindowFunction( ss << "vYSum += pow(arg1 - vYMean, 2);\n\t\t\t"; ss << "vSum += (arg0 - vXMean)*(arg1 - vYMean);\n\t\t"; ss << "}\n\t\t"; - } else if (pCurDVRX->IsStartFixed() && !pCurDVRX->IsEndFixed()) { + } else if (pCurDVRX->IsStartFixed() && !pCurDVRX->IsEndFixed()) { ss << "0; i < gid0 + " << nCurWindowSizeX << "; i++) {\n\t\t\t"; ss << "arg0 = " << vSubArguments[0] ->GenSlidingWindowDeclRef(true) << ";\n\t\t\t"; @@ -4127,7 +4127,7 @@ void OpPermut::GenSlidingWindowFunction( if (i) ss << ","; vSubArguments[i]->GenSlidingWindowDecl(ss); - } + } ss << ") {\n"; ss <<" int gid0=get_global_id(0);\n"; ss <<" double inA;\n"; @@ -7353,7 +7353,7 @@ void OpDevSq::GenSlidingWindowFunction(std::stringstream& ss, if (i) ss << ","; vSubArguments[i]->GenSlidingWindowDecl(ss); - } + } ss << ") {\n"; ss << " int gid0 = get_global_id(0);\n"; ss << " double vSum = 0.0;\n"; @@ -7418,7 +7418,7 @@ void OpDevSq::GenSlidingWindowFunction(std::stringstream& ss, ss << " vSum += arg" << i << ";\n"; ss << " }\n"; } -} + } else if (pCur->GetType() == formula::svSingleVectorRef) { const formula::SingleVectorRefToken* pTVR = @@ -7449,7 +7449,7 @@ void OpDevSq::GenSlidingWindowFunction(std::stringstream& ss, ss << " cnt++;\n"; ss << " vSum += arg" << i << ";\n"; } - } + } ss << " vMean = vSum / cnt;\n"; ss << " vSum = 0.0;\n"; for(size_t k = 0; k < vSubArguments.size(); k++ ) @@ -7502,7 +7502,7 @@ void OpDevSq::GenSlidingWindowFunction(std::stringstream& ss, ss << " vSum += pow( arg" << k << " - vMean, 2 );\n"; ss << " }\n"; } - } + } else if (pCur->GetType() == formula::svSingleVectorRef) { const formula::SingleVectorRefToken* pTVR = @@ -7529,7 +7529,7 @@ void OpDevSq::GenSlidingWindowFunction(std::stringstream& ss, ss << vSubArguments[k]->GenSlidingWindowDeclRef() << ";\n"; ss << " vSum += pow( arg" << k << " - vMean, 2 );\n"; } - } + } ss << " return vSum;\n"; ss << "}"; } |