diff options
author | tsepez <tsepez@chromium.org> | 2016-09-13 16:08:49 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-09-13 16:08:49 -0700 |
commit | 63f545c485c063831ecb58fb492f96fe5f462fd1 (patch) | |
tree | 8c57386bc84f7173b780a7e8bf79a19ec7c3231e /core/fpdfdoc/cpvt_generateap.cpp | |
parent | f86ca3884886506c999a3b521078151e7cda0bf9 (diff) | |
download | pdfium-63f545c485c063831ecb58fb492f96fe5f462fd1.tar.xz |
CFX_FloatPoint default constructor and equals operatorschromium/2860
Review-Url: https://codereview.chromium.org/2341453002
Diffstat (limited to 'core/fpdfdoc/cpvt_generateap.cpp')
-rw-r--r-- | core/fpdfdoc/cpvt_generateap.cpp | 13 |
1 files changed, 6 insertions, 7 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; |