[Libreoffice-commits] core.git: cui/source
Caolán McNamara
caolanm at redhat.com
Tue Oct 18 17:57:55 UTC 2016
cui/source/tabpages/tpgradnt.cxx | 6 ++++--
cui/source/tabpages/tphatch.cxx | 6 ++++--
cui/source/tabpages/tppattern.cxx | 6 ++++--
3 files changed, 12 insertions(+), 6 deletions(-)
New commits:
commit 0a7d06cfc37f94f8a7571f023e1b78b6451a5367
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Oct 18 18:56:29 2016 +0100
make area tab page of paragraph properties not crash
cause the parent dialog isn't a SvxAreaTabDialog
Change-Id: I1a1311ca4b414c797d4b3e72208e64bffea863ca
diff --git a/cui/source/tabpages/tpgradnt.cxx b/cui/source/tabpages/tpgradnt.cxx
index 68d2871..503e94a 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 9b6c5ad..7469d15 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 c156d24..2ae6dfd79 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();
More information about the Libreoffice-commits
mailing list