[Libreoffice-commits] core.git: dbaccess/source desktop/source drawinglayer/source editeng/source emfio/source extensions/source filter/source formula/source framework/source
Noel Grandin (via logerrit)
logerrit at kemper.freedesktop.org
Fri May 29 12:45:17 UTC 2020
dbaccess/source/ui/dlg/TextConnectionHelper.cxx | 2 +-
desktop/source/deployment/misc/dp_misc.cxx | 4 ++--
desktop/source/lib/init.cxx | 2 +-
drawinglayer/source/primitive2d/PolyPolygonGraphicPrimitive2D.cxx | 2 +-
drawinglayer/source/primitive2d/fillgraphicprimitive2d.cxx | 2 +-
drawinglayer/source/primitive2d/textbreakuphelper.cxx | 2 +-
drawinglayer/source/processor3d/zbufferprocessor3d.cxx | 2 +-
drawinglayer/source/tools/emfpfont.cxx | 2 +-
editeng/source/editeng/editobj.cxx | 2 +-
editeng/source/editeng/impedit.cxx | 2 +-
emfio/source/reader/mtftools.cxx | 2 +-
extensions/source/propctrlr/propertycontrolextender.cxx | 4 ++--
extensions/source/scanner/sane.cxx | 4 ++--
filter/source/msfilter/msdffimp.cxx | 2 +-
filter/source/msfilter/msvbahelper.cxx | 2 +-
filter/source/msfilter/svdfppt.cxx | 2 +-
formula/source/core/api/token.cxx | 2 +-
formula/source/ui/dlg/formula.cxx | 2 +-
formula/source/ui/dlg/parawin.cxx | 2 +-
framework/source/uielement/menubarmanager.cxx | 4 ++--
framework/source/uielement/recentfilesmenucontroller.cxx | 6 +++---
framework/source/uielement/statusbarmanager.cxx | 4 ++--
22 files changed, 29 insertions(+), 29 deletions(-)
New commits:
commit 9b25614939f7709e3d67949f49c4beeec0cdc534
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Fri May 29 11:34:00 2020 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Fri May 29 14:44:37 2020 +0200
loplugin:simplifybool in dbaccess..framework
Change-Id: I0d73bb7d8d3fde426edc0a10c0750758b68aceb5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95099
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/dbaccess/source/ui/dlg/TextConnectionHelper.cxx b/dbaccess/source/ui/dlg/TextConnectionHelper.cxx
index bacc0f7cb67c..a494bda4c4ad 100644
--- a/dbaccess/source/ui/dlg/TextConnectionHelper.cxx
+++ b/dbaccess/source/ui/dlg/TextConnectionHelper.cxx
@@ -358,7 +358,7 @@ namespace dbaui
if (nPos == -1)
return rBox.get_active_text().copy(0);
- if ( !( m_xTextSeparator.get() == &rBox && nPos == (rBox.get_count()-1) ) )
+ if ( m_xTextSeparator.get() != &rBox || nPos != (rBox.get_count()-1) )
return OUString(
static_cast< sal_Unicode >( rList.getToken((nPos*2)+1, nTok ).toInt32() ));
// somewhat strange ... translates for instance an "32" into " "
diff --git a/desktop/source/deployment/misc/dp_misc.cxx b/desktop/source/deployment/misc/dp_misc.cxx
index 513294535ce8..a76076e623f9 100644
--- a/desktop/source/deployment/misc/dp_misc.cxx
+++ b/desktop/source/deployment/misc/dp_misc.cxx
@@ -79,8 +79,8 @@ OUString OfficePipeId::operator () ()
OUString userPath;
::utl::Bootstrap::PathStatus aLocateResult =
::utl::Bootstrap::locateUserInstallation( userPath );
- if (!(aLocateResult == ::utl::Bootstrap::PATH_EXISTS ||
- aLocateResult == ::utl::Bootstrap::PATH_VALID))
+ if (aLocateResult != ::utl::Bootstrap::PATH_EXISTS &&
+ aLocateResult != ::utl::Bootstrap::PATH_VALID)
{
throw Exception("Extension Manager: Could not obtain path for UserInstallation.", nullptr);
}
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 717a542a9f27..7f89463dc6aa 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -5043,7 +5043,7 @@ unsigned char* doc_renderFontOrientation(SAL_UNUSED_PARAMETER LibreOfficeKitDocu
int nFontWidth = aRect.BottomRight().X() + 1;
int nFontHeight = aRect.BottomRight().Y() + 1;
- if (!(nFontWidth > 0 && nFontHeight > 0))
+ if (nFontWidth <= 0 || nFontHeight <= 0)
break;
if (*pFontWidth > 0 && *pFontHeight > 0)
diff --git a/drawinglayer/source/primitive2d/PolyPolygonGraphicPrimitive2D.cxx b/drawinglayer/source/primitive2d/PolyPolygonGraphicPrimitive2D.cxx
index 2a1aefafa275..c857ba5c8e3d 100644
--- a/drawinglayer/source/primitive2d/PolyPolygonGraphicPrimitive2D.cxx
+++ b/drawinglayer/source/primitive2d/PolyPolygonGraphicPrimitive2D.cxx
@@ -40,7 +40,7 @@ void PolyPolygonGraphicPrimitive2D::create2DDecomposition(
const GraphicType aType(rGraphic.GetType());
// is there a bitmap or a metafile (do we have content)?
- if (!(GraphicType::Bitmap == aType || GraphicType::GdiMetafile == aType))
+ if (GraphicType::Bitmap != aType && GraphicType::GdiMetafile != aType)
return;
const Size aPrefSize(rGraphic.GetPrefSize());
diff --git a/drawinglayer/source/primitive2d/fillgraphicprimitive2d.cxx b/drawinglayer/source/primitive2d/fillgraphicprimitive2d.cxx
index 1bfc47940a87..708b3f2ce48d 100644
--- a/drawinglayer/source/primitive2d/fillgraphicprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/fillgraphicprimitive2d.cxx
@@ -41,7 +41,7 @@ namespace drawinglayer::primitive2d
const Graphic& rGraphic = rAttribute.getGraphic();
- if(!(GraphicType::Bitmap == rGraphic.GetType() || GraphicType::GdiMetafile == rGraphic.GetType()))
+ if(GraphicType::Bitmap != rGraphic.GetType() && GraphicType::GdiMetafile != rGraphic.GetType())
return;
const Size aSize(rGraphic.GetPrefSize());
diff --git a/drawinglayer/source/primitive2d/textbreakuphelper.cxx b/drawinglayer/source/primitive2d/textbreakuphelper.cxx
index 1139f19e8d06..df37aa01356e 100644
--- a/drawinglayer/source/primitive2d/textbreakuphelper.cxx
+++ b/drawinglayer/source/primitive2d/textbreakuphelper.cxx
@@ -55,7 +55,7 @@ namespace drawinglayer::primitive2d
void TextBreakupHelper::breakupPortion(Primitive2DContainer& rTempResult, sal_Int32 nIndex, sal_Int32 nLength, bool bWordLineMode)
{
- if(!(nLength && !(nIndex == mrSource.getTextPosition() && nLength == mrSource.getTextLength())))
+ if(!(nLength && (nIndex != mrSource.getTextPosition() || nLength != mrSource.getTextLength())))
return;
// prepare values for new portion
diff --git a/drawinglayer/source/processor3d/zbufferprocessor3d.cxx b/drawinglayer/source/processor3d/zbufferprocessor3d.cxx
index dc8a2f8aa962..6cd65d60b416 100644
--- a/drawinglayer/source/processor3d/zbufferprocessor3d.cxx
+++ b/drawinglayer/source/processor3d/zbufferprocessor3d.cxx
@@ -274,7 +274,7 @@ void ZBufferRasterConverter3D::processLineSpan(const basegfx::RasterConversionLi
if(nSpanCount & 0x0001)
return;
- if(!(nLine >= 0 && nLine < static_cast<sal_Int32>(mrBuffer.getHeight())))
+ if(nLine < 0 || nLine >= static_cast<sal_Int32>(mrBuffer.getHeight()))
return;
sal_uInt32 nXA(std::min(mrBuffer.getWidth(), static_cast<sal_uInt32>(std::max(sal_Int32(0), basegfx::fround(rA.getX().getVal())))));
diff --git a/drawinglayer/source/tools/emfpfont.cxx b/drawinglayer/source/tools/emfpfont.cxx
index a9ee61511234..f641fdd4d21b 100644
--- a/drawinglayer/source/tools/emfpfont.cxx
+++ b/drawinglayer/source/tools/emfpfont.cxx
@@ -56,7 +56,7 @@ namespace emfplushelper
SAL_INFO("drawinglayer", "EMF+\tReserved: 0x" << reserved << std::dec);
SAL_INFO("drawinglayer", "EMF+\tLength: " << length);
- if (!(length > 0 && length < 0x4000))
+ if (length <= 0 || length >= 0x4000)
return;
rtl_uString *pStr = rtl_uString_alloc(length);
diff --git a/editeng/source/editeng/editobj.cxx b/editeng/source/editeng/editobj.cxx
index f93d4a6205ad..88cef3a89c35 100644
--- a/editeng/source/editeng/editobj.cxx
+++ b/editeng/source/editeng/editobj.cxx
@@ -444,7 +444,7 @@ void EditTextObject::dumpAsXml(xmlTextWriterPtr pWriter) const
// from SfxItemPoolUser
void EditTextObjectImpl::ObjectInDestruction(const SfxItemPool& rSfxItemPool)
{
- if(!(!bOwnerOfPool && pPool == &rSfxItemPool))
+ if(bOwnerOfPool || pPool != &rSfxItemPool)
return;
// The pool we are based on gets destructed; get owner of pool by creating own one.
diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx
index e087305effd1..20b6bd4dcc3c 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -161,7 +161,7 @@ static void lcl_translateTwips(vcl::Window const & rParent, vcl::Window& rChild)
// This prevents multiple translate calls that negate
// one another.
const Point aOrigin = rChild.GetMapMode().GetOrigin();
- if (!(aOrigin.getX() == 0 && aOrigin.getY() == 0))
+ if (aOrigin.getX() != 0 || aOrigin.getY() != 0)
return;
// Set map mode, so that callback payloads will contain absolute coordinates instead of relative ones.
diff --git a/emfio/source/reader/mtftools.cxx b/emfio/source/reader/mtftools.cxx
index 06b0f813588d..535c49184dae 100644
--- a/emfio/source/reader/mtftools.cxx
+++ b/emfio/source/reader/mtftools.cxx
@@ -1386,7 +1386,7 @@ namespace emfio
void MtfTools::DrawPolyBezier( tools::Polygon rPolygon, bool bTo, bool bRecordPath )
{
sal_uInt16 nPoints = rPolygon.GetSize();
- if ( !(( nPoints >= 4 ) && ( ( ( nPoints - 4 ) % 3 ) == 0 )) )
+ if ( ( nPoints < 4 ) || ( ( ( nPoints - 4 ) % 3 ) != 0 ) )
return;
UpdateClipRegion();
diff --git a/extensions/source/propctrlr/propertycontrolextender.cxx b/extensions/source/propctrlr/propertycontrolextender.cxx
index 443a166820e6..142e288ddeb9 100644
--- a/extensions/source/propctrlr/propertycontrolextender.cxx
+++ b/extensions/source/propctrlr/propertycontrolextender.cxx
@@ -78,8 +78,8 @@ namespace pcr
void SAL_CALL PropertyControlExtender::keyPressed( const KeyEvent& _event )
{
OSL_ENSURE( _event.Source == m_pData->xControlWindow, "PropertyControlExtender::keyPressed: where does this come from?" );
- if ( !(( _event.KeyFunc == KeyFunction::DELETE )
- && ( _event.Modifiers == 0 ))
+ if ( ( _event.KeyFunc != KeyFunction::DELETE )
+ || ( _event.Modifiers != 0 )
)
return;
diff --git a/extensions/source/scanner/sane.cxx b/extensions/source/scanner/sane.cxx
index 9030e5697a09..f8f85de5d9e1 100644
--- a/extensions/source/scanner/sane.cxx
+++ b/extensions/source/scanner/sane.cxx
@@ -388,8 +388,8 @@ bool Sane::GetOptionValue( int n, double& rRet, int nElement )
bool Sane::GetOptionValue( int n, double* pSet )
{
- if( ! maHandle || ! ( mppOptions[n]->type == SANE_TYPE_FIXED ||
- mppOptions[n]->type == SANE_TYPE_INT ) )
+ if( ! maHandle || ( mppOptions[n]->type != SANE_TYPE_FIXED &&
+ mppOptions[n]->type != SANE_TYPE_INT ) )
return false;
std::unique_ptr<SANE_Word[]> pFixedSet(new SANE_Word[mppOptions[n]->size/sizeof(SANE_Word)]);
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index 8f8e5d015728..da5b636172c9 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -3634,7 +3634,7 @@ void SvxMSDffManager::ReadObjText( SvStream& rStream, SdrObject* pObj )
DffRecordHeader aRecHd;
if (!ReadDffRecordHeader(rStream, aRecHd))
return;
- if( !(aRecHd.nRecType == DFF_msofbtClientTextbox || aRecHd.nRecType == 0x1022) )
+ if( aRecHd.nRecType != DFF_msofbtClientTextbox && aRecHd.nRecType != 0x1022 )
return;
while (rStream.good() && rStream.Tell() < aRecHd.GetRecEndFilePos())
diff --git a/filter/source/msfilter/msvbahelper.cxx b/filter/source/msfilter/msvbahelper.cxx
index 92e53386fcb3..8c44140397b1 100644
--- a/filter/source/msfilter/msvbahelper.cxx
+++ b/filter/source/msfilter/msvbahelper.cxx
@@ -718,7 +718,7 @@ awt::KeyEvent parseKeyEvent( const OUString& Key )
}
else // key should be enclosed in '{}'
{
- if ( sKeyCode.getLength() < 3 || !( sKeyCode[0] == '{' && sKeyCode[sKeyCode.getLength() - 1 ] == '}' ) )
+ if ( sKeyCode.getLength() < 3 || sKeyCode[0] != '{' || sKeyCode[sKeyCode.getLength() - 1 ] != '}' )
throw uno::RuntimeException();
sKeyCode = sKeyCode.copy(1, sKeyCode.getLength() - 2 );
diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx
index 9734c6d3464f..385551be007a 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -606,7 +606,7 @@ void SdrEscherImport::RecolorGraphic( SvStream& rSt, sal_uInt32 nRecLen, Graphic
.ReadUInt16( nX )
.ReadUInt16( nX );
- if ( !(( nGlobalColorsCount <= 64 ) && ( nFillColorsCount <= 64 )) )
+ if ( ( nGlobalColorsCount > 64 ) || ( nFillColorsCount > 64 ) )
return;
if ( static_cast<sal_uInt32>( ( nGlobalColorsCount + nFillColorsCount ) * 44 + 12 ) != nRecLen )
diff --git a/formula/source/core/api/token.cxx b/formula/source/core/api/token.cxx
index 0b8b373a9de3..68df38517f76 100644
--- a/formula/source/core/api/token.cxx
+++ b/formula/source/core/api/token.cxx
@@ -1357,7 +1357,7 @@ FormulaTokenArray * FormulaTokenArray::RewriteMissing( const MissingConvention &
// Omit everything except a trailing separator, the leading
// separator is omitted below. The other way around would leave
// an extraneous separator if no parameter followed.
- if (!(pOcas[ i ] == nFn && pCur->GetOpCode() == ocSep))
+ if (pOcas[ i ] != nFn || pCur->GetOpCode() != ocSep)
bAdd = false;
}
}
diff --git a/formula/source/ui/dlg/formula.cxx b/formula/source/ui/dlg/formula.cxx
index 330217c80292..b92824fc60a5 100644
--- a/formula/source/ui/dlg/formula.cxx
+++ b/formula/source/ui/dlg/formula.cxx
@@ -585,7 +585,7 @@ void FormulaDlg_Impl::CalcStruct( const OUString& rStrExp, bool bForceRecalcStru
void FormulaDlg_Impl::MakeTree(StructPage* _pTree, weld::TreeIter* pParent, const FormulaToken* pFuncToken,
const FormulaToken* _pToken, long Count)
{
- if ( !(_pToken != nullptr && Count > 0) )
+ if ( _pToken == nullptr || Count <= 0 )
return;
long nParas = _pToken->GetParamCount();
diff --git a/formula/source/ui/dlg/parawin.cxx b/formula/source/ui/dlg/parawin.cxx
index ceb50d8d7e6d..4a3b76838d7b 100644
--- a/formula/source/ui/dlg/parawin.cxx
+++ b/formula/source/ui/dlg/parawin.cxx
@@ -108,7 +108,7 @@ void ParaWin::UpdateArgDesc( sal_uInt16 nArg )
if (nMaxArgs > 4)
nArg = sal::static_int_cast<sal_uInt16>( nArg + GetSliderPos() );
- if (!((nMaxArgs > 0) && (nArg<nMaxArgs)))
+ if ((nMaxArgs <= 0) || (nArg >= nMaxArgs))
return;
OUString aArgDesc;
diff --git a/framework/source/uielement/menubarmanager.cxx b/framework/source/uielement/menubarmanager.cxx
index f7ff1e18dbf6..29bc7f3e4643 100644
--- a/framework/source/uielement/menubarmanager.cxx
+++ b/framework/source/uielement/menubarmanager.cxx
@@ -691,8 +691,8 @@ IMPL_LINK( MenuBarManager, Activate, Menu *, pMenu, bool )
// There is no dispatch mechanism for the special window list menu items,
// because they are handled directly through XFrame->activate!!!
// Don't update dispatches for special file menu items.
- if ( !( menuItemHandler->nItemId >= START_ITEMID_WINDOWLIST &&
- menuItemHandler->nItemId < END_ITEMID_WINDOWLIST ) )
+ if ( menuItemHandler->nItemId < START_ITEMID_WINDOWLIST ||
+ menuItemHandler->nItemId >= END_ITEMID_WINDOWLIST )
{
Reference< XDispatch > xMenuItemDispatch;
diff --git a/framework/source/uielement/recentfilesmenucontroller.cxx b/framework/source/uielement/recentfilesmenucontroller.cxx
index 9b75f3fdb66e..82fe0f361108 100644
--- a/framework/source/uielement/recentfilesmenucontroller.cxx
+++ b/framework/source/uielement/recentfilesmenucontroller.cxx
@@ -236,8 +236,8 @@ void RecentFilesMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >
void RecentFilesMenuController::executeEntry( sal_Int32 nIndex )
{
- if (!(( nIndex >= 0 ) &&
- ( nIndex < sal::static_int_cast<sal_Int32>( m_aRecentFilesItems.size() ))))
+ if (( nIndex < 0 ) ||
+ ( nIndex >= sal::static_int_cast<sal_Int32>( m_aRecentFilesItems.size() )))
return;
Sequence< PropertyValue > aArgsList(3);
@@ -360,7 +360,7 @@ void SAL_CALL RecentFilesMenuController::dispatch(
const OUString aEntryArgStr( "entry=" );
sal_Int32 nEntryArg = aURL.Complete.indexOf( aEntryArgStr, nQueryPart );
sal_Int32 nEntryPos = nEntryArg + aEntryArgStr.getLength();
- if (!(( nEntryArg > 0 ) && ( nEntryPos < aURL.Complete.getLength() )))
+ if (( nEntryArg <= 0 ) || ( nEntryPos >= aURL.Complete.getLength() ))
return;
sal_Int32 nAddArgs = aURL.Complete.indexOf( '&', nEntryPos );
diff --git a/framework/source/uielement/statusbarmanager.cxx b/framework/source/uielement/statusbarmanager.cxx
index f97becd5d1ff..f49716bc146e 100644
--- a/framework/source/uielement/statusbarmanager.cxx
+++ b/framework/source/uielement/statusbarmanager.cxx
@@ -532,7 +532,7 @@ void StatusBarManager::UserDraw( const UserDrawEvent& rUDEvt )
sal_uInt16 nId( rUDEvt.GetItemId() );
StatusBarControllerMap::const_iterator it = m_aControllerMap.find( nId );
- if (!(( nId > 0 ) && ( it != m_aControllerMap.end() )))
+ if (( nId <= 0 ) || ( it == m_aControllerMap.end() ))
return;
uno::Reference< frame::XStatusbarController > xController( it->second );
@@ -588,7 +588,7 @@ void StatusBarManager::MouseButton( const MouseEvent& rMEvt ,sal_Bool ( SAL_CALL
sal_uInt16 nId = m_pStatusBar->GetItemId( rMEvt.GetPosPixel() );
StatusBarControllerMap::const_iterator it = m_aControllerMap.find( nId );
- if (!(( nId > 0 ) && ( it != m_aControllerMap.end() )))
+ if (( nId <= 0 ) || ( it == m_aControllerMap.end() ))
return;
uno::Reference< frame::XStatusbarController > xController( it->second );
More information about the Libreoffice-commits
mailing list