diff options
author | Matteo Casalin <matteo.casalin@yahoo.com> | 2014-08-22 22:24:31 +0200 |
---|---|---|
committer | Matteo Casalin <matteo.casalin@yahoo.com> | 2014-09-06 12:08:49 +0200 |
commit | 8cb128868685857e52b262c05d7a04bebdfe7efb (patch) | |
tree | 5b12bfae1ec6557350cce8402feebc9bec770ea5 /sw | |
parent | b65e9c65c5a852d9b0eec8302dc5bf0bcef8bf84 (diff) |
sal_uInt16: avoid unnecessary casts, constify
Change-Id: Ia9bf83054d08d73711bb3f6e83d316ff55e4798c
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/txtnode/ndtxt.cxx | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx index 7bf2895029b5..c05bc4e908ff 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -910,8 +910,7 @@ void SwTxtNode::Update( bool bNoExp = false; bool bResort = false; bool bMergePortionsNeeded = false; - const sal_uInt16 coArrSz = - static_cast<sal_uInt16>(RES_TXTATR_WITHEND_END) - static_cast<sal_uInt16>(RES_CHRATR_BEGIN); + const int coArrSz = RES_TXTATR_WITHEND_END - RES_CHRATR_BEGIN; bool aDontExp[ coArrSz ]; memset( &aDontExp, 0, coArrSz * sizeof(bool) ); @@ -945,8 +944,7 @@ void SwTxtNode::Update( if (!(isCHRATR(nWhich) || isTXTATR_WITHEND(nWhich))) continue; - const sal_uInt16 nWhPos = static_cast<sal_uInt16>(nWhich - - RES_CHRATR_BEGIN); + const sal_uInt16 nWhPos = nWhich - RES_CHRATR_BEGIN; if( aDontExp[ nWhPos ] ) continue; @@ -963,10 +961,8 @@ void SwTxtNode::Update( if ( pHint->IsCharFmtAttr() ) { bNoExp = true; - aDontExp[ static_cast<sal_uInt16>(RES_TXTATR_CHARFMT) - static_cast<sal_uInt16>(RES_CHRATR_BEGIN) ] - = true; - aDontExp[ static_cast<sal_uInt16>(RES_TXTATR_INETFMT) - static_cast<sal_uInt16>(RES_CHRATR_BEGIN) ] - = true; + aDontExp[ RES_TXTATR_CHARFMT - RES_CHRATR_BEGIN ] = true; + aDontExp[ RES_TXTATR_INETFMT - RES_CHRATR_BEGIN ] = true; } else aDontExp[ nWhPos ] = true; @@ -2885,7 +2881,7 @@ bool SwTxtNode::GetFirstLineOfsWithNum( short& rFLOffset ) const { if ( AreListLevelIndentsApplicable() ) { - rFLOffset = static_cast<sal_uInt16>(rFmt.GetFirstLineIndent()); + rFLOffset = rFmt.GetFirstLineIndent(); } else if (!getIDocumentSettingAccess()->get(IDocumentSettingAccess::IGNORE_FIRST_LINE_INDENT_IN_NUMBERING)) { @@ -3631,7 +3627,7 @@ void SwTxtNode::Modify( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewVal //UUUU reset fill information if(maFillAttributes.get()) { - sal_uInt16 nWhich = pNewValue ? pNewValue->Which() : 0; + const sal_uInt16 nWhich = pNewValue ? pNewValue->Which() : 0; bool bReset(RES_FMT_CHG == nWhich); // ..on format change (e.g. style changed) if(!bReset && RES_ATTRSET_CHG == nWhich) // ..on ItemChange from DrawingLayer FillAttributes @@ -4898,7 +4894,7 @@ sal_uInt16 SwTxtNode::ResetAllAttr() HandleResetAttrAtTxtNode aHandleResetAttr( *this ); - sal_uInt16 nRet = SwCntntNode::ResetAllAttr(); + const sal_uInt16 nRet = SwCntntNode::ResetAllAttr(); mbInSetOrResetAttr = bOldIsSetOrResetAttr; |