Index: core/fpdfdoc/cpvt_generateap.cpp |
diff --git a/core/fpdfdoc/cpvt_generateap.cpp b/core/fpdfdoc/cpvt_generateap.cpp |
index 9bde7e6b85f75456c2b32fecb3dcc35dcd759da0..a19332bb7c1443b48e6771235712f5332ed59b0b 100644 |
--- a/core/fpdfdoc/cpvt_generateap.cpp |
+++ b/core/fpdfdoc/cpvt_generateap.cpp |
@@ -619,6 +619,35 @@ bool CPVT_GenerateAP::GenerateUnderlineAP(CPDF_Document* pDoc, |
return true; |
} |
+bool CPVT_GenerateAP::GenerateStrikeOutAP(CPDF_Document* pDoc, |
+ CPDF_Dictionary* pAnnotDict) { |
+ // If AP dictionary exists, we use the appearance defined in the |
+ // existing AP dictionary. |
+ if (pAnnotDict->KeyExist("AP")) |
+ return false; |
+ |
+ CFX_ByteTextBuf sAppStream; |
+ CFX_ByteString sExtGSDictName = "GS"; |
+ sAppStream << "/" << sExtGSDictName << " gs "; |
+ |
+ sAppStream << GetColorStringWithDefault(pAnnotDict, |
+ CPVT_Color(CPVT_Color::kRGB, 0, 0, 0), |
+ PaintOperation::STROKE); |
+ |
+ CFX_FloatRect rect = pAnnotDict->GetRectBy("Rect"); |
+ rect.Normalize(); |
+ |
+ FX_FLOAT fLineWidth = 1.0; |
+ FX_FLOAT fY = (rect.top + rect.bottom) / 2; |
+ sAppStream << fLineWidth << " w " << rect.left << " " << fY << " m " |
+ << rect.right << " " << fY << " l S\n"; |
+ |
+ CPDF_Dictionary* pExtGStateDict = |
+ GenerateExtGStateDict(*pAnnotDict, sExtGSDictName, "Normal"); |
+ GenerateAndSetAPDict(pDoc, pAnnotDict, sAppStream, pExtGStateDict); |
+ return true; |
+} |
+ |
// Static. |
CFX_ByteString CPVT_GenerateAP::GenerateEditAP( |
IPVT_FontMap* pFontMap, |