summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/source/filter/ww1/fltshell.cxx6
1 files changed, 4 insertions, 2 deletions
diff --git a/sw/source/filter/ww1/fltshell.cxx b/sw/source/filter/ww1/fltshell.cxx
index 51e0a65ab885..238fb74fbc71 100644
--- a/sw/source/filter/ww1/fltshell.cxx
+++ b/sw/source/filter/ww1/fltshell.cxx
@@ -325,6 +325,8 @@ SwFltStackEntry* SwFltControlStack::SetAttr(const SwPosition& rPos,
myEIter aI = maEntries.begin();
while (aI != maEntries.end())
{
+ bool bLastEntry = aI == maEntries.end() - 1;
+
SwFltStackEntry& rEntry = *aI;
if (rEntry.bOpen)
{
@@ -350,7 +352,7 @@ SwFltStackEntry* SwFltControlStack::SetAttr(const SwPosition& rPos,
{
rEntry.bConsumedByField = consumedByField;
rEntry.SetEndPos(rPos);
- if (nAttrId == rEntry.pAttr->Which())
+ if (bLastEntry && nAttrId == rEntry.pAttr->Which())
{
//potential candidate for merging with an identical
//property beginning at rPos
@@ -377,7 +379,7 @@ SwFltStackEntry* SwFltControlStack::SetAttr(const SwPosition& rPos,
//we advance to the next node, or finish processing the document
if (rEntry.m_aPtPos.m_nNode.GetIndex() == aFltPos.m_nNode.GetIndex())
{
- if (nAttrId == rEntry.pAttr->Which() &&
+ if (bLastEntry && nAttrId == rEntry.pAttr->Which() &&
rEntry.m_aPtPos.m_nCntnt == aFltPos.m_nCntnt)
{
//potential candidate for merging with an identical