Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(143)

Side by Side Diff: core/fpdfdoc/cpdf_annotlist.cpp

Issue 2295953002: Use enum class for subtypes of CPDF_Annot. (Closed)
Patch Set: Use enum class for subtypes of CPDF_Annot. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « core/fpdfdoc/cpdf_annot.cpp ('k') | core/fpdfdoc/include/cpdf_annot.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 PDFium Authors. All rights reserved. 1 // Copyright 2016 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "core/fpdfdoc/include/cpdf_annotlist.h" 7 #include "core/fpdfdoc/include/cpdf_annotlist.h"
8 8
9 #include "core/fpdfapi/fpdf_page/include/cpdf_page.h" 9 #include "core/fpdfapi/fpdf_page/include/cpdf_page.h"
10 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h" 10 #include "core/fpdfapi/fpdf_parser/include/cpdf_document.h"
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 103
104 void CPDF_AnnotList::DisplayPass(CPDF_Page* pPage, 104 void CPDF_AnnotList::DisplayPass(CPDF_Page* pPage,
105 CFX_RenderDevice* pDevice, 105 CFX_RenderDevice* pDevice,
106 CPDF_RenderContext* pContext, 106 CPDF_RenderContext* pContext,
107 FX_BOOL bPrinting, 107 FX_BOOL bPrinting,
108 CFX_Matrix* pMatrix, 108 CFX_Matrix* pMatrix,
109 FX_BOOL bWidgetPass, 109 FX_BOOL bWidgetPass,
110 CPDF_RenderOptions* pOptions, 110 CPDF_RenderOptions* pOptions,
111 FX_RECT* clip_rect) { 111 FX_RECT* clip_rect) {
112 for (const auto& pAnnot : m_AnnotList) { 112 for (const auto& pAnnot : m_AnnotList) {
113 bool bWidget = pAnnot->GetSubtype() == "Widget"; 113 bool bWidget = pAnnot->GetSubtype() == CPDF_Annot::Subtype::WIDGET;
114 if ((bWidgetPass && !bWidget) || (!bWidgetPass && bWidget)) 114 if ((bWidgetPass && !bWidget) || (!bWidgetPass && bWidget))
115 continue; 115 continue;
116 116
117 uint32_t annot_flags = pAnnot->GetFlags(); 117 uint32_t annot_flags = pAnnot->GetFlags();
118 if (annot_flags & ANNOTFLAG_HIDDEN) 118 if (annot_flags & ANNOTFLAG_HIDDEN)
119 continue; 119 continue;
120 120
121 if (bPrinting && (annot_flags & ANNOTFLAG_PRINT) == 0) 121 if (bPrinting && (annot_flags & ANNOTFLAG_PRINT) == 0)
122 continue; 122 continue;
123 123
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
173 CPDF_RenderContext* pContext, 173 CPDF_RenderContext* pContext,
174 FX_BOOL bPrinting, 174 FX_BOOL bPrinting,
175 CFX_Matrix* pMatrix, 175 CFX_Matrix* pMatrix,
176 FX_BOOL bShowWidget, 176 FX_BOOL bShowWidget,
177 CPDF_RenderOptions* pOptions) { 177 CPDF_RenderOptions* pOptions) {
178 uint32_t dwAnnotFlags = bShowWidget ? ANNOTFLAG_INVISIBLE | ANNOTFLAG_HIDDEN 178 uint32_t dwAnnotFlags = bShowWidget ? ANNOTFLAG_INVISIBLE | ANNOTFLAG_HIDDEN
179 : ANNOTFLAG_INVISIBLE; 179 : ANNOTFLAG_INVISIBLE;
180 DisplayAnnots(pPage, nullptr, pContext, bPrinting, pMatrix, dwAnnotFlags, 180 DisplayAnnots(pPage, nullptr, pContext, bPrinting, pMatrix, dwAnnotFlags,
181 pOptions, nullptr); 181 pOptions, nullptr);
182 } 182 }
OLDNEW
« no previous file with comments | « core/fpdfdoc/cpdf_annot.cpp ('k') | core/fpdfdoc/include/cpdf_annot.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698