diff options
author | mad@chromium.org <mad@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-26 19:31:50 +0000 |
---|---|---|
committer | mad@chromium.org <mad@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-26 19:31:50 +0000 |
commit | 7bc411e754d029fad76bb0420a4a72cc5fe19382 (patch) | |
tree | 310cdfb97299a8da0ed6212972833c23949b6604 /chrome/browser/importer | |
parent | da10ffa3b4ed4ce6905ce35a36f308638b0eef72 (diff) | |
download | chromium_src-7bc411e754d029fad76bb0420a4a72cc5fe19382.zip chromium_src-7bc411e754d029fad76bb0420a4a72cc5fe19382.tar.gz chromium_src-7bc411e754d029fad76bb0420a4a72cc5fe19382.tar.bz2 |
Revert change made in http://codereview.chromium.org/10925.
It was mistakenly resting the wrong iterator, so I also renamed the outer one to avoid confusion.
BUG=2569
Review URL: http://codereview.chromium.org/28200
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10500 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/importer')
-rw-r--r-- | chrome/browser/importer/firefox_importer_utils.cc | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/chrome/browser/importer/firefox_importer_utils.cc b/chrome/browser/importer/firefox_importer_utils.cc index 023fcf9..c546727 100644 --- a/chrome/browser/importer/firefox_importer_utils.cc +++ b/chrome/browser/importer/firefox_importer_utils.cc @@ -195,14 +195,12 @@ void ParseSearchEnginesFromXMLFiles(const std::vector<std::wstring>& xml_files, std::map<std::wstring, TemplateURL*> search_engine_for_url; std::string content; - bool need_to_increment_iter; // The first XML file represents the default search engine in Firefox 3, so we // need to keep it on top of the list. TemplateURL* default_turl = NULL; - for (std::vector<std::wstring>::const_iterator iter = xml_files.begin(); - iter != xml_files.end();) { - need_to_increment_iter = true; - file_util::ReadFileToString(*iter, &content); + for (std::vector<std::wstring>::const_iterator file_iter = xml_files.begin(); + file_iter != xml_files.end(); ++file_iter) { + file_util::ReadFileToString(*file_iter, &content); TemplateURL* template_url = new TemplateURL(); FirefoxURLParameterFilter param_filter; if (TemplateURLParser::Parse( @@ -218,8 +216,7 @@ void ParseSearchEnginesFromXMLFiles(const std::vector<std::wstring>& xml_files, // returns a vector with first Firefox default search engines and then // the user's ones. We want to give priority to the user ones. delete iter->second; - iter = search_engine_for_url.erase(iter); - need_to_increment_iter = false; + search_engine_for_url.erase(iter); } // Give this a keyword to facilitate tab-to-search, if possible. template_url->set_keyword(TemplateURLModel::GenerateKeyword(GURL(url), @@ -232,8 +229,6 @@ void ParseSearchEnginesFromXMLFiles(const std::vector<std::wstring>& xml_files, delete template_url; } content.clear(); - if (need_to_increment_iter) - ++iter; } // Put the results in the |search_engines| vector. |