[Libreoffice-commits] .: sw/source

Norbert Thiebaud nthiebaud at kemper.freedesktop.org
Sun Oct 10 02:41:00 PDT 2010


 sw/source/ui/shells/frmsh.cxx   |    9 +++---
 sw/source/ui/uiview/view.cxx    |    4 +--
 sw/source/ui/uiview/viewtab.cxx |   53 ++++++++++++++++++++--------------------
 3 files changed, 34 insertions(+), 32 deletions(-)

New commits:
commit 30e5418b2c50ba396d047a915c953d737a831dfb
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date:   Sun Oct 10 04:28:44 2010 -0500

    squash some  warning: suggest parentheses around && within ||

diff --git a/sw/source/ui/shells/frmsh.cxx b/sw/source/ui/shells/frmsh.cxx
index b2dfee2..70841ce 100644
--- a/sw/source/ui/shells/frmsh.cxx
+++ b/sw/source/ui/shells/frmsh.cxx
@@ -710,8 +710,9 @@ void SwFrameShell::GetState(SfxItemSet& rSet)
                 case FN_FRAME_ALIGN_HORZ_RIGHT:
                 case FN_FRAME_ALIGN_HORZ_LEFT:
                     if ( (eFrmType & FRMTYPE_FLY_INCNT) ||
-                            bProtect ||
-                            (nWhich == FN_FRAME_ALIGN_HORZ_CENTER  || nWhich == SID_OBJECT_ALIGN_CENTER)&& bHtmlMode )
+                         bProtect ||
+                         ((nWhich == FN_FRAME_ALIGN_HORZ_CENTER  || nWhich == SID_OBJECT_ALIGN_CENTER) &&
+                          bHtmlMode ))
                         rSet.DisableItem( nWhich );
                 break;
                 case FN_FRAME_ALIGN_VERT_ROW_TOP:
@@ -721,7 +722,7 @@ void SwFrameShell::GetState(SfxItemSet& rSet)
                 case FN_FRAME_ALIGN_VERT_CHAR_CENTER:
                 case FN_FRAME_ALIGN_VERT_CHAR_BOTTOM:
                     if ( !(eFrmType & FRMTYPE_FLY_INCNT) || bProtect
-                            || bHtmlMode && FN_FRAME_ALIGN_VERT_CHAR_BOTTOM == nWhich )
+                         || (bHtmlMode && FN_FRAME_ALIGN_VERT_CHAR_BOTTOM == nWhich) )
                         rSet.DisableItem( nWhich );
                 break;
 
@@ -732,7 +733,7 @@ void SwFrameShell::GetState(SfxItemSet& rSet)
                 case FN_FRAME_ALIGN_VERT_TOP:
                 case FN_FRAME_ALIGN_VERT_CENTER:
                 case FN_FRAME_ALIGN_VERT_BOTTOM:
-                    if ( bProtect || bHtmlMode && eFrmType & FRMTYPE_FLY_ATCNT)
+                    if ( bProtect || (bHtmlMode && eFrmType & FRMTYPE_FLY_ATCNT))
                         rSet.DisableItem( nWhich );
                     else
                     {
diff --git a/sw/source/ui/uiview/view.cxx b/sw/source/ui/uiview/view.cxx
index aed5998..dfbd703 100644
--- a/sw/source/ui/uiview/view.cxx
+++ b/sw/source/ui/uiview/view.cxx
@@ -1225,8 +1225,8 @@ bool lcl_IsOwnDocument( SwView& rView )
     String Created = xDocProps->getAuthor();
     String Changed = xDocProps->getModifiedBy();
     String FullName = SW_MOD()->GetUserOptions().GetFullName();
-    return FullName.Len() &&
-            (Changed.Len() && Changed == FullName ) ||
+    return (FullName.Len() &&
+            (Changed.Len() && Changed == FullName )) ||
             (!Changed.Len() && Created.Len() && Created == FullName );
 }
 
diff --git a/sw/source/ui/uiview/viewtab.cxx b/sw/source/ui/uiview/viewtab.cxx
index d80233e..132d27f 100644
--- a/sw/source/ui/uiview/viewtab.cxx
+++ b/sw/source/ui/uiview/viewtab.cxx
@@ -529,7 +529,7 @@ void SwView::ExecTabWin( SfxRequest& rReq )
                     aUL.SetLower( (USHORT)aLongULSpace.GetLower() );
                 aDesc.GetMaster().SetFmtAttr( aUL );
 
-                if( bHead && pHeaderFmt || !bHead && pFooterFmt )
+                if( (bHead && pHeaderFmt) || (!bHead && pFooterFmt ))
                 {
                     SwFmtFrmSize aSz( bHead ? pHeaderFmt->GetFrmSize() :
                                               pFooterFmt->GetFrmSize() );
@@ -694,7 +694,7 @@ void SwView::ExecTabWin( SfxRequest& rReq )
         SvxColumnItem aColItem((const SvxColumnItem&)rReq.
                                             GetArgs()->Get(nSlot));
 
-        if( bSetTabColFromDoc || !bSect && rSh.GetTableFmt() )
+        if( bSetTabColFromDoc || (!bSect && rSh.GetTableFmt()))
         {
             ASSERT(aColItem.Count(), "ColDesc ist leer!!");
 
@@ -826,7 +826,7 @@ void SwView::ExecTabWin( SfxRequest& rReq )
         SvxColumnItem aColItem((const SvxColumnItem&)rReq.
                                             GetArgs()->Get(nSlot));
 
-        if( bSetTabColFromDoc || !bSect && rSh.GetTableFmt() )
+        if( bSetTabColFromDoc || (!bSect && rSh.GetTableFmt()) )
         {
             ASSERT(aColItem.Count(), "ColDesc ist leer!!");
 
@@ -1074,13 +1074,13 @@ void SwView::StateTabWin(SfxItemSet& rSet)
             if ( ISA( SwWebView ) ||
                  IsTabColFromDoc() ||
                  IsTabRowFromDoc() ||
-                 ( nSelType & nsSelectionType::SEL_GRF) ||
-                    (nSelType & nsSelectionType::SEL_FRM) ||
-                    (nSelType & nsSelectionType::SEL_OLE) ||
-                    SFX_ITEM_AVAILABLE > aCoreSet.GetItemState(RES_LR_SPACE)||
-                    !bVerticalWriting && (SID_ATTR_TABSTOP_VERTICAL == nWhich)||
-                    bVerticalWriting && (RES_PARATR_TABSTOP == nWhich)
-                 )
+                 ( nSelType & nsSelectionType::SEL_GRF ) ||
+                 ( nSelType & nsSelectionType::SEL_FRM ) ||
+                 ( nSelType & nsSelectionType::SEL_OLE ) ||
+                 ( SFX_ITEM_AVAILABLE > aCoreSet.GetItemState(RES_LR_SPACE) ) ||
+                 (!bVerticalWriting && (SID_ATTR_TABSTOP_VERTICAL == nWhich) ) ||
+                 ( bVerticalWriting && (RES_PARATR_TABSTOP == nWhich))
+               )
                 rSet.DisableItem( nWhich );
             else
             {
@@ -1103,12 +1103,12 @@ void SwView::StateTabWin(SfxItemSet& rSet)
         case SID_ATTR_PARA_LRSPACE:
         {
             if ( nSelType & nsSelectionType::SEL_GRF ||
-                    nSelType & nsSelectionType::SEL_FRM ||
-                    nSelType & nsSelectionType::SEL_OLE ||
-                    nFrmType == FRMTYPE_DRAWOBJ ||
-                    !bVerticalWriting && (SID_ATTR_PARA_LRSPACE_VERTICAL == nWhich)||
-                    bVerticalWriting && (SID_ATTR_PARA_LRSPACE == nWhich)
-                    )
+                 nSelType & nsSelectionType::SEL_FRM ||
+                 nSelType & nsSelectionType::SEL_OLE ||
+                 nFrmType == FRMTYPE_DRAWOBJ ||
+                 (!bVerticalWriting && (SID_ATTR_PARA_LRSPACE_VERTICAL == nWhich)) ||
+                 ( bVerticalWriting && (SID_ATTR_PARA_LRSPACE == nWhich))
+                )
             {
                 rSet.DisableItem(nWhich);
             }
@@ -1282,12 +1282,13 @@ void SwView::StateTabWin(SfxItemSet& rSet)
 
             BOOL bTableVertical = bHasTable && rSh.IsTableVertical();
 
-            if((SID_RULER_BORDERS_VERTICAL == nWhich) &&
-                    ((bHasTable && !bTableVertical)||
-                        (!bVerticalWriting && !bFrmSelection && !bHasTable ) || (bFrmSelection && !bFrameHasVerticalColumns)) ||
-                ((SID_RULER_BORDERS == nWhich) &&
-                    ((bHasTable && bTableVertical)||
-                        (bVerticalWriting && !bFrmSelection&& !bHasTable) || bFrameHasVerticalColumns)))
+            if(((SID_RULER_BORDERS_VERTICAL == nWhich) &&
+                ((bHasTable && !bTableVertical) ||
+                 (!bVerticalWriting && !bFrmSelection && !bHasTable ) ||
+                 ( bFrmSelection && !bFrameHasVerticalColumns))) ||
+               ((SID_RULER_BORDERS == nWhich) &&
+                ((bHasTable && bTableVertical) ||
+                 (bVerticalWriting && !bFrmSelection&& !bHasTable) || bFrameHasVerticalColumns)))
                 rSet.DisableItem(nWhich);
             else if ( bHasTable )
             {
@@ -1501,10 +1502,10 @@ void SwView::StateTabWin(SfxItemSet& rSet)
             BOOL bFrameRTL;
             BOOL bFrameHasVerticalColumns =  rSh.IsFrmVertical(FALSE, bFrameRTL) && bFrmSelection;
 
-            if((SID_RULER_ROWS == nWhich) &&
-                    ((!bVerticalWriting && !bFrmSelection) || (bFrmSelection && !bFrameHasVerticalColumns)) ||
-                ((SID_RULER_ROWS_VERTICAL == nWhich) &&
-                    ((bVerticalWriting && !bFrmSelection) || bFrameHasVerticalColumns)))
+            if(((SID_RULER_ROWS == nWhich) &&
+                ((!bVerticalWriting && !bFrmSelection) || (bFrmSelection && !bFrameHasVerticalColumns))) ||
+               ((SID_RULER_ROWS_VERTICAL == nWhich) &&
+                ((bVerticalWriting && !bFrmSelection) || bFrameHasVerticalColumns)))
                 rSet.DisableItem(nWhich);
             else if ( IsTabRowFromDoc() ||
                     ( rSh.GetTableFmt() && !bFrmSelection &&


More information about the Libreoffice-commits mailing list