summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-07-15 14:49:48 +0100
committerCaolán McNamara <caolanm@redhat.com>2017-07-15 14:53:53 +0100
commit33ecb72fd52050687f74828263526a8e836c3bdf (patch)
tree73effa11b0efd8c051311778f2e7664de690fd9f /sd
parentb128f8f0bcd5f5378c559c8fdd506cfb51ff09b3 (diff)
coverity#1415090 Unchecked dynamic_cast
and coverity#1415096 Unchecked dynamic_cast Change-Id: I29a20a0868f8720a7aee60ebd6f55a7dbb76f894
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/sidebar/SlideBackground.cxx16
1 files changed, 10 insertions, 6 deletions
diff --git a/sd/source/ui/sidebar/SlideBackground.cxx b/sd/source/ui/sidebar/SlideBackground.cxx
index 5011f7a58c01..a0c2e756e42c 100644
--- a/sd/source/ui/sidebar/SlideBackground.cxx
+++ b/sd/source/ui/sidebar/SlideBackground.cxx
@@ -733,7 +733,7 @@ void SlideBackground::NotifyItemUpdate(
{
const SvxSizeItem* pSizeItem = nullptr;
if (eState >= SfxItemState::DEFAULT)
- pSizeItem = dynamic_cast< const SvxSizeItem* >(pState);
+ pSizeItem = dynamic_cast<const SvxSizeItem*>(pState);
if (pSizeItem)
{
Size aPaperSize = pSizeItem->GetSize();
@@ -748,10 +748,12 @@ void SlideBackground::NotifyItemUpdate(
case SID_ATTR_PAGE:
{
- if (eState >= SfxItemState::DEFAULT &&
- pState && dynamic_cast< const SvxPageItem *>( pState ) != nullptr)
+ const SvxPageItem* pPageItem = nullptr;
+ if (eState >= SfxItemState::DEFAULT)
+ pPageItem = dynamic_cast<const SvxPageItem*>(pState);
+ if (pPageItem)
{
- mpPageItem.reset( static_cast<SvxPageItem*>(pState->Clone()) );
+ mpPageItem.reset(static_cast<SvxPageItem*>(pPageItem->Clone()));
bool bIsLandscape = mpPageItem->IsLandscape();
mpPaperOrientation->SelectEntryPos( bIsLandscape ? 0 : 1 );
}
@@ -762,8 +764,9 @@ void SlideBackground::NotifyItemUpdate(
{
const SvxLongLRSpaceItem* pLRItem = nullptr;
if (eState >= SfxItemState::DEFAULT)
- {
pLRItem = dynamic_cast<const SvxLongLRSpaceItem*>(pState);
+ if (pLRItem)
+ {
m_nPageLeftMargin = pLRItem->GetLeft();
m_nPageRightMargin = pLRItem->GetRight();
SetFieldUnit(*m_pLeftMarginEdit, meFieldUnit, true);
@@ -778,8 +781,9 @@ void SlideBackground::NotifyItemUpdate(
{
const SvxLongULSpaceItem* pULItem = nullptr;
if (eState >= SfxItemState::DEFAULT)
- {
pULItem = dynamic_cast<const SvxLongULSpaceItem*>(pState);
+ if (pULItem)
+ {
m_nPageTopMargin = pULItem->GetUpper();
m_nPageBottomMargin = pULItem->GetLower();
SetFieldUnit(*m_pTopMarginEdit, meFieldUnit, true);