From 0884e6f18e136fae6213bf20aaa072920a81817a Mon Sep 17 00:00:00 2001 From: Thomas Lange Date: Wed, 14 Nov 2001 11:49:34 +0000 Subject: #94058# problem with setting/removing font effects (underline, strikeout, embossed, ...) in selections that already had more than one of each kind set now fixed. --- svx/source/dialog/chardlg.cxx | 34 ++++++++++++++++++++++++++++------ 1 file changed, 28 insertions(+), 6 deletions(-) (limited to 'svx/source/dialog/chardlg.cxx') diff --git a/svx/source/dialog/chardlg.cxx b/svx/source/dialog/chardlg.cxx index 3435752753f7..ec5e6357769f 100644 --- a/svx/source/dialog/chardlg.cxx +++ b/svx/source/dialog/chardlg.cxx @@ -2,9 +2,9 @@ * * $RCSfile: chardlg.cxx,v $ * - * $Revision: 1.67 $ + * $Revision: 1.68 $ * - * last change: $Author: pb $ $Date: 2001-11-08 06:23:25 $ + * last change: $Author: tl $ $Date: 2001-11-14 12:49:34 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -2200,9 +2200,17 @@ BOOL SvxCharEffectsPage::FillItemSet( SfxItemSet& rSet ) if ( pOld ) { + //! if there are different underline styles in the selection the + //! item-state in the 'rOldSet' will be invalid. In this case + //! changing the underline style will be allowed if a style is + //! selected in the listbox. + BOOL bAllowChg = LISTBOX_ENTRY_NOTFOUND != nPos && + SFX_ITEM_DEFAULT > rOldSet.GetItemState( nWhich, TRUE ); + const SvxUnderlineItem& rItem = *( (const SvxUnderlineItem*)pOld ); if ( (FontUnderline)rItem.GetValue() == eUnder && - ( UNDERLINE_NONE == eUnder || rItem.GetColor() == m_aColorLB.GetSelectEntryColor() ) ) + ( UNDERLINE_NONE == eUnder || rItem.GetColor() == m_aColorLB.GetSelectEntryColor() ) && + ! bAllowChg ) bChanged = FALSE; } @@ -2226,8 +2234,16 @@ BOOL SvxCharEffectsPage::FillItemSet( SfxItemSet& rSet ) if ( pOld ) { + //! if there are different strikeout styles in the selection the + //! item-state in the 'rOldSet' will be invalid. In this case + //! changing the strikeout style will be allowed if a style is + //! selected in the listbox. + BOOL bAllowChg = LISTBOX_ENTRY_NOTFOUND != nPos && + SFX_ITEM_DEFAULT > rOldSet.GetItemState( nWhich, TRUE ); + const SvxCrossedOutItem& rItem = *( (const SvxCrossedOutItem*)pOld ); - if ( !m_aStrikeoutLB.IsEnabled() || (FontStrikeout)rItem.GetValue() == eStrike ) + if ( !m_aStrikeoutLB.IsEnabled() + || ((FontStrikeout)rItem.GetValue() == eStrike && !bAllowChg) ) bChanged = FALSE; } @@ -2313,9 +2329,15 @@ BOOL SvxCharEffectsPage::FillItemSet( SfxItemSet& rSet ) if ( pOld ) { - const SvxCaseMapItem& rItem = *( (const SvxCaseMapItem*)pOld ); + //! if there are different effect styles in the selection the + //! item-state in the 'rOldSet' will be invalid. In this case + //! changing the effect style will be allowed if a style is + //! selected in the listbox. + BOOL bAllowChg = LISTBOX_ENTRY_NOTFOUND != nPos && + SFX_ITEM_DEFAULT > rOldSet.GetItemState( nWhich, TRUE ); - if ( (SvxCaseMap)rItem.GetValue() == eCaseMap ) + const SvxCaseMapItem& rItem = *( (const SvxCaseMapItem*)pOld ); + if ( (SvxCaseMap)rItem.GetValue() == eCaseMap && !bAllowChg ) bChanged = FALSE; } -- cgit