diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-10-28 12:10:31 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-10-28 12:29:30 +0100 |
commit | ea95d600ded32afdde8b59d88d062731a77a6b82 (patch) | |
tree | 0b591eb52369f6aaceb26c73a7d9e32af58d9687 | |
parent | d0fb0305c4c0d46a4941e5f2464cbddb3fc72c70 (diff) |
check for invalidated item with IsInvalidItem
-rw-r--r-- | sw/source/core/doc/docfmt.cxx | 39 |
1 files changed, 21 insertions, 18 deletions
diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx index b0edf69833fe..16a0780ffc67 100644 --- a/sw/source/core/doc/docfmt.cxx +++ b/sw/source/core/doc/docfmt.cxx @@ -536,26 +536,29 @@ lcl_InsAttr(SwDoc *const pDoc, const SwPaM &rRg, const SfxItemSet& rChgSet, { SfxItemIter aIter( rChgSet ); const SfxPoolItem* pItem = aIter.FirstItem(); - const sal_uInt16 nWhich = pItem->Which(); - - if ( isCHRATR(nWhich) || - (RES_TXTATR_CHARFMT == nWhich) || - (RES_TXTATR_INETFMT == nWhich) || - (RES_TXTATR_AUTOFMT == nWhich) || - (RES_TXTATR_UNKNOWN_CONTAINER == nWhich) ) + if (!IsInvalidItem(pItem)) { - pCharSet = &rChgSet; - bCharAttr = true; - } + const sal_uInt16 nWhich = pItem->Which(); - if ( isPARATR(nWhich) - || isPARATR_LIST(nWhich) - || isFRMATR(nWhich) - || isGRFATR(nWhich) - || isUNKNOWNATR(nWhich) ) - { - pOtherSet = &rChgSet; - bOtherAttr = true; + if ( isCHRATR(nWhich) || + (RES_TXTATR_CHARFMT == nWhich) || + (RES_TXTATR_INETFMT == nWhich) || + (RES_TXTATR_AUTOFMT == nWhich) || + (RES_TXTATR_UNKNOWN_CONTAINER == nWhich) ) + { + pCharSet = &rChgSet; + bCharAttr = true; + } + + if ( isPARATR(nWhich) + || isPARATR_LIST(nWhich) + || isFRMATR(nWhich) + || isGRFATR(nWhich) + || isUNKNOWNATR(nWhich) ) + { + pOtherSet = &rChgSet; + bOtherAttr = true; + } } } |