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 "xfa/fxfa/app/xfa_ffnotify.h" | 9 #include "xfa/fxfa/app/xfa_ffnotify.h" |
10 #include "xfa/fxfa/fm2js/xfa_fm2jsapi.h" | 10 #include "xfa/fxfa/fm2js/xfa_fm2jsapi.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 methodName = L"x"; | 58 methodName = L"x"; |
59 break; | 59 break; |
60 case XFA_LAYOUTMODEL_Y: | 60 case XFA_LAYOUTMODEL_Y: |
61 methodName = L"y"; | 61 methodName = L"y"; |
62 break; | 62 break; |
63 } | 63 } |
64 ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, methodName); | 64 ThrowScriptErrorMessage(XFA_IDS_INCORRECT_NUMBER_OF_METHOD, methodName); |
65 return; | 65 return; |
66 } | 66 } |
67 CXFA_Node* pNode = NULL; | 67 CXFA_Node* pNode = NULL; |
68 CFX_WideString wsUnit = FX_WSTRC(L"pt"); | 68 CFX_WideString wsUnit(L"pt"); |
69 int32_t iIndex = 0; | 69 int32_t iIndex = 0; |
70 if (iLength >= 1) { | 70 if (iLength >= 1) { |
71 pNode = static_cast<CXFA_Node*>(pArguments->GetObject(0)); | 71 pNode = static_cast<CXFA_Node*>(pArguments->GetObject(0)); |
72 } | 72 } |
73 if (iLength >= 2) { | 73 if (iLength >= 2) { |
74 CFX_ByteString bsUnit = pArguments->GetUTF8String(1); | 74 CFX_ByteString bsUnit = pArguments->GetUTF8String(1); |
75 if (!bsUnit.IsEmpty()) { | 75 if (!bsUnit.IsEmpty()) { |
76 wsUnit = CFX_WideString::FromUTF8(bsUnit.AsStringC()); | 76 wsUnit = CFX_WideString::FromUTF8(bsUnit.AsStringC()); |
77 } | 77 } |
78 } | 78 } |
(...skipping 469 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
548 CXFA_LayoutItem* pLayoutItem = pDocLayout->GetLayoutItem(pNode); | 548 CXFA_LayoutItem* pLayoutItem = pDocLayout->GetLayoutItem(pNode); |
549 if (!pLayoutItem) { | 549 if (!pLayoutItem) { |
550 FXJSE_Value_SetInteger(hValue, -1); | 550 FXJSE_Value_SetInteger(hValue, -1); |
551 return; | 551 return; |
552 } | 552 } |
553 iPage = pLayoutItem->GetFirst()->GetPage()->GetPageIndex(); | 553 iPage = pLayoutItem->GetFirst()->GetPage()->GetPageIndex(); |
554 if (hValue) { | 554 if (hValue) { |
555 FXJSE_Value_SetInteger(hValue, bAbsPage ? iPage : iPage + 1); | 555 FXJSE_Value_SetInteger(hValue, bAbsPage ? iPage : iPage + 1); |
556 } | 556 } |
557 } | 557 } |
OLD | NEW |