• K Moon's avatar
    Unify layout code in AppendBlankPages · 6139b7f4
    K Moon authored
    Refactors PDFiumEngine::AppendBlankPages() to leverage the layout code
    in LoadPageInfo(), instead of using a separate copy. AppendBlankPages()
    now ensures |PDFiumEngine::pages_| is in the right state for a later
    layout pass, rather than trying to compute all the layout up front when
    the new PDFiumPage instances are created.
    
    This duplication is particularly harmful because AppendBlankPages() is
    only called from print preview code paths, and so may be overlooked if
    not testing print previewing specifically.
    
    Also inlined PDFiumEngine::LoadPagesInCurrentLayout(), since this method
    is only used in one place (and we're trying to centralize layout), has
    simple logic, and will become much shorter once the two "compute layout"
    methods are merged together.
    
    Bug: 885110
    Change-Id: Ic0ae2410ca930794beeb28983b9d0cc5e89284f4
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1769708Reviewed-by: default avatarLei Zhang <thestig@chromium.org>
    Commit-Queue: K Moon <kmoon@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#691858}
    6139b7f4
BUILD.gn 5.58 KB