Suppress a test failing after the last WebKit merge.
[chromium-blink-merge.git] / printing / page_range.cc
blobffe572d7e0ee45039892f5876df9a198b7ec4a91
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
3 // found in the LICENSE file.
5 #include "printing/page_range.h"
7 #include "base/stl_util-inl.h"
9 namespace printing {
11 /* static */
12 std::vector<int> PageRange::GetPages(const PageRanges& ranges) {
13 std::set<int> pages;
14 for (unsigned i = 0; i < ranges.size(); ++i) {
15 const PageRange& range = ranges[i];
16 // Ranges are inclusive.
17 for (int i = range.from; i <= range.to; ++i) {
18 pages.insert(i);
21 return SetToVector(pages);
24 /* static */
25 int PageRange::GetTotalPages(const PageRanges& ranges) {
26 // Since ranges can overlap we need to merge them before counting
27 std::vector<int> pages = PageRange::GetPages(ranges);
28 return pages.size();
31 } // namespace printing