diff options
author | Zolnai Tamás <zolnaitamas2000@gmail.com> | 2013-09-12 12:52:51 +0200 |
---|---|---|
committer | Zolnai Tamás <zolnaitamas2000@gmail.com> | 2013-09-15 18:45:58 +0200 |
commit | e37a33f5743ab8f3e31a919586842f6f8952d381 (patch) | |
tree | 57e84d248b1a3cf90763e5ead8e4b80fbbbb556f | |
parent | 3da52a1f5783ee1fd6fe7f741920b0450305f1b6 (diff) |
In some case character border merge is called twice
Change-Id: I206b3a448b45c918070bb73074bea79e94231297
-rw-r--r-- | sw/source/core/text/itrform2.cxx | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx index 05d6854abd01..0b9074f6b2c8 100644 --- a/sw/source/core/text/itrform2.cxx +++ b/sw/source/core/text/itrform2.cxx @@ -2639,11 +2639,15 @@ void SwTxtFormatter::MergeCharacterBorder( SwLinePortion& rPortion, SwTxtFormatI // The current portion isn't inserted into the portion chain yet, so the info's // last portion will be the previous one if( rInf.GetLast() && rInf.GetLast() != &rPortion && // For para portion (special case) - rInf.GetLast()->GetJoinBorderWithNext()) + rInf.GetLast()->GetJoinBorderWithNext() ) { - rPortion.SetJoinBorderWithPrev(true); - if( rPortion.InTxtGrp() && rPortion.Width() > aCurFont.GetLeftBorderSpace() ) - rPortion.Width(rPortion.Width() - aCurFont.GetLeftBorderSpace()); + // In some case border merge is called twice to the portion + if( !rPortion.GetJoinBorderWithPrev() ) + { + rPortion.SetJoinBorderWithPrev(true); + if( rPortion.InTxtGrp() && rPortion.Width() > aCurFont.GetLeftBorderSpace() ) + rPortion.Width(rPortion.Width() - aCurFont.GetLeftBorderSpace()); + } } else { @@ -2653,18 +2657,22 @@ void SwTxtFormatter::MergeCharacterBorder( SwLinePortion& rPortion, SwTxtFormatI // Get next portion's font bool bSeek = false; - if( !rInf.IsFull() // Last portion of the line (in case of line break) - && rInf.GetIdx() + rPortion.GetLen() != rInf.GetTxt().getLength() ) // Last portion of the paragraph + if( !rInf.IsFull() && // Not the last portion of the line (in case of line break) + rInf.GetIdx() + rPortion.GetLen() != rInf.GetTxt().getLength() ) // Not the last portion of the paragraph bSeek = Seek(rInf.GetIdx() + rPortion.GetLen()); - // If next portion has the same font then merge + // If next portion has the same border then merge if( bSeek && GetFnt()->HasBorder() && ::lcl_HasSameBorder(aCurFont, *GetFnt()) ) { - rPortion.SetJoinBorderWithNext(true); - if( rPortion.InTxtGrp() && rPortion.Width() > aCurFont.GetRightBorderSpace() ) - rPortion.Width(rPortion.Width() - aCurFont.GetRightBorderSpace()); + // In some case border merge is called twice to the portion + if( !rPortion.GetJoinBorderWithNext() ) + { + rPortion.SetJoinBorderWithNext(true); + if( rPortion.InTxtGrp() && rPortion.Width() > aCurFont.GetRightBorderSpace() ) + rPortion.Width(rPortion.Width() - aCurFont.GetRightBorderSpace()); + } } - // If this is the last portion of the merge group than make the real height merge + // If this is the last portion of the merge group then make the real height merge else { rPortion.SetJoinBorderWithNext(false); |