summaryrefslogtreecommitdiff
path: root/core/fpdfdoc/cpvt_generateap.cpp
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2017-02-14 14:58:49 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-02-14 14:59:09 +0000
commit92a32db931c1303388158f8a9e045e922d0b8dfa (patch)
tree5c6c05ffb40c1bb2653b415842537f7043bd6407 /core/fpdfdoc/cpvt_generateap.cpp
parent4797c4240cb9e2d8cd36c583d46cd52ff94af95d (diff)
downloadpdfium-92a32db931c1303388158f8a9e045e922d0b8dfa.tar.xz
Revert "Convert CFX_FloatPoint to CFX_PointF"
This reverts commit 4797c4240cb9e2d8cd36c583d46cd52ff94af95d. Reason for revert: Reverting chain to see if fixes Chrome roll. Original change's description: > Convert CFX_FloatPoint to CFX_PointF > > The two classes store the same information, remove the CFX_FloatPoint variant. > > Change-Id: Ie598c2ba5af04fb2bb3347dd48c30fd5e4845e62 > Reviewed-on: https://pdfium-review.googlesource.com/2612 > Commit-Queue: dsinclair <dsinclair@chromium.org> > Reviewed-by: Tom Sepez <tsepez@chromium.org> > TBR=tsepez@chromium.org,dsinclair@chromium.org,pdfium-reviews@googlegroups.com NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true Change-Id: Ia42074e706983c62d2e57497c3079b3c338343a3 Reviewed-on: https://pdfium-review.googlesource.com/2694 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'core/fpdfdoc/cpvt_generateap.cpp')
-rw-r--r--core/fpdfdoc/cpvt_generateap.cpp37
1 files changed, 19 insertions, 18 deletions
diff --git a/core/fpdfdoc/cpvt_generateap.cpp b/core/fpdfdoc/cpvt_generateap.cpp
index 15515151bc..4bb244f29e 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_PointF ptOffset;
+ CFX_FloatPoint ptOffset;
if (!bMultiLine) {
ptOffset =
- CFX_PointF(0.0f, (rcContent.Height() - rcBody.Height()) / 2.0f);
+ CFX_FloatPoint(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_PointF ptOffset =
- CFX_PointF(0.0f, (rcContent.Height() - rcEdit.Height()) / 2.0f);
+ CFX_FloatPoint ptOffset =
+ CFX_FloatPoint(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,8 +328,9 @@ bool GenerateWidgetAP(CPDF_Document* pDoc,
if (sButtonBorder.GetLength() > 0)
sAppStream << "q\n" << sButtonBorder << "Q\n";
- CFX_PointF ptCenter = CFX_PointF((rcButton.left + rcButton.right) / 2,
- (rcButton.top + rcButton.bottom) / 2);
+ CFX_FloatPoint ptCenter =
+ CFX_FloatPoint((rcButton.left + rcButton.right) / 2,
+ (rcButton.top + rcButton.bottom) / 2);
if (IsFloatBigger(rcButton.Width(), 6) &&
IsFloatBigger(rcButton.Height(), 6)) {
sAppStream << "q\n"
@@ -401,7 +402,7 @@ bool GenerateWidgetAP(CPDF_Document* pDoc,
CPVT_Color(CPVT_Color::kGray, 1),
PaintOperation::FILL)
<< CPVT_GenerateAP::GenerateEditAP(&map, vt.GetIterator(),
- CFX_PointF(0.0f, fy),
+ CFX_FloatPoint(0.0f, fy),
true, 0)
<< "ET\n";
} else {
@@ -409,7 +410,7 @@ bool GenerateWidgetAP(CPDF_Document* pDoc,
<< CPVT_GenerateAP::GenerateColorAP(crText,
PaintOperation::FILL)
<< CPVT_GenerateAP::GenerateEditAP(&map, vt.GetIterator(),
- CFX_PointF(0.0f, fy),
+ CFX_FloatPoint(0.0f, fy),
true, 0)
<< "ET\n";
}
@@ -528,7 +529,7 @@ CFX_ByteString GetPopupContentsString(CPDF_Document* pDoc,
vt.Initialize();
vt.SetText(swValue);
vt.RearrangeAll();
- CFX_PointF ptOffset(3.0f, -3.0f);
+ CFX_FloatPoint ptOffset(3.0f, -3.0f);
CFX_ByteString sContent = CPVT_GenerateAP::GenerateEditAP(
&map, vt.GetIterator(), ptOffset, false, 0);
@@ -1101,14 +1102,14 @@ bool CPVT_GenerateAP::GenerateStrikeOutAP(CPDF_Document* pDoc,
CFX_ByteString CPVT_GenerateAP::GenerateEditAP(
IPVT_FontMap* pFontMap,
CPDF_VariableText::Iterator* pIterator,
- const CFX_PointF& ptOffset,
+ const CFX_FloatPoint& ptOffset,
bool bContinuous,
uint16_t SubWord) {
CFX_ByteTextBuf sEditStream;
CFX_ByteTextBuf sLineStream;
CFX_ByteTextBuf sWords;
- CFX_PointF ptOld;
- CFX_PointF ptNew;
+ CFX_FloatPoint ptOld;
+ CFX_FloatPoint ptNew;
int32_t nCurFontIndex = -1;
CPVT_WordPlace oldplace;
@@ -1125,13 +1126,13 @@ CFX_ByteString CPVT_GenerateAP::GenerateEditAP(
}
CPVT_Word word;
if (pIterator->GetWord(word)) {
- ptNew = CFX_PointF(word.ptWord.x + ptOffset.x,
- word.ptWord.y + ptOffset.y);
+ ptNew = CFX_FloatPoint(word.ptWord.x + ptOffset.x,
+ word.ptWord.y + ptOffset.y);
} else {
CPVT_Line line;
pIterator->GetLine(line);
- ptNew = CFX_PointF(line.ptLine.x + ptOffset.x,
- line.ptLine.y + ptOffset.y);
+ ptNew = CFX_FloatPoint(line.ptLine.x + ptOffset.x,
+ line.ptLine.y + ptOffset.y);
}
if (ptNew != ptOld) {
sLineStream << ptNew.x - ptOld.x << " " << ptNew.y - ptOld.y
@@ -1156,8 +1157,8 @@ CFX_ByteString CPVT_GenerateAP::GenerateEditAP(
} else {
CPVT_Word word;
if (pIterator->GetWord(word)) {
- ptNew =
- CFX_PointF(word.ptWord.x + ptOffset.x, word.ptWord.y + ptOffset.y);
+ ptNew = CFX_FloatPoint(word.ptWord.x + ptOffset.x,
+ word.ptWord.y + ptOffset.y);
if (ptNew != ptOld) {
sEditStream << ptNew.x - ptOld.x << " " << ptNew.y - ptOld.y
<< " Td\n";