Kaydet (Commit) e37a33f5 authored tarafından Zolnai Tamás's avatar Zolnai Tamás

In some case character border merge is called twice

Change-Id: I206b3a448b45c918070bb73074bea79e94231297
üst 3da52a1f
...@@ -2639,11 +2639,15 @@ void SwTxtFormatter::MergeCharacterBorder( SwLinePortion& rPortion, SwTxtFormatI ...@@ -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 // The current portion isn't inserted into the portion chain yet, so the info's
// last portion will be the previous one // last portion will be the previous one
if( rInf.GetLast() && rInf.GetLast() != &rPortion && // For para portion (special case) if( rInf.GetLast() && rInf.GetLast() != &rPortion && // For para portion (special case)
rInf.GetLast()->GetJoinBorderWithNext()) rInf.GetLast()->GetJoinBorderWithNext() )
{ {
rPortion.SetJoinBorderWithPrev(true); // In some case border merge is called twice to the portion
if( rPortion.InTxtGrp() && rPortion.Width() > aCurFont.GetLeftBorderSpace() ) if( !rPortion.GetJoinBorderWithPrev() )
rPortion.Width(rPortion.Width() - aCurFont.GetLeftBorderSpace()); {
rPortion.SetJoinBorderWithPrev(true);
if( rPortion.InTxtGrp() && rPortion.Width() > aCurFont.GetLeftBorderSpace() )
rPortion.Width(rPortion.Width() - aCurFont.GetLeftBorderSpace());
}
} }
else else
{ {
...@@ -2653,18 +2657,22 @@ void SwTxtFormatter::MergeCharacterBorder( SwLinePortion& rPortion, SwTxtFormatI ...@@ -2653,18 +2657,22 @@ void SwTxtFormatter::MergeCharacterBorder( SwLinePortion& rPortion, SwTxtFormatI
// Get next portion's font // Get next portion's font
bool bSeek = false; bool bSeek = false;
if( !rInf.IsFull() // Last portion of the line (in case of line break) if( !rInf.IsFull() && // Not the last portion of the line (in case of line break)
&& rInf.GetIdx() + rPortion.GetLen() != rInf.GetTxt().getLength() ) // Last portion of the paragraph rInf.GetIdx() + rPortion.GetLen() != rInf.GetTxt().getLength() ) // Not the last portion of the paragraph
bSeek = Seek(rInf.GetIdx() + rPortion.GetLen()); 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()) ) if( bSeek && GetFnt()->HasBorder() && ::lcl_HasSameBorder(aCurFont, *GetFnt()) )
{ {
rPortion.SetJoinBorderWithNext(true); // In some case border merge is called twice to the portion
if( rPortion.InTxtGrp() && rPortion.Width() > aCurFont.GetRightBorderSpace() ) if( !rPortion.GetJoinBorderWithNext() )
rPortion.Width(rPortion.Width() - aCurFont.GetRightBorderSpace()); {
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 else
{ {
rPortion.SetJoinBorderWithNext(false); rPortion.SetJoinBorderWithNext(false);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment