diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-07 08:42:54 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-07 10:45:05 +0200 |
commit | 868d8c8f0fdf376b0a3eb545ee841c9c12ffee3b (patch) | |
tree | 7e8b919732f3d73cfb77974c489ee864103b2882 | |
parent | 9479171a09ba4c73afa8b40a5c2590df3b6d5415 (diff) |
loplugin:unnecessaryparen handle parens inside call expr
stick to single-arg function calls, sometimes parens in multi-arg calls
might be there for clarity
Change-Id: Ib80190c571ce65b5d219a88056687042de749e74
Reviewed-on: https://gerrit.libreoffice.org/39676
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
59 files changed, 138 insertions, 102 deletions
diff --git a/codemaker/source/cppumaker/cppuoptions.cxx b/codemaker/source/cppumaker/cppuoptions.cxx index 2a15f3497283..ea15907cc1e5 100644 --- a/codemaker/source/cppumaker/cppuoptions.cxx +++ b/codemaker/source/cppumaker/cppuoptions.cxx @@ -43,7 +43,7 @@ bool CppuOptions::initOptions(int ac, char* av[], bool bCmdFile) OString name(av[0]); sal_Int32 index = name.lastIndexOf(SEPARATOR); - m_program = name.copy((index > 0 ? index+1 : 0)); + m_program = name.copy(index > 0 ? index+1 : 0); if (ac < 2) { diff --git a/codemaker/source/javamaker/javaoptions.cxx b/codemaker/source/javamaker/javaoptions.cxx index cffc74451ac7..a09107a99b53 100644 --- a/codemaker/source/javamaker/javaoptions.cxx +++ b/codemaker/source/javamaker/javaoptions.cxx @@ -41,7 +41,7 @@ bool JavaOptions::initOptions(int ac, char* av[], bool bCmdFile) OString name(av[0]); sal_Int32 index = name.lastIndexOf(SEPARATOR); - m_program = name.copy((index > 0 ? index+1 : 0)); + m_program = name.copy(index > 0 ? index+1 : 0); if (ac < 2) { diff --git a/compilerplugins/clang/test/unnecessaryparen.cxx b/compilerplugins/clang/test/unnecessaryparen.cxx index 201032a703ae..77cb6bb87168 100644 --- a/compilerplugins/clang/test/unnecessaryparen.cxx +++ b/compilerplugins/clang/test/unnecessaryparen.cxx @@ -15,6 +15,8 @@ int main() x = ((2)); // expected-error {{parentheses around parentheses [loplugin:unnecessaryparen]}} if ((foo(1))) foo(2); // expected-error {{parentheses immediately inside if statement [loplugin:unnecessaryparen]}} + + foo((1)); // expected-error {{parentheses immediately inside single-arg call [loplugin:unnecessaryparen]}} }; /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/compilerplugins/clang/unnecessaryparen.cxx b/compilerplugins/clang/unnecessaryparen.cxx index e04468fdf096..55dac9523870 100644 --- a/compilerplugins/clang/unnecessaryparen.cxx +++ b/compilerplugins/clang/unnecessaryparen.cxx @@ -33,11 +33,14 @@ public: { StringRef fn( compiler.getSourceManager().getFileEntryForID( compiler.getSourceManager().getMainFileID())->getName() ); - // fixing this makes the source in the .y files look horrible + // fixing this, makes the source in the .y files look horrible if (loplugin::hasPathnamePrefix(fn, WORKDIR "/YaccTarget/unoidl/source/sourceprovider-parser.cxx")) return; if (loplugin::hasPathnamePrefix(fn, WORKDIR "/YaccTarget/idlc/source/parser.cxx")) return; + if (loplugin::hasPathnamePrefix(fn, WORKDIR "/YaccTarget/rsc/source/parser/rscyacc.cxx")) + return; + // TODO yuck, comma operator at work if (loplugin::hasPathnamePrefix(fn, SRCDIR "/writerfilter/source/rtftok/rtftokenizer.cxx")) return; @@ -52,6 +55,7 @@ public: bool VisitDoStmt(const DoStmt *); bool VisitWhileStmt(const WhileStmt *); bool VisitSwitchStmt(const SwitchStmt *); + bool VisitCallExpr(const CallExpr *); private: void VisitSomeStmt(const Stmt *parent, const Expr* cond, StringRef stmtName); }; @@ -122,6 +126,31 @@ void UnnecessaryParen::VisitSomeStmt(const Stmt *parent, const Expr* cond, Strin } } +bool UnnecessaryParen::VisitCallExpr(const CallExpr* callExpr) +{ + if (ignoreLocation(callExpr)) + return true; + if (callExpr->getLocStart().isMacroID()) + return true; + if (callExpr->getNumArgs() != 1 || isa<CXXOperatorCallExpr>(callExpr)) + return true; + + auto parenExpr = dyn_cast<ParenExpr>(callExpr->getArg(0)->IgnoreImpCasts()); + if (parenExpr) { + if (parenExpr->getLocStart().isMacroID()) + return true; + // assignments need extra parentheses or they generate a compiler warning + auto binaryOp = dyn_cast<BinaryOperator>(parenExpr->getSubExpr()); + if (binaryOp && binaryOp->getOpcode() == BO_Assign) + return true; + report( + DiagnosticsEngine::Warning, "parentheses immediately inside single-arg call", + parenExpr->getLocStart()) + << parenExpr->getSourceRange(); + } + return true; +} + loplugin::Plugin::Registration< UnnecessaryParen > X("unnecessaryparen", true); } diff --git a/connectivity/source/drivers/mork/MResultSet.cxx b/connectivity/source/drivers/mork/MResultSet.cxx index 81f253fd3d2d..0be8b575804b 100644 --- a/connectivity/source/drivers/mork/MResultSet.cxx +++ b/connectivity/source/drivers/mork/MResultSet.cxx @@ -1139,7 +1139,7 @@ void SAL_CALL OResultSet::executeQuery() #endif for ( sal_Int32 nRow = 1; nRow <= m_aQueryHelper.getResultCount(); nRow++ ) { - OKeyValue* pKeyValue = OKeyValue::createKeyValue((nRow)); + OKeyValue* pKeyValue = OKeyValue::createKeyValue(nRow); std::vector<sal_Int32>::const_iterator aIter = m_aOrderbyColumnNumber.begin(); for (;aIter != m_aOrderbyColumnNumber.end(); ++aIter) diff --git a/cppu/source/typelib/typelib.cxx b/cppu/source/typelib/typelib.cxx index cf6621707f16..063e0ba8ddb1 100644 --- a/cppu/source/typelib/typelib.cxx +++ b/cppu/source/typelib/typelib.cxx @@ -249,7 +249,7 @@ TypeDescriptor_Init_Impl::~TypeDescriptor_Init_Impl() TypeDescriptionList_Impl::const_iterator aIt = pCache->begin(); while( aIt != pCache->end() ) { - typelib_typedescription_release( (*aIt) ); + typelib_typedescription_release( *aIt ); ++aIt; } delete pCache; @@ -1853,7 +1853,7 @@ extern "C" void SAL_CALL typelib_typedescription_getByName( { if( *ppRet ) { - typelib_typedescription_release( (*ppRet) ); + typelib_typedescription_release( *ppRet ); *ppRet = nullptr; } diff --git a/cui/source/options/cfgchart.cxx b/cui/source/options/cfgchart.cxx index 67ec485efaeb..fe9a24a01437 100644 --- a/cui/source/options/cfgchart.cxx +++ b/cui/source/options/cfgchart.cxx @@ -232,7 +232,7 @@ bool SvxChartOptions::RetrieveOptions() // set color values for( sal_Int32 i=0; i < nCount; i++ ) { - aCol.SetColor( (static_cast< ColorData >(aColorSeq[ i ] ))); + aCol.SetColor( static_cast< ColorData >(aColorSeq[ i ]) ); aName = aPrefix + OUString::number(i + 1) + aPostfix; diff --git a/dbaccess/source/ui/querydesign/JoinTableView.cxx b/dbaccess/source/ui/querydesign/JoinTableView.cxx index ff97680c0e89..2453d7ca265c 100644 --- a/dbaccess/source/ui/querydesign/JoinTableView.cxx +++ b/dbaccess/source/ui/querydesign/JoinTableView.cxx @@ -838,7 +838,7 @@ void OJoinTableView::MouseButtonUp( const MouseEvent& rEvt ) // Double-click if( rEvt.GetClicks() == 2 ) - ConnDoubleClicked( (*aIter) ); + ConnDoubleClicked( *aIter ); break; } diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx index 0aae2172e881..38b3d4e2dcc9 100644 --- a/editeng/source/editeng/impedit4.cxx +++ b/editeng/source/editeng/impedit4.cxx @@ -1841,7 +1841,7 @@ Reference< XSpellAlternatives > ImpEditEngine::ImpSpell( EditView* pEditView ) { DBG_ASSERT( xSpeller.is(), "No spell checker set!" ); - ContentNode* pLastNode = aEditDoc.GetObject( (aEditDoc.Count()-1) ); + ContentNode* pLastNode = aEditDoc.GetObject( aEditDoc.Count()-1 ); EditSelection aCurSel( pEditView->pImpEditView->GetEditSelection() ); aCurSel.Min() = aCurSel.Max(); diff --git a/embeddedobj/source/general/dummyobject.cxx b/embeddedobj/source/general/dummyobject.cxx index 83056c2a022e..269599af679d 100644 --- a/embeddedobj/source/general/dummyobject.cxx +++ b/embeddedobj/source/general/dummyobject.cxx @@ -294,7 +294,7 @@ void SAL_CALL ODummyEmbeddedObject::setPersistentEntry( if ( m_bWaitSaveCompleted ) { if ( nEntryConnectionMode == embed::EntryInitModes::NO_INIT ) - saveCompleted( ( m_xParentStorage != xStorage || !m_aEntryName.equals( sEntName ) ) ); + saveCompleted( m_xParentStorage != xStorage || !m_aEntryName.equals( sEntName ) ); else throw embed::WrongStateException( "The object waits for saveCompleted() call!", diff --git a/embeddedobj/source/msole/olepersist.cxx b/embeddedobj/source/msole/olepersist.cxx index 9b1b86359741..e039a306f867 100644 --- a/embeddedobj/source/msole/olepersist.cxx +++ b/embeddedobj/source/msole/olepersist.cxx @@ -1305,7 +1305,7 @@ void SAL_CALL OleEmbeddedObject::setPersistentEntry( if ( m_bWaitSaveCompleted ) { if ( nEntryConnectionMode == embed::EntryInitModes::NO_INIT ) - saveCompleted( ( m_xParentStorage != xStorage || !m_aEntryName.equals( sEntName ) ) ); + saveCompleted( m_xParentStorage != xStorage || !m_aEntryName.equals( sEntName ) ); else throw embed::WrongStateException( "The object waits for saveCompleted() call!", diff --git a/filter/source/graphicfilter/etiff/etiff.cxx b/filter/source/graphicfilter/etiff/etiff.cxx index 01520ae90949..ef7009e65b92 100644 --- a/filter/source/graphicfilter/etiff/etiff.cxx +++ b/filter/source/graphicfilter/etiff/etiff.cxx @@ -189,7 +189,7 @@ bool TIFFWriter::WriteTIFF( const Graphic& rGraphic, FilterConfigItem* pFilterCo mnBitsPerPixel = mnBitsPerPixel <= 1 ? 1 : mnBitsPerPixel <= 4 ? 4 : mnBitsPerPixel <= 8 ? 8 : 24; - if ( ImplWriteHeader( ( aAnimation.Count() > 0 ) ) ) + if ( ImplWriteHeader( aAnimation.Count() > 0 ) ) { Size aDestMapSize( 300, 300 ); const MapMode aMapMode( aBmp.GetPrefMapMode() ); diff --git a/filter/source/xsltdialog/typedetectionimport.cxx b/filter/source/xsltdialog/typedetectionimport.cxx index 4cdd05cc9b91..823f71ca82f6 100644 --- a/filter/source/xsltdialog/typedetectionimport.cxx +++ b/filter/source/xsltdialog/typedetectionimport.cxx @@ -72,7 +72,7 @@ void TypeDetectionImporter::fillFilterVector( XMLFilterVector& rFilters ) NodeVector::iterator aIter = maFilterNodes.begin(); while( aIter != maFilterNodes.end() ) { - filter_info_impl* pFilter = createFilterForNode( (*aIter) ); + filter_info_impl* pFilter = createFilterForNode( *aIter ); if( pFilter ) rFilters.push_back( pFilter ); diff --git a/filter/source/xsltdialog/xmlfilterjar.cxx b/filter/source/xsltdialog/xmlfilterjar.cxx index c9aec0b31584..f80e8f8a5820 100644 --- a/filter/source/xsltdialog/xmlfilterjar.cxx +++ b/filter/source/xsltdialog/xmlfilterjar.cxx @@ -279,7 +279,7 @@ void XMLFilterJarHelper::openPackage( const OUString& rPackageURL, XMLFilterVect { if( copyFiles( xIfc, (*aIter) ) ) { - rFilters.push_back( (*aIter) ); + rFilters.push_back( *aIter ); } else { diff --git a/hwpfilter/source/hcode.cxx b/hwpfilter/source/hcode.cxx index 41fb6d34cb81..1e0170401dca 100644 --- a/hwpfilter/source/hcode.cxx +++ b/hwpfilter/source/hcode.cxx @@ -423,7 +423,7 @@ static hchar s_hh2ks(hchar hh) return 0x2020; if (hh >= HCA_TG) { - return sal::static_int_cast<hchar>((tblhhtg_ks[hh - HCA_TG])); + return sal::static_int_cast<hchar>(tblhhtg_ks[hh - HCA_TG]); } hh -= HCA_KSS; idx = hh / 0x60 + 161; @@ -444,7 +444,7 @@ static hchar s_hh2kssm(hchar hh) if ((idx < 0x34 || idx >= 0x38) && idx != 0x1F) return 0; if (hh >= HCA_TG) - return sal::static_int_cast<hchar>((hhtg_tg[hh - HCA_TG])); + return sal::static_int_cast<hchar>(hhtg_tg[hh - HCA_TG]); if (idx == 0x1F) hh = hh - 0x1F00 + 0x360; else diff --git a/io/source/stm/odata.cxx b/io/source/stm/odata.cxx index ed6402e5ed8d..9a9680f0fb8b 100644 --- a/io/source/stm/odata.cxx +++ b/io/source/stm/odata.cxx @@ -668,7 +668,7 @@ void ODataOutputStream::writeUTF(const OUString& Value) writeLong( nUTFLen ); } else { - writeShort( ((sal_uInt16)nUTFLen) ); + writeShort( (sal_uInt16)nUTFLen ); } for( i = 0 ; i < nStrLen ; i++ ) { diff --git a/lotuswordpro/source/filter/lwpdrawobj.cxx b/lotuswordpro/source/filter/lwpdrawobj.cxx index 08688aa6037c..7d349351fb71 100644 --- a/lotuswordpro/source/filter/lwpdrawobj.cxx +++ b/lotuswordpro/source/filter/lwpdrawobj.cxx @@ -987,9 +987,9 @@ void LwpDrawTextBox::SetFontStyle(rtl::Reference<XFFont> const & pFont, SdwTextB //size pFont->SetFontSize(pRec->nTextSize/20); // bold - pFont->SetBold(((pRec->nTextAttrs & TA_BOLD) != 0)); + pFont->SetBold((pRec->nTextAttrs & TA_BOLD) != 0); // italic - pFont->SetItalic(((pRec->nTextAttrs & TA_ITALIC) != 0)); + pFont->SetItalic((pRec->nTextAttrs & TA_ITALIC) != 0); // strike-through if (pRec->nTextAttrs & TA_STRIKETHRU) { diff --git a/package/source/xstor/xstorage.cxx b/package/source/xstor/xstorage.cxx index bb473a090cda..cf67ee18ca8d 100644 --- a/package/source/xstor/xstorage.cxx +++ b/package/source/xstor/xstorage.cxx @@ -1245,7 +1245,7 @@ void OStorage_Impl::Revert() pDeletedIter != m_aDeletedList.end(); ++pDeletedIter ) { - m_aChildrenList.push_back( (*pDeletedIter) ); + m_aChildrenList.push_back( *pDeletedIter ); ClearElement( *pDeletedIter ); diff --git a/rsc/source/parser/rsckey.cxx b/rsc/source/parser/rsckey.cxx index b4758fff6aaa..843470f793b8 100644 --- a/rsc/source/parser/rsckey.cxx +++ b/rsc/source/parser/rsckey.cxx @@ -72,8 +72,7 @@ Atom RscNameTable::Put( Atom nName, sal_uInt32 nTyp, sal_IntPtr nValue ) ((nEntries +1) * sizeof( KEY_STRUCT )) )); else pTable = static_cast<KEY_STRUCT *>( - rtl_allocateMemory( ((nEntries +1) - * sizeof( KEY_STRUCT )) )); + rtl_allocateMemory( (nEntries + 1) * sizeof( KEY_STRUCT ) ) ); pTable[ nEntries ].nName = nName; pTable[ nEntries ].nTyp = nTyp; diff --git a/rsc/source/res/rscclass.cxx b/rsc/source/res/rscclass.cxx index c793771d4322..386b34a2229a 100644 --- a/rsc/source/res/rscclass.cxx +++ b/rsc/source/res/rscclass.cxx @@ -220,8 +220,8 @@ ERRTYPE RscClass::SetVariable( Atom nVarName, } else { - pVarTypeList = static_cast<VARTYPE_STRUCT *>(rtl_allocateMemory( ((nEntries +1) - * sizeof( VARTYPE_STRUCT )) )); + pVarTypeList = static_cast<VARTYPE_STRUCT *>(rtl_allocateMemory( (nEntries + 1) + * sizeof( VARTYPE_STRUCT ) )); } pVarTypeList[ nEntries ].nVarName = nVarName; pVarTypeList[ nEntries ].nMask = nMask; diff --git a/rsc/source/res/rscconst.cxx b/rsc/source/res/rscconst.cxx index f791eb2b6b63..c0161106dbea 100644 --- a/rsc/source/res/rscconst.cxx +++ b/rsc/source/res/rscconst.cxx @@ -44,7 +44,7 @@ void RscEnum::SetConstant( Atom nVarName, sal_Int32 lValue ) pVarArray = static_cast<VarEle *>(rtl_reallocateMemory( static_cast<void *>(pVarArray), ((nEntries +1) * sizeof( VarEle )) )); else - pVarArray = static_cast<VarEle *>(rtl_allocateMemory( ((nEntries +1) * sizeof( VarEle )) )); + pVarArray = static_cast<VarEle *>(rtl_allocateMemory( (nEntries +1) * sizeof( VarEle ) )); pVarArray[ nEntries ].nId = nVarName; pVarArray[ nEntries ].lValue = lValue; nEntries++; diff --git a/sal/osl/unx/socket.cxx b/sal/osl/unx/socket.cxx index 973c1d68699e..2b5467091460 100644 --- a/sal/osl/unx/socket.cxx +++ b/sal/osl/unx/socket.cxx @@ -1306,7 +1306,7 @@ oslSocket SAL_CALL osl_createSocket(oslAddrFamily Family, int nErrno = errno; SAL_WARN( "sal.osl", "socket creation failed: (" << nErrno << ") " << strerror(nErrno) ); - destroySocketImpl((pSocket)); + destroySocketImpl(pSocket); pSocket= nullptr; } else diff --git a/sal/rtl/locale.cxx b/sal/rtl/locale.cxx index 751c23c5a941..ec8a8232ea8a 100644 --- a/sal/rtl/locale.cxx +++ b/sal/rtl/locale.cxx @@ -167,7 +167,7 @@ sal_Bool rtl_hashtable_grow(RTL_HASHTABLE** table) } rtl_freeMemory((*table)->Table); - rtl_freeMemory((*table)); + rtl_freeMemory(*table); (*table) = pNewTable; return true; diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx index c30d649bb8d4..345a82267249 100644 --- a/sc/source/core/tool/compiler.cxx +++ b/sc/source/core/tool/compiler.cxx @@ -1772,9 +1772,9 @@ ScCompiler::ScCompiler( ScDocument* pDocument, const ScAddress& rPos, ScTokenArr mbCloseBrackets( true ), mbRewind( false ) { - SetGrammar( ((eGrammar == formula::FormulaGrammar::GRAM_UNSPECIFIED) ? + SetGrammar( (eGrammar == formula::FormulaGrammar::GRAM_UNSPECIFIED) ? pDocument->GetGrammar() : - eGrammar) ); + eGrammar ); } ScCompiler::ScCompiler( sc::CompileFormulaContext& rCxt, const ScAddress& rPos ) : @@ -1812,9 +1812,9 @@ ScCompiler::ScCompiler( ScDocument* pDocument, const ScAddress& rPos, mbCloseBrackets( true ), mbRewind( false ) { - SetGrammar( ((eGrammar == formula::FormulaGrammar::GRAM_UNSPECIFIED) ? + SetGrammar( (eGrammar == formula::FormulaGrammar::GRAM_UNSPECIFIED) ? (pDocument ? pDocument->GetGrammar() : formula::FormulaGrammar::GRAM_DEFAULT) : - eGrammar)); + eGrammar ); } ScCompiler::~ScCompiler() diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx index e453f46a5812..75a1d6b2debe 100644 --- a/sc/source/core/tool/interpr2.cxx +++ b/sc/source/core/tool/interpr2.cxx @@ -1884,7 +1884,7 @@ void ScInterpreter::ScPDuration() if ( fFuture <= 0.0 || fPresent <= 0.0 || fInterest <= 0.0 ) PushIllegalArgument(); else - PushDouble( ( log( fFuture / fPresent ) / rtl::math::log1p( fInterest ) ) ); + PushDouble( log( fFuture / fPresent ) / rtl::math::log1p( fInterest ) ); } } diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx index 5b1e193f6738..46a33554f318 100644 --- a/sc/source/core/tool/token.cxx +++ b/sc/source/core/tool/token.cxx @@ -5109,9 +5109,9 @@ namespace { void wrapAddress( ScAddress& rPos, SCCOL nMaxCol, SCROW nMaxRow ) { if (rPos.Col() > nMaxCol) - rPos.SetCol((rPos.Col() % (nMaxCol+1))); + rPos.SetCol(rPos.Col() % (nMaxCol+1)); if (rPos.Row() > nMaxRow) - rPos.SetRow((rPos.Row() % (nMaxRow+1))); + rPos.SetRow(rPos.Row() % (nMaxRow+1)); } template<typename T> void wrapRange( T& n1, T& n2, T nMax ) diff --git a/sc/source/ui/Accessibility/AccessibleDocument.cxx b/sc/source/ui/Accessibility/AccessibleDocument.cxx index 1d326f5927b9..efe77b65900e 100644 --- a/sc/source/ui/Accessibility/AccessibleDocument.cxx +++ b/sc/source/ui/Accessibility/AccessibleDocument.cxx @@ -988,7 +988,7 @@ bool ScChildrenShapes::FindSelectedShapesChanges(const uno::Reference<drawing::X (*aDataItr)->pAccShape->SetState(AccessibleStateType::SELECTED); (*aDataItr)->pAccShape->SetState(AccessibleStateType::FOCUSED); bResult = true; - vecSelectedShapeAdd.push_back((*aDataItr)); + vecSelectedShapeAdd.push_back(*aDataItr); } aFocusedItr = aDataItr; } diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx index fdb6d5e61a9f..b4896e3f9802 100644 --- a/sc/source/ui/vba/vbarange.cxx +++ b/sc/source/ui/vba/vbarange.cxx @@ -1778,7 +1778,7 @@ ScVbaRange::HasFormula() ScCellRangesBase* pThisRanges = dynamic_cast< ScCellRangesBase * > ( xIf.get() ); if ( pThisRanges ) { - uno::Reference<uno::XInterface> xRanges( pThisRanges->queryFormulaCells( ( sheet::FormulaResult::ERROR | sheet::FormulaResult::VALUE | sheet::FormulaResult::STRING ) ), uno::UNO_QUERY_THROW ); + uno::Reference<uno::XInterface> xRanges( pThisRanges->queryFormulaCells( sheet::FormulaResult::ERROR | sheet::FormulaResult::VALUE | sheet::FormulaResult::STRING ), uno::UNO_QUERY_THROW ); ScCellRangesBase* pFormulaRanges = dynamic_cast< ScCellRangesBase * > ( xRanges.get() ); // check if there are no formula cell, return false if ( pFormulaRanges->GetRangeList().empty() ) diff --git a/sc/source/ui/view/tabcont.cxx b/sc/source/ui/view/tabcont.cxx index c015c2bc12eb..a786a8ab5f18 100644 --- a/sc/source/ui/view/tabcont.cxx +++ b/sc/source/ui/view/tabcont.cxx @@ -321,9 +321,9 @@ void ScTabControl::UpdateInputContext() WinBits nStyle = GetStyle(); if (pDoc->GetDocumentShell()->IsReadOnly()) // no insert sheet tab for readonly doc. - SetStyle((nStyle & ~WB_INSERTTAB)); + SetStyle(nStyle & ~WB_INSERTTAB); else - SetStyle((nStyle | WB_INSERTTAB)); + SetStyle(nStyle | WB_INSERTTAB); } void ScTabControl::UpdateStatus() diff --git a/sd/source/core/CustomAnimationEffect.cxx b/sd/source/core/CustomAnimationEffect.cxx index be8f7da7b81f..52e3e52f5145 100644 --- a/sd/source/core/CustomAnimationEffect.cxx +++ b/sd/source/core/CustomAnimationEffect.cxx @@ -2574,7 +2574,7 @@ void EffectSequenceHelper::setAnimateForm( const CustomAnimationTextGroupPtr& pT // first insert if we have to if( bAnimateForm ) { - EffectSequence::iterator aInsertIter( find( (*aIter) ) ); + EffectSequence::iterator aInsertIter( find( *aIter ) ); CustomAnimationEffectPtr pEffect; if( (aEffects.size() == 1) && ((*aIter)->getTarget().getValueType() != ::cppu::UnoType<ParagraphTarget>::get() ) ) @@ -2721,8 +2721,8 @@ void EffectSequenceHelper::setTextReverse( const CustomAnimationTextGroupPtr& pT if( aIter != aEnd ) { - pTextGroup->addEffect( (*aIter ) ); - EffectSequence::iterator aInsertIter( find( (*aIter++) ) ); + pTextGroup->addEffect( *aIter ); + EffectSequence::iterator aInsertIter( find( *aIter++ ) ); while( aIter != aEnd ) { CustomAnimationEffectPtr pEffect( (*aIter++) ); diff --git a/sd/source/core/EffectMigration.cxx b/sd/source/core/EffectMigration.cxx index 1f9f60c6c351..11158e8c017b 100644 --- a/sd/source/core/EffectMigration.cxx +++ b/sd/source/core/EffectMigration.cxx @@ -1136,7 +1136,7 @@ void EffectMigration::SetPresentationOrder( SvxShape* pShape, sal_Int32 nNewPos std::vector< EffectSequence::iterator >::iterator aEnd( aEffectVector[nCurrentPos].end() ); while( aIter != aEnd ) { - aEffects.push_back( (*(*aIter)) ); + aEffects.push_back( *(*aIter) ); rSequence.erase( (*aIter++) ); } @@ -1150,7 +1150,7 @@ void EffectMigration::SetPresentationOrder( SvxShape* pShape, sal_Int32 nNewPos { while( aTempIter != aTempEnd ) { - rSequence.push_back( (*aTempIter++) ); + rSequence.push_back( *aTempIter++ ); } } else diff --git a/sd/source/filter/eppt/epptso.cxx b/sd/source/filter/eppt/epptso.cxx index 685f588f6693..80727694b15f 100644 --- a/sd/source/filter/eppt/epptso.cxx +++ b/sd/source/filter/eppt/epptso.cxx @@ -739,7 +739,7 @@ void PPTWriter::ImplWriteParagraphs( SvStream& rOut, TextObj& rTextObj ) if ( nPropertyFlags & 0xf ) rOut.WriteInt16( nBulletFlags ); if ( nPropertyFlags & 0x80 ) - rOut.WriteUInt16( ( pPara->cBulletId ) ); + rOut.WriteUInt16( pPara->cBulletId ); if ( nPropertyFlags & 0x10 ) rOut.WriteUInt16( nFontId ); if ( nPropertyFlags & 0x40 ) @@ -760,17 +760,17 @@ void PPTWriter::ImplWriteParagraphs( SvStream& rOut, TextObj& rTextObj ) rOut.WriteUInt32( nBulletColor ); } if ( nPropertyFlags & 0x00000800 ) - rOut.WriteUInt16( ( pPara->mnTextAdjust ) ); + rOut.WriteUInt16( pPara->mnTextAdjust ); if ( nPropertyFlags & 0x00001000 ) - rOut.WriteUInt16( ( nLineSpacing ) ); + rOut.WriteUInt16( nLineSpacing ); if ( nPropertyFlags & 0x00002000 ) - rOut.WriteUInt16( ( pPara->mnLineSpacingTop ) ); + rOut.WriteUInt16( pPara->mnLineSpacingTop ); if ( nPropertyFlags & 0x00004000 ) - rOut.WriteUInt16( ( pPara->mnLineSpacingBottom ) ); + rOut.WriteUInt16( pPara->mnLineSpacingBottom ); if ( nPropertyFlags & 0x100 ) - rOut.WriteUInt16( (pPara->nTextOfs) ); + rOut.WriteUInt16( pPara->nTextOfs ); if ( nPropertyFlags & 0x400 ) - rOut.WriteUInt16( (pPara->nBulletOfs) ); + rOut.WriteUInt16( pPara->nBulletOfs ); if ( nPropertyFlags & 0x000e0000 ) { sal_uInt16 nAsianSettings = 0; @@ -949,13 +949,13 @@ void PPTWriter::ImplWritePortions( SvStream& rOut, TextObj& rTextObj ) .WriteUInt32( nPropertyFlags ); //PropertyFlags if ( nPropertyFlags & 0xffff ) - rOut.WriteUInt16( ( nCharAttr ) ); + rOut.WriteUInt16( nCharAttr ); if ( nPropertyFlags & 0x00010000 ) rOut.WriteUInt16( rPortion.mnFont ); if ( nPropertyFlags & 0x00200000 ) rOut.WriteUInt16( rPortion.mnAsianOrComplexFont ); if ( nPropertyFlags & 0x00020000 ) - rOut.WriteUInt16( ( rPortion.mnCharHeight ) ); + rOut.WriteUInt16( rPortion.mnCharHeight ); if ( nPropertyFlags & 0x00040000 ) rOut.WriteUInt32( nCharColor ); if ( nPropertyFlags & 0x00080000 ) @@ -1100,7 +1100,7 @@ void PPTWriter::ImplWriteTextStyleAtom( SvStream& rOut, int nTextInstance, sal_u { rOut.WriteUInt32( EPP_DateTimeMCAtom << 16 ).WriteUInt32( 8 ) .WriteUInt32( pFieldEntry->nFieldStartPos ) // TxtOffset to TxtField; - .WriteUChar( ( pFieldEntry->nFieldType & 0xff ) ) // Type + .WriteUChar( pFieldEntry->nFieldType & 0xff ) // Type .WriteUChar( 0 ).WriteUInt16( 0 ); // PadBytes } break; diff --git a/sd/source/filter/html/htmlex.cxx b/sd/source/filter/html/htmlex.cxx index e80256f82d87..0c21bb966f11 100644 --- a/sd/source/filter/html/htmlex.cxx +++ b/sd/source/filter/html/htmlex.cxx @@ -2419,8 +2419,8 @@ bool HtmlExport::CreateNavBarFrames() // first page aButton = SdResId(STR_HTMLEXP_FIRSTPAGE); if(mnButtonThema != -1) - aButton = CreateImage(GetButtonName((nFile == 0 || mnSdPageCount == 1? - BTN_FIRST_0:BTN_FIRST_1)), aButton); + aButton = CreateImage(GetButtonName(nFile == 0 || mnSdPageCount == 1 ? BTN_FIRST_0 : BTN_FIRST_1), + aButton); if(nFile != 0 && mnSdPageCount > 1) aButton = CreateLink("JavaScript:parent.NavigateAbs(0)", aButton); @@ -2431,8 +2431,9 @@ bool HtmlExport::CreateNavBarFrames() // to the previous page aButton = SdResId(STR_PUBLISH_BACK); if(mnButtonThema != -1) - aButton = CreateImage(GetButtonName((nFile == 0 || mnSdPageCount == 1? - BTN_PREV_0:BTN_PREV_1)), aButton); + aButton = CreateImage(GetButtonName(nFile == 0 || mnSdPageCount == 1? + BTN_PREV_0:BTN_PREV_1), + aButton); if(nFile != 0 && mnSdPageCount > 1) aButton = CreateLink("JavaScript:parent.NavigateRel(-1)", aButton); @@ -2443,8 +2444,9 @@ bool HtmlExport::CreateNavBarFrames() // to the next page aButton = SdResId(STR_PUBLISH_NEXT); if(mnButtonThema != -1) - aButton = CreateImage(GetButtonName((nFile ==2 || mnSdPageCount == 1? - BTN_NEXT_0:BTN_NEXT_1)), aButton); + aButton = CreateImage(GetButtonName(nFile ==2 || mnSdPageCount == 1? + BTN_NEXT_0:BTN_NEXT_1), + aButton); if(nFile != 2 && mnSdPageCount > 1) aButton = CreateLink("JavaScript:parent.NavigateRel(1)", aButton); @@ -2455,8 +2457,9 @@ bool HtmlExport::CreateNavBarFrames() // to the last page aButton = SdResId(STR_HTMLEXP_LASTPAGE); if(mnButtonThema != -1) - aButton = CreateImage(GetButtonName((nFile ==2 || mnSdPageCount == 1? - BTN_LAST_0:BTN_LAST_1)), aButton); + aButton = CreateImage(GetButtonName(nFile ==2 || mnSdPageCount == 1? + BTN_LAST_0:BTN_LAST_1), + aButton); if(nFile != 2 && mnSdPageCount > 1) { diff --git a/sd/source/ui/animations/CustomAnimationDialog.cxx b/sd/source/ui/animations/CustomAnimationDialog.cxx index 115abbb07053..0e268a95a08a 100644 --- a/sd/source/ui/animations/CustomAnimationDialog.cxx +++ b/sd/source/ui/animations/CustomAnimationDialog.cxx @@ -153,7 +153,7 @@ void PresetPropertyBox::setValue( const Any& rValue, const OUString& rPresetId ) while( aIter != aEnd ) { - sal_Int32 nPos = mpControl->InsertEntry( rPresets.getUINameForProperty( (*aIter) ) ); + sal_Int32 nPos = mpControl->InsertEntry( rPresets.getUINameForProperty( *aIter ) ); if( (*aIter) == aPropertyValue ) mpControl->SelectEntryPos( nPos ); maPropertyValues[nPos] = (*aIter++); diff --git a/sd/source/ui/animations/CustomAnimationPane.cxx b/sd/source/ui/animations/CustomAnimationPane.cxx index 605cdf984ff4..2d362cb0ca80 100644 --- a/sd/source/ui/animations/CustomAnimationPane.cxx +++ b/sd/source/ui/animations/CustomAnimationPane.cxx @@ -723,7 +723,7 @@ void CustomAnimationPane::updateControls() { ++aIter; } - while( (aIter != mpMainSequence->getEnd()) && !(mpCustomAnimationList->isExpanded((*aIter)) ) ); + while( (aIter != mpMainSequence->getEnd()) && !(mpCustomAnimationList->isExpanded(*aIter) ) ); if( aIter == mpMainSequence->getEnd() ) bEnableDown = false; diff --git a/sd/source/ui/annotations/annotationmanager.cxx b/sd/source/ui/annotations/annotationmanager.cxx index 5539f53efcb8..d287a8e74e6c 100644 --- a/sd/source/ui/annotations/annotationmanager.cxx +++ b/sd/source/ui/annotations/annotationmanager.cxx @@ -680,7 +680,7 @@ void AnnotationManagerImpl::DeleteAllAnnotations() AnnotationVector aAnnotations( pPage->getAnnotations() ); for( AnnotationVector::iterator iter = aAnnotations.begin(); iter != aAnnotations.end(); ++iter ) { - pPage->removeAnnotation( (*iter) ); + pPage->removeAnnotation( *iter ); } } } diff --git a/sd/source/ui/unoidl/unoobj.cxx b/sd/source/ui/unoidl/unoobj.cxx index b3401f14b1d2..8250ac4a692d 100644 --- a/sd/source/ui/unoidl/unoobj.cxx +++ b/sd/source/ui/unoidl/unoobj.cxx @@ -439,7 +439,7 @@ void SAL_CALL SdXShape::setPropertyValue( const OUString& aPropertyName, const c SdrObject* pObj = mpShape->GetSdrObject(); if( pObj ) { - SdAnimationInfo* pInfo = GetAnimationInfo((pEntry->nWID <= WID_THAT_NEED_ANIMINFO)); + SdAnimationInfo* pInfo = GetAnimationInfo(pEntry->nWID <= WID_THAT_NEED_ANIMINFO); switch(pEntry->nWID) { diff --git a/slideshow/source/engine/slide/userpaintoverlay.cxx b/slideshow/source/engine/slide/userpaintoverlay.cxx index 4440a80b3a91..48b52dc956b2 100644 --- a/slideshow/source/engine/slide/userpaintoverlay.cxx +++ b/slideshow/source/engine/slide/userpaintoverlay.cxx @@ -137,7 +137,7 @@ namespace slideshow //(*aIter)->getCanvas()->clear(); //get via SlideImpl instance the bitmap of the slide unmodified to redraw it - SlideBitmapSharedPtr pBitmap( mrSlide.getCurrentSlideBitmap( (*aIter) ) ); + SlideBitmapSharedPtr pBitmap( mrSlide.getCurrentSlideBitmap( *aIter ) ); ::cppcanvas::CanvasSharedPtr pCanvas( (*aIter)->getCanvas() ); const ::basegfx::B2DHomMatrix aViewTransform( (*aIter)->getTransformation() ); @@ -339,7 +339,7 @@ namespace slideshow { //get via SlideImpl instance the bitmap of the slide unmodified to redraw it - SlideBitmapSharedPtr pBitmap( mrSlide.getCurrentSlideBitmap( (*aIter) ) ); + SlideBitmapSharedPtr pBitmap( mrSlide.getCurrentSlideBitmap( *aIter ) ); ::cppcanvas::CanvasSharedPtr pCanvas( (*aIter)->getCanvas() ); ::basegfx::B2DHomMatrix aViewTransform( (*aIter)->getTransformation() ); diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index 42cb77684bf1..b2c188ec62e7 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -1118,7 +1118,7 @@ void SmShowSymbolSetWindow::Paint(vcl::RenderContext& rRenderContext, const tool // set MapUnit for which 'nLen' has been calculated rRenderContext.SetMapMode(MapMode(MapUnit::MapPixel)); - sal_uInt16 v = sal::static_int_cast< sal_uInt16 >((m_pVScrollBar->GetThumbPos() * nColumns)); + sal_uInt16 v = sal::static_int_cast< sal_uInt16 >(m_pVScrollBar->GetThumbPos() * nColumns); size_t nSymbols = aSymbolSet.size(); Color aTxtColor(rRenderContext.GetTextColor()); diff --git a/svl/source/numbers/zforfind.cxx b/svl/source/numbers/zforfind.cxx index 760f001f1dbf..d022a2b4cd63 100644 --- a/svl/source/numbers/zforfind.cxx +++ b/svl/source/numbers/zforfind.cxx @@ -1326,7 +1326,7 @@ bool ImpSvNumberInputScan::IsAcceptedDatePattern( sal_uInt16 nStartPatternAt ) bool ImpSvNumberInputScan::SkipDatePatternSeparator( sal_uInt16 nParticle, sal_Int32 & rPos, bool & rSignedYear ) { // If not initialized yet start with first number, if any. - if (!IsAcceptedDatePattern( (nAnzNums ? nNums[0] : 0))) + if (!IsAcceptedDatePattern( nAnzNums ? nNums[0] : 0 )) { return false; } @@ -1384,7 +1384,7 @@ bool ImpSvNumberInputScan::SkipDatePatternSeparator( sal_uInt16 nParticle, sal_I sal_uInt16 ImpSvNumberInputScan::GetDatePatternNumbers() { // If not initialized yet start with first number, if any. - if (!IsAcceptedDatePattern( (nAnzNums ? nNums[0] : 0))) + if (!IsAcceptedDatePattern( nAnzNums ? nNums[0] : 0 )) { return 0; } @@ -1419,7 +1419,7 @@ bool ImpSvNumberInputScan::IsDatePatternNumberOfType( sal_uInt16 nNumber, sal_Un sal_uInt32 ImpSvNumberInputScan::GetDatePatternOrder() { // If not initialized yet start with first number, if any. - if (!IsAcceptedDatePattern( (nAnzNums ? nNums[0] : 0))) + if (!IsAcceptedDatePattern( nAnzNums ? nNums[0] : 0 )) { return 0; } diff --git a/svx/source/gallery2/galbrws2.cxx b/svx/source/gallery2/galbrws2.cxx index 9384734e71ba..a2afa9b0383a 100644 --- a/svx/source/gallery2/galbrws2.cxx +++ b/svx/source/gallery2/galbrws2.cxx @@ -899,7 +899,7 @@ void GalleryBrowser2::ImplUpdateViews( sal_uInt16 nSelectionId ) mpIconView->InsertItem( (sal_uInt16) i ); } - ImplSelectItemId( ( ( nSelectionId > mpCurTheme->GetObjectCount() ) ? mpCurTheme->GetObjectCount() : nSelectionId ) ); + ImplSelectItemId( ( nSelectionId > mpCurTheme->GetObjectCount() ) ? mpCurTheme->GetObjectCount() : nSelectionId ); } switch( GetMode() ) diff --git a/svx/source/svdraw/svdtrans.cxx b/svx/source/svdraw/svdtrans.cxx index 352db733b5f1..55e7d4784e49 100644 --- a/svx/source/svdraw/svdtrans.cxx +++ b/svx/source/svdraw/svdtrans.cxx @@ -388,7 +388,7 @@ long GetAngle(const Point& rPnt) if (rPnt.Y()>0) a=-9000; else a=9000; } else { - a=svx::Round((atan2((double)-rPnt.Y(),(double)rPnt.X())/nPi180)); + a=svx::Round(atan2((double)-rPnt.Y(),(double)rPnt.X())/nPi180); } return a; } diff --git a/svx/source/table/svdotable.cxx b/svx/source/table/svdotable.cxx index 422755b414a6..5adbfde30df4 100644 --- a/svx/source/table/svdotable.cxx +++ b/svx/source/table/svdotable.cxx @@ -522,7 +522,7 @@ void SdrTableObjImpl::DragEdge( bool mbHorizontal, int nEdge, sal_Int32 nOffset } else if(!bRTL && nEdge>0) { - Reference< XPropertySet > xColSet( xCols->getByIndex( (nEdge-1) ), UNO_QUERY_THROW ); + Reference< XPropertySet > xColSet( xCols->getByIndex( nEdge-1 ), UNO_QUERY_THROW ); xColSet->setPropertyValue( sSize, Any( nWidth ) ); } /* To prevent the table resizing on edge dragging */ diff --git a/sw/source/core/doc/DocumentStylePoolManager.cxx b/sw/source/core/doc/DocumentStylePoolManager.cxx index 15b6b0565824..f29114005681 100644 --- a/sw/source/core/doc/DocumentStylePoolManager.cxx +++ b/sw/source/core/doc/DocumentStylePoolManager.cxx @@ -1991,7 +1991,7 @@ SwNumRule* DocumentStylePoolManager::GetNumRuleFromPool( sal_uInt16 nId ) for (sal_uInt16 n = 0; n < MAXLEVEL; ++n) { - aFormat.SetBulletChar( ( (n & 1) ? 0x25a1 : 0x2611 ) ); + aFormat.SetBulletChar( (n & 1) ? 0x25a1 : 0x2611 ); if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION ) { diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx index 76af28b3dc49..11f2b7d56a7f 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.cxx +++ b/sw/source/filter/ww8/rtfattributeoutput.cxx @@ -1275,7 +1275,7 @@ void RtfAttributeOutput::SectionPageBorders(const SwFrameFormat* pFormat, const void RtfAttributeOutput::SectionBiDi(bool bBiDi) { - m_rExport.Strm().WriteCharPtr((bBiDi ? OOO_STRING_SVTOOLS_RTF_RTLSECT : OOO_STRING_SVTOOLS_RTF_LTRSECT)); + m_rExport.Strm().WriteCharPtr(bBiDi ? OOO_STRING_SVTOOLS_RTF_RTLSECT : OOO_STRING_SVTOOLS_RTF_LTRSECT); } void RtfAttributeOutput::SectionPageNumbering(sal_uInt16 nNumType, const ::boost::optional<sal_uInt16>& oPageRestartNumber) diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx index fd24098031ed..a585b8d48233 100644 --- a/sw/source/filter/ww8/ww8par6.cxx +++ b/sw/source/filter/ww8/ww8par6.cxx @@ -1042,11 +1042,11 @@ void wwSectionManager::CreateSep(const long nTextPos) if (eVer >= ww::eWW6) { - aRes = pSep->HasSprm((eVer <= ww::eWW7 ? 132 : 0x3001)); + aRes = pSep->HasSprm(eVer <= ww::eWW7 ? 132 : 0x3001); if (aRes.pSprm && aRes.nRemainingData >= 1) aNewSection.maSep.iHeadingPgn = *aRes.pSprm; - aRes = pSep->HasSprm((eVer <= ww::eWW7 ? 131 : 0x3000)); + aRes = pSep->HasSprm(eVer <= ww::eWW7 ? 131 : 0x3000); if (aRes.pSprm && aRes.nRemainingData >= 1) aNewSection.maSep.cnsPgn = *aRes.pSprm; } @@ -1817,7 +1817,7 @@ WW8SwFlyPara::WW8SwFlyPara( SwPaM& rPaM, { bAutoWidth = true; nWidth = nNetWidth = - msword_cast<sal_Int16>((nPgWidth ? nPgWidth : 2268)); // 4 cm + msword_cast<sal_Int16>(nPgWidth ? nPgWidth : 2268); // 4 cm } if( nWidth <= MINFLY ) nWidth = nNetWidth = MINFLY; // minimum width diff --git a/sw/source/ui/table/tabledlg.cxx b/sw/source/ui/table/tabledlg.cxx index f38c0d7fdf96..b1f9298fd594 100644 --- a/sw/source/ui/table/tabledlg.cxx +++ b/sw/source/ui/table/tabledlg.cxx @@ -770,8 +770,8 @@ SwTableColumnPage::SwTableColumnPage(vcl::Window* pParent, const SfxItemSet& rSe SetExchangeSupport(); const SfxPoolItem* pItem; - Init((SfxItemState::SET == rSet.GetItemState( SID_HTML_MODE, false,&pItem ) - && static_cast<const SfxUInt16Item*>(pItem)->GetValue() & HTMLMODE_ON)); + Init(SfxItemState::SET == rSet.GetItemState( SID_HTML_MODE, false,&pItem ) + && static_cast<const SfxUInt16Item*>(pItem)->GetValue() & HTMLMODE_ON); } SwTableColumnPage::~SwTableColumnPage() diff --git a/sw/source/uibase/shells/grfsh.cxx b/sw/source/uibase/shells/grfsh.cxx index 3b6eeda36108..5a7fa6afcc82 100644 --- a/sw/source/uibase/shells/grfsh.cxx +++ b/sw/source/uibase/shells/grfsh.cxx @@ -287,7 +287,7 @@ void SwGrfShell::Execute(SfxRequest &rReq) sal_uInt16 nHtmlMode = ::GetHtmlMode(GetView().GetDocShell()); aSet.Put(SfxUInt16Item(SID_HTML_MODE, nHtmlMode)); - FieldUnit eMetric = ::GetDfltMetric((0 != (nHtmlMode&HTMLMODE_ON))); + FieldUnit eMetric = ::GetDfltMetric(0 != (nHtmlMode&HTMLMODE_ON)); SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric)) ); const SwRect* pRect = &rSh.GetAnyCurRect(CurRectType::Page); diff --git a/sw/source/uibase/shells/tabsh.cxx b/sw/source/uibase/shells/tabsh.cxx index 1a32de2bf9a8..3347c1af6d44 100644 --- a/sw/source/uibase/shells/tabsh.cxx +++ b/sw/source/uibase/shells/tabsh.cxx @@ -1061,10 +1061,11 @@ void SwTableShell::Execute(SfxRequest &rReq) case FN_TABLE_MODE_FIX_PROP : case FN_TABLE_MODE_VARIABLE : { - rSh.SetTableChgMode( ( FN_TABLE_MODE_FIX == nSlot ? TableChgMode::FixedWidthChangeAbs + rSh.SetTableChgMode( FN_TABLE_MODE_FIX == nSlot + ? TableChgMode::FixedWidthChangeAbs : FN_TABLE_MODE_FIX_PROP == nSlot ? TableChgMode::FixedWidthChangeProp - : TableChgMode::VarWidthChangeAbs ) ); + : TableChgMode::VarWidthChangeAbs ); SfxBindings& rBind = GetView().GetViewFrame()->GetBindings(); static sal_uInt16 aInva[] = diff --git a/sw/source/uibase/uiview/viewtab.cxx b/sw/source/uibase/uiview/viewtab.cxx index 3ac39c0f091c..138069464a09 100644 --- a/sw/source/uibase/uiview/viewtab.cxx +++ b/sw/source/uibase/uiview/viewtab.cxx @@ -1365,8 +1365,8 @@ void SwView::StateTabWin(SfxItemSet& rSet) else if( nFrameType & FrameTypeFlags::DRAWOBJ) { const SwRect &rRect = rSh.GetObjRect(); - aLongUL.SetUpper((rRect.Top() - rPageRect.Top())); - aLongUL.SetLower((rPageRect.Bottom() - rRect.Bottom())); + aLongUL.SetUpper(rRect.Top() - rPageRect.Top()); + aLongUL.SetLower(rPageRect.Bottom() - rRect.Bottom()); } else if(bBrowse) { diff --git a/ucb/source/core/ucbstore.cxx b/ucb/source/core/ucbstore.cxx index d9e4154e7ed0..05a7a0afc09a 100644 --- a/ucb/source/core/ucbstore.cxx +++ b/ucb/source/core/ucbstore.cxx @@ -2000,7 +2000,7 @@ void SAL_CALL PersistentPropertySet::setPropertyValues( while ( it != end ) { - notifyPropertyChangeEvent( (*it) ); + notifyPropertyChangeEvent( *it ); ++it; } } diff --git a/ucb/source/ucp/webdav-neon/ContentProperties.cxx b/ucb/source/ucp/webdav-neon/ContentProperties.cxx index cafb01c3aa13..4557a565674c 100644 --- a/ucb/source/ucp/webdav-neon/ContentProperties.cxx +++ b/ucb/source/ucp/webdav-neon/ContentProperties.cxx @@ -119,7 +119,7 @@ ContentProperties::ContentProperties( const DAVResource& rResource ) while ( it != end ) { - addProperty( (*it) ); + addProperty( *it ); ++it; } @@ -588,7 +588,7 @@ void CachableContentProperties::addProperties( while ( it != end ) { if ( isCachable( (*it).Name, (*it).IsCaseSensitive ) ) - m_aProps.addProperty( (*it) ); + m_aProps.addProperty( *it ); ++it; } diff --git a/vcl/source/bitmap/BitmapProcessor.cxx b/vcl/source/bitmap/BitmapProcessor.cxx index 371d71523de8..d9ab9359c08f 100644 --- a/vcl/source/bitmap/BitmapProcessor.cxx +++ b/vcl/source/bitmap/BitmapProcessor.cxx @@ -42,9 +42,9 @@ BitmapEx BitmapProcessor::createLightImage(const BitmapEx& rBitmapEx) aBColor.setRed(fHue); aBColor = basegfx::tools::hsl2rgb(aBColor); - aColor.SetRed(((aBColor.getRed() * 255.0) + 0.5)); - aColor.SetGreen(((aBColor.getGreen() * 255.0) + 0.5)); - aColor.SetBlue(((aBColor.getBlue() * 255.0) + 0.5)); + aColor.SetRed((aBColor.getRed() * 255.0) + 0.5); + aColor.SetGreen((aBColor.getGreen() * 255.0) + 0.5); + aColor.SetBlue((aBColor.getBlue() * 255.0) + 0.5); pWrite->SetPixel(nY, nX, aColor); } diff --git a/vcl/source/filter/wmf/wmfwr.cxx b/vcl/source/filter/wmf/wmfwr.cxx index 23c0bb3a429d..e89199dced08 100644 --- a/vcl/source/filter/wmf/wmfwr.cxx +++ b/vcl/source/filter/wmf/wmfwr.cxx @@ -659,7 +659,7 @@ void WMFWriter::WMFRecord_PolyPolygon(const tools::PolyPolygon & rPolyPoly) } WriteRecordHeader(0,W_META_POLYPOLYGON); pWMF->WriteUInt16( nCount ); - for (i=0; i<nCount; i++) pWMF->WriteUInt16( (aSimplePolyPoly.GetObject(i).GetSize()) ); + for (i=0; i<nCount; i++) pWMF->WriteUInt16( aSimplePolyPoly.GetObject(i).GetSize() ); for (i=0; i<nCount; i++) { pPoly=&(aSimplePolyPoly.GetObject(i)); nSize=pPoly->GetSize(); diff --git a/vcl/source/gdi/print2.cxx b/vcl/source/gdi/print2.cxx index 576c564652ec..b358fa0d4307 100644 --- a/vcl/source/gdi/print2.cxx +++ b/vcl/source/gdi/print2.cxx @@ -1100,7 +1100,8 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf, { // simply add this action (above, we inserted the actions // starting at index 0 up to and including nLastBgAction) - rOutMtf.AddAction( ( aCurrAct->first->Duplicate(), aCurrAct->first ) ); + aCurrAct->first->Duplicate(); + rOutMtf.AddAction( aCurrAct->first ); } // STAGE 3.2: Generate banded bitmaps for special regions @@ -1312,7 +1313,8 @@ bool OutputDevice::RemoveTransparenciesFromMetaFile( const GDIMetaFile& rInMtf, else { // simply add this action - rOutMtf.AddAction( ( pCurrAct->Duplicate(), pCurrAct ) ); + pCurrAct->Duplicate(); + rOutMtf.AddAction( pCurrAct ); } pCurrAct->Execute(aMapModeVDev.get()); diff --git a/vcl/unx/generic/gdi/salgdi.cxx b/vcl/unx/generic/gdi/salgdi.cxx index 39a58c326057..f061649b975d 100644 --- a/vcl/unx/generic/gdi/salgdi.cxx +++ b/vcl/unx/generic/gdi/salgdi.cxx @@ -92,11 +92,11 @@ X11SalGraphics::X11SalGraphics(): if (m_bOpenGL) { mxImpl.reset(new X11OpenGLSalGraphicsImpl(*this)); - mxTextRenderImpl.reset((new OpenGLX11CairoTextRender(*this))); + mxTextRenderImpl.reset(new OpenGLX11CairoTextRender(*this)); } else { - mxTextRenderImpl.reset((new X11CairoTextRender(*this))); + mxTextRenderImpl.reset(new X11CairoTextRender(*this)); mxImpl.reset(new X11SalGraphicsImpl(*this)); } diff --git a/vcl/unx/generic/print/genpspgraphics.cxx b/vcl/unx/generic/print/genpspgraphics.cxx index 63394e74ec2c..9d9de0f446e0 100644 --- a/vcl/unx/generic/print/genpspgraphics.cxx +++ b/vcl/unx/generic/print/genpspgraphics.cxx @@ -847,7 +847,7 @@ FontAttributes GenPspGraphics::Info2FontAttributes( const psp::FastPrintFontInfo aDFA.SetItalic( rInfo.m_eItalic ); aDFA.SetWidthType( rInfo.m_eWidth ); aDFA.SetPitch( rInfo.m_ePitch ); - aDFA.SetSymbolFlag( (rInfo.m_aEncoding == RTL_TEXTENCODING_SYMBOL) ); + aDFA.SetSymbolFlag( rInfo.m_aEncoding == RTL_TEXTENCODING_SYMBOL ); aDFA.SetQuality(512); // add font family name aliases diff --git a/xmloff/source/draw/sdxmlexp.cxx b/xmloff/source/draw/sdxmlexp.cxx index 66b8bf41eab7..4397126201cb 100644 --- a/xmloff/source/draw/sdxmlexp.cxx +++ b/xmloff/source/draw/sdxmlexp.cxx @@ -1518,7 +1518,7 @@ void SdXMLExport::ImpWriteHeaderFooterDecls() AddAttribute(XML_NAMESPACE_PRESENTATION, XML_NAME, sBuffer.makeStringAndClear()); SvXMLElementExport aElem(*this, XML_NAMESPACE_PRESENTATION, XML_HEADER_DECL, true, true); - Characters((*aIter)); + Characters(*aIter); } } @@ -1535,7 +1535,7 @@ void SdXMLExport::ImpWriteHeaderFooterDecls() AddAttribute(XML_NAMESPACE_PRESENTATION, XML_NAME, sBuffer.makeStringAndClear()); SvXMLElementExport aElem(*this, XML_NAMESPACE_PRESENTATION, XML_FOOTER_DECL, false, false); - Characters((*aIter)); + Characters(*aIter); } } diff --git a/xmloff/source/style/impastpl.cxx b/xmloff/source/style/impastpl.cxx index 56e1c6cc7f33..cebd614357d9 100644 --- a/xmloff/source/style/impastpl.cxx +++ b/xmloff/source/style/impastpl.cxx @@ -128,10 +128,10 @@ data2string(void *data, result.append(OUString::number((*static_cast<const sal_uInt64*>(data)), 16)); break; case typelib_TypeClass_FLOAT: - result.append(OUString::number((*static_cast<const float*>(data)))); + result.append(OUString::number(*static_cast<const float*>(data))); break; case typelib_TypeClass_DOUBLE: - result.append(OUString::number((*static_cast<const double*>(data)))); + result.append(OUString::number(*static_cast<const double*>(data))); break; case typelib_TypeClass_CHAR: result.append("U+"); |