summaryrefslogtreecommitdiff
path: root/core/fpdfdoc
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-09-13 16:08:49 -0700
committerCommit bot <commit-bot@chromium.org>2016-09-13 16:08:49 -0700
commit63f545c485c063831ecb58fb492f96fe5f462fd1 (patch)
tree8c57386bc84f7173b780a7e8bf79a19ec7c3231e /core/fpdfdoc
parentf86ca3884886506c999a3b521078151e7cda0bf9 (diff)
downloadpdfium-63f545c485c063831ecb58fb492f96fe5f462fd1.tar.xz
CFX_FloatPoint default constructor and equals operatorschromium/2860
Review-Url: https://codereview.chromium.org/2341453002
Diffstat (limited to 'core/fpdfdoc')
-rw-r--r--core/fpdfdoc/cpvt_generateap.cpp13
-rw-r--r--core/fpdfdoc/include/cpvt_line.h3
-rw-r--r--core/fpdfdoc/include/cpvt_word.h1
3 files changed, 7 insertions, 10 deletions
diff --git a/core/fpdfdoc/cpvt_generateap.cpp b/core/fpdfdoc/cpvt_generateap.cpp
index 741b2365f5..dbfcdbffed 100644
--- a/core/fpdfdoc/cpvt_generateap.cpp
+++ b/core/fpdfdoc/cpvt_generateap.cpp
@@ -237,7 +237,7 @@ bool GenerateWidgetAP(CPDF_Document* pDoc,
vt.SetText(swValue);
vt.RearrangeAll();
CFX_FloatRect rcContent = vt.GetContentRect();
- CFX_FloatPoint ptOffset(0.0f, 0.0f);
+ CFX_FloatPoint ptOffset;
if (!bMultiLine) {
ptOffset =
CFX_FloatPoint(0.0f, (rcContent.Height() - rcBody.Height()) / 2.0f);
@@ -1083,13 +1083,12 @@ CFX_ByteString CPVT_GenerateAP::GenerateEditAP(
CFX_ByteTextBuf sEditStream;
CFX_ByteTextBuf sLineStream;
CFX_ByteTextBuf sWords;
- CFX_FloatPoint ptOld(0.0f, 0.0f);
- CFX_FloatPoint ptNew(0.0f, 0.0f);
+ CFX_FloatPoint ptOld;
+ CFX_FloatPoint ptNew;
int32_t nCurFontIndex = -1;
+ CPVT_WordPlace oldplace;
pIterator->SetAt(0);
-
- CPVT_WordPlace oldplace;
while (pIterator->NextWord()) {
CPVT_WordPlace place = pIterator->GetAt();
if (bContinuous) {
@@ -1110,7 +1109,7 @@ CFX_ByteString CPVT_GenerateAP::GenerateEditAP(
ptNew = CFX_FloatPoint(line.ptLine.x + ptOffset.x,
line.ptLine.y + ptOffset.y);
}
- if (ptNew.x != ptOld.x || ptNew.y != ptOld.y) {
+ if (ptNew != ptOld) {
sLineStream << ptNew.x - ptOld.x << " " << ptNew.y - ptOld.y
<< " Td\n";
ptOld = ptNew;
@@ -1135,7 +1134,7 @@ CFX_ByteString CPVT_GenerateAP::GenerateEditAP(
if (pIterator->GetWord(word)) {
ptNew = CFX_FloatPoint(word.ptWord.x + ptOffset.x,
word.ptWord.y + ptOffset.y);
- if (ptNew.x != ptOld.x || ptNew.y != ptOld.y) {
+ if (ptNew != ptOld) {
sEditStream << ptNew.x - ptOld.x << " " << ptNew.y - ptOld.y
<< " Td\n";
ptOld = ptNew;
diff --git a/core/fpdfdoc/include/cpvt_line.h b/core/fpdfdoc/include/cpvt_line.h
index ea0f899e19..d6c74edb4e 100644
--- a/core/fpdfdoc/include/cpvt_line.h
+++ b/core/fpdfdoc/include/cpvt_line.h
@@ -12,8 +12,7 @@
#include "core/fxcrt/include/fx_system.h"
struct CPVT_Line {
- CPVT_Line()
- : ptLine(0, 0), fLineWidth(0.0f), fLineAscent(0.0f), fLineDescent(0.0f) {}
+ CPVT_Line() : fLineWidth(0.0f), fLineAscent(0.0f), fLineDescent(0.0f) {}
CPVT_WordPlace lineplace;
CPVT_WordPlace lineEnd;
diff --git a/core/fpdfdoc/include/cpvt_word.h b/core/fpdfdoc/include/cpvt_word.h
index f7b7b23dac..b2af4ec6fa 100644
--- a/core/fpdfdoc/include/cpvt_word.h
+++ b/core/fpdfdoc/include/cpvt_word.h
@@ -29,7 +29,6 @@ struct CPVT_Word {
inline CPVT_Word::CPVT_Word()
: Word(0),
nCharset(0),
- ptWord(0.0f, 0.0f),
fAscent(0.0f),
fDescent(0.0f),
fWidth(0.0f),