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

Side by Side Diff: fpdfsdk/src/fxedit/fxet_pageobjs.cpp

Issue 1252613002: FX_BOOL considered harmful. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Manual edits. Created 5 years, 5 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 | « fpdfsdk/src/fxedit/fxet_list.cpp ('k') | fpdfsdk/src/javascript/Document.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 "../../include/fxedit/fxet_stub.h" 7 #include "../../include/fxedit/fxet_stub.h"
8 #include "../../include/fxedit/fx_edit.h" 8 #include "../../include/fxedit/fx_edit.h"
9 #include "../../include/fxedit/fxet_edit.h" 9 #include "../../include/fxedit/fxet_edit.h"
10 10
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 } 125 }
126 } 126 }
127 127
128 pDevice->RestoreState(); 128 pDevice->RestoreState();
129 } 129 }
130 130
131 void IFX_Edit::DrawEdit(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, IF X_Edit* pEdit, FX_COLORREF crTextFill, FX_COLORREF crTextStroke, 131 void IFX_Edit::DrawEdit(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device, IF X_Edit* pEdit, FX_COLORREF crTextFill, FX_COLORREF crTextStroke,
132 const CPDF_Rect& rcClip, const C PDF_Point& ptOffset, const CPVT_WordRange* pRange, IFX_SystemHandler* pSystemHan dler, void* pFFLData) 132 const CPDF_Rect& rcClip, const C PDF_Point& ptOffset, const CPVT_WordRange* pRange, IFX_SystemHandler* pSystemHan dler, void* pFFLData)
133 { 133 {
134 134
135 » FX_BOOL bContinuous = pEdit->GetCharArray() == 0; 135 » bool bContinuous = pEdit->GetCharArray() == 0;
136 if (pEdit->GetCharSpace() > 0.0f) 136 if (pEdit->GetCharSpace() > 0.0f)
137 » » bContinuous = FALSE; 137 » » bContinuous = false;
138 138
139 FX_WORD SubWord = pEdit->GetPasswordChar(); 139 FX_WORD SubWord = pEdit->GetPasswordChar();
140 FX_FLOAT fFontSize = pEdit->GetFontSize(); 140 FX_FLOAT fFontSize = pEdit->GetFontSize();
141 CPVT_WordRange wrSelect = pEdit->GetSelectWordRange(); 141 CPVT_WordRange wrSelect = pEdit->GetSelectWordRange();
142 int32_t nHorzScale = pEdit->GetHorzScale(); 142 int32_t nHorzScale = pEdit->GetHorzScale();
143 143
144 FX_COLORREF crCurFill = crTextFill; 144 FX_COLORREF crCurFill = crTextFill;
145 FX_COLORREF crOldFill = crCurFill; 145 FX_COLORREF crOldFill = crCurFill;
146 146
147 » FX_BOOL bSelect = FALSE; 147 » bool bSelect = false;
148 const FX_COLORREF crWhite = ArgbEncode(255,255,255,255); 148 const FX_COLORREF crWhite = ArgbEncode(255,255,255,255);
149 const FX_COLORREF crSelBK = ArgbEncode(255,0,51,113); 149 const FX_COLORREF crSelBK = ArgbEncode(255,0,51,113);
150 150
151 CFX_ByteTextBuf sTextBuf; 151 CFX_ByteTextBuf sTextBuf;
152 int32_t nFontIndex = -1; 152 int32_t nFontIndex = -1;
153 CPDF_Point ptBT(0.0f,0.0f); 153 CPDF_Point ptBT(0.0f,0.0f);
154 154
155 pDevice->SaveState(); 155 pDevice->SaveState();
156 156
157 if (!rcClip.IsEmpty()) 157 if (!rcClip.IsEmpty())
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 } 271 }
272 272
273 void IFX_Edit::DrawRichEdit(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device , IFX_Edit* pEdit, 273 void IFX_Edit::DrawRichEdit(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device , IFX_Edit* pEdit,
274 const CPDF_Rect& rcClip, const C PDF_Point& ptOffset, const CPVT_WordRange* pRange) 274 const CPDF_Rect& rcClip, const C PDF_Point& ptOffset, const CPVT_WordRange* pRange)
275 { 275 {
276 //FX_FLOAT fFontSize = pEdit->GetFontSize(); 276 //FX_FLOAT fFontSize = pEdit->GetFontSize();
277 CPVT_WordRange wrSelect = pEdit->GetSelectWordRange(); 277 CPVT_WordRange wrSelect = pEdit->GetSelectWordRange();
278 278
279 FX_COLORREF crCurText = ArgbEncode(255, 0,0,0); 279 FX_COLORREF crCurText = ArgbEncode(255, 0,0,0);
280 FX_COLORREF crOld = crCurText; 280 FX_COLORREF crOld = crCurText;
281 » FX_BOOL bSelect = FALSE; 281 » bool bSelect = false;
282 const FX_COLORREF crWhite = ArgbEncode(255,255,255,255); 282 const FX_COLORREF crWhite = ArgbEncode(255,255,255,255);
283 const FX_COLORREF crSelBK = ArgbEncode(255,0,51,113); 283 const FX_COLORREF crSelBK = ArgbEncode(255,0,51,113);
284 284
285 CFX_ByteTextBuf sTextBuf; 285 CFX_ByteTextBuf sTextBuf;
286 CPVT_WordProps wp; 286 CPVT_WordProps wp;
287 CPDF_Point ptBT(0.0f,0.0f); 287 CPDF_Point ptBT(0.0f,0.0f);
288 288
289 pDevice->SaveState(); 289 pDevice->SaveState();
290 290
291 if (!rcClip.IsEmpty()) 291 if (!rcClip.IsEmpty())
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
403 CPDF_PathData* pPathData = pPathObj->m_Path.GetModify(); 403 CPDF_PathData* pPathData = pPathObj->m_Path.GetModify();
404 pPathData->AppendRect(rcFill.left,rcFill.bottom,rcFill.right,rcFill.top) ; 404 pPathData->AppendRect(rcFill.left,rcFill.bottom,rcFill.right,rcFill.top) ;
405 405
406 FX_FLOAT rgb[3]; 406 FX_FLOAT rgb[3];
407 rgb[0] = FXARGB_R(crFill) / 255.0f ; 407 rgb[0] = FXARGB_R(crFill) / 255.0f ;
408 rgb[1] = FXARGB_G(crFill) / 255.0f; 408 rgb[1] = FXARGB_G(crFill) / 255.0f;
409 rgb[2] = FXARGB_B(crFill) / 255.0f; 409 rgb[2] = FXARGB_B(crFill) / 255.0f;
410 pPathObj->m_ColorState.SetFillColor(CPDF_ColorSpace::GetStockCS(PDFCS_DE VICERGB), rgb, 3); 410 pPathObj->m_ColorState.SetFillColor(CPDF_ColorSpace::GetStockCS(PDFCS_DE VICERGB), rgb, 3);
411 411
412 pPathObj->m_FillType = FXFILL_ALTERNATE; 412 pPathObj->m_FillType = FXFILL_ALTERNATE;
413 » pPathObj->m_bStroke = FALSE; 413 » pPathObj->m_bStroke = false;
414 414
415 pPageObjs->InsertObject(pPageObjs->GetLastObjectPosition(),pPathObj); 415 pPageObjs->InsertObject(pPageObjs->GetLastObjectPosition(),pPathObj);
416 } 416 }
417 417
418 static CPDF_TextObject* AddTextObjToPageObjects(CPDF_PageObjects* pPageObjs, FX_ COLORREF crText, 418 static CPDF_TextObject* AddTextObjToPageObjects(CPDF_PageObjects* pPageObjs, FX_ COLORREF crText,
419 CPDF_Font* pFont, FX_FL OAT fFontSize, FX_FLOAT fCharSpace, int32_t nHorzScale, 419 CPDF_Font* pFont, FX_FL OAT fFontSize, FX_FLOAT fCharSpace, int32_t nHorzScale,
420 const CPDF_Point& point , const CFX_ByteString& text) 420 const CPDF_Point& point , const CFX_ByteString& text)
421 { 421 {
422 CPDF_TextObject* pTxtObj = new CPDF_TextObject; 422 CPDF_TextObject* pTxtObj = new CPDF_TextObject;
423 423
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after
632 rcUnderline.right += ptOffset.x; 632 rcUnderline.right += ptOffset.x;
633 rcUnderline.top += ptOffset.y; 633 rcUnderline.top += ptOffset.y;
634 rcUnderline.bottom += ptOffset.y; 634 rcUnderline.bottom += ptOffset.y;
635 AddRectToPageObjects(pPageObjects, color , rcUnderline); 635 AddRectToPageObjects(pPageObjects, color , rcUnderline);
636 } 636 }
637 } 637 }
638 } 638 }
639 } 639 }
640 } 640 }
641 641
OLDNEW
« no previous file with comments | « fpdfsdk/src/fxedit/fxet_list.cpp ('k') | fpdfsdk/src/javascript/Document.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698