| 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 "fpdfsdk/pdfwindow/PWL_Utils.h" | 7 #include "fpdfsdk/pdfwindow/PWL_Utils.h" |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 pEdit->SetAlignmentH(nAlignmentH, TRUE); | 441 pEdit->SetAlignmentH(nAlignmentH, TRUE); |
| 442 pEdit->SetAlignmentV(nAlignmentV, TRUE); | 442 pEdit->SetAlignmentV(nAlignmentV, TRUE); |
| 443 pEdit->SetMultiLine(bMultiLine, TRUE); | 443 pEdit->SetMultiLine(bMultiLine, TRUE); |
| 444 pEdit->SetAutoReturn(bAutoReturn, TRUE); | 444 pEdit->SetAutoReturn(bAutoReturn, TRUE); |
| 445 if (IsFloatZero(fFontSize)) | 445 if (IsFloatZero(fFontSize)) |
| 446 pEdit->SetAutoFontSize(TRUE, TRUE); | 446 pEdit->SetAutoFontSize(TRUE, TRUE); |
| 447 else | 447 else |
| 448 pEdit->SetFontSize(fFontSize); | 448 pEdit->SetFontSize(fFontSize); |
| 449 | 449 |
| 450 pEdit->Initialize(); | 450 pEdit->Initialize(); |
| 451 pEdit->SetText(sText.c_str()); | 451 pEdit->SetText(sText); |
| 452 | 452 |
| 453 CFX_ByteString sEdit = | 453 CFX_ByteString sEdit = |
| 454 CPWL_Utils::GetEditAppStream(pEdit.get(), CFX_FloatPoint(0.0f, 0.0f)); | 454 CPWL_Utils::GetEditAppStream(pEdit.get(), CFX_FloatPoint(0.0f, 0.0f)); |
| 455 if (sEdit.GetLength() > 0) | 455 if (sEdit.GetLength() > 0) |
| 456 sRet << "BT\n" << CPWL_Utils::GetColorAppStream(crText) << sEdit << "ET\n"; | 456 sRet << "BT\n" << CPWL_Utils::GetColorAppStream(crText) << sEdit << "ET\n"; |
| 457 | 457 |
| 458 return sRet.MakeString(); | 458 return sRet.MakeString(); |
| 459 } | 459 } |
| 460 | 460 |
| 461 CFX_ByteString CPWL_Utils::GetPushButtonAppStream(const CFX_FloatRect& rcBBox, | 461 CFX_ByteString CPWL_Utils::GetPushButtonAppStream(const CFX_FloatRect& rcBBox, |
| (...skipping 11 matching lines...) Expand all Loading... |
| 473 pEdit->SetAlignmentH(1, TRUE); | 473 pEdit->SetAlignmentH(1, TRUE); |
| 474 pEdit->SetAlignmentV(1, TRUE); | 474 pEdit->SetAlignmentV(1, TRUE); |
| 475 pEdit->SetMultiLine(FALSE, TRUE); | 475 pEdit->SetMultiLine(FALSE, TRUE); |
| 476 pEdit->SetAutoReturn(FALSE, TRUE); | 476 pEdit->SetAutoReturn(FALSE, TRUE); |
| 477 if (IsFloatZero(fFontSize)) | 477 if (IsFloatZero(fFontSize)) |
| 478 pEdit->SetAutoFontSize(TRUE, TRUE); | 478 pEdit->SetAutoFontSize(TRUE, TRUE); |
| 479 else | 479 else |
| 480 pEdit->SetFontSize(fFontSize); | 480 pEdit->SetFontSize(fFontSize); |
| 481 | 481 |
| 482 pEdit->Initialize(); | 482 pEdit->Initialize(); |
| 483 pEdit->SetText(sLabel.c_str()); | 483 pEdit->SetText(sLabel); |
| 484 | 484 |
| 485 CFX_FloatRect rcLabelContent = pEdit->GetContentRect(); | 485 CFX_FloatRect rcLabelContent = pEdit->GetContentRect(); |
| 486 CPWL_Icon Icon; | 486 CPWL_Icon Icon; |
| 487 PWL_CREATEPARAM cp; | 487 PWL_CREATEPARAM cp; |
| 488 cp.dwFlags = PWS_VISIBLE; | 488 cp.dwFlags = PWS_VISIBLE; |
| 489 Icon.Create(cp); | 489 Icon.Create(cp); |
| 490 Icon.SetIconFit(&IconFit); | 490 Icon.SetIconFit(&IconFit); |
| 491 Icon.SetPDFStream(pIconStream); | 491 Icon.SetPDFStream(pIconStream); |
| 492 | 492 |
| 493 CFX_FloatRect rcLabel = CFX_FloatRect(0, 0, 0, 0); | 493 CFX_FloatRect rcLabel = CFX_FloatRect(0, 0, 0, 0); |
| (...skipping 2851 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 = nConvertColorType; | 3353 nColorType = nConvertColorType; |
| 3354 } | 3354 } |
| OLD | NEW |