[Libreoffice-commits] core.git: svx/source

Tor Lillqvist tml at collabora.com
Mon Sep 16 08:46:50 PDT 2013


 svx/source/sidebar/PanelLayout.cxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 19fd14a8ed09f1ab4c7bf9ae49df3131daea7d51
Author: Tor Lillqvist <tml at collabora.com>
Date:   Mon Sep 16 18:43:08 2013 +0300

    Correct use of && where only & makes sense
    
    Shows up as a warning from Clang: use of logical '&&' with constant operand
    
    I wonder how many cases we have where && is used instead of & but with both
    operands non-constant, thus not causing any warning?
    
    Change-Id: I8fbbcf9c08f54f8803a08a4e8c54d7bd873af800

diff --git a/svx/source/sidebar/PanelLayout.cxx b/svx/source/sidebar/PanelLayout.cxx
index 9712b26..003ca3e 100644
--- a/svx/source/sidebar/PanelLayout.cxx
+++ b/svx/source/sidebar/PanelLayout.cxx
@@ -36,9 +36,9 @@ void PanelLayout::setPosSizePixel(long nX, long nY, long nWidth, long nHeight, s
     if (bIsLayoutEnabled && pChild->GetType() == WINDOW_SCROLLWINDOW)
     {
         WinBits nStyle = pChild->GetStyle();
-        if (nStyle && (WB_AUTOHSCROLL | WB_HSCROLL))
+        if (nStyle & (WB_AUTOHSCROLL | WB_HSCROLL))
             bCanHandleSmallerWidth = true;
-        if (nStyle && (WB_AUTOVSCROLL | WB_VSCROLL))
+        if (nStyle & (WB_AUTOVSCROLL | WB_VSCROLL))
             bCanHandleSmallerHeight = true;
     }
 


More information about the Libreoffice-commits mailing list