mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 08:12:05 +00:00
fix bug 18398. Make sure the startOffset and textWidth get reset in the while loop
This commit is contained in:
parent
37a95b7bc6
commit
6773500b62
@ -1099,13 +1099,14 @@ nsTextFrame::PaintTextDecorations(nsIRenderingContext& aRenderingContext,
|
||||
if (aDetails){
|
||||
nsRect rect;
|
||||
GetRect(rect);
|
||||
PRInt32 startOffset = 0;
|
||||
PRInt32 textWidth = 0;
|
||||
while(aDetails){
|
||||
const nscoord* sp= aSpacing;
|
||||
PRInt32 startOffset = 0;
|
||||
PRInt32 textWidth = 0;
|
||||
PRInt32 start = PR_MAX(0,(aDetails->mStart - (PRInt32)aIndex));
|
||||
PRInt32 end = PR_MIN((PRInt32)aLength,(aDetails->mEnd - (PRInt32)aIndex));
|
||||
PRInt32 i;
|
||||
if (start < end && (aLength - start) > 0)
|
||||
if ((start < end) && ((aLength - start) > 0))
|
||||
{
|
||||
//aDetails allready processed to have offsets from frame start not content offsets
|
||||
if (start < end){
|
||||
@ -1113,18 +1114,18 @@ nsTextFrame::PaintTextDecorations(nsIRenderingContext& aRenderingContext,
|
||||
textWidth = aWidth;
|
||||
else {
|
||||
if (aDetails->mStart > 0){
|
||||
if (aSpacing)
|
||||
if (sp)
|
||||
{
|
||||
for (i = 0; i < start;i ++){
|
||||
startOffset += *aSpacing ++;
|
||||
startOffset += *sp ++;
|
||||
}
|
||||
}
|
||||
else
|
||||
aRenderingContext.GetWidth(aText, start, startOffset);
|
||||
}
|
||||
if (aSpacing){
|
||||
if (sp){
|
||||
for (i = start; i < end;i ++){
|
||||
textWidth += *aSpacing ++;
|
||||
textWidth += *sp ++;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -1099,13 +1099,14 @@ nsTextFrame::PaintTextDecorations(nsIRenderingContext& aRenderingContext,
|
||||
if (aDetails){
|
||||
nsRect rect;
|
||||
GetRect(rect);
|
||||
PRInt32 startOffset = 0;
|
||||
PRInt32 textWidth = 0;
|
||||
while(aDetails){
|
||||
const nscoord* sp= aSpacing;
|
||||
PRInt32 startOffset = 0;
|
||||
PRInt32 textWidth = 0;
|
||||
PRInt32 start = PR_MAX(0,(aDetails->mStart - (PRInt32)aIndex));
|
||||
PRInt32 end = PR_MIN((PRInt32)aLength,(aDetails->mEnd - (PRInt32)aIndex));
|
||||
PRInt32 i;
|
||||
if (start < end && (aLength - start) > 0)
|
||||
if ((start < end) && ((aLength - start) > 0))
|
||||
{
|
||||
//aDetails allready processed to have offsets from frame start not content offsets
|
||||
if (start < end){
|
||||
@ -1113,18 +1114,18 @@ nsTextFrame::PaintTextDecorations(nsIRenderingContext& aRenderingContext,
|
||||
textWidth = aWidth;
|
||||
else {
|
||||
if (aDetails->mStart > 0){
|
||||
if (aSpacing)
|
||||
if (sp)
|
||||
{
|
||||
for (i = 0; i < start;i ++){
|
||||
startOffset += *aSpacing ++;
|
||||
startOffset += *sp ++;
|
||||
}
|
||||
}
|
||||
else
|
||||
aRenderingContext.GetWidth(aText, start, startOffset);
|
||||
}
|
||||
if (aSpacing){
|
||||
if (sp){
|
||||
for (i = start; i < end;i ++){
|
||||
textWidth += *aSpacing ++;
|
||||
textWidth += *sp ++;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user