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

Unified Diff: core/src/fpdfdoc/doc_vt.cpp

Issue 1737593006: Re-land "Replace CPDF_Rect and CPDF_Point with CFX types." (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Ooops. Created 4 years, 10 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/src/fpdfdoc/doc_link.cpp ('k') | core/src/fpdfdoc/pdf_vt.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fpdfdoc/doc_vt.cpp
diff --git a/core/src/fpdfdoc/doc_vt.cpp b/core/src/fpdfdoc/doc_vt.cpp
index 0f8a4e53202394f37285c413540ee18b199dde25..477df25a142343c07821a4e70eeb485b625e6cfa 100644
--- a/core/src/fpdfdoc/doc_vt.cpp
+++ b/core/src/fpdfdoc/doc_vt.cpp
@@ -166,7 +166,7 @@ void CSection::UpdateWordPlace(CPVT_WordPlace& place) const {
}
}
}
-CPVT_WordPlace CSection::SearchWordPlace(const CPDF_Point& point) const {
+CPVT_WordPlace CSection::SearchWordPlace(const CFX_FloatPoint& point) const {
ASSERT(m_pVT);
CPVT_WordPlace place = GetBeginWordPlace();
FX_BOOL bUp = TRUE;
@@ -1135,8 +1135,8 @@ CPVT_WordPlace CPDF_VariableText::GetNextWordPlace(
return place;
}
CPVT_WordPlace CPDF_VariableText::SearchWordPlace(
- const CPDF_Point& point) const {
- CPDF_Point pt = OutToIn(point);
+ const CFX_FloatPoint& point) const {
+ CFX_FloatPoint pt = OutToIn(point);
CPVT_WordPlace place = GetBeginWordPlace();
int32_t nLeft = 0;
int32_t nRight = m_SectionArray.GetSize() - 1;
@@ -1161,8 +1161,8 @@ CPVT_WordPlace CPDF_VariableText::SearchWordPlace(
continue;
} else {
place = pSection->SearchWordPlace(
- CPDF_Point(pt.x - pSection->m_SecInfo.rcSection.left,
- pt.y - pSection->m_SecInfo.rcSection.top));
+ CFX_FloatPoint(pt.x - pSection->m_SecInfo.rcSection.left,
+ pt.y - pSection->m_SecInfo.rcSection.top));
place.nSecIndex = nMid;
return place;
}
@@ -1180,10 +1180,10 @@ CPVT_WordPlace CPDF_VariableText::SearchWordPlace(
}
CPVT_WordPlace CPDF_VariableText::GetUpWordPlace(
const CPVT_WordPlace& place,
- const CPDF_Point& point) const {
+ const CFX_FloatPoint& point) const {
if (CSection* pSection = m_SectionArray.GetAt(place.nSecIndex)) {
CPVT_WordPlace temp = place;
- CPDF_Point pt = OutToIn(point);
+ CFX_FloatPoint pt = OutToIn(point);
if (temp.nLineIndex-- > 0) {
return pSection->SearchWordPlace(
pt.x - pSection->m_SecInfo.rcSection.left, temp);
@@ -1200,10 +1200,10 @@ CPVT_WordPlace CPDF_VariableText::GetUpWordPlace(
}
CPVT_WordPlace CPDF_VariableText::GetDownWordPlace(
const CPVT_WordPlace& place,
- const CPDF_Point& point) const {
+ const CFX_FloatPoint& point) const {
if (CSection* pSection = m_SectionArray.GetAt(place.nSecIndex)) {
CPVT_WordPlace temp = place;
- CPDF_Point pt = OutToIn(point);
+ CFX_FloatPoint pt = OutToIn(point);
if (temp.nLineIndex++ < pSection->m_LineArray.GetSize() - 1) {
return pSection->SearchWordPlace(
pt.x - pSection->m_SecInfo.rcSection.left, temp);
@@ -1333,7 +1333,7 @@ FX_BOOL CPDF_VariableText::GetSectionInfo(const CPVT_WordPlace& place,
}
return FALSE;
}
-CPDF_Rect CPDF_VariableText::GetContentRect() const {
+CFX_FloatRect CPDF_VariableText::GetContentRect() const {
return InToOut(CPVT_FloatRect(CPDF_EditContainer::GetContentRect()));
}
FX_FLOAT CPDF_VariableText::GetWordFontSize(const CPVT_WordInfo& WordInfo,
@@ -1753,8 +1753,8 @@ FX_BOOL CPDF_VariableText_Iterator::GetWord(CPVT_Word& word) const {
word.nCharset = pWord->nCharset;
word.fWidth = m_pVT->GetWordWidth(*pWord);
word.ptWord = m_pVT->InToOut(
- CPDF_Point(pWord->fWordX + pSection->m_SecInfo.rcSection.left,
- pWord->fWordY + pSection->m_SecInfo.rcSection.top));
+ CFX_FloatPoint(pWord->fWordX + pSection->m_SecInfo.rcSection.left,
+ pWord->fWordY + pSection->m_SecInfo.rcSection.top));
word.fAscent = m_pVT->GetWordAscent(*pWord);
word.fDescent = m_pVT->GetWordDescent(*pWord);
if (pWord->pWordProps) {
@@ -1785,7 +1785,7 @@ FX_BOOL CPDF_VariableText_Iterator::GetLine(CPVT_Line& line) const {
line.lineplace = CPVT_WordPlace(m_CurPos.nSecIndex, m_CurPos.nLineIndex, -1);
if (CSection* pSection = m_pVT->m_SectionArray.GetAt(m_CurPos.nSecIndex)) {
if (CLine* pLine = pSection->m_LineArray.GetAt(m_CurPos.nLineIndex)) {
- line.ptLine = m_pVT->InToOut(CPDF_Point(
+ line.ptLine = m_pVT->InToOut(CFX_FloatPoint(
pLine->m_LineInfo.fLineX + pSection->m_SecInfo.rcSection.left,
pLine->m_LineInfo.fLineY + pSection->m_SecInfo.rcSection.top));
line.fLineWidth = pLine->m_LineInfo.fLineWidth;
« no previous file with comments | « core/src/fpdfdoc/doc_link.cpp ('k') | core/src/fpdfdoc/pdf_vt.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698