diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-04-22 21:40:50 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-04-22 20:50:54 +0000 |
commit | 1a31dd5ec4ede142044eb58d2d1e03709a6d12cd (patch) | |
tree | 17b04e5622bfab63ce46098bf8ad4a5dc4200d26 | |
parent | bac01f8af744ae4f6853fcafa53fce1eadb8f361 (diff) |
Clean up odd sal::static_int_cast<sal_Bool> uses
Change-Id: Idbd1cdb06315b96dc9f45e34108a1af45229ed2f
Reviewed-on: https://gerrit.libreoffice.org/15484
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
-rw-r--r-- | cui/source/tabpages/tparea.cxx | 9 | ||||
-rw-r--r-- | cui/source/tabpages/tpline.cxx | 4 | ||||
-rw-r--r-- | i18npool/source/breakiterator/xdictionary.cxx | 2 | ||||
-rw-r--r-- | i18npool/source/localedata/localedata.cxx | 7 | ||||
-rw-r--r-- | xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx | 4 |
5 files changed, 12 insertions, 14 deletions
diff --git a/cui/source/tabpages/tparea.cxx b/cui/source/tabpages/tparea.cxx index ed8c5cf986df..882f185d32bd 100644 --- a/cui/source/tabpages/tparea.cxx +++ b/cui/source/tabpages/tparea.cxx @@ -1200,8 +1200,7 @@ bool SvxAreaTabPage::FillItemSet( SfxItemSet* rAttrs ) TriState eState = m_pTsbTile->GetState(); if( m_pTsbTile->IsValueChangedFromSaved() ) { - XFillBmpTileItem aFillBmpTileItem( - sal::static_int_cast< sal_Bool >( eState ) ); + XFillBmpTileItem aFillBmpTileItem( eState != TRISTATE_FALSE ); pOld = GetOldItem( *rAttrs, XATTR_FILLBMP_TILE ); if ( !pOld || !( *static_cast<const XFillBmpTileItem*>(pOld) == aFillBmpTileItem ) ) { @@ -1217,7 +1216,7 @@ bool SvxAreaTabPage::FillItemSet( SfxItemSet* rAttrs ) if( m_pTsbStretch->IsValueChangedFromSaved() ) { XFillBmpStretchItem aFillBmpStretchItem( - sal::static_int_cast< sal_Bool >( eState ) ); + eState != TRISTATE_FALSE ); pOld = GetOldItem( *rAttrs, XATTR_FILLBMP_STRETCH ); if ( !pOld || !( *static_cast<const XFillBmpStretchItem*>(pOld) == aFillBmpStretchItem ) ) { @@ -2244,12 +2243,12 @@ IMPL_LINK_NOARG(SvxAreaTabPage, ModifyTileHdl_Impl) m_pMtrFldYSize->SetValue( m_pMtrFldYSize->GetValue() ); } - rXFSet.Put( XFillBmpTileItem( sal::static_int_cast< sal_Bool >( eState ) ) ); + rXFSet.Put( XFillBmpTileItem( eState != TRISTATE_FALSE ) ); if( m_pTsbStretch->IsEnabled() ) rXFSet.Put( XFillBmpStretchItem( - sal::static_int_cast< sal_Bool >( m_pTsbStretch->GetState() ) ) ); + m_pTsbStretch->GetState() != TRISTATE_FALSE ) ); if( m_pTsbScale->IsEnabled() ) rXFSet.Put( XFillBmpSizeLogItem( m_pTsbScale->GetState() == TRISTATE_FALSE ) ); diff --git a/cui/source/tabpages/tpline.cxx b/cui/source/tabpages/tpline.cxx index ce3668f7a89f..0ebcf15f2deb 100644 --- a/cui/source/tabpages/tpline.cxx +++ b/cui/source/tabpages/tpline.cxx @@ -805,7 +805,7 @@ bool SvxLineTabPage::FillItemSet( SfxItemSet* rAttrs ) TriState eState = m_pTsbCenterStart->GetState(); if( m_pTsbCenterStart->IsValueChangedFromSaved() ) { - XLineStartCenterItem aItem( sal::static_int_cast< sal_Bool >( eState ) ); + XLineStartCenterItem aItem( eState != TRISTATE_FALSE ); pOld = GetOldItem( *rAttrs, XATTR_LINESTARTCENTER ); if ( !pOld || !( *static_cast<const XLineStartCenterItem*>(pOld) == aItem ) ) { @@ -816,7 +816,7 @@ bool SvxLineTabPage::FillItemSet( SfxItemSet* rAttrs ) eState = m_pTsbCenterEnd->GetState(); if( m_pTsbCenterEnd->IsValueChangedFromSaved() ) { - XLineEndCenterItem aItem( sal::static_int_cast< sal_Bool >( eState ) ); + XLineEndCenterItem aItem( eState != TRISTATE_FALSE ); pOld = GetOldItem( *rAttrs, XATTR_LINEENDCENTER ); if ( !pOld || !( *static_cast<const XLineEndCenterItem*>(pOld) == aItem ) ) { diff --git a/i18npool/source/breakiterator/xdictionary.cxx b/i18npool/source/breakiterator/xdictionary.cxx index 5f14995c4cd2..ec9f63097b78 100644 --- a/i18npool/source/breakiterator/xdictionary.cxx +++ b/i18npool/source/breakiterator/xdictionary.cxx @@ -196,7 +196,7 @@ void xdictionary::setJapaneseWordBreak() bool xdictionary::exists(const sal_uInt32 c) { // 0x1FFF is the hardcoded limit in gendict for data.existMarks - bool exist = (data.existMark && ((c>>3) < 0x1FFF)) ? sal::static_int_cast<sal_Bool>((data.existMark[c>>3] & (1<<(c&0x07))) != 0) : sal_False; + bool exist = data.existMark && (c>>3) < 0x1FFF && (data.existMark[c>>3] & (1<<(c&0x07))) != 0; if (!exist && japaneseWordBreak) return BreakIteratorImpl::getScriptClass(c) == ScriptType::ASIAN; else diff --git a/i18npool/source/localedata/localedata.cxx b/i18npool/source/localedata/localedata.cxx index 56d8fc88b7b3..4ab8cd2a6b1e 100644 --- a/i18npool/source/localedata/localedata.cxx +++ b/i18npool/source/localedata/localedata.cxx @@ -710,7 +710,7 @@ LocaleDataImpl::getAllCalendars2( const Locale& rLocale ) throw(RuntimeException for(sal_Int16 i = 0; i < calendarsCount; i++) { OUString calendarID(allCalendars[offset]); offset++; - bool defaultCalendar = sal::static_int_cast<sal_Bool>( allCalendars[offset][0] ); + bool defaultCalendar = allCalendars[offset][0] != 0; offset++; Sequence< CalendarItem2 > days = getCalendarItems( allCalendars, offset, REF_DAYS, i, rLocale, calendarsSeq); @@ -879,7 +879,7 @@ LocaleDataImpl::getAllFormats( const Locale& rLocale ) throw(RuntimeException, s formatArray[nOff + 3], formatArray[nOff + 4], formatArray[nOff + 5][0], - sal::static_int_cast<sal_Bool>(formatArray[nOff + 6][0])); + formatArray[nOff + 6][0] != 0); seq[f] = elem; } } @@ -943,8 +943,7 @@ LocaleDataImpl::getCollatorImplementations( const Locale& rLocale ) throw(Runtim Sequence< Implementation > seq(collatorCount); for(sal_Int16 i = 0; i < collatorCount; i++) { Implementation impl(collatorArray[i * COLLATOR_ELEMENTS + COLLATOR_OFFSET_ALGO], - sal::static_int_cast<sal_Bool>( - collatorArray[i * COLLATOR_ELEMENTS + COLLATOR_OFFSET_DEFAULT][0])); + collatorArray[i * COLLATOR_ELEMENTS + COLLATOR_OFFSET_DEFAULT][0] != 0); seq[i] = impl; } return seq; diff --git a/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx b/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx index 8faef3a597de..2259c1d704db 100644 --- a/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx +++ b/xmlsecurity/source/xmlsec/mscrypt/x509certificate_mscryptimpl.cxx @@ -380,7 +380,7 @@ OUString SAL_CALL X509Certificate_MSCryptImpl :: getSubjectName() throw ( ::com: if( xExtn == NULL ) throw RuntimeException() ; - xExtn->setCertExtn( pExtn->Value.pbData, pExtn->Value.cbData, ( unsigned char* )pExtn->pszObjId, strlen( pExtn->pszObjId ), sal::static_int_cast<sal_Bool>(pExtn->fCritical) ) ; + xExtn->setCertExtn( pExtn->Value.pbData, pExtn->Value.cbData, ( unsigned char* )pExtn->pszObjId, strlen( pExtn->pszObjId ), pExtn->fCritical ) ; xExtns[i] = xExtn ; } @@ -406,7 +406,7 @@ OUString SAL_CALL X509Certificate_MSCryptImpl :: getSubjectName() throw ( ::com: if( xExtn == NULL ) throw RuntimeException() ; - xExtn->setCertExtn( pExtn->Value.pbData, pExtn->Value.cbData, ( unsigned char* )pExtn->pszObjId, strlen( pExtn->pszObjId ), sal::static_int_cast<sal_Bool>(pExtn->fCritical) ) ; + xExtn->setCertExtn( pExtn->Value.pbData, pExtn->Value.cbData, ( unsigned char* )pExtn->pszObjId, strlen( pExtn->pszObjId ), pExtn->fCritical ) ; } } |