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

coverity#704971 Unchecked dynamic_cast

Change-Id: Ic5983001ea739fc04c15c0852b6693c9cc9bfabd
üst 82f02546
...@@ -1813,14 +1813,14 @@ void SwXTextTableCursor::setPropertyValue(const OUString& rPropertyName, const u ...@@ -1813,14 +1813,14 @@ void SwXTextTableCursor::setPropertyValue(const OUString& rPropertyName, const u
SwStartNode* pSttNode = pUnoCrsr->GetNode()->StartOfSectionNode(); SwStartNode* pSttNode = pUnoCrsr->GetNode()->StartOfSectionNode();
const SwTableNode* pTblNode = pSttNode->FindTableNode(); const SwTableNode* pTblNode = pSttNode->FindTableNode();
lcl_FormatTable((SwFrmFmt*)pTblNode->GetTable().GetFrmFmt()); lcl_FormatTable((SwFrmFmt*)pTblNode->GetTable().GetFrmFmt());
SwUnoTableCrsr* pTblCrsr = dynamic_cast<SwUnoTableCrsr*>(pUnoCrsr); SwUnoTableCrsr& rTblCrsr = dynamic_cast<SwUnoTableCrsr&>(*pUnoCrsr);
const SfxItemPropertySimpleEntry* pEntry = const SfxItemPropertySimpleEntry* pEntry =
m_pPropSet->getPropertyMap().getByName(rPropertyName); m_pPropSet->getPropertyMap().getByName(rPropertyName);
if(pEntry) if(pEntry)
{ {
if ( pEntry->nFlags & beans::PropertyAttribute::READONLY) if ( pEntry->nFlags & beans::PropertyAttribute::READONLY)
throw beans::PropertyVetoException("Property is read-only: " + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) ); throw beans::PropertyVetoException("Property is read-only: " + rPropertyName, static_cast < cppu::OWeakObject * > ( this ) );
pTblCrsr->MakeBoxSels(); rTblCrsr.MakeBoxSels();
SwDoc* pDoc = pUnoCrsr->GetDoc(); SwDoc* pDoc = pUnoCrsr->GetDoc();
switch(pEntry->nWID ) switch(pEntry->nWID )
{ {
...@@ -1846,15 +1846,15 @@ void SwXTextTableCursor::setPropertyValue(const OUString& rPropertyName, const u ...@@ -1846,15 +1846,15 @@ void SwXTextTableCursor::setPropertyValue(const OUString& rPropertyName, const u
default: default:
{ {
SfxItemSet aItemSet( pDoc->GetAttrPool(), pEntry->nWID, pEntry->nWID ); SfxItemSet aItemSet( pDoc->GetAttrPool(), pEntry->nWID, pEntry->nWID );
SwUnoCursorHelper::GetCrsrAttr(pTblCrsr->GetSelRing(), SwUnoCursorHelper::GetCrsrAttr(rTblCrsr.GetSelRing(),
aItemSet); aItemSet);
if (!SwUnoCursorHelper::SetCursorPropertyValue( if (!SwUnoCursorHelper::SetCursorPropertyValue(
*pEntry, aValue, pTblCrsr->GetSelRing(), aItemSet)) *pEntry, aValue, rTblCrsr.GetSelRing(), aItemSet))
{ {
m_pPropSet->setPropertyValue(*pEntry, aValue, aItemSet); m_pPropSet->setPropertyValue(*pEntry, aValue, aItemSet);
} }
SwUnoCursorHelper::SetCrsrAttr(pTblCrsr->GetSelRing(), SwUnoCursorHelper::SetCrsrAttr(rTblCrsr.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