Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(532)

Side by Side Diff: fpdfsdk/pdfwindow/PWL_Label.cpp

Issue 1853233002: Make down-conversion explicit from CFX_ByteString to CFX_ByteStringC. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Fix CPDF_Name::GetConstString() Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « fpdfsdk/pdfwindow/PWL_Icon.cpp ('k') | fpdfsdk/pdfwindow/PWL_ListBox.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_Label.h" 7 #include "fpdfsdk/pdfwindow/PWL_Label.h"
8 #include "fpdfsdk/pdfwindow/PWL_Utils.h" 8 #include "fpdfsdk/pdfwindow/PWL_Utils.h"
9 #include "fpdfsdk/pdfwindow/PWL_Wnd.h" 9 #include "fpdfsdk/pdfwindow/PWL_Wnd.h"
10 10
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
111 m_pEdit->SetCharSpace(fCharSpace); 111 m_pEdit->SetCharSpace(fCharSpace);
112 } 112 }
113 113
114 CFX_FloatRect CPWL_Label::GetContentRect() const { 114 CFX_FloatRect CPWL_Label::GetContentRect() const {
115 return m_pEdit->GetContentRect(); 115 return m_pEdit->GetContentRect();
116 } 116 }
117 117
118 void CPWL_Label::GetThisAppearanceStream(CFX_ByteTextBuf& sAppStream) { 118 void CPWL_Label::GetThisAppearanceStream(CFX_ByteTextBuf& sAppStream) {
119 CPWL_Wnd::GetThisAppearanceStream(sAppStream); 119 CPWL_Wnd::GetThisAppearanceStream(sAppStream);
120 120
121 sAppStream << GetTextAppearanceStream(CFX_FloatPoint(0.0f, 0.0f)); 121 sAppStream << GetTextAppearanceStream(CFX_FloatPoint(0.0f, 0.0f))
122 .AsByteStringC();
122 } 123 }
123 124
124 CFX_ByteString CPWL_Label::GetTextAppearanceStream( 125 CFX_ByteString CPWL_Label::GetTextAppearanceStream(
125 const CFX_FloatPoint& ptOffset) const { 126 const CFX_FloatPoint& ptOffset) const {
126 CFX_ByteTextBuf sRet; 127 CFX_ByteTextBuf sRet;
127 CFX_ByteString sEdit = CPWL_Utils::GetEditAppStream(m_pEdit, ptOffset); 128 CFX_ByteString sEdit = CPWL_Utils::GetEditAppStream(m_pEdit, ptOffset);
128 129
129 if (sEdit.GetLength() > 0) { 130 if (sEdit.GetLength() > 0) {
130 sRet << "BT\n" << CPWL_Utils::GetColorAppStream(GetTextColor()) << sEdit 131 sRet << "BT\n"
131 << "ET\n"; 132 << CPWL_Utils::GetColorAppStream(GetTextColor()).AsByteStringC()
133 << sEdit.AsByteStringC() << "ET\n";
132 } 134 }
133 135
134 return sRet.GetByteString(); 136 return sRet.GetByteString();
135 } 137 }
136 138
137 CFX_WideString CPWL_Label::GetText() const { 139 CFX_WideString CPWL_Label::GetText() const {
138 return m_pEdit->GetText(); 140 return m_pEdit->GetText();
139 } 141 }
140 142
141 void CPWL_Label::SetLimitChar(int32_t nLimitChar) { 143 void CPWL_Label::SetLimitChar(int32_t nLimitChar) {
142 m_pEdit->SetLimitChar(nLimitChar); 144 m_pEdit->SetLimitChar(nLimitChar);
143 } 145 }
144 146
145 int32_t CPWL_Label::GetTotalWords() { 147 int32_t CPWL_Label::GetTotalWords() {
146 if (m_pEdit) 148 if (m_pEdit)
147 return m_pEdit->GetTotalWords(); 149 return m_pEdit->GetTotalWords();
148 150
149 return 0; 151 return 0;
150 } 152 }
OLDNEW
« no previous file with comments | « fpdfsdk/pdfwindow/PWL_Icon.cpp ('k') | fpdfsdk/pdfwindow/PWL_ListBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698