diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-02-08 13:53:20 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-02-09 21:04:10 +0100 |
commit | b4f38d8b788018b3f88421d72bb82ad3bdeef9e2 (patch) | |
tree | ac428f55c596a8cef2c466e0a4bd7e8507768230 | |
parent | 21d1d0d2340d40f646c5e3f413a33b45ab89675f (diff) |
loplugin:indentation in sc
Change-Id: Ieafabbafde456edba5adbe1fd587c32f04aedb98
Reviewed-on: https://gerrit.libreoffice.org/67562
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
73 files changed, 615 insertions, 615 deletions
diff --git a/sc/inc/bigrange.hxx b/sc/inc/bigrange.hxx index ab9d91659d1d..fef2443b1461 100644 --- a/sc/inc/bigrange.hxx +++ b/sc/inc/bigrange.hxx @@ -125,12 +125,12 @@ public: void Set( sal_Int32 nCol1, sal_Int32 nRow1, sal_Int32 nTab1, sal_Int32 nCol2, sal_Int32 nRow2, sal_Int32 nTab2 ) { aStart.Set( nCol1, nRow1, nTab1 ); - aEnd.Set( nCol2, nRow2, nTab2 ); } + aEnd.Set( nCol2, nRow2, nTab2 ); } void GetVars( sal_Int32& nCol1, sal_Int32& nRow1, sal_Int32& nTab1, sal_Int32& nCol2, sal_Int32& nRow2, sal_Int32& nTab2 ) const { aStart.GetVars( nCol1, nRow1, nTab1 ); - aEnd.GetVars( nCol2, nRow2, nTab2 ); } + aEnd.GetVars( nCol2, nRow2, nTab2 ); } bool IsValid( const ScDocument* pDoc ) const { return aStart.IsValid( pDoc ) && aEnd.IsValid( pDoc ); } diff --git a/sc/qa/extras/macros-test.cxx b/sc/qa/extras/macros-test.cxx index de4f00ca8f95..596e70fe6ce7 100644 --- a/sc/qa/extras/macros-test.cxx +++ b/sc/qa/extras/macros-test.cxx @@ -141,7 +141,7 @@ void ScMacrosTest::testPasswordProtectedStarBasic() // far big method tdf#94617 - SfxObjectShell::CallXScript( + SfxObjectShell::CallXScript( xComponent, "vnd.sun.Star.script:MyLibrary.BigModule.farBigMethod?language=Basic&location=document", aParams, aRet, aOutParamIndex, aOutParam); diff --git a/sc/qa/unit/opencl-test.cxx b/sc/qa/unit/opencl-test.cxx index 79cf3ab8fb69..2cb7667751cf 100644 --- a/sc/qa/unit/opencl-test.cxx +++ b/sc/qa/unit/opencl-test.cxx @@ -1889,7 +1889,7 @@ void ScOpenCLTest::testFinacialXNPVFormula() CPPUNIT_ASSERT_DOUBLES_EQUAL(fExcel, fLibre, fabs(0.0001*fExcel)); } - for (SCROW i = 16; i <= 26; ++i) + for (SCROW i = 16; i <= 26; ++i) { double fLibre = rDoc.GetValue(ScAddress(3, i, 0)); double fExcel = rDocRes.GetValue(ScAddress(3, i, 0)); diff --git a/sc/source/core/data/dpgroup.cxx b/sc/source/core/data/dpgroup.cxx index 37d184a07e41..34fc1a0e0259 100644 --- a/sc/source/core/data/dpgroup.cxx +++ b/sc/source/core/data/dpgroup.cxx @@ -1012,8 +1012,8 @@ long ScDPGroupTableData::GetSourceDim( long nDim ) return nSourceCount; if ( nDim >= nSourceCount && nDim < nSourceCount +static_cast<long>(aGroups.size()) ) { - const ScDPGroupDimension& rGroupDim = aGroups[nDim - nSourceCount]; - return rGroupDim.GetSourceDim(); + const ScDPGroupDimension& rGroupDim = aGroups[nDim - nSourceCount]; + return rGroupDim.GetSourceDim(); } return nDim; } diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx index 24ff05b2df16..4f83e326b87f 100644 --- a/sc/source/core/data/dpobject.cxx +++ b/sc/source/core/data/dpobject.cxx @@ -3573,11 +3573,11 @@ bool ScDPCollection::GetReferenceGroups(const ScDPObject& rDPObj, const ScDPDime if (!pRefDesc->HasRangeName()) continue; - if (pDesc->GetRangeName() == pRefDesc->GetRangeName()) - { + if (pDesc->GetRangeName() == pRefDesc->GetRangeName()) + { *pGroups = rRefObj.GetSaveData()->GetExistingDimensionData(); return true; - } + } } else { diff --git a/sc/source/core/data/dptabres.cxx b/sc/source/core/data/dptabres.cxx index c1ac4eb130d7..357ab98fbeac 100644 --- a/sc/source/core/data/dptabres.cxx +++ b/sc/source/core/data/dptabres.cxx @@ -241,10 +241,10 @@ bool ScDPColMembersOrder::operator()( sal_Int32 nIndex1, sal_Int32 nIndex2 ) con { const ScDPDataMember* pDataMember1 = rDimension.GetMember(nIndex1); const ScDPDataMember* pDataMember2 = rDimension.GetMember(nIndex2); - bool bHide1 = pDataMember1 && !pDataMember1->IsVisible(); - bool bHide2 = pDataMember2 && !pDataMember2->IsVisible(); - if ( bHide1 || bHide2 ) - return !bHide1; + bool bHide1 = pDataMember1 && !pDataMember1->IsVisible(); + bool bHide2 = pDataMember2 && !pDataMember2->IsVisible(); + if ( bHide1 || bHide2 ) + return !bHide1; return lcl_IsLess( pDataMember1, pDataMember2, nMeasure, bAscending ); } @@ -975,7 +975,7 @@ ScDPResultMember::~ScDPResultMember() OUString ScDPResultMember::GetName() const { - const ScDPMember* pMemberDesc = GetDPMember(); + const ScDPMember* pMemberDesc = GetDPMember(); if (pMemberDesc) return pMemberDesc->GetNameStr( false ); else @@ -1056,10 +1056,10 @@ void ScDPResultMember::InitFrom( const vector<ScDPDimension*>& ppDim, const vect { if ( ppDim[nPos]->getIsDataLayoutDimension() ) { - if ( !pChildDimension ) - pChildDimension.reset( new ScDPResultDimension( pResultData ) ); - pChildDimension->InitFrom( ppDim, ppLev, nPos, rInitState , false ); - return; + if ( !pChildDimension ) + pChildDimension.reset( new ScDPResultDimension( pResultData ) ); + pChildDimension->InitFrom( ppDim, ppLev, nPos, rInitState , false ); + return; } else { //find next dim @@ -1227,7 +1227,7 @@ long ScDPResultMember::GetSubTotalCount( long* pUserSubStart ) const if ( pUserSubStart ) *pUserSubStart = 0; // default - const ScDPLevel* pParentLevel = GetParentLevel(); + const ScDPLevel* pParentLevel = GetParentLevel(); if ( bForceSubTotal ) // set if needed for root members return 1; // grand total is always "automatic" @@ -2775,7 +2775,7 @@ ScDPResultMember *ScDPResultDimension::FindMember( SCROW iData ) const MemberHash::const_iterator aRes = maMemberHash.find( iData ); if( aRes != maMemberHash.end()) { - if ( aRes->second->IsNamedItem( iData ) ) + if ( aRes->second->IsNamedItem( iData ) ) return aRes->second; OSL_FAIL("problem! hash result is not the same as IsNamedItem"); } @@ -3968,8 +3968,8 @@ size_t ScDPResultVisibilityData::MemberHash::operator() (const ScDPItemData& r) } SCROW ScDPResultMember::GetDataId( ) const { - const ScDPMember* pMemberDesc = GetDPMember(); - if (pMemberDesc) + const ScDPMember* pMemberDesc = GetDPMember(); + if (pMemberDesc) return pMemberDesc->GetItemDataId(); return -1; } diff --git a/sc/source/core/data/dptabsrc.cxx b/sc/source/core/data/dptabsrc.cxx index 4acd3720274c..e456e3b8136a 100644 --- a/sc/source/core/data/dptabsrc.cxx +++ b/sc/source/core/data/dptabsrc.cxx @@ -2523,7 +2523,7 @@ sal_Int32 ScDPMember::Compare( const ScDPMember& rOther ) const } // no positions set - compare names - return pSource->GetData()->Compare( pSource->GetSourceDim(nDim),mnDataId,rOther.GetItemDataId()); + return pSource->GetData()->Compare( pSource->GetSourceDim(nDim),mnDataId,rOther.GetItemDataId()); } ScDPItemData ScDPMember::FillItemData() const diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx index 162211e59074..251c76905a14 100644 --- a/sc/source/core/data/drwlayer.cxx +++ b/sc/source/core/data/drwlayer.cxx @@ -1094,7 +1094,7 @@ bool ScDrawLayer::GetPrintArea( ScRange& rRange, bool bSetHor, bool bSetVer ) co { nStartX = 0; SCCOL nStartCol = rRange.aStart.Col(); - SCCOL i; + SCCOL i; for (i=0; i<nStartCol; i++) nStartX +=pDoc->GetColWidth(i,nTab); nEndX = nStartX; diff --git a/sc/source/core/data/table6.cxx b/sc/source/core/data/table6.cxx index 021a185aaf99..728a86ee744b 100644 --- a/sc/source/core/data/table6.cxx +++ b/sc/source/core/data/table6.cxx @@ -130,7 +130,7 @@ bool ScTable::SearchCell(const SvxSearchItem& rSearchItem, SCCOL nCol, SCROW nRo { if ( bDoBack ) { - sal_Int32 nTemp=nStart; nStart=nEnd; nEnd=nTemp; + sal_Int32 nTemp=nStart; nStart=nEnd; nEnd=nTemp; bFound = pSearchText->SearchBackward(aString, &nStart, &nEnd, &aSearchResult); // change results to definition before 614: --nEnd; diff --git a/sc/source/core/opencl/op_array.cxx b/sc/source/core/opencl/op_array.cxx index 58954a626646..69990cff921f 100644 --- a/sc/source/core/opencl/op_array.cxx +++ b/sc/source/core/opencl/op_array.cxx @@ -40,23 +40,23 @@ void OpSumX2MY2::GenSlidingWindowFunction(std::stringstream &ss, size_t nCurWindowSize = pCurDVR->GetArrayLength() < pCurDVR->GetRefRowSize() ? pCurDVR->GetArrayLength(): pCurDVR->GetRefRowSize() ; - ss << " int i ;\n"; - ss << " for (i = "; - if (!pCurDVR->IsStartFixed() && pCurDVR->IsEndFixed()) { + ss << " int i ;\n"; + ss << " for (i = "; + if (!pCurDVR->IsStartFixed() && pCurDVR->IsEndFixed()) { ss << "gid0; i < "<< nCurWindowSize <<"; i++)\n"; - } else if (pCurDVR->IsStartFixed() && !pCurDVR->IsEndFixed()) { + } else if (pCurDVR->IsStartFixed() && !pCurDVR->IsEndFixed()) { ss << "0; i < gid0+"<< nCurWindowSize <<"; i++)\n"; - } else { + } else { ss << "0; i < "<< nCurWindowSize <<"; i++)\n"; - } - ss << " {\n"; - if(!pCurDVR->IsStartFixed() && !pCurDVR->IsEndFixed()) - { + } + ss << " {\n"; + if(!pCurDVR->IsStartFixed() && !pCurDVR->IsEndFixed()) + { ss << " int doubleIndex =i+gid0;\n"; - }else - { + }else + { ss << " int doubleIndex =i;\n"; - } + } CheckSubArgumentIsNan(ss,vSubArguments,0); CheckSubArgumentIsNan(ss,vSubArguments,1); @@ -97,23 +97,23 @@ void OpSumX2PY2::GenSlidingWindowFunction(std::stringstream &ss, size_t nCurWindowSize = pCurDVR->GetArrayLength() < pCurDVR->GetRefRowSize() ? pCurDVR->GetArrayLength(): pCurDVR->GetRefRowSize() ; - ss << " int i ;\n"; - ss << " for (i = "; - if (!pCurDVR->IsStartFixed() && pCurDVR->IsEndFixed()) { + ss << " int i ;\n"; + ss << " for (i = "; + if (!pCurDVR->IsStartFixed() && pCurDVR->IsEndFixed()) { ss << "gid0; i < "<< nCurWindowSize <<"; i++)\n"; - } else if (pCurDVR->IsStartFixed() && !pCurDVR->IsEndFixed()) { + } else if (pCurDVR->IsStartFixed() && !pCurDVR->IsEndFixed()) { ss << "0; i < gid0+"<< nCurWindowSize <<"; i++)\n"; - } else { + } else { ss << "0; i < "<< nCurWindowSize <<"; i++)\n"; - } - ss << " {\n"; - if(!pCurDVR->IsStartFixed() && !pCurDVR->IsEndFixed()) - { + } + ss << " {\n"; + if(!pCurDVR->IsStartFixed() && !pCurDVR->IsEndFixed()) + { ss << " int doubleIndex =i+gid0;\n"; - }else - { + }else + { ss << " int doubleIndex =i;\n"; - } + } CheckSubArgumentIsNan(ss,vSubArguments,0); CheckSubArgumentIsNan(ss,vSubArguments,1); @@ -153,23 +153,23 @@ void OpSumXMY2::GenSlidingWindowFunction(std::stringstream &ss, size_t nCurWindowSize = pCurDVR->GetArrayLength() < pCurDVR->GetRefRowSize() ? pCurDVR->GetArrayLength(): pCurDVR->GetRefRowSize() ; - ss << " int i ;\n"; - ss << " for (i = "; - if (!pCurDVR->IsStartFixed() && pCurDVR->IsEndFixed()) { + ss << " int i ;\n"; + ss << " for (i = "; + if (!pCurDVR->IsStartFixed() && pCurDVR->IsEndFixed()) { ss << "gid0; i < "<< nCurWindowSize <<"; i++)\n"; - } else if (pCurDVR->IsStartFixed() && !pCurDVR->IsEndFixed()) { + } else if (pCurDVR->IsStartFixed() && !pCurDVR->IsEndFixed()) { ss << "0; i < gid0+"<< nCurWindowSize <<"; i++)\n"; - } else { + } else { ss << "0; i < "<< nCurWindowSize <<"; i++)\n"; - } - ss << " {\n"; - if(!pCurDVR->IsStartFixed() && !pCurDVR->IsEndFixed()) - { + } + ss << " {\n"; + if(!pCurDVR->IsStartFixed() && !pCurDVR->IsEndFixed()) + { ss << " int doubleIndex =i+gid0;\n"; - }else - { + }else + { ss << " int doubleIndex =i;\n"; - } + } CheckSubArgumentIsNan(ss,vSubArguments,0); CheckSubArgumentIsNan(ss,vSubArguments,1); diff --git a/sc/source/core/opencl/op_database.cxx b/sc/source/core/opencl/op_database.cxx index 594b8ea8d75a..4071ea62d17a 100644 --- a/sc/source/core/opencl/op_database.cxx +++ b/sc/source/core/opencl/op_database.cxx @@ -46,14 +46,14 @@ void OpDmax::GenSlidingWindowFunction(std::stringstream &ss, formula::svSingleVectorRef) throw Unhandled(__FILE__, __LINE__); - const formula::SingleVectorRefToken*pTmpDVR1= static_cast<const - formula::SingleVectorRefToken *>(vSubArguments[dataCol]-> - GetFormulaToken()); - ss << " tmp"<<dataCol<<"="; - ss << vSubArguments[dataCol]->GenSlidingWindowDeclRef()<<";\n"; - ss << " if(gid0>="<<pTmpDVR1->GetArrayLength()<<" ||isnan("; - ss << "tmp"<<dataCol<<"))\n"; - ss << " tmp"<<dataCol<<"=0;\n"; + const formula::SingleVectorRefToken*pTmpDVR1= static_cast<const + formula::SingleVectorRefToken *>(vSubArguments[dataCol]-> + GetFormulaToken()); + ss << " tmp"<<dataCol<<"="; + ss << vSubArguments[dataCol]->GenSlidingWindowDeclRef()<<";\n"; + ss << " if(gid0>="<<pTmpDVR1->GetArrayLength()<<" ||isnan("; + ss << "tmp"<<dataCol<<"))\n"; + ss << " tmp"<<dataCol<<"=0;\n"; int conditionCol = 0; int conditionRow = 0; @@ -173,14 +173,14 @@ void OpDmin::GenSlidingWindowFunction(std::stringstream &ss, formula::svSingleVectorRef) throw Unhandled(__FILE__, __LINE__); - const formula::SingleVectorRefToken*pTmpDVR1= static_cast<const - formula::SingleVectorRefToken *>(vSubArguments[dataCol]-> - GetFormulaToken()); - ss << " tmp"<<dataCol<<"="; - ss << vSubArguments[dataCol]->GenSlidingWindowDeclRef()<<";\n"; - ss << " if(gid0>="<<pTmpDVR1->GetArrayLength()<<" ||isnan("; - ss << "tmp"<<dataCol<<"))\n"; - ss << " tmp"<<dataCol<<"=0;\n"; + const formula::SingleVectorRefToken*pTmpDVR1= static_cast<const + formula::SingleVectorRefToken *>(vSubArguments[dataCol]-> + GetFormulaToken()); + ss << " tmp"<<dataCol<<"="; + ss << vSubArguments[dataCol]->GenSlidingWindowDeclRef()<<";\n"; + ss << " if(gid0>="<<pTmpDVR1->GetArrayLength()<<" ||isnan("; + ss << "tmp"<<dataCol<<"))\n"; + ss << " tmp"<<dataCol<<"=0;\n"; int conditionCol = 0; int conditionRow = 0; @@ -301,14 +301,14 @@ void OpDproduct::GenSlidingWindowFunction(std::stringstream &ss, formula::svSingleVectorRef) throw Unhandled(__FILE__, __LINE__); - const formula::SingleVectorRefToken*pTmpDVR1= static_cast<const - formula::SingleVectorRefToken *>(vSubArguments[dataCol]-> - GetFormulaToken()); - ss << " tmp"<<dataCol<<"="; - ss << vSubArguments[dataCol]->GenSlidingWindowDeclRef()<<";\n"; - ss << " if(gid0>="<<pTmpDVR1->GetArrayLength()<<" ||isnan("; - ss << "tmp"<<dataCol<<"))\n"; - ss << " tmp"<<dataCol<<"=0;\n"; + const formula::SingleVectorRefToken*pTmpDVR1= static_cast<const + formula::SingleVectorRefToken *>(vSubArguments[dataCol]-> + GetFormulaToken()); + ss << " tmp"<<dataCol<<"="; + ss << vSubArguments[dataCol]->GenSlidingWindowDeclRef()<<";\n"; + ss << " if(gid0>="<<pTmpDVR1->GetArrayLength()<<" ||isnan("; + ss << "tmp"<<dataCol<<"))\n"; + ss << " tmp"<<dataCol<<"=0;\n"; int conditionCol = 0; int conditionRow = 0; @@ -428,14 +428,14 @@ void OpDaverage::GenSlidingWindowFunction(std::stringstream &ss, formula::svSingleVectorRef) throw Unhandled(__FILE__, __LINE__); - const formula::SingleVectorRefToken*pTmpDVR1= static_cast<const - formula::SingleVectorRefToken *>(vSubArguments[dataCol]-> - GetFormulaToken()); - ss << " tmp"<<dataCol<<"="; - ss << vSubArguments[dataCol]->GenSlidingWindowDeclRef()<<";\n"; - ss << " if(gid0>="<<pTmpDVR1->GetArrayLength()<<" ||isnan("; - ss << "tmp"<<dataCol<<"))\n"; - ss << " tmp"<<dataCol<<"=0;\n"; + const formula::SingleVectorRefToken*pTmpDVR1= static_cast<const + formula::SingleVectorRefToken *>(vSubArguments[dataCol]-> + GetFormulaToken()); + ss << " tmp"<<dataCol<<"="; + ss << vSubArguments[dataCol]->GenSlidingWindowDeclRef()<<";\n"; + ss << " if(gid0>="<<pTmpDVR1->GetArrayLength()<<" ||isnan("; + ss << "tmp"<<dataCol<<"))\n"; + ss << " tmp"<<dataCol<<"=0;\n"; int conditionCol = 0; int conditionRow = 0; @@ -560,14 +560,14 @@ void OpDstdev::GenSlidingWindowFunction(std::stringstream &ss, formula::svSingleVectorRef) throw Unhandled(__FILE__, __LINE__); - const formula::SingleVectorRefToken*pTmpDVR1= static_cast<const - formula::SingleVectorRefToken *>(vSubArguments[dataCol]-> - GetFormulaToken()); - ss << " tmp"<<dataCol<<"="; - ss << vSubArguments[dataCol]->GenSlidingWindowDeclRef()<<";\n"; - ss << " if(gid0>="<<pTmpDVR1->GetArrayLength()<<" ||isnan("; - ss << "tmp"<<dataCol<<"))\n"; - ss << " tmp"<<dataCol<<"=0;\n"; + const formula::SingleVectorRefToken*pTmpDVR1= static_cast<const + formula::SingleVectorRefToken *>(vSubArguments[dataCol]-> + GetFormulaToken()); + ss << " tmp"<<dataCol<<"="; + ss << vSubArguments[dataCol]->GenSlidingWindowDeclRef()<<";\n"; + ss << " if(gid0>="<<pTmpDVR1->GetArrayLength()<<" ||isnan("; + ss << "tmp"<<dataCol<<"))\n"; + ss << " tmp"<<dataCol<<"=0;\n"; int conditionCol = 0; int conditionRow = 0; @@ -742,14 +742,14 @@ void OpDstdevp::GenSlidingWindowFunction(std::stringstream &ss, formula::svSingleVectorRef) throw Unhandled(__FILE__, __LINE__); - const formula::SingleVectorRefToken*pTmpDVR1= static_cast<const - formula::SingleVectorRefToken *>(vSubArguments[dataCol]-> - GetFormulaToken()); - ss << " tmp"<<dataCol<<"="; - ss << vSubArguments[dataCol]->GenSlidingWindowDeclRef()<<";\n"; - ss << " if(gid0>="<<pTmpDVR1->GetArrayLength()<<" ||isnan("; - ss << "tmp"<<dataCol<<"))\n"; - ss << " tmp"<<dataCol<<"=0;\n"; + const formula::SingleVectorRefToken*pTmpDVR1= static_cast<const + formula::SingleVectorRefToken *>(vSubArguments[dataCol]-> + GetFormulaToken()); + ss << " tmp"<<dataCol<<"="; + ss << vSubArguments[dataCol]->GenSlidingWindowDeclRef()<<";\n"; + ss << " if(gid0>="<<pTmpDVR1->GetArrayLength()<<" ||isnan("; + ss << "tmp"<<dataCol<<"))\n"; + ss << " tmp"<<dataCol<<"=0;\n"; int conditionCol = 0; int conditionRow = 0; @@ -922,14 +922,14 @@ void OpDsum::GenSlidingWindowFunction(std::stringstream &ss, formula::svSingleVectorRef) throw Unhandled(__FILE__, __LINE__); - const formula::SingleVectorRefToken*pTmpDVR1= static_cast<const - formula::SingleVectorRefToken *>(vSubArguments[dataCol]-> - GetFormulaToken()); - ss << " tmp"<<dataCol<<"="; - ss << vSubArguments[dataCol]->GenSlidingWindowDeclRef()<<";\n"; - ss << " if(gid0>="<<pTmpDVR1->GetArrayLength()<<" ||isnan("; - ss << "tmp"<<dataCol<<"))\n"; - ss << " tmp"<<dataCol<<"=0;\n"; + const formula::SingleVectorRefToken*pTmpDVR1= static_cast<const + formula::SingleVectorRefToken *>(vSubArguments[dataCol]-> + GetFormulaToken()); + ss << " tmp"<<dataCol<<"="; + ss << vSubArguments[dataCol]->GenSlidingWindowDeclRef()<<";\n"; + ss << " if(gid0>="<<pTmpDVR1->GetArrayLength()<<" ||isnan("; + ss << "tmp"<<dataCol<<"))\n"; + ss << " tmp"<<dataCol<<"=0;\n"; int conditionCol = 0; int conditionRow = 0; @@ -1051,14 +1051,14 @@ void OpDvar::GenSlidingWindowFunction(std::stringstream &ss, formula::svSingleVectorRef) throw Unhandled(__FILE__, __LINE__); - const formula::SingleVectorRefToken*pTmpDVR1= static_cast<const - formula::SingleVectorRefToken *>(vSubArguments[dataCol]-> - GetFormulaToken()); - ss << " tmp"<<dataCol<<"="; - ss << vSubArguments[dataCol]->GenSlidingWindowDeclRef()<<";\n"; - ss << " if(gid0>="<<pTmpDVR1->GetArrayLength()<<" ||isnan("; - ss << "tmp"<<dataCol<<"))\n"; - ss << " tmp"<<dataCol<<"=0;\n"; + const formula::SingleVectorRefToken*pTmpDVR1= static_cast<const + formula::SingleVectorRefToken *>(vSubArguments[dataCol]-> + GetFormulaToken()); + ss << " tmp"<<dataCol<<"="; + ss << vSubArguments[dataCol]->GenSlidingWindowDeclRef()<<";\n"; + ss << " if(gid0>="<<pTmpDVR1->GetArrayLength()<<" ||isnan("; + ss << "tmp"<<dataCol<<"))\n"; + ss << " tmp"<<dataCol<<"=0;\n"; int conditionCol = 0; int conditionRow = 0; @@ -1233,14 +1233,14 @@ void OpDvarp::GenSlidingWindowFunction(std::stringstream &ss, formula::svSingleVectorRef) throw Unhandled(__FILE__, __LINE__); - const formula::SingleVectorRefToken*pTmpDVR1= static_cast<const - formula::SingleVectorRefToken *>(vSubArguments[dataCol]-> - GetFormulaToken()); - ss << " tmp"<<dataCol<<"="; - ss << vSubArguments[dataCol]->GenSlidingWindowDeclRef()<<";\n"; - ss << " if(gid0>="<<pTmpDVR1->GetArrayLength()<<" ||isnan("; - ss << "tmp"<<dataCol<<"))\n"; - ss << " tmp"<<dataCol<<"=0;\n"; + const formula::SingleVectorRefToken*pTmpDVR1= static_cast<const + formula::SingleVectorRefToken *>(vSubArguments[dataCol]-> + GetFormulaToken()); + ss << " tmp"<<dataCol<<"="; + ss << vSubArguments[dataCol]->GenSlidingWindowDeclRef()<<";\n"; + ss << " if(gid0>="<<pTmpDVR1->GetArrayLength()<<" ||isnan("; + ss << "tmp"<<dataCol<<"))\n"; + ss << " tmp"<<dataCol<<"=0;\n"; int conditionCol = 0; int conditionRow = 0; @@ -1416,11 +1416,11 @@ void OpDcount::GenSlidingWindowFunction(std::stringstream &ss, const formula::SingleVectorRefToken*pTmpDVR1= static_cast<const formula::SingleVectorRefToken *>(vSubArguments[dataCol] ->GetFormulaToken()); - ss << " tmp"<<dataCol<<"="; - ss << vSubArguments[dataCol]->GenSlidingWindowDeclRef()<<";\n"; - ss << " if(gid0>="<<pTmpDVR1->GetArrayLength()<<" ||isnan("; - ss << "tmp"<<dataCol<<"))\n"; - ss << " tmp"<<dataCol<<"=DBL_MIN;\n"; + ss << " tmp"<<dataCol<<"="; + ss << vSubArguments[dataCol]->GenSlidingWindowDeclRef()<<";\n"; + ss << " if(gid0>="<<pTmpDVR1->GetArrayLength()<<" ||isnan("; + ss << "tmp"<<dataCol<<"))\n"; + ss << " tmp"<<dataCol<<"=DBL_MIN;\n"; int conditionCol = 0; int conditionRow = 0; @@ -1544,11 +1544,11 @@ void OpDcount2::GenSlidingWindowFunction(std::stringstream &ss, const formula::SingleVectorRefToken*pTmpDVR1= static_cast<const formula::SingleVectorRefToken *>(vSubArguments[dataCol] ->GetFormulaToken()); - ss << " tmp"<<dataCol<<"="; - ss << vSubArguments[dataCol]->GenSlidingWindowDeclRef()<<";\n"; - ss << " if(gid0>="<<pTmpDVR1->GetArrayLength()<<" ||isnan("; - ss << "tmp"<<dataCol<<"))\n"; - ss << " tmp"<<dataCol<<"=DBL_MIN;\n"; + ss << " tmp"<<dataCol<<"="; + ss << vSubArguments[dataCol]->GenSlidingWindowDeclRef()<<";\n"; + ss << " if(gid0>="<<pTmpDVR1->GetArrayLength()<<" ||isnan("; + ss << "tmp"<<dataCol<<"))\n"; + ss << " tmp"<<dataCol<<"=DBL_MIN;\n"; int conditionCol = 0; int conditionRow = 0; diff --git a/sc/source/core/opencl/op_financial.cxx b/sc/source/core/opencl/op_financial.cxx index 66d1f9d18e28..4cbfbe564e18 100644 --- a/sc/source/core/opencl/op_financial.cxx +++ b/sc/source/core/opencl/op_financial.cxx @@ -110,7 +110,7 @@ vSubArguments) assert(pCur); if (pCur->GetType() == formula::svSingleVectorRef) { - const formula::SingleVectorRefToken* pSVR = + const formula::SingleVectorRefToken* pSVR = static_cast< const formula::SingleVectorRefToken* >(pCur); ss << " if (gid0 < " << pSVR->GetArrayLength() << "){\n"; } @@ -1221,7 +1221,7 @@ void PriceMat::GenSlidingWindowFunction( ss<< "int buffer_settle_len = "; ss<< tmpCurDVR0->GetArrayLength(); ss << ";\n\t"; - ss<< "int buffer_mat_len = "; + ss<< "int buffer_mat_len = "; ss<< tmpCurDVR1->GetArrayLength(); ss << ";\n\t"; ss<< "int buffer_issue_len = "; @@ -1882,10 +1882,10 @@ void OpAccrintm::GenSlidingWindowFunction( ss<< "int buffer_nMode_len = "; ss<< tmpCurDVR4->GetArrayLength(); ss << ";\n\t"; - ss <<"if(gid0 >= buffer_nIssue_len || isnan("; - ss <<vSubArguments[0]->GenSlidingWindowDeclRef(); - ss <<"))\n\t\t"; - ss <<"nStartDate = 0;\n\telse\n\t\t"; + ss <<"if(gid0 >= buffer_nIssue_len || isnan("; + ss <<vSubArguments[0]->GenSlidingWindowDeclRef(); + ss <<"))\n\t\t"; + ss <<"nStartDate = 0;\n\telse\n\t\t"; ss << "nStartDate=(int)"; ss << vSubArguments[0]->GenSlidingWindowDeclRef(); ss <<";\n\t"; @@ -2018,7 +2018,7 @@ void OpYield::GenSlidingWindowFunction( ss<< tmpCurDVR2->GetArrayLength(); ss << ";\n\t"; - ss<< "int buffer_tmp003_len = "; + ss<< "int buffer_tmp003_len = "; ss<< tmpCurDVR3->GetArrayLength(); ss << ";\n\t"; @@ -2320,7 +2320,7 @@ void OpPMT::GenSlidingWindowFunction(std::stringstream &ss, assert(pCur); if (pCur->GetType() == formula::svSingleVectorRef) { - const formula::SingleVectorRefToken* pSVR = + const formula::SingleVectorRefToken* pSVR = static_cast< const formula::SingleVectorRefToken* >(pCur); ss << "if (gid0 < " << pSVR->GetArrayLength() << "){\n"; } @@ -2444,8 +2444,8 @@ void OpNPV::GenSlidingWindowFunction(std::stringstream &ss, ss << " nCount += 1;\n"; } } - ss << " return tmp;\n"; - ss << "}"; + ss << " return tmp;\n"; + ss << "}"; } void OpPrice::BinInlineFun(std::set<std::string>& decls, @@ -3966,7 +3966,7 @@ void OpYielddisc::GenSlidingWindowFunction( ss<< tmpCurDVR2->GetArrayLength(); ss << ";\n\t"; - ss<< "int buffer_tmp003_len = "; + ss<< "int buffer_tmp003_len = "; ss<< tmpCurDVR3->GetArrayLength(); ss << ";\n\t"; @@ -4408,17 +4408,17 @@ vSubArguments) ss << " double fv;\n"; ss << " double type;\n"; - FormulaToken *tmpCur0 = vSubArguments[0]->GetFormulaToken(); - const formula::SingleVectorRefToken*tmpCurDVR0= static_cast<const - formula::SingleVectorRefToken *>(tmpCur0); + FormulaToken *tmpCur0 = vSubArguments[0]->GetFormulaToken(); + const formula::SingleVectorRefToken*tmpCurDVR0= static_cast<const + formula::SingleVectorRefToken *>(tmpCur0); - FormulaToken *tmpCur1 = vSubArguments[1]->GetFormulaToken(); - const formula::SingleVectorRefToken*tmpCurDVR1= static_cast<const - formula::SingleVectorRefToken *>(tmpCur1); + FormulaToken *tmpCur1 = vSubArguments[1]->GetFormulaToken(); + const formula::SingleVectorRefToken*tmpCurDVR1= static_cast<const + formula::SingleVectorRefToken *>(tmpCur1); - FormulaToken *tmpCur2 = vSubArguments[2]->GetFormulaToken(); - const formula::SingleVectorRefToken*tmpCurDVR2= static_cast<const - formula::SingleVectorRefToken *>(tmpCur2); + FormulaToken *tmpCur2 = vSubArguments[2]->GetFormulaToken(); + const formula::SingleVectorRefToken*tmpCurDVR2= static_cast<const + formula::SingleVectorRefToken *>(tmpCur2); if(vSubArguments.size()>3) { diff --git a/sc/source/core/opencl/op_math.cxx b/sc/source/core/opencl/op_math.cxx index 4b34df551426..4ed984941d87 100644 --- a/sc/source/core/opencl/op_math.cxx +++ b/sc/source/core/opencl/op_math.cxx @@ -516,13 +516,13 @@ void OpCountIfs::GenSlidingWindowFunction(std::stringstream &ss, ss << " int loop;\n"; GenTmpVariables(ss,vSubArguments); - ss<< " int singleIndex =gid0;\n"; - int m=0; + ss<< " int singleIndex =gid0;\n"; + int m=0; - std::stringstream tmpss; + std::stringstream tmpss; - for(size_t j=0;j<vSubArguments.size();j+=2,m++) - { + for(size_t j=0;j<vSubArguments.size();j+=2,m++) + { CheckSubArgumentIsNan(tmpss,vSubArguments,j); CheckSubArgumentIsNan(ss,vSubArguments,j+1); tmpss <<" if(isequal("; @@ -532,17 +532,17 @@ void OpCountIfs::GenSlidingWindowFunction(std::stringstream &ss, tmpss << "tmp"; tmpss << j+1; tmpss << ")){\n"; - } + } tmpss << " tmp ++;\n"; for(size_t j=0;j<vSubArguments.size();j+=2,m--) - { - for(int n = 0;n<m+1;n++) + { + for(int n = 0;n<m+1;n++) { tmpss << " "; } tmpss<< "}\n"; - } - UnrollDoubleVector(ss,tmpss,pCurDVR,nCurWindowSize); + } + UnrollDoubleVector(ss,tmpss,pCurDVR,nCurWindowSize); ss << "return tmp;\n"; ss << "}"; @@ -856,11 +856,11 @@ void OpAverageIfs::GenSlidingWindowFunction(std::stringstream &ss, ss << " int count=0;\n"; ss << " int loop;"; GenTmpVariables(ss,vSubArguments); - ss<< " int singleIndex =gid0;\n"; - int m=0; - std::stringstream tmpss; - for(size_t j=1;j<vSubArguments.size();j+=2,m++) - { + ss<< " int singleIndex =gid0;\n"; + int m=0; + std::stringstream tmpss; + for(size_t j=1;j<vSubArguments.size();j+=2,m++) + { CheckSubArgumentIsNan(tmpss,vSubArguments,j); CheckSubArgumentIsNan(ss,vSubArguments,j+1); tmpss <<" if(isequal("; @@ -870,13 +870,13 @@ void OpAverageIfs::GenSlidingWindowFunction(std::stringstream &ss, tmpss << "tmp"; tmpss << j+1; tmpss << ")){\n"; - } - CheckSubArgumentIsNan(tmpss,vSubArguments,0); + } + CheckSubArgumentIsNan(tmpss,vSubArguments,0); 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++) + for(int n = 0;n<m+1;n++) { tmpss << " "; } @@ -885,10 +885,10 @@ void OpAverageIfs::GenSlidingWindowFunction(std::stringstream &ss, UnrollDoubleVector(ss,tmpss,pCurDVR,nCurWindowSize); - ss << " if(count!=0)\n"; - ss << " tmp=tmp/count;\n"; - ss << " else\n"; - ss << " tmp= 0 ;\n"; + ss << " if(count!=0)\n"; + ss << " tmp=tmp/count;\n"; + ss << " else\n"; + ss << " tmp= 0 ;\n"; ss << "return tmp;\n"; ss << "}"; } @@ -1364,8 +1364,8 @@ void OpArcCotHyp::GenSlidingWindowFunction(std::stringstream &ss, ss << vSubArguments[0]->GenSlidingWindowDeclRef(); ss << ";\n"; } - ss << " return 0.5 * log(1 + 2 * pown(arg0 - 1.0, -1));\n"; - ss << "}"; + ss << " return 0.5 * log(1 + 2 * pown(arg0 - 1.0, -1));\n"; + ss << "}"; } void OpArcSin::BinInlineFun(std::set<std::string>& decls, std::set<std::string>& funs) @@ -2872,7 +2872,7 @@ void OpAverageIf::GenSlidingWindowFunction(std::stringstream &ss, const formula::DoubleVectorRefToken*pCurDVR2= static_cast<const formula::DoubleVectorRefToken *>(tmpCur2); unsigned paraThreeWidth = pCurDVR2->GetArrays().size(); - if(paraThreeWidth > 1) + if(paraThreeWidth > 1) { throw Unhandled(__FILE__, __LINE__); } diff --git a/sc/source/core/opencl/op_statistical.cxx b/sc/source/core/opencl/op_statistical.cxx index 9e1637f0bfc3..863f1be4db8c 100644 --- a/sc/source/core/opencl/op_statistical.cxx +++ b/sc/source/core/opencl/op_statistical.cxx @@ -2984,8 +2984,8 @@ void OpCorrel::GenSlidingWindowFunction( size_t nCurWindowSizeX = pCurDVRY->GetRefRowSize(); - ss << "for (int i = "; - if (!pCurDVRX->IsStartFixed() && pCurDVRX->IsEndFixed()) { + ss << "for (int i = "; + if (!pCurDVRX->IsStartFixed() && pCurDVRX->IsEndFixed()) { ss << "gid0; i < " << nCurWindowSizeX << "; i++) {\n\t\t"; ss << "arg0 = " << vSubArguments[0] ->GenSlidingWindowDeclRef(true) << ";\n\t\t"; @@ -3002,7 +3002,7 @@ void OpCorrel::GenSlidingWindowFunction( ss << "vXSum += arg0;\n\t\t"; ss << "vYSum += arg1;\n\t"; ss << "}\n\t"; - } else if (pCurDVRX->IsStartFixed() && !pCurDVRX->IsEndFixed()) { + } else if (pCurDVRX->IsStartFixed() && !pCurDVRX->IsEndFixed()) { ss << "0; i < gid0 + " << nCurWindowSizeX << "; i++) {\n\t\t"; ss << "arg0 = " << vSubArguments[0] ->GenSlidingWindowDeclRef(true) << ";\n\t\t"; @@ -3019,8 +3019,8 @@ void OpCorrel::GenSlidingWindowFunction( ss << "vXSum += arg0;\n\t\t"; ss << "vYSum += arg1;\n\t"; ss << "}\n\t"; - } - else if (pCurDVRX->IsStartFixed() && pCurDVRX->IsEndFixed()) { + } + else if (pCurDVRX->IsStartFixed() && pCurDVRX->IsEndFixed()) { ss << "0; i < " << nCurWindowSizeX << "; i++) {\n\t\t"; ss << "arg0 = " << vSubArguments[0] ->GenSlidingWindowDeclRef(true) << ";\n\t\t"; @@ -3037,7 +3037,7 @@ void OpCorrel::GenSlidingWindowFunction( ss << "vXSum += arg0;\n\t\t"; ss << "vYSum += arg1;\n\t"; ss << "}\n\t"; - } else { + } else { ss << "0; i < " << nCurWindowSizeX << "; i++) {\n\t\t"; ss << "arg0 = " << vSubArguments[0] ->GenSlidingWindowDeclRef(true) << ";\n\t\t"; @@ -3054,19 +3054,19 @@ void OpCorrel::GenSlidingWindowFunction( ss << "vXSum += arg0;\n\t\t"; ss << "vYSum += arg1;\n\t"; ss << "}\n\t"; - } + } - ss << "if(cnt < 1) {\n\t\t"; - ss << "return DBL_MIN;\n\t"; - ss << "}\n\t"; - ss << "else {\n\t\t"; - ss << "vXMean = vXSum/cnt;\n\t\t"; - ss << "vYMean = vYSum/cnt;\n\t\t"; - ss << "vXSum = 0.0;\n\t\t"; - ss << "vYSum = 0.0;\n\t\t"; + ss << "if(cnt < 1) {\n\t\t"; + ss << "return DBL_MIN;\n\t"; + ss << "}\n\t"; + ss << "else {\n\t\t"; + ss << "vXMean = vXSum/cnt;\n\t\t"; + ss << "vYMean = vYSum/cnt;\n\t\t"; + ss << "vXSum = 0.0;\n\t\t"; + ss << "vYSum = 0.0;\n\t\t"; - ss << "for (int i = "; - if (!pCurDVRX->IsStartFixed() && pCurDVRX->IsEndFixed()) { + ss << "for (int i = "; + if (!pCurDVRX->IsStartFixed() && pCurDVRX->IsEndFixed()) { ss << "gid0; i < " << nCurWindowSizeX << "; i++) {\n\t\t\t"; ss << "arg0 = " << vSubArguments[0] ->GenSlidingWindowDeclRef(true) << ";\n\t\t\t"; @@ -3082,7 +3082,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"; @@ -3098,7 +3098,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 < " << nCurWindowSizeX << "; i++) {\n\t\t\t"; ss << "arg0 = " << vSubArguments[0] ->GenSlidingWindowDeclRef(true) << ";\n\t\t\t"; @@ -3114,7 +3114,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 { + } else { ss << "0; i < " << nCurWindowSizeX << "; i++) {\n\t\t\t"; ss << "arg0 = " << vSubArguments[0] ->GenSlidingWindowDeclRef(true) << ";\n\t\t\t"; @@ -3130,16 +3130,16 @@ void OpCorrel::GenSlidingWindowFunction( ss << "vYSum += ((arg1 - vYMean)*(arg1 - vYMean));\n\t\t\t"; ss << "vSum += (arg0 - vXMean)*(arg1 - vYMean);\n\t\t"; ss << "}\n\t\t"; - } + } - ss << "if(vXSum == 0.0 || vYSum == 0.0) {\n\t\t\t"; - ss << "return NAN;\n\t\t"; - ss << "}\n\t\t"; - ss << "else {\n\t\t\t"; - ss << "return vSum/pow(vXSum*vYSum, 0.5);\n\t\t"; - ss << "}\n\t"; - ss << "}\n"; - ss << "}"; + ss << "if(vXSum == 0.0 || vYSum == 0.0) {\n\t\t\t"; + ss << "return NAN;\n\t\t"; + ss << "}\n\t\t"; + ss << "else {\n\t\t\t"; + ss << "return vSum/pow(vXSum*vYSum, 0.5);\n\t\t"; + ss << "}\n\t"; + ss << "}\n"; + ss << "}"; } void OpNegbinomdist::GenSlidingWindowFunction( @@ -3423,9 +3423,9 @@ void OpGeoMean::GenSlidingWindowFunction( formula::svDoubleVectorRef) { FormulaToken *tmpCur = rArg->GetFormulaToken(); - const formula::DoubleVectorRefToken*pCurDVR= static_cast<const + const formula::DoubleVectorRefToken*pCurDVR= static_cast<const formula::DoubleVectorRefToken *>(tmpCur); - size_t nCurWindowSize = pCurDVR->GetArrayLength() < + size_t nCurWindowSize = pCurDVR->GetArrayLength() < pCurDVR->GetRefRowSize() ? pCurDVR->GetArrayLength(): pCurDVR->GetRefRowSize() ; @@ -5986,19 +5986,19 @@ vSubArguments) ss <<";\n"; } } - ss << " tmp1 = floor(tmp1);\n"; - ss << " if(tmp1 < 1.0)\n"; - ss << " result = -DBL_MAX;\n"; - ss << " else\n"; - ss << " {\n"; - ss << " if(tmp2)\n"; - ss << " result =GetChiSqDistCDF(tmp0,tmp1);\n"; - ss << " else\n"; - ss << " result =GetChiSqDistPDF(tmp0,tmp1);\n"; - ss << " }\n"; - ss << " return result;\n"; - ss << "}"; - } + ss << " tmp1 = floor(tmp1);\n"; + ss << " if(tmp1 < 1.0)\n"; + ss << " result = -DBL_MAX;\n"; + ss << " else\n"; + ss << " {\n"; + ss << " if(tmp2)\n"; + ss << " result =GetChiSqDistCDF(tmp0,tmp1);\n"; + ss << " else\n"; + ss << " result =GetChiSqDistPDF(tmp0,tmp1);\n"; + ss << " }\n"; + ss << " return result;\n"; + ss << "}"; +} void OpChiSqInv::BinInlineFun(std::set<std::string>& decls, std::set<std::string>& funs) @@ -6040,39 +6040,39 @@ vSubArguments) { GenTmpVariables(ss,vSubArguments); CheckAllSubArgumentIsNan(ss,vSubArguments); - ss <<"\n"; - for (size_t i = 0; i < vSubArguments.size(); i++) - { - FormulaToken *pCur = vSubArguments[i]->GetFormulaToken(); - assert(pCur); - if (pCur->GetType() == formula::svSingleVectorRef) - { - const formula::SingleVectorRefToken* pSVR = - static_cast< const formula::SingleVectorRefToken* >(pCur); - ss << "if (gid0 < " << pSVR->GetArrayLength() << "){\n"; - } - else if (pCur->GetType() == formula::svDouble) + ss <<"\n"; + for (size_t i = 0; i < vSubArguments.size(); i++) { - ss << "{\n"; - } + FormulaToken *pCur = vSubArguments[i]->GetFormulaToken(); + assert(pCur); + if (pCur->GetType() == formula::svSingleVectorRef) + { + const formula::SingleVectorRefToken* pSVR = + static_cast< const formula::SingleVectorRefToken* >(pCur); + ss << "if (gid0 < " << pSVR->GetArrayLength() << "){\n"; + } + else if (pCur->GetType() == formula::svDouble) + { + ss << "{\n"; + } - if(ocPush==vSubArguments[i]->GetFormulaToken()->GetOpCode()) - { - ss << " if (isnan("; - ss << vSubArguments[i]->GenSlidingWindowDeclRef(); - ss << "))\n"; - ss << " tmp"<<i<<"= 0;\n"; - ss << " else\n"; - ss << " tmp"<<i<<"=\n"; - ss << vSubArguments[i]->GenSlidingWindowDeclRef(); - ss << ";\n}\n"; - } - else - { - ss << "tmp"<<i<<"="<<vSubArguments[i]->GenSlidingWindowDeclRef(); - ss <<";\n"; + if(ocPush==vSubArguments[i]->GetFormulaToken()->GetOpCode()) + { + ss << " if (isnan("; + ss << vSubArguments[i]->GenSlidingWindowDeclRef(); + ss << "))\n"; + ss << " tmp"<<i<<"= 0;\n"; + ss << " else\n"; + ss << " tmp"<<i<<"=\n"; + ss << vSubArguments[i]->GenSlidingWindowDeclRef(); + ss << ";\n}\n"; + } + else + { + ss << "tmp"<<i<<"="<<vSubArguments[i]->GenSlidingWindowDeclRef(); + ss <<";\n"; + } } - } ss << " tmp1 = floor(tmp1);\n"; ss << " bool bConvError;\n"; ss << " if(tmp1 < 1.0 || tmp0 < 0 || tmp0>=1.0)\n"; @@ -8557,14 +8557,14 @@ void OpVarA::GenSlidingWindowFunction(std::stringstream &ss, else if(isMixedSV == svSingleVectorRefDouble) { ss << " if (gid0 < " << pSVR->GetArrayLength() << ")\n"; - ss << " {\n"; + ss << " {\n"; ss << " arg = "; ss << vSubArguments[i]->GenSlidingWindowDeclRef() << ";\n"; ss << " if (!isnan(arg))\n"; ss << " {\n"; ss << " vSum += (arg - fMean)*(arg - fMean);\n"; ss << " }\n"; - ss << " }\n"; + ss << " }\n"; } else if(isMixedSV == svSingleVectorRefString) { @@ -8925,14 +8925,14 @@ void OpVarPA::GenSlidingWindowFunction(std::stringstream &ss, else if(isMixedSV == svSingleVectorRefDouble) { ss << " if (gid0 < " << pSVR->GetArrayLength() << ")\n"; - ss << " {\n"; + ss << " {\n"; ss << " arg = "; ss << vSubArguments[i]->GenSlidingWindowDeclRef() << ";\n"; ss << " if (!isnan(arg))\n"; ss << " {\n"; ss << " vSum += (arg - fMean)*(arg - fMean);\n"; ss << " }\n"; - ss << " }\n"; + ss << " }\n"; } else if(isMixedSV == svSingleVectorRefString) { @@ -9292,14 +9292,14 @@ void OpStDevA::GenSlidingWindowFunction(std::stringstream &ss, else if(isMixedSV == svSingleVectorRefDouble) { ss << " if (gid0 < " << pSVR->GetArrayLength() << ")\n"; - ss << " {\n"; + ss << " {\n"; ss << " arg = "; ss << vSubArguments[i]->GenSlidingWindowDeclRef() << ";\n"; ss << " if (!isnan(arg))\n"; ss << " {\n"; ss << " vSum += (arg - fMean)*(arg - fMean);\n"; ss << " }\n"; - ss << " }\n"; + ss << " }\n"; } else if(isMixedSV == svSingleVectorRefString) { @@ -9660,14 +9660,14 @@ void OpStDevPA::GenSlidingWindowFunction(std::stringstream &ss, else if(isMixedSV == svSingleVectorRefDouble) { ss << " if (gid0 < " << pSVR->GetArrayLength() << ")\n"; - ss << " {\n"; + ss << " {\n"; ss << " arg = "; ss << vSubArguments[i]->GenSlidingWindowDeclRef() << ";\n"; ss << " if (!isnan(arg))\n"; ss << " {\n"; ss << " vSum += (arg - fMean)*(arg - fMean);\n"; ss << " }\n"; - ss << " }\n"; + ss << " }\n"; } else if(isMixedSV == svSingleVectorRefString) { diff --git a/sc/source/core/tool/appoptio.cxx b/sc/source/core/tool/appoptio.cxx index d87076541f73..c5cb0591bbaf 100644 --- a/sc/source/core/tool/appoptio.cxx +++ b/sc/source/core/tool/appoptio.cxx @@ -105,7 +105,7 @@ ScAppOptions& ScAppOptions::operator=( const ScAppOptions& rCpy ) nDefaultObjectSizeHeight = rCpy.nDefaultObjectSizeHeight; mbShowSharedDocumentWarning = rCpy.mbShowSharedDocumentWarning; meKeyBindingType = rCpy.meKeyBindingType; - return *this; + return *this; } void ScAppOptions::SetLRUFuncList( const sal_uInt16* pList, const sal_uInt16 nCount ) diff --git a/sc/source/core/tool/interpr5.cxx b/sc/source/core/tool/interpr5.cxx index aef35f1cc3a0..55a30139213d 100644 --- a/sc/source/core/tool/interpr5.cxx +++ b/sc/source/core/tool/interpr5.cxx @@ -2259,8 +2259,8 @@ bool ScInterpreter::CheckMatrix(bool _bLOG, sal_uInt8& nCase, SCSIZE& nCX, else { pMatX = GetNewMat(nCY, nRY); - nCX = nCY; - nRX = nRY; + nCX = nCY; + nRX = nRY; if (!pMatX) { PushIllegalArgument(); diff --git a/sc/source/core/tool/interpr8.cxx b/sc/source/core/tool/interpr8.cxx index a3b77cb14004..759e5815ae0a 100644 --- a/sc/source/core/tool/interpr8.cxx +++ b/sc/source/core/tool/interpr8.cxx @@ -367,7 +367,7 @@ bool ScETSForecastCalculation::PreprocessDataRange( const ScMatrixRef& rMatX, co mnSmplInPrd = nSmplInPrd; else { - mnSmplInPrd = CalcPeriodLen(); + mnSmplInPrd = CalcPeriodLen(); if ( mnSmplInPrd == 1 ) bEDS = true; // period length 1 means no periodic data: EDS suffices } diff --git a/sc/source/filter/excel/excimp8.cxx b/sc/source/filter/excel/excimp8.cxx index e4d86de828e7..76085738d1b6 100644 --- a/sc/source/filter/excel/excimp8.cxx +++ b/sc/source/filter/excel/excimp8.cxx @@ -106,7 +106,7 @@ public: uno::Reference< container::XIndexContainer > xElement; if ( ! ( aElement >>= xElement ) ) throw lang::IllegalArgumentException(); - IdToOleNameHash[ aName ] = xElement; + IdToOleNameHash[ aName ] = xElement; } virtual void SAL_CALL removeByName( const OUString& aName ) override { diff --git a/sc/source/filter/excel/xestream.cxx b/sc/source/filter/excel/xestream.cxx index b62de7eeafbf..e2d70cda4f18 100644 --- a/sc/source/filter/excel/xestream.cxx +++ b/sc/source/filter/excel/xestream.cxx @@ -234,8 +234,8 @@ std::size_t XclExpStream::Write( const void* pData, std::size_t nBytes ) else { nWriteRet = mrStrm.WriteBytes(pBuffer, nWriteLen); - bValid = (nWriteLen == nWriteRet); - OSL_ENSURE( bValid, "XclExpStream::Write - stream write error" ); + bValid = (nWriteLen == nWriteRet); + OSL_ENSURE( bValid, "XclExpStream::Write - stream write error" ); } pBuffer += nWriteRet; nRet += nWriteRet; diff --git a/sc/source/filter/excel/xetable.cxx b/sc/source/filter/excel/xetable.cxx index 1292138d9b0b..264a4d042488 100644 --- a/sc/source/filter/excel/xetable.cxx +++ b/sc/source/filter/excel/xetable.cxx @@ -732,13 +732,13 @@ void XclExpLabelCell::Init( const XclExpRoot& rRoot, else nXclFont = mxText->GetLeadingFont(); - // create cell format - if( GetXFId() == EXC_XFID_NOTFOUND ) - { + // create cell format + if( GetXFId() == EXC_XFID_NOTFOUND ) + { OSL_ENSURE( nXclFont != EXC_FONT_NOTFOUND, "XclExpLabelCell::Init - leading font not found" ); bool bForceLineBreak = mxText->IsWrapped(); SetXFId( rRoot.GetXFBuffer().InsertWithFont( pPattern, ApiScriptType::WEAK, nXclFont, bForceLineBreak ) ); - } + } // get auto-wrap attribute from cell format const XclExpXF* pXF = rRoot.GetXFBuffer().GetXFById( GetXFId() ); diff --git a/sc/source/filter/lotus/lotform.cxx b/sc/source/filter/lotus/lotform.cxx index 1da11ec9305f..ed969fe40b3d 100644 --- a/sc/source/filter/lotus/lotform.cxx +++ b/sc/source/filter/lotus/lotform.cxx @@ -638,9 +638,9 @@ void LotusToSc::Convert( std::unique_ptr<ScTokenArray>& rpErg, sal_Int32& rRest case FT_Snum: if ( bWK123 ) { - sal_uInt32 nValue; + sal_uInt32 nValue; - Read( nValue ); + Read( nValue ); double fValue = Snum32ToDouble( nValue ); aStack << aPool.Store( fValue ); } diff --git a/sc/source/filter/oox/richstring.cxx b/sc/source/filter/oox/richstring.cxx index 94cd78b474e1..f1c82e04ed86 100644 --- a/sc/source/filter/oox/richstring.cxx +++ b/sc/source/filter/oox/richstring.cxx @@ -435,7 +435,7 @@ void RichString::createTextPortions( const OUString& rText, FontPortionModelList maTextPortions.clear(); if( !rText.isEmpty() ) { - sal_Int32 nStrLen = rText.getLength(); + sal_Int32 nStrLen = rText.getLength(); // add leading and trailing string position to ease the following loop if( rPortions.empty() || (rPortions.front().mnPos > 0) ) rPortions.insert( rPortions.begin(), FontPortionModel( 0 ) ); diff --git a/sc/source/filter/oox/workbookfragment.cxx b/sc/source/filter/oox/workbookfragment.cxx index 59cfa61bbd07..d37954e365fe 100644 --- a/sc/source/filter/oox/workbookfragment.cxx +++ b/sc/source/filter/oox/workbookfragment.cxx @@ -324,19 +324,19 @@ void importSheetFragments( WorkbookFragment& rWorkbookHandler, SheetFragmentVect rSharedPool.pushTask( std::make_unique<WorkerThread>( pTag, rWorkbookHandler, rxFragment, /* ref */ nSheetsLeft ) ); nSheetsLeft++; - } - - // coverity[loop_top] - this isn't an infinite loop where nSheetsLeft gets decremented by the above threads - while( nSheetsLeft > 0) - { - // This is a much more controlled re-enterancy hazard than - // allowing a yield deeper inside the filter code for progress - // bar updating. - Application::Yield(); - } - rSharedPool.waitUntilDone(pTag); - - // threads joined in ThreadPool destructor + } + + // coverity[loop_top] - this isn't an infinite loop where nSheetsLeft gets decremented by the above threads + while( nSheetsLeft > 0) + { + // This is a much more controlled re-enterancy hazard than + // allowing a yield deeper inside the filter code for progress + // bar updating. + Application::Yield(); + } + rSharedPool.waitUntilDone(pTag); + + // threads joined in ThreadPool destructor } } diff --git a/sc/source/filter/rtf/eeimpars.cxx b/sc/source/filter/rtf/eeimpars.cxx index c579b8956bcf..e49448b8f8a4 100644 --- a/sc/source/filter/rtf/eeimpars.cxx +++ b/sc/source/filter/rtf/eeimpars.cxx @@ -115,10 +115,10 @@ void ScEEImport::WriteToDocument( bool bSizeColsRows, double nOutputFactor, SvNu sal_uLong nProgress = 0; SCCOL nStartCol, nEndCol; - SCROW nStartRow, nEndRow; - SCTAB nTab; - SCROW nOverlapRowMax, nLastMergedRow; - SCCOL nMergeColAdd; + SCROW nStartRow, nEndRow; + SCTAB nTab; + SCROW nOverlapRowMax, nLastMergedRow; + SCCOL nMergeColAdd; nStartCol = maRange.aStart.Col(); nStartRow = maRange.aStart.Row(); nTab = maRange.aStart.Tab(); diff --git a/sc/source/filter/xml/XMLTableShapeImportHelper.cxx b/sc/source/filter/xml/XMLTableShapeImportHelper.cxx index 6c8f0639462b..2e651b5de4c9 100644 --- a/sc/source/filter/xml/XMLTableShapeImportHelper.cxx +++ b/sc/source/filter/xml/XMLTableShapeImportHelper.cxx @@ -204,7 +204,7 @@ void XMLTableShapeImportHelper::finishShape( { if ( ScDrawObjData* pAnchor = ScDrawLayer::GetObjData( pSdrObj ) ) { - if ( pAnchor->maStartOffset.getX() == 0 && pAnchor->maStartOffset.getY() == 0 ) + if ( pAnchor->maStartOffset.getX() == 0 && pAnchor->maStartOffset.getY() == 0 ) pAnchor->maStartOffset = aStartPoint; if ( aStartPoint.getX() < pAnchor->maStartOffset.getX() ) pAnchor->maStartOffset.setX( aStartPoint.getX() ); diff --git a/sc/source/filter/xml/XMLTableShapeResizer.cxx b/sc/source/filter/xml/XMLTableShapeResizer.cxx index 9cbdc7e6b6a7..105bbb7cbeb5 100644 --- a/sc/source/filter/xml/XMLTableShapeResizer.cxx +++ b/sc/source/filter/xml/XMLTableShapeResizer.cxx @@ -82,7 +82,7 @@ void ScMyOLEFixer::CreateChartListener(ScDocument* pDoc, return; unique_ptr< vector<ScTokenRef> > pRefTokens(new vector<ScTokenRef>); - const sal_Unicode cSep = ScCompiler::GetNativeSymbolChar(ocSep); + const sal_Unicode cSep = ScCompiler::GetNativeSymbolChar(ocSep); ScRefTokenHelper::compileRangeRepresentation( *pRefTokens, aRangeStr, pDoc, cSep, pDoc->GetGrammar()); if (!pRefTokens->empty()) diff --git a/sc/source/filter/xml/xmldrani.hxx b/sc/source/filter/xml/xmldrani.hxx index 8520fde6415c..fd70a656ea0b 100644 --- a/sc/source/filter/xml/xmldrani.hxx +++ b/sc/source/filter/xml/xmldrani.hxx @@ -231,8 +231,10 @@ public: virtual void SAL_CALL endFastElement( sal_Int32 nElement ) override; void AddSubTotalColumn(const css::sheet::SubTotalColumn& rSubTotalColumn) - { aSubTotalRule.aSubTotalColumns.realloc(aSubTotalRule.aSubTotalColumns.getLength() + 1); - aSubTotalRule.aSubTotalColumns[aSubTotalRule.aSubTotalColumns.getLength() - 1] = rSubTotalColumn; } + { + aSubTotalRule.aSubTotalColumns.realloc(aSubTotalRule.aSubTotalColumns.getLength() + 1); + aSubTotalRule.aSubTotalColumns[aSubTotalRule.aSubTotalColumns.getLength() - 1] = rSubTotalColumn; + } }; class ScXMLSubTotalFieldContext : public ScXMLImportContext diff --git a/sc/source/filter/xml/xmlstyle.cxx b/sc/source/filter/xml/xmlstyle.cxx index 6afef36ba39a..4026e098136f 100644 --- a/sc/source/filter/xml/xmlstyle.cxx +++ b/sc/source/filter/xml/xmlstyle.cxx @@ -1232,25 +1232,25 @@ bool XmlScPropHdl_HoriJustify::importXML( { if (IsXMLToken(rStrImpValue, XML_START)) { - nValue = table::CellHoriJustify_LEFT; + nValue = table::CellHoriJustify_LEFT; rValue <<= nValue; bRetval = true; } else if (IsXMLToken(rStrImpValue, XML_END)) { - nValue = table::CellHoriJustify_RIGHT; + nValue = table::CellHoriJustify_RIGHT; rValue <<= nValue; bRetval = true; } else if (IsXMLToken(rStrImpValue, XML_CENTER)) { - nValue = table::CellHoriJustify_CENTER; + nValue = table::CellHoriJustify_CENTER; rValue <<= nValue; bRetval = true; } else if (IsXMLToken(rStrImpValue, XML_JUSTIFY)) { - nValue = table::CellHoriJustify_BLOCK; + nValue = table::CellHoriJustify_BLOCK; rValue <<= nValue; bRetval = true; } diff --git a/sc/source/filter/xml/xmltabi.cxx b/sc/source/filter/xml/xmltabi.cxx index d9e447699616..936170a1624a 100644 --- a/sc/source/filter/xml/xmltabi.cxx +++ b/sc/source/filter/xml/xmltabi.cxx @@ -361,7 +361,7 @@ void SAL_CALL ScXMLTableContext::endFastElement(sal_Int32 /*nElement*/) SCTAB nCurTab = rTables.GetCurrentSheet(); if (!sPrintRanges.isEmpty()) { - ScRangeList aRangeList; + ScRangeList aRangeList; ScRangeStringConverter::GetRangeListFromString( aRangeList, sPrintRanges, pDoc, ::formula::FormulaGrammar::CONV_OOO ); size_t nCount = aRangeList.size(); for (size_t i=0; i< nCount; i++ ) diff --git a/sc/source/ui/Accessibility/AccessibleCell.cxx b/sc/source/ui/Accessibility/AccessibleCell.cxx index 930ffce6c8ef..6a87f344e242 100644 --- a/sc/source/ui/Accessibility/AccessibleCell.cxx +++ b/sc/source/ui/Accessibility/AccessibleCell.cxx @@ -138,7 +138,7 @@ uno::Reference< XAccessible > SAL_CALL ScAccessibleCell::getAccessibleAtPoint( void SAL_CALL ScAccessibleCell::grabFocus( ) { - SolarMutexGuard aGuard; + SolarMutexGuard aGuard; IsObjectValid(); if (getAccessibleParent().is() && mpViewShell) { diff --git a/sc/source/ui/Accessibility/AccessibleCellBase.cxx b/sc/source/ui/Accessibility/AccessibleCellBase.cxx index cd024862b5a5..18ce2fc1e0f1 100644 --- a/sc/source/ui/Accessibility/AccessibleCellBase.cxx +++ b/sc/source/ui/Accessibility/AccessibleCellBase.cxx @@ -74,7 +74,7 @@ ScAccessibleCellBase::~ScAccessibleCellBase() bool ScAccessibleCellBase::isVisible() { - SolarMutexGuard aGuard; + SolarMutexGuard aGuard; IsObjectValid(); // test whether the cell is hidden (column/row - hidden/filtered) bool bVisible(true); diff --git a/sc/source/ui/Accessibility/AccessibleContextBase.cxx b/sc/source/ui/Accessibility/AccessibleContextBase.cxx index 3577a57f839d..6a1a778ee01d 100644 --- a/sc/source/ui/Accessibility/AccessibleContextBase.cxx +++ b/sc/source/ui/Accessibility/AccessibleContextBase.cxx @@ -268,9 +268,9 @@ sal_Int32 SAL_CALL nIndex = i; } } - } + } - return nIndex; + return nIndex; } sal_Int16 SAL_CALL diff --git a/sc/source/ui/Accessibility/AccessibleDocument.cxx b/sc/source/ui/Accessibility/AccessibleDocument.cxx index 2adccc76a3e9..c54e624423da 100644 --- a/sc/source/ui/Accessibility/AccessibleDocument.cxx +++ b/sc/source/ui/Accessibility/AccessibleDocument.cxx @@ -495,16 +495,16 @@ bool ScChildrenShapes::ReplaceChild (::accessibility::AccessibleShape* pCurrentC for (sal_Int32 index=0;index<count;index++) { ScAccessibleShapeData* pShape = maZOrderedShapes[index]; - if (pShape) + if (pShape) + { + rtl::Reference< ::accessibility::AccessibleShape > pAccShape(pShape->pAccShape); + if (pAccShape.is() && ::accessibility::ShapeTypeHandler::Instance().GetTypeId (pAccShape->GetXShape()) == ::accessibility::DRAWING_CONTROL) { - rtl::Reference< ::accessibility::AccessibleShape > pAccShape(pShape->pAccShape); - if (pAccShape.is() && ::accessibility::ShapeTypeHandler::Instance().GetTypeId (pAccShape->GetXShape()) == ::accessibility::DRAWING_CONTROL) - { ::accessibility::AccessibleControlShape *pCtlAccShape = static_cast < ::accessibility::AccessibleControlShape* >(pAccShape.get()); if (pCtlAccShape && pCtlAccShape->GetControlModel() == pSet) return pCtlAccShape; - } - } + } + } } return nullptr; } @@ -516,12 +516,12 @@ ScChildrenShapes::GetAccessibleCaption (const css::uno::Reference < css::drawing for (sal_Int32 index=0;index<count;index++) { ScAccessibleShapeData* pShape = maZOrderedShapes[index]; - if (pShape && pShape->xShape == xShape ) - { - css::uno::Reference< css::accessibility::XAccessible > xNewChild( pShape->pAccShape.get() ); - if(xNewChild.get()) + if (pShape && pShape->xShape == xShape ) + { + css::uno::Reference< css::accessibility::XAccessible > xNewChild( pShape->pAccShape.get() ); + if(xNewChild.get()) return xNewChild; - } + } } return nullptr; } @@ -2164,7 +2164,7 @@ void ScAccessibleDocument::AddChild(const uno::Reference<XAccessible>& xAcc, boo if( bFireEvent ) { AccessibleEventObject aEvent; - aEvent.Source = uno::Reference<XAccessibleContext>(this); + aEvent.Source = uno::Reference<XAccessibleContext>(this); aEvent.EventId = AccessibleEventId::CHILD; aEvent.NewValue <<= mxTempAcc; CommitChange( aEvent ); @@ -2181,7 +2181,7 @@ void ScAccessibleDocument::RemoveChild(const uno::Reference<XAccessible>& xAcc, if( bFireEvent ) { AccessibleEventObject aEvent; - aEvent.Source = uno::Reference<XAccessibleContext>(this); + aEvent.Source = uno::Reference<XAccessibleContext>(this); aEvent.EventId = AccessibleEventId::CHILD; aEvent.OldValue <<= mxTempAcc; CommitChange( aEvent ); diff --git a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx index 084cd6d83195..fe4ae808336c 100644 --- a/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx +++ b/sc/source/ui/Accessibility/AccessibleDocumentPagePreview.cxx @@ -862,7 +862,7 @@ uno::Reference<XAccessible> ScShapeChildren::GetBackShape(sal_Int32 nIndex) cons if (nIndex >= 0) throw lang::IndexOutOfBoundsException(); - return xAccessible; + return xAccessible; } sal_Int32 ScShapeChildren::GetForeShapeCount() const @@ -889,7 +889,7 @@ uno::Reference<XAccessible> ScShapeChildren::GetForeShape(sal_Int32 nIndex) cons if (nIndex >= 0) throw lang::IndexOutOfBoundsException(); - return xAccessible; + return xAccessible; } sal_Int32 ScShapeChildren::GetControlCount() const @@ -916,7 +916,7 @@ uno::Reference<XAccessible> ScShapeChildren::GetControl(sal_Int32 nIndex) const if (nIndex >= 0) throw lang::IndexOutOfBoundsException(); - return xAccessible; + return xAccessible; } struct ScShapePointFound diff --git a/sc/source/ui/Accessibility/AccessibleEditObject.cxx b/sc/source/ui/Accessibility/AccessibleEditObject.cxx index f13bd2be706c..17fdbbe5ea77 100644 --- a/sc/source/ui/Accessibility/AccessibleEditObject.cxx +++ b/sc/source/ui/Accessibility/AccessibleEditObject.cxx @@ -155,7 +155,7 @@ uno::Reference< XAccessible > SAL_CALL ScAccessibleEditObject::getAccessibleAtPo uno::Reference<XAccessible> xRet; if (containsPoint(rPoint)) { - SolarMutexGuard aGuard; + SolarMutexGuard aGuard; IsObjectValid(); CreateTextHelper(); diff --git a/sc/source/ui/Accessibility/AccessiblePageHeader.cxx b/sc/source/ui/Accessibility/AccessiblePageHeader.cxx index c97d4ef72aa1..a821207e9a50 100644 --- a/sc/source/ui/Accessibility/AccessiblePageHeader.cxx +++ b/sc/source/ui/Accessibility/AccessiblePageHeader.cxx @@ -175,7 +175,7 @@ uno::Reference< XAccessible > SAL_CALL ScAccessiblePageHeader::getAccessibleAtPo void SAL_CALL ScAccessiblePageHeader::grabFocus() { - SolarMutexGuard aGuard; + SolarMutexGuard aGuard; IsObjectValid(); if (getAccessibleParent().is()) { diff --git a/sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx b/sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx index 50bbdde971ea..42239fd29725 100644 --- a/sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx +++ b/sc/source/ui/Accessibility/AccessiblePageHeaderArea.cxx @@ -107,7 +107,7 @@ uno::Reference< XAccessible > SAL_CALL ScAccessiblePageHeaderArea::getAccessible uno::Reference<XAccessible> xRet; if (containsPoint(rPoint)) { - SolarMutexGuard aGuard; + SolarMutexGuard aGuard; IsObjectValid(); if(!mpTextHelper) diff --git a/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx b/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx index 2c21faedbb49..f3cd32d0728f 100644 --- a/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx +++ b/sc/source/ui/Accessibility/AccessiblePreviewCell.cxx @@ -96,7 +96,7 @@ uno::Reference< XAccessible > SAL_CALL ScAccessiblePreviewCell::getAccessibleAtP uno::Reference<XAccessible> xRet; if (containsPoint(rPoint)) { - SolarMutexGuard aGuard; + SolarMutexGuard aGuard; IsObjectValid(); if(!mpTextHelper) @@ -110,7 +110,7 @@ uno::Reference< XAccessible > SAL_CALL ScAccessiblePreviewCell::getAccessibleAtP void SAL_CALL ScAccessiblePreviewCell::grabFocus() { - SolarMutexGuard aGuard; + SolarMutexGuard aGuard; IsObjectValid(); if (getAccessibleParent().is()) { diff --git a/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx b/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx index 6810cf457207..bb24d5816eb0 100644 --- a/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx +++ b/sc/source/ui/Accessibility/AccessiblePreviewHeaderCell.cxx @@ -135,7 +135,7 @@ void SAL_CALL ScAccessiblePreviewHeaderCell::release() uno::Any SAL_CALL ScAccessiblePreviewHeaderCell::getCurrentValue() { - SolarMutexGuard aGuard; + SolarMutexGuard aGuard; IsObjectValid(); double fValue(0.0); @@ -155,7 +155,7 @@ sal_Bool SAL_CALL ScAccessiblePreviewHeaderCell::setCurrentValue( const uno::Any uno::Any SAL_CALL ScAccessiblePreviewHeaderCell::getMaximumValue() { - SolarMutexGuard aGuard; + SolarMutexGuard aGuard; IsObjectValid(); double fValue(0.0); @@ -178,7 +178,7 @@ uno::Reference< XAccessible > SAL_CALL ScAccessiblePreviewHeaderCell::getAccessi uno::Reference<XAccessible> xRet; if (containsPoint(rPoint)) { - SolarMutexGuard aGuard; + SolarMutexGuard aGuard; IsObjectValid(); if(!mpTextHelper) @@ -192,7 +192,7 @@ uno::Reference< XAccessible > SAL_CALL ScAccessiblePreviewHeaderCell::getAccessi void SAL_CALL ScAccessiblePreviewHeaderCell::grabFocus() { - SolarMutexGuard aGuard; + SolarMutexGuard aGuard; IsObjectValid(); if (getAccessibleParent().is()) { diff --git a/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx b/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx index 608d03395528..ac134478e16b 100644 --- a/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx +++ b/sc/source/ui/Accessibility/AccessiblePreviewTable.cxx @@ -443,7 +443,7 @@ uno::Reference< XAccessible > SAL_CALL ScAccessiblePreviewTable::getAccessibleAt void SAL_CALL ScAccessiblePreviewTable::grabFocus() { - SolarMutexGuard aGuard; + SolarMutexGuard aGuard; IsObjectValid(); if (getAccessibleParent().is()) { diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx index 42c27fee13d0..55aaf256398e 100644 --- a/sc/source/ui/app/inputhdl.cxx +++ b/sc/source/ui/app/inputhdl.cxx @@ -2919,7 +2919,7 @@ void ScInputHandler::EnterHandler( ScEnterMode nBlockMode ) if ( bInsertPreCorrectedString && aString != aPreAutoCorrectString ) { - ScInputStatusItem aItem(FID_INPUTLINE_STATUS, + ScInputStatusItem aItem(FID_INPUTLINE_STATUS, aCursorPos, aCursorPos, aCursorPos, aPreAutoCorrectString, pObject.get()); aArgs[0] = &aItem; diff --git a/sc/source/ui/cctrl/tbzoomsliderctrl.cxx b/sc/source/ui/cctrl/tbzoomsliderctrl.cxx index 3ccad9b2c189..89eb23e81b7a 100644 --- a/sc/source/ui/cctrl/tbzoomsliderctrl.cxx +++ b/sc/source/ui/cctrl/tbzoomsliderctrl.cxx @@ -335,32 +335,32 @@ void ScZoomSliderWnd::UpdateFromItem( const SvxZoomSliderItem* pZoomSliderItem ) mpImpl->mnMaxZoom >= mpImpl->mnCurrentZoom && mpImpl->mnMaxZoom > gnSliderCenter, "Looks like the zoom slider item is corrupted" ); - const css::uno::Sequence < sal_Int32 >& rSnappingPoints = pZoomSliderItem->GetSnappingPoints(); - mpImpl->maSnappingPointOffsets.clear(); - mpImpl->maSnappingPointZooms.clear(); - - // get all snapping points: - std::set< sal_uInt16 > aTmpSnappingPoints; - for ( sal_Int32 j = 0; j < rSnappingPoints.getLength(); ++j ) - { - const sal_Int32 nSnappingPoint = rSnappingPoints[j]; - aTmpSnappingPoints.insert( static_cast<sal_uInt16>(nSnappingPoint) ); - } - - // remove snapping points that are too close to each other: - long nLastOffset = 0; - - for ( const sal_uInt16 nCurrent : aTmpSnappingPoints ) - { - const long nCurrentOffset = Zoom2Offset( nCurrent ); - - if ( nCurrentOffset - nLastOffset >= nSnappingPointsMinDist ) - { - mpImpl->maSnappingPointOffsets.push_back( nCurrentOffset ); - mpImpl->maSnappingPointZooms.push_back( nCurrent ); - nLastOffset = nCurrentOffset; - } - } + const css::uno::Sequence < sal_Int32 >& rSnappingPoints = pZoomSliderItem->GetSnappingPoints(); + mpImpl->maSnappingPointOffsets.clear(); + mpImpl->maSnappingPointZooms.clear(); + + // get all snapping points: + std::set< sal_uInt16 > aTmpSnappingPoints; + for ( sal_Int32 j = 0; j < rSnappingPoints.getLength(); ++j ) + { + const sal_Int32 nSnappingPoint = rSnappingPoints[j]; + aTmpSnappingPoints.insert( static_cast<sal_uInt16>(nSnappingPoint) ); + } + + // remove snapping points that are too close to each other: + long nLastOffset = 0; + + for ( const sal_uInt16 nCurrent : aTmpSnappingPoints ) + { + const long nCurrentOffset = Zoom2Offset( nCurrent ); + + if ( nCurrentOffset - nLastOffset >= nSnappingPointsMinDist ) + { + mpImpl->maSnappingPointOffsets.push_back( nCurrentOffset ); + mpImpl->maSnappingPointZooms.push_back( nCurrent ); + nLastOffset = nCurrentOffset; + } + } } Size aSliderWindowSize = GetOutputSizePixel(); diff --git a/sc/source/ui/dbgui/consdlg.cxx b/sc/source/ui/dbgui/consdlg.cxx index d1df2b6647a1..c2138dd89ffe 100644 --- a/sc/source/ui/dbgui/consdlg.cxx +++ b/sc/source/ui/dbgui/consdlg.cxx @@ -257,7 +257,7 @@ void ScConsolidateDlg::FillAreaLists() pLbDataArea->InsertEntry( pAreaData[i].aStrName, i+1 ); // if ( !pAreaData[i].bIsDbArea ) - pLbDestArea->InsertEntry( pAreaData[i].aStrName, i+1 ); + pLbDestArea->InsertEntry( pAreaData[i].aStrName, i+1 ); } } } diff --git a/sc/source/ui/dbgui/filtdlg.cxx b/sc/source/ui/dbgui/filtdlg.cxx index 6eff43642397..96debd0892e4 100644 --- a/sc/source/ui/dbgui/filtdlg.cxx +++ b/sc/source/ui/dbgui/filtdlg.cxx @@ -319,17 +319,17 @@ void ScFilterDlg::Init( const SfxItemSet& rArgSet ) pLbConnect1->Hide(); // Disable/Enable Logic: - (pLbField1->GetSelectedEntryPos() != 0) + (pLbField1->GetSelectedEntryPos() != 0) && (pLbField2->GetSelectedEntryPos() != 0) ? pLbConnect2->SelectEntryPos( static_cast<sal_uInt16>(theQueryData.GetEntry(1).eConnect) ) : pLbConnect2->SetNoSelection(); - (pLbField2->GetSelectedEntryPos() != 0) + (pLbField2->GetSelectedEntryPos() != 0) && (pLbField3->GetSelectedEntryPos() != 0) ? pLbConnect3->SelectEntryPos( static_cast<sal_uInt16>(theQueryData.GetEntry(2).eConnect) ) : pLbConnect3->SetNoSelection(); - (pLbField3->GetSelectedEntryPos() != 0) + (pLbField3->GetSelectedEntryPos() != 0) && (pLbField4->GetSelectedEntryPos() != 0) ? pLbConnect4->SelectEntryPos( static_cast<sal_uInt16>(theQueryData.GetEntry(3).eConnect) ) : pLbConnect4->SetNoSelection(); diff --git a/sc/source/ui/dbgui/pfiltdlg.cxx b/sc/source/ui/dbgui/pfiltdlg.cxx index dc394d0cf9d2..fe98f18c67df 100644 --- a/sc/source/ui/dbgui/pfiltdlg.cxx +++ b/sc/source/ui/dbgui/pfiltdlg.cxx @@ -209,12 +209,12 @@ void ScPivotFilterDlg::Init( const SfxItemSet& rArgSet ) // disable/enable logic: - (m_pLbField1->GetSelectedEntryPos() != 0) + (m_pLbField1->GetSelectedEntryPos() != 0) && (m_pLbField2->GetSelectedEntryPos() != 0) ? m_pLbConnect1->SelectEntryPos( static_cast<sal_uInt16>(theQueryData.GetEntry(1).eConnect) ) : m_pLbConnect1->SetNoSelection(); - (m_pLbField2->GetSelectedEntryPos() != 0) + (m_pLbField2->GetSelectedEntryPos() != 0) && (m_pLbField3->GetSelectedEntryPos() != 0) ? m_pLbConnect2->SelectEntryPos( static_cast<sal_uInt16>(theQueryData.GetEntry(2).eConnect) ) : m_pLbConnect2->SetNoSelection(); diff --git a/sc/source/ui/dbgui/sfiltdlg.cxx b/sc/source/ui/dbgui/sfiltdlg.cxx index 41859bc89848..2c46c8684ba2 100644 --- a/sc/source/ui/dbgui/sfiltdlg.cxx +++ b/sc/source/ui/dbgui/sfiltdlg.cxx @@ -66,27 +66,27 @@ ScSpecialFilterDlg::ScSpecialFilterDlg( SfxBindings* pB, SfxChildWindow* pCW, vc pRefInputEdit ( nullptr ), bRefInputMode ( false ) { - get(pLbFilterArea,"lbfilterarea"); - get(pEdFilterArea,"edfilterarea"); - pEdFilterArea->SetReferences(this, get<VclFrame>("filterframe")->get_label_widget()); - get(pRbFilterArea,"rbfilterarea"); - pRbFilterArea->SetReferences(this, pEdFilterArea); - get(pBtnCase,"case"); - get(pBtnRegExp,"regexp"); - get(pBtnHeader,"header"); - get(pBtnUnique,"unique"); - get(pBtnCopyResult,"copyresult"); - get(pLbCopyArea,"lbcopyarea"); - get(pEdCopyArea,"edcopyarea"); - pEdCopyArea->SetReferences(this, pBtnCopyResult); - get(pRbCopyArea,"rbcopyarea"); - pRbCopyArea->SetReferences(this, pEdCopyArea); - get(pBtnDestPers,"destpers"); - get(pFtDbAreaLabel,"dbarealabel"); - get(pFtDbArea,"dbarea"); - get(pBtnOk,"ok"); - get(pBtnCancel,"cancel"); - get(pExpander,"more"); + get(pLbFilterArea,"lbfilterarea"); + get(pEdFilterArea,"edfilterarea"); + pEdFilterArea->SetReferences(this, get<VclFrame>("filterframe")->get_label_widget()); + get(pRbFilterArea,"rbfilterarea"); + pRbFilterArea->SetReferences(this, pEdFilterArea); + get(pBtnCase,"case"); + get(pBtnRegExp,"regexp"); + get(pBtnHeader,"header"); + get(pBtnUnique,"unique"); + get(pBtnCopyResult,"copyresult"); + get(pLbCopyArea,"lbcopyarea"); + get(pEdCopyArea,"edcopyarea"); + pEdCopyArea->SetReferences(this, pBtnCopyResult); + get(pRbCopyArea,"rbcopyarea"); + pRbCopyArea->SetReferences(this, pEdCopyArea); + get(pBtnDestPers,"destpers"); + get(pFtDbAreaLabel,"dbarealabel"); + get(pFtDbArea,"dbarea"); + get(pBtnOk,"ok"); + get(pBtnCancel,"cancel"); + get(pExpander,"more"); Init( rArgSet ); pEdFilterArea->GrabFocus(); diff --git a/sc/source/ui/docshell/dbdocimp.cxx b/sc/source/ui/docshell/dbdocimp.cxx index 69aeeb02709b..612eb4996982 100644 --- a/sc/source/ui/docshell/dbdocimp.cxx +++ b/sc/source/ui/docshell/dbdocimp.cxx @@ -130,7 +130,7 @@ bool ScDBDocFunc::DoImport( SCTAB nTab, const ScImportParam& rParam, rParam.nCol2, rParam.nRow2 ); if (!pDBData) { - OSL_FAIL( "DoImport: no DBData" ); + OSL_FAIL( "DoImport: no DBData" ); return false; } diff --git a/sc/source/ui/docshell/docfunc.cxx b/sc/source/ui/docshell/docfunc.cxx index cabb2472c358..1965e4c9067f 100644 --- a/sc/source/ui/docshell/docfunc.cxx +++ b/sc/source/ui/docshell/docfunc.cxx @@ -1201,7 +1201,7 @@ bool ScDocFunc::ShowNote( const ScAddress& rPos, bool bShow ) if( rDoc.IsUndoEnabled() ) rDocShell.GetUndoManager()->AddUndoAction( std::make_unique<ScUndoShowHideNote>( rDocShell, rPos, bShow ) ); - rDoc.SetStreamValid(rPos.Tab(), false); + rDoc.SetStreamValid(rPos.Tab(), false); ScTabView::OnLOKNoteStateChanged(pNote); @@ -2107,7 +2107,7 @@ bool ScDocFunc::InsertCells( const ScRange& rRange, const ScMarkData* pTabMark, while( !qIncreaseRange.empty() ) { ScRange aRange = qIncreaseRange.back(); - ScCellMergeOption aMergeOption( + ScCellMergeOption aMergeOption( aRange.aStart.Col(), aRange.aStart.Row(), aRange.aEnd.Col(), aRange.aEnd.Row() ); MergeCells(aMergeOption, false, true, true); diff --git a/sc/source/ui/docshell/olinefun.cxx b/sc/source/ui/docshell/olinefun.cxx index c15dcfd7c88f..cad48943ed54 100644 --- a/sc/source/ui/docshell/olinefun.cxx +++ b/sc/source/ui/docshell/olinefun.cxx @@ -392,7 +392,7 @@ bool ScOutlineDocFunc::SelectLevel( SCTAB nTab, bool bColumns, sal_uInt16 nLevel } } - for (SCCOLROW i=nThisStart; i<=nThisEnd; i++) + for (SCCOLROW i=nThisStart; i<=nThisEnd; i++) { if ( bColumns ) rDoc.ShowCol( static_cast<SCCOL>(i), nTab, bShow ); diff --git a/sc/source/ui/drawfunc/drtxtob.cxx b/sc/source/ui/drawfunc/drtxtob.cxx index d688bf7977d8..90708dee1fb6 100644 --- a/sc/source/ui/drawfunc/drtxtob.cxx +++ b/sc/source/ui/drawfunc/drtxtob.cxx @@ -1035,7 +1035,7 @@ void ScDrawTextObjectBar::GetAttrState( SfxItemSet& rDestSet ) rDestSet.Put( SfxBoolItem( SID_ALIGN_ANY_RIGHT, eAdj == SvxAdjust::Right ) ); rDestSet.Put( SfxBoolItem( SID_ALIGN_ANY_JUSTIFIED, eAdj == SvxAdjust::Block ) ); - SvxLRSpaceItem aLR = aAttrSet.Get( EE_PARA_LRSPACE ); + SvxLRSpaceItem aLR = aAttrSet.Get( EE_PARA_LRSPACE ); aLR.SetWhich(SID_ATTR_PARA_LRSPACE); rDestSet.Put(aLR); Invalidate( SID_ATTR_PARA_LRSPACE ); diff --git a/sc/source/ui/drawfunc/graphsh.cxx b/sc/source/ui/drawfunc/graphsh.cxx index b0e2721cf6df..64f2e4339838 100644 --- a/sc/source/ui/drawfunc/graphsh.cxx +++ b/sc/source/ui/drawfunc/graphsh.cxx @@ -56,7 +56,7 @@ ScGraphicShell::ScGraphicShell(ScViewData* pData) : ScDrawShell(pData) { SetName("GraphicObject"); - SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context::Graphic)); + SfxShell::SetContextName(vcl::EnumContext::GetContextName(vcl::EnumContext::Context::Graphic)); } ScGraphicShell::~ScGraphicShell() diff --git a/sc/source/ui/navipi/content.cxx b/sc/source/ui/navipi/content.cxx index 539c6c05123b..07874893daa5 100644 --- a/sc/source/ui/navipi/content.cxx +++ b/sc/source/ui/navipi/content.cxx @@ -529,11 +529,11 @@ void ScContentTree::KeyInput( const KeyEvent& rKEvt ) while( pBeginEntry ) { OUString aTempText( GetEntryText( pBeginEntry ) ); - if( pScDrawView->GetObjectIsMarked( pScDrawView->GetObjectByName( aTempText ) ) ) - { + if( pScDrawView->GetObjectIsMarked( pScDrawView->GetObjectByName( aTempText ) ) ) + { bHasMakredObject = true; break; - } + } pBeginEntry = Next( pBeginEntry ); } if( !bHasMakredObject && pScTabViewShell) @@ -769,8 +769,8 @@ void ScContentTree::ObjectFresh( ScContentId nType, const SvTreeListEntry* pEntr { if ( bHiddenDoc && !pHiddenDocument ) return; // other document displayed - if(nType ==ScContentId::GRAPHIC||nType ==ScContentId::OLEOBJECT||nType ==ScContentId::DRAWING) - { + if(nType ==ScContentId::GRAPHIC||nType ==ScContentId::OLEOBJECT||nType ==ScContentId::DRAWING) + { SetUpdateMode(false); ClearType( nType ); GetDrawNames( nType/*, nId*/ ); @@ -800,7 +800,7 @@ void ScContentTree::ObjectFresh( ScContentId nType, const SvTreeListEntry* pEntr Select( pOldEntry ); } } - } + } } void ScContentTree::Refresh( ScContentId nType ) diff --git a/sc/source/ui/pagedlg/areasdlg.cxx b/sc/source/ui/pagedlg/areasdlg.cxx index b7ef9fe1e343..85b87004266d 100644 --- a/sc/source/ui/pagedlg/areasdlg.cxx +++ b/sc/source/ui/pagedlg/areasdlg.cxx @@ -385,7 +385,7 @@ bool ScPrintAreasDlg::Impl_CheckRefStrings() { Edit* pEd = nullptr; - if ( !bPrintAreaOk ) pEd = pEdPrintArea; + if ( !bPrintAreaOk ) pEd = pEdPrintArea; else if ( !bRepeatRowOk ) pEd = pEdRepeatRow; else if ( !bRepeatColOk ) pEd = pEdRepeatCol; diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx index 01b41cc63fd5..cf4d62f96fc7 100644 --- a/sc/source/ui/unoobj/chart2uno.cxx +++ b/sc/source/ui/unoobj/chart2uno.cxx @@ -3132,8 +3132,8 @@ sal_uInt32 getDisplayNumberFormat(const ScDocument* pDoc, const ScAddress& rPos) } } - // we could not find a non-empty cell - return 0; + // we could not find a non-empty cell + return 0; } if (nIndex < 0 || nIndex >= static_cast<sal_Int32>(m_aDataArray.size())) diff --git a/sc/source/ui/unoobj/dapiuno.cxx b/sc/source/ui/unoobj/dapiuno.cxx index ca1ddda16cc8..afb58aa355f3 100644 --- a/sc/source/ui/unoobj/dapiuno.cxx +++ b/sc/source/ui/unoobj/dapiuno.cxx @@ -1334,7 +1334,7 @@ ScDataPilotDescriptor::ScDataPilotDescriptor(ScDocShell* pDocSh) : { ScDPSaveData aSaveData; // set defaults like in ScPivotParam constructor - aSaveData.SetColumnGrand( true ); + aSaveData.SetColumnGrand( true ); aSaveData.SetRowGrand( true ); aSaveData.SetIgnoreEmptyRows( false ); aSaveData.SetRepeatIfEmpty( false ); @@ -2975,7 +2975,7 @@ ScFieldGroup& ScDataPilotFieldGroupsObj::getFieldGroup( const OUString& rName ) ScFieldGroups::iterator aIt = implFindByName( rName ); if( aIt == maGroups.end() ) throw RuntimeException("Field Group with name \"" + rName + "\" not found", static_cast<cppu::OWeakObject*>(this)); - return *aIt; + return *aIt; } void ScDataPilotFieldGroupsObj::renameFieldGroup( const OUString& rOldName, const OUString& rNewName ) diff --git a/sc/source/ui/unoobj/datauno.cxx b/sc/source/ui/unoobj/datauno.cxx index 8c7de6105331..f04bd72d4554 100644 --- a/sc/source/ui/unoobj/datauno.cxx +++ b/sc/source/ui/unoobj/datauno.cxx @@ -2370,7 +2370,7 @@ sal_Bool ScUnnamedDatabaseRangesObj::hasByTable( sal_Int32 nTab ) SolarMutexGuard aGuard; if (pDocShell) { - if (pDocShell->GetDocument().GetTableCount() <= nTab) + if (pDocShell->GetDocument().GetTableCount() <= nTab) throw lang::IndexOutOfBoundsException(); if (pDocShell->GetDocument().GetAnonymousDBData(static_cast<SCTAB>(nTab))) return true; diff --git a/sc/source/ui/vba/vbaapplication.cxx b/sc/source/ui/vba/vbaapplication.cxx index 2ae5b7b208fd..e58b643a076d 100644 --- a/sc/source/ui/vba/vbaapplication.cxx +++ b/sc/source/ui/vba/vbaapplication.cxx @@ -298,28 +298,28 @@ ScVbaApplication::getSelection() // if ScVbaShape::getType( xShape ) == office::MsoShapeType::msoAutoShape // and the uno object implements the com.sun.star.drawing.Text service // return a textboxshape object - sal_Int32 nType = ScVbaShape::getType( xShape ); - if ( nType == office::MsoShapeType::msoAutoShape ) - { - // TODO Oval with text box - if( ScVbaShape::getAutoShapeType( xShape ) == office::MsoAutoShapeType::msoShapeOval ) + sal_Int32 nType = ScVbaShape::getType( xShape ); + if ( nType == office::MsoShapeType::msoAutoShape ) { - return uno::makeAny( uno::Reference< msforms::XOval >(new ScVbaOvalShape( mxContext, xShape, xShapes, xModel ) ) ); - } + // TODO Oval with text box + if( ScVbaShape::getAutoShapeType( xShape ) == office::MsoAutoShapeType::msoShapeOval ) + { + return uno::makeAny( uno::Reference< msforms::XOval >(new ScVbaOvalShape( mxContext, xShape, xShapes, xModel ) ) ); + } - uno::Reference< lang::XServiceInfo > xShapeServiceInfo( xShape, uno::UNO_QUERY_THROW ); - if ( xShapeServiceInfo->supportsService("com.sun.star.drawing.Text") ) + uno::Reference< lang::XServiceInfo > xShapeServiceInfo( xShape, uno::UNO_QUERY_THROW ); + if ( xShapeServiceInfo->supportsService("com.sun.star.drawing.Text") ) + { + return uno::makeAny( uno::Reference< msforms::XTextBoxShape >( + new ScVbaTextBoxShape( mxContext, xShape, xShapes, xModel ) ) ); + } + } + else if ( nType == office::MsoShapeType::msoLine ) { - return uno::makeAny( uno::Reference< msforms::XTextBoxShape >( - new ScVbaTextBoxShape( mxContext, xShape, xShapes, xModel ) ) ); + return uno::makeAny( uno::Reference< msforms::XLine >( new ScVbaLineShape( + mxContext, xShape, xShapes, xModel ) ) ); } - } - else if ( nType == office::MsoShapeType::msoLine ) - { - return uno::makeAny( uno::Reference< msforms::XLine >( new ScVbaLineShape( - mxContext, xShape, xShapes, xModel ) ) ); - } return uno::makeAny( uno::Reference< msforms::XShape >(new ScVbaShape( this, mxContext, xShape, xShapes, xModel, ScVbaShape::getType( xShape ) ) ) ); } else if( xServiceInfo->supportsService("com.sun.star.sheet.SheetCellRange") || @@ -715,7 +715,7 @@ ScVbaApplication::setCursor( sal_Int32 _cursor ) { try { - uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_QUERY_THROW ); + uno::Reference< frame::XModel > xModel( getCurrentDocument(), uno::UNO_QUERY_THROW ); switch( _cursor ) { case excel::XlMousePointer::xlNorthwestArrow: @@ -928,7 +928,7 @@ OUString ScVbaApplication::getOfficePath( const OUString& _sPathType ) try { OUString sUrl; - xProps->getPropertyValue( _sPathType ) >>= sUrl; + xProps->getPropertyValue( _sPathType ) >>= sUrl; // if it's a list of paths then use the last one sal_Int32 nIndex = sUrl.lastIndexOf( ';' ) ; diff --git a/sc/source/ui/vba/vbachart.cxx b/sc/source/ui/vba/vbachart.cxx index 27605af57ea4..efda917eada2 100644 --- a/sc/source/ui/vba/vbachart.cxx +++ b/sc/source/ui/vba/vbachart.cxx @@ -222,10 +222,10 @@ ScVbaChart::getChartType() void SAL_CALL ScVbaChart::setChartType( ::sal_Int32 _nChartType ) { -try -{ - switch (_nChartType) + try { + switch (_nChartType) + { case xlColumnClustered: case xlColumnStacked: case xlColumnStacked100: @@ -339,10 +339,10 @@ try break; default: throw script::BasicErrorException( OUString(), uno::Reference< uno::XInterface >(), sal_uInt32(ERRCODE_BASIC_CONVERSION), OUString() ); - } + } - switch (_nChartType) - { + switch (_nChartType) + { case xlLineMarkers: case xlLineMarkersStacked: case xlLineMarkersStacked100: @@ -360,10 +360,10 @@ try mxDiagramPropertySet->setPropertyValue(SYMBOLTYPE, uno::makeAny(chart::ChartSymbolType::NONE)); } break; - } + } - switch (_nChartType) - { + switch (_nChartType) + { case xlConeCol: case xlPyramidCol: case xlCylinderCol: diff --git a/sc/source/ui/vba/vbacomment.cxx b/sc/source/ui/vba/vbacomment.cxx index 0370a45719fb..57b67993abc2 100644 --- a/sc/source/ui/vba/vbacomment.cxx +++ b/sc/source/ui/vba/vbacomment.cxx @@ -96,7 +96,7 @@ ScVbaComment::getAnnotationIndex() } SAL_INFO("sc.ui", "returning index is " << aIndex); - return aIndex; + return aIndex; } uno::Reference< excel::XComment > diff --git a/sc/source/ui/vba/vbaformatcondition.cxx b/sc/source/ui/vba/vbaformatcondition.cxx index dcedad96775b..ed885a16fa01 100644 --- a/sc/source/ui/vba/vbaformatcondition.cxx +++ b/sc/source/ui/vba/vbaformatcondition.cxx @@ -56,7 +56,7 @@ ScVbaFormatCondition::Delete( ) { ScVbaFormatConditions* pFormatConditions = lcl_getScVbaFormatConditionsPtr( moFormatConditions ); pFormatConditions->removeFormatCondition(msStyleName, true); - notifyRange(); + notifyRange(); } void SAL_CALL diff --git a/sc/source/ui/vba/vbaoleobjects.cxx b/sc/source/ui/vba/vbaoleobjects.cxx index 299f2f7e89ba..b01cab778d5f 100644 --- a/sc/source/ui/vba/vbaoleobjects.cxx +++ b/sc/source/ui/vba/vbaoleobjects.cxx @@ -43,7 +43,7 @@ public: sal_Int32 nLen = xIndexAccess->getCount(); for ( sal_Int32 index = 0; index < nLen; ++index ) { - uno::Reference< drawing::XControlShape > xControlShape( xIndexAccess->getByIndex( index), uno::UNO_QUERY); + uno::Reference< drawing::XControlShape > xControlShape( xIndexAccess->getByIndex( index), uno::UNO_QUERY); if ( xControlShape.is() ) vObjects.push_back( xControlShape ); } @@ -94,12 +94,12 @@ public: virtual uno::Any SAL_CALL nextElement( ) override { - if ( nIndex < m_xIndexAccess->getCount() ) - { - uno::Reference< drawing::XControlShape > xControlShape ( m_xIndexAccess->getByIndex( nIndex++ ), uno::UNO_QUERY_THROW ); + if ( nIndex < m_xIndexAccess->getCount() ) + { + uno::Reference< drawing::XControlShape > xControlShape ( m_xIndexAccess->getByIndex( nIndex++ ), uno::UNO_QUERY_THROW ); return uno::makeAny( uno::Reference< ov::excel::XOLEObject >( new ScVbaOLEObject( m_xParent, m_xContext, xControlShape ) ) ); - } - throw container::NoSuchElementException(); + } + throw container::NoSuchElementException(); } }; diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx index dee057079db0..fba198b5ba55 100644 --- a/sc/source/ui/vba/vbarange.cxx +++ b/sc/source/ui/vba/vbarange.cxx @@ -588,7 +588,7 @@ public: if ( xTypes.is() ) { sal_Int32 nNewIndex = xTypes->getStandardFormat( nType, aLocale ); - mxRangeProps->setPropertyValue( "NumberFormat", uno::makeAny( nNewIndex ) ); + mxRangeProps->setPropertyValue( "NumberFormat", uno::makeAny( nNewIndex ) ); } } @@ -1414,7 +1414,7 @@ lcl_setupBorders( const uno::Reference< excel::XRange >& xParentRange, const uno uno::Reference< XHelperInterface > xParent( xParentRange, uno::UNO_QUERY_THROW ); ScDocument& rDoc = getDocumentFromRange(xRange); ScVbaPalette aPalette( rDoc.GetDocumentShell() ); - uno::Reference< XCollection > borders( new ScVbaBorders( xParent, xContext, xRange, aPalette ) ); + uno::Reference< XCollection > borders( new ScVbaBorders( xParent, xContext, xRange, aPalette ) ); return borders; } @@ -2042,7 +2042,7 @@ ScVbaRange::Address( const uno::Any& RowAbsolute, const uno::Any& ColumnAbsolut // Multi-Area Range OUStringBuffer sAddress; uno::Reference< XCollection > xCollection( m_Areas, uno::UNO_QUERY_THROW ); - uno::Any aExternalCopy = External; + uno::Any aExternalCopy = External; for ( sal_Int32 index = 1; index <= xCollection->getCount(); ++index ) { uno::Reference< excel::XRange > xRange( xCollection->Item( uno::makeAny( index ), uno::Any() ), uno::UNO_QUERY_THROW ); @@ -2295,14 +2295,14 @@ ScVbaRange::Activate() RangeHelper thisRange( xCellRange ); uno::Reference< sheet::XCellRangeAddressable > xThisRangeAddress = thisRange.getCellRangeAddressable(); table::CellRangeAddress thisRangeAddress = xThisRangeAddress->getRangeAddress(); - uno::Reference< frame::XModel > xModel; - ScDocShell* pShell = getScDocShell(); + uno::Reference< frame::XModel > xModel; + ScDocShell* pShell = getScDocShell(); - if ( pShell ) - xModel = pShell->GetModel(); + if ( pShell ) + xModel = pShell->GetModel(); - if ( !xModel.is() ) - throw uno::RuntimeException(); + if ( !xModel.is() ) + throw uno::RuntimeException(); // get current selection uno::Reference< sheet::XCellRangeAddressable > xRange( xModel->getCurrentSelection(), ::uno::UNO_QUERY); @@ -2641,8 +2641,8 @@ ScVbaRange::getWrapText() uno::Any aResult; for ( sal_Int32 index=1; index <= nItems; ++index ) { - uno::Reference< excel::XRange > xRange( m_Areas->Item( uno::makeAny(index), uno::Any() ), uno::UNO_QUERY_THROW ); - if ( index > 1 ) + uno::Reference< excel::XRange > xRange( m_Areas->Item( uno::makeAny(index), uno::Any() ), uno::UNO_QUERY_THROW ); + if ( index > 1 ) if ( aResult != xRange->getWrapText() ) return aNULL(); aResult = xRange->getWrapText(); @@ -2664,7 +2664,7 @@ ScVbaRange::getWrapText() uno::Reference< excel::XInterior > ScVbaRange::Interior( ) { uno::Reference< beans::XPropertySet > xProps( mxRange, uno::UNO_QUERY_THROW ); - return new ScVbaInterior ( this, mxContext, xProps, &getScDocument() ); + return new ScVbaInterior ( this, mxContext, xProps, &getScDocument() ); } uno::Reference< excel::XRange > ScVbaRange::Range( const uno::Any &Cell1, const uno::Any &Cell2 ) @@ -3310,7 +3310,7 @@ const OUString& sPropName ) const beans::PropertyValue* pProp = props.getConstArray(); sal_Int32 nItems = props.getLength(); - sal_Int32 count=0; + sal_Int32 count=0; for ( ; count < nItems; ++count, ++pProp ) if ( pProp->Name == sPropName ) return count; @@ -3670,10 +3670,10 @@ ScVbaRange::Delete( const uno::Any& Shift ) } } else - { + { bool bFullRow = ( thisAddress.StartColumn == 0 && thisAddress.EndColumn == MAXCOL ); - sal_Int32 nCols = thisAddress.EndColumn - thisAddress.StartColumn; - sal_Int32 nRows = thisAddress.EndRow - thisAddress.StartRow; + sal_Int32 nCols = thisAddress.EndColumn - thisAddress.StartColumn; + sal_Int32 nRows = thisAddress.EndRow - thisAddress.StartRow; if ( mbIsRows || bFullRow || ( nCols >= nRows ) ) mode = sheet::CellDeleteMode_UP; else @@ -3704,12 +3704,12 @@ ScVbaRange::createEnumeration() { uno::Reference< table::XColumnRowRange > xColumnRowRange(mxRange, uno::UNO_QUERY ); uno::Reference< excel::XRange > xRange( m_Areas->Item( uno::makeAny( sal_Int32(1) ), uno::Any() ), uno::UNO_QUERY_THROW ); - sal_Int32 nElems = 0; + sal_Int32 nElems = 0; if ( mbIsColumns ) nElems = xColumnRowRange->getColumns()->getCount(); else nElems = xColumnRowRange->getRows()->getCount(); - return new ColumnsRowEnumeration( xRange, nElems ); + return new ColumnsRowEnumeration( xRange, nElems ); } return new CellsEnumeration( mxParent, mxContext, m_Areas ); @@ -3934,7 +3934,7 @@ ScVbaRange::getRowHeight() sal_Int32 nStartRow = thisAddress.StartRow; sal_Int32 nEndRow = thisAddress.EndRow; - sal_uInt16 nRowTwips = 0; + sal_uInt16 nRowTwips = 0; // #TODO probably possible to use the SfxItemSet (and see if // SfxItemState::DONTCARE is set) to improve performance // #CHECKME looks like this is general behaviour not just row Range specific @@ -3970,7 +3970,7 @@ ScVbaRange::setRowHeight( const uno::Any& _rowheight) return; } double nHeight = 0; // Incoming height is in points - _rowheight >>= nHeight; + _rowheight >>= nHeight; nHeight = lcl_Round2DecPlaces( nHeight ); RangeHelper thisRange( mxRange ); table::CellRangeAddress thisAddress = thisRange.getCellRangeAddressable()->getRangeAddress(); @@ -4064,7 +4064,7 @@ ScVbaRange::getHeight() double nHeight = 0; for ( sal_Int32 index=0; index<nElems; ++index ) { - uno::Reference< sheet::XCellRangeAddressable > xAddressable( xIndexAccess->getByIndex( index ), uno::UNO_QUERY_THROW ); + uno::Reference< sheet::XCellRangeAddressable > xAddressable( xIndexAccess->getByIndex( index ), uno::UNO_QUERY_THROW ); nHeight += getCalcRowHeight(xAddressable->getRangeAddress() ); } return uno::makeAny( nHeight ); @@ -4170,7 +4170,7 @@ ScVbaRange::getWorksheet() ScDocShell* pDocShell = getDocShellFromRange(xRange); RangeHelper rHelper(xRange); // parent should be Thisworkbook - xSheet.set( new ScVbaWorksheet( uno::Reference< XHelperInterface >(), mxContext,rHelper.getSpreadSheet(),pDocShell->GetModel()) ); + xSheet.set( new ScVbaWorksheet( uno::Reference< XHelperInterface >(), mxContext,rHelper.getSpreadSheet(),pDocShell->GetModel()) ); } return xSheet; } @@ -4486,137 +4486,137 @@ ScVbaRange::AutoFilter( const uno::Any& aField, const uno::Any& Criteria1, const bool bAll = false; uno::Sequence< sheet::TableFilterField2 > sTabFilts; uno::Reference< beans::XPropertySet > xDescProps( xDesc, uno::UNO_QUERY_THROW ); - if ( Criteria1.hasValue() ) - { - sTabFilts.realloc( 1 ); - sTabFilts[0].Operator = sheet::FilterOperator2::EQUAL;// sensible default - if ( !bCritHasNumericValue ) + if ( Criteria1.hasValue() ) { - Criteria1 >>= sCriteria1; - if ( sCriteria1.isEmpty() ) + sTabFilts.realloc( 1 ); + sTabFilts[0].Operator = sheet::FilterOperator2::EQUAL;// sensible default + if ( !bCritHasNumericValue ) { - uno::Sequence< OUString > aCriteria1; - Criteria1 >>= aCriteria1; - sal_uInt16 nLength = aCriteria1.getLength(); - if ( nLength ) + Criteria1 >>= sCriteria1; + if ( sCriteria1.isEmpty() ) { - // When sequence is provided for Criteria1 don't care about Criteria2 - bAcceptCriteria2 = false; - - sTabFilts.realloc( nLength ); - for ( sal_uInt16 i = 0; i < nLength; ++i ) + uno::Sequence< OUString > aCriteria1; + Criteria1 >>= aCriteria1; + sal_uInt16 nLength = aCriteria1.getLength(); + if ( nLength ) { - lcl_setTableFieldsFromCriteria( aCriteria1[i], xDescProps, sTabFilts[i] ); - sTabFilts[i].Connection = sheet::FilterConnection_OR; - sTabFilts[i].Field = (nField - 1); + // When sequence is provided for Criteria1 don't care about Criteria2 + bAcceptCriteria2 = false; + + sTabFilts.realloc( nLength ); + for ( sal_uInt16 i = 0; i < nLength; ++i ) + { + lcl_setTableFieldsFromCriteria( aCriteria1[i], xDescProps, sTabFilts[i] ); + sTabFilts[i].Connection = sheet::FilterConnection_OR; + sTabFilts[i].Field = (nField - 1); + } } + else + bAll = true; } else - bAll = true; + { + sTabFilts[0].IsNumeric = bCritHasNumericValue; + if ( bHasCritValue && !sCriteria1.isEmpty() ) + lcl_setTableFieldsFromCriteria( sCriteria1, xDescProps, sTabFilts[0] ); + else + bAll = true; + } } - else + else // numeric { - sTabFilts[0].IsNumeric = bCritHasNumericValue; - if ( bHasCritValue && !sCriteria1.isEmpty() ) - lcl_setTableFieldsFromCriteria( sCriteria1, xDescProps, sTabFilts[0] ); - else - bAll = true; + sTabFilts[0].IsNumeric = true; + sTabFilts[0].NumericValue = nCriteria1; } } - else // numeric - { - sTabFilts[0].IsNumeric = true; - sTabFilts[0].NumericValue = nCriteria1; - } - } - else // no value specified - bAll = true; - // not sure what the relationship between Criteria1 and Operator is, - // e.g. can you have a Operator without a Criteria ? in openoffice it - if ( Operator.hasValue() && ( Operator >>= nOperator ) ) - { - // if it's a bottom/top Ten(Percent/Value) and there - // is no value specified for criteria1 set it to 10 - if ( !bCritHasNumericValue && sCriteria1.isEmpty() && ( nOperator != excel::XlAutoFilterOperator::xlOr ) && ( nOperator != excel::XlAutoFilterOperator::xlAnd ) ) - { - sTabFilts[0].IsNumeric = true; - sTabFilts[0].NumericValue = 10; - bAll = false; - } - switch ( nOperator ) + else // no value specified + bAll = true; + // not sure what the relationship between Criteria1 and Operator is, + // e.g. can you have a Operator without a Criteria ? in openoffice it + if ( Operator.hasValue() && ( Operator >>= nOperator ) ) { - case excel::XlAutoFilterOperator::xlBottom10Items: - sTabFilts[0].Operator = sheet::FilterOperator2::BOTTOM_VALUES; - break; - case excel::XlAutoFilterOperator::xlBottom10Percent: - sTabFilts[0].Operator = sheet::FilterOperator2::BOTTOM_PERCENT; - break; - case excel::XlAutoFilterOperator::xlTop10Items: - sTabFilts[0].Operator = sheet::FilterOperator2::TOP_VALUES; - break; - case excel::XlAutoFilterOperator::xlTop10Percent: - sTabFilts[0].Operator = sheet::FilterOperator2::TOP_PERCENT; - break; - case excel::XlAutoFilterOperator::xlOr: - nConn = sheet::FilterConnection_OR; - break; - case excel::XlAutoFilterOperator::xlAnd: - nConn = sheet::FilterConnection_AND; - break; - default: - throw uno::RuntimeException("UnknownOption" ); - - } + // if it's a bottom/top Ten(Percent/Value) and there + // is no value specified for criteria1 set it to 10 + if ( !bCritHasNumericValue && sCriteria1.isEmpty() && ( nOperator != excel::XlAutoFilterOperator::xlOr ) && ( nOperator != excel::XlAutoFilterOperator::xlAnd ) ) + { + sTabFilts[0].IsNumeric = true; + sTabFilts[0].NumericValue = 10; + bAll = false; + } + switch ( nOperator ) + { + case excel::XlAutoFilterOperator::xlBottom10Items: + sTabFilts[0].Operator = sheet::FilterOperator2::BOTTOM_VALUES; + break; + case excel::XlAutoFilterOperator::xlBottom10Percent: + sTabFilts[0].Operator = sheet::FilterOperator2::BOTTOM_PERCENT; + break; + case excel::XlAutoFilterOperator::xlTop10Items: + sTabFilts[0].Operator = sheet::FilterOperator2::TOP_VALUES; + break; + case excel::XlAutoFilterOperator::xlTop10Percent: + sTabFilts[0].Operator = sheet::FilterOperator2::TOP_PERCENT; + break; + case excel::XlAutoFilterOperator::xlOr: + nConn = sheet::FilterConnection_OR; + break; + case excel::XlAutoFilterOperator::xlAnd: + nConn = sheet::FilterConnection_AND; + break; + default: + throw uno::RuntimeException("UnknownOption" ); - } - if ( !bAll && bAcceptCriteria2 ) - { - sTabFilts[0].Connection = sheet::FilterConnection_AND; - sTabFilts[0].Field = (nField - 1); + } - OUString sCriteria2; - uno::Sequence< OUString > aCriteria2; - if ( Criteria2.hasValue() ) // there is a Criteria2 + } + if ( !bAll && bAcceptCriteria2 ) { - sTabFilts.realloc(2); - sTabFilts[1].Field = sTabFilts[0].Field; - sTabFilts[1].Connection = nConn; + sTabFilts[0].Connection = sheet::FilterConnection_AND; + sTabFilts[0].Field = (nField - 1); - if ( Criteria2 >>= sCriteria2 ) + OUString sCriteria2; + uno::Sequence< OUString > aCriteria2; + if ( Criteria2.hasValue() ) // there is a Criteria2 { - if ( !sCriteria2.isEmpty() ) + sTabFilts.realloc(2); + sTabFilts[1].Field = sTabFilts[0].Field; + sTabFilts[1].Connection = nConn; + + if ( Criteria2 >>= sCriteria2 ) { - uno::Reference< beans::XPropertySet > xProps; - lcl_setTableFieldsFromCriteria( sCriteria2, xProps, sTabFilts[1] ); - sTabFilts[1].IsNumeric = false; + if ( !sCriteria2.isEmpty() ) + { + uno::Reference< beans::XPropertySet > xProps; + lcl_setTableFieldsFromCriteria( sCriteria2, xProps, sTabFilts[1] ); + sTabFilts[1].IsNumeric = false; + } } - } - else if ( Criteria2 >>= aCriteria2 ) - { - sal_uInt16 nLength = aCriteria2.getLength(); - if ( nLength ) + else if ( Criteria2 >>= aCriteria2 ) { - // For compatibility use only the last value form the sequence - lcl_setTableFieldsFromCriteria( aCriteria2[nLength - 1], xDescProps, sTabFilts[1] ); + sal_uInt16 nLength = aCriteria2.getLength(); + if ( nLength ) + { + // For compatibility use only the last value form the sequence + lcl_setTableFieldsFromCriteria( aCriteria2[nLength - 1], xDescProps, sTabFilts[1] ); + } + } + else // numeric + { + Criteria2 >>= sTabFilts[1].NumericValue; + sTabFilts[1].IsNumeric = true; + sTabFilts[1].Operator = sheet::FilterOperator2::EQUAL; } - } - else // numeric - { - Criteria2 >>= sTabFilts[1].NumericValue; - sTabFilts[1].IsNumeric = true; - sTabFilts[1].Operator = sheet::FilterOperator2::EQUAL; } } - } - xDesc->setFilterFields2( sTabFilts ); - if ( !bAll ) - { - xDataBaseRange->refresh(); - } - else - // was 0 based now seems to be 1 - lcl_SetAllQueryForField( pShell, nField, nSheet ); + xDesc->setFilterFields2( sTabFilts ); + if ( !bAll ) + { + xDataBaseRange->refresh(); + } + else + // was 0 based now seems to be 1 + lcl_SetAllQueryForField( pShell, nField, nSheet ); } } else @@ -4714,11 +4714,11 @@ ScVbaRange::Autofit() // if the range is a not a row or column range autofit will // throw an error - if ( !( mbIsColumns || mbIsRows ) ) + if ( !( mbIsColumns || mbIsRows ) ) DebugHelper::basicexception(ERRCODE_BASIC_METHOD_FAILED, OUString()); - ScDocShell* pDocShell = getDocShellFromRange( mxRange ); - if ( pDocShell ) - { + ScDocShell* pDocShell = getDocShellFromRange( mxRange ); + if ( pDocShell ) + { RangeHelper thisRange( mxRange ); table::CellRangeAddress thisAddress = thisRange.getCellRangeAddressable()->getRangeAddress(); diff --git a/sc/source/ui/vba/vbavalidation.cxx b/sc/source/ui/vba/vbavalidation.cxx index 15b36154d1f4..c9f166435325 100644 --- a/sc/source/ui/vba/vbavalidation.cxx +++ b/sc/source/ui/vba/vbavalidation.cxx @@ -316,7 +316,7 @@ ScVbaValidation::getFormula1() OUString SAL_CALL ScVbaValidation::getFormula2() { - uno::Reference< sheet::XSheetCondition > xCond( lcl_getValidationProps( m_xRange ), uno::UNO_QUERY_THROW ); + uno::Reference< sheet::XSheetCondition > xCond( lcl_getValidationProps( m_xRange ), uno::UNO_QUERY_THROW ); return xCond->getFormula2(); } diff --git a/sc/source/ui/vba/vbaworksheet.cxx b/sc/source/ui/vba/vbaworksheet.cxx index a4b1d184b5a2..ff602c6dbda8 100644 --- a/sc/source/ui/vba/vbaworksheet.cxx +++ b/sc/source/ui/vba/vbaworksheet.cxx @@ -426,7 +426,7 @@ void SAL_CALL ScVbaWorksheet::setAutoFilterMode( sal_Bool bAutoFilterMode ) uno::Reference< excel::XRange > ScVbaWorksheet::getUsedRange() { - uno::Reference< sheet::XSheetCellRange > xSheetCellRange(getSheet(), uno::UNO_QUERY_THROW ); + uno::Reference< sheet::XSheetCellRange > xSheetCellRange(getSheet(), uno::UNO_QUERY_THROW ); uno::Reference< sheet::XSheetCellCursor > xSheetCellCursor( getSheet()->createCursorByRange( xSheetCellRange ), uno::UNO_QUERY_THROW ); uno::Reference<sheet::XUsedAreaCursor> xUsedCursor(xSheetCellCursor,uno::UNO_QUERY_THROW); xUsedCursor->gotoStartOfUsedArea( false ); @@ -453,9 +453,9 @@ ScVbaWorksheet::HPageBreaks( const uno::Any& aIndex ) { uno::Reference< sheet::XSheetPageBreak > xSheetPageBreak(getSheet(),uno::UNO_QUERY_THROW); uno::Reference< excel::XHPageBreaks > xHPageBreaks( new ScVbaHPageBreaks( this, mxContext, xSheetPageBreak)); - if ( aIndex.hasValue() ) - return xHPageBreaks->Item( aIndex, uno::Any()); - return uno::makeAny( xHPageBreaks ); + if ( aIndex.hasValue() ) + return xHPageBreaks->Item( aIndex, uno::Any()); + return uno::makeAny( xHPageBreaks ); } uno::Any @@ -541,7 +541,7 @@ ScVbaWorksheet::Move( const uno::Any& Before, const uno::Any& After ) { uno::Reference< sheet::XSheetCellCursor > xSheetCellCursor = getSheet()->createCursor( ); uno::Reference<sheet::XUsedAreaCursor> xUsedCursor(xSheetCellCursor,uno::UNO_QUERY_THROW); - uno::Reference< table::XCellRange > xRange1( xSheetCellCursor, uno::UNO_QUERY); + uno::Reference< table::XCellRange > xRange1( xSheetCellCursor, uno::UNO_QUERY); // #FIXME needs worksheet as parent uno::Reference<excel::XRange> xRange = new ScVbaRange( this, mxContext, xRange1); if (xRange.is()) @@ -805,10 +805,10 @@ ScVbaWorksheet::Shapes( const uno::Any& aIndex ) uno::Reference< drawing::XShapes > xShapes( xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY_THROW ); uno::Reference< container::XIndexAccess > xIndexAccess( xShapes, uno::UNO_QUERY_THROW ); - uno::Reference< msforms::XShapes> xVbaShapes( new ScVbaShapes( this, mxContext, xIndexAccess, getModel() ) ); - if ( aIndex.hasValue() ) - return xVbaShapes->Item( aIndex, uno::Any() ); - return uno::makeAny( xVbaShapes ); + uno::Reference< msforms::XShapes> xVbaShapes( new ScVbaShapes( this, mxContext, xIndexAccess, getModel() ) ); + if ( aIndex.hasValue() ) + return xVbaShapes->Item( aIndex, uno::Any() ); + return uno::makeAny( xVbaShapes ); } uno::Any @@ -946,7 +946,7 @@ ScVbaWorksheet::getFormControls() uno::Reference< sheet::XSpreadsheet > xSpreadsheet( getSheet(), uno::UNO_QUERY_THROW ); uno::Reference< drawing::XDrawPageSupplier > xDrawPageSupplier( xSpreadsheet, uno::UNO_QUERY_THROW ); uno::Reference< form::XFormsSupplier > xFormSupplier( xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY_THROW ); - uno::Reference< container::XIndexAccess > xIndexAccess( xFormSupplier->getForms(), uno::UNO_QUERY_THROW ); + uno::Reference< container::XIndexAccess > xIndexAccess( xFormSupplier->getForms(), uno::UNO_QUERY_THROW ); // get the www-standard container ( maybe we should access the // 'www-standard' by name rather than index, this seems an // implementation detail @@ -1012,7 +1012,7 @@ void SAL_CALL ScVbaWorksheet::setEnableCalculation( sal_Bool bEnableCalculation ) { uno::Reference <sheet::XCalculatable> xCalculatable(getModel(), uno::UNO_QUERY_THROW); - xCalculatable->enableAutomaticCalculation( bEnableCalculation); + xCalculatable->enableAutomaticCalculation( bEnableCalculation); } sal_Bool SAL_CALL ScVbaWorksheet::getEnableCalculation( ) diff --git a/sc/source/ui/vba/vbaworksheets.cxx b/sc/source/ui/vba/vbaworksheets.cxx index 9c23794c19a4..bd4c5e132747 100644 --- a/sc/source/ui/vba/vbaworksheets.cxx +++ b/sc/source/ui/vba/vbaworksheets.cxx @@ -250,9 +250,9 @@ ScVbaWorksheets::Add( const uno::Any& Before, const uno::Any& After, aStringSheet = xApplication->getActiveWorkbook()->getActiveSheet()->getName(); bBefore = true; } - nCount = static_cast< SCTAB >( m_xIndexAccess->getCount() ); - for (SCTAB i=0; i < nCount; i++) - { + nCount = static_cast< SCTAB >( m_xIndexAccess->getCount() ); + for (SCTAB i=0; i < nCount; i++) + { uno::Reference< sheet::XSpreadsheet > xSheet(m_xIndexAccess->getByIndex(i), uno::UNO_QUERY); uno::Reference< container::XNamed > xNamed( xSheet, uno::UNO_QUERY_THROW ); if (xNamed->getName() == aStringSheet) @@ -260,7 +260,7 @@ ScVbaWorksheets::Add( const uno::Any& Before, const uno::Any& After, nSheetIndex = i; break; } - } + } if(!bBefore) nSheetIndex++; diff --git a/sc/source/ui/view/drawvie4.cxx b/sc/source/ui/view/drawvie4.cxx index f3d1b303af4d..a516f71bc64e 100644 --- a/sc/source/ui/view/drawvie4.cxx +++ b/sc/source/ui/view/drawvie4.cxx @@ -457,7 +457,7 @@ void ScDrawView::SetMarkedOriginalSize() if (nIdent == OBJ_OLE2) { // TODO/LEAN: working with visual area can switch object to running state - uno::Reference < embed::XEmbeddedObject > xObj( static_cast<SdrOle2Obj*>(pObj)->GetObjRef(), uno::UNO_QUERY ); + uno::Reference < embed::XEmbeddedObject > xObj( static_cast<SdrOle2Obj*>(pObj)->GetObjRef(), uno::UNO_QUERY ); if ( xObj.is() ) // NULL for an invalid object that couldn't be loaded { sal_Int64 nAspect = static_cast<SdrOle2Obj*>(pObj)->GetAspect(); diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx index 7f9bb77cc133..d9fdf1a6b20d 100644 --- a/sc/source/ui/view/formatsh.cxx +++ b/sc/source/ui/view/formatsh.cxx @@ -933,7 +933,7 @@ void ScFormatShell::ExecuteStyle( SfxRequest& rReq ) } } - rReq.SetReturnValue( SfxUInt16Item( nSlotId, nRetMask ) ); + rReq.SetReturnValue( SfxUInt16Item( nSlotId, nRetMask ) ); if ( bAddUndo && bUndo) pDocSh->GetUndoManager()->AddUndoAction( diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index a053367c8314..72ec475c1b21 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -5238,7 +5238,7 @@ bool ScGridWindow::GetEditUrl( const Point& rPos, long nStartX = aLogicEdit.Left(); - long nTextWidth = pEngine->CalcTextWidth(); + long nTextWidth = pEngine->CalcTextWidth(); long nTextHeight = pEngine->GetTextHeight(); if ( nTextWidth < nThisColLogic ) { diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx index dcb67b9e2e4a..93febfee2a3f 100644 --- a/sc/source/ui/view/output2.cxx +++ b/sc/source/ui/view/output2.cxx @@ -3571,8 +3571,8 @@ void ScOutputData::DrawEditTopBottom(DrawEditParam& rParam) // "repeat" is handled with unformatted text (for performance reasons) OUString aCellStr = rParam.mpEngine->GetText(); - long nRepeatSize = 0; - SetEngineTextAndGetWidth( rParam, aCellStr, nRepeatSize, 0 ); + long nRepeatSize = 0; + SetEngineTextAndGetWidth( rParam, aCellStr, nRepeatSize, 0 ); if ( pFmtDevice != mpRefDevice ) ++nRepeatSize; diff --git a/sc/source/ui/view/preview.cxx b/sc/source/ui/view/preview.cxx index c71aa6a3ef9c..848c0045bcc2 100644 --- a/sc/source/ui/view/preview.cxx +++ b/sc/source/ui/view/preview.cxx @@ -202,9 +202,9 @@ void ScPreview::TestLastPage() nTab = 0; nPageNo = nTabPage = nTabStart = nDisplayStart = 0; aState.nPrintTab = 0; - aState.nStartCol = aState.nEndCol = 0; - aState.nStartRow = aState.nEndRow = 0; - aState.nZoom = 0; + aState.nStartCol = aState.nEndCol = 0; + aState.nStartRow = aState.nEndRow = 0; + aState.nZoom = 0; aState.nPagesX = aState.nPagesY = 0; aState.nTabPages = aState.nTotalPages = aState.nPageStart = aState.nDocPages = 0; @@ -1232,11 +1232,11 @@ void ScPreview::MouseButtonUp( const MouseEvent& rMEvt ) bHeaderRulerChange = false; bFooterRulerChange = false; } - } - bTopRulerMove = false; - bBottomRulerMove = false; - bHeaderRulerMove = false; - bFooterRulerMove = false; + } + bTopRulerMove = false; + bBottomRulerMove = false; + bHeaderRulerMove = false; + bFooterRulerMove = false; } if( rMEvt.IsLeft() && GetPointer() == PointerStyle::HSplit ) { diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx index dbacb7d4b8f9..af90ce16e2aa 100644 --- a/sc/source/ui/view/tabvwsh4.cxx +++ b/sc/source/ui/view/tabvwsh4.cxx @@ -334,12 +334,12 @@ void ScTabViewShell::InnerResizePixel( const Point &rOfs, const Size &rSize, boo if ( GetViewFrame()->GetFrame().IsInPlace() ) { SvBorder aBorder; - GetBorderSize( aBorder, rSize ); + GetBorderSize( aBorder, rSize ); SetBorderPixel( aBorder ); Size aObjSize = GetObjectShell()->GetVisArea().GetSize(); - Size aSize( rSize ); + Size aSize( rSize ); aSize.AdjustWidth( -(aBorder.Left() + aBorder.Right()) ); aSize.AdjustHeight( -(aBorder.Top() + aBorder.Bottom()) ); diff --git a/sc/source/ui/view/tabvwshg.cxx b/sc/source/ui/view/tabvwshg.cxx index 887af7e5a1f2..4935ceba3e01 100644 --- a/sc/source/ui/view/tabvwshg.cxx +++ b/sc/source/ui/view/tabvwshg.cxx @@ -90,7 +90,7 @@ void ScTabViewShell::InsertURLButton( const OUString& rName, const OUString& rUR xPropSet->setPropertyValue("ButtonType", uno::Any(form::FormButtonType_URL) ); #if HAVE_FEATURE_AVMEDIA - if ( ::avmedia::MediaWindow::isMediaURL( rURL, ""/*TODO?*/ ) ) + if ( ::avmedia::MediaWindow::isMediaURL( rURL, ""/*TODO?*/ ) ) { xPropSet->setPropertyValue("DispatchURLInternal", uno::Any(true) ); } diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx index e7c01ce19dcb..bf7b8382dcba 100644 --- a/sc/source/ui/view/viewfun3.cxx +++ b/sc/source/ui/view/viewfun3.cxx @@ -642,7 +642,6 @@ void ScViewFunc::PasteFromTransferable( const uno::Reference<datatransfer::XTran else { TransferableDataHelper aDataHelper( rxTransferable ); - { SotClipboardFormatId nBiff8 = SotExchange::RegisterFormatName("Biff8"); SotClipboardFormatId nBiff5 = SotExchange::RegisterFormatName("Biff5"); SotClipboardFormatId nFormatId = SotClipboardFormatId::NONE; @@ -707,7 +706,6 @@ void ScViewFunc::PasteFromTransferable( const uno::Reference<datatransfer::XTran PasteDataFormat( nFormatId, aDataHelper.GetTransferable(), GetViewData().GetCurX(), GetViewData().GetCurY(), nullptr ); - } } } |