diff options
62 files changed, 133 insertions, 123 deletions
diff --git a/canvas/source/tools/page.hxx b/canvas/source/tools/page.hxx index d063c7a0f716..800a294a9433 100644 --- a/canvas/source/tools/page.hxx +++ b/canvas/source/tools/page.hxx @@ -108,7 +108,7 @@ namespace canvas // request was made to select this fragment, // but this fragment has not been located on any // of the available pages, we need to hurry now. - if(!(mpPage)) + if(!mpPage) return false; std::shared_ptr<ISurface> pSurface(mpPage->getSurface()); @@ -125,7 +125,7 @@ namespace canvas bool refresh() { - if(!(mpPage)) + if(!mpPage) return false; std::shared_ptr<ISurface> pSurface(mpPage->getSurface()); diff --git a/compilerplugins/clang/test/unnecessaryparen.cxx b/compilerplugins/clang/test/unnecessaryparen.cxx index e89da95df384..fb36052778b5 100644 --- a/compilerplugins/clang/test/unnecessaryparen.cxx +++ b/compilerplugins/clang/test/unnecessaryparen.cxx @@ -7,6 +7,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ +#include <memory> #include <string> #include <rtl/ustring.hxx> #include <o3tl/typed_flags_set.hxx> @@ -114,4 +115,14 @@ int main() (void)nBits; }; +class Foo2 +{ + int* p; + + int foo2() + { + return (p) ? 1 : 0; // expected-error {{unnecessary parentheses around member expr [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 287c080afb13..119ee98e13a5 100644 --- a/compilerplugins/clang/unnecessaryparen.cxx +++ b/compilerplugins/clang/unnecessaryparen.cxx @@ -219,6 +219,14 @@ bool UnnecessaryParen::VisitParenExpr(const ParenExpr* parenExpr) << parenExpr->getSourceRange(); } handled_.insert(parenExpr); + } else if (auto memberExpr = dyn_cast<MemberExpr>(subExpr)) { + if (isa<CXXThisExpr>(ignoreAllImplicit(memberExpr->getBase()))) { + report( + DiagnosticsEngine::Warning, "unnecessary parentheses around member expr", + compat::getBeginLoc(parenExpr)) + << parenExpr->getSourceRange(); + handled_.insert(parenExpr); + } } return true; diff --git a/connectivity/source/drivers/firebird/Connection.cxx b/connectivity/source/drivers/firebird/Connection.cxx index 877f83830b9b..b12eafb35cdf 100644 --- a/connectivity/source/drivers/firebird/Connection.cxx +++ b/connectivity/source/drivers/firebird/Connection.cxx @@ -919,7 +919,7 @@ void Connection::disposing() if (m_pDatabaseFileDir) { - ::utl::removeTree((m_pDatabaseFileDir)->GetURL()); + ::utl::removeTree(m_pDatabaseFileDir->GetURL()); m_pDatabaseFileDir.reset(); } } diff --git a/dbaccess/source/ui/querydesign/querycontroller.cxx b/dbaccess/source/ui/querydesign/querycontroller.cxx index 48e02ec47111..9ed4334768e8 100644 --- a/dbaccess/source/ui/querydesign/querycontroller.cxx +++ b/dbaccess/source/ui/querydesign/querycontroller.cxx @@ -870,7 +870,7 @@ void OQueryController::impl_initialize() ClearUndoManager(); - if ( ( m_bGraphicalDesign ) + if ( m_bGraphicalDesign && ( ( m_sName.isEmpty() && !editingCommand() ) || ( m_sStatement.isEmpty() && editingCommand() ) ) diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx index 61ccea0dda9e..815dc8f52b09 100644 --- a/editeng/source/editeng/impedit3.cxx +++ b/editeng/source/editeng/impedit3.cxx @@ -2746,7 +2746,7 @@ void ImpEditEngine::SeekCursor( ContentNode* pNode, sal_Int32 nPos, SvxFont& rFo { if ( nStretchY != 100 ) { - aRealSz.setHeight( aRealSz.Height() * ( nStretchY) ); + aRealSz.setHeight( aRealSz.Height() * nStretchY ); aRealSz.setHeight( aRealSz.Height() / 100 ); } if ( nStretchX != 100 ) @@ -2758,7 +2758,7 @@ void ImpEditEngine::SeekCursor( ContentNode* pNode, sal_Int32 nPos, SvxFont& rFo } else { - aRealSz.setWidth( aRealSz.Width() * ( nStretchX) ); + aRealSz.setWidth( aRealSz.Width() * nStretchX ); aRealSz.setWidth( aRealSz.Width() / 100 ); // Also the Kerning: (long due to handle Interim results) diff --git a/extensions/source/update/ui/updatecheckui.cxx b/extensions/source/update/ui/updatecheckui.cxx index a3e1a492ef3f..af32a628b454 100644 --- a/extensions/source/update/ui/updatecheckui.cxx +++ b/extensions/source/update/ui/updatecheckui.cxx @@ -842,7 +842,7 @@ void BubbleWindow::Show( bool bVisible, ShowFlags nFlags ) if ( aScreenPos.X() < 0 ) { mnTipOffset = aScreenPos.X(); - aPos.AdjustX( -(mnTipOffset) ); + aPos.AdjustX( -mnTipOffset ); } SetPosSizePixel( aPos, aWindowSize ); diff --git a/filter/source/graphicfilter/icgm/bitmap.cxx b/filter/source/graphicfilter/icgm/bitmap.cxx index 375612b19e9b..12e3f25416dc 100644 --- a/filter/source/graphicfilter/icgm/bitmap.cxx +++ b/filter/source/graphicfilter/icgm/bitmap.cxx @@ -355,7 +355,7 @@ std::unique_ptr<CGMBitmap> CGMBitmap::GetNext() ( ( xCGMTempBitmap->pCGMBitmapDescriptor->mnQ.X == pCGMBitmapDescriptor->mnR.X ) && ( xCGMTempBitmap->pCGMBitmapDescriptor->mnQ.Y == pCGMBitmapDescriptor->mnR.Y ) ) ) ) { - ImplInsert( *(xCGMTempBitmap->pCGMBitmapDescriptor), *(pCGMBitmapDescriptor) ); + ImplInsert( *(xCGMTempBitmap->pCGMBitmapDescriptor), *pCGMBitmapDescriptor ); xCGMTempBitmap.reset(); return xCGMTempBitmap; } diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx index 4f8210d405b1..778a9228d4d7 100644 --- a/framework/source/services/autorecovery.cxx +++ b/framework/source/services/autorecovery.cxx @@ -2158,19 +2158,13 @@ void AutoRecovery::implts_stopListening() xGlobalEventBroadcaster.set(m_xNewDocBroadcaster, css::uno::UNO_QUERY); } /* SAFE */ - if ( - (xGlobalEventBroadcaster.is()) && - (m_bListenForDocEvents ) - ) + if (xGlobalEventBroadcaster.is() && m_bListenForDocEvents) { xGlobalEventBroadcaster->removeDocumentEventListener(m_xNewDocBroadcasterListener); m_bListenForDocEvents = false; } - if ( - (xCFG.is() ) && - (m_bListenForConfigChanges) - ) + if (xCFG.is() && m_bListenForConfigChanges) { xCFG->removeChangesListener(m_xRecoveryCFGListener); m_bListenForConfigChanges = false; diff --git a/framework/source/xml/acceleratorconfigurationreader.cxx b/framework/source/xml/acceleratorconfigurationreader.cxx index ea945756c6db..6c50e40cf284 100644 --- a/framework/source/xml/acceleratorconfigurationreader.cxx +++ b/framework/source/xml/acceleratorconfigurationreader.cxx @@ -75,10 +75,7 @@ void SAL_CALL AcceleratorConfigurationReader::endDocument() // The xml file seems to be corrupted. // Because we found no end-tags ... at least for // one list or item. - if ( - (m_bInsideAcceleratorList) || - (m_bInsideAcceleratorItem) - ) + if (m_bInsideAcceleratorList || m_bInsideAcceleratorItem) { THROW_PARSEEXCEPTION("No matching start or end element 'acceleratorlist' found!") } diff --git a/hwpfilter/source/hiodev.cxx b/hwpfilter/source/hiodev.cxx index 6416bb080cbe..f7cd75ead04a 100644 --- a/hwpfilter/source/hiodev.cxx +++ b/hwpfilter/source/hiodev.cxx @@ -151,7 +151,7 @@ bool HStreamIODev::setCompressed(bool flag) bool HStreamIODev::read1b(unsigned char &out) { - size_t res = (compressed) ? GZREAD(rBuf, 1) : _stream->readBytes(rBuf, 1); + size_t res = compressed ? GZREAD(rBuf, 1) : _stream->readBytes(rBuf, 1); if (res < 1) return false; @@ -171,7 +171,7 @@ bool HStreamIODev::read1b(char &out) bool HStreamIODev::read2b(unsigned short &out) { - size_t res = (compressed) ? GZREAD(rBuf, 2) : _stream->readBytes(rBuf, 2); + size_t res = compressed ? GZREAD(rBuf, 2) : _stream->readBytes(rBuf, 2); if (res < 2) return false; @@ -182,7 +182,7 @@ bool HStreamIODev::read2b(unsigned short &out) bool HStreamIODev::read4b(unsigned int &out) { - size_t res = (compressed) ? GZREAD(rBuf, 4) : _stream->readBytes(rBuf, 4); + size_t res = compressed ? GZREAD(rBuf, 4) : _stream->readBytes(rBuf, 4); if (res < 4) return false; @@ -204,9 +204,9 @@ bool HStreamIODev::read4b(int &out) size_t HStreamIODev::readBlock(void *ptr, size_t size) { size_t count = - (compressed) ? GZREAD(ptr, size) : _stream->readBytes(static_cast<byte *>(ptr), - - size); + compressed + ? GZREAD(ptr, size) + : _stream->readBytes(static_cast<byte *>(ptr), size); return count; } diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx index 283daad8d253..b78f70d7681c 100644 --- a/reportdesign/source/ui/report/ReportController.cxx +++ b/reportdesign/source/ui/report/ReportController.cxx @@ -3762,13 +3762,13 @@ void OReportController::switchReportSection(const sal_Int16 _nId) const OUString sUndoAction(RptResId(bSwitchOn ? RID_STR_UNDO_ADD_REPORTHEADERFOOTER : RID_STR_UNDO_REMOVE_REPORTHEADERFOOTER)); pUndoContext.reset( new UndoContext( getUndoManager(), sUndoAction ) ); - addUndoAction(std::make_unique<OReportSectionUndo>(*(m_aReportModel),SID_REPORTHEADER_WITHOUT_UNDO + addUndoAction(std::make_unique<OReportSectionUndo>(*m_aReportModel,SID_REPORTHEADER_WITHOUT_UNDO ,::std::mem_fn(&OReportHelper::getReportHeader) ,m_xReportDefinition ,bSwitchOn ? Inserted : Removed )); - addUndoAction(std::make_unique<OReportSectionUndo>(*(m_aReportModel),SID_REPORTFOOTER_WITHOUT_UNDO + addUndoAction(std::make_unique<OReportSectionUndo>(*m_aReportModel,SID_REPORTFOOTER_WITHOUT_UNDO ,::std::mem_fn(&OReportHelper::getReportFooter) ,m_xReportDefinition ,bSwitchOn ? Inserted : Removed diff --git a/sal/osl/unx/file.cxx b/sal/osl/unx/file.cxx index 305a57a27034..1f04802aa9e6 100644 --- a/sal/osl/unx/file.cxx +++ b/sal/osl/unx/file.cxx @@ -389,7 +389,7 @@ oslFileError FileHandle_Impl::readFileAt( return osl_File_E_None; } - if (m_kind == KIND_MEM || !(m_buffer)) + if (m_kind == KIND_MEM || !m_buffer) { // not buffered return readAt(nOffset, pBuffer, nBytesRequested, pBytesRead); diff --git a/sal/qa/osl/module/osl_Module.cxx b/sal/qa/osl/module/osl_Module.cxx index 65be1ffacab1..52112cb9f151 100644 --- a/sal/qa/osl/module/osl_Module.cxx +++ b/sal/qa/osl/module/osl_Module.cxx @@ -83,7 +83,7 @@ namespace osl_Module &osl_Module::testClass::myFunc), aFileURL); - if ( !( bRes ) ) + if ( !bRes ) { CPPUNIT_ASSERT_MESSAGE("Cannot locate current module.", false ); } @@ -117,7 +117,7 @@ namespace osl_Module reinterpret_cast<oslGenericFunction>( &osl_Module::testClass::myFunc), aFileURL); - if ( !( bRes ) ) + if ( !bRes ) { CPPUNIT_ASSERT_MESSAGE("Cannot locate current module.", false ); } @@ -138,7 +138,7 @@ namespace osl_Module OUString aFileURL; bRes = osl::Module::getUrlFromAddress( reinterpret_cast<oslGenericFunction>(pFunc), aFileURL); - if ( !( bRes ) ) + if ( !bRes ) { CPPUNIT_ASSERT_MESSAGE("Cannot locate current module.", false ); } @@ -228,7 +228,7 @@ namespace osl_Module reinterpret_cast<oslGenericFunction>( osl_Module::testClass::myFunc), aFileURL); - if ( !( bRes ) ) + if ( !bRes ) { CPPUNIT_ASSERT_MESSAGE("Cannot locate current module - using executable instead", false ); } diff --git a/sc/source/core/opencl/formulagroupcl.cxx b/sc/source/core/opencl/formulagroupcl.cxx index 51e0ea4ec813..d9d7da3d501c 100644 --- a/sc/source/core/opencl/formulagroupcl.cxx +++ b/sc/source/core/opencl/formulagroupcl.cxx @@ -1712,7 +1712,7 @@ public: } // set kernel arg SAL_INFO("sc.opencl", "Kernel " << k << " arg " << argno << ": cl_mem: " << mpClmem2); - err = clSetKernelArg(k, argno, sizeof(cl_mem), &(mpClmem2)); + err = clSetKernelArg(k, argno, sizeof(cl_mem), &mpClmem2); if (CL_SUCCESS != err) throw OpenCLError("clSetKernelArg", err, __FILE__, __LINE__); return 1; diff --git a/sc/source/ui/dbgui/tpsubt.cxx b/sc/source/ui/dbgui/tpsubt.cxx index f4bbec1a7351..94f6f95cbb83 100644 --- a/sc/source/ui/dbgui/tpsubt.cxx +++ b/sc/source/ui/dbgui/tpsubt.cxx @@ -100,7 +100,7 @@ void ScTpSubTotalGroup::Init() GetItemSet().Get( nWhichSubTotals )); pViewData = rSubTotalItem.GetViewData(); - pDoc = ( pViewData ) ? pViewData->GetDocument() : nullptr; + pDoc = pViewData ? pViewData->GetDocument() : nullptr; OSL_ENSURE( pViewData && pDoc, "ViewData or Document not found :-(" ); @@ -473,7 +473,7 @@ void ScTpSubTotalOptions::Init() GetItemSet().Get( nWhichSubTotals )); pViewData = rSubTotalItem.GetViewData(); - pDoc = ( pViewData ) ? pViewData->GetDocument() : nullptr; + pDoc = pViewData ? pViewData->GetDocument() : nullptr; OSL_ENSURE( pViewData && pDoc, "ViewData or Document not found!" ); diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx index fba198b5ba55..f1500352d4fd 100644 --- a/sc/source/ui/vba/vbarange.cxx +++ b/sc/source/ui/vba/vbarange.cxx @@ -678,7 +678,7 @@ public: { if ( !hasMoreElements() ) throw container::NoSuchElementException(); - CellPos aPos = *(m_it)++; + CellPos aPos = *m_it++; uno::Reference< table::XCellRange > xRangeArea = getArea( aPos.m_nArea ); uno::Reference< table::XCellRange > xCellRange( xRangeArea->getCellByPosition( aPos.m_nCol, aPos.m_nRow ), uno::UNO_QUERY_THROW ); diff --git a/sc/source/ui/view/output3.cxx b/sc/source/ui/view/output3.cxx index 270d974e3a0b..17f315ca14f9 100644 --- a/sc/source/ui/view/output3.cxx +++ b/sc/source/ui/view/output3.cxx @@ -77,7 +77,7 @@ Point ScOutputData::PrePrintDrawingLayer(long nLogStX, long nLogStY ) if(pViewShell || pDrawView) { - SdrView* pLocalDrawView = (pDrawView) ? pDrawView : pViewShell->GetSdrView(); + SdrView* pLocalDrawView = pDrawView ? pDrawView : pViewShell->GetSdrView(); if(pLocalDrawView) { @@ -115,7 +115,7 @@ void ScOutputData::PostPrintDrawingLayer(const Point& rMMOffset) // #i74768# if(pViewShell || pDrawView) { - SdrView* pLocalDrawView = (pDrawView) ? pDrawView : pViewShell->GetSdrView(); + SdrView* pLocalDrawView = pDrawView ? pDrawView : pViewShell->GetSdrView(); if(pLocalDrawView) { @@ -139,7 +139,7 @@ void ScOutputData::PrintDrawingLayer(SdrLayerID nLayer, const Point& rMMOffset) if(pViewShell || pDrawView) { - SdrView* pLocalDrawView = (pDrawView) ? pDrawView : pViewShell->GetSdrView(); + SdrView* pLocalDrawView = pDrawView ? pDrawView : pViewShell->GetSdrView(); if(pLocalDrawView) { @@ -197,7 +197,7 @@ void ScOutputData::DrawSelectiveObjects(SdrLayerID nLayer) if(pViewShell || pDrawView) { - SdrView* pLocalDrawView = (pDrawView) ? pDrawView : pViewShell->GetSdrView(); + SdrView* pLocalDrawView = pDrawView ? pDrawView : pViewShell->GetSdrView(); if(pLocalDrawView) { diff --git a/sd/source/filter/html/htmlex.cxx b/sd/source/filter/html/htmlex.cxx index 55b2c1820979..d5ac11f330b6 100644 --- a/sd/source/filter/html/htmlex.cxx +++ b/sd/source/filter/html/htmlex.cxx @@ -721,7 +721,7 @@ void HtmlExport::ExportHtml() nProgrCount += mbImpress?mnSdPageCount:0; nProgrCount += mbContentsPage?1:0; nProgrCount += (mbFrames && mbNotes)?mnSdPageCount:0; - nProgrCount += (mbFrames)?8:0; + nProgrCount += mbFrames ? 8 : 0; InitProgress( nProgrCount ); mpDocSh->SetWaitCursor( true ); diff --git a/sfx2/source/control/thumbnailview.cxx b/sfx2/source/control/thumbnailview.cxx index cea98594642b..04c47f81ffc0 100644 --- a/sfx2/source/control/thumbnailview.cxx +++ b/sfx2/source/control/thumbnailview.cxx @@ -278,7 +278,7 @@ void ThumbnailView::CalculateItemPositions (bool bScrollBarUsed) nScrBarWidth = mpScrBar->GetSizePixel().Width(); // calculate maximum number of visible columns - mnCols = static_cast<sal_uInt16>((aWinSize.Width()-nScrBarWidth) / (mnItemWidth)); + mnCols = static_cast<sal_uInt16>((aWinSize.Width()-nScrBarWidth) / mnItemWidth); if (!mnCols) mnCols = 1; diff --git a/sfx2/source/dialog/titledockwin.cxx b/sfx2/source/dialog/titledockwin.cxx index c82d1ec84033..e78527652bb4 100644 --- a/sfx2/source/dialog/titledockwin.cxx +++ b/sfx2/source/dialog/titledockwin.cxx @@ -122,7 +122,7 @@ namespace sfx2 // Place the content window. if ( m_nTitleBarHeight < aToolBoxSize.Height() ) m_nTitleBarHeight = aToolBoxSize.Height(); - aWindowSize.AdjustHeight( -(m_nTitleBarHeight) ); + aWindowSize.AdjustHeight( -m_nTitleBarHeight ); m_aContentWindow->SetPosSizePixel( Point( m_aBorder.Left(), m_nTitleBarHeight + m_aBorder.Top() ), Size( diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index f1ac1d6eec33..dea622fdad57 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -1009,8 +1009,8 @@ bool SmShowSymbolSet::MouseButtonDown(const MouseEvent& rMEvt) aOutputSize.AdjustWidth(nXOffset ); aOutputSize.AdjustHeight(nYOffset ); Point aPoint(rMEvt.GetPosPixel()); - aPoint.AdjustX( -(nXOffset) ); - aPoint.AdjustY( -(nYOffset) ); + aPoint.AdjustX( -nXOffset ); + aPoint.AdjustY( -nYOffset ); if (rMEvt.IsLeft() && tools::Rectangle(Point(0, 0), aOutputSize).IsInside(rMEvt.GetPosPixel())) { diff --git a/starmath/source/mathtype.cxx b/starmath/source/mathtype.cxx index 201034320fef..afedfc192e9b 100644 --- a/starmath/source/mathtype.cxx +++ b/starmath/source/mathtype.cxx @@ -3051,7 +3051,7 @@ void MathType::HandleMath(SmNode *pNode) { pS->WriteUChar( CHAR|0x20 ); } - else if ((nPendingAttributes) && + else if (nPendingAttributes && (i == ((pTemp->GetText().getLength()+1)/2)-1)) { pS->WriteUChar( 0x22 ); @@ -3269,7 +3269,7 @@ void MathType::HandleText(SmNode *pNode) SmTextNode *pTemp = static_cast<SmTextNode *>(pNode); for(sal_Int32 i=0;i<pTemp->GetText().getLength();i++) { - if ((nPendingAttributes) && + if (nPendingAttributes && (i == ((pTemp->GetText().getLength()+1)/2)-1)) { pS->WriteUChar( 0x22 ); //char, with attributes right @@ -3299,7 +3299,7 @@ void MathType::HandleText(SmNode *pNode) //possible for starmath to place character attributes on //entities which cannot occur in mathtype e.g. a Summation //symbol so these attributes may be lost - if ((nPendingAttributes) && + if (nPendingAttributes && (i == ((pTemp->GetText().getLength()+1)/2)-1)) { pS->WriteUChar( EMBEL ); diff --git a/svl/source/items/itemset.cxx b/svl/source/items/itemset.cxx index ba5df7559def..254e8291b231 100644 --- a/svl/source/items/itemset.cxx +++ b/svl/source/items/itemset.cxx @@ -1662,7 +1662,7 @@ const SfxPoolItem* SfxAllItemSet::Put( const SfxPoolItem& rItem, sal_uInt16 nWhi if ( !pOld ) { bIncrementCount = true; - pOld = (m_pParent) + pOld = m_pParent ? &m_pParent->Get( nWhich ) : (SfxItemPool::IsWhich(nWhich) ? &m_pPool->GetDefaultItem(nWhich) diff --git a/svtools/source/contnr/imivctl1.cxx b/svtools/source/contnr/imivctl1.cxx index c8d689c1a729..b67555b706e6 100644 --- a/svtools/source/contnr/imivctl1.cxx +++ b/svtools/source/contnr/imivctl1.cxx @@ -1110,14 +1110,14 @@ void SvxIconChoiceCtrl_Impl::PositionScrollBars( long nRealWidth, long nRealHeig { // horizontal scrollbar Point aPos( 0, nRealHeight ); - aPos.AdjustY( -(nHorSBarHeight) ); + aPos.AdjustY( -nHorSBarHeight ); if( aHorSBar->GetPosPixel() != aPos ) aHorSBar->SetPosPixel( aPos ); // vertical scrollbar aPos.setX( nRealWidth ); aPos.setY( 0 ); - aPos.AdjustX( -(nVerSBarWidth) ); + aPos.AdjustX( -nVerSBarWidth ); aPos.AdjustX( 1 ); aPos.AdjustY( -1 ); diff --git a/svx/source/dialog/pagectrl.cxx b/svx/source/dialog/pagectrl.cxx index 324a7373daa7..0d12247b98ec 100644 --- a/svx/source/dialog/pagectrl.cxx +++ b/svx/source/dialog/pagectrl.cxx @@ -195,7 +195,7 @@ void SvxPageWindow::DrawPage(vcl::RenderContext& rRenderContext, const Point& rO { // show headers if possible aHdRect.AdjustLeft(nHdLeft ); - aHdRect.AdjustRight( -(nHdRight) ); + aHdRect.AdjustRight( -nHdRight ); aHdRect.SetBottom( aRect.Top() + nHdHeight ); aRect.AdjustTop(nHdHeight + nHdDist ); @@ -207,7 +207,7 @@ void SvxPageWindow::DrawPage(vcl::RenderContext& rRenderContext, const Point& rO { // show footer if possible aFtRect.AdjustLeft(nFtLeft ); - aFtRect.AdjustRight( -(nFtRight) ); + aFtRect.AdjustRight( -nFtRight ); aFtRect.SetTop( aRect.Bottom() - nFtHeight ); aRect.AdjustBottom( -(nFtHeight + nFtDist) ); diff --git a/svx/source/svdraw/svdhdl.cxx b/svx/source/svdraw/svdhdl.cxx index 6c87087c2b44..2bbb535fe3f6 100644 --- a/svx/source/svdraw/svdhdl.cxx +++ b/svx/source/svdraw/svdhdl.cxx @@ -427,7 +427,7 @@ void SdrHdl::CreateB2dIAObject() { case SdrHdlKind::Move: { - eKindOfMarker = (b1PixMore) ? BitmapMarkerKind::Rect_9x9 : BitmapMarkerKind::Rect_7x7; + eKindOfMarker = b1PixMore ? BitmapMarkerKind::Rect_9x9 : BitmapMarkerKind::Rect_7x7; break; } case SdrHdlKind::UpperLeft: diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx index 554b3ce7f7fe..078e6ec644c0 100644 --- a/svx/source/svdraw/svdmrkv.cxx +++ b/svx/source/svdraw/svdmrkv.cxx @@ -2071,8 +2071,8 @@ bool SdrMarkView::PickMarkedObj(const Point& rPnt, SdrObject*& rpObj, SdrPageVie SdrPageView* pPV=pM->GetPageView(); SdrObject* pObj=pM->GetMarkedSdrObj(); tools::Rectangle aRect(pObj->GetCurrentBoundRect()); - aRect.AdjustLeft( -(mnHitTolLog) ); - aRect.AdjustTop( -(mnHitTolLog) ); + aRect.AdjustLeft( -mnHitTolLog ); + aRect.AdjustTop( -mnHitTolLog ); aRect.AdjustRight(mnHitTolLog ); aRect.AdjustBottom(mnHitTolLog ); if (aRect.IsInside(rPnt)) { diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx index 8d36a0e9e6f7..af7a56200564 100644 --- a/sw/source/core/crsr/crsrsh.cxx +++ b/sw/source/core/crsr/crsrsh.cxx @@ -2130,7 +2130,7 @@ void SwCursorShell::Push() // fdo#60513: if we have a table cursor, copy that; else copy current. // This seems to work because UpdateCursor() will fix this up on Pop(), // then MakeBoxSels() will re-create the current m_pCurrentCursor cell ring. - SwShellCursor *const pCurrent((m_pTableCursor) ? m_pTableCursor : m_pCurrentCursor); + SwShellCursor *const pCurrent(m_pTableCursor ? m_pTableCursor : m_pCurrentCursor); m_pStackCursor = new SwShellCursor( *this, *pCurrent->GetPoint(), pCurrent->GetPtPos(), m_pStackCursor ); @@ -2935,7 +2935,7 @@ size_t SwCursorShell::UpdateTableSelBoxes() { GetLayout()->MakeTableCursors( *m_pTableCursor ); } - return (m_pTableCursor) ? m_pTableCursor->GetSelectedBoxesCount() : 0; + return m_pTableCursor ? m_pTableCursor->GetSelectedBoxesCount() : 0; } /// show the current selected "object" diff --git a/sw/source/core/fields/expfld.cxx b/sw/source/core/fields/expfld.cxx index 87cd67994835..228f4cb762ad 100644 --- a/sw/source/core/fields/expfld.cxx +++ b/sw/source/core/fields/expfld.cxx @@ -855,7 +855,7 @@ OUString SwSetExpField::GetFieldName() const { SwFieldTypesEnum const nStrType( (IsSequenceField()) ? TYP_SEQFLD - : (mbInput) + : mbInput ? TYP_SETINPFLD : TYP_SETFLD ); diff --git a/sw/source/core/text/porfld.cxx b/sw/source/core/text/porfld.cxx index 1a9ad99b908c..e2a482e870dc 100644 --- a/sw/source/core/text/porfld.cxx +++ b/sw/source/core/text/porfld.cxx @@ -359,7 +359,7 @@ bool SwFieldPortion::Format( SwTextFormatInfo &rInf ) // The char is held in the first position // Unconditionally after format! - SetLen( (m_bNoLength) ? TextFrameIndex(0) : nFollow ); + SetLen( m_bNoLength ? TextFrameIndex(0) : nFollow ); if( nRest ) { diff --git a/sw/source/core/txtnode/fmtatr2.cxx b/sw/source/core/txtnode/fmtatr2.cxx index 73f6fb4b78ca..c909871b4dba 100644 --- a/sw/source/core/txtnode/fmtatr2.cxx +++ b/sw/source/core/txtnode/fmtatr2.cxx @@ -647,7 +647,7 @@ Meta::~Meta() SwTextMeta * Meta::GetTextAttr() const { - return (m_pFormat) ? m_pFormat->GetTextAttr() : nullptr; + return m_pFormat ? m_pFormat->GetTextAttr() : nullptr; } diff --git a/sw/source/core/txtnode/txatritr.cxx b/sw/source/core/txtnode/txatritr.cxx index f8cbb075b8ad..3fd45de385ff 100644 --- a/sw/source/core/txtnode/txatritr.cxx +++ b/sw/source/core/txtnode/txatritr.cxx @@ -57,7 +57,7 @@ SwScriptIterator::SwScriptIterator( } } - m_nChgPos = (bForward) + m_nChgPos = bForward ? g_pBreakIt->GetBreakIter()->endOfScript( m_rText, nStt, nCurScript) : g_pBreakIt->GetBreakIter()->beginOfScript( diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx index 812bc5763fb2..f7c307c4c18f 100644 --- a/sw/source/core/txtnode/txtedt.cxx +++ b/sw/source/core/txtnode/txtedt.cxx @@ -2294,7 +2294,7 @@ void SwTextNode::SetWrongDirty(WrongState eNew) const auto SwTextNode::GetWrongDirty() const -> WrongState { - return (m_pParaIdleData_Impl) ? m_pParaIdleData_Impl->eWrongDirty : WrongState::DONE; + return m_pParaIdleData_Impl ? m_pParaIdleData_Impl->eWrongDirty : WrongState::DONE; } bool SwTextNode::IsWrongDirty() const diff --git a/sw/source/core/undo/unmove.cxx b/sw/source/core/undo/unmove.cxx index cc762dd3e31f..a8f99653961a 100644 --- a/sw/source/core/undo/unmove.cxx +++ b/sw/source/core/undo/unmove.cxx @@ -224,7 +224,7 @@ void SwUndoMove::UndoImpl(::sw::UndoRedoContext & rContext) static_cast<SwTextNode*>(pCNd)->ClearSwpHintsArr( false ); // first delete all attributes at InsertPos - const bool bSuccess = pDoc->getIDocumentContentOperations().MoveRange( aPam, aPos, (m_bMoveRedlines) + const bool bSuccess = pDoc->getIDocumentContentOperations().MoveRange( aPam, aPos, m_bMoveRedlines ? SwMoveFlags::REDLINES : SwMoveFlags::DEFAULT ); if (!bSuccess) @@ -288,7 +288,7 @@ void SwUndoMove::RedoImpl(::sw::UndoRedoContext & rContext) { // only a move with SwRange SwNodeRange aRg( rNds, nSttNode, rNds, nEndNode ); - rDoc.getIDocumentContentOperations().MoveNodeRange( aRg, aIdx, (m_bMoveRedlines) + rDoc.getIDocumentContentOperations().MoveNodeRange( aRg, aIdx, m_bMoveRedlines ? SwMoveFlags::REDLINES : SwMoveFlags::DEFAULT ); } diff --git a/sw/source/core/unocore/unoidx.cxx b/sw/source/core/unocore/unoidx.cxx index de2b67a7da37..445142d6af86 100644 --- a/sw/source/core/unocore/unoidx.cxx +++ b/sw/source/core/unocore/unoidx.cxx @@ -337,7 +337,7 @@ public: , m_eTOXType(eType) , m_bIsDescriptor(nullptr == pBaseSection) , m_pDoc(&rDoc) - , m_pProps((m_bIsDescriptor) + , m_pProps(m_bIsDescriptor ? new SwDocIndexDescriptorProperties_Impl(rDoc.GetTOXType(eType, 0)) : nullptr) { @@ -351,7 +351,7 @@ public: SwTOXBase & GetTOXSectionOrThrow() const { SwSectionFormat *const pSectionFormat(GetSectionFormat()); - SwTOXBase *const pTOXSection( (m_bIsDescriptor) + SwTOXBase *const pTOXSection( m_bIsDescriptor ? &m_pProps->GetTOXBase() : (pSectionFormat ? static_cast<SwTOXBaseSection*>(pSectionFormat->GetSection()) @@ -367,7 +367,7 @@ public: sal_Int32 GetFormMax() const { SwTOXBase & rSection( GetTOXSectionOrThrow() ); - return (m_bIsDescriptor) + return m_bIsDescriptor ? SwForm::GetFormMaxLevel(m_eTOXType) : rSection.GetTOXForm().GetFormMax(); } diff --git a/sw/source/core/unocore/unoobj2.cxx b/sw/source/core/unocore/unoobj2.cxx index d6d0a25d9bb2..c98db9a1aaff 100644 --- a/sw/source/core/unocore/unoobj2.cxx +++ b/sw/source/core/unocore/unoobj2.cxx @@ -668,7 +668,7 @@ SwXParagraphEnumerationImpl::NextElement_Impl() SwPosition* pStart = rUnoCursor.Start(); const sal_Int32 nFirstContent = - (m_bFirstParagraph) ? m_nFirstParaStart : -1; + m_bFirstParagraph ? m_nFirstParaStart : -1; const sal_Int32 nLastContent = (m_nEndIndex == pStart->nNode.GetIndex()) ? m_nLastParaEnd : -1; diff --git a/sw/source/core/unocore/unosect.cxx b/sw/source/core/unocore/unosect.cxx index 47380a275dd9..2a2869a1717c 100644 --- a/sw/source/core/unocore/unosect.cxx +++ b/sw/source/core/unocore/unosect.cxx @@ -972,7 +972,7 @@ SwXTextSection::Impl::GetPropertyValues_Impl( { case WID_SECT_CONDITION: { - const OUString uTmp( (m_bIsDescriptor) + const OUString uTmp( m_bIsDescriptor ? m_pProps->m_sCondition : pSect->GetCondition()); pRet[nProperty] <<= uTmp; @@ -1049,28 +1049,28 @@ SwXTextSection::Impl::GetPropertyValues_Impl( break; case WID_SECT_VISIBLE : { - const bool bTemp = (m_bIsDescriptor) + const bool bTemp = m_bIsDescriptor ? !m_pProps->m_bHidden : !pSect->IsHidden(); pRet[nProperty] <<= bTemp; } break; case WID_SECT_CURRENTLY_VISIBLE: { - const bool bTemp = (m_bIsDescriptor) + const bool bTemp = m_bIsDescriptor ? !m_pProps->m_bCondHidden : !pSect->IsCondHidden(); pRet[nProperty] <<= bTemp; } break; case WID_SECT_PROTECTED: { - const bool bTemp = (m_bIsDescriptor) + const bool bTemp = m_bIsDescriptor ? m_pProps->m_bProtect : pSect->IsProtect(); pRet[nProperty] <<= bTemp; } break; case WID_SECT_EDIT_IN_READONLY: { - const bool bTemp = (m_bIsDescriptor) + const bool bTemp = m_bIsDescriptor ? m_pProps->m_bEditInReadonly : pSect->IsEditInReadonly(); pRet[nProperty] <<= bTemp; } @@ -1151,7 +1151,7 @@ SwXTextSection::Impl::GetPropertyValues_Impl( break; case WID_SECT_PASSWORD: { - pRet[nProperty] <<= (m_bIsDescriptor) + pRet[nProperty] <<= m_bIsDescriptor ? m_pProps->m_Password : pSect->GetPassword(); } break; diff --git a/sw/source/core/unocore/unosett.cxx b/sw/source/core/unocore/unosett.cxx index 2dffb00e7492..08e2787b4f9e 100644 --- a/sw/source/core/unocore/unosett.cxx +++ b/sw/source/core/unocore/unosett.cxx @@ -1302,7 +1302,7 @@ uno::Sequence<beans::PropertyValue> SwXNumberingRules::GetNumberingRuleByIndex( SwStyleNameMapper::FillProgName(sValue, aUString, SwGetPoolIdFromName::TxtColl); } - return GetPropertiesForNumFormat(rFormat, CharStyleName, (m_pDocShell) ? & aUString : nullptr); + return GetPropertiesForNumFormat(rFormat, CharStyleName, m_pDocShell ? & aUString : nullptr); } diff --git a/sw/source/core/view/pagepreviewlayout.cxx b/sw/source/core/view/pagepreviewlayout.cxx index 38bb11c72da6..3a3ba81eb601 100644 --- a/sw/source/core/view/pagepreviewlayout.cxx +++ b/sw/source/core/view/pagepreviewlayout.cxx @@ -597,7 +597,7 @@ void SwPagePreviewLayout::CalcPreviewPages() /// check whether RTL interface or not if(!AllSettings::GetLayoutRTL()) aCurrPaintOffset.AdjustX(mnColWidth ); - else aCurrPaintOffset.AdjustX( -(mnColWidth) ); + else aCurrPaintOffset.AdjustX( -mnColWidth ); ++nCurrCol; continue; } @@ -623,7 +623,7 @@ void SwPagePreviewLayout::CalcPreviewPages() /// check whether RTL interface or not if(!AllSettings::GetLayoutRTL()) aCurrPaintOffset.AdjustX(mnColWidth ); - else aCurrPaintOffset.AdjustX( -(mnColWidth) ); + else aCurrPaintOffset.AdjustX( -mnColWidth ); ++nCurrCol; if ( nCurrCol > mnCols ) { diff --git a/sw/source/filter/ww8/ww8par2.cxx b/sw/source/filter/ww8/ww8par2.cxx index 054e7aed7f91..c036df0955a8 100644 --- a/sw/source/filter/ww8/ww8par2.cxx +++ b/sw/source/filter/ww8/ww8par2.cxx @@ -4576,14 +4576,14 @@ void WW8RStyle::Import() rtl_TextEncoding SwWW8StyInf::GetCharSet() const { - if ((m_pFormat) && (m_pFormat->GetFrameDir().GetValue() == SvxFrameDirection::Horizontal_RL_TB)) + if (m_pFormat && (m_pFormat->GetFrameDir().GetValue() == SvxFrameDirection::Horizontal_RL_TB)) return m_eRTLFontSrcCharSet; return m_eLTRFontSrcCharSet; } rtl_TextEncoding SwWW8StyInf::GetCJKCharSet() const { - if ((m_pFormat) && (m_pFormat->GetFrameDir().GetValue() == SvxFrameDirection::Horizontal_RL_TB)) + if (m_pFormat && (m_pFormat->GetFrameDir().GetValue() == SvxFrameDirection::Horizontal_RL_TB)) return m_eRTLFontSrcCharSet; return m_eCJKFontSrcCharSet; } diff --git a/sw/source/filter/ww8/ww8scan.cxx b/sw/source/filter/ww8/ww8scan.cxx index 1b747d1c5b95..c2708708bd41 100644 --- a/sw/source/filter/ww8/ww8scan.cxx +++ b/sw/source/filter/ww8/ww8scan.cxx @@ -969,7 +969,7 @@ void WW8PLCFx_PCDAttrs::advance() WW8_CP WW8PLCFx_PCDAttrs::Where() { - return ( pPcd ) ? pPcd->Where() : WW8_CP_MAX; + return pPcd ? pPcd->Where() : WW8_CP_MAX; } void WW8PLCFx_PCDAttrs::GetSprms(WW8PLCFxDesc* p) @@ -4286,7 +4286,7 @@ void WW8PLCFx_Book::SetIdx(sal_uInt32 nI) sal_uInt32 WW8PLCFx_Book::GetIdx2() const { - return nIMax ? ( pBook[1]->GetIdx() | ( ( nIsEnd ) ? 0x80000000 : 0 ) ) : 0; + return nIMax ? ( pBook[1]->GetIdx() | ( nIsEnd ? 0x80000000 : 0 ) ) : 0; } void WW8PLCFx_Book::SetIdx2(sal_uInt32 nI) @@ -4363,7 +4363,7 @@ void WW8PLCFx_Book::advance() if (nPairFor == pBook[1]->GetIdx()) nIsEnd = 0; else - nIsEnd = ( nIsEnd ) ? 0 : 1; + nIsEnd = nIsEnd ? 0 : 1; } } } diff --git a/sw/source/filter/ww8/ww8scan.hxx b/sw/source/filter/ww8/ww8scan.hxx index b0ba35346da4..3a109542791a 100644 --- a/sw/source/filter/ww8/ww8scan.hxx +++ b/sw/source/filter/ww8/ww8scan.hxx @@ -774,7 +774,7 @@ public: virtual void advance() override; const OUString* GetName() const; WW8_CP GetStartPos() const - { return ( nIsEnd ) ? WW8_CP_MAX : pBook[0]->Where(); } + { return nIsEnd ? WW8_CP_MAX : pBook[0]->Where(); } long GetLen() const; bool GetIsEnd() const { return nIsEnd != 0; } long GetHandle() const; diff --git a/sw/source/filter/xml/xmltbli.cxx b/sw/source/filter/xml/xmltbli.cxx index 885abd80a5e5..2ea89d1cfe64 100644 --- a/sw/source/filter/xml/xmltbli.cxx +++ b/sw/source/filter/xml/xmltbli.cxx @@ -222,7 +222,7 @@ public: bool IsCovered() const { return mbCovered; } bool HasStringValue() const { return m_bHasStringValue; } OUString const* GetStringValue() const { - return (m_bHasStringValue) ? &m_StringValue : nullptr; + return m_bHasStringValue ? &m_StringValue : nullptr; } const SwStartNode *GetStartNode() const { return pStartNode; } diff --git a/sw/source/ui/misc/docfnote.cxx b/sw/source/ui/misc/docfnote.cxx index f3693cb6735d..c8512fac27f2 100644 --- a/sw/source/ui/misc/docfnote.cxx +++ b/sw/source/ui/misc/docfnote.cxx @@ -241,7 +241,7 @@ void SwEndNoteOptionPage::SelectNumbering(SwFootnoteNum const eNum) SwFootnoteNum SwEndNoteOptionPage::GetNumbering() const { const int nPos = m_xNumCountBox->get_active(); - return static_cast<SwFootnoteNum>((bPosDoc) ? nPos + 2 : nPos); + return static_cast<SwFootnoteNum>(bPosDoc ? nPos + 2 : nPos); } void SwEndNoteOptionPage::SetShell( SwWrtShell &rShell ) diff --git a/sw/source/uibase/app/docsh.cxx b/sw/source/uibase/app/docsh.cxx index 13e662feed3b..053209651f01 100644 --- a/sw/source/uibase/app/docsh.cxx +++ b/sw/source/uibase/app/docsh.cxx @@ -370,7 +370,7 @@ bool SwDocShell::Save() SetError(nErr ? nErr : nVBWarning); SfxViewFrame *const pFrame = - (m_pWrtShell) ? m_pWrtShell->GetView().GetViewFrame() : nullptr; + m_pWrtShell ? m_pWrtShell->GetView().GetViewFrame() : nullptr; if( pFrame ) { pFrame->GetBindings().SetState(SfxBoolItem(SID_DOC_MODIFIED, false)); diff --git a/sw/source/uibase/docvw/AnnotationWin2.cxx b/sw/source/uibase/docvw/AnnotationWin2.cxx index 978482343e81..075c3c5c247a 100644 --- a/sw/source/uibase/docvw/AnnotationWin2.cxx +++ b/sw/source/uibase/docvw/AnnotationWin2.cxx @@ -1469,7 +1469,7 @@ void SwAnnotationWin::ChangeSidebarItem( SwSidebarItem const & rSidebarItem ) const bool bAnchorChanged = mpAnchorFrame != rSidebarItem.maLayoutInfo.mpAnchorFrame; if ( bAnchorChanged ) { - mrMgr.DisconnectSidebarWinFromFrame( *(mpAnchorFrame), *this ); + mrMgr.DisconnectSidebarWinFromFrame( *mpAnchorFrame, *this ); } mrSidebarItem = rSidebarItem; diff --git a/tools/source/zcodec/zcodec.cxx b/tools/source/zcodec/zcodec.cxx index 12c6e9cc025d..70cfd8aac0d5 100644 --- a/tools/source/zcodec/zcodec.cxx +++ b/tools/source/zcodec/zcodec.cxx @@ -170,7 +170,7 @@ long ZCodec::Decompress( SvStream& rIStm, SvStream& rOStm ) while ( ( err != Z_STREAM_END) && ( PZSTREAM->avail_in || mnInToRead ) ); ImplWriteBack(); - return ( mbStatus ) ? static_cast<long>(PZSTREAM->total_out - nOldTotal_Out) : -1; + return mbStatus ? static_cast<long>(PZSTREAM->total_out - nOldTotal_Out) : -1; } void ZCodec::Write( SvStream& rOStm, const sal_uInt8* pData, sal_uInt32 nSize ) diff --git a/vcl/qt5/Qt5Frame.cxx b/vcl/qt5/Qt5Frame.cxx index e8fb1456705b..9a41cf38bf8b 100644 --- a/vcl/qt5/Qt5Frame.cxx +++ b/vcl/qt5/Qt5Frame.cxx @@ -389,7 +389,7 @@ void Qt5Frame::Center() if (m_pParent) { QWidget* pWindow = m_pParent->GetQWidget()->window(); - QWidget* const pWidget = (m_pTopLevel) ? m_pTopLevel : m_pQWidget; + QWidget* const pWidget = m_pTopLevel ? m_pTopLevel : m_pQWidget; pWidget->move(pWindow->frameGeometry().topLeft() + pWindow->rect().center() - pWidget->rect().center()); } @@ -431,7 +431,7 @@ void Qt5Frame::SetPosSize(long nX, long nY, long nWidth, long nHeight, sal_uInt1 m_bDefaultSize = false; if (isChild(false) || !m_pQWidget->isMaximized()) { - QWidget* const pWidget = (m_pTopLevel) ? m_pTopLevel : m_pQWidget; + QWidget* const pWidget = m_pTopLevel ? m_pTopLevel : m_pQWidget; if (m_nStyle & SalFrameStyleFlags::SIZEABLE) pWidget->resize(nWidth, nHeight); diff --git a/vcl/source/control/imp_listbox.cxx b/vcl/source/control/imp_listbox.cxx index 1a059785994a..a5711ab39cbf 100644 --- a/vcl/source/control/imp_listbox.cxx +++ b/vcl/source/control/imp_listbox.cxx @@ -1735,7 +1735,7 @@ void ImplListBoxWindow::ImplPaint(vcl::RenderContext& rRenderContext, sal_Int32 { mbInUserDraw = true; mnUserDrawEntry = nPos; - aRect.AdjustLeft( -(mnLeft) ); + aRect.AdjustLeft( -mnLeft ); if (nPos < GetEntryList()->GetMRUCount()) nPos = GetEntryList()->FindEntry(GetEntryList()->GetEntryText(nPos)); nPos = nPos - GetEntryList()->GetMRUCount(); diff --git a/vcl/source/filter/ixpm/xpmread.cxx b/vcl/source/filter/ixpm/xpmread.cxx index dd1166a20caa..d1e50944fd61 100644 --- a/vcl/source/filter/ixpm/xpmread.cxx +++ b/vcl/source/filter/ixpm/xpmread.cxx @@ -557,7 +557,7 @@ bool XPMReader::ImplGetPara ( sal_uLong nNumb ) nSize++; pPtr++; } - return ( ( nCount == nNumb ) && ( mpPara ) ); + return ( ( nCount == nNumb ) && mpPara ); } // The next string is read and stored in mpStringBuf (terminated with 0); diff --git a/vcl/source/gdi/sallayout.cxx b/vcl/source/gdi/sallayout.cxx index e6ef73d28882..9b665674d999 100644 --- a/vcl/source/gdi/sallayout.cxx +++ b/vcl/source/gdi/sallayout.cxx @@ -922,8 +922,8 @@ bool GenericSalLayout::GetNextGlyph(const GlyphItem** pGlyph, // calculate absolute position in pixel units Point aRelativePos = pGlyphIter->m_aLinearPos; - aRelativePos.setX( aRelativePos.X() / ( mnUnitsPerPixel) ); - aRelativePos.setY( aRelativePos.Y() / ( mnUnitsPerPixel) ); + aRelativePos.setX( aRelativePos.X() / mnUnitsPerPixel ); + aRelativePos.setY( aRelativePos.Y() / mnUnitsPerPixel ); rPos = GetDrawPosition( aRelativePos ); return true; diff --git a/vcl/source/treelist/headbar.cxx b/vcl/source/treelist/headbar.cxx index 3eaaba9ef76c..9777fc55722e 100644 --- a/vcl/source/treelist/headbar.cxx +++ b/vcl/source/treelist/headbar.cxx @@ -309,7 +309,7 @@ void HeaderBar::ImplDrawItem(vcl::RenderContext& rRenderContext, sal_uInt16 nPos { // do not draw border aRect.AdjustTop(mnBorderOff1 ); - aRect.AdjustBottom( -(mnBorderOff2) ); + aRect.AdjustBottom( -mnBorderOff2 ); // delete background if ( !pRect ) @@ -593,7 +593,7 @@ void HeaderBar::ImplUpdate(sal_uInt16 nPos, bool bEnd) if (bEnd) aRect.SetRight( mnDX - 1 ); aRect.AdjustTop(mnBorderOff1 ); - aRect.AdjustBottom( -(mnBorderOff2) ); + aRect.AdjustBottom( -mnBorderOff2 ); Invalidate(aRect); } diff --git a/vcl/source/treelist/svimpbox.cxx b/vcl/source/treelist/svimpbox.cxx index e8d927634960..7b3daeb913c2 100644 --- a/vcl/source/treelist/svimpbox.cxx +++ b/vcl/source/treelist/svimpbox.cxx @@ -1134,9 +1134,9 @@ void SvImpLBox::PositionScrollBars( Size& rSize, sal_uInt16 nMask ) Size aHorSize( rSize.Width(), nHorSBarHeight ); if( nMask & 0x0001 ) - aHorSize.AdjustWidth( -(nVerSBarWidth) ); + aHorSize.AdjustWidth( -nVerSBarWidth ); if( nMask & 0x0002 ) - aVerSize.AdjustHeight( -(nHorSBarHeight) ); + aVerSize.AdjustHeight( -nHorSBarHeight ); aVerSize.AdjustHeight(2 * nOverlap ); Point aVerPos( rSize.Width() - aVerSize.Width() + nOverlap, -nOverlap ); diff --git a/vcl/source/treelist/transfer.cxx b/vcl/source/treelist/transfer.cxx index cc7b97ba02df..41c41bf71a08 100644 --- a/vcl/source/treelist/transfer.cxx +++ b/vcl/source/treelist/transfer.cxx @@ -1330,7 +1330,7 @@ SotClipboardFormatId TransferableDataHelper::GetFormat( sal_uInt32 nFormat ) con { ::osl::MutexGuard aGuard(mxImpl->maMutex); DBG_ASSERT(nFormat < maFormats.size(), "TransferableDataHelper::GetFormat: invalid format index"); - return( ( nFormat < maFormats.size() ) ? (maFormats)[ nFormat ].mnSotId : SotClipboardFormatId::NONE ); + return( ( nFormat < maFormats.size() ) ? maFormats[ nFormat ].mnSotId : SotClipboardFormatId::NONE ); } DataFlavor TransferableDataHelper::GetFormatDataFlavor( sal_uInt32 nFormat ) const diff --git a/vcl/source/window/dockmgr.cxx b/vcl/source/window/dockmgr.cxx index d1238c89c245..c8599d46a318 100644 --- a/vcl/source/window/dockmgr.cxx +++ b/vcl/source/window/dockmgr.cxx @@ -584,8 +584,8 @@ void ImplDockingWindowWrapper::Tracking( const TrackingEvent& rTEvt ) { if ( bFloatMode ) { - aTrackRect.AdjustLeft( -(mnDockLeft) ); - aTrackRect.AdjustTop( -(mnDockTop) ); + aTrackRect.AdjustLeft( -mnDockLeft ); + aTrackRect.AdjustTop( -mnDockTop ); aTrackRect.AdjustRight(mnDockRight ); aTrackRect.AdjustBottom(mnDockBottom ); } @@ -595,8 +595,8 @@ void ImplDockingWindowWrapper::Tracking( const TrackingEvent& rTEvt ) { aTrackRect.AdjustLeft(mnDockLeft ); aTrackRect.AdjustTop(mnDockTop ); - aTrackRect.AdjustRight( -(mnDockRight) ); - aTrackRect.AdjustBottom( -(mnDockBottom) ); + aTrackRect.AdjustRight( -mnDockRight ); + aTrackRect.AdjustBottom( -mnDockBottom ); } } mbLastFloatMode = bFloatMode; diff --git a/vcl/source/window/dockwin.cxx b/vcl/source/window/dockwin.cxx index 7b5d2fdcaebe..47f050d1af99 100644 --- a/vcl/source/window/dockwin.cxx +++ b/vcl/source/window/dockwin.cxx @@ -462,8 +462,8 @@ void DockingWindow::Tracking( const TrackingEvent& rTEvt ) { if ( bFloatMode ) { - aTrackRect.AdjustLeft( -(mnDockLeft) ); - aTrackRect.AdjustTop( -(mnDockTop) ); + aTrackRect.AdjustLeft( -mnDockLeft ); + aTrackRect.AdjustTop( -mnDockTop ); aTrackRect.AdjustRight(mnDockRight ); aTrackRect.AdjustBottom(mnDockBottom ); } @@ -473,8 +473,8 @@ void DockingWindow::Tracking( const TrackingEvent& rTEvt ) { aTrackRect.AdjustLeft(mnDockLeft ); aTrackRect.AdjustTop(mnDockTop ); - aTrackRect.AdjustRight( -(mnDockRight) ); - aTrackRect.AdjustBottom( -(mnDockBottom) ); + aTrackRect.AdjustRight( -mnDockRight ); + aTrackRect.AdjustBottom( -mnDockBottom ); } } mbLastFloatMode = bFloatMode; diff --git a/vcl/source/window/menufloatingwindow.cxx b/vcl/source/window/menufloatingwindow.cxx index 62b6102f0325..7986679f8af1 100644 --- a/vcl/source/window/menufloatingwindow.cxx +++ b/vcl/source/window/menufloatingwindow.cxx @@ -191,7 +191,7 @@ vcl::Region MenuFloatingWindow::ImplCalcClipRegion() const Size aOutSz = GetOutputSizePixel(); tools::Rectangle aRect( Point(), aOutSz ); aRect.AdjustTop(nScrollerHeight ); - aRect.AdjustBottom( -(nScrollerHeight) ); + aRect.AdjustBottom( -nScrollerHeight ); vcl::Region aRegion(aRect); diff --git a/vcl/source/window/mouse.cxx b/vcl/source/window/mouse.cxx index c0e5a385b626..0fb993367317 100644 --- a/vcl/source/window/mouse.cxx +++ b/vcl/source/window/mouse.cxx @@ -68,8 +68,8 @@ WindowHitTest Window::ImplHitTest( const Point& rFramePos ) if ( mpWindowImpl->mbWinRegion ) { Point aTempPos = aFramePos; - aTempPos.AdjustX( -(mnOutOffX) ); - aTempPos.AdjustY( -(mnOutOffY) ); + aTempPos.AdjustX( -mnOutOffX ); + aTempPos.AdjustY( -mnOutOffY ); if ( !mpWindowImpl->maWinRegion.IsInside( aTempPos ) ) return WindowHitTest::NONE; } diff --git a/vcl/source/window/splitwin.cxx b/vcl/source/window/splitwin.cxx index 080a6ae38a7a..824d020b97c0 100644 --- a/vcl/source/window/splitwin.cxx +++ b/vcl/source/window/splitwin.cxx @@ -1108,7 +1108,7 @@ void SplitWindow::ImplDrawSplitTracking(const Point& rPos) aRect.SetRight( aRect.Left() + mpSplitSet->mnSplitSize - 1 ); if (!(mnWinStyle & WB_NOSPLITDRAW)) aRect.AdjustRight( -1 ); - if ((mnSplitTest & SPLIT_WINDOW) && (mbFadeOut)) + if ((mnSplitTest & SPLIT_WINDOW) && mbFadeOut) { aRect.AdjustLeft(SPLITWIN_SPLITSIZEEXLN ); aRect.AdjustRight(SPLITWIN_SPLITSIZEEXLN ); @@ -1122,7 +1122,7 @@ void SplitWindow::ImplDrawSplitTracking(const Point& rPos) aRect.SetBottom( aRect.Top() + mpSplitSet->mnSplitSize - 1 ); if (!(mnWinStyle & WB_NOSPLITDRAW)) aRect.AdjustBottom( -1 ); - if ((mnSplitTest & SPLIT_WINDOW) && (mbFadeOut)) + if ((mnSplitTest & SPLIT_WINDOW) && mbFadeOut) { aRect.AdjustTop(SPLITWIN_SPLITSIZEEXLN ); aRect.AdjustBottom(SPLITWIN_SPLITSIZEEXLN ); @@ -1429,7 +1429,7 @@ void SplitWindow::ImplSplitMousePos( Point& rMousePos ) { if ( mnSplitTest & SPLIT_HORZ ) { - rMousePos.AdjustX( -(mnMouseOff) ); + rMousePos.AdjustX( -mnMouseOff ); if ( rMousePos.X() < maDragRect.Left() ) rMousePos.setX( maDragRect.Left() ); else if ( rMousePos.X()+mpSplitSet->mnSplitSize+1 > maDragRect.Right() ) @@ -1439,7 +1439,7 @@ void SplitWindow::ImplSplitMousePos( Point& rMousePos ) } else { - rMousePos.AdjustY( -(mnMouseOff) ); + rMousePos.AdjustY( -mnMouseOff ); if ( rMousePos.Y() < maDragRect.Top() ) rMousePos.setY( maDragRect.Top() ); else if ( rMousePos.Y()+mpSplitSet->mnSplitSize+1 > maDragRect.Bottom() ) @@ -1477,7 +1477,7 @@ void SplitWindow::ImplGetButtonRect( tools::Rectangle& rRect, bool bTest ) const rRect.SetBottom( mnDY-mnBottomBorder-1 ); if ( bTest ) { - rRect.AdjustTop( -(mnTopBorder) ); + rRect.AdjustTop( -mnTopBorder ); rRect.AdjustBottom(mnBottomBorder ); } break; @@ -1488,7 +1488,7 @@ void SplitWindow::ImplGetButtonRect( tools::Rectangle& rRect, bool bTest ) const rRect.SetBottom( mnTopBorder+nSplitSize-1 ); if ( bTest ) { - rRect.AdjustTop( -(mnTopBorder) ); + rRect.AdjustTop( -mnTopBorder ); rRect.AdjustBottom(mnBottomBorder ); } break; @@ -1499,7 +1499,7 @@ void SplitWindow::ImplGetButtonRect( tools::Rectangle& rRect, bool bTest ) const rRect.SetBottom( rRect.Top()+SPLITWIN_SPLITSIZEAUTOHIDE ); if ( bTest ) { - rRect.AdjustLeft( -(mnLeftBorder) ); + rRect.AdjustLeft( -mnLeftBorder ); rRect.AdjustRight(mnRightBorder ); } break; @@ -1510,7 +1510,7 @@ void SplitWindow::ImplGetButtonRect( tools::Rectangle& rRect, bool bTest ) const rRect.SetBottom( rRect.Top()+SPLITWIN_SPLITSIZEAUTOHIDE ); if ( bTest ) { - rRect.AdjustLeft( -(mnLeftBorder) ); + rRect.AdjustLeft( -mnLeftBorder ); rRect.AdjustRight(mnRightBorder ); } break; diff --git a/vcl/unx/generic/app/saldisp.cxx b/vcl/unx/generic/app/saldisp.cxx index 5de28384b357..5af29803bbeb 100644 --- a/vcl/unx/generic/app/saldisp.cxx +++ b/vcl/unx/generic/app/saldisp.cxx @@ -1439,7 +1439,7 @@ KeySym SalDisplay::GetKeySym( XKeyEvent *pEvent, *pStatusReturn = 0; SalI18N_InputMethod* const pInputMethod = - ( pXLib_ ) ? pXLib_->GetInputMethod() : nullptr; + pXLib_ ? pXLib_->GetInputMethod() : nullptr; // first get the printable of the possibly modified KeySym if ( (aInputContext == nullptr) @@ -1946,7 +1946,7 @@ void SalX11Display::Yield() bool SalX11Display::Dispatch( XEvent *pEvent ) { SalI18N_InputMethod* const pInputMethod = - ( pXLib_ ) ? pXLib_->GetInputMethod() : nullptr; + pXLib_ ? pXLib_->GetInputMethod() : nullptr; if( pInputMethod ) { diff --git a/xmloff/source/core/xmlcnimp.cxx b/xmloff/source/core/xmlcnimp.cxx index 04343f6baf51..ce5e9968c24f 100644 --- a/xmloff/source/core/xmlcnimp.cxx +++ b/xmloff/source/core/xmlcnimp.cxx @@ -38,7 +38,7 @@ SvXMLAttrContainerData::~SvXMLAttrContainerData() bool SvXMLAttrContainerData::operator ==( const SvXMLAttrContainerData& rCmp ) const { - return ( *(rCmp.pimpl) == *(pimpl) ); + return ( *(rCmp.pimpl) == *pimpl ); } bool SvXMLAttrContainerData::AddAttr( const OUString& rLName, |