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

Unified Diff: core/fpdfdoc/cpvt_generateap.cpp

Issue 2310873002: Move ShouldGenerateAPForAnnotation check to CPDF_Annot::GenerateAPIfNeeded (Closed)
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « core/fpdfdoc/cpdf_annot.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfdoc/cpvt_generateap.cpp
diff --git a/core/fpdfdoc/cpvt_generateap.cpp b/core/fpdfdoc/cpvt_generateap.cpp
index d19992ec6043da48bdbcab6d8e887f58077864b6..be96d2d1d3bf46bf306f60b0f9d5aa12e81127f1 100644
--- a/core/fpdfdoc/cpvt_generateap.cpp
+++ b/core/fpdfdoc/cpvt_generateap.cpp
@@ -674,15 +674,6 @@ CFX_ByteString GenerateTextSymbolAP(const CFX_FloatRect& rect) {
return sAppStream.MakeString();
}
-bool ShouldGenerateAPForAnnotation(CPDF_Dictionary* pAnnotDict) {
- // If AP dictionary exists, we use the appearance defined in the
- // existing AP dictionary.
- if (pAnnotDict->KeyExist("AP"))
- return false;
-
- return !CPDF_Annot::IsAnnotationHidden(pAnnotDict);
-}
-
} // namespace
bool FPDF_GenerateAP(CPDF_Document* pDoc, CPDF_Dictionary* pAnnotDict) {
@@ -735,9 +726,6 @@ bool CPVT_GenerateAP::GenerateTextFieldAP(CPDF_Document* pDoc,
bool CPVT_GenerateAP::GenerateCircleAP(CPDF_Document* pDoc,
CPDF_Dictionary* pAnnotDict) {
- if (!ShouldGenerateAPForAnnotation(pAnnotDict))
- return false;
-
CFX_ByteTextBuf sAppStream;
CFX_ByteString sExtGSDictName = "GS";
sAppStream << "/" << sExtGSDictName << " gs ";
@@ -811,9 +799,6 @@ bool CPVT_GenerateAP::GenerateCircleAP(CPDF_Document* pDoc,
bool CPVT_GenerateAP::GenerateHighlightAP(CPDF_Document* pDoc,
CPDF_Dictionary* pAnnotDict) {
- if (!ShouldGenerateAPForAnnotation(pAnnotDict))
- return false;
-
CFX_ByteTextBuf sAppStream;
CFX_ByteString sExtGSDictName = "GS";
sAppStream << "/" << sExtGSDictName << " gs ";
@@ -841,9 +826,6 @@ bool CPVT_GenerateAP::GenerateHighlightAP(CPDF_Document* pDoc,
bool CPVT_GenerateAP::GenerateInkAP(CPDF_Document* pDoc,
CPDF_Dictionary* pAnnotDict) {
- if (!ShouldGenerateAPForAnnotation(pAnnotDict))
- return false;
-
FX_FLOAT fBorderWidth = GetBorderWidth(*pAnnotDict);
bool bIsStroke = fBorderWidth > 0;
@@ -897,9 +879,6 @@ bool CPVT_GenerateAP::GenerateInkAP(CPDF_Document* pDoc,
bool CPVT_GenerateAP::GenerateTextAP(CPDF_Document* pDoc,
CPDF_Dictionary* pAnnotDict) {
- if (!ShouldGenerateAPForAnnotation(pAnnotDict))
- return false;
-
CFX_ByteTextBuf sAppStream;
CFX_ByteString sExtGSDictName = "GS";
sAppStream << "/" << sExtGSDictName << " gs ";
@@ -922,9 +901,6 @@ bool CPVT_GenerateAP::GenerateTextAP(CPDF_Document* pDoc,
bool CPVT_GenerateAP::GenerateUnderlineAP(CPDF_Document* pDoc,
CPDF_Dictionary* pAnnotDict) {
- if (!ShouldGenerateAPForAnnotation(pAnnotDict))
- return false;
-
CFX_ByteTextBuf sAppStream;
CFX_ByteString sExtGSDictName = "GS";
sAppStream << "/" << sExtGSDictName << " gs ";
@@ -989,9 +965,6 @@ bool CPVT_GenerateAP::GeneratePopupAP(CPDF_Document* pDoc,
bool CPVT_GenerateAP::GenerateSquareAP(CPDF_Document* pDoc,
CPDF_Dictionary* pAnnotDict) {
- if (!ShouldGenerateAPForAnnotation(pAnnotDict))
- return false;
-
CFX_ByteTextBuf sAppStream;
CFX_ByteString sExtGSDictName = "GS";
sAppStream << "/" << sExtGSDictName << " gs ";
@@ -1039,9 +1012,6 @@ bool CPVT_GenerateAP::GenerateSquareAP(CPDF_Document* pDoc,
bool CPVT_GenerateAP::GenerateSquigglyAP(CPDF_Document* pDoc,
CPDF_Dictionary* pAnnotDict) {
- if (!ShouldGenerateAPForAnnotation(pAnnotDict))
- return false;
-
CFX_ByteTextBuf sAppStream;
CFX_ByteString sExtGSDictName = "GS";
sAppStream << "/" << sExtGSDictName << " gs ";
@@ -1090,9 +1060,6 @@ bool CPVT_GenerateAP::GenerateSquigglyAP(CPDF_Document* pDoc,
bool CPVT_GenerateAP::GenerateStrikeOutAP(CPDF_Document* pDoc,
CPDF_Dictionary* pAnnotDict) {
- if (!ShouldGenerateAPForAnnotation(pAnnotDict))
- return false;
-
CFX_ByteTextBuf sAppStream;
CFX_ByteString sExtGSDictName = "GS";
sAppStream << "/" << sExtGSDictName << " gs ";
« no previous file with comments | « core/fpdfdoc/cpdf_annot.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698