summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-08-07 15:47:48 +0100
committerCaolán McNamara <caolanm@redhat.com>2014-08-07 18:00:50 +0100
commit65ed07a8638f2e9fcb866932a051150455b4766a (patch)
tree61493347aea0ada859805b626f8b69123ab5f810 /sw
parent013b19212b5bc37c85b1f1a72b0b71f75854b997 (diff)
coverity#1078601 Dereference after null check
Change-Id: Ie708384cbf0a2b0faa82d0653ceb87816bcdcbfd
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/access/acctextframe.cxx15
1 files changed, 9 insertions, 6 deletions
diff --git a/sw/source/core/access/acctextframe.cxx b/sw/source/core/access/acctextframe.cxx
index 5aa437cab09c..2c0c1b108abc 100644
--- a/sw/source/core/access/acctextframe.cxx
+++ b/sw/source/core/access/acctextframe.cxx
@@ -83,11 +83,14 @@ void SwAccessibleTextFrame::Modify( const SfxPoolItem* pOld, const SfxPoolItem *
// #i73249#
case RES_TITLE_CHANGED:
{
- const OUString& sOldTitle(
- dynamic_cast<const SwStringMsgPoolItem&>(*pOld).GetString() );
- const OUString& sNewTitle(
- dynamic_cast<const SwStringMsgPoolItem&>(*pNew).GetString() );
- if ( sOldTitle == sNewTitle )
+ OUString sOldTitle, sNewTitle;
+ const SwStringMsgPoolItem *pOldItem = dynamic_cast<const SwStringMsgPoolItem*>(pOld);
+ if (pOldItem)
+ sOldTitle = pOldItem->GetString();
+ const SwStringMsgPoolItem *pNewItem = dynamic_cast<const SwStringMsgPoolItem*>(pNew);
+ if (pNewItem)
+ sNewTitle = pNewItem->GetString();
+ if (sOldTitle == sNewTitle)
{
break;
}
@@ -100,7 +103,7 @@ void SwAccessibleTextFrame::Modify( const SfxPoolItem* pOld, const SfxPoolItem *
const SwFlyFrmFmt* pFlyFrmFmt =
dynamic_cast<const SwFlyFrmFmt*>( pFlyFrm->GetFmt() );
- if ( !pFlyFrmFmt->GetObjDescription().isEmpty() )
+ if (!pFlyFrmFmt || !pFlyFrmFmt->GetObjDescription().isEmpty())
{
break;
}