summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMuhammet Kara <muhammet.kara@pardus.org.tr>2016-05-30 17:20:50 +0300
committerCaolán McNamara <caolanm@redhat.com>2016-07-05 09:35:40 +0000
commitb6b34d538398f8214daa5b160f764dc8b82ff9c5 (patch)
tree9ffb350c9cbd293618fab09efcff6c8ad06151b3 /sw
parent4ed2a7305f80192bdbe2eace48c4ee65e9938f7d (diff)
Clarify calculation precedence tdf#39440
Use parentheses to clarify the code. Change-Id: I864dc6dacadb5b9ba9dca8e0abd9fa4e6db1eddc Reviewed-on: https://gerrit.libreoffice.org/25677 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: jan iversen <jani@documentfoundation.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/doc/DocumentStylePoolManager.cxx2
-rw-r--r--sw/source/filter/ww8/ww8atr.cxx2
-rw-r--r--sw/source/ui/dbui/dbinsdlg.cxx2
-rw-r--r--sw/source/uibase/app/docstyle.cxx4
-rw-r--r--sw/source/uibase/docvw/edtwin.cxx2
-rw-r--r--sw/source/uibase/uiview/viewdlg2.cxx8
-rw-r--r--sw/source/uibase/uiview/viewtab.cxx2
7 files changed, 11 insertions, 11 deletions
diff --git a/sw/source/core/doc/DocumentStylePoolManager.cxx b/sw/source/core/doc/DocumentStylePoolManager.cxx
index 1845f86d6e3a..8bda2586c9ac 100644
--- a/sw/source/core/doc/DocumentStylePoolManager.cxx
+++ b/sw/source/core/doc/DocumentStylePoolManager.cxx
@@ -1992,7 +1992,7 @@ SwNumRule* DocumentStylePoolManager::GetNumRuleFromPool( sal_uInt16 nId )
for (sal_uInt16 n = 0; n < MAXLEVEL; ++n)
{
- aFormat.SetBulletChar( ( n & 1 ? 0x25a1 : 0x2611 ) );
+ aFormat.SetBulletChar( ( (n & 1) ? 0x25a1 : 0x2611 ) );
if ( eNumberFormatPositionAndSpaceMode == SvxNumberFormat::LABEL_WIDTH_AND_POSITION )
{
diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx
index 7efb44de269d..c6290b70c3bd 100644
--- a/sw/source/filter/ww8/ww8atr.cxx
+++ b/sw/source/filter/ww8/ww8atr.cxx
@@ -2545,7 +2545,7 @@ void AttributeOutputBase::TextField( const SwFormatField& rField )
case RES_AUTHORFLD:
{
ww::eField eField =
- (AF_SHORTCUT & pField->GetFormat() ? ww::eUSERINITIALS : ww::eUSERNAME);
+ ((AF_SHORTCUT & pField->GetFormat()) ? ww::eUSERINITIALS : ww::eUSERNAME);
GetExport().OutputField(pField, eField, FieldString(eField));
}
break;
diff --git a/sw/source/ui/dbui/dbinsdlg.cxx b/sw/source/ui/dbui/dbinsdlg.cxx
index 049f2f90cc7e..a75a08b1f4b5 100644
--- a/sw/source/ui/dbui/dbinsdlg.cxx
+++ b/sw/source/ui/dbui/dbinsdlg.cxx
@@ -715,7 +715,7 @@ IMPL_LINK_TYPED( SwInsertDBColAutoPilot, TableFormatHdl, Button*, pButton, void
}
else
nWidth = rSh.GetAnyCurRect(
- FrameTypeFlags::FLY_ANY & rSh.GetFrameType( nullptr, true )
+ (FrameTypeFlags::FLY_ANY & rSh.GetFrameType( nullptr, true ))
? RECT_FLY_PRT_EMBEDDED
: RECT_PAGE_PRT ).Width();
diff --git a/sw/source/uibase/app/docstyle.cxx b/sw/source/uibase/app/docstyle.cxx
index 11f7e957c564..33b78477fd3f 100644
--- a/sw/source/uibase/app/docstyle.cxx
+++ b/sw/source/uibase/app/docstyle.cxx
@@ -1949,7 +1949,7 @@ bool SwDocStyleSheet::FillStyleSheet(
}
else if( !bCreate )
nPoolId = SwStyleNameMapper::GetPoolIdFromUIName( aName, nsSwGetPoolIdFromName::GET_POOLID_PAGEDESC );
- SetMask( USER_FMT & nPoolId ? SFXSTYLEBIT_USERDEF : 0 );
+ SetMask( (USER_FMT & nPoolId) ? SFXSTYLEBIT_USERDEF : 0 );
bRet = nullptr != pDesc || USHRT_MAX != nPoolId;
if( bDeleteInfo )
@@ -1978,7 +1978,7 @@ bool SwDocStyleSheet::FillStyleSheet(
}
else if( !bCreate )
nPoolId = SwStyleNameMapper::GetPoolIdFromUIName( aName, nsSwGetPoolIdFromName::GET_POOLID_NUMRULE );
- SetMask( USER_FMT & nPoolId ? SFXSTYLEBIT_USERDEF : 0 );
+ SetMask( (USER_FMT & nPoolId) ? SFXSTYLEBIT_USERDEF : 0 );
bRet = nullptr != pNumRule || USHRT_MAX != nPoolId;
diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx
index fedbd8bed1e1..1631ffac5110 100644
--- a/sw/source/uibase/docvw/edtwin.cxx
+++ b/sw/source/uibase/docvw/edtwin.cxx
@@ -2242,7 +2242,7 @@ KEYINPUT_CHECKTABLE_INSDEL:
nsSelectionType::SEL_DRW_FORM))
{
- eKeyState = rKeyCode.GetModifier() & KEY_SHIFT ?
+ eKeyState = (rKeyCode.GetModifier() & KEY_SHIFT) ?
KS_PrevObject : KS_NextObject;
}
else if ( !rSh.IsMultiSelection() && rSh.CursorInsideInputField() )
diff --git a/sw/source/uibase/uiview/viewdlg2.cxx b/sw/source/uibase/uiview/viewdlg2.cxx
index 4a0273185357..e1797bb7e832 100644
--- a/sw/source/uibase/uiview/viewdlg2.cxx
+++ b/sw/source/uibase/uiview/viewdlg2.cxx
@@ -118,10 +118,10 @@ void SwView::InsertCaption(const InsCaptionOpt *pOpt)
if (eType & nsSelectionType::SEL_OLE)
eType = nsSelectionType::SEL_GRF;
- const SwLabelType eT = eType & nsSelectionType::SEL_TBL ? LTYPE_TABLE :
- eType & nsSelectionType::SEL_FRM ? LTYPE_FLY :
- eType == nsSelectionType::SEL_TXT ? LTYPE_FLY :
- eType & nsSelectionType::SEL_DRW ? LTYPE_DRAW :
+ const SwLabelType eT = (eType & nsSelectionType::SEL_TBL) ? LTYPE_TABLE :
+ (eType & nsSelectionType::SEL_FRM) ? LTYPE_FLY :
+ (eType == nsSelectionType::SEL_TXT) ? LTYPE_FLY :
+ (eType & nsSelectionType::SEL_DRW) ? LTYPE_DRAW :
LTYPE_OBJECT;
SwFieldMgr aMgr(&rSh);
diff --git a/sw/source/uibase/uiview/viewtab.cxx b/sw/source/uibase/uiview/viewtab.cxx
index 6f50300ac3a6..25a848c733d4 100644
--- a/sw/source/uibase/uiview/viewtab.cxx
+++ b/sw/source/uibase/uiview/viewtab.cxx
@@ -1271,7 +1271,7 @@ void SwView::StateTabWin(SfxItemSet& rSet)
if ( ( nFrameType & FrameTypeFlags::HEADER || nFrameType & FrameTypeFlags::FOOTER ) &&
!(nFrameType & FrameTypeFlags::COLSECT) )
{
- SwFrameFormat *pFormat = const_cast<SwFrameFormat*>(nFrameType & FrameTypeFlags::HEADER ?
+ SwFrameFormat *pFormat = const_cast<SwFrameFormat*>((nFrameType & FrameTypeFlags::HEADER) ?
rDesc.GetMaster().GetHeader().GetHeaderFormat() :
rDesc.GetMaster().GetFooter().GetFooterFormat());
if( pFormat )// #i80890# if rDesc is not the one belonging to the current page is might crash