diff options
author | Matteo Casalin <matteo.casalin@yahoo.com> | 2014-11-10 01:08:39 +0100 |
---|---|---|
committer | Matteo Casalin <matteo.casalin@yahoo.com> | 2014-11-16 16:54:42 +0100 |
commit | 93193e23750c2739f4e929cb28149509d97a4d8b (patch) | |
tree | b1b35355c2f51fd6abacb54300ed40c509a8c7cf /sw/source/uibase | |
parent | f2eb1eabd5d8e107eb2e6b65d7eec2ff6cbb906f (diff) |
sw: convert 'a ? b : sal_False' to 'a && b'
Change-Id: I4b7829a1abe1459f2e4915159588fd3e16a14eea
Diffstat (limited to 'sw/source/uibase')
-rw-r--r-- | sw/source/uibase/config/modcfg.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/config/usrpref.cxx | 4 | ||||
-rw-r--r-- | sw/source/uibase/dochdl/gloshdl.cxx | 4 | ||||
-rw-r--r-- | sw/source/uibase/fldui/fldmgr.cxx | 4 | ||||
-rw-r--r-- | sw/source/uibase/lingu/hyp.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/uiview/viewling.cxx | 4 | ||||
-rw-r--r-- | sw/source/uibase/uiview/viewprt.cxx | 4 | ||||
-rw-r--r-- | sw/source/uibase/uno/unomod.cxx | 3 | ||||
-rw-r--r-- | sw/source/uibase/uno/unotxdoc.cxx | 2 |
9 files changed, 13 insertions, 16 deletions
diff --git a/sw/source/uibase/config/modcfg.cxx b/sw/source/uibase/config/modcfg.cxx index 5bd15b35d1bb..9313aa9582bd 100644 --- a/sw/source/uibase/config/modcfg.cxx +++ b/sw/source/uibase/config/modcfg.cxx @@ -916,7 +916,7 @@ void SwInsertConfig::Load() { if(pValues[nProp].hasValue()) { - bool bBool = nProp < INS_PROP_CAP_OBJECT_TABLE_ENABLE ? *(sal_Bool*)pValues[nProp].getValue() : sal_False; + bool bBool = nProp < INS_PROP_CAP_OBJECT_TABLE_ENABLE && *(sal_Bool*)pValues[nProp].getValue(); switch(nProp) { case INS_PROP_TABLE_HEADER: diff --git a/sw/source/uibase/config/usrpref.cxx b/sw/source/uibase/config/usrpref.cxx index fb8010a1f821..88aa1f3df64a 100644 --- a/sw/source/uibase/config/usrpref.cxx +++ b/sw/source/uibase/config/usrpref.cxx @@ -177,7 +177,7 @@ void SwContentViewConfig::Load() { if(pValues[nProp].hasValue()) { - bool bSet = nProp != 16 ? *(sal_Bool*)pValues[nProp].getValue() : sal_False; + bool bSet = nProp != 16 && *(sal_Bool*)pValues[nProp].getValue(); switch(nProp) { case 0: rParent.SetGraphic(bSet); break;// "Display/GraphicObject", @@ -433,7 +433,7 @@ void SwGridConfig::Load() { if(pValues[nProp].hasValue()) { - bool bSet = nProp < 3 ? *(sal_Bool*)pValues[nProp].getValue() : sal_False; + bool bSet = nProp < 3 && *(sal_Bool*)pValues[nProp].getValue(); sal_Int32 nSet = 0; if(nProp >= 3) pValues[nProp] >>= nSet; diff --git a/sw/source/uibase/dochdl/gloshdl.cxx b/sw/source/uibase/dochdl/gloshdl.cxx index 4e62f0a17c33..995584f2acb2 100644 --- a/sw/source/uibase/dochdl/gloshdl.cxx +++ b/sw/source/uibase/dochdl/gloshdl.cxx @@ -393,7 +393,7 @@ bool SwGlossaryHdl::ExpandGlossary() if(pWrtShell->IsSelection()) aShortName = pWrtShell->GetSelTxt(); } - return pGlossary ? Expand( aShortName, &rStatGlossaries, pGlossary ) : sal_False; + return pGlossary && Expand( aShortName, &rStatGlossaries, pGlossary ); } bool SwGlossaryHdl::Expand( const OUString& rShortName, @@ -693,7 +693,7 @@ bool SwGlossaryHdl::IsOld() const { SwTextBlocks *pGlossary = pCurGrp ? pCurGrp : rStatGlossaries.GetGroupDoc(aCurGrp); - bool bRet = pGlossary ? pGlossary->IsOld() : sal_False; + bool bRet = pGlossary && pGlossary->IsOld(); if( !pCurGrp ) delete pGlossary; return bRet; diff --git a/sw/source/uibase/fldui/fldmgr.cxx b/sw/source/uibase/fldui/fldmgr.cxx index def26f114f9d..887fb91fe033 100644 --- a/sw/source/uibase/fldui/fldmgr.cxx +++ b/sw/source/uibase/fldui/fldmgr.cxx @@ -733,9 +733,7 @@ bool SwFldMgr::GoNextPrev( bool bNext, SwFieldType* pTyp ) return pSh->MoveFldType( 0, bNext, RES_DBFLD ); } - return (pTyp && pSh) - ? pSh->MoveFldType( pTyp, bNext ) - : sal_False; + return pTyp && pSh && pSh->MoveFldType( pTyp, bNext ); } // insert field types diff --git a/sw/source/uibase/lingu/hyp.cxx b/sw/source/uibase/lingu/hyp.cxx index a683fdbc4c6e..1f1e2ffaf298 100644 --- a/sw/source/uibase/lingu/hyp.cxx +++ b/sw/source/uibase/lingu/hyp.cxx @@ -54,7 +54,7 @@ SwHyphWrapper::SwHyphWrapper( SwView* pVw, bInfoBox( false ) { uno::Reference< linguistic2::XLinguProperties > xProp( GetLinguPropertySet() ); - bAutomatic = xProp.is() ? xProp->getIsHyphAuto() : sal_False; + bAutomatic = xProp.is() && xProp->getIsHyphAuto(); SetHyphen(); } diff --git a/sw/source/uibase/uiview/viewling.cxx b/sw/source/uibase/uiview/viewling.cxx index 68ff90b860c3..8a880767c819 100644 --- a/sw/source/uibase/uiview/viewling.cxx +++ b/sw/source/uibase/uiview/viewling.cxx @@ -269,7 +269,7 @@ void SwView::SpellStart( SvxSpellArea eWhich, SwConversionArgs *pConvArgs ) { Reference< XLinguProperties > xProp = ::GetLinguPropertySet(); - bool bIsWrapReverse = (!pConvArgs && xProp.is()) ? xProp->getIsWrapReverse() : sal_False; + bool bIsWrapReverse = !pConvArgs && xProp.is() && xProp->getIsWrapReverse(); SwDocPositions eStart = DOCPOS_START; SwDocPositions eEnde = DOCPOS_END; @@ -449,7 +449,7 @@ void SwView::HyphenateDocument() m_pWrtShell->StartUndo(UNDO_INSATTR); // valid later - bool bHyphSpecial = xProp.is() ? xProp->getIsHyphSpecial() : sal_False; + bool bHyphSpecial = xProp.is() && xProp->getIsHyphSpecial(); bool bSelection = ((SwCrsrShell*)m_pWrtShell)->HasSelection() || m_pWrtShell->GetCrsr() != m_pWrtShell->GetCrsr()->GetNext(); bool bOther = m_pWrtShell->HasOtherCnt() && bHyphSpecial && !bSelection; diff --git a/sw/source/uibase/uiview/viewprt.cxx b/sw/source/uibase/uiview/viewprt.cxx index 3d64f8b8b834..59f18ac037c4 100644 --- a/sw/source/uibase/uiview/viewprt.cxx +++ b/sw/source/uibase/uiview/viewprt.cxx @@ -191,11 +191,11 @@ void SwView::ExecutePrint(SfxRequest& rReq) { SwWrtShell* pSh = &GetWrtShell(); SFX_REQUEST_ARG(rReq, pSilentItem, SfxBoolItem, SID_SILENT, false); - bool bSilent = pSilentItem ? pSilentItem->GetValue() : sal_False; + bool bSilent = pSilentItem && pSilentItem->GetValue(); SFX_REQUEST_ARG(rReq, pPrintFromMergeItem, SfxBoolItem, FN_QRY_MERGE, false); if(pPrintFromMergeItem) rReq.RemoveItem(FN_QRY_MERGE); - bool bFromMerge = pPrintFromMergeItem ? pPrintFromMergeItem->GetValue() : sal_False; + bool bFromMerge = pPrintFromMergeItem && pPrintFromMergeItem->GetValue(); SwMiscConfig aMiscConfig; bool bPrintSelection = false; if(!bSilent && !bFromMerge && diff --git a/sw/source/uibase/uno/unomod.cxx b/sw/source/uibase/uno/unomod.cxx index 2614c3574d6b..4ab522c0b35f 100644 --- a/sw/source/uibase/uno/unomod.cxx +++ b/sw/source/uibase/uno/unomod.cxx @@ -608,8 +608,7 @@ void SwXViewSettings::_setSingleValue( const comphelper::PropertyInfo & rInfo, c IllegalArgumentException, WrappedTargetException, RuntimeException) { - bool bVal = HANDLE_VIEWSET_ZOOM != rInfo.mnHandle ? - *(sal_Bool*)rValue.getValue() : sal_False; + bool bVal = HANDLE_VIEWSET_ZOOM != rInfo.mnHandle && *(sal_Bool*)rValue.getValue(); // the API flag should not be set to the application's view settings switch( rInfo.mnHandle ) { diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx index 3cb41d5e6765..f2585c088b18 100644 --- a/sw/source/uibase/uno/unotxdoc.cxx +++ b/sw/source/uibase/uno/unotxdoc.cxx @@ -3989,7 +3989,7 @@ SwViewOptionAdjust_Impl::AdjustViewOptions(SwPrintData const*const pPrtOptions) aRenderViewOptions.SetLineBreak( false ); // breaks (type 1) aRenderViewOptions.SetPageBreak( false ); // breaks (type 2) aRenderViewOptions.SetColumnBreak( false ); // breaks (type 3) - bool bVal = pPrtOptions? pPrtOptions->bPrintHiddenText : sal_False; + bool bVal = pPrtOptions && pPrtOptions->bPrintHiddenText; if (bContainsHiddenChars) aRenderViewOptions.SetShowHiddenChar( bVal ); // hidden text if (bContainsHiddenFields) |