coverity#1078575 Unchecked dynamic_cast

Change-Id: Ib4b7c2dcfa42aea0866806684a3949d35e796b27
This commit is contained in:
Caolán McNamara 2014-05-23 13:02:21 +01:00
parent 7ebbd60b14
commit a5a1f885f0

View File

@ -109,12 +109,13 @@ void SwAccessibleNoTextFrame::Modify( const SfxPoolItem* pOld, const SfxPoolItem
// #i73249#
case RES_TITLE_CHANGED:
{
OUString sOldTitle;
OUString sOldTitle, sNewTitle;
const SwStringMsgPoolItem* pOldItem = dynamic_cast<const SwStringMsgPoolItem*>(pOld);
if (pOldItem)
sOldTitle = pOldItem->GetString();
const OUString& sNewTitle(
dynamic_cast<const SwStringMsgPoolItem*>(pNew)->GetString() );
const SwStringMsgPoolItem* pNewItem = dynamic_cast<const SwStringMsgPoolItem*>(pNew);
if (pNewItem)
sNewTitle = pNewItem->GetString();
if ( sOldTitle == sNewTitle )
{
break;