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

Side by Side Diff: chrome/browser/printing/page_number.cc

Issue 2890: Include chrome/browser/SConscript in Linux build.... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 12 years, 3 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/net/dns_host_info.cc ('k') | chrome/browser/printing/page_setup.h » ('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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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/printing/page_number.h" 5 #include "chrome/browser/printing/page_number.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "chrome/browser/printing/print_settings.h" 8 #include "chrome/browser/printing/print_settings.h"
9 9
10 namespace printing { 10 namespace printing {
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 // Switch to next page. 49 // Switch to next page.
50 if (++page_number_ == document_page_count_) { 50 if (++page_number_ == document_page_count_) {
51 // Finished. 51 // Finished.
52 *this = npos(); 52 *this = npos();
53 } 53 }
54 } else { 54 } else {
55 // Switch to next page. 55 // Switch to next page.
56 ++page_number_; 56 ++page_number_;
57 // Page ranges are inclusive. 57 // Page ranges are inclusive.
58 if (page_number_ > (*ranges_)[page_range_index_].to) { 58 if (page_number_ > (*ranges_)[page_range_index_].to) {
59 if (++page_range_index_ == ranges_->size()) { 59 DCHECK(ranges_->size() <= std::numeric_limits<int>::max());
60 if (++page_range_index_ == static_cast<int>(ranges_->size())) {
60 // Finished. 61 // Finished.
61 *this = npos(); 62 *this = npos();
62 } else { 63 } else {
63 page_number_ = (*ranges_)[page_range_index_].from; 64 page_number_ = (*ranges_)[page_range_index_].from;
64 } 65 }
65 } 66 }
66 } 67 }
67 return ToInt(); 68 return ToInt();
68 } 69 }
69 70
70 bool PageNumber::operator==(const PageNumber& other) const { 71 bool PageNumber::operator==(const PageNumber& other) const {
71 return page_number_ == other.page_number_ && 72 return page_number_ == other.page_number_ &&
72 page_range_index_ == other.page_range_index_; 73 page_range_index_ == other.page_range_index_;
73 } 74 }
74 bool PageNumber::operator!=(const PageNumber& other) const { 75 bool PageNumber::operator!=(const PageNumber& other) const {
75 return page_number_ != other.page_number_ || 76 return page_number_ != other.page_number_ ||
76 page_range_index_ != other.page_range_index_; 77 page_range_index_ != other.page_range_index_;
77 } 78 }
78 79
79 } // namespace printing 80 } // namespace printing
80 81
OLDNEW
« no previous file with comments | « chrome/browser/net/dns_host_info.cc ('k') | chrome/browser/printing/page_setup.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698