diff options
author | Takeshi Abe <tabe@fixedpoint.jp> | 2011-08-24 18:41:01 +0900 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-08-24 15:05:03 +0100 |
commit | acdff77b03cb9cbc78ca2379421b36fc94389e02 (patch) | |
tree | ab575e627fdfb6a07d46f503cc2f256e2fdcb861 /sw | |
parent | 5b868092b6771e317329102b64efd464e60f1463 (diff) |
fdo#40341: hide 'math baseline alignment' unless available
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/ui/config/optpage.cxx | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx index f44c8db71657..331863f35bfe 100644 --- a/sw/source/ui/config/optpage.cxx +++ b/sw/source/ui/config/optpage.cxx @@ -1456,9 +1456,11 @@ sal_Bool SwShdwCrsrOptionsTabPage::FillItemSet( SfxItemSet& rSet ) bRet = sal_True; } - m_pWrtShell->GetDoc()->set( IDocumentSettingAccess::MATH_BASELINE_ALIGNMENT, - m_aMathBaselineAlignmentCB.IsChecked() ); - bRet |= m_aMathBaselineAlignmentCB.IsChecked() != m_aMathBaselineAlignmentCB.GetSavedValue(); + if (m_pWrtShell) { + m_pWrtShell->GetDoc()->set( IDocumentSettingAccess::MATH_BASELINE_ALIGNMENT, + m_aMathBaselineAlignmentCB.IsChecked() ); + bRet |= m_aMathBaselineAlignmentCB.IsChecked() != m_aMathBaselineAlignmentCB.GetSavedValue(); + } if( aCrsrInProtCB.IsChecked() != aCrsrInProtCB.GetSavedValue()) { @@ -1505,8 +1507,12 @@ void SwShdwCrsrOptionsTabPage::Reset( const SfxItemSet& rSet ) aFillTabRB.Check( FILL_TAB == eMode ); aFillSpaceRB.Check( FILL_SPACE == eMode ); - m_aMathBaselineAlignmentCB.Check( m_pWrtShell->GetDoc()->get( IDocumentSettingAccess::MATH_BASELINE_ALIGNMENT ) ); - m_aMathBaselineAlignmentCB.SaveValue(); + if (m_pWrtShell) { + m_aMathBaselineAlignmentCB.Check( m_pWrtShell->GetDoc()->get( IDocumentSettingAccess::MATH_BASELINE_ALIGNMENT ) ); + m_aMathBaselineAlignmentCB.SaveValue(); + } else { + m_aMathBaselineAlignmentCB.Hide(); + } if( SFX_ITEM_SET == rSet.GetItemState( FN_PARAM_CRSR_IN_PROTECTED, sal_False, &pItem )) aCrsrInProtCB.Check(((const SfxBoolItem*)pItem)->GetValue()); |