coverity#982479 Unchecked dynamic_cast

Change-Id: I79f02538a44edb7fb7c1b94dbec365a30d896bb4
This commit is contained in:
Caolán McNamara
2014-05-23 10:09:40 +01:00
parent 04d6fa930d
commit efc9dffda3

View File

@@ -187,9 +187,10 @@ namespace
// copying additional attributes for bookmarks or fieldmarks
::sw::mark::IBookmark* const pNewBookmark =
dynamic_cast< ::sw::mark::IBookmark* const >(pNewMark);
if(pNewBookmark)
const ::sw::mark::IBookmark* const pOldBookmark =
dynamic_cast< const ::sw::mark::IBookmark* >(pMark);
if (pNewBookmark && pOldBookmark)
{
const ::sw::mark::IBookmark* const pOldBookmark = dynamic_cast< const ::sw::mark::IBookmark* >(pMark);
pNewBookmark->SetKeyCode(pOldBookmark->GetKeyCode());
pNewBookmark->SetShortName(pOldBookmark->GetShortName());
}