summaryrefslogtreecommitdiff
path: root/core/src
diff options
context:
space:
mode:
authorBo Xu <bo_xu@foxitsoftware.com>2014-12-19 08:56:16 -0800
committerBo Xu <bo_xu@foxitsoftware.com>2014-12-19 09:02:28 -0800
commit0b07b3138f0d6b0f9cedf5d1d126366e754729e3 (patch)
tree4b1bb4e651aa42326481ad9c9a312f78cb0dba8b /core/src
parentd66f592b8d55bc68e360c6b0155799719bb2125a (diff)
downloadpdfium-0b07b3138f0d6b0f9cedf5d1d126366e754729e3.tar.xz
XFA: merge patch from CL 816153002
Transform font size to user space for valid text size comparison. BUG=438441 R=thestig@chromium.org Review URL: https://codereview.chromium.org/816153002
Diffstat (limited to 'core/src')
-rw-r--r--core/src/fpdftext/fpdf_text_int.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/core/src/fpdftext/fpdf_text_int.cpp b/core/src/fpdftext/fpdf_text_int.cpp
index c8369fda1f..c28647dc17 100644
--- a/core/src/fpdftext/fpdf_text_int.cpp
+++ b/core/src/fpdftext/fpdf_text_int.cpp
@@ -1844,14 +1844,15 @@ void CPDF_TextPage::ProcessTextObject(PDFTEXT_Obj Obj)
int nTotal = wstrItem.GetLength();
FX_BOOL bDel = FALSE;
const int count = std::min(m_TempCharList.GetSize(), 7);
+ FX_FLOAT threshold = charinfo.m_Matrix.TransformXDistance((FX_FLOAT)TEXT_CHARRATIO_GAPDELTA * pTextObj->GetFontSize());
for (int n = m_TempCharList.GetSize();
n > m_TempCharList.GetSize() - count;
n--) {
PAGECHAR_INFO* charinfo1 = (PAGECHAR_INFO*)m_TempCharList.GetAt(n - 1);
if(charinfo1->m_CharCode == charinfo.m_CharCode &&
charinfo1->m_pTextObj->GetFont() == charinfo.m_pTextObj->GetFont() &&
- FXSYS_fabs(charinfo1->m_OriginX - charinfo.m_OriginX) < TEXT_CHARRATIO_GAPDELTA * pTextObj->GetFontSize() &&
- FXSYS_fabs(charinfo1->m_OriginY - charinfo.m_OriginY) < TEXT_CHARRATIO_GAPDELTA * pTextObj->GetFontSize() ) {
+ FXSYS_fabs(charinfo1->m_OriginX - charinfo.m_OriginX) < threshold &&
+ FXSYS_fabs(charinfo1->m_OriginY - charinfo.m_OriginY) < threshold) {
bDel = TRUE;
break;
}