summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/javascript
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2016-02-26 14:24:28 -0800
committerTom Sepez <tsepez@chromium.org>2016-02-26 14:24:28 -0800
commit281a9eadff15b167e2ee3032e21b83190ad49125 (patch)
treef02f7d0842f59d8e69bda011b3e62547ffb1acde /fpdfsdk/src/javascript
parent566b974287ce0e81a963138152b8898f22480f52 (diff)
downloadpdfium-281a9eadff15b167e2ee3032e21b83190ad49125.tar.xz
Re-land "Replace CPDF_Rect and CPDF_Point with CFX types."
TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/1737593006 .
Diffstat (limited to 'fpdfsdk/src/javascript')
-rw-r--r--fpdfsdk/src/javascript/Document.cpp2
-rw-r--r--fpdfsdk/src/javascript/Field.cpp16
-rw-r--r--fpdfsdk/src/javascript/Field.h8
3 files changed, 13 insertions, 13 deletions
diff --git a/fpdfsdk/src/javascript/Document.cpp b/fpdfsdk/src/javascript/Document.cpp
index c49524d02f..8b2b315ae8 100644
--- a/fpdfsdk/src/javascript/Document.cpp
+++ b/fpdfsdk/src/javascript/Document.cpp
@@ -494,7 +494,7 @@ FX_BOOL Document::removeField(IJS_Context* cc,
return TRUE;
for (CPDFSDK_Widget* pWidget : widgets) {
- CPDF_Rect rcAnnot = pWidget->GetRect();
+ CFX_FloatRect rcAnnot = pWidget->GetRect();
--rcAnnot.left;
--rcAnnot.bottom;
++rcAnnot.right;
diff --git a/fpdfsdk/src/javascript/Field.cpp b/fpdfsdk/src/javascript/Field.cpp
index 82187c2453..9b6a7facba 100644
--- a/fpdfsdk/src/javascript/Field.cpp
+++ b/fpdfsdk/src/javascript/Field.cpp
@@ -2095,7 +2095,7 @@ FX_BOOL Field::rect(IJS_Context* cc,
pArray[2] = (FX_FLOAT)Lower_Rightx.ToInt();
pArray[3] = (FX_FLOAT)Upper_Lefty.ToInt();
- CPDF_Rect crRect(pArray);
+ CFX_FloatRect crRect(pArray);
if (m_bDelay) {
AddDelay_Rect(FP_RECT, crRect);
} else {
@@ -2133,7 +2133,7 @@ FX_BOOL Field::rect(IJS_Context* cc,
void Field::SetRect(CPDFSDK_Document* pDocument,
const CFX_WideString& swFieldName,
int nControlIndex,
- const CPDF_Rect& rect) {
+ const CFX_FloatRect& rect) {
CPDFSDK_InterForm* pInterForm = (CPDFSDK_InterForm*)pDocument->GetInterForm();
std::vector<CPDF_FormField*> FieldArray =
@@ -2146,13 +2146,13 @@ void Field::SetRect(CPDFSDK_Document* pDocument,
ASSERT(pFormControl);
if (CPDFSDK_Widget* pWidget = pInterForm->GetWidget(pFormControl)) {
- CPDF_Rect crRect = rect;
+ CFX_FloatRect crRect = rect;
CPDF_Page* pPDFPage = pWidget->GetPDFPage();
crRect.Intersect(pPDFPage->GetPageBBox());
if (!crRect.IsEmpty()) {
- CPDF_Rect rcOld = pWidget->GetRect();
+ CFX_FloatRect rcOld = pWidget->GetRect();
if (crRect.left != rcOld.left || crRect.right != rcOld.right ||
crRect.top != rcOld.top || crRect.bottom != rcOld.bottom) {
pWidget->SetRect(crRect);
@@ -2170,13 +2170,13 @@ void Field::SetRect(CPDFSDK_Document* pDocument,
if (CPDF_FormControl* pFormControl =
pFormField->GetControl(nControlIndex)) {
if (CPDFSDK_Widget* pWidget = pInterForm->GetWidget(pFormControl)) {
- CPDF_Rect crRect = rect;
+ CFX_FloatRect crRect = rect;
CPDF_Page* pPDFPage = pWidget->GetPDFPage();
crRect.Intersect(pPDFPage->GetPageBBox());
if (!crRect.IsEmpty()) {
- CPDF_Rect rcOld = pWidget->GetRect();
+ CFX_FloatRect rcOld = pWidget->GetRect();
if (crRect.left != rcOld.left || crRect.right != rcOld.right ||
crRect.top != rcOld.top || crRect.bottom != rcOld.bottom) {
pWidget->SetRect(crRect);
@@ -3402,7 +3402,7 @@ void Field::AddDelay_WideString(enum FIELD_PROP prop,
m_pJSDoc->AddDelayData(pNewData);
}
-void Field::AddDelay_Rect(enum FIELD_PROP prop, const CPDF_Rect& rect) {
+void Field::AddDelay_Rect(enum FIELD_PROP prop, const CFX_FloatRect& rect) {
CJS_DelayData* pNewData = new CJS_DelayData;
pNewData->sFieldName = m_FieldName;
pNewData->nControlIndex = m_nFormControlIndex;
@@ -3592,6 +3592,6 @@ void Field::AddField(CPDFSDK_Document* pDocument,
int nPageIndex,
int nFieldType,
const CFX_WideString& sName,
- const CPDF_Rect& rcCoords) {
+ const CFX_FloatRect& rcCoords) {
// Not supported.
}
diff --git a/fpdfsdk/src/javascript/Field.h b/fpdfsdk/src/javascript/Field.h
index 21552c4ec7..4fba1ddfa1 100644
--- a/fpdfsdk/src/javascript/Field.h
+++ b/fpdfsdk/src/javascript/Field.h
@@ -81,7 +81,7 @@ struct CJS_DelayData {
bool b;
CFX_ByteString string;
CFX_WideString widestring;
- CPDF_Rect rect;
+ CFX_FloatRect rect;
CPWL_Color color;
CFX_DWordArray wordarray;
CJS_WideStringArray widestringarray;
@@ -390,7 +390,7 @@ class Field : public CJS_EmbedObj {
static void SetRect(CPDFSDK_Document* pDocument,
const CFX_WideString& swFieldName,
int nControlIndex,
- const CPDF_Rect& rect);
+ const CFX_FloatRect& rect);
static void SetRichText(CPDFSDK_Document* pDocument,
const CFX_WideString& swFieldName,
int nControlIndex,
@@ -435,7 +435,7 @@ class Field : public CJS_EmbedObj {
int nPageIndex,
int nFieldType,
const CFX_WideString& sName,
- const CPDF_Rect& rcCoords);
+ const CFX_FloatRect& rcCoords);
static void UpdateFormField(CPDFSDK_Document* pDocument,
CPDF_FormField* pFormField,
@@ -473,7 +473,7 @@ class Field : public CJS_EmbedObj {
void AddDelay_Bool(enum FIELD_PROP prop, bool b);
void AddDelay_String(enum FIELD_PROP prop, const CFX_ByteString& string);
void AddDelay_WideString(enum FIELD_PROP prop, const CFX_WideString& string);
- void AddDelay_Rect(enum FIELD_PROP prop, const CPDF_Rect& rect);
+ void AddDelay_Rect(enum FIELD_PROP prop, const CFX_FloatRect& rect);
void AddDelay_Color(enum FIELD_PROP prop, const CPWL_Color& color);
void AddDelay_WordArray(enum FIELD_PROP prop, const CFX_DWordArray& array);
void AddDelay_WideStringArray(enum FIELD_PROP prop,