Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(55)

Side by Side Diff: chrome/browser/autofill/autofill_profile.cc

Issue 5521005: AutoFillProfile: Don't clobber data on self-assignment (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Moar bettar Created 10 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/autofill/autofill_profile_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/autofill/autofill_profile.h" 5 #include "chrome/browser/autofill/autofill_profile.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <list> 8 #include <list>
9 #include <map> 9 #include <map>
10 #include <set> 10 #include <set>
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
372 } 372 }
373 } 373 }
374 374
375 bool AutoFillProfile::IsEmpty() const { 375 bool AutoFillProfile::IsEmpty() const {
376 FieldTypeSet types; 376 FieldTypeSet types;
377 GetAvailableFieldTypes(&types); 377 GetAvailableFieldTypes(&types);
378 return types.empty(); 378 return types.empty();
379 } 379 }
380 380
381 void AutoFillProfile::operator=(const AutoFillProfile& source) { 381 void AutoFillProfile::operator=(const AutoFillProfile& source) {
382 if (this == &source)
383 return;
384
382 label_ = source.label_; 385 label_ = source.label_;
383 guid_ = source.guid_; 386 guid_ = source.guid_;
384 387
385 STLDeleteContainerPairSecondPointers(personal_info_.begin(), 388 STLDeleteContainerPairSecondPointers(personal_info_.begin(),
386 personal_info_.end()); 389 personal_info_.end());
387 personal_info_.clear(); 390 personal_info_.clear();
388 391
389 FormGroupMap::const_iterator iter; 392 FormGroupMap::const_iterator iter;
390 for (iter = source.personal_info_.begin(); 393 for (iter = source.personal_info_.begin();
391 iter != source.personal_info_.end(); 394 iter != source.personal_info_.end();
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
495 << UTF16ToUTF8(profile.GetFieldText(AutoFillType(ADDRESS_HOME_ZIP))) 498 << UTF16ToUTF8(profile.GetFieldText(AutoFillType(ADDRESS_HOME_ZIP)))
496 << " " 499 << " "
497 << UTF16ToUTF8(profile.GetFieldText(AutoFillType(ADDRESS_HOME_COUNTRY))) 500 << UTF16ToUTF8(profile.GetFieldText(AutoFillType(ADDRESS_HOME_COUNTRY)))
498 << " " 501 << " "
499 << UTF16ToUTF8(profile.GetFieldText(AutoFillType( 502 << UTF16ToUTF8(profile.GetFieldText(AutoFillType(
500 PHONE_HOME_WHOLE_NUMBER))) 503 PHONE_HOME_WHOLE_NUMBER)))
501 << " " 504 << " "
502 << UTF16ToUTF8(profile.GetFieldText(AutoFillType( 505 << UTF16ToUTF8(profile.GetFieldText(AutoFillType(
503 PHONE_FAX_WHOLE_NUMBER))); 506 PHONE_FAX_WHOLE_NUMBER)));
504 } 507 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/autofill/autofill_profile_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698