diff options
author | hbono@chromium.org <hbono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-30 08:30:44 +0000 |
---|---|---|
committer | hbono@chromium.org <hbono@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-04-30 08:30:44 +0000 |
commit | 264e3cd23191c41de8310c60d981be159f65038a (patch) | |
tree | b1ea14ef6cc79ca0772d0b9f27b024aaeac38766 /chrome/browser/views/autocomplete | |
parent | ea1d9fa94c09ed23455f62ea224c70b4e255e430 (diff) | |
download | chromium_src-264e3cd23191c41de8310c60d981be159f65038a.zip chromium_src-264e3cd23191c41de8310c60d981be159f65038a.tar.gz chromium_src-264e3cd23191c41de8310c60d981be159f65038a.tar.bz2 |
A quick fix for supporting bidirectional texts in omnibox2.
It seems the AutocompleteResultView::DrawString() function calls the AutocompleteResultView::DrawStringFragment() function even when |text_start| is greater than |text_end|, i.e. there are not matching characters.
This change filters out the above case and fixes a couple of lint errors.
Review URL: http://codereview.chromium.org/100196
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14933 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/autocomplete')
-rw-r--r-- | chrome/browser/views/autocomplete/autocomplete_popup_contents_view.cc | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/chrome/browser/views/autocomplete/autocomplete_popup_contents_view.cc b/chrome/browser/views/autocomplete/autocomplete_popup_contents_view.cc index dd7a117..41385d9 100644 --- a/chrome/browser/views/autocomplete/autocomplete_popup_contents_view.cc +++ b/chrome/browser/views/autocomplete/autocomplete_popup_contents_view.cc @@ -135,7 +135,7 @@ class AutocompleteResultView : public views::View { static SkBitmap* icon_star_; static SkBitmap* icon_star_selected_; static int icon_size_; - + static bool initialized_; static void InitClass(); @@ -414,9 +414,11 @@ int AutocompleteResultView::DrawString( int style = i->style; if (force_dim) style |= ACMatchClassification::DIM; - x += DrawStringFragment(canvas, - text.substr(text_start, text_end - text_start), - style, x, y); + if (text_start < text_end) { + x += DrawStringFragment(canvas, + text.substr(text_start, text_end - text_start), + style, x, y); + } } } return x; @@ -799,4 +801,3 @@ void AutocompletePopupContentsView::MakeCanvasTransparent( canvas->FillRectInt(0, 0, canvas->getDevice()->width(), canvas->getDevice()->height(), paint); } - |