[Libreoffice-commits] .: sw/source

Caolán McNamara caolan at kemper.freedesktop.org
Fri Oct 28 04:29:55 PDT 2011


 sw/source/core/doc/docfmt.cxx |   39 +++++++++++++++++++++------------------
 1 file changed, 21 insertions(+), 18 deletions(-)

New commits:
commit ea95d600ded32afdde8b59d88d062731a77a6b82
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Oct 28 12:10:31 2011 +0100

    check for invalidated item with IsInvalidItem

diff --git a/sw/source/core/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index b0edf69..16a0780 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;
+            }
         }
     }
 


More information about the Libreoffice-commits mailing list