| 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_Edit.h" | 7 #include "fpdfsdk/pdfwindow/PWL_Edit.h" |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 wrTemp = CPWL_Utils::OverlapWordRange(wrVisible, wrSelAfter); | 287 wrTemp = CPWL_Utils::OverlapWordRange(wrVisible, wrSelAfter); |
| 288 CFX_ByteString sEditAfter = CPWL_Utils::GetEditAppStream( | 288 CFX_ByteString sEditAfter = CPWL_Utils::GetEditAppStream( |
| 289 m_pEdit, ptOffset, &wrTemp, !HasFlag(PES_CHARARRAY), | 289 m_pEdit, ptOffset, &wrTemp, !HasFlag(PES_CHARARRAY), |
| 290 m_pEdit->GetPasswordChar()); | 290 m_pEdit->GetPasswordChar()); |
| 291 | 291 |
| 292 if (sEditAfter.GetLength() > 0) | 292 if (sEditAfter.GetLength() > 0) |
| 293 sText << "BT\n" << CPWL_Utils::GetColorAppStream(GetTextColor()).AsStringC() | 293 sText << "BT\n" << CPWL_Utils::GetColorAppStream(GetTextColor()).AsStringC() |
| 294 << sEditAfter.AsStringC() << "ET\n"; | 294 << sEditAfter.AsStringC() << "ET\n"; |
| 295 | 295 |
| 296 if (sText.GetLength() > 0) { | 296 if (sText.GetLength() > 0) { |
| 297 CFX_FloatRect rcClient = GetClientRect(); | 297 CFX_FloatRect rect = GetClientRect(); |
| 298 sAppStream << "q\n/Tx BMC\n"; | 298 sAppStream << "q\n/Tx BMC\n"; |
| 299 | 299 |
| 300 if (!HasFlag(PES_TEXTOVERFLOW)) | 300 if (!HasFlag(PES_TEXTOVERFLOW)) |
| 301 sAppStream << rcClient.left << " " << rcClient.bottom << " " | 301 sAppStream << rect.left << " " << rect.bottom << " " |
| 302 << rcClient.right - rcClient.left << " " | 302 << rect.right - rect.left << " " << rect.top - rect.bottom |
| 303 << rcClient.top - rcClient.bottom << " re W n\n"; | 303 << " re W n\n"; |
| 304 | 304 |
| 305 sAppStream << sText; | 305 sAppStream << sText; |
| 306 | 306 |
| 307 sAppStream << "EMC\nQ\n"; | 307 sAppStream << "EMC\nQ\n"; |
| 308 } | 308 } |
| 309 } | 309 } |
| 310 | 310 |
| 311 void CPWL_Edit::DrawThisAppearance(CFX_RenderDevice* pDevice, | 311 void CPWL_Edit::DrawThisAppearance(CFX_RenderDevice* pDevice, |
| 312 CFX_Matrix* pUser2Device) { | 312 CFX_Matrix* pUser2Device) { |
| 313 CPWL_Wnd::DrawThisAppearance(pDevice, pUser2Device); | 313 CPWL_Wnd::DrawThisAppearance(pDevice, pUser2Device); |
| (...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 944 } | 944 } |
| 945 | 945 |
| 946 void CPWL_Edit::GeneratePageObjects(CPDF_PageObjectHolder* pObjectHolder, | 946 void CPWL_Edit::GeneratePageObjects(CPDF_PageObjectHolder* pObjectHolder, |
| 947 const CFX_FloatPoint& ptOffset) { | 947 const CFX_FloatPoint& ptOffset) { |
| 948 CFX_ArrayTemplate<CPDF_TextObject*> ObjArray; | 948 CFX_ArrayTemplate<CPDF_TextObject*> ObjArray; |
| 949 IFX_Edit::GeneratePageObjects( | 949 IFX_Edit::GeneratePageObjects( |
| 950 pObjectHolder, m_pEdit, ptOffset, NULL, | 950 pObjectHolder, m_pEdit, ptOffset, NULL, |
| 951 CPWL_Utils::PWLColorToFXColor(GetTextColor(), GetTransparency()), | 951 CPWL_Utils::PWLColorToFXColor(GetTextColor(), GetTransparency()), |
| 952 ObjArray); | 952 ObjArray); |
| 953 } | 953 } |
| OLD | NEW |