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

Side by Side Diff: third_party/WebKit/Source/core/editing/LayoutSelection.cpp

Issue 2833343002: Change SelectionStartEnd() returning values instead of assigning into ref args. (Closed)
Patch Set: rebase Created 3 years, 8 months 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights
4 * reserved. 4 * reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 } 299 }
300 300
301 // Any new blocks that remain were not found in the old blocks dict, and so 301 // Any new blocks that remain were not found in the old blocks dict, and so
302 // they need to be updated. 302 // they need to be updated.
303 SelectedBlockMap::iterator new_blocks_end = new_selected_blocks.end(); 303 SelectedBlockMap::iterator new_blocks_end = new_selected_blocks.end();
304 for (SelectedBlockMap::iterator i = new_selected_blocks.begin(); 304 for (SelectedBlockMap::iterator i = new_selected_blocks.begin();
305 i != new_blocks_end; ++i) 305 i != new_blocks_end; ++i)
306 i->key->SetShouldInvalidateSelection(); 306 i->key->SetShouldInvalidateSelection();
307 } 307 }
308 308
309 void LayoutSelection::SelectionStartEnd(int& start_pos, int& end_pos) { 309 std::pair<int, int> LayoutSelection::SelectionStartEnd() {
310 Commit(); 310 Commit();
311 start_pos = selection_start_pos_; 311 return std::make_pair(selection_start_pos_, selection_end_pos_);
312 end_pos = selection_end_pos_;
313 } 312 }
314 313
315 void LayoutSelection::ClearSelection() { 314 void LayoutSelection::ClearSelection() {
316 // For querying Layer::compositingState() 315 // For querying Layer::compositingState()
317 // This is correct, since destroying layout objects needs to cause eager paint 316 // This is correct, since destroying layout objects needs to cause eager paint
318 // invalidations. 317 // invalidations.
319 DisableCompositingQueryAsserts disabler; 318 DisableCompositingQueryAsserts disabler;
320 319
321 SetSelection(0, -1, 0, -1, kPaintInvalidationNewMinusOld); 320 SetSelection(0, -1, 0, -1, kPaintInvalidationNewMinusOld);
322 } 321 }
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
447 446
448 o->SetShouldInvalidateSelection(); 447 o->SetShouldInvalidateSelection();
449 } 448 }
450 } 449 }
451 450
452 DEFINE_TRACE(LayoutSelection) { 451 DEFINE_TRACE(LayoutSelection) {
453 visitor->Trace(frame_selection_); 452 visitor->Trace(frame_selection_);
454 } 453 }
455 454
456 } // namespace blink 455 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/editing/LayoutSelection.h ('k') | third_party/WebKit/Source/core/layout/LayoutObject.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698