accessibility/source/extended/AccessibleBrowseBoxTableCell.cxx | 2 accessibility/source/extended/accessibleiconchoicectrlentry.cxx | 2 accessibility/source/standard/vclxaccessibletabpagewindow.cxx | 4 - accessibility/source/standard/vclxaccessibletoolbox.cxx | 2 avmedia/source/gstreamer/gstplayer.cxx | 2 avmedia/source/viewer/mediawindow_impl.cxx | 2 basctl/source/dlged/dlgedview.cxx | 2 basegfx/source/color/bcolormodifier.cxx | 6 +- basegfx/source/curve/b2dcubicbezier.cxx | 2 basegfx/source/matrix/b3dhommatrix.cxx | 2 basegfx/source/polygon/b2dlinegeometry.cxx | 4 - basegfx/source/polygon/b2dpolygontools.cxx | 14 ++--- basegfx/source/polygon/b2dpolypolygoncutter.cxx | 4 - basegfx/source/polygon/b2dpolypolygontools.cxx | 6 +- basegfx/source/polygon/b2dtrapezoid.cxx | 4 - basegfx/source/tools/gradienttools.cxx | 4 - basic/qa/cppunit/basic_coverage.cxx | 4 - basic/qa/cppunit/basictest.cxx | 6 +- basic/source/basmgr/basicmanagerrepository.cxx | 2 basic/source/basmgr/basmgr.cxx | 2 basic/source/classes/eventatt.cxx | 6 +- basic/source/classes/sb.cxx | 4 - basic/source/classes/sbunoobj.cxx | 4 - basic/source/classes/sbxmod.cxx | 4 - basic/source/comp/codegen.cxx | 2 basic/source/comp/exprgen.cxx | 2 basic/source/comp/sbcomp.cxx | 2 basic/source/runtime/methods.cxx | 2 basic/source/runtime/methods1.cxx | 4 - basic/source/runtime/runtime.cxx | 28 +++++----- basic/source/sbx/sbxcoll.cxx | 2 basic/source/sbx/sbxobj.cxx | 6 +- basic/source/sbx/sbxvalue.cxx | 12 ++-- 33 files changed, 77 insertions(+), 77 deletions(-)
New commits: commit 3d8400a8d938be7b116298d6a79bb49d7cc0cc99 Author: Noel Grandin <noel.gran...@collabora.co.uk> Date: Fri May 19 10:26:30 2017 +0200 loplugin:comparisonwithconstant in accessibility..basegfx re-running this plugin on these modules now that sberg has improved the plugin. Change-Id: I1818b1fa540cf62b81219a4f3ed2dcae8ff0e838 Reviewed-on: https://gerrit.libreoffice.org/37805 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/accessibility/source/extended/AccessibleBrowseBoxTableCell.cxx b/accessibility/source/extended/AccessibleBrowseBoxTableCell.cxx index ea8f6694d290..835bd62d6365 100644 --- a/accessibility/source/extended/AccessibleBrowseBoxTableCell.cxx +++ b/accessibility/source/extended/AccessibleBrowseBoxTableCell.cxx @@ -75,7 +75,7 @@ namespace accessibility sal_Int32 _nOffset ) :AccessibleBrowseBoxCell( _rxParent, _rBrowseBox, _xFocusWindow, _nRowPos, _nColPos ) { - m_nOffset = ( OFFSET_DEFAULT == _nOffset ) ? (sal_Int32)BBINDEX_FIRSTCONTROL : _nOffset; + m_nOffset = ( _nOffset == OFFSET_DEFAULT ) ? (sal_Int32)BBINDEX_FIRSTCONTROL : _nOffset; sal_Int32 nIndex = getIndex_Impl( _nRowPos, _nColPos, _rBrowseBox.GetColumnCount() ); setAccessibleName( _rBrowseBox.GetAccessibleObjectName( BBTYPE_TABLECELL, nIndex ) ); setAccessibleDescription( _rBrowseBox.GetAccessibleObjectDescription( BBTYPE_TABLECELL, nIndex ) ); diff --git a/accessibility/source/extended/accessibleiconchoicectrlentry.cxx b/accessibility/source/extended/accessibleiconchoicectrlentry.cxx index 6be99bec6c93..94816740b8cb 100644 --- a/accessibility/source/extended/accessibleiconchoicectrlentry.cxx +++ b/accessibility/source/extended/accessibleiconchoicectrlentry.cxx @@ -92,7 +92,7 @@ namespace accessibility if ( _rSource.Source == m_xParent ) { dispose(); - OSL_ENSURE( !m_xParent.is() && ( nullptr == m_pIconCtrl ), "" ); + OSL_ENSURE( !m_xParent.is() && ( m_pIconCtrl == nullptr ), "" ); } } diff --git a/accessibility/source/standard/vclxaccessibletabpagewindow.cxx b/accessibility/source/standard/vclxaccessibletabpagewindow.cxx index c8edcab404f8..0b8c2c5f7390 100644 --- a/accessibility/source/standard/vclxaccessibletabpagewindow.cxx +++ b/accessibility/source/standard/vclxaccessibletabpagewindow.cxx @@ -114,9 +114,9 @@ Reference< XAccessible > VCLXAccessibleTabPageWindow::getAccessibleParent( ) if ( xCont.is() ) { sal_uInt16 const nPagePos(m_pTabControl->GetPagePos(m_nPageId)); - SAL_WARN_IF(TAB_PAGE_NOTFOUND == nPagePos, "accessibility", + SAL_WARN_IF(nPagePos == TAB_PAGE_NOTFOUND, "accessibility", "getAccessibleParent(): no tab page"); - if (TAB_PAGE_NOTFOUND != nPagePos) + if (nPagePos != TAB_PAGE_NOTFOUND) { xParent = xCont->getAccessibleChild(nPagePos); } diff --git a/accessibility/source/standard/vclxaccessibletoolbox.cxx b/accessibility/source/standard/vclxaccessibletoolbox.cxx index d00778116f19..113391b8bf39 100644 --- a/accessibility/source/standard/vclxaccessibletoolbox.cxx +++ b/accessibility/source/standard/vclxaccessibletoolbox.cxx @@ -140,7 +140,7 @@ namespace if ( _ppImplementation ) *_ppImplementation = pImplementation; - return nullptr != pImplementation; + return pImplementation != nullptr; } Sequence< sal_Int8 > OToolBoxWindowItem::getUnoTunnelImplementationId() diff --git a/avmedia/source/gstreamer/gstplayer.cxx b/avmedia/source/gstreamer/gstplayer.cxx index 5b7559bf74d4..bc2d7493071d 100644 --- a/avmedia/source/gstreamer/gstplayer.cxx +++ b/avmedia/source/gstreamer/gstplayer.cxx @@ -688,7 +688,7 @@ void SAL_CALL Player::start() ::osl::MutexGuard aGuard(m_aMutex); // set the pipeline state to READY and run the loop - if( mbInitialized && nullptr != mpPlaybin ) + if( mbInitialized && mpPlaybin != nullptr ) { gst_element_set_state( mpPlaybin, GST_STATE_PLAYING ); mbPlayPending = true; diff --git a/avmedia/source/viewer/mediawindow_impl.cxx b/avmedia/source/viewer/mediawindow_impl.cxx index 172e4a3610ab..62c2d976801f 100644 --- a/avmedia/source/viewer/mediawindow_impl.cxx +++ b/avmedia/source/viewer/mediawindow_impl.cxx @@ -331,7 +331,7 @@ void MediaWindowImpl::updateMediaItem( MediaItem& rItem ) const if( isPlaying() ) rItem.setState( MediaState::Play ); else - rItem.setState( ( 0.0 == getMediaTime() ) ? MediaState::Stop : MediaState::Pause ); + rItem.setState( ( getMediaTime() == 0.0 ) ? MediaState::Stop : MediaState::Pause ); rItem.setDuration( getDuration() ); rItem.setTime( getMediaTime() ); diff --git a/basctl/source/dlged/dlgedview.cxx b/basctl/source/dlged/dlgedview.cxx index afb76e242f71..5fe5914746ea 100644 --- a/basctl/source/dlged/dlgedview.cxx +++ b/basctl/source/dlged/dlgedview.cxx @@ -129,7 +129,7 @@ SdrObject* impLocalHitCorrection(SdrObject* pRetval, const Point& rPnt, sal_uInt { bool bExcludeInner(false); - if(nullptr != dynamic_cast< DlgEdForm* >(pRetval)) + if(dynamic_cast< DlgEdForm* >(pRetval) != nullptr) { // from DlgEdForm::CheckHit; exclude inner for DlgEdForm bExcludeInner = true; diff --git a/basegfx/source/color/bcolormodifier.cxx b/basegfx/source/color/bcolormodifier.cxx index 64941c24dad2..6704f7ea489b 100644 --- a/basegfx/source/color/bcolormodifier.cxx +++ b/basegfx/source/color/bcolormodifier.cxx @@ -35,7 +35,7 @@ namespace basegfx bool BColorModifier_gray::operator==(const BColorModifier& rCompare) const { - return nullptr != dynamic_cast< const BColorModifier_gray* >(&rCompare); + return dynamic_cast< const BColorModifier_gray* >(&rCompare) != nullptr; } ::basegfx::BColor BColorModifier_gray::getModifiedColor(const ::basegfx::BColor& aSourceColor) const @@ -54,7 +54,7 @@ namespace basegfx bool BColorModifier_invert::operator==(const BColorModifier& rCompare) const { - return nullptr != dynamic_cast< const BColorModifier_invert* >(&rCompare); + return dynamic_cast< const BColorModifier_invert* >(&rCompare) != nullptr; } ::basegfx::BColor BColorModifier_invert::getModifiedColor(const ::basegfx::BColor& aSourceColor) const @@ -71,7 +71,7 @@ namespace basegfx bool BColorModifier_luminance_to_alpha::operator==(const BColorModifier& rCompare) const { - return nullptr != dynamic_cast< const BColorModifier_luminance_to_alpha* >(&rCompare); + return dynamic_cast< const BColorModifier_luminance_to_alpha* >(&rCompare) != nullptr; } ::basegfx::BColor BColorModifier_luminance_to_alpha::getModifiedColor(const ::basegfx::BColor& aSourceColor) const diff --git a/basegfx/source/curve/b2dcubicbezier.cxx b/basegfx/source/curve/b2dcubicbezier.cxx index c0f4c6b0cf8e..2b9394e0ff70 100644 --- a/basegfx/source/curve/b2dcubicbezier.cxx +++ b/basegfx/source/curve/b2dcubicbezier.cxx @@ -746,7 +746,7 @@ namespace basegfx } } - if(0.0 == fPosition || 1.0 == fPosition) + if(fPosition == 0.0 || fPosition == 1.0) { // if we are completely left or right, we are done break; diff --git a/basegfx/source/matrix/b3dhommatrix.cxx b/basegfx/source/matrix/b3dhommatrix.cxx index 919a00c9fb50..1a88c8b5c777 100644 --- a/basegfx/source/matrix/b3dhommatrix.cxx +++ b/basegfx/source/matrix/b3dhommatrix.cxx @@ -390,7 +390,7 @@ namespace basegfx return false; // If determinant is zero, decomposition is not possible - if(0.0 == determinant()) + if(determinant() == 0.0) return false; // isolate translation diff --git a/basegfx/source/polygon/b2dlinegeometry.cxx b/basegfx/source/polygon/b2dlinegeometry.cxx index b6829d68d7f5..8ae52d508fd2 100644 --- a/basegfx/source/polygon/b2dlinegeometry.cxx +++ b/basegfx/source/polygon/b2dlinegeometry.cxx @@ -679,7 +679,7 @@ namespace basegfx double fMiterMinimumAngle) { OSL_ENSURE(fHalfLineWidth > 0.0, "createAreaGeometryForJoin: LineWidth too small (!)"); - OSL_ENSURE(B2DLineJoin::NONE != eJoin, "createAreaGeometryForJoin: B2DLineJoin::NONE not allowed (!)"); + OSL_ENSURE(eJoin != B2DLineJoin::NONE, "createAreaGeometryForJoin: B2DLineJoin::NONE not allowed (!)"); // LineJoin from tangent rPerpendPrev to tangent rPerpendEdge in rPoint B2DPolygon aEdgePolygon; @@ -715,7 +715,7 @@ namespace basegfx double fCutPos(0.0); tools::findCut(aStartPoint, rTangentPrev, aEndPoint, rTangentEdge, CutFlagValue::ALL, &fCutPos); - if(0.0 != fCutPos) + if(fCutPos != 0.0) { const B2DPoint aCutPoint(aStartPoint + (rTangentPrev * fCutPos)); aEdgePolygon.append(aCutPoint); diff --git a/basegfx/source/polygon/b2dpolygontools.cxx b/basegfx/source/polygon/b2dpolygontools.cxx index 0b0f1712b54e..e40f17c8a3cb 100644 --- a/basegfx/source/polygon/b2dpolygontools.cxx +++ b/basegfx/source/polygon/b2dpolygontools.cxx @@ -199,7 +199,7 @@ namespace basegfx // add curved edge and generate DistanceBound double fBound(0.0); - if(0.0 == fDistanceBound) + if(fDistanceBound == 0.0) { // If not set, use B2DCubicBezier functionality to guess a rough value const double fRoughLength((aBezier.getEdgeLength() + aBezier.getControlPolygonLength()) / 2.0); @@ -269,7 +269,7 @@ namespace basegfx aRetval.append(aBezier.getStartPoint()); // #i37443# prepare convenient AngleBound if none was given - if(0.0 == fAngleBound) + if(fAngleBound == 0.0) { #ifdef DBG_UTIL fAngleBound = fAngleBoundStartValue; @@ -2392,7 +2392,7 @@ namespace basegfx fEdgeDist = getSmallestDistancePointToEdge(aBezier.getStartPoint(), aBezier.getEndPoint(), rTestPoint, fNewCut); } - if(DBL_MAX == fRetval || fEdgeDist < fRetval) + if(fRetval == DBL_MAX || fEdgeDist < fRetval) { fRetval = fEdgeDist; rEdgeIndex = a; @@ -2457,7 +2457,7 @@ namespace basegfx { const sal_uInt32 nPointCount(rCandidate.count()); - if(nPointCount && 0.0 != rOriginal.getWidth() && 0.0 != rOriginal.getHeight()) + if(nPointCount && rOriginal.getWidth() != 0.0 && rOriginal.getHeight() != 0.0) { B2DPolygon aRetval; @@ -2696,7 +2696,7 @@ namespace basegfx B2DPolygon growInNormalDirection(const B2DPolygon& rCandidate, double fValue) { - if(0.0 != fValue) + if(fValue != 0.0) { if(rCandidate.areControlPointsUsed()) { @@ -3301,7 +3301,7 @@ namespace basegfx B2DPoint aControlB; // first point is not allowed to be a control point - OSL_ENSURE(css::drawing::PolygonFlags_CONTROL != ePolygonFlag, + OSL_ENSURE(ePolygonFlag != css::drawing::PolygonFlags_CONTROL, "UnoPolygonBezierCoordsToB2DPolygon: Start point is a control point, illegal input polygon (!)"); // add first point as start point @@ -3342,7 +3342,7 @@ namespace basegfx // two or no control points are consumed, another one would be an error. // It's also an error if only one control point was read - SAL_WARN_IF(css::drawing::PolygonFlags_CONTROL == ePolygonFlag || bControlA != bControlB, + SAL_WARN_IF(ePolygonFlag == css::drawing::PolygonFlags_CONTROL || bControlA != bControlB, "basegfx", "UnoPolygonBezierCoordsToB2DPolygon: Illegal source polygon (!)"); // the previous writes used the B2DPolyPoygon -> tools::PolyPolygon converter diff --git a/basegfx/source/polygon/b2dpolypolygoncutter.cxx b/basegfx/source/polygon/b2dpolypolygoncutter.cxx index 7bd7ce4a365b..cbd5a50112af 100644 --- a/basegfx/source/polygon/b2dpolypolygoncutter.cxx +++ b/basegfx/source/polygon/b2dpolypolygoncutter.cxx @@ -592,7 +592,7 @@ namespace basegfx { PN& rPN = maPNV[a]; - if(SAL_MAX_UINT32 != rPN.mnI) + if(rPN.mnI != SAL_MAX_UINT32) { // unused node, start new part polygon B2DPolygon aNewPart; @@ -622,7 +622,7 @@ namespace basegfx nCountdown--; pPNCurr = &(maPNV[pPNCurr->mnIN]); } - while(pPNCurr != &rPN && SAL_MAX_UINT32 != pPNCurr->mnI); + while(pPNCurr != &rPN && pPNCurr->mnI != SAL_MAX_UINT32); // close and add aNewPart.setClosed(true); diff --git a/basegfx/source/polygon/b2dpolypolygontools.cxx b/basegfx/source/polygon/b2dpolypolygontools.cxx index c2c1cb25befc..d0353f5640c8 100644 --- a/basegfx/source/polygon/b2dpolypolygontools.cxx +++ b/basegfx/source/polygon/b2dpolypolygontools.cxx @@ -233,7 +233,7 @@ namespace basegfx void applyLineDashing(const B2DPolyPolygon& rCandidate, const std::vector<double>& rDotDashArray, B2DPolyPolygon* pLineTarget, B2DPolyPolygon* pGapTarget, double fFullDashDotLen) { - if(0.0 == fFullDashDotLen && rDotDashArray.size()) + if(fFullDashDotLen == 0.0 && rDotDashArray.size()) { // calculate fFullDashDotLen from rDotDashArray fFullDashDotLen = std::accumulate(rDotDashArray.begin(), rDotDashArray.end(), 0.0); @@ -327,7 +327,7 @@ namespace basegfx double fNewCut(0.0); const double fNewDistance(getSmallestDistancePointToPolygon(aCandidate, rTestPoint, nNewEdgeIndex, fNewCut)); - if(DBL_MAX == fRetval || fNewDistance < fRetval) + if(fRetval == DBL_MAX || fNewDistance < fRetval) { fRetval = fNewDistance; rPolygonIndex = a; @@ -378,7 +378,7 @@ namespace basegfx B2DPolyPolygon growInNormalDirection(const B2DPolyPolygon& rCandidate, double fValue) { - if(0.0 != fValue) + if(fValue != 0.0) { B2DPolyPolygon aRetval; diff --git a/basegfx/source/polygon/b2dtrapezoid.cxx b/basegfx/source/polygon/b2dtrapezoid.cxx index 6d2dad568332..e60bc1fb1ce8 100644 --- a/basegfx/source/polygon/b2dtrapezoid.cxx +++ b/basegfx/source/polygon/b2dtrapezoid.cxx @@ -115,7 +115,7 @@ namespace basegfx // data write access to StartPoint void setStart( const B2DPoint* pNewStart) { - OSL_ENSURE(nullptr != pNewStart, "No null pointer allowed here (!)"); + OSL_ENSURE(pNewStart != nullptr, "No null pointer allowed here (!)"); if(mpStart != pNewStart) { @@ -129,7 +129,7 @@ namespace basegfx // data write access to EndPoint void setEnd( const B2DPoint* pNewEnd) { - OSL_ENSURE(nullptr != pNewEnd, "No null pointer allowed here (!)"); + OSL_ENSURE(pNewEnd != nullptr, "No null pointer allowed here (!)"); if(mpEnd != pNewEnd) { diff --git a/basegfx/source/tools/gradienttools.cxx b/basegfx/source/tools/gradienttools.cxx index 119c900c767a..a3c42a6b7e75 100644 --- a/basegfx/source/tools/gradienttools.cxx +++ b/basegfx/source/tools/gradienttools.cxx @@ -176,7 +176,7 @@ namespace basegfx aTextureTransform.translate(fTargetOffsetX, fTargetOffsetY); // prepare aspect for texture - const double fAspectRatio(0.0 == fTargetSizeY ? 1.0 : (fTargetSizeX / fTargetSizeY)); + const double fAspectRatio(fTargetSizeY == 0.0 ? 1.0 : (fTargetSizeX / fTargetSizeY)); return ODFGradientInfo(aTextureTransform, fAspectRatio, nSteps); } @@ -253,7 +253,7 @@ namespace basegfx aTextureTransform.translate(fTargetOffsetX, fTargetOffsetY); // prepare aspect for texture - const double fAspectRatio(0.0 == fTargetSizeY ? 1.0 : (fTargetSizeX / fTargetSizeY)); + const double fAspectRatio(fTargetSizeY == 0.0 ? 1.0 : (fTargetSizeX / fTargetSizeY)); return ODFGradientInfo(aTextureTransform, fAspectRatio, nSteps); } commit 2e51afc77c0800dda6c09bb645d8962ae125b2ba Author: Noel Grandin <noel.gran...@collabora.co.uk> Date: Fri May 19 11:25:32 2017 +0200 loplugin:comparisonwithconstant in basic Change-Id: Ie34a17d2fb465ffbe675ba4e99917d23959f1fb5 Reviewed-on: https://gerrit.libreoffice.org/37809 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/basic/qa/cppunit/basic_coverage.cxx b/basic/qa/cppunit/basic_coverage.cxx index 1f336b482819..bee658a586d5 100644 --- a/basic/qa/cppunit/basic_coverage.cxx +++ b/basic/qa/cppunit/basic_coverage.cxx @@ -99,7 +99,7 @@ std::vector< OUString > Coverage::get_subdirnames( const OUString& sDirName ) osl::DirectoryItem aItem; osl::FileStatus aFileStatus(osl_FileStatus_Mask_FileURL|osl_FileStatus_Mask_Type); - if(osl::FileBase::E_None == aDir.open()) + if(aDir.open() == osl::FileBase::E_None) { while (aDir.getNextItem(aItem) == osl::FileBase::E_None) { @@ -116,7 +116,7 @@ void Coverage::process_directory(const OUString& sDirName) osl::DirectoryItem aItem; osl::FileStatus aFileStatus(osl_FileStatus_Mask_FileURL|osl_FileStatus_Mask_Type); - if(osl::FileBase::E_None == aDir.open()) + if(aDir.open() == osl::FileBase::E_None) { while (aDir.getNextItem(aItem) == osl::FileBase::E_None) { diff --git a/basic/qa/cppunit/basictest.cxx b/basic/qa/cppunit/basictest.cxx index ebd97d8c7ef4..bedd89e5dacf 100644 --- a/basic/qa/cppunit/basictest.cxx +++ b/basic/qa/cppunit/basictest.cxx @@ -49,15 +49,15 @@ void MacroSnippet::LoadSourceFromFile( const OUString& sMacroFileURL ) fprintf(stderr,"loadSource opening macro file %s\n", OUStringToOString( sMacroFileURL, RTL_TEXTENCODING_UTF8 ).getStr() ); osl::File aFile(sMacroFileURL); - if(osl::FileBase::E_None == aFile.open(osl_File_OpenFlag_Read)) + if(aFile.open(osl_File_OpenFlag_Read) == osl::FileBase::E_None) { sal_uInt64 size; sal_uInt64 size_read; - if(osl::FileBase::E_None == aFile.getSize(size)) + if(aFile.getSize(size) == osl::FileBase::E_None) { void* buffer = calloc(1, size+1); CPPUNIT_ASSERT(buffer); - if(osl::FileBase::E_None == aFile.read( buffer, size, size_read)) + if(aFile.read( buffer, size, size_read) == osl::FileBase::E_None) { if(size == size_read) { diff --git a/basic/source/basmgr/basicmanagerrepository.cxx b/basic/source/basmgr/basicmanagerrepository.cxx index 711210c33a0a..be1e1ca4edb9 100644 --- a/basic/source/basmgr/basicmanagerrepository.cxx +++ b/basic/source/basmgr/basicmanagerrepository.cxx @@ -445,7 +445,7 @@ namespace basic for(const auto& rError : aErrors) { // show message to user - if ( DialogMask::ButtonsCancel == ErrorHandler::HandleError( rError.GetErrorId() ) ) + if ( ErrorHandler::HandleError( rError.GetErrorId() ) == DialogMask::ButtonsCancel ) { // user wants to break loading of BASIC-manager delete _out_rpBasicManager; diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx index 4acd754113ff..cd9774b84ff0 100644 --- a/basic/source/basmgr/basmgr.cxx +++ b/basic/source/basmgr/basmgr.cxx @@ -1536,7 +1536,7 @@ namespace bool BasicManager::HasMacro( OUString const& i_fullyQualifiedName ) const { - return ( nullptr != lcl_queryMacro( const_cast< BasicManager* >( this ), i_fullyQualifiedName ) ); + return ( lcl_queryMacro( const_cast< BasicManager* >( this ), i_fullyQualifiedName ) != nullptr ); } ErrCode BasicManager::ExecuteMacro( OUString const& i_fullyQualifiedName, SbxArray* i_arguments, SbxValue* i_retValue ) diff --git a/basic/source/classes/eventatt.cxx b/basic/source/classes/eventatt.cxx index eea4b67060eb..4e65c7a289fb 100644 --- a/basic/source/classes/eventatt.cxx +++ b/basic/source/classes/eventatt.cxx @@ -279,7 +279,7 @@ void BasicScriptListener_Impl::firing_impl( const ScriptEvent& aScriptEvent, Any } // Default: Be tolerant and search everywhere - if( (!pMethVar || nullptr == dynamic_cast<const SbMethod*>( pMethVar)) && maBasicRef.is() ) + if( (!pMethVar || dynamic_cast<const SbMethod*>( pMethVar) == nullptr) && maBasicRef.is() ) { pMethVar = maBasicRef->FindQualified( aMacro, SbxClassType::DontCare ); } @@ -328,7 +328,7 @@ css::uno::Reference< css::container::XNameContainer > implFindDialogLibForDialog css::uno::Reference< css::container::XNameContainer > aRetDlgLib; SbxVariable* pDlgLibContVar = pBasic->Find("DialogLibraries", SbxClassType::Object); - if( pDlgLibContVar && nullptr != dynamic_cast<const SbUnoObject*>( pDlgLibContVar) ) + if( pDlgLibContVar && dynamic_cast<const SbUnoObject*>( pDlgLibContVar) != nullptr ) { SbUnoObject* pDlgLibContUnoObj = static_cast<SbUnoObject*>(static_cast<SbxBase*>(pDlgLibContVar)); Any aDlgLibContAny = pDlgLibContUnoObj->getUnoAny(); @@ -427,7 +427,7 @@ void RTL_Impl_CreateUnoDialog( StarBASIC* pBasic, SbxArray& rPar, bool bWrite ) // Get dialog SbxBaseRef pObj = rPar.Get( 1 )->GetObject(); - if( !(pObj.is() && nullptr != dynamic_cast<const SbUnoObject*>( pObj.get() )) ) + if( !(pObj.is() && dynamic_cast<const SbUnoObject*>( pObj.get() ) != nullptr) ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); return; diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx index c3e0a63c2668..913d94967aad 100644 --- a/basic/source/classes/sb.cxx +++ b/basic/source/classes/sb.cxx @@ -1256,7 +1256,7 @@ void StarBASIC::DeInitAllModules() // Deinit own modules for (const auto& pModule: pModules) { - if( pModule->pImage && !pModule->isProxyModule() && nullptr == dynamic_cast<SbObjModule*>( pModule.get()) ) + if( pModule->pImage && !pModule->isProxyModule() && dynamic_cast<SbObjModule*>( pModule.get()) == nullptr ) { pModule->pImage->bInit = false; } @@ -1853,7 +1853,7 @@ bool StarBASIC::LoadData( SvStream& r, sal_uInt16 nVer ) { return false; } - else if( nullptr != dynamic_cast<const SbJScriptModule*>( pMod) ) + else if( dynamic_cast<const SbJScriptModule*>( pMod) != nullptr ) { // assign Ref, so that pMod will be deleted SbModuleRef xRef = pMod; diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx index 43573250de0c..c35f96425659 100644 --- a/basic/source/classes/sbunoobj.cxx +++ b/basic/source/classes/sbunoobj.cxx @@ -995,7 +995,7 @@ Any sbxToUnoValueImpl( const SbxValue* pVar, bool bBlockConversionToSmallestType if( pClassModule->createCOMWrapperForIface( aRetAny, pClassModuleObj ) ) return aRetAny; } - if( nullptr == dynamic_cast<const SbUnoObject*>( xObj.get() ) ) + if( dynamic_cast<const SbUnoObject*>( xObj.get() ) == nullptr ) { // Create NativeObjectWrapper to identify object in case of callbacks SbxObject* pObj = dynamic_cast<SbxObject*>( pVar->GetObject() ); @@ -4246,7 +4246,7 @@ ModuleInvocationProxy::ModuleInvocationProxy( const OUString& aPrefix, SbxObject , m_xScopeObj( xScopeObj ) , m_aListeners( m_aMutex ) { - m_bProxyIsClassModuleObject = xScopeObj.is() && nullptr != dynamic_cast<const SbClassModuleObject*>( xScopeObj.get() ); + m_bProxyIsClassModuleObject = xScopeObj.is() && dynamic_cast<const SbClassModuleObject*>( xScopeObj.get() ) != nullptr; } Reference< XIntrospectionAccess > SAL_CALL ModuleInvocationProxy::getIntrospection() diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx index 9f74c7415172..f5b63ce1a669 100644 --- a/basic/source/classes/sbxmod.cxx +++ b/basic/source/classes/sbxmod.cxx @@ -1321,7 +1321,7 @@ void SbModule::ClearPrivateVars() void SbModule::implClearIfVarDependsOnDeletedBasic( SbxVariable* pVar, StarBASIC* pDeletedBasic ) { - if( pVar->SbxValue::GetType() != SbxOBJECT || nullptr != dynamic_cast<const SbProcedureProperty*>( pVar) ) + if( pVar->SbxValue::GetType() != SbxOBJECT || dynamic_cast<const SbProcedureProperty*>( pVar) != nullptr ) return; SbxObject* pObj = dynamic_cast<SbxObject*>( pVar->GetObject() ); @@ -1380,7 +1380,7 @@ void StarBASIC::ClearAllModuleVars() for (const auto& rModule: pModules) { // Initialise only, if the startcode was already executed - if( rModule->pImage && rModule->pImage->bInit && !rModule->isProxyModule() && nullptr == dynamic_cast<const SbObjModule*>( rModule.get()) ) + if( rModule->pImage && rModule->pImage->bInit && !rModule->isProxyModule() && dynamic_cast<const SbObjModule*>( rModule.get()) == nullptr ) rModule->ClearPrivateVars(); } diff --git a/basic/source/comp/codegen.cxx b/basic/source/comp/codegen.cxx index a3acf6732b9f..fee812fead44 100644 --- a/basic/source/comp/codegen.cxx +++ b/basic/source/comp/codegen.cxx @@ -205,7 +205,7 @@ void SbiCodeGen::Save() { const OUString& rIfaceName = pParser->aIfaceVector[i]; int nFound = aPureProcName.indexOf( rIfaceName ); - if( nFound == 0 && '_' == aPureProcName[rIfaceName.getLength()] ) + if( nFound == 0 && aPureProcName[rIfaceName.getLength()] == '_' ) { if( nPropPrefixFound == 0 ) { diff --git a/basic/source/comp/exprgen.cxx b/basic/source/comp/exprgen.cxx index 1b0638881bce..befb063cdde2 100644 --- a/basic/source/comp/exprgen.cxx +++ b/basic/source/comp/exprgen.cxx @@ -87,7 +87,7 @@ void SbiExprNode::Gen( SbiCodeGen& rGen, RecursiveMode eRecMode ) if( aVar.pDef->GetScope() == SbPARAM ) { eOp = SbiOpcode::PARAM_; - if( 0 == aVar.pDef->GetPos() ) + if( aVar.pDef->GetPos() == 0 ) { bool bTreatFunctionAsParam = true; if( eRecMode == FORCE_CALL ) diff --git a/basic/source/comp/sbcomp.cxx b/basic/source/comp/sbcomp.cxx index bdddbc4e2ec6..6e1bf2a8f8bc 100644 --- a/basic/source/comp/sbcomp.cxx +++ b/basic/source/comp/sbcomp.cxx @@ -58,7 +58,7 @@ bool SbModule::Compile() bool bRet = IsCompiled(); if( bRet ) { - if( nullptr == dynamic_cast<const SbObjModule*>( this) ) + if( dynamic_cast<const SbObjModule*>( this) == nullptr ) pBasic->ClearAllModuleVars(); RemoveVars(); // remove 'this' Modules variables // clear all method statics diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx index 42c4a4703364..a2c3e6ce940a 100644 --- a/basic/source/runtime/methods.cxx +++ b/basic/source/runtime/methods.cxx @@ -2601,7 +2601,7 @@ RTLFUNC(IsObject) SbUnoClass* pUnoClass; bool bObject; - if( pObj && nullptr != ( pUnoClass=dynamic_cast<SbUnoClass*>( pObj) ) ) + if( pObj && ( pUnoClass=dynamic_cast<SbUnoClass*>( pObj) ) != nullptr ) { bObject = pUnoClass->getUnoClass().is(); } diff --git a/basic/source/runtime/methods1.cxx b/basic/source/runtime/methods1.cxx index f3502fe3465a..021e7f21b950 100644 --- a/basic/source/runtime/methods1.cxx +++ b/basic/source/runtime/methods1.cxx @@ -125,7 +125,7 @@ RTLFUNC(CallByName) SbxObject* pObj = nullptr; if( pObjVar ) pObj = dynamic_cast<SbxObject*>( pObjVar ); - if( !pObj && pObjVar && nullptr != dynamic_cast<const SbxVariable*>( pObjVar) ) + if( !pObj && pObjVar && dynamic_cast<const SbxVariable*>( pObjVar) != nullptr ) { SbxBase* pObjVarObj = static_cast<SbxVariable*>(pObjVar)->GetObject(); pObj = dynamic_cast<SbxObject*>( pObjVarObj ); @@ -957,7 +957,7 @@ RTLFUNC(FindPropertyObject) { pObj = dynamic_cast<SbxObject*>( pObjVar ); } - if( !pObj && pObjVar && nullptr != dynamic_cast<const SbxVariable*>( pObjVar) ) + if( !pObj && pObjVar && dynamic_cast<const SbxVariable*>( pObjVar) != nullptr ) { SbxBase* pObjVarObj = static_cast<SbxVariable*>(pObjVar)->GetObject(); pObj = dynamic_cast<SbxObject*>( pObjVarObj ); diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx index 5314e8f413c7..7b8761cc750f 100644 --- a/basic/source/runtime/runtime.cxx +++ b/basic/source/runtime/runtime.cxx @@ -833,7 +833,7 @@ bool SbiRuntime::Step() // there's no error handler -> find one farther above SbiRuntime* pRtErrHdl = nullptr; SbiRuntime* pRt = this; - while( nullptr != (pRt = pRt->pNext) ) + while( (pRt = pRt->pNext) != nullptr ) { if( !pRt->bError || pRt->pError != nullptr ) { @@ -1587,11 +1587,11 @@ inline bool checkUnoStructCopy( bool bVBA, SbxVariableRef& refVal, SbxVariableRe return false; } // #115826: Exclude ProcedureProperties to avoid call to Property Get procedure - else if( nullptr != dynamic_cast<const SbProcedureProperty*>( refVar.get() ) ) + else if( dynamic_cast<const SbProcedureProperty*>( refVar.get() ) != nullptr ) return false; SbxObjectRef xValObj = static_cast<SbxObject*>(refVal->GetObject()); - if( !xValObj.is() || nullptr != dynamic_cast<const SbUnoAnyObject*>( xValObj.get() ) ) + if( !xValObj.is() || dynamic_cast<const SbUnoAnyObject*>( xValObj.get() ) != nullptr ) return false; SbUnoObject* pUnoVal = dynamic_cast<SbUnoObject*>( xValObj.get() ); @@ -1902,7 +1902,7 @@ void SbiRuntime::StepSET_Impl( SbxVariableRef& refVal, SbxVariableRef& refVar, b } if ( bDimAsNew ) { - if( nullptr == dynamic_cast<const SbxObject*>( refVar.get() ) ) + if( dynamic_cast<const SbxObject*>( refVar.get() ) == nullptr ) { SbxBase* pValObjBase = refVal->GetObject(); if( pValObjBase == nullptr ) @@ -2387,9 +2387,9 @@ void SbiRuntime::StepARGV() SbxVariableRef pVal = PopVar(); // Before fix of #94916: - if( nullptr != dynamic_cast<const SbxMethod*>( pVal.get() ) - || nullptr != dynamic_cast<const SbUnoProperty*>( pVal.get() ) - || nullptr != dynamic_cast<const SbProcedureProperty*>( pVal.get() ) ) + if( dynamic_cast<const SbxMethod*>( pVal.get() ) != nullptr + || dynamic_cast<const SbUnoProperty*>( pVal.get() ) != nullptr + || dynamic_cast<const SbProcedureProperty*>( pVal.get() ) != nullptr ) { // evaluate methods and properties! SbxVariable* pRes = new SbxVariable( *pVal ); @@ -2797,9 +2797,9 @@ void SbiRuntime::StepARGN( sal_uInt32 nOp1 ) OUString aAlias( pImg->GetString( static_cast<short>( nOp1 ) ) ); SbxVariableRef pVal = PopVar(); if( bVBAEnabled && - ( nullptr != dynamic_cast<const SbxMethod*>( pVal.get()) - || nullptr != dynamic_cast<const SbUnoProperty*>( pVal.get()) - || nullptr != dynamic_cast<const SbProcedureProperty*>( pVal.get()) ) ) + ( dynamic_cast<const SbxMethod*>( pVal.get()) != nullptr + || dynamic_cast<const SbUnoProperty*>( pVal.get()) != nullptr + || dynamic_cast<const SbProcedureProperty*>( pVal.get()) != nullptr ) ) { // named variables ( that are Any especially properties ) can be empty at this point and need a broadcast if ( pVal->GetType() == SbxEMPTY ) @@ -3531,7 +3531,7 @@ SbxVariable* SbiRuntime::FindElement( SbxObject* pObj, sal_uInt32 nOp1, sal_uInt // definitely we want this for VBA where properties are often // collections ( which need index access ), but lets only do // this if we actually have params following - else if( bVBAEnabled && nullptr != dynamic_cast<const SbUnoProperty*>( pElem) && pElem->GetParameters() ) + else if( bVBAEnabled && dynamic_cast<const SbUnoProperty*>( pElem) != nullptr && pElem->GetParameters() ) { SbxVariableRef refTemp = pElem; @@ -3665,7 +3665,7 @@ void SbiRuntime::SetupArgs( SbxVariable* p, sal_uInt32 nOp1 ) } } } - else if( bVBAEnabled && p->GetType() == SbxOBJECT && (nullptr == dynamic_cast<const SbxMethod*>( p) || !p->IsBroadcaster()) ) + else if( bVBAEnabled && p->GetType() == SbxOBJECT && (dynamic_cast<const SbxMethod*>( p) == nullptr || !p->IsBroadcaster()) ) { // Check for default method with named parameters SbxBaseRef xObj = p->GetObject(); @@ -3787,8 +3787,8 @@ SbxVariable* SbiRuntime::CheckArray( SbxVariable* pElem ) } // consider index-access for UnoObjects else if( pElem->GetType() == SbxOBJECT && - nullptr == dynamic_cast<const SbxMethod*>( pElem) && - ( !bVBAEnabled || nullptr == dynamic_cast<const SbxProperty*>( pElem) ) ) + dynamic_cast<const SbxMethod*>( pElem) == nullptr && + ( !bVBAEnabled || dynamic_cast<const SbxProperty*>( pElem) == nullptr ) ) { pPar = pElem->GetParameters(); if ( pPar ) diff --git a/basic/source/sbx/sbxcoll.cxx b/basic/source/sbx/sbxcoll.cxx index 690cbc2ec2bd..af752516baea 100644 --- a/basic/source/sbx/sbxcoll.cxx +++ b/basic/source/sbx/sbxcoll.cxx @@ -170,7 +170,7 @@ void SbxCollection::CollAdd( SbxArray* pPar_ ) else { SbxBase* pObj = pPar_->Get( 1 )->GetObject(); - if( !pObj || !( nullptr != dynamic_cast<const SbxObject*>( pObj) ) ) + if( !pObj || dynamic_cast<const SbxObject*>(pObj) == nullptr ) { SetError( ERRCODE_SBX_NOTIMP ); } diff --git a/basic/source/sbx/sbxobj.cxx b/basic/source/sbx/sbxobj.cxx index 7763e96d90bf..ece89f5862be 100644 --- a/basic/source/sbx/sbxobj.cxx +++ b/basic/source/sbx/sbxobj.cxx @@ -288,7 +288,7 @@ SbxVariable* SbxObject::Find( const OUString& rName, SbxClassType t ) bool SbxObject::Call( const OUString& rName, SbxArray* pParam ) { SbxVariable* pMeth = FindQualified( rName, SbxClassType::DontCare); - if( pMeth && nullptr != dynamic_cast<const SbxMethod*>( pMeth) ) + if( pMeth && dynamic_cast<const SbxMethod*>( pMeth) != nullptr ) { // FindQualified() might have struck already! if( pParam ) @@ -384,7 +384,7 @@ SbxVariable* SbxObject::Make( const OUString& rName, SbxClassType ct, SbxDataTyp return nullptr; } // Collections may contain objects of the same name - if( !( ct == SbxClassType::Object && nullptr != dynamic_cast<const SbxCollection*>( this ) ) ) + if( !( ct == SbxClassType::Object && dynamic_cast<const SbxCollection*>( this ) != nullptr ) ) { SbxVariable* pRes = pArray->Find( rName, ct ); if( pRes ) @@ -428,7 +428,7 @@ void SbxObject::Insert( SbxVariable* pVar ) { // Then this element exists already // There are objects of the same name allowed at collections - if( pArray == pObjs.get() && nullptr != dynamic_cast<const SbxCollection*>( this ) ) + if( pArray == pObjs.get() && dynamic_cast<const SbxCollection*>( this ) != nullptr ) { nIdx = pArray->Count(); } diff --git a/basic/source/sbx/sbxvalue.cxx b/basic/source/sbx/sbxvalue.cxx index f4bc90578e96..bca0f80f8d2f 100644 --- a/basic/source/sbx/sbxvalue.cxx +++ b/basic/source/sbx/sbxvalue.cxx @@ -156,8 +156,8 @@ void SbxValue::Clear() { SAL_INFO("basic.sbx", "Not at Parent-Prop - otherwise CyclicRef"); SbxVariable *pThisVar = dynamic_cast<SbxVariable*>( this ); - bool bParentProp = pThisVar && 5345 == - static_cast<sal_uInt16>(pThisVar->GetUserData()); + bool bParentProp = pThisVar && static_cast<sal_uInt16>(pThisVar->GetUserData()) == + 5345; if ( !bParentProp ) aData.pObj->ReleaseRef(); } @@ -497,8 +497,8 @@ bool SbxValue::Put( const SbxValues& rVal ) } SAL_INFO("basic.sbx", "Not at Parent-Prop - otherwise CyclicRef"); SbxVariable *pThisVar = dynamic_cast<SbxVariable*>( this ); - bool bParentProp = pThisVar && 5345 == - static_cast<sal_uInt16>(pThisVar->GetUserData()); + bool bParentProp = pThisVar && static_cast<sal_uInt16>(pThisVar->GetUserData()) == + 5345; if ( !bParentProp ) p->aData.pObj->AddFirstRef(); } @@ -688,7 +688,7 @@ bool SbxValue::ImpIsNumeric( bool bOnlyIntntl ) const return false; } // Test downcast!!! - if( nullptr != dynamic_cast<const SbxVariable*>( this) ) + if( dynamic_cast<const SbxVariable*>( this) != nullptr ) const_cast<SbxVariable*>(static_cast<const SbxVariable*>(this))->Broadcast( SfxHintId::BasicDataWanted ); SbxDataType t = GetType(); if( t == SbxSTRING ) @@ -763,7 +763,7 @@ bool SbxValue::SetType( SbxDataType t ) : 0; DBG_ASSERT( nSlotId != 5345 || pThisVar->GetName() == "Parent", "SID_PARENTOBJECT is not named 'Parent'" ); - bool bParentProp = 5345 == nSlotId; + bool bParentProp = nSlotId == 5345; if ( !bParentProp ) aData.pObj->ReleaseRef(); } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits