| 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/fxedit/include/fx_edit.h" | 7 #include "fpdfsdk/fxedit/include/fx_edit.h" |
| 8 #include "fpdfsdk/pdfwindow/PWL_Label.h" | 8 #include "fpdfsdk/pdfwindow/PWL_Label.h" |
| 9 #include "fpdfsdk/pdfwindow/PWL_Utils.h" | 9 #include "fpdfsdk/pdfwindow/PWL_Utils.h" |
| 10 #include "fpdfsdk/pdfwindow/PWL_Wnd.h" | 10 #include "fpdfsdk/pdfwindow/PWL_Wnd.h" |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 125 CFX_ByteString CPWL_Label::GetTextAppearanceStream( | 125 CFX_ByteString CPWL_Label::GetTextAppearanceStream( |
| 126 const CFX_FloatPoint& ptOffset) const { | 126 const CFX_FloatPoint& ptOffset) const { |
| 127 CFX_ByteTextBuf sRet; | 127 CFX_ByteTextBuf sRet; |
| 128 CFX_ByteString sEdit = CPWL_Utils::GetEditAppStream(m_pEdit, ptOffset); | 128 CFX_ByteString sEdit = CPWL_Utils::GetEditAppStream(m_pEdit, ptOffset); |
| 129 | 129 |
| 130 if (sEdit.GetLength() > 0) { | 130 if (sEdit.GetLength() > 0) { |
| 131 sRet << "BT\n" << CPWL_Utils::GetColorAppStream(GetTextColor()).AsStringC() | 131 sRet << "BT\n" << CPWL_Utils::GetColorAppStream(GetTextColor()).AsStringC() |
| 132 << sEdit.AsStringC() << "ET\n"; | 132 << sEdit.AsStringC() << "ET\n"; |
| 133 } | 133 } |
| 134 | 134 |
| 135 return sRet.GetByteString(); | 135 return sRet.AsStringC(); |
| 136 } | 136 } |
| 137 | 137 |
| 138 CFX_WideString CPWL_Label::GetText() const { | 138 CFX_WideString CPWL_Label::GetText() const { |
| 139 return m_pEdit->GetText(); | 139 return m_pEdit->GetText(); |
| 140 } | 140 } |
| 141 | 141 |
| 142 void CPWL_Label::SetLimitChar(int32_t nLimitChar) { | 142 void CPWL_Label::SetLimitChar(int32_t nLimitChar) { |
| 143 m_pEdit->SetLimitChar(nLimitChar); | 143 m_pEdit->SetLimitChar(nLimitChar); |
| 144 } | 144 } |
| 145 | 145 |
| 146 int32_t CPWL_Label::GetTotalWords() { | 146 int32_t CPWL_Label::GetTotalWords() { |
| 147 if (m_pEdit) | 147 if (m_pEdit) |
| 148 return m_pEdit->GetTotalWords(); | 148 return m_pEdit->GetTotalWords(); |
| 149 | 149 |
| 150 return 0; | 150 return 0; |
| 151 } | 151 } |
| OLD | NEW |