Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: xfa/fxfa/parser/xfa_script_layoutpseudomodel.cpp

Issue 1857073002: Make down-conversion explicit from CFX_Widetring to CFX_WideStringC. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: String argument type Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « xfa/fxfa/parser/xfa_script_imp.cpp ('k') | xfa/fxfa/parser/xfa_script_nodehelper.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
110 case XFA_LAYOUTMODEL_W: 110 case XFA_LAYOUTMODEL_W:
111 measure.Set(rtRect.width, XFA_UNIT_Pt); 111 measure.Set(rtRect.width, XFA_UNIT_Pt);
112 break; 112 break;
113 case XFA_LAYOUTMODEL_X: 113 case XFA_LAYOUTMODEL_X:
114 measure.Set(rtRect.left, XFA_UNIT_Pt); 114 measure.Set(rtRect.left, XFA_UNIT_Pt);
115 break; 115 break;
116 case XFA_LAYOUTMODEL_Y: 116 case XFA_LAYOUTMODEL_Y:
117 measure.Set(rtRect.top, XFA_UNIT_Pt); 117 measure.Set(rtRect.top, XFA_UNIT_Pt);
118 break; 118 break;
119 } 119 }
120 XFA_UNIT unit = measure.GetUnit(wsUnit); 120 XFA_UNIT unit = measure.GetUnit(wsUnit.AsWideStringC());
121 FX_FLOAT fValue = measure.ToUnit(unit); 121 FX_FLOAT fValue = measure.ToUnit(unit);
122 fValue = FXSYS_round(fValue * 1000) / 1000.0f; 122 fValue = FXSYS_round(fValue * 1000) / 1000.0f;
123 if (hValue) { 123 if (hValue) {
124 FXJSE_Value_SetFloat(hValue, fValue); 124 FXJSE_Value_SetFloat(hValue, fValue);
125 } 125 }
126 } 126 }
127 void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_H( 127 void CScript_LayoutPseudoModel::Script_LayoutPseudoModel_H(
128 CFXJSE_Arguments* pArguments) { 128 CFXJSE_Arguments* pArguments) {
129 Script_LayoutPseudoModel_HWXY(pArguments, XFA_LAYOUTMODEL_H); 129 Script_LayoutPseudoModel_HWXY(pArguments, XFA_LAYOUTMODEL_H);
130 } 130 }
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after
549 CXFA_LayoutItem* pLayoutItem = pDocLayout->GetLayoutItem(pNode); 549 CXFA_LayoutItem* pLayoutItem = pDocLayout->GetLayoutItem(pNode);
550 if (!pLayoutItem) { 550 if (!pLayoutItem) {
551 FXJSE_Value_SetInteger(hValue, -1); 551 FXJSE_Value_SetInteger(hValue, -1);
552 return; 552 return;
553 } 553 }
554 iPage = pLayoutItem->GetFirst()->GetPage()->GetPageIndex(); 554 iPage = pLayoutItem->GetFirst()->GetPage()->GetPageIndex();
555 if (hValue) { 555 if (hValue) {
556 FXJSE_Value_SetInteger(hValue, bAbsPage ? iPage : iPage + 1); 556 FXJSE_Value_SetInteger(hValue, bAbsPage ? iPage : iPage + 1);
557 } 557 }
558 } 558 }
OLDNEW
« no previous file with comments | « xfa/fxfa/parser/xfa_script_imp.cpp ('k') | xfa/fxfa/parser/xfa_script_nodehelper.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698