Skip to content
This repository
Browse code

Fix color tag didn't hide bug introduced by PR2725.

  • Loading branch information...
commit 937e565410c19c0c3c3651c467c919a69cf027a2 1 parent bf91362
ulion authored May 13, 2013

Showing 1 changed file with 4 additions and 1 deletion. Show diff stats Hide diff stats

  1. 5  xbmc/guilib/GUITextLayout.cpp
5  xbmc/guilib/GUITextLayout.cpp
@@ -354,6 +354,7 @@ void CGUITextLayout::ParseText(const CStdStringW &text, uint32_t defaultStyle, v
354 354
   {
355 355
     uint32_t newStyle = 0;
356 356
     color_t newColor = currentColor;
  357
+    bool colorTagChange = false;
357 358
     bool newLine = false;
358 359
     // have a [ - check if it's an ON or OFF switch
359 360
     bool on(true);
@@ -418,17 +419,19 @@ void CGUITextLayout::ParseText(const CStdStringW &text, uint32_t defaultStyle, v
418 419
           // reuse existing color
419 420
           newColor = it - colors.begin();
420 421
         colorStack.push(newColor);
  422
+        colorTagChange = true;
421 423
       }
422 424
       else if (!on && finish == pos + 5 && colorStack.size() > 1)
423 425
       { // revert to previous color
424 426
         colorStack.pop();
425 427
         newColor = colorStack.top();
  428
+        colorTagChange = true;
426 429
       }
427 430
       if (finish != CStdString::npos)
428 431
         pos = finish + 1;
429 432
     }
430 433
 
431  
-    if (newStyle || newColor != currentColor || newLine)
  434
+    if (newStyle || colorTagChange || newLine)
432 435
     { // we have a new style or a new color, so format up the previous segment
433 436
       CStdStringW subText = text.Mid(startPos, endPos - startPos);
434 437
       if (currentStyle & FONT_STYLE_UPPERCASE)

0 notes on commit 937e565

Please sign in to comment.
Something went wrong with that request. Please try again.