)]}' { "commit": "60a7195a9b42b5f27b13fff2a9173ad797ce958c", "tree": "54f94d9df69334cea157354883eadc7c9a704807", "parents": [ "9e7388e8e7ebbf5be6964f61b040297a17a16652" ], "author": { "name": "Lei Zhang", "email": "thestig@chromium.org", "time": "Wed Jul 14 22:27:55 2021 +0000" }, "committer": { "name": "Pdfium LUCI CQ", "email": "pdfium-scoped@luci-project-accounts.iam.gserviceaccount.com", "time": "Wed Jul 14 22:27:55 2021 +0000" }, "message": "Revert \"Fix enum type mismatch in CPDF_FontEncoding.\"\n\nThis reverts commit 18192fde8ddc9cb87afd8a5f1c869e73bcb3484d.\n\nReason for revert: Regressed text extraction for bigtable-osdi06.pdf.\n\nOriginal change\u0027s description:\n\u003e Fix enum type mismatch in CPDF_FontEncoding.\n\u003e\n\u003e Apart from PDFFONT_ENCODING_BUILTIN and FT_ENCODING_NONE, none of\n\u003e the PDFFONT_* definitions and FT_Encoding definitions have equivalent\n\u003e values. Since we pass these around as ints, it is easy to mix them up\n\u003e without compile-time detection. Once we re-write the FT_ functions to\n\u003e take FT_Encoding enums, a couple of problems crop up:\n\u003e\n\u003e CPDF_Type1Font.cpp:213 (and 275) are calling with the wrong enum, but\n\u003e CPDF_FontEncoding.cpp:1810 handles a mismatched enum, but the\n\u003e mismatched enum is not the one being passed by any of the mismatched\n\u003e callers. The result is those calls always get back a 0.\n\u003e\n\u003e So we are left to guess intent. The FT_ENCODING_ADOBE_STANDARD enum\n\u003e matches against our StandardEncoding table, so perhaps that was the\n\u003e intent when passing the mismatched PDFFONT_ENCODING_STANDARD value.\n\u003e Alternatively, maybe the intent was to match against the odd\n\u003e PDFFONT_ENCODING_PDFDOC case in the switch. Or it may just be that\n\u003e getting 0 and removing dead code is the best option.\n\u003e\n\u003e This CL tries the first option to see how it affects rendering,\n\u003e since it the most uptight about type safety, and we remove the\n\u003e mismatched case from the switch.\n\u003e\n\u003e Change-Id: I08cf85a8adf1ddabc6c2aa4484972b262af7ee49\n\u003e Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/80610\n\u003e Commit-Queue: Tom Sepez \u003ctsepez@chromium.org\u003e\n\u003e Reviewed-by: Lei Zhang \u003cthestig@chromium.org\u003e\n\n# Not skipping CQ checks because original CL landed \u003e 1 day ago.\n\nChange-Id: If1233bc8b67dcf23e5827e9d4adda22d24483e79\nReviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/83070\nReviewed-by: Lei Zhang \u003cthestig@chromium.org\u003e\nCommit-Queue: Lei Zhang \u003cthestig@chromium.org\u003e\n", "tree_diff": [ { "type": "modify", "old_id": "b7272263b2f2a036722caf9add5b399b57f4b30f", "old_mode": 33188, "old_path": "core/fpdfapi/font/cpdf_fontencoding.cpp", "new_id": "c456b60eea6b857a2bf929aa1698a72a68f3cf79", "new_mode": 33188, "new_path": "core/fpdfapi/font/cpdf_fontencoding.cpp" }, { "type": "modify", "old_id": "144704209bc7ffc2f79e4c014ebc397150640ba9", "old_mode": 33188, "old_path": "core/fpdfapi/font/cpdf_fontencoding.h", "new_id": "4ff6403ea89a2f2d11f1f99414a06243a4e9a5de", "new_mode": 33188, "new_path": "core/fpdfapi/font/cpdf_fontencoding.h" }, { "type": "modify", "old_id": "6ff20149860741af4f4fb6581f94d55467684eb7", "old_mode": 33188, "old_path": "core/fpdfapi/font/cpdf_type1font.cpp", "new_id": "90dd4dc0f1e93acc2973af7a636af140798ab516", "new_mode": 33188, "new_path": "core/fpdfapi/font/cpdf_type1font.cpp" } ] }