Kaydet (Commit) 8cb12886 authored tarafından Matteo Casalin's avatar Matteo Casalin

sal_uInt16: avoid unnecessary casts, constify

Change-Id: Ia9bf83054d08d73711bb3f6e83d316ff55e4798c
üst b65e9c65
...@@ -910,8 +910,7 @@ void SwTxtNode::Update( ...@@ -910,8 +910,7 @@ void SwTxtNode::Update(
bool bNoExp = false; bool bNoExp = false;
bool bResort = false; bool bResort = false;
bool bMergePortionsNeeded = false; bool bMergePortionsNeeded = false;
const sal_uInt16 coArrSz = const int coArrSz = RES_TXTATR_WITHEND_END - RES_CHRATR_BEGIN;
static_cast<sal_uInt16>(RES_TXTATR_WITHEND_END) - static_cast<sal_uInt16>(RES_CHRATR_BEGIN);
bool aDontExp[ coArrSz ]; bool aDontExp[ coArrSz ];
memset( &aDontExp, 0, coArrSz * sizeof(bool) ); memset( &aDontExp, 0, coArrSz * sizeof(bool) );
...@@ -945,8 +944,7 @@ void SwTxtNode::Update( ...@@ -945,8 +944,7 @@ void SwTxtNode::Update(
if (!(isCHRATR(nWhich) || isTXTATR_WITHEND(nWhich))) if (!(isCHRATR(nWhich) || isTXTATR_WITHEND(nWhich)))
continue; continue;
const sal_uInt16 nWhPos = static_cast<sal_uInt16>(nWhich - const sal_uInt16 nWhPos = nWhich - RES_CHRATR_BEGIN;
RES_CHRATR_BEGIN);
if( aDontExp[ nWhPos ] ) if( aDontExp[ nWhPos ] )
continue; continue;
...@@ -963,10 +961,8 @@ void SwTxtNode::Update( ...@@ -963,10 +961,8 @@ void SwTxtNode::Update(
if ( pHint->IsCharFmtAttr() ) if ( pHint->IsCharFmtAttr() )
{ {
bNoExp = true; bNoExp = true;
aDontExp[ static_cast<sal_uInt16>(RES_TXTATR_CHARFMT) - static_cast<sal_uInt16>(RES_CHRATR_BEGIN) ] aDontExp[ RES_TXTATR_CHARFMT - RES_CHRATR_BEGIN ] = true;
= true; aDontExp[ RES_TXTATR_INETFMT - RES_CHRATR_BEGIN ] = true;
aDontExp[ static_cast<sal_uInt16>(RES_TXTATR_INETFMT) - static_cast<sal_uInt16>(RES_CHRATR_BEGIN) ]
= true;
} }
else else
aDontExp[ nWhPos ] = true; aDontExp[ nWhPos ] = true;
...@@ -2885,7 +2881,7 @@ bool SwTxtNode::GetFirstLineOfsWithNum( short& rFLOffset ) const ...@@ -2885,7 +2881,7 @@ bool SwTxtNode::GetFirstLineOfsWithNum( short& rFLOffset ) const
{ {
if ( AreListLevelIndentsApplicable() ) if ( AreListLevelIndentsApplicable() )
{ {
rFLOffset = static_cast<sal_uInt16>(rFmt.GetFirstLineIndent()); rFLOffset = rFmt.GetFirstLineIndent();
} }
else if (!getIDocumentSettingAccess()->get(IDocumentSettingAccess::IGNORE_FIRST_LINE_INDENT_IN_NUMBERING)) else if (!getIDocumentSettingAccess()->get(IDocumentSettingAccess::IGNORE_FIRST_LINE_INDENT_IN_NUMBERING))
{ {
...@@ -3631,7 +3627,7 @@ void SwTxtNode::Modify( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewVal ...@@ -3631,7 +3627,7 @@ void SwTxtNode::Modify( const SfxPoolItem* pOldValue, const SfxPoolItem* pNewVal
//UUUU reset fill information //UUUU reset fill information
if(maFillAttributes.get()) 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) bool bReset(RES_FMT_CHG == nWhich); // ..on format change (e.g. style changed)
if(!bReset && RES_ATTRSET_CHG == nWhich) // ..on ItemChange from DrawingLayer FillAttributes if(!bReset && RES_ATTRSET_CHG == nWhich) // ..on ItemChange from DrawingLayer FillAttributes
...@@ -4898,7 +4894,7 @@ sal_uInt16 SwTxtNode::ResetAllAttr() ...@@ -4898,7 +4894,7 @@ sal_uInt16 SwTxtNode::ResetAllAttr()
HandleResetAttrAtTxtNode aHandleResetAttr( *this ); HandleResetAttrAtTxtNode aHandleResetAttr( *this );
sal_uInt16 nRet = SwCntntNode::ResetAllAttr(); const sal_uInt16 nRet = SwCntntNode::ResetAllAttr();
mbInSetOrResetAttr = bOldIsSetOrResetAttr; mbInSetOrResetAttr = bOldIsSetOrResetAttr;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment