1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "printing/page_range.h"
10 const std::size_t kMaxNumberOfPages
= 100000;
16 std::vector
<int> PageRange::GetPages(const PageRanges
& ranges
) {
17 // TODO(vitalybuka): crbug.com/95548 Remove this method as part fix.
19 for (unsigned i
= 0; i
< ranges
.size(); ++i
) {
20 const PageRange
& range
= ranges
[i
];
21 // Ranges are inclusive.
22 for (int i
= range
.from
; i
<= range
.to
; ++i
) {
24 if (pages
.size() >= kMaxNumberOfPages
)
25 return std::vector
<int>(pages
.begin(), pages
.end());
28 return std::vector
<int>(pages
.begin(), pages
.end());
31 } // namespace printing