[Libreoffice-commits] core.git: ucb/source unotools/source vcl/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Fri May 29 12:45:47 UTC 2020


 ucb/source/cacher/cachedcontentresultset.cxx |    3 +--
 unotools/source/misc/fontdefs.cxx            |    2 +-
 vcl/source/control/field2.cxx                |    2 +-
 vcl/source/filter/png/PngImageReader.cxx     |    3 +--
 vcl/source/fontsubset/sft.cxx                |    4 ++--
 vcl/source/gdi/pdfwriter_impl.cxx            |    4 ++--
 vcl/source/treelist/treelistbox.cxx          |    2 +-
 vcl/source/window/legacyaccessibility.cxx    |    3 +--
 vcl/source/window/menu.cxx                   |    4 ++--
 vcl/source/window/winproc.cxx                |    8 ++++----
 10 files changed, 16 insertions(+), 19 deletions(-)

New commits:
commit 198546d0fae471a8a1808b337008faa8bfa457a7
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Fri May 29 13:14:16 2020 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Fri May 29 14:45:03 2020 +0200

    loplugin:simplifybool in ucb..vcl
    
    Change-Id: Ib63623f5ca3f6559e02a0013c3cbd6174f7aec14
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95108
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/ucb/source/cacher/cachedcontentresultset.cxx b/ucb/source/cacher/cachedcontentresultset.cxx
index 9ebc51357fd2..c947b128c3e1 100644
--- a/ucb/source/cacher/cachedcontentresultset.cxx
+++ b/ucb/source/cacher/cachedcontentresultset.cxx
@@ -978,8 +978,7 @@ void SAL_CALL CachedContentResultSet
         {
             nNew = COMSUNSTARUCBCCRS_DEFAULT_FETCH_DIRECTION;
         }
-        else if( !( nNew == FetchDirection::FORWARD
-                || nNew == FetchDirection::REVERSE ) )
+        else if( nNew != FetchDirection::FORWARD && nNew != FetchDirection::REVERSE )
         {
             throw IllegalArgumentException();
         }
diff --git a/unotools/source/misc/fontdefs.cxx b/unotools/source/misc/fontdefs.cxx
index 3eb4d69bd3a7..3fd6c51ea6cd 100644
--- a/unotools/source/misc/fontdefs.cxx
+++ b/unotools/source/misc/fontdefs.cxx
@@ -402,7 +402,7 @@ OUString GetEnglishSearchFontName(const OUString& rInName)
             }
         }
         // not lowercase Ascii
-        else if ( !((c >= 'a') && (c <= 'z')) )
+        else if ( (c < 'a') || (c > 'z') )
         {
             // To Lowercase-Ascii
             if ( (c >= 'A') && (c <= 'Z') )
diff --git a/vcl/source/control/field2.cxx b/vcl/source/control/field2.cxx
index da400911d0ca..6b69d19c9ff1 100644
--- a/vcl/source/control/field2.cxx
+++ b/vcl/source/control/field2.cxx
@@ -944,7 +944,7 @@ static ExtDateFieldFormat ImplGetExtFormat( DateOrder eOld )
 static sal_uInt16 ImplCutNumberFromString( OUString& rStr )
 {
     sal_Int32 i1 = 0;
-    while (i1 != rStr.getLength() && !(rStr[i1] >= '0' && rStr[i1] <= '9')) {
+    while (i1 != rStr.getLength() && (rStr[i1] < '0' || rStr[i1] > '9')) {
         ++i1;
     }
     sal_Int32 i2 = i1;
diff --git a/vcl/source/filter/png/PngImageReader.cxx b/vcl/source/filter/png/PngImageReader.cxx
index 958cae34eb46..fae4b29a339a 100644
--- a/vcl/source/filter/png/PngImageReader.cxx
+++ b/vcl/source/filter/png/PngImageReader.cxx
@@ -126,8 +126,7 @@ bool reader(SvStream& rStream, BitmapEx& rBitmapEx, bool bUseBitmap32)
         return false;
     }
 
-    if (bitDepth != 8
-        || !(colorType == PNG_COLOR_TYPE_RGB || colorType == PNG_COLOR_TYPE_RGB_ALPHA))
+    if (bitDepth != 8 || (colorType != PNG_COLOR_TYPE_RGB && colorType != PNG_COLOR_TYPE_RGB_ALPHA))
     {
         png_destroy_read_struct(&pPng, &pInfo, nullptr);
         return false;
diff --git a/vcl/source/fontsubset/sft.cxx b/vcl/source/fontsubset/sft.cxx
index efba8ff594f3..e16335a70449 100644
--- a/vcl/source/fontsubset/sft.cxx
+++ b/vcl/source/fontsubset/sft.cxx
@@ -756,7 +756,7 @@ static int BSplineToPSPath(ControlPoint const *srcA, int srcCount, PSPathElement
             }
             else
             {
-                if (!(x0 == curx && y0 == cury))
+                if (x0 != curx || y0 != cury)
                 {                              /* eliminate empty lines */
                     p = PSPathElement(PS_LINETO);
                     p.x1 = curx;
@@ -1814,7 +1814,7 @@ SFErrCodes CreateT3FromTTGlyphs(TrueTypeFont *ttf, FILE *outf, const char *fname
 
     const char * const h41 = "(%s) cvn exch definefont pop\n";
 
-    if (!((nGlyphs > 0) && (nGlyphs <= 256))) return SFErrCodes::GlyphNum;
+    if ((nGlyphs <= 0) || (nGlyphs > 256)) return SFErrCodes::GlyphNum;
     if (!glyphArray) return SFErrCodes::BadArg;
     if (!fname) fname = ttf->psname;
 
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index a09a5fcf5599..b1f027441cda 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -5961,8 +5961,8 @@ void PDFWriterImpl::drawLayout( SalLayout& rLayout, const OUString& rText, bool
     // perform artificial italics if necessary
     if( ( m_aCurrentPDFState.m_aFont.GetItalic() == ITALIC_NORMAL ||
           m_aCurrentPDFState.m_aFont.GetItalic() == ITALIC_OBLIQUE ) &&
-        !( GetFontInstance()->GetFontFace()->GetItalic() == ITALIC_NORMAL ||
-           GetFontInstance()->GetFontFace()->GetItalic() == ITALIC_OBLIQUE )
+        ( GetFontInstance()->GetFontFace()->GetItalic() != ITALIC_NORMAL &&
+           GetFontInstance()->GetFontFace()->GetItalic() != ITALIC_OBLIQUE )
         )
     {
         fSkew = M_PI/12.0;
diff --git a/vcl/source/treelist/treelistbox.cxx b/vcl/source/treelist/treelistbox.cxx
index bb52e28fe0d4..3c68f1331f0b 100644
--- a/vcl/source/treelist/treelistbox.cxx
+++ b/vcl/source/treelist/treelistbox.cxx
@@ -2815,7 +2815,7 @@ void SvTreeListBox::PaintEntry1(SvTreeListEntry& rEntry, long nLine, vcl::Render
         pNextTab = nNextTab < nTabCount ? aTabs[nNextTab].get() : nullptr;
     } while (pNextTab && pNextTab->IsDynamic());
 
-    if (!(!pNextTab || (GetTabPos( &rEntry, pNextTab ) > nDynTabPos)))
+    if (pNextTab && (GetTabPos( &rEntry, pNextTab ) <= nDynTabPos))
         return;
 
     if (!((nWindowStyle & WB_HASBUTTONSATROOT) || pModel->GetDepth(&rEntry) > 0))
diff --git a/vcl/source/window/legacyaccessibility.cxx b/vcl/source/window/legacyaccessibility.cxx
index 376d0d08af6f..346e1fdc8f2a 100644
--- a/vcl/source/window/legacyaccessibility.cxx
+++ b/vcl/source/window/legacyaccessibility.cxx
@@ -191,8 +191,7 @@ Window* Window::getLegacyNonLayoutAccessibleRelationMemberOf() const
         pFrameWindow = ImplGetFrameWindow();
     }
     // if( ! ( GetType() == WindowType::FIXEDTEXT        ||
-    if( !( GetType() == WindowType::FIXEDLINE ||
-        GetType() == WindowType::GROUPBOX ) )
+    if( GetType() != WindowType::FIXEDLINE && GetType() != WindowType::GROUPBOX )
     {
         // search for a control that makes member of this window
         // it is considered the last fixed line or group box
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index bcfbdbb37773..3d5d88fa11f2 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -1488,7 +1488,7 @@ Size Menu::ImplCalcSize( vcl::Window* pWin )
             {
                 nCheckWidth = aMaxSize.Width();
                 // checks / images take the same place
-                if( ! ( ( pData->eType == MenuItemType::IMAGE ) || ( pData->eType == MenuItemType::STRINGIMAGE ) ) )
+                if( ( pData->eType != MenuItemType::IMAGE ) && ( pData->eType != MenuItemType::STRINGIMAGE ) )
                     nWidth += nCheckWidth + nExtra * 2;
             }
 
@@ -1849,7 +1849,7 @@ void Menu::ImplPaint(vcl::RenderContext& rRenderContext, Size const & rSize,
                     // however do not do this if native checks will be painted since
                     // the selection color too often does not fit the theme's check and/or radio
 
-                    if( !((pData->eType == MenuItemType::IMAGE) || (pData->eType == MenuItemType::STRINGIMAGE)))
+                    if( (pData->eType != MenuItemType::IMAGE) && (pData->eType != MenuItemType::STRINGIMAGE))
                     {
                         if (rRenderContext.IsNativeControlSupported(ControlType::MenuPopup,
                                                                     (pData->nBits & MenuItemBits::RADIOCHECK)
diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx
index 2c77f7069456..57bba25eb16b 100644
--- a/vcl/source/window/winproc.cxx
+++ b/vcl/source/window/winproc.cxx
@@ -461,10 +461,10 @@ bool ImplHandleMouseEvent( const VclPtr<vcl::Window>& xWindow, MouseNotifyEvent
                     //long nMouseY = nY;
                     long nMouseX = aMousePos.X(); // #106074# use the possibly re-mirrored coordinates (RTL) ! nX,nY are unmodified !
                     long nMouseY = aMousePos.Y();
-                    if ( !(((nMouseX-nDragW) <= pMouseDownWin->ImplGetFrameData()->mnFirstMouseX) &&
-                           ((nMouseX+nDragW) >= pMouseDownWin->ImplGetFrameData()->mnFirstMouseX)) ||
-                         !(((nMouseY-nDragH) <= pMouseDownWin->ImplGetFrameData()->mnFirstMouseY) &&
-                           ((nMouseY+nDragH) >= pMouseDownWin->ImplGetFrameData()->mnFirstMouseY)) )
+                    if ( (((nMouseX-nDragW) > pMouseDownWin->ImplGetFrameData()->mnFirstMouseX) ||
+                           ((nMouseX+nDragW) < pMouseDownWin->ImplGetFrameData()->mnFirstMouseX)) ||
+                         (((nMouseY-nDragH) > pMouseDownWin->ImplGetFrameData()->mnFirstMouseY) ||
+                           ((nMouseY+nDragH) < pMouseDownWin->ImplGetFrameData()->mnFirstMouseY)) )
                     {
                         pMouseDownWin->ImplGetFrameData()->mbStartDragCalled  = true;
 


More information about the Libreoffice-commits mailing list