diff options
author | Matteo Casalin <matteo.casalin@yahoo.com> | 2014-11-12 09:05:53 +0100 |
---|---|---|
committer | Matteo Casalin <matteo.casalin@yahoo.com> | 2014-11-16 16:54:42 +0100 |
commit | f65dea36d2778b7f626ac8b07cd057110a5c3a4b (patch) | |
tree | 3b88477a134b90ec1b7717069fc8c127bb63f71d | |
parent | 195fd6b5e3cfbf5359ea58663ae7c97f78ac4592 (diff) |
sw: convert 'a ? b : sal_True' to '!a || b'
Change-Id: I7177521a9bf9c845216e2b6c91d20df93b137987
-rw-r--r-- | sw/source/core/undo/undel.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/dochdl/gloshdl.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/uiview/view2.cxx | 4 | ||||
-rw-r--r-- | sw/source/uibase/uno/unotxdoc.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/uno/unotxvw.cxx | 6 | ||||
-rw-r--r-- | sw/source/uibase/utlui/content.cxx | 2 |
6 files changed, 9 insertions, 9 deletions
diff --git a/sw/source/core/undo/undel.cxx b/sw/source/core/undo/undel.cxx index f39361e35723..b486ad82b7ac 100644 --- a/sw/source/core/undo/undel.cxx +++ b/sw/source/core/undo/undel.cxx @@ -436,7 +436,7 @@ bool SwUndoDelete::SaveCntnt( const SwPosition* pStt, const SwPosition* pEnd, bool SwUndoDelete::CanGrouping( SwDoc* pDoc, const SwPaM& rDelPam ) { // Is Undo greater than one Node (that is Start and EndString)? - if( pSttStr ? pSttStr->isEmpty() || pEndStr : sal_True ) + if( !pSttStr || pSttStr->isEmpty() || pEndStr ) return false; // only the deletion of single char's can be condensed diff --git a/sw/source/uibase/dochdl/gloshdl.cxx b/sw/source/uibase/dochdl/gloshdl.cxx index 995584f2acb2..7904405ab102 100644 --- a/sw/source/uibase/dochdl/gloshdl.cxx +++ b/sw/source/uibase/dochdl/gloshdl.cxx @@ -683,7 +683,7 @@ bool SwGlossaryHdl::IsReadOnly( const OUString* pGrpNm ) const else pGlossary = rStatGlossaries.GetGroupDoc(aCurGrp); - bool bRet = pGlossary ? pGlossary->IsReadOnly() : sal_True; + const bool bRet = !pGlossary || pGlossary->IsReadOnly(); if( pGrpNm || !pCurGrp ) delete pGlossary; return bRet; diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx index e9591742b575..3bd1eeb94321 100644 --- a/sw/source/uibase/uiview/view2.cxx +++ b/sw/source/uibase/uiview/view2.cxx @@ -391,7 +391,7 @@ bool SwView::InsertGraphicDlg( SfxRequest& rReq ) { Any aVal = xCtrlAcc->getValue( ExtendedFilePickerElementIds::CHECKBOX_LINK, 0); OSL_ENSURE(aVal.hasValue(), "Value CBX_INSERT_AS_LINK not found"); - bAsLink = aVal.hasValue() ? *(sal_Bool*) aVal.getValue() : sal_True; + bAsLink = !aVal.hasValue() || *(sal_Bool*) aVal.getValue(); Any aTemplateValue = xCtrlAcc->getValue( ExtendedFilePickerElementIds::LISTBOX_IMAGE_TEMPLATE, ListboxControlActions::GET_SELECTED_ITEM ); @@ -426,7 +426,7 @@ bool SwView::InsertGraphicDlg( SfxRequest& rReq ) { Any aVal = xCtrlAcc->getValue( ExtendedFilePickerElementIds::CHECKBOX_LINK, 0); OSL_ENSURE(aVal.hasValue(), "Value CBX_INSERT_AS_LINK not found"); - bAsLink = aVal.hasValue() ? *(sal_Bool*) aVal.getValue() : sal_True; + bAsLink = !aVal.hasValue() || *(sal_Bool*) aVal.getValue(); Any aTemplateValue = xCtrlAcc->getValue( ExtendedFilePickerElementIds::LISTBOX_IMAGE_TEMPLATE, ListboxControlActions::GET_SELECTED_ITEM ); diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx index f2585c088b18..50dc5f895976 100644 --- a/sw/source/uibase/uno/unotxdoc.cxx +++ b/sw/source/uibase/uno/unotxdoc.cxx @@ -4000,7 +4000,7 @@ SwViewOptionAdjust_Impl::AdjustViewOptions(SwPrintData const*const pPrtOptions) if (bContainsPlaceHolders) { // should always be printed in PDF export! - bVal = pPrtOptions ? pPrtOptions->bPrintTextPlaceholder : sal_True; + bVal = !pPrtOptions || pPrtOptions->bPrintTextPlaceholder; aRenderViewOptions.SetShowPlaceHolderFields( bVal ); } diff --git a/sw/source/uibase/uno/unotxvw.cxx b/sw/source/uibase/uno/unotxvw.cxx index 07d93e8ea962..7f6682ef7fd9 100644 --- a/sw/source/uibase/uno/unotxvw.cxx +++ b/sw/source/uibase/uno/unotxvw.cxx @@ -483,7 +483,7 @@ sal_Bool SAL_CALL SwXTextView::isFormDesignMode( ) throw (uno::RuntimeException SolarMutexGuard aGuard; SwView* pView2 = GetView(); FmFormShell* pFormShell = pView2 ? pView2->GetFormShell() : NULL; - return pFormShell ? pFormShell->IsDesignMode() : sal_True; + return static_cast<sal_Bool>(!pFormShell || pFormShell->IsDesignMode()); } void SAL_CALL SwXTextView::setFormDesignMode( sal_Bool _DesignMode ) throw (RuntimeException, std::exception) @@ -632,8 +632,8 @@ void SAL_CALL SwXTextView::setRubyList( } else if(pProperties[nProp].Name == UNO_NAME_RUBY_IS_ABOVE) { - bool bValue = pProperties[nProp].Value.hasValue() ? - *(sal_Bool*)pProperties[nProp].Value.getValue() : sal_True; + bool bValue = !pProperties[nProp].Value.hasValue() || + *(sal_Bool*)pProperties[nProp].Value.getValue(); pEntry->GetRubyAttr().SetPosition(bValue ? 0 : 1); } } diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 7b698d1f1e0b..bd75cde79bc6 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -1600,7 +1600,7 @@ void SwContentTree::Display( bool bActive ) bIsActive = bActive; bIsHidden = !bActive; SwWrtShell* pShell = GetWrtShell(); - bool bReadOnly = pShell ? pShell->GetView().GetDocShell()->IsReadOnly() : sal_True; + const bool bReadOnly = !pShell || pShell->GetView().GetDocShell()->IsReadOnly(); if(bReadOnly != bIsLastReadOnly) { bIsLastReadOnly = bReadOnly; |