| OLD | NEW |
| 1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 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/include/cpdfsdk_widget.h" | 7 #include "fpdfsdk/include/cpdfsdk_widget.h" |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 1384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1395 int32_t nCurSel = pField->GetSelectedIndex(0); | 1395 int32_t nCurSel = pField->GetSelectedIndex(0); |
| 1396 if (nCurSel < 0) | 1396 if (nCurSel < 0) |
| 1397 pEdit->SetText(pField->GetValue()); | 1397 pEdit->SetText(pField->GetValue()); |
| 1398 else | 1398 else |
| 1399 pEdit->SetText(pField->GetOptionLabel(nCurSel)); | 1399 pEdit->SetText(pField->GetOptionLabel(nCurSel)); |
| 1400 } | 1400 } |
| 1401 | 1401 |
| 1402 CFX_FloatRect rcContent = pEdit->GetContentRect(); | 1402 CFX_FloatRect rcContent = pEdit->GetContentRect(); |
| 1403 | 1403 |
| 1404 CFX_ByteString sEdit = | 1404 CFX_ByteString sEdit = |
| 1405 CPWL_Utils::GetEditAppStream(pEdit.get(), CFX_FloatPoint(0.0f, 0.0f)); | 1405 CPWL_Utils::GetEditAppStream(pEdit.get(), CFX_FloatPoint()); |
| 1406 if (sEdit.GetLength() > 0) { | 1406 if (sEdit.GetLength() > 0) { |
| 1407 sBody << "/Tx BMC\n" | 1407 sBody << "/Tx BMC\n" |
| 1408 << "q\n"; | 1408 << "q\n"; |
| 1409 if (rcContent.Width() > rcEdit.Width() || | 1409 if (rcContent.Width() > rcEdit.Width() || |
| 1410 rcContent.Height() > rcEdit.Height()) { | 1410 rcContent.Height() > rcEdit.Height()) { |
| 1411 sBody << rcEdit.left << " " << rcEdit.bottom << " " << rcEdit.Width() | 1411 sBody << rcEdit.left << " " << rcEdit.bottom << " " << rcEdit.Width() |
| 1412 << " " << rcEdit.Height() << " re\nW\nn\n"; | 1412 << " " << rcEdit.Height() << " re\nW\nn\n"; |
| 1413 } | 1413 } |
| 1414 | 1414 |
| 1415 CPWL_Color crText = GetTextPWLColor(); | 1415 CPWL_Color crText = GetTextPWLColor(); |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1578 if (IsFloatZero(fFontSize)) | 1578 if (IsFloatZero(fFontSize)) |
| 1579 pEdit->SetAutoFontSize(TRUE, TRUE); | 1579 pEdit->SetAutoFontSize(TRUE, TRUE); |
| 1580 else | 1580 else |
| 1581 pEdit->SetFontSize(fFontSize); | 1581 pEdit->SetFontSize(fFontSize); |
| 1582 | 1582 |
| 1583 pEdit->Initialize(); | 1583 pEdit->Initialize(); |
| 1584 pEdit->SetText(sValue ? *sValue : pField->GetValue()); | 1584 pEdit->SetText(sValue ? *sValue : pField->GetValue()); |
| 1585 | 1585 |
| 1586 CFX_FloatRect rcContent = pEdit->GetContentRect(); | 1586 CFX_FloatRect rcContent = pEdit->GetContentRect(); |
| 1587 CFX_ByteString sEdit = CPWL_Utils::GetEditAppStream( | 1587 CFX_ByteString sEdit = CPWL_Utils::GetEditAppStream( |
| 1588 pEdit.get(), CFX_FloatPoint(0.0f, 0.0f), nullptr, !bCharArray, subWord); | 1588 pEdit.get(), CFX_FloatPoint(), nullptr, !bCharArray, subWord); |
| 1589 | 1589 |
| 1590 if (sEdit.GetLength() > 0) { | 1590 if (sEdit.GetLength() > 0) { |
| 1591 sBody << "/Tx BMC\n" | 1591 sBody << "/Tx BMC\n" |
| 1592 << "q\n"; | 1592 << "q\n"; |
| 1593 if (rcContent.Width() > rcClient.Width() || | 1593 if (rcContent.Width() > rcClient.Width() || |
| 1594 rcContent.Height() > rcClient.Height()) { | 1594 rcContent.Height() > rcClient.Height()) { |
| 1595 sBody << rcClient.left << " " << rcClient.bottom << " " | 1595 sBody << rcClient.left << " " << rcClient.bottom << " " |
| 1596 << rcClient.Width() << " " << rcClient.Height() << " re\nW\nn\n"; | 1596 << rcClient.Width() << " " << rcClient.Height() << " re\nW\nn\n"; |
| 1597 } | 1597 } |
| 1598 CPWL_Color crText = GetTextPWLColor(); | 1598 CPWL_Color crText = GetTextPWLColor(); |
| (...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1943 return FALSE; | 1943 return FALSE; |
| 1944 | 1944 |
| 1945 if (!IsVisible()) | 1945 if (!IsVisible()) |
| 1946 return FALSE; | 1946 return FALSE; |
| 1947 | 1947 |
| 1948 if ((GetFieldFlags() & FIELDFLAG_READONLY) == FIELDFLAG_READONLY) | 1948 if ((GetFieldFlags() & FIELDFLAG_READONLY) == FIELDFLAG_READONLY) |
| 1949 return FALSE; | 1949 return FALSE; |
| 1950 | 1950 |
| 1951 return TRUE; | 1951 return TRUE; |
| 1952 } | 1952 } |
| OLD | NEW |