summaryrefslogtreecommitdiff
path: root/core/fpdfdoc/cpvt_generateap.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-02-14 11:52:07 -0500
committerChromium commit bot <commit-bot@chromium.org>2017-02-14 18:12:34 +0000
commitf528eee136a602643a7777d87a2cce52cf83f38a (patch)
tree94643b8f0b26a8cd61437db4b9867b9a60a00ef8 /core/fpdfdoc/cpvt_generateap.cpp
parent22da8c268d2228203b40a8c73a2d3f6c25fc9acc (diff)
downloadpdfium-f528eee136a602643a7777d87a2cce52cf83f38a.tar.xz
Reland "Convert CFX_FloatPoint to CFX_PointF"
This CL updates the CFX_FloatPoint Cl to accommodate for the Origin CL being reverted. Change-Id: I345fe1117938a49ad9ee5f310fe7b5e21d9f1948 Reviewed-on: https://pdfium-review.googlesource.com/2697 Reviewed-by: Nicolás Peña <npm@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fpdfdoc/cpvt_generateap.cpp')
-rw-r--r--core/fpdfdoc/cpvt_generateap.cpp37
1 files changed, 18 insertions, 19 deletions
diff --git a/core/fpdfdoc/cpvt_generateap.cpp b/core/fpdfdoc/cpvt_generateap.cpp
index 4bb244f29e..15515151bc 100644
--- a/core/fpdfdoc/cpvt_generateap.cpp
+++ b/core/fpdfdoc/cpvt_generateap.cpp
@@ -246,10 +246,10 @@ bool GenerateWidgetAP(CPDF_Document* pDoc,
vt.SetText(swValue);
vt.RearrangeAll();
CFX_FloatRect rcContent = vt.GetContentRect();
- CFX_FloatPoint ptOffset;
+ CFX_PointF ptOffset;
if (!bMultiLine) {
ptOffset =
- CFX_FloatPoint(0.0f, (rcContent.Height() - rcBody.Height()) / 2.0f);
+ CFX_PointF(0.0f, (rcContent.Height() - rcBody.Height()) / 2.0f);
}
CFX_ByteString sBody = CPVT_GenerateAP::GenerateEditAP(
&map, vt.GetIterator(), ptOffset, !bCharArray, subWord);
@@ -296,8 +296,8 @@ bool GenerateWidgetAP(CPDF_Document* pDoc,
vt.SetText(swValue);
vt.RearrangeAll();
CFX_FloatRect rcContent = vt.GetContentRect();
- CFX_FloatPoint ptOffset =
- CFX_FloatPoint(0.0f, (rcContent.Height() - rcEdit.Height()) / 2.0f);
+ CFX_PointF ptOffset =
+ CFX_PointF(0.0f, (rcContent.Height() - rcEdit.Height()) / 2.0f);
CFX_ByteString sEdit = CPVT_GenerateAP::GenerateEditAP(
&map, vt.GetIterator(), ptOffset, true, 0);
if (sEdit.GetLength() > 0) {
@@ -328,9 +328,8 @@ bool GenerateWidgetAP(CPDF_Document* pDoc,
if (sButtonBorder.GetLength() > 0)
sAppStream << "q\n" << sButtonBorder << "Q\n";
- CFX_FloatPoint ptCenter =
- CFX_FloatPoint((rcButton.left + rcButton.right) / 2,
- (rcButton.top + rcButton.bottom) / 2);
+ CFX_PointF ptCenter = CFX_PointF((rcButton.left + rcButton.right) / 2,
+ (rcButton.top + rcButton.bottom) / 2);
if (IsFloatBigger(rcButton.Width(), 6) &&
IsFloatBigger(rcButton.Height(), 6)) {
sAppStream << "q\n"
@@ -402,7 +401,7 @@ bool GenerateWidgetAP(CPDF_Document* pDoc,
CPVT_Color(CPVT_Color::kGray, 1),
PaintOperation::FILL)
<< CPVT_GenerateAP::GenerateEditAP(&map, vt.GetIterator(),
- CFX_FloatPoint(0.0f, fy),
+ CFX_PointF(0.0f, fy),
true, 0)
<< "ET\n";
} else {
@@ -410,7 +409,7 @@ bool GenerateWidgetAP(CPDF_Document* pDoc,
<< CPVT_GenerateAP::GenerateColorAP(crText,
PaintOperation::FILL)
<< CPVT_GenerateAP::GenerateEditAP(&map, vt.GetIterator(),
- CFX_FloatPoint(0.0f, fy),
+ CFX_PointF(0.0f, fy),
true, 0)
<< "ET\n";
}
@@ -529,7 +528,7 @@ CFX_ByteString GetPopupContentsString(CPDF_Document* pDoc,
vt.Initialize();
vt.SetText(swValue);
vt.RearrangeAll();
- CFX_FloatPoint ptOffset(3.0f, -3.0f);
+ CFX_PointF ptOffset(3.0f, -3.0f);
CFX_ByteString sContent = CPVT_GenerateAP::GenerateEditAP(
&map, vt.GetIterator(), ptOffset, false, 0);
@@ -1102,14 +1101,14 @@ bool CPVT_GenerateAP::GenerateStrikeOutAP(CPDF_Document* pDoc,
CFX_ByteString CPVT_GenerateAP::GenerateEditAP(
IPVT_FontMap* pFontMap,
CPDF_VariableText::Iterator* pIterator,
- const CFX_FloatPoint& ptOffset,
+ const CFX_PointF& ptOffset,
bool bContinuous,
uint16_t SubWord) {
CFX_ByteTextBuf sEditStream;
CFX_ByteTextBuf sLineStream;
CFX_ByteTextBuf sWords;
- CFX_FloatPoint ptOld;
- CFX_FloatPoint ptNew;
+ CFX_PointF ptOld;
+ CFX_PointF ptNew;
int32_t nCurFontIndex = -1;
CPVT_WordPlace oldplace;
@@ -1126,13 +1125,13 @@ CFX_ByteString CPVT_GenerateAP::GenerateEditAP(
}
CPVT_Word word;
if (pIterator->GetWord(word)) {
- ptNew = CFX_FloatPoint(word.ptWord.x + ptOffset.x,
- word.ptWord.y + ptOffset.y);
+ ptNew = CFX_PointF(word.ptWord.x + ptOffset.x,
+ word.ptWord.y + ptOffset.y);
} else {
CPVT_Line line;
pIterator->GetLine(line);
- ptNew = CFX_FloatPoint(line.ptLine.x + ptOffset.x,
- line.ptLine.y + ptOffset.y);
+ ptNew = CFX_PointF(line.ptLine.x + ptOffset.x,
+ line.ptLine.y + ptOffset.y);
}
if (ptNew != ptOld) {
sLineStream << ptNew.x - ptOld.x << " " << ptNew.y - ptOld.y
@@ -1157,8 +1156,8 @@ CFX_ByteString CPVT_GenerateAP::GenerateEditAP(
} else {
CPVT_Word word;
if (pIterator->GetWord(word)) {
- ptNew = CFX_FloatPoint(word.ptWord.x + ptOffset.x,
- word.ptWord.y + ptOffset.y);
+ ptNew =
+ CFX_PointF(word.ptWord.x + ptOffset.x, word.ptWord.y + ptOffset.y);
if (ptNew != ptOld) {
sEditStream << ptNew.x - ptOld.x << " " << ptNew.y - ptOld.y
<< " Td\n";