From 89bf9ce294d83669922443dd17391e8c38e720a8 Mon Sep 17 00:00:00 2001 From: Henrique Nakashima Date: Tue, 19 Sep 2017 16:45:10 -0400 Subject: Fix draw order of popup annotations. Bug: chromium:765375 Change-Id: Ifdbd33ca92ec7105778788f891095eaf280c18cf Reviewed-on: https://pdfium-review.googlesource.com/14370 Commit-Queue: Henrique Nakashima Reviewed-by: dsinclair --- fpdfsdk/cpdfsdk_baannot.cpp | 7 +++++++ fpdfsdk/cpdfsdk_baannot.h | 2 ++ 2 files changed, 9 insertions(+) diff --git a/fpdfsdk/cpdfsdk_baannot.cpp b/fpdfsdk/cpdfsdk_baannot.cpp index 711d228ec3..c551fee799 100644 --- a/fpdfsdk/cpdfsdk_baannot.cpp +++ b/fpdfsdk/cpdfsdk_baannot.cpp @@ -353,3 +353,10 @@ void CPDFSDK_BAAnnot::SetOpenState(bool bOpenState) { if (CPDF_Annot* pAnnot = m_pAnnot->GetPopupAnnot()) pAnnot->SetOpenState(bOpenState); } + +int CPDFSDK_BAAnnot::GetLayoutOrder() const { + if (m_pAnnot->GetSubtype() == CPDF_Annot::Subtype::POPUP) + return 1; + + return CPDFSDK_Annot::GetLayoutOrder(); +} diff --git a/fpdfsdk/cpdfsdk_baannot.h b/fpdfsdk/cpdfsdk_baannot.h index 1d71585a35..c7300c46e5 100644 --- a/fpdfsdk/cpdfsdk_baannot.h +++ b/fpdfsdk/cpdfsdk_baannot.h @@ -92,6 +92,8 @@ class CPDFSDK_BAAnnot : public CPDFSDK_Annot { void SetOpenState(bool bState); + int GetLayoutOrder() const override; + protected: CFX_UnownedPtr const m_pAnnot; }; -- cgit v1.2.3