• Lei Zhang's avatar
    PDF: Loading the print preview should ignore the first destination page. · 1fcd3374
    Lei Zhang authored
    When loading the print preview PDF for non-PDF content, the initial
    request loads a single page of the print preview source as the first
    page in the PDF. Subsequent pages are appended at page index 1 and
    onwards. Before r487767, ProcessPreviewPageInfo(), which loads the
    subsequent pages, checked the source page index and did not load if the
    source page index is less than 1. In r487767, the check changes to make
    sure the source page index is never negative, and to ignore loads when
    the source page index is 0. But it turns out that was not 100% correct.
    What it should have ignored is when the destination page index is 0.
    
    e.g. Print preview a 2 page document, and only select page 2. Here, the
    initial load loads source page index 1 as destination page index 0.
    ProcessPreviewPageInfo() then gets a request to load source page index 1
    as destination page index 0. This is redundant and should be ignored.
    
    Though oftentimes, source page index 0 maps to destination page index 0,
    so it just works out by luck.
    
    Fixing this does not change the user observable behavior, but it does
    make page load counting easier.
    
    Change-Id: If6ad8f32f95e04fce86268c6015271978b201fc5
    Reviewed-on: https://chromium-review.googlesource.com/580634Reviewed-by: default avatarRebekah Potter <rbpotter@chromium.org>
    Commit-Queue: Lei Zhang <thestig@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#488526}
    1fcd3374
out_of_process_instance.cc 60.2 KB