diff options
author | Oliver-Rainer Wittmann <orw@apache.org> | 2013-04-24 14:24:02 +0000 |
---|---|---|
committer | Michael Meeks <michael.meeks@suse.com> | 2013-05-20 11:33:22 +0100 |
commit | 6c4b11e3a366b16796ce31761ce15119233c640c (patch) | |
tree | 348180a5706444d4c4a6fb0222e6042430630f52 /svx/source/sidebar/paragraph/ParaPropertyPanel.cxx | |
parent | b8fe3f84a60ea73aed9748844aee80441eb0fc7d (diff) |
Resolves: #i122074# paragraph property panel
correct enable/disable of indentation increase/decrease controls
(cherry picked from commit cc9eaeaaa2ab279db0bf9a8fa63034333dbdaae3)
Change-Id: Ia7c676435859027f0526d6253db771e2359bb7cc
Diffstat (limited to 'svx/source/sidebar/paragraph/ParaPropertyPanel.cxx')
-rw-r--r-- | svx/source/sidebar/paragraph/ParaPropertyPanel.cxx | 35 |
1 files changed, 14 insertions, 21 deletions
diff --git a/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx b/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx index e4d714113fb1..5716de9e03d5 100644 --- a/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx +++ b/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx @@ -1280,9 +1280,9 @@ void ParaPropertyPanel::StateChangedIndentImpl( sal_uInt16 /*nSID*/, SfxItemStat maTbxIndent_IncDec->Enable(); maTbxIndent_IncDec->EnableItem(ID_HANGING_INDENT, sal_True); - if(maContext.GetCombinedContext() != CombinedEnumContext(Application_Writer, Context_Text) - && maContext.GetCombinedContext() != CombinedEnumContext(Application_Writer, Context_Default) - && maContext.GetCombinedContext() != CombinedEnumContext(Application_Writer, Context_Table)) + if ( maContext.GetCombinedContext() != CombinedEnumContext(Application_Writer, Context_Text) + && maContext.GetCombinedContext() != CombinedEnumContext(Application_Writer, Context_Default) + && maContext.GetCombinedContext() != CombinedEnumContext(Application_Writer, Context_Table) ) { maTbxIndent_IncDec->EnableItem(BT_TBX_INDENT_INC, sal_True); maTbxIndent_IncDec->EnableItem(BT_TBX_INDENT_DEC, sal_True); @@ -1407,27 +1407,20 @@ void ParaPropertyPanel::StateChangeOutLineImpl( sal_uInt16 nSID, SfxItemState eS void ParaPropertyPanel::StateChangeIncDecImpl( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState ) { - if (nSID==SID_INC_INDENT) + if ( ( maContext.GetCombinedContext() == CombinedEnumContext(Application_Writer, Context_Text) + || maContext.GetCombinedContext() == CombinedEnumContext(Application_Writer, Context_Default) + || maContext.GetCombinedContext() == CombinedEnumContext(Application_Writer, Context_Table) ) + && ( nSID == SID_INC_INDENT || nSID == SID_DEC_INDENT ) ) { - if( pState && eState == SFX_ITEM_UNKNOWN ) - maTbxIndent_IncDec->EnableItem(BT_TBX_INDENT_INC, sal_True); - else - if( maContext.GetCombinedContext() != CombinedEnumContext(Application_Writer, Context_Text) && - maContext.GetCombinedContext() != CombinedEnumContext(Application_Writer, Context_Default) && - maContext.GetCombinedContext() != CombinedEnumContext(Application_Writer, Context_Table) ) - maTbxIndent_IncDec->EnableItem(BT_TBX_INDENT_INC, sal_False); - } - if (nSID==SID_DEC_INDENT) - { - if( pState && eState == SFX_ITEM_UNKNOWN ) - maTbxIndent_IncDec->EnableItem(BT_TBX_INDENT_DEC, sal_True); - else - if( maContext.GetCombinedContext() != CombinedEnumContext(Application_Writer, Context_Text) && - maContext.GetCombinedContext() != CombinedEnumContext(Application_Writer, Context_Default) && - maContext.GetCombinedContext() != CombinedEnumContext(Application_Writer, Context_Table) ) - maTbxIndent_IncDec->EnableItem(BT_TBX_INDENT_DEC, sal_False); + // Writer's text shell is the only one which provides reasonable states for Slots SID_INC_INDENT and SID_DEC_INDENT + // - namely SFX_ITEM_UNKNOWN and SFX_ITEM_DISABLED + maTbxIndent_IncDec->EnableItem( + nSID == SID_INC_INDENT ? BT_TBX_INDENT_INC : BT_TBX_INDENT_DEC, + ( pState && eState == SFX_ITEM_UNKNOWN ) ? sal_True : sal_False ); } } + + // Add toggle state for numbering and bullet icons void ParaPropertyPanel::StateChangeBulletNumImpl( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState ) { |