diff options
author | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-03 23:40:27 +0000 |
---|---|---|
committer | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-03-03 23:40:27 +0000 |
commit | da4eefdf3f571bd8835a2be18b267a7685c75cbd (patch) | |
tree | 465c74a28a33ebc6079e697a791313490db9fe5b /printing/printed_document.cc | |
parent | 6c1319541aee6ff89c06457b46d46bbcbcfe868f (diff) | |
download | chromium_src-da4eefdf3f571bd8835a2be18b267a7685c75cbd.zip chromium_src-da4eefdf3f571bd8835a2be18b267a7685c75cbd.tar.gz chromium_src-da4eefdf3f571bd8835a2be18b267a7685c75cbd.tar.bz2 |
Linux Printing: Properly print a subset of all pages.
BUG=59732
TEST=Open a 10 PDF, print pages 6,7,8 or pages 6-8.
Review URL: http://codereview.chromium.org/6592093
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76835 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'printing/printed_document.cc')
-rw-r--r-- | printing/printed_document.cc | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/printing/printed_document.cc b/printing/printed_document.cc index 3d8f156..1f2a939 100644 --- a/printing/printed_document.cc +++ b/printing/printed_document.cc @@ -80,6 +80,12 @@ void PrintedDocument::SetPage(int page_number, { base::AutoLock lock(lock_); mutable_.pages_[page_number] = page; + +#if defined(OS_POSIX) && !defined(OS_MACOSX) + if (page_number < mutable_.first_page) + mutable_.first_page = page_number; +#endif + if (mutable_.shrink_factor == 0) { mutable_.shrink_factor = shrink; } else { @@ -111,11 +117,10 @@ bool PrintedDocument::IsComplete() const { return false; for (; page != PageNumber::npos(); ++page) { - bool metafile_must_be_valid = -#if defined(OS_WIN) || defined(OS_MAC) - true; +#if defined(OS_WIN) || defined(OS_MACOSX) + const bool metafile_must_be_valid = true; #elif defined(OS_POSIX) - (page.ToInt() == 0); + const bool metafile_must_be_valid = (page.ToInt() == mutable_.first_page); #endif PrintedPages::const_iterator itr = mutable_.pages_.find(page.ToInt()); if (itr == mutable_.pages_.end() || !itr->second.get()) @@ -279,6 +284,9 @@ PrintedDocument::Mutable::Mutable(PrintedPagesSource* source) expected_page_count_(0), page_count_(0), shrink_factor(0) { +#if defined(OS_POSIX) && !defined(OS_MACOSX) + first_page = INT_MAX; +#endif } PrintedDocument::Mutable::~Mutable() { |