diff options
-rw-r--r-- | sw/source/core/text/txtfld.cxx | 23 | ||||
-rw-r--r-- | sw/source/core/txtnode/thints.cxx | 2 |
2 files changed, 23 insertions, 2 deletions
diff --git a/sw/source/core/text/txtfld.cxx b/sw/source/core/text/txtfld.cxx index 4f39e5269ae4..9bbd4558e42b 100644 --- a/sw/source/core/text/txtfld.cxx +++ b/sw/source/core/text/txtfld.cxx @@ -51,6 +51,7 @@ #include "reffld.hxx" #include "flddat.hxx" #include "fmtautofmt.hxx" +#include <svl/itemiter.hxx> static bool lcl_IsInBody( SwFrm *pFrm ) { @@ -421,7 +422,27 @@ static void checkApplyParagraphMarkFormatToNumbering( SwFont* pNumFnt, SwTxtForm && *hint->GetStart() == *hint->GetEnd() && *hint->GetStart() == node->Len()) { boost::shared_ptr<SfxItemSet> pSet(hint->GetAutoFmt().GetStyleHandle()); - pNumFnt->SetDiffFnt( pSet.get(), pIDSA ); + + // Check each item and in case it should be ignored, then clear it. + boost::shared_ptr<SfxItemSet> pCleanedSet; + if (pSet.get()) + { + pCleanedSet.reset(pSet->Clone()); + + SfxItemIter aIter(*pSet); + const SfxPoolItem* pItem = aIter.GetCurItem(); + while (true) + { + if (SwTxtNode::IsIgnoredCharFmtForNumbering(pItem->Which())) + pCleanedSet->ClearItem(pItem->Which()); + + if (aIter.IsAtEnd()) + break; + + pItem = aIter.NextItem(); + } + } + pNumFnt->SetDiffFnt(pCleanedSet.get(), pIDSA); } } } diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx index f68028279cc2..5dc8df8c4d03 100644 --- a/sw/source/core/txtnode/thints.cxx +++ b/sw/source/core/txtnode/thints.cxx @@ -1763,7 +1763,7 @@ void SwTxtNode::DelSoftHyph( const sal_Int32 nStt, const sal_Int32 nEnd ) bool SwTxtNode::IsIgnoredCharFmtForNumbering(const sal_uInt16 nWhich) { - return (nWhich == RES_CHRATR_UNDERLINE || nWhich == RES_CHRATR_BACKGROUND || nWhich == RES_CHRATR_ESCAPEMENT); + return (nWhich == RES_CHRATR_UNDERLINE || nWhich == RES_CHRATR_COLOR || nWhich == RES_CHRATR_BACKGROUND || nWhich == RES_CHRATR_ESCAPEMENT); } //In MS Word, following properties of the paragraph end position wont affect the formatting of bullets, so we ignore them: |