Ticket #3651: 3651-FixBlockSelection.patch

File 3651-FixBlockSelection.patch, 939 bytes (added by dsizzle, 5 years ago)

Patch to fix off-by-one errors in selection of Unicode block

  • src/apps/charactermap/UnicodeBlockView.cpp

    From f17944660da6ca299bccc3a97e30d72e55d46f5e Mon Sep 17 00:00:00 2001
    From: dsizzle <dcieslak@yahoo.com>
    Date: Wed, 26 Nov 2014 17:24:39 +0000
    Subject: [PATCH] 3651: Enhancement 1 - Select correct list item via the stored
     index number instead of relying on listbox index
    
    ---
     src/apps/charactermap/UnicodeBlockView.cpp | 10 ++++++++--
     1 file changed, 8 insertions(+), 2 deletions(-)
    
    diff --git a/src/apps/charactermap/UnicodeBlockView.cpp b/src/apps/charactermap/UnicodeBlockView.cpp
    index a643875..b40e40b 100644
    a b UnicodeBlockView::SelectBlockForCharacter(uint32 character)  
    133133            break;
    134134        }
    135135
    136         Select(i);
    137         ScrollToSelection();
     136        BlockListItem* block = fBlocks.ItemAt(i);
     137       
     138        int32 blockNum = IndexOf(block);
     139       
     140        if (blockNum >= 0) {
     141            Select(blockNum);
     142            ScrollToSelection();
     143        }
    138144    }
    139145}