[Libreoffice] [PATCH 2/2] remove 'precedence' warning in sw

nthiebaud at gmail.com nthiebaud at gmail.com
Thu Sep 30 01:25:55 PDT 2010


---
 sw/source/core/doc/docfld.cxx     |   12 ++++++------
 sw/source/core/doc/tblrwcl.cxx    |   16 ++++++++--------
 sw/source/core/table/swtable.cxx  |    2 +-
 sw/source/core/unocore/unotbl.cxx |   26 +++++++++++++-------------
 sw/source/ui/fldui/fldmgr.cxx     |    4 ++--
 sw/source/ui/shells/tabsh.cxx     |   16 ++++++++--------
 sw/source/ui/shells/textsh1.cxx   |    4 ++--
 7 files changed, 40 insertions(+), 40 deletions(-)

diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx
index 9d907b9..63b2f57 100644
--- a/sw/source/core/doc/docfld.cxx
+++ b/sw/source/core/doc/docfld.cxx
@@ -2464,9 +2464,9 @@ void SwDocUpdtFld::_MakeFldList( SwDoc& rDoc, int eGetMode )
             {
                 SwDBData aDBData(((SwDBNumSetField*)pFld)->GetDBData(&rDoc));
 
-                if( bIsDBMgr &&
-                    rDoc.GetNewDBMgr()->OpenDataSource( aDBData.sDataSource, aDBData.sCommand )&&
-                    GETFLD_ALL == eGetMode ||
+                if( (bIsDBMgr &&
+                     rDoc.GetNewDBMgr()->OpenDataSource( aDBData.sDataSource, aDBData.sCommand ) &&
+                     GETFLD_ALL == eGetMode) ||
                     ( GETFLD_CALC & eGetMode &&
                         ((SwDBNumSetField*)pFld)->IsCondValid()))
                     pFormel = &pFld->GetPar1();
@@ -2476,9 +2476,9 @@ void SwDocUpdtFld::_MakeFldList( SwDoc& rDoc, int eGetMode )
             {
                 SwDBData aDBData(((SwDBNextSetField*)pFld)->GetDBData(&rDoc));
 
-                if( bIsDBMgr &&
-                    rDoc.GetNewDBMgr()->OpenDataSource( aDBData.sDataSource, aDBData.sCommand )&&
-                    GETFLD_ALL == eGetMode ||
+                if( (bIsDBMgr &&
+                     rDoc.GetNewDBMgr()->OpenDataSource( aDBData.sDataSource, aDBData.sCommand ) &&
+                     GETFLD_ALL == eGetMode) ||
                     ( GETFLD_CALC & eGetMode &&
                         ((SwDBNextSetField*)pFld)->IsCondValid() ))
                     pFormel = &pFld->GetPar1();
diff --git a/sw/source/core/doc/tblrwcl.cxx b/sw/source/core/doc/tblrwcl.cxx
index 5d93e03..a443835 100644
--- a/sw/source/core/doc/tblrwcl.cxx
+++ b/sw/source/core/doc/tblrwcl.cxx
@@ -2924,10 +2924,10 @@ BOOL lcl_InsOtherBox( SwTableLine* pLine, CR_SetBoxWidth& rParam,
             if(
                 rParam.bLeft ? ((nDist + nWidth / 2 ) <= rParam.nSide &&
                                 (TBLFIX_CHGABS != rParam.nMode ||
-                                n < rBoxes.Count() &&
-                                (nDist + nWidth + rBoxes[ n+1 ]->
-                                    GetFrmFmt()->GetFrmSize().GetWidth() / 2)
-                                  > rParam.nSide ))
+                                 (n < rBoxes.Count() &&
+                                  (nDist + nWidth + rBoxes[ n+1 ]->
+                                   GetFrmFmt()->GetFrmSize().GetWidth() / 2)
+                                  > rParam.nSide )))
                              : (nDist + nWidth / 2 ) > rParam.nSide
                 )
             {
@@ -2989,10 +2989,10 @@ BOOL lcl_InsOtherBox( SwTableLine* pLine, CR_SetBoxWidth& rParam,
             if( nLowerDiff ||
                 (rParam.bLeft ? ((nDist + nWidth / 2 ) <= rParam.nSide &&
                                 (TBLFIX_CHGABS != rParam.nMode ||
-                                n < rBoxes.Count() &&
-                                (nDist + nWidth + rBoxes[ n+1 ]->
-                                    GetFrmFmt()->GetFrmSize().GetWidth() / 2)
-                                  > rParam.nSide ))
+                                 (n < rBoxes.Count() &&
+                                  (nDist + nWidth + rBoxes[ n+1 ]->
+                                   GetFrmFmt()->GetFrmSize().GetWidth() / 2)
+                                  > rParam.nSide )))
                               : (nDist + nWidth / 2 ) > rParam.nSide ))
             {
                 if( !nLowerDiff )
diff --git a/sw/source/core/table/swtable.cxx b/sw/source/core/table/swtable.cxx
index 9144738..2ede651 100644
--- a/sw/source/core/table/swtable.cxx
+++ b/sw/source/core/table/swtable.cxx
@@ -2410,7 +2410,7 @@ void SwTableBoxFmt::Modify( SfxPoolItem* pOld, SfxPoolItem* pNew )
                     BOOL bNewIsTxtFmt = pNumFmtr->IsTextFormat( nNewFmt ) ||
                                         NUMBERFORMAT_TEXT == nNewFmt;
 
-                    if( !bNewIsTxtFmt && nOldFmt != nNewFmt || pNewFml )
+                    if( (!bNewIsTxtFmt && nOldFmt != nNewFmt) || pNewFml )
                     {
                         BOOL bChgTxt = TRUE;
                         double fVal = 0;
diff --git a/sw/source/core/unocore/unotbl.cxx b/sw/source/core/unocore/unotbl.cxx
index 9dd21a4..0959cec 100644
--- a/sw/source/core/unocore/unotbl.cxx
+++ b/sw/source/core/unocore/unotbl.cxx
@@ -700,7 +700,7 @@ void lcl_SetTblSeparators(const uno::Any& rVal, SwTable* pTable, SwTableBox* pBo
         {
             aCols[i] = pArray[i].Position;
             if(pArray[i].IsVisible == aCols.IsHidden(i) ||
-                !bRow && aCols.IsHidden(i) ||
+               (!bRow && aCols.IsHidden(i)) ||
                 long(aCols[i] - long(nLastValue)) < 0 ||
                 UNO_TABLE_COLUMN_SUM < aCols[i] )
             {
@@ -3415,7 +3415,7 @@ void SwXTextTable::setPropertyValue(const OUString& rPropertyName,
                 }
                 break;
                 case FN_UNO_TABLE_BORDER_DISTANCES:
-                {    
+                {
                     table::TableBorderDistances aTableBorderDistances;
                     if( !(aValue >>= aTableBorderDistances) ||
                         (!aTableBorderDistances.IsLeftDistanceValid &&
@@ -3441,15 +3441,15 @@ void SwXTextTable::setPropertyValue(const OUString& rPropertyName,
                             SwTableBox* pBox = rBoxes.GetObject(k);
                             const SwFrmFmt* pBoxFmt = pBox->GetFrmFmt();
                             const SvxBoxItem& rBox = pBoxFmt->GetBox();
-                            if( 
-                                aTableBorderDistances.IsLeftDistanceValid && nLeftDistance !=   rBox.GetDistance( BOX_LINE_LEFT ) ||
-                                aTableBorderDistances.IsRightDistanceValid && nRightDistance !=  rBox.GetDistance( BOX_LINE_RIGHT ) ||
-                                aTableBorderDistances.IsTopDistanceValid && nTopDistance !=    rBox.GetDistance( BOX_LINE_TOP ) ||
-                                aTableBorderDistances.IsBottomDistanceValid && nBottomDistance != rBox.GetDistance( BOX_LINE_BOTTOM ))
+                            if(
+                                (aTableBorderDistances.IsLeftDistanceValid && nLeftDistance != rBox.GetDistance( BOX_LINE_LEFT )) ||
+                                (aTableBorderDistances.IsRightDistanceValid && nRightDistance != rBox.GetDistance( BOX_LINE_RIGHT )) ||
+                                (aTableBorderDistances.IsTopDistanceValid && nTopDistance != rBox.GetDistance( BOX_LINE_TOP )) ||
+                                (aTableBorderDistances.IsBottomDistanceValid && nBottomDistance != rBox.GetDistance( BOX_LINE_BOTTOM )))
                             {
                                 SvxBoxItem aSetBox( rBox );
                                 SwFrmFmt* pSetBoxFmt = pBox->ClaimFrmFmt();
-                                if( aTableBorderDistances.IsLeftDistanceValid ) 
+                                if( aTableBorderDistances.IsLeftDistanceValid )
                                     aSetBox.SetDistance( nLeftDistance, BOX_LINE_LEFT );
                                 if( aTableBorderDistances.IsRightDistanceValid )
                                     aSetBox.SetDistance( nRightDistance, BOX_LINE_RIGHT );
@@ -3458,7 +3458,7 @@ void SwXTextTable::setPropertyValue(const OUString& rPropertyName,
                                 if( aTableBorderDistances.IsBottomDistanceValid )
                                     aSetBox.SetDistance( nBottomDistance, BOX_LINE_BOTTOM );
                                 pDoc->SetAttr( aSetBox, *pSetBoxFmt );
-                            }    
+                            }
                         }
                     }
                     pDoc->EndUndo(UNDO_END, NULL);
@@ -3758,10 +3758,10 @@ void SwXTextTable::setName(const OUString& rName) throw( uno::RuntimeException )
     vos::OGuard aGuard(Application::GetSolarMutex());
     SwFrmFmt* pFmt = GetFrmFmt();
     String sNewTblName(rName);
-    if(!pFmt && !bIsDescriptor ||
-        !sNewTblName.Len() ||
-            STRING_NOTFOUND != sNewTblName.Search('.') ||
-                STRING_NOTFOUND != sNewTblName.Search(' ')  )
+    if((!pFmt && !bIsDescriptor) ||
+       !sNewTblName.Len() ||
+       STRING_NOTFOUND != sNewTblName.Search('.') ||
+       STRING_NOTFOUND != sNewTblName.Search(' ')  )
         throw uno::RuntimeException();
 
     if(pFmt)
diff --git a/sw/source/ui/fldui/fldmgr.cxx b/sw/source/ui/fldui/fldmgr.cxx
index 4e707ce..df88ca4 100644
--- a/sw/source/ui/fldui/fldmgr.cxx
+++ b/sw/source/ui/fldui/fldmgr.cxx
@@ -561,8 +561,8 @@ BOOL SwFldMgr::GetSubTypes(USHORT nTypeId, SvStringsDtor& rToFill)
 
                        ((nTypeId == TYP_INPUTFLD  || nTypeId == TYP_FORMELFLD) &&
                          (nWhich == RES_USERFLD ||
-                          nWhich == RES_SETEXPFLD &&
-                          !(((SwSetExpFieldType*)pFldType)->GetType() & nsSwGetSetExpType::GSE_SEQ)) ) )
+                          (nWhich == RES_SETEXPFLD &&
+                           !(((SwSetExpFieldType*)pFldType)->GetType() & nsSwGetSetExpType::GSE_SEQ)) )) )
                     {
                         String* pNew = new String(pFldType->GetName());
                         rToFill.Insert(pNew, rToFill.Count());
diff --git a/sw/source/ui/shells/tabsh.cxx b/sw/source/ui/shells/tabsh.cxx
index 3e17c83..3c22e8a 100644
--- a/sw/source/ui/shells/tabsh.cxx
+++ b/sw/source/ui/shells/tabsh.cxx
@@ -220,7 +220,7 @@ static SwTableRep*  lcl_TableParamToItemSet( SfxItemSet& rSet, SwWrtShell &rSh )
 
         // Tabellenvariante, wenn mehrere Tabellenzellen selektiert
     rSh.GetCrsr();					//Damit GetCrsrCnt() auch das Richtige liefert
-    aBoxInfo.SetTable          (rSh.IsTableMode() && rSh.GetCrsrCnt() > 1 ||
+    aBoxInfo.SetTable          ((rSh.IsTableMode() && rSh.GetCrsrCnt() > 1) ||
                                     !bTableSel);
         // Abstandsfeld immer anzeigen
     aBoxInfo.SetDist           ((BOOL) TRUE);
@@ -663,7 +663,7 @@ void SwTableShell::Execute(SfxRequest &rReq)
             else
                 aCoreSet.InvalidateItem( RES_BACKGROUND );
 
-            if ( !pDlg && rReq.GetArgs() || pDlg->Execute() == RET_OK )
+            if ( (!pDlg && rReq.GetArgs()) || pDlg->Execute() == RET_OK )
             {
                 const SfxItemSet* pOutSet = pDlg ? pDlg->GetOutputItemSet() : rReq.GetArgs();
                 if ( pDlg )
@@ -1329,9 +1329,9 @@ void SwTableShell::GetState(SfxItemSet &rSet)
             case FN_TABLE_VERT_BOTTOM:
             {
                 USHORT nAlign = rSh.GetBoxAlign();
-                BOOL bSet = nSlot == FN_TABLE_VERT_NONE && nAlign == text::VertOrientation::NONE||
-                            nSlot == FN_TABLE_VERT_CENTER && nAlign == text::VertOrientation::CENTER ||
-                            nSlot == FN_TABLE_VERT_BOTTOM && nAlign == text::VertOrientation::BOTTOM;
+                BOOL bSet = (nSlot == FN_TABLE_VERT_NONE && nAlign == text::VertOrientation::NONE) ||
+                            (nSlot == FN_TABLE_VERT_CENTER && nAlign == text::VertOrientation::CENTER) ||
+                            (nSlot == FN_TABLE_VERT_BOTTOM && nAlign == text::VertOrientation::BOTTOM);
                 rSet.Put(SfxBoolItem(nSlot, bSet));
             }
             break;
@@ -1341,9 +1341,9 @@ void SwTableShell::GetState(SfxItemSet &rSet)
             case FN_TABLE_MODE_VARIABLE	 :
                 {
                     TblChgMode nMode = rSh.GetTblChgMode();
-                    BOOL bSet = nSlot == FN_TABLE_MODE_FIX && nMode == TBLFIX_CHGABS ||
-                            nSlot == FN_TABLE_MODE_FIX_PROP && nMode == TBLFIX_CHGPROP ||
-                            nSlot == FN_TABLE_MODE_VARIABLE && nMode == TBLVAR_CHGABS;
+                    BOOL bSet = (nSlot == FN_TABLE_MODE_FIX && nMode == TBLFIX_CHGABS) ||
+                                (nSlot == FN_TABLE_MODE_FIX_PROP && nMode == TBLFIX_CHGPROP) ||
+                                (nSlot == FN_TABLE_MODE_VARIABLE && nMode == TBLVAR_CHGABS);
                     rSet.Put(SfxBoolItem(nSlot, bSet));
                 }
             break;
diff --git a/sw/source/ui/shells/textsh1.cxx b/sw/source/ui/shells/textsh1.cxx
index f41d28c..129f59c 100644
--- a/sw/source/ui/shells/textsh1.cxx
+++ b/sw/source/ui/shells/textsh1.cxx
@@ -1758,8 +1758,8 @@ void SwTextShell::ChangeHeaderOrFooter(
         if( !rStyleName.Len() || rStyleName == sTmp )
         {
             if( bShowWarning && !bOn && GetActiveView() && GetActiveView() == &GetView() &&
-                    (bHeader && aDesc.GetMaster().GetHeader().IsActive() ||
-                        !bHeader && aDesc.GetMaster().GetFooter().IsActive()))
+                (bHeader && aDesc.GetMaster().GetHeader().IsActive()) ||
+                (!bHeader && aDesc.GetMaster().GetFooter().IsActive()))
             {
                 bShowWarning = FALSE;
                 //Actions have to be closed while the dialog is showing
-- 
1.7.1



More information about the LibreOffice mailing list