cc: Added inline to Tile::IsReadyToDraw
[chromium-blink-merge.git] / printing / page_range.cc
blob7a8cb84c84c70e58fdd8a23bef7fd31bad96adeb
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"
7 #include <set>
8 #include <vector>
10 namespace printing {
12 /* static */
13 std::vector<int> PageRange::GetPages(const PageRanges& ranges) {
14 std::set<int> pages;
15 for (unsigned i = 0; i < ranges.size(); ++i) {
16 const PageRange& range = ranges[i];
17 // Ranges are inclusive.
18 for (int i = range.from; i <= range.to; ++i) {
19 pages.insert(i);
22 return std::vector<int>(pages.begin(), pages.end());
25 } // namespace printing