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

Side by Side Diff: fpdfsdk/pdfwindow/PWL_Utils.cpp

Issue 2152473002: Removing default params from CFX_Edit. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@ifx_cleanup_2
Patch Set: Rebase to master Created 4 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
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 "fpdfsdk/pdfwindow/PWL_Utils.h" 7 #include "fpdfsdk/pdfwindow/PWL_Utils.h"
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 int32_t nAlignmentV, 434 int32_t nAlignmentV,
435 FX_FLOAT fFontSize, 435 FX_FLOAT fFontSize,
436 FX_BOOL bMultiLine, 436 FX_BOOL bMultiLine,
437 FX_BOOL bAutoReturn, 437 FX_BOOL bAutoReturn,
438 const CPWL_Color& crText) { 438 const CPWL_Color& crText) {
439 CFX_ByteTextBuf sRet; 439 CFX_ByteTextBuf sRet;
440 440
441 std::unique_ptr<CFX_Edit> pEdit(new CFX_Edit); 441 std::unique_ptr<CFX_Edit> pEdit(new CFX_Edit);
442 pEdit->SetFontMap(pFontMap); 442 pEdit->SetFontMap(pFontMap);
443 pEdit->SetPlateRect(rcBBox); 443 pEdit->SetPlateRect(rcBBox);
444 pEdit->SetAlignmentH(nAlignmentH); 444 pEdit->SetAlignmentH(nAlignmentH, TRUE);
445 pEdit->SetAlignmentV(nAlignmentV); 445 pEdit->SetAlignmentV(nAlignmentV, TRUE);
446 pEdit->SetMultiLine(bMultiLine); 446 pEdit->SetMultiLine(bMultiLine, TRUE);
447 pEdit->SetAutoReturn(bAutoReturn); 447 pEdit->SetAutoReturn(bAutoReturn, TRUE);
448 if (IsFloatZero(fFontSize)) 448 if (IsFloatZero(fFontSize))
449 pEdit->SetAutoFontSize(TRUE); 449 pEdit->SetAutoFontSize(TRUE, TRUE);
450 else 450 else
451 pEdit->SetFontSize(fFontSize); 451 pEdit->SetFontSize(fFontSize);
452 452
453 pEdit->Initialize(); 453 pEdit->Initialize();
454 pEdit->SetText(sText.c_str()); 454 pEdit->SetText(sText.c_str());
455 455
456 CFX_ByteString sEdit = 456 CFX_ByteString sEdit =
457 CPWL_Utils::GetEditAppStream(pEdit.get(), CFX_FloatPoint(0.0f, 0.0f)); 457 CPWL_Utils::GetEditAppStream(pEdit.get(), CFX_FloatPoint(0.0f, 0.0f));
458 if (sEdit.GetLength() > 0) 458 if (sEdit.GetLength() > 0)
459 sRet << "BT\n" << CPWL_Utils::GetColorAppStream(crText) << sEdit << "ET\n"; 459 sRet << "BT\n" << CPWL_Utils::GetColorAppStream(crText) << sEdit << "ET\n";
460 460
461 return sRet.MakeString(); 461 return sRet.MakeString();
462 } 462 }
463 463
464 CFX_ByteString CPWL_Utils::GetPushButtonAppStream(const CFX_FloatRect& rcBBox, 464 CFX_ByteString CPWL_Utils::GetPushButtonAppStream(const CFX_FloatRect& rcBBox,
465 IPVT_FontMap* pFontMap, 465 IPVT_FontMap* pFontMap,
466 CPDF_Stream* pIconStream, 466 CPDF_Stream* pIconStream,
467 CPDF_IconFit& IconFit, 467 CPDF_IconFit& IconFit,
468 const CFX_WideString& sLabel, 468 const CFX_WideString& sLabel,
469 const CPWL_Color& crText, 469 const CPWL_Color& crText,
470 FX_FLOAT fFontSize, 470 FX_FLOAT fFontSize,
471 int32_t nLayOut) { 471 int32_t nLayOut) {
472 const FX_FLOAT fAutoFontScale = 1.0f / 3.0f; 472 const FX_FLOAT fAutoFontScale = 1.0f / 3.0f;
473 473
474 std::unique_ptr<CFX_Edit> pEdit(new CFX_Edit); 474 std::unique_ptr<CFX_Edit> pEdit(new CFX_Edit);
475 pEdit->SetFontMap(pFontMap); 475 pEdit->SetFontMap(pFontMap);
476 pEdit->SetAlignmentH(1); 476 pEdit->SetAlignmentH(1, TRUE);
477 pEdit->SetAlignmentV(1); 477 pEdit->SetAlignmentV(1, TRUE);
478 pEdit->SetMultiLine(FALSE); 478 pEdit->SetMultiLine(FALSE, TRUE);
479 pEdit->SetAutoReturn(FALSE); 479 pEdit->SetAutoReturn(FALSE, TRUE);
480 if (IsFloatZero(fFontSize)) 480 if (IsFloatZero(fFontSize))
481 pEdit->SetAutoFontSize(TRUE); 481 pEdit->SetAutoFontSize(TRUE, TRUE);
482 else 482 else
483 pEdit->SetFontSize(fFontSize); 483 pEdit->SetFontSize(fFontSize);
484 484
485 pEdit->Initialize(); 485 pEdit->Initialize();
486 pEdit->SetText(sLabel.c_str()); 486 pEdit->SetText(sLabel.c_str());
487 487
488 CFX_FloatRect rcLabelContent = pEdit->GetContentRect(); 488 CFX_FloatRect rcLabelContent = pEdit->GetContentRect();
489 CPWL_Icon Icon; 489 CPWL_Icon Icon;
490 PWL_CREATEPARAM cp; 490 PWL_CREATEPARAM cp;
491 cp.dwFlags = PWS_VISIBLE; 491 cp.dwFlags = PWS_VISIBLE;
(...skipping 2853 matching lines...) Expand 10 before | Expand all | Expand 10 after
3345 break; 3345 break;
3346 case COLORTYPE_RGB: 3346 case COLORTYPE_RGB:
3347 CPWL_Utils::ConvertCMYK2RGB(fColor1, fColor2, fColor3, fColor4, 3347 CPWL_Utils::ConvertCMYK2RGB(fColor1, fColor2, fColor3, fColor4,
3348 fColor1, fColor2, fColor3); 3348 fColor1, fColor2, fColor3);
3349 break; 3349 break;
3350 } 3350 }
3351 break; 3351 break;
3352 } 3352 }
3353 nColorType = other_nColorType; 3353 nColorType = other_nColorType;
3354 } 3354 }
OLDNEW
« fpdfsdk/fxedit/fxet_edit.cpp ('K') | « fpdfsdk/pdfwindow/PWL_EditCtrl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698