| 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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 void CPWL_Label::GetThisAppearanceStream(CFX_ByteTextBuf& sAppStream) { | 116 void CPWL_Label::GetThisAppearanceStream(CFX_ByteTextBuf& sAppStream) { |
| 117 CPWL_Wnd::GetThisAppearanceStream(sAppStream); | 117 CPWL_Wnd::GetThisAppearanceStream(sAppStream); |
| 118 | 118 |
| 119 sAppStream << GetTextAppearanceStream(CFX_FloatPoint(0.0f, 0.0f)).AsStringC(); | 119 sAppStream << GetTextAppearanceStream(CFX_FloatPoint(0.0f, 0.0f)).AsStringC(); |
| 120 } | 120 } |
| 121 | 121 |
| 122 CFX_ByteString CPWL_Label::GetTextAppearanceStream( | 122 CFX_ByteString CPWL_Label::GetTextAppearanceStream( |
| 123 const CFX_FloatPoint& ptOffset) const { | 123 const CFX_FloatPoint& ptOffset) const { |
| 124 CFX_ByteTextBuf sRet; | 124 CFX_ByteTextBuf sRet; |
| 125 CFX_ByteString sEdit = CPWL_Utils::GetEditAppStream(m_pEdit, ptOffset); | 125 CFX_ByteString sEdit = CPWL_Utils::GetEditAppStream(m_pEdit, ptOffset); |
| 126 | |
| 127 if (sEdit.GetLength() > 0) { | 126 if (sEdit.GetLength() > 0) { |
| 128 sRet << "BT\n" << CPWL_Utils::GetColorAppStream(GetTextColor()).AsStringC() | 127 sRet << "BT\n" << CPWL_Utils::GetColorAppStream(GetTextColor()).AsStringC() |
| 129 << sEdit.AsStringC() << "ET\n"; | 128 << sEdit.AsStringC() << "ET\n"; |
| 130 } | 129 } |
| 131 | 130 return sRet.MakeString(); |
| 132 return sRet.AsStringC(); | |
| 133 } | 131 } |
| 134 | 132 |
| 135 CFX_WideString CPWL_Label::GetText() const { | 133 CFX_WideString CPWL_Label::GetText() const { |
| 136 return m_pEdit->GetText(); | 134 return m_pEdit->GetText(); |
| 137 } | 135 } |
| 138 | 136 |
| 139 void CPWL_Label::SetLimitChar(int32_t nLimitChar) { | 137 void CPWL_Label::SetLimitChar(int32_t nLimitChar) { |
| 140 m_pEdit->SetLimitChar(nLimitChar); | 138 m_pEdit->SetLimitChar(nLimitChar); |
| 141 } | 139 } |
| 142 | 140 |
| 143 int32_t CPWL_Label::GetTotalWords() { | 141 int32_t CPWL_Label::GetTotalWords() { |
| 144 return m_pEdit->GetTotalWords(); | 142 return m_pEdit->GetTotalWords(); |
| 145 } | 143 } |
| OLD | NEW |