OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #include "xfa/fxfa/parser/xfa_script_layoutpseudomodel.h" | 7 #include "xfa/fxfa/parser/xfa_script_layoutpseudomodel.h" |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 | 10 |
(...skipping 12 matching lines...) Expand all Loading... |
23 #include "xfa/fxfa/parser/xfa_script_imp.h" | 23 #include "xfa/fxfa/parser/xfa_script_imp.h" |
24 #include "xfa/fxfa/parser/xfa_utils.h" | 24 #include "xfa/fxfa/parser/xfa_utils.h" |
25 #include "xfa/fxjse/cfxjse_arguments.h" | 25 #include "xfa/fxjse/cfxjse_arguments.h" |
26 | 26 |
27 CScript_LayoutPseudoModel::CScript_LayoutPseudoModel(CXFA_Document* pDocument) | 27 CScript_LayoutPseudoModel::CScript_LayoutPseudoModel(CXFA_Document* pDocument) |
28 : CXFA_OrdinaryObject(pDocument, XFA_ELEMENT_LayoutPseudoModel) { | 28 : CXFA_OrdinaryObject(pDocument, XFA_ELEMENT_LayoutPseudoModel) { |
29 m_uScriptHash = XFA_HASHCODE_Layout; | 29 m_uScriptHash = XFA_HASHCODE_Layout; |
30 } | 30 } |
31 CScript_LayoutPseudoModel::~CScript_LayoutPseudoModel() {} | 31 CScript_LayoutPseudoModel::~CScript_LayoutPseudoModel() {} |
32 void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_Ready( | 32 void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_Ready( |
33 FXJSE_HVALUE hValue, | 33 CFXJSE_Value* pValue, |
34 FX_BOOL bSetting, | 34 FX_BOOL bSetting, |
35 XFA_ATTRIBUTE eAttribute) { | 35 XFA_ATTRIBUTE eAttribute) { |
36 CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); | 36 CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); |
37 if (!pNotify) { | 37 if (!pNotify) { |
38 return; | 38 return; |
39 } | 39 } |
40 if (bSetting) { | 40 if (bSetting) { |
41 ThrowScriptErrorMessage(XFA_IDS_UNABLE_SET_READY); | 41 ThrowScriptErrorMessage(XFA_IDS_UNABLE_SET_READY); |
42 return; | 42 return; |
43 } | 43 } |
44 int32_t iStatus = pNotify->GetLayoutStatus(); | 44 int32_t iStatus = pNotify->GetLayoutStatus(); |
45 FXJSE_Value_SetBoolean(hValue, iStatus >= 2); | 45 FXJSE_Value_SetBoolean(pValue, iStatus >= 2); |
46 } | 46 } |
47 void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_HWXY( | 47 void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_HWXY( |
48 CFXJSE_Arguments* pArguments, | 48 CFXJSE_Arguments* pArguments, |
49 XFA_LAYOUTMODEL_HWXY layoutModel) { | 49 XFA_LAYOUTMODEL_HWXY layoutModel) { |
50 int32_t iLength = pArguments->GetLength(); | 50 int32_t iLength = pArguments->GetLength(); |
51 if (iLength < 1 || iLength > 3) { | 51 if (iLength < 1 || iLength > 3) { |
52 const FX_WCHAR* methodName = NULL; | 52 const FX_WCHAR* methodName = NULL; |
53 switch (layoutModel) { | 53 switch (layoutModel) { |
54 case XFA_LAYOUTMODEL_H: | 54 case XFA_LAYOUTMODEL_H: |
55 methodName = L"h"; | 55 methodName = L"h"; |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 CFX_RectF rtRect; | 92 CFX_RectF rtRect; |
93 CXFA_Measurement measure; | 93 CXFA_Measurement measure; |
94 CXFA_LayoutItem* pLayoutItem = pDocLayout->GetLayoutItem(pNode); | 94 CXFA_LayoutItem* pLayoutItem = pDocLayout->GetLayoutItem(pNode); |
95 if (!pLayoutItem) { | 95 if (!pLayoutItem) { |
96 return; | 96 return; |
97 } | 97 } |
98 while (iIndex > 0 && pLayoutItem) { | 98 while (iIndex > 0 && pLayoutItem) { |
99 pLayoutItem = pLayoutItem->GetNext(); | 99 pLayoutItem = pLayoutItem->GetNext(); |
100 iIndex--; | 100 iIndex--; |
101 } | 101 } |
102 FXJSE_HVALUE hValue = pArguments->GetReturnValue(); | 102 CFXJSE_Value* pValue = pArguments->GetReturnValue(); |
103 if (!pLayoutItem) { | 103 if (!pLayoutItem) { |
104 FXJSE_Value_SetFloat(hValue, 0); | 104 FXJSE_Value_SetFloat(pValue, 0); |
105 return; | 105 return; |
106 } | 106 } |
107 pLayoutItem->GetRect(rtRect, TRUE); | 107 pLayoutItem->GetRect(rtRect, TRUE); |
108 switch (layoutModel) { | 108 switch (layoutModel) { |
109 case XFA_LAYOUTMODEL_H: | 109 case XFA_LAYOUTMODEL_H: |
110 measure.Set(rtRect.height, XFA_UNIT_Pt); | 110 measure.Set(rtRect.height, XFA_UNIT_Pt); |
111 break; | 111 break; |
112 case XFA_LAYOUTMODEL_W: | 112 case XFA_LAYOUTMODEL_W: |
113 measure.Set(rtRect.width, XFA_UNIT_Pt); | 113 measure.Set(rtRect.width, XFA_UNIT_Pt); |
114 break; | 114 break; |
115 case XFA_LAYOUTMODEL_X: | 115 case XFA_LAYOUTMODEL_X: |
116 measure.Set(rtRect.left, XFA_UNIT_Pt); | 116 measure.Set(rtRect.left, XFA_UNIT_Pt); |
117 break; | 117 break; |
118 case XFA_LAYOUTMODEL_Y: | 118 case XFA_LAYOUTMODEL_Y: |
119 measure.Set(rtRect.top, XFA_UNIT_Pt); | 119 measure.Set(rtRect.top, XFA_UNIT_Pt); |
120 break; | 120 break; |
121 } | 121 } |
122 XFA_UNIT unit = measure.GetUnit(wsUnit.AsStringC()); | 122 XFA_UNIT unit = measure.GetUnit(wsUnit.AsStringC()); |
123 FX_FLOAT fValue = measure.ToUnit(unit); | 123 FX_FLOAT fValue = measure.ToUnit(unit); |
124 fValue = FXSYS_round(fValue * 1000) / 1000.0f; | 124 fValue = FXSYS_round(fValue * 1000) / 1000.0f; |
125 if (hValue) { | 125 if (pValue) { |
126 FXJSE_Value_SetFloat(hValue, fValue); | 126 FXJSE_Value_SetFloat(pValue, fValue); |
127 } | 127 } |
128 } | 128 } |
129 void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_H( | 129 void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_H( |
130 CFXJSE_Arguments* pArguments) { | 130 CFXJSE_Arguments* pArguments) { |
131 Script_LayoutPseudoModel_HWXY(pArguments, XFA_LAYOUTMODEL_H); | 131 Script_LayoutPseudoModel_HWXY(pArguments, XFA_LAYOUTMODEL_H); |
132 } | 132 } |
133 void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_W( | 133 void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_W( |
134 CFXJSE_Arguments* pArguments) { | 134 CFXJSE_Arguments* pArguments) { |
135 Script_LayoutPseudoModel_HWXY(pArguments, XFA_LAYOUTMODEL_W); | 135 Script_LayoutPseudoModel_HWXY(pArguments, XFA_LAYOUTMODEL_W); |
136 } | 136 } |
(...skipping 21 matching lines...) Expand all Loading... |
158 continue; | 158 continue; |
159 } | 159 } |
160 CXFA_Node* pMasterPage = pLayoutPage->GetMasterPage(); | 160 CXFA_Node* pMasterPage = pLayoutPage->GetMasterPage(); |
161 if (pMasterPage->GetInteger(XFA_ATTRIBUTE_Numbered)) { | 161 if (pMasterPage->GetInteger(XFA_ATTRIBUTE_Numbered)) { |
162 iPageCount++; | 162 iPageCount++; |
163 } | 163 } |
164 } | 164 } |
165 } else { | 165 } else { |
166 iPageCount = iPageNum; | 166 iPageCount = iPageNum; |
167 } | 167 } |
168 FXJSE_HVALUE hValue = pArguments->GetReturnValue(); | 168 CFXJSE_Value* pValue = pArguments->GetReturnValue(); |
169 if (hValue) { | 169 if (pValue) { |
170 FXJSE_Value_SetInteger(hValue, iPageCount); | 170 FXJSE_Value_SetInteger(pValue, iPageCount); |
171 } | 171 } |
172 } | 172 } |
173 void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_PageCount( | 173 void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_PageCount( |
174 CFXJSE_Arguments* pArguments) { | 174 CFXJSE_Arguments* pArguments) { |
175 Script_LayoutPseudoModel_NumberedPageCount(pArguments, TRUE); | 175 Script_LayoutPseudoModel_NumberedPageCount(pArguments, TRUE); |
176 } | 176 } |
177 void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_PageSpan( | 177 void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_PageSpan( |
178 CFXJSE_Arguments* pArguments) { | 178 CFXJSE_Arguments* pArguments) { |
179 int32_t iLength = pArguments->GetLength(); | 179 int32_t iLength = pArguments->GetLength(); |
180 if (iLength != 1) { | 180 if (iLength != 1) { |
181 ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"pageSpan"); | 181 ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, L"pageSpan"); |
182 return; | 182 return; |
183 } | 183 } |
184 CXFA_Node* pNode = NULL; | 184 CXFA_Node* pNode = NULL; |
185 if (iLength >= 1) { | 185 if (iLength >= 1) { |
186 pNode = static_cast<CXFA_Node*>(pArguments->GetObject(0)); | 186 pNode = static_cast<CXFA_Node*>(pArguments->GetObject(0)); |
187 } | 187 } |
188 if (!pNode) { | 188 if (!pNode) { |
189 return; | 189 return; |
190 } | 190 } |
191 CXFA_LayoutProcessor* pDocLayout = m_pDocument->GetDocLayout(); | 191 CXFA_LayoutProcessor* pDocLayout = m_pDocument->GetDocLayout(); |
192 if (!pDocLayout) { | 192 if (!pDocLayout) { |
193 return; | 193 return; |
194 } | 194 } |
195 FXJSE_HVALUE hValue = pArguments->GetReturnValue(); | 195 CFXJSE_Value* pValue = pArguments->GetReturnValue(); |
196 CXFA_LayoutItem* pLayoutItem = pDocLayout->GetLayoutItem(pNode); | 196 CXFA_LayoutItem* pLayoutItem = pDocLayout->GetLayoutItem(pNode); |
197 if (!pLayoutItem) { | 197 if (!pLayoutItem) { |
198 FXJSE_Value_SetInteger(hValue, -1); | 198 FXJSE_Value_SetInteger(pValue, -1); |
199 return; | 199 return; |
200 } | 200 } |
201 int32_t iLast = pLayoutItem->GetLast()->GetPage()->GetPageIndex(); | 201 int32_t iLast = pLayoutItem->GetLast()->GetPage()->GetPageIndex(); |
202 int32_t iFirst = pLayoutItem->GetFirst()->GetPage()->GetPageIndex(); | 202 int32_t iFirst = pLayoutItem->GetFirst()->GetPage()->GetPageIndex(); |
203 int32_t iPageSpan = iLast - iFirst + 1; | 203 int32_t iPageSpan = iLast - iFirst + 1; |
204 if (hValue) { | 204 if (pValue) { |
205 FXJSE_Value_SetInteger(hValue, iPageSpan); | 205 FXJSE_Value_SetInteger(pValue, iPageSpan); |
206 } | 206 } |
207 } | 207 } |
208 void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_Page( | 208 void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_Page( |
209 CFXJSE_Arguments* pArguments) { | 209 CFXJSE_Arguments* pArguments) { |
210 Script_LayoutPseudoModel_PageImp(pArguments, FALSE); | 210 Script_LayoutPseudoModel_PageImp(pArguments, FALSE); |
211 } | 211 } |
212 void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_GetObjArray( | 212 void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_GetObjArray( |
213 CXFA_LayoutProcessor* pDocLayout, | 213 CXFA_LayoutProcessor* pDocLayout, |
214 int32_t iPageNo, | 214 int32_t iPageNo, |
215 const CFX_WideString& wsType, | 215 const CFX_WideString& wsType, |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
388 Script_LayoutPseudoModel_NumberedPageCount(pArguments, FALSE); | 388 Script_LayoutPseudoModel_NumberedPageCount(pArguments, FALSE); |
389 } | 389 } |
390 void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_AbsPageCountInBatch( | 390 void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_AbsPageCountInBatch( |
391 CFXJSE_Arguments* pArguments) { | 391 CFXJSE_Arguments* pArguments) { |
392 CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); | 392 CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); |
393 if (!pNotify) { | 393 if (!pNotify) { |
394 return; | 394 return; |
395 } | 395 } |
396 CXFA_FFDoc* hDoc = pNotify->GetHDOC(); | 396 CXFA_FFDoc* hDoc = pNotify->GetHDOC(); |
397 int32_t iPageCount = pNotify->GetDocProvider()->AbsPageCountInBatch(hDoc); | 397 int32_t iPageCount = pNotify->GetDocProvider()->AbsPageCountInBatch(hDoc); |
398 FXJSE_HVALUE hValue = pArguments->GetReturnValue(); | 398 CFXJSE_Value* pValue = pArguments->GetReturnValue(); |
399 if (hValue) { | 399 if (pValue) { |
400 FXJSE_Value_SetInteger(hValue, iPageCount); | 400 FXJSE_Value_SetInteger(pValue, iPageCount); |
401 } | 401 } |
402 } | 402 } |
403 void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_SheetCountInBatch( | 403 void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_SheetCountInBatch( |
404 CFXJSE_Arguments* pArguments) { | 404 CFXJSE_Arguments* pArguments) { |
405 CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); | 405 CXFA_FFNotify* pNotify = m_pDocument->GetParser()->GetNotify(); |
406 if (!pNotify) { | 406 if (!pNotify) { |
407 return; | 407 return; |
408 } | 408 } |
409 CXFA_FFDoc* hDoc = pNotify->GetHDOC(); | 409 CXFA_FFDoc* hDoc = pNotify->GetHDOC(); |
410 int32_t iPageCount = pNotify->GetDocProvider()->SheetCountInBatch(hDoc); | 410 int32_t iPageCount = pNotify->GetDocProvider()->SheetCountInBatch(hDoc); |
411 FXJSE_HVALUE hValue = pArguments->GetReturnValue(); | 411 CFXJSE_Value* pValue = pArguments->GetReturnValue(); |
412 if (hValue) { | 412 if (pValue) { |
413 FXJSE_Value_SetInteger(hValue, iPageCount); | 413 FXJSE_Value_SetInteger(pValue, iPageCount); |
414 } | 414 } |
415 } | 415 } |
416 void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_Relayout( | 416 void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_Relayout( |
417 CFXJSE_Arguments* pArguments) { | 417 CFXJSE_Arguments* pArguments) { |
418 CXFA_Node* pRootNode = m_pDocument->GetRoot(); | 418 CXFA_Node* pRootNode = m_pDocument->GetRoot(); |
419 CXFA_Node* pFormRoot = pRootNode->GetFirstChildByClass(XFA_ELEMENT_Form); | 419 CXFA_Node* pFormRoot = pRootNode->GetFirstChildByClass(XFA_ELEMENT_Form); |
420 ASSERT(pFormRoot); | 420 ASSERT(pFormRoot); |
421 CXFA_Node* pContentRootNode = pFormRoot->GetNodeItem(XFA_NODEITEM_FirstChild); | 421 CXFA_Node* pContentRootNode = pFormRoot->GetNodeItem(XFA_NODEITEM_FirstChild); |
422 CXFA_LayoutProcessor* pLayoutProcessor = m_pDocument->GetLayoutProcessor(); | 422 CXFA_LayoutProcessor* pLayoutProcessor = m_pDocument->GetLayoutProcessor(); |
423 if (pContentRootNode) { | 423 if (pContentRootNode) { |
(...skipping 28 matching lines...) Expand all Loading... |
452 if (!pDocLayout) { | 452 if (!pDocLayout) { |
453 return; | 453 return; |
454 } | 454 } |
455 CXFA_FFWidget* hWidget = | 455 CXFA_FFWidget* hWidget = |
456 pNotify->GetHWidget(pDocLayout->GetLayoutItem(pNode)); | 456 pNotify->GetHWidget(pDocLayout->GetLayoutItem(pNode)); |
457 if (!hWidget) { | 457 if (!hWidget) { |
458 return; | 458 return; |
459 } | 459 } |
460 CXFA_FFDoc* hDoc = pNotify->GetHDOC(); | 460 CXFA_FFDoc* hDoc = pNotify->GetHDOC(); |
461 int32_t iPageCount = pNotify->GetDocProvider()->AbsPageInBatch(hDoc, hWidget); | 461 int32_t iPageCount = pNotify->GetDocProvider()->AbsPageInBatch(hDoc, hWidget); |
462 FXJSE_HVALUE hValue = pArguments->GetReturnValue(); | 462 CFXJSE_Value* pValue = pArguments->GetReturnValue(); |
463 if (hValue) { | 463 if (pValue) { |
464 FXJSE_Value_SetInteger(hValue, iPageCount); | 464 FXJSE_Value_SetInteger(pValue, iPageCount); |
465 } | 465 } |
466 } | 466 } |
467 void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_SheetInBatch( | 467 void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_SheetInBatch( |
468 CFXJSE_Arguments* pArguments) { | 468 CFXJSE_Arguments* pArguments) { |
469 int32_t iLength = pArguments->GetLength(); | 469 int32_t iLength = pArguments->GetLength(); |
470 if (iLength != 1) { | 470 if (iLength != 1) { |
471 ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, | 471 ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, |
472 L"sheetInBatch"); | 472 L"sheetInBatch"); |
473 return; | 473 return; |
474 } | 474 } |
(...skipping 12 matching lines...) Expand all Loading... |
487 if (!pDocLayout) { | 487 if (!pDocLayout) { |
488 return; | 488 return; |
489 } | 489 } |
490 CXFA_FFWidget* hWidget = | 490 CXFA_FFWidget* hWidget = |
491 pNotify->GetHWidget(pDocLayout->GetLayoutItem(pNode)); | 491 pNotify->GetHWidget(pDocLayout->GetLayoutItem(pNode)); |
492 if (!hWidget) { | 492 if (!hWidget) { |
493 return; | 493 return; |
494 } | 494 } |
495 CXFA_FFDoc* hDoc = pNotify->GetHDOC(); | 495 CXFA_FFDoc* hDoc = pNotify->GetHDOC(); |
496 int32_t iPageCount = pNotify->GetDocProvider()->SheetInBatch(hDoc, hWidget); | 496 int32_t iPageCount = pNotify->GetDocProvider()->SheetInBatch(hDoc, hWidget); |
497 FXJSE_HVALUE hValue = pArguments->GetReturnValue(); | 497 CFXJSE_Value* pValue = pArguments->GetReturnValue(); |
498 if (hValue) { | 498 if (pValue) { |
499 FXJSE_Value_SetInteger(hValue, iPageCount); | 499 FXJSE_Value_SetInteger(pValue, iPageCount); |
500 } | 500 } |
501 } | 501 } |
502 void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_Sheet( | 502 void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_Sheet( |
503 CFXJSE_Arguments* pArguments) { | 503 CFXJSE_Arguments* pArguments) { |
504 Script_LayoutPseudoModel_PageImp(pArguments, TRUE); | 504 Script_LayoutPseudoModel_PageImp(pArguments, TRUE); |
505 } | 505 } |
506 void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_RelayoutPageArea( | 506 void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_RelayoutPageArea( |
507 CFXJSE_Arguments* pArguments) {} | 507 CFXJSE_Arguments* pArguments) {} |
508 void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_SheetCount( | 508 void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_SheetCount( |
509 CFXJSE_Arguments* pArguments) { | 509 CFXJSE_Arguments* pArguments) { |
(...skipping 15 matching lines...) Expand all Loading... |
525 methodName = L"page"; | 525 methodName = L"page"; |
526 } | 526 } |
527 ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, methodName); | 527 ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, methodName); |
528 return; | 528 return; |
529 } | 529 } |
530 CXFA_Node* pNode = NULL; | 530 CXFA_Node* pNode = NULL; |
531 if (iLength >= 1) { | 531 if (iLength >= 1) { |
532 pNode = static_cast<CXFA_Node*>(pArguments->GetObject(0)); | 532 pNode = static_cast<CXFA_Node*>(pArguments->GetObject(0)); |
533 } | 533 } |
534 int32_t iPage = 0; | 534 int32_t iPage = 0; |
535 FXJSE_HVALUE hValue = pArguments->GetReturnValue(); | 535 CFXJSE_Value* pValue = pArguments->GetReturnValue(); |
536 if (!pNode && hValue) { | 536 if (!pNode && pValue) { |
537 FXJSE_Value_SetInteger(hValue, iPage); | 537 FXJSE_Value_SetInteger(pValue, iPage); |
538 } | 538 } |
539 CXFA_LayoutProcessor* pDocLayout = m_pDocument->GetDocLayout(); | 539 CXFA_LayoutProcessor* pDocLayout = m_pDocument->GetDocLayout(); |
540 if (!pDocLayout) { | 540 if (!pDocLayout) { |
541 return; | 541 return; |
542 } | 542 } |
543 CXFA_LayoutItem* pLayoutItem = pDocLayout->GetLayoutItem(pNode); | 543 CXFA_LayoutItem* pLayoutItem = pDocLayout->GetLayoutItem(pNode); |
544 if (!pLayoutItem) { | 544 if (!pLayoutItem) { |
545 FXJSE_Value_SetInteger(hValue, -1); | 545 FXJSE_Value_SetInteger(pValue, -1); |
546 return; | 546 return; |
547 } | 547 } |
548 iPage = pLayoutItem->GetFirst()->GetPage()->GetPageIndex(); | 548 iPage = pLayoutItem->GetFirst()->GetPage()->GetPageIndex(); |
549 if (hValue) { | 549 if (pValue) { |
550 FXJSE_Value_SetInteger(hValue, bAbsPage ? iPage : iPage + 1); | 550 FXJSE_Value_SetInteger(pValue, bAbsPage ? iPage : iPage + 1); |
551 } | 551 } |
552 } | 552 } |
OLD | NEW |