summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-10-18 18:56:29 +0100
committerCaolán McNamara <caolanm@redhat.com>2016-10-18 18:57:33 +0100
commit0a7d06cfc37f94f8a7571f023e1b78b6451a5367 (patch)
tree9fd8456007af25641d19e97a4bcd9e86f547ac08 /cui
parent6b9804b8f2ca85e9eb42d344d17cfee7a7a9414c (diff)
make area tab page of paragraph properties not crash
cause the parent dialog isn't a SvxAreaTabDialog Change-Id: I1a1311ca4b414c797d4b3e72208e64bffea863ca
Diffstat (limited to 'cui')
-rw-r--r--cui/source/tabpages/tpgradnt.cxx6
-rw-r--r--cui/source/tabpages/tphatch.cxx6
-rw-r--r--cui/source/tabpages/tppattern.cxx6
3 files changed, 12 insertions, 6 deletions
diff --git a/cui/source/tabpages/tpgradnt.cxx b/cui/source/tabpages/tpgradnt.cxx
index 68d28719dc77..503e94abae93 100644
--- a/cui/source/tabpages/tpgradnt.cxx
+++ b/cui/source/tabpages/tpgradnt.cxx
@@ -184,8 +184,10 @@ void SvxGradientTabPage::ActivatePage( const SfxItemSet& rSet )
if( *m_pnColorListState & ChangeType::CHANGED ||
*m_pnColorListState & ChangeType::MODIFIED )
{
- if( *m_pnColorListState & ChangeType::CHANGED )
- m_pColorList = static_cast<SvxAreaTabDialog*>( GetParentDialog() )->GetNewColorList();
+ SvxAreaTabDialog* pArea = (*m_pnColorListState & ChangeType::CHANGED) ?
+ dynamic_cast<SvxAreaTabDialog*>(GetParentDialog()) : nullptr;
+ if (pArea)
+ m_pColorList = pArea->GetNewColorList();
// LbColorFrom
nPos = m_pLbColorFrom->GetSelectEntryPos();
diff --git a/cui/source/tabpages/tphatch.cxx b/cui/source/tabpages/tphatch.cxx
index 9b6c5adf1ff1..7469d15567fa 100644
--- a/cui/source/tabpages/tphatch.cxx
+++ b/cui/source/tabpages/tphatch.cxx
@@ -170,8 +170,10 @@ void SvxHatchTabPage::ActivatePage( const SfxItemSet& rSet )
if( *m_pnColorListState & ChangeType::CHANGED ||
*m_pnColorListState & ChangeType::MODIFIED )
{
- if( *m_pnColorListState & ChangeType::CHANGED )
- m_pColorList = static_cast<SvxAreaTabDialog*>( GetParentDialog() )->GetNewColorList();
+ SvxAreaTabDialog* pArea = (*m_pnColorListState & ChangeType::CHANGED) ?
+ dynamic_cast<SvxAreaTabDialog*>(GetParentDialog()) : nullptr;
+ if (pArea)
+ m_pColorList = pArea->GetNewColorList();
// LbLineColor
nPos = m_pLbLineColor->GetSelectEntryPos();
diff --git a/cui/source/tabpages/tppattern.cxx b/cui/source/tabpages/tppattern.cxx
index c156d24dd0c0..2ae6dfd79f80 100644
--- a/cui/source/tabpages/tppattern.cxx
+++ b/cui/source/tabpages/tppattern.cxx
@@ -175,8 +175,10 @@ void SvxPatternTabPage::ActivatePage( const SfxItemSet& rSet )
if( *m_pnColorListState & ChangeType::CHANGED ||
*m_pnColorListState & ChangeType::MODIFIED )
{
- if( *m_pnColorListState & ChangeType::CHANGED )
- m_pColorList = static_cast<SvxAreaTabDialog*>( GetParentDialog() )->GetNewColorList();
+ SvxAreaTabDialog* pArea = (*m_pnColorListState & ChangeType::CHANGED) ?
+ dynamic_cast<SvxAreaTabDialog*>(GetParentDialog()) : nullptr;
+ if (pArea)
+ m_pColorList = pArea->GetNewColorList();
// LbColor
nPos = m_pLbColor->GetSelectEntryPos();