Ticket #10559: fix.patch

File fix.patch, 1.4 KB (added by KapiX, 10 years ago)
  • src/preferences/datatranslations/DataTranslationsWindow.cpp

    From 4c94b0803f7168188043b700083db42280428185 Mon Sep 17 00:00:00 2001
    From: Kacper Kasper <kacperkasper@gmail.com>
    Date: Tue, 18 Feb 2014 07:37:07 +0000
    Subject: [PATCH] Fix small visual glitch in DataTranslations' Info window
    
    * When translations did not match, FindFirst returned negative index
    resulting in bold font style "leaking" into translator's name.
    ---
     src/preferences/datatranslations/DataTranslationsWindow.cpp | 5 +++--
     1 file changed, 3 insertions(+), 2 deletions(-)
    
    diff --git a/src/preferences/datatranslations/DataTranslationsWindow.cpp b/src/preferences/datatranslations/DataTranslationsWindow.cpp
    index 7cf78d8..3e54c98 100644
    a b  
    11/*
    2  * Copyright 2002-2010, Haiku, Inc.
     2 * Copyright 2002-2014, Haiku, Inc.
    33 * Distributed under the terms of the MIT license.
    44 *
    55 * Authors:
    DataTranslationsWindow::_ShowInfoAlert(int32 id)  
    279279        B_TRANSLATE("Info:"), B_TRANSLATE("Path:"), NULL };
    280280    for (int32 i = 0; labels[i]; i++) {
    281281        int32 index = message.FindFirst(labels[i]);
    282         view->SetFontAndColor(index, index + strlen(labels[i]), &font);
     282        if (index >= 0)
     283            view->SetFontAndColor(index, index + strlen(labels[i]), &font);
    283284    }
    284285
    285286    alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);