diff options
author | Matteo Casalin <matteo.casalin@yahoo.com> | 2014-08-22 20:44:59 +0200 |
---|---|---|
committer | Matteo Casalin <matteo.casalin@yahoo.com> | 2014-09-06 12:08:33 +0200 |
commit | 26ec2061fa3d96f1b1c77beab09537fb2f69f87a (patch) | |
tree | ec6302f8b8bffc5337ac1f16b66a94f0d0da41fd /sw | |
parent | 507cc73f1fa49eb23e8e52e67add69885f6b7972 (diff) |
sal_uInt16 to size_t, constify, avoid temporaries
Change-Id: I1208f1e98a0ee09263babeffa7554e94ed455434
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/txtnode/thints.cxx | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx index 3e228ac7b943..54546f2e8c8d 100644 --- a/sw/source/core/txtnode/thints.cxx +++ b/sw/source/core/txtnode/thints.cxx @@ -2117,8 +2117,7 @@ bool SwTxtNode::GetAttr( SfxItemSet& rSet, sal_Int32 nStt, sal_Int32 nEnd, // #i75299# boost::scoped_ptr< std::vector< SwPoolItemEndPair > > pAttrArr; - const sal_uInt16 coArrSz = static_cast<sal_uInt16>(RES_TXTATR_WITHEND_END) - - static_cast<sal_uInt16>(RES_CHRATR_BEGIN); + const size_t coArrSz = RES_TXTATR_WITHEND_END - RES_CHRATR_BEGIN; for (size_t n = 0; n < nSize; ++n) { @@ -2233,7 +2232,7 @@ bool SwTxtNode::GetAttr( SfxItemSet& rSet, sal_Int32 nStt, sal_Int32 nEnd, if ( pAttrArr.get() ) { - for (sal_uInt16 n = 0; n < coArrSz; ++n) + for (size_t n = 0; n < coArrSz; ++n) { const SwPoolItemEndPair& rItemPair = (*pAttrArr)[ n ]; if( (0 != rItemPair.mpItem) && ((SfxPoolItem*)-1 != rItemPair.mpItem) ) @@ -2922,8 +2921,7 @@ static void lcl_CheckSortNumber( const SwpHints& rHints, SwTxtCharFmt& rNewCharF if ( nOtherStart == nHtStart && nOtherEnd == nHtEnd ) { - const sal_uInt16 nOtherSortNum = static_cast<const SwTxtCharFmt*>(pOtherHt)->GetSortNumber(); - nSortNumber = nOtherSortNum + 1; + nSortNumber = static_cast<const SwTxtCharFmt*>(pOtherHt)->GetSortNumber() + 1; } } } @@ -2957,7 +2955,7 @@ bool SwpHints::TryInsertHint( // Wir koennen also auf die while-Schleife verzichten sal_Int32 *pHtEnd = pHint->GetEnd(); - sal_uInt16 nWhich = pHint->Which(); + const sal_uInt16 nWhich = pHint->Which(); std::vector<sal_uInt16> aWhichSublist; switch( nWhich ) @@ -2994,9 +2992,9 @@ bool SwpHints::TryInsertHint( const sal_uInt16 *pRanges = pSet->GetRanges(); while( (*pRanges) != 0 ) { - sal_uInt16 nBeg = (*pRanges); + const sal_uInt16 nBeg = (*pRanges); ++pRanges; - sal_uInt16 nEnd = (*pRanges); + const sal_uInt16 nEnd = (*pRanges); ++pRanges; for( sal_uInt16 nSubElem = nBeg; nSubElem <= nEnd; ++nSubElem ) if( pSet->HasItem( nSubElem ) ) @@ -3399,7 +3397,7 @@ sal_uInt16 SwTxtNode::GetLang( const sal_Int32 nBegin, const sal_Int32 nLen, ( nAttrStart == *pEndIdx || !nBegin ))) ) { const SfxPoolItem* pItem = CharFmt::GetItem( *pHt, nWhichId ); - sal_uInt16 nLng = ((SvxLanguageItem*)pItem)->GetLanguage(); + const sal_uInt16 nLng = ((SvxLanguageItem*)pItem)->GetLanguage(); // Umfasst das Attribut den Bereich komplett? if( nAttrStart <= nBegin && nEnd <= *pEndIdx ) |