Kaydet (Commit) d0b9fe79 authored tarafından Caolán McNamara's avatar Caolán McNamara

coverity#704962 Unchecked dynamic_cast

Change-Id: I6960b09ef68a9755469c42715f5ccd25ac3d3896
üst 551b054b
...@@ -3906,8 +3906,8 @@ void SwXCellRange::setPropertyValue(const OUString& rPropertyName, const uno::An ...@@ -3906,8 +3906,8 @@ void SwXCellRange::setPropertyValue(const OUString& rPropertyName, const uno::An
// remove actions to enable box selection // remove actions to enable box selection
UnoActionRemoveContext aRemoveContext(pDoc); UnoActionRemoveContext aRemoveContext(pDoc);
} }
SwUnoTableCrsr* pCrsr = dynamic_cast<SwUnoTableCrsr*>(pTblCrsr); SwUnoTableCrsr& rCrsr = dynamic_cast<SwUnoTableCrsr&>(*pTblCrsr);
pCrsr->MakeBoxSels(); rCrsr.MakeBoxSels();
switch(pEntry->nWID ) switch(pEntry->nWID )
{ {
case FN_UNO_TABLE_CELL_BACKGROUND: case FN_UNO_TABLE_CELL_BACKGROUND:
...@@ -3944,7 +3944,7 @@ void SwXCellRange::setPropertyValue(const OUString& rPropertyName, const uno::An ...@@ -3944,7 +3944,7 @@ void SwXCellRange::setPropertyValue(const OUString& rPropertyName, const uno::An
aBoxInfo.SetValid(nValid, true); aBoxInfo.SetValid(nValid, true);
aSet.Put(aBoxInfo); aSet.Put(aBoxInfo);
pDoc->GetTabBorders(*pCrsr, aSet); pDoc->GetTabBorders(rCrsr, aSet);
aSet.Put(aBoxInfo); aSet.Put(aBoxInfo);
SvxBoxItem aBoxItem((const SvxBoxItem&)aSet.Get(RES_BOX)); SvxBoxItem aBoxItem((const SvxBoxItem&)aSet.Get(RES_BOX));
...@@ -3957,7 +3957,7 @@ void SwXCellRange::setPropertyValue(const OUString& rPropertyName, const uno::An ...@@ -3957,7 +3957,7 @@ void SwXCellRange::setPropertyValue(const OUString& rPropertyName, const uno::An
{ {
SfxUInt32Item aNumberFormat(RES_BOXATR_FORMAT); SfxUInt32Item aNumberFormat(RES_BOXATR_FORMAT);
((SfxPoolItem&)aNumberFormat).PutValue(aValue, 0); ((SfxPoolItem&)aNumberFormat).PutValue(aValue, 0);
pDoc->SetBoxAttr( *pCrsr, aNumberFormat); pDoc->SetBoxAttr(rCrsr, aNumberFormat);
} }
break; break;
case FN_UNO_RANGE_ROW_LABEL: case FN_UNO_RANGE_ROW_LABEL:
...@@ -3983,15 +3983,15 @@ void SwXCellRange::setPropertyValue(const OUString& rPropertyName, const uno::An ...@@ -3983,15 +3983,15 @@ void SwXCellRange::setPropertyValue(const OUString& rPropertyName, const uno::An
default: default:
{ {
SfxItemSet aItemSet( pDoc->GetAttrPool(), pEntry->nWID, pEntry->nWID ); SfxItemSet aItemSet( pDoc->GetAttrPool(), pEntry->nWID, pEntry->nWID );
SwUnoCursorHelper::GetCrsrAttr(pCrsr->GetSelRing(), SwUnoCursorHelper::GetCrsrAttr(rCrsr.GetSelRing(),
aItemSet); aItemSet);
if (!SwUnoCursorHelper::SetCursorPropertyValue( if (!SwUnoCursorHelper::SetCursorPropertyValue(
*pEntry, aValue, pCrsr->GetSelRing(), aItemSet)) *pEntry, aValue, rCrsr.GetSelRing(), aItemSet))
{ {
m_pPropSet->setPropertyValue(*pEntry, aValue, aItemSet); m_pPropSet->setPropertyValue(*pEntry, aValue, aItemSet);
} }
SwUnoCursorHelper::SetCrsrAttr(pCrsr->GetSelRing(), SwUnoCursorHelper::SetCrsrAttr(rCrsr.GetSelRing(),
aItemSet, nsSetAttrMode::SETATTR_DEFAULT, true); aItemSet, nsSetAttrMode::SETATTR_DEFAULT, true);
} }
} }
......
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