summaryrefslogtreecommitdiff
path: root/fpdfsdk/pwl
diff options
context:
space:
mode:
authorRyan Harrison <rharrison@chromium.org>2017-09-18 14:23:18 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-09-18 18:40:16 +0000
commit275e260a6cd4a8e506ba974feb85ebcd926c1739 (patch)
tree2029b9158ec044764ceff122fe5fb5d0a3f123d1 /fpdfsdk/pwl
parent450fbeaaabf1ab340c1018de2e58f1950657517e (diff)
downloadpdfium-275e260a6cd4a8e506ba974feb85ebcd926c1739.tar.xz
Convert string class names
Automated using git grep & sed. Replace StringC classes with StringView classes. Remove the CFX_ prefix and put string classes in fxcrt namespace. Change AsStringC() to AsStringView(). Rename tests from TEST(fxcrt, *String*Foo) to TEST(*String*, Foo). Couple of tests needed to have their names regularlized. BUG=pdfium:894 Change-Id: I7ca038685c8d803795f3ed02545124f7a224c83d Reviewed-on: https://pdfium-review.googlesource.com/14151 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'fpdfsdk/pwl')
-rw-r--r--fpdfsdk/pwl/cpwl_appstream.cpp293
-rw-r--r--fpdfsdk/pwl/cpwl_appstream.h20
-rw-r--r--fpdfsdk/pwl/cpwl_button.cpp2
-rw-r--r--fpdfsdk/pwl/cpwl_button.h2
-rw-r--r--fpdfsdk/pwl/cpwl_caret.cpp2
-rw-r--r--fpdfsdk/pwl/cpwl_caret.h2
-rw-r--r--fpdfsdk/pwl/cpwl_combo_box.cpp16
-rw-r--r--fpdfsdk/pwl/cpwl_combo_box.h12
-rw-r--r--fpdfsdk/pwl/cpwl_edit.cpp20
-rw-r--r--fpdfsdk/pwl/cpwl_edit.h10
-rw-r--r--fpdfsdk/pwl/cpwl_edit_ctrl.cpp8
-rw-r--r--fpdfsdk/pwl/cpwl_edit_ctrl.h6
-rw-r--r--fpdfsdk/pwl/cpwl_edit_impl.cpp38
-rw-r--r--fpdfsdk/pwl/cpwl_edit_impl.h28
-rw-r--r--fpdfsdk/pwl/cpwl_font_map.cpp52
-rw-r--r--fpdfsdk/pwl/cpwl_font_map.h35
-rw-r--r--fpdfsdk/pwl/cpwl_icon.cpp6
-rw-r--r--fpdfsdk/pwl/cpwl_icon.h2
-rw-r--r--fpdfsdk/pwl/cpwl_list_box.cpp10
-rw-r--r--fpdfsdk/pwl/cpwl_list_box.h6
-rw-r--r--fpdfsdk/pwl/cpwl_list_impl.cpp12
-rw-r--r--fpdfsdk/pwl/cpwl_list_impl.h12
-rw-r--r--fpdfsdk/pwl/cpwl_scroll_bar.cpp4
-rw-r--r--fpdfsdk/pwl/cpwl_scroll_bar.h4
-rw-r--r--fpdfsdk/pwl/cpwl_special_button.cpp6
-rw-r--r--fpdfsdk/pwl/cpwl_special_button.h6
-rw-r--r--fpdfsdk/pwl/cpwl_wnd.cpp8
-rw-r--r--fpdfsdk/pwl/cpwl_wnd.h6
28 files changed, 312 insertions, 316 deletions
diff --git a/fpdfsdk/pwl/cpwl_appstream.cpp b/fpdfsdk/pwl/cpwl_appstream.cpp
index c7188ada07..6a19efb906 100644
--- a/fpdfsdk/pwl/cpwl_appstream.cpp
+++ b/fpdfsdk/pwl/cpwl_appstream.cpp
@@ -79,8 +79,8 @@ const char kTextEndOperator[] = "ET";
class AutoClosedCommand {
public:
AutoClosedCommand(std::ostringstream* stream,
- CFX_ByteString open,
- CFX_ByteString close)
+ ByteString open,
+ ByteString close)
: stream_(stream), close_(close) {
*stream_ << open << "\n";
}
@@ -89,7 +89,7 @@ class AutoClosedCommand {
private:
std::ostringstream* stream_;
- CFX_ByteString close_;
+ ByteString close_;
};
class AutoClosedQCommand : public AutoClosedCommand {
@@ -99,8 +99,8 @@ class AutoClosedQCommand : public AutoClosedCommand {
~AutoClosedQCommand() override {}
};
-CFX_ByteString GetColorAppStream(const CFX_Color& color,
- const bool& bFillOrStroke) {
+ByteString GetColorAppStream(const CFX_Color& color,
+ const bool& bFillOrStroke) {
std::ostringstream sColorStream;
switch (color.nColorType) {
@@ -125,10 +125,10 @@ CFX_ByteString GetColorAppStream(const CFX_Color& color,
break;
}
- return CFX_ByteString(sColorStream);
+ return ByteString(sColorStream);
}
-CFX_ByteString GetAP_Check(const CFX_FloatRect& crBBox) {
+ByteString GetAP_Check(const CFX_FloatRect& crBBox) {
const float fWidth = crBBox.right - crBBox.left;
const float fHeight = crBBox.top - crBBox.bottom;
@@ -174,10 +174,10 @@ CFX_ByteString GetAP_Check(const CFX_FloatRect& crBBox) {
<< pts[nNext][0].y << " " << kCurveToOperator << "\n";
}
- return CFX_ByteString(csAP);
+ return ByteString(csAP);
}
-CFX_ByteString GetAP_Circle(const CFX_FloatRect& crBBox) {
+ByteString GetAP_Circle(const CFX_FloatRect& crBBox) {
std::ostringstream csAP;
float fWidth = crBBox.right - crBBox.left;
@@ -218,10 +218,10 @@ CFX_ByteString GetAP_Circle(const CFX_FloatRect& crBBox) {
<< pt1.y - py * FX_BEZIER << " " << pt1.x << " " << pt1.y << " "
<< kCurveToOperator << "\n";
- return CFX_ByteString(csAP);
+ return ByteString(csAP);
}
-CFX_ByteString GetAP_Cross(const CFX_FloatRect& crBBox) {
+ByteString GetAP_Cross(const CFX_FloatRect& crBBox) {
std::ostringstream csAP;
csAP << crBBox.left << " " << crBBox.top << " " << kMoveToOperator << "\n";
@@ -230,10 +230,10 @@ CFX_ByteString GetAP_Cross(const CFX_FloatRect& crBBox) {
csAP << crBBox.left << " " << crBBox.bottom << " " << kMoveToOperator << "\n";
csAP << crBBox.right << " " << crBBox.top << " " << kLineToOperator << "\n";
- return CFX_ByteString(csAP);
+ return ByteString(csAP);
}
-CFX_ByteString GetAP_Diamond(const CFX_FloatRect& crBBox) {
+ByteString GetAP_Diamond(const CFX_FloatRect& crBBox) {
std::ostringstream csAP;
float fWidth = crBBox.right - crBBox.left;
@@ -250,10 +250,10 @@ CFX_ByteString GetAP_Diamond(const CFX_FloatRect& crBBox) {
csAP << pt4.x << " " << pt4.y << " " << kLineToOperator << "\n";
csAP << pt1.x << " " << pt1.y << " " << kLineToOperator << "\n";
- return CFX_ByteString(csAP);
+ return ByteString(csAP);
}
-CFX_ByteString GetAP_Square(const CFX_FloatRect& crBBox) {
+ByteString GetAP_Square(const CFX_FloatRect& crBBox) {
std::ostringstream csAP;
csAP << crBBox.left << " " << crBBox.top << " " << kMoveToOperator << "\n";
@@ -263,10 +263,10 @@ CFX_ByteString GetAP_Square(const CFX_FloatRect& crBBox) {
csAP << crBBox.left << " " << crBBox.bottom << " " << kLineToOperator << "\n";
csAP << crBBox.left << " " << crBBox.top << " " << kLineToOperator << "\n";
- return CFX_ByteString(csAP);
+ return ByteString(csAP);
}
-CFX_ByteString GetAP_Star(const CFX_FloatRect& crBBox) {
+ByteString GetAP_Star(const CFX_FloatRect& crBBox) {
std::ostringstream csAP;
float fRadius = (crBBox.top - crBBox.bottom) / (1 + (float)cos(FX_PI / 5.0f));
@@ -292,10 +292,10 @@ CFX_ByteString GetAP_Star(const CFX_FloatRect& crBBox) {
csAP << px[nNext] << " " << py[nNext] << " " << kLineToOperator << "\n";
}
- return CFX_ByteString(csAP);
+ return ByteString(csAP);
}
-CFX_ByteString GetAP_HalfCircle(const CFX_FloatRect& crBBox, float fRotate) {
+ByteString GetAP_HalfCircle(const CFX_FloatRect& crBBox, float fRotate) {
std::ostringstream csAP;
float fWidth = crBBox.right - crBBox.left;
@@ -328,44 +328,44 @@ CFX_ByteString GetAP_HalfCircle(const CFX_FloatRect& crBBox, float fRotate) {
<< pt3.y + py * FX_BEZIER << " " << pt3.x << " " << pt3.y << " "
<< kCurveToOperator << "\n";
- return CFX_ByteString(csAP);
+ return ByteString(csAP);
}
-CFX_ByteString GetAppStream_Check(const CFX_FloatRect& rcBBox,
- const CFX_Color& crText) {
+ByteString GetAppStream_Check(const CFX_FloatRect& rcBBox,
+ const CFX_Color& crText) {
std::ostringstream sAP;
{
AutoClosedQCommand q(&sAP);
sAP << GetColorAppStream(crText, true) << GetAP_Check(rcBBox)
<< kFillOperator << "\n";
}
- return CFX_ByteString(sAP);
+ return ByteString(sAP);
}
-CFX_ByteString GetAppStream_Circle(const CFX_FloatRect& rcBBox,
- const CFX_Color& crText) {
+ByteString GetAppStream_Circle(const CFX_FloatRect& rcBBox,
+ const CFX_Color& crText) {
std::ostringstream sAP;
{
AutoClosedQCommand q(&sAP);
sAP << GetColorAppStream(crText, true) << GetAP_Circle(rcBBox)
<< kFillOperator << "\n";
}
- return CFX_ByteString(sAP);
+ return ByteString(sAP);
}
-CFX_ByteString GetAppStream_Cross(const CFX_FloatRect& rcBBox,
- const CFX_Color& crText) {
+ByteString GetAppStream_Cross(const CFX_FloatRect& rcBBox,
+ const CFX_Color& crText) {
std::ostringstream sAP;
{
AutoClosedQCommand q(&sAP);
sAP << GetColorAppStream(crText, false) << GetAP_Cross(rcBBox)
<< kStrokeOperator << "\n";
}
- return CFX_ByteString(sAP);
+ return ByteString(sAP);
}
-CFX_ByteString GetAppStream_Diamond(const CFX_FloatRect& rcBBox,
- const CFX_Color& crText) {
+ByteString GetAppStream_Diamond(const CFX_FloatRect& rcBBox,
+ const CFX_Color& crText) {
std::ostringstream sAP;
{
AutoClosedQCommand q(&sAP);
@@ -373,51 +373,51 @@ CFX_ByteString GetAppStream_Diamond(const CFX_FloatRect& rcBBox,
<< GetColorAppStream(crText, true) << GetAP_Diamond(rcBBox)
<< kFillOperator << "\n";
}
- return CFX_ByteString(sAP);
+ return ByteString(sAP);
}
-CFX_ByteString GetAppStream_Square(const CFX_FloatRect& rcBBox,
- const CFX_Color& crText) {
+ByteString GetAppStream_Square(const CFX_FloatRect& rcBBox,
+ const CFX_Color& crText) {
std::ostringstream sAP;
{
AutoClosedQCommand q(&sAP);
sAP << GetColorAppStream(crText, true) << GetAP_Square(rcBBox)
<< kFillOperator << "\n";
}
- return CFX_ByteString(sAP);
+ return ByteString(sAP);
}
-CFX_ByteString GetAppStream_Star(const CFX_FloatRect& rcBBox,
- const CFX_Color& crText) {
+ByteString GetAppStream_Star(const CFX_FloatRect& rcBBox,
+ const CFX_Color& crText) {
std::ostringstream sAP;
{
AutoClosedQCommand q(&sAP);
sAP << GetColorAppStream(crText, true) << GetAP_Star(rcBBox)
<< kFillOperator << "\n";
}
- return CFX_ByteString(sAP);
+ return ByteString(sAP);
}
-CFX_ByteString GetCircleFillAppStream(const CFX_FloatRect& rect,
- const CFX_Color& color) {
+ByteString GetCircleFillAppStream(const CFX_FloatRect& rect,
+ const CFX_Color& color) {
std::ostringstream sAppStream;
- CFX_ByteString sColor = GetColorAppStream(color, true);
+ ByteString sColor = GetColorAppStream(color, true);
if (sColor.GetLength() > 0) {
AutoClosedQCommand q(&sAppStream);
sAppStream << sColor << GetAP_Circle(rect) << kFillOperator << "\n";
}
- return CFX_ByteString(sAppStream);
+ return ByteString(sAppStream);
}
-CFX_ByteString GetCircleBorderAppStream(const CFX_FloatRect& rect,
- float fWidth,
- const CFX_Color& color,
- const CFX_Color& crLeftTop,
- const CFX_Color& crRightBottom,
- BorderStyle nStyle,
- const CPWL_Dash& dash) {
+ByteString GetCircleBorderAppStream(const CFX_FloatRect& rect,
+ float fWidth,
+ const CFX_Color& color,
+ const CFX_Color& crLeftTop,
+ const CFX_Color& crRightBottom,
+ BorderStyle nStyle,
+ const CPWL_Dash& dash) {
std::ostringstream sAppStream;
- CFX_ByteString sColor;
+ ByteString sColor;
if (fWidth > 0.0f) {
AutoClosedQCommand q(&sAppStream);
@@ -502,12 +502,12 @@ CFX_ByteString GetCircleBorderAppStream(const CFX_FloatRect& rect,
} break;
}
}
- return CFX_ByteString(sAppStream);
+ return ByteString(sAppStream);
}
-CFX_ByteString GetCheckBoxAppStream(const CFX_FloatRect& rcBBox,
- CheckStyle nStyle,
- const CFX_Color& crText) {
+ByteString GetCheckBoxAppStream(const CFX_FloatRect& rcBBox,
+ CheckStyle nStyle,
+ const CFX_Color& crText) {
CFX_FloatRect rcCenter = rcBBox.GetCenterSquare();
switch (nStyle) {
default:
@@ -530,9 +530,9 @@ CFX_ByteString GetCheckBoxAppStream(const CFX_FloatRect& rcBBox,
}
}
-CFX_ByteString GetRadioButtonAppStream(const CFX_FloatRect& rcBBox,
- CheckStyle nStyle,
- const CFX_Color& crText) {
+ByteString GetRadioButtonAppStream(const CFX_FloatRect& rcBBox,
+ CheckStyle nStyle,
+ const CFX_Color& crText) {
CFX_FloatRect rcCenter = rcBBox.GetCenterSquare();
switch (nStyle) {
default:
@@ -555,33 +555,33 @@ CFX_ByteString GetRadioButtonAppStream(const CFX_FloatRect& rcBBox,
}
}
-CFX_ByteString GetFontSetString(IPVT_FontMap* pFontMap,
- int32_t nFontIndex,
- float fFontSize) {
+ByteString GetFontSetString(IPVT_FontMap* pFontMap,
+ int32_t nFontIndex,
+ float fFontSize) {
if (!pFontMap)
- return CFX_ByteString();
+ return ByteString();
- CFX_ByteString sFontAlias = pFontMap->GetPDFFontAlias(nFontIndex);
+ ByteString sFontAlias = pFontMap->GetPDFFontAlias(nFontIndex);
if (sFontAlias.GetLength() <= 0 || fFontSize <= 0)
- return CFX_ByteString();
+ return ByteString();
std::ostringstream sRet;
sRet << "/" << sFontAlias << " " << fFontSize << " "
<< kSetTextFontAndSizeOperator << "\n";
- return CFX_ByteString(sRet);
+ return ByteString(sRet);
}
-CFX_ByteString GetWordRenderString(const CFX_ByteString& strWords) {
+ByteString GetWordRenderString(const ByteString& strWords) {
if (strWords.GetLength() > 0) {
return PDF_EncodeString(strWords, false) + " " + kShowTextOperator + "\n";
}
- return CFX_ByteString();
+ return ByteString();
}
-CFX_ByteString GetEditAppStream(CPWL_EditImpl* pEdit,
- const CFX_PointF& ptOffset,
- bool bContinuous,
- uint16_t SubWord) {
+ByteString GetEditAppStream(CPWL_EditImpl* pEdit,
+ const CFX_PointF& ptOffset,
+ bool bContinuous,
+ uint16_t SubWord) {
CPWL_EditImpl_Iterator* pIterator = pEdit->GetIterator();
pIterator->SetAt(0);
@@ -597,7 +597,7 @@ CFX_ByteString GetEditAppStream(CPWL_EditImpl* pEdit,
if (bContinuous) {
if (place.LineCmp(oldplace) != 0) {
if (sWords.tellp() > 0) {
- sEditStream << GetWordRenderString(CFX_ByteString(sWords));
+ sEditStream << GetWordRenderString(ByteString(sWords));
sWords.str("");
}
@@ -624,7 +624,7 @@ CFX_ByteString GetEditAppStream(CPWL_EditImpl* pEdit,
if (pIterator->GetWord(word)) {
if (word.nFontIndex != nCurFontIndex) {
if (sWords.tellp() > 0) {
- sEditStream << GetWordRenderString(CFX_ByteString(sWords));
+ sEditStream << GetWordRenderString(ByteString(sWords));
sWords.str("");
}
sEditStream << GetFontSetString(pEdit->GetFontMap(), word.nFontIndex,
@@ -661,7 +661,7 @@ CFX_ByteString GetEditAppStream(CPWL_EditImpl* pEdit,
}
if (sWords.tellp() > 0) {
- sEditStream << GetWordRenderString(CFX_ByteString(sWords));
+ sEditStream << GetWordRenderString(ByteString(sWords));
sWords.str("");
}
@@ -681,14 +681,14 @@ CFX_ByteString GetEditAppStream(CPWL_EditImpl* pEdit,
sAppStream << sEditStream.str();
}
- return CFX_ByteString(sAppStream);
+ return ByteString(sAppStream);
}
-CFX_ByteString GenerateIconAppStream(CPDF_IconFit& fit,
- CPDF_Stream* pIconStream,
- const CFX_FloatRect& rcIcon) {
+ByteString GenerateIconAppStream(CPDF_IconFit& fit,
+ CPDF_Stream* pIconStream,
+ const CFX_FloatRect& rcIcon) {
if (rcIcon.IsEmpty() || !pIconStream)
- return CFX_ByteString();
+ return ByteString();
CPWL_Icon icon;
CPWL_Wnd::CreateParams cp;
@@ -698,9 +698,9 @@ CFX_ByteString GenerateIconAppStream(CPDF_IconFit& fit,
icon.SetPDFStream(pIconStream);
icon.Move(rcIcon, false, false);
- CFX_ByteString sAlias = icon.GetImageAlias();
+ ByteString sAlias = icon.GetImageAlias();
if (sAlias.GetLength() <= 0)
- return CFX_ByteString();
+ return ByteString();
CFX_FloatRect rcPlate = icon.GetClientRect();
CFX_Matrix mt = icon.GetImageMatrix().GetInverse();
@@ -732,17 +732,17 @@ CFX_ByteString GenerateIconAppStream(CPDF_IconFit& fit,
}
icon.Destroy();
- return CFX_ByteString(str);
+ return ByteString(str);
}
-CFX_ByteString GetPushButtonAppStream(const CFX_FloatRect& rcBBox,
- IPVT_FontMap* pFontMap,
- CPDF_Stream* pIconStream,
- CPDF_IconFit& IconFit,
- const CFX_WideString& sLabel,
- const CFX_Color& crText,
- float fFontSize,
- ButtonStyle nLayOut) {
+ByteString GetPushButtonAppStream(const CFX_FloatRect& rcBBox,
+ IPVT_FontMap* pFontMap,
+ CPDF_Stream* pIconStream,
+ CPDF_IconFit& IconFit,
+ const WideString& sLabel,
+ const CFX_Color& crText,
+ float fFontSize,
+ ButtonStyle nLayOut) {
const float fAutoFontScale = 1.0f / 3.0f;
auto pEdit = pdfium::MakeUnique<CPWL_EditImpl>();
@@ -902,7 +902,7 @@ CFX_ByteString GetPushButtonAppStream(const CFX_FloatRect& rcBBox,
if (!rcLabel.IsEmpty()) {
pEdit->SetPlateRect(rcLabel);
- CFX_ByteString sEdit =
+ ByteString sEdit =
GetEditAppStream(pEdit.get(), CFX_PointF(0.0f, 0.0f), true, 0);
if (sEdit.GetLength() > 0) {
AutoClosedCommand bt(&sTemp, kTextBeginOperator, kTextEndOperator);
@@ -911,7 +911,7 @@ CFX_ByteString GetPushButtonAppStream(const CFX_FloatRect& rcBBox,
}
if (sTemp.tellp() <= 0)
- return CFX_ByteString();
+ return ByteString();
std::ostringstream sAppStream;
{
@@ -923,18 +923,18 @@ CFX_ByteString GetPushButtonAppStream(const CFX_FloatRect& rcBBox,
<< kEndPathNoFillOrStrokeOperator << "\n";
sAppStream << sTemp.str().c_str();
}
- return CFX_ByteString(sAppStream);
+ return ByteString(sAppStream);
}
-CFX_ByteString GetBorderAppStreamInternal(const CFX_FloatRect& rect,
- float fWidth,
- const CFX_Color& color,
- const CFX_Color& crLeftTop,
- const CFX_Color& crRightBottom,
- BorderStyle nStyle,
- const CPWL_Dash& dash) {
+ByteString GetBorderAppStreamInternal(const CFX_FloatRect& rect,
+ float fWidth,
+ const CFX_Color& color,
+ const CFX_Color& crLeftTop,
+ const CFX_Color& crRightBottom,
+ BorderStyle nStyle,
+ const CPWL_Dash& dash) {
std::ostringstream sAppStream;
- CFX_ByteString sColor;
+ ByteString sColor;
float fLeft = rect.left;
float fRight = rect.right;
@@ -1044,12 +1044,12 @@ CFX_ByteString GetBorderAppStreamInternal(const CFX_FloatRect& rect,
}
}
- return CFX_ByteString(sAppStream);
+ return ByteString(sAppStream);
}
-CFX_ByteString GetDropButtonAppStream(const CFX_FloatRect& rcBBox) {
+ByteString GetDropButtonAppStream(const CFX_FloatRect& rcBBox) {
if (rcBBox.IsEmpty())
- return CFX_ByteString();
+ return ByteString();
std::ostringstream sAppStream;
{
@@ -1087,13 +1087,13 @@ CFX_ByteString GetDropButtonAppStream(const CFX_FloatRect& rcBBox) {
<< kLineToOperator << " " << kFillOperator << "\n";
}
- return CFX_ByteString(sAppStream);
+ return ByteString(sAppStream);
}
-CFX_ByteString GetRectFillAppStream(const CFX_FloatRect& rect,
- const CFX_Color& color) {
+ByteString GetRectFillAppStream(const CFX_FloatRect& rect,
+ const CFX_Color& color) {
std::ostringstream sAppStream;
- CFX_ByteString sColor = GetColorAppStream(color, true);
+ ByteString sColor = GetColorAppStream(color, true);
if (sColor.GetLength() > 0) {
AutoClosedQCommand q(&sAppStream);
sAppStream << sColor << rect.left << " " << rect.bottom << " "
@@ -1101,7 +1101,7 @@ CFX_ByteString GetRectFillAppStream(const CFX_FloatRect& rect,
<< kAppendRectOperator << " " << kFillOperator << "\n";
}
- return CFX_ByteString(sAppStream);
+ return ByteString(sAppStream);
}
} // namespace
@@ -1177,7 +1177,7 @@ void CPWL_AppStream::SetAsPushButton() {
CFX_FloatRect rcClient = rcWindow.GetDeflated(fBorderWidth, fBorderWidth);
CFX_Color crText(COLORTYPE_GRAY, 0);
- CFX_ByteString csNameTag;
+ ByteString csNameTag;
CPDF_DefaultAppearance da = pControl->GetDefaultAppearance();
if (da.HasColor()) {
da.GetColor(iColorType, fc);
@@ -1187,10 +1187,10 @@ void CPWL_AppStream::SetAsPushButton() {
if (da.HasFont())
csNameTag = da.GetFont(&fFontSize);
- CFX_WideString csWCaption;
- CFX_WideString csNormalCaption;
- CFX_WideString csRolloverCaption;
- CFX_WideString csDownCaption;
+ WideString csWCaption;
+ WideString csNormalCaption;
+ WideString csRolloverCaption;
+ WideString csDownCaption;
if (pControl->HasMKEntry("CA"))
csNormalCaption = pControl->GetNormalCaption();
@@ -1240,7 +1240,7 @@ void CPWL_AppStream::SetAsPushButton() {
widget_->GetInterForm()->GetFormFillEnv()->GetSysHandler());
font_map.SetAPType("N");
- CFX_ByteString csAP =
+ ByteString csAP =
GetRectFillAppStream(rcWindow, crBackground) +
GetBorderAppStreamInternal(rcWindow, fBorderWidth, crBorder, crLeftTop,
crRightBottom, nBorderStyle, dsBorder) +
@@ -1359,7 +1359,7 @@ void CPWL_AppStream::SetAsCheckBox() {
}
CheckStyle nStyle = CheckStyle::kCheck;
- CFX_WideString csWCaption = pControl->GetNormalCaption();
+ WideString csWCaption = pControl->GetNormalCaption();
if (csWCaption.GetLength() > 0) {
switch (csWCaption[0]) {
case L'l':
@@ -1383,12 +1383,12 @@ void CPWL_AppStream::SetAsCheckBox() {
}
}
- CFX_ByteString csAP_N_ON =
+ ByteString csAP_N_ON =
GetRectFillAppStream(rcWindow, crBackground) +
GetBorderAppStreamInternal(rcWindow, fBorderWidth, crBorder, crLeftTop,
crRightBottom, nBorderStyle, dsBorder);
- CFX_ByteString csAP_N_OFF = csAP_N_ON;
+ ByteString csAP_N_OFF = csAP_N_ON;
switch (nBorderStyle) {
case BorderStyle::BEVELED: {
@@ -1406,12 +1406,12 @@ void CPWL_AppStream::SetAsCheckBox() {
break;
}
- CFX_ByteString csAP_D_ON =
+ ByteString csAP_D_ON =
GetRectFillAppStream(rcWindow, crBackground - 0.25f) +
GetBorderAppStreamInternal(rcWindow, fBorderWidth, crBorder, crLeftTop,
crRightBottom, nBorderStyle, dsBorder);
- CFX_ByteString csAP_D_OFF = csAP_D_ON;
+ ByteString csAP_D_OFF = csAP_D_ON;
csAP_N_ON += GetCheckBoxAppStream(rcClient, nStyle, crText);
csAP_D_ON += GetCheckBoxAppStream(rcClient, nStyle, crText);
@@ -1422,7 +1422,7 @@ void CPWL_AppStream::SetAsCheckBox() {
Write("D", csAP_D_ON, pControl->GetCheckedAPState());
Write("D", csAP_D_OFF, "Off");
- CFX_ByteString csAS = widget_->GetAppState();
+ ByteString csAS = widget_->GetAppState();
if (csAS.IsEmpty())
widget_->SetAppState("Off");
}
@@ -1475,7 +1475,7 @@ void CPWL_AppStream::SetAsRadioButton() {
}
CheckStyle nStyle = CheckStyle::kCircle;
- CFX_WideString csWCaption = pControl->GetNormalCaption();
+ WideString csWCaption = pControl->GetNormalCaption();
if (csWCaption.GetLength() > 0) {
switch (csWCaption[0]) {
case L'8':
@@ -1499,7 +1499,7 @@ void CPWL_AppStream::SetAsRadioButton() {
}
}
- CFX_ByteString csAP_N_ON;
+ ByteString csAP_N_ON;
CFX_FloatRect rcCenter = rcWindow.GetCenterSquare().GetDeflated(1.0f, 1.0f);
if (nStyle == CheckStyle::kCircle) {
if (nBorderStyle == BorderStyle::BEVELED) {
@@ -1521,7 +1521,7 @@ void CPWL_AppStream::SetAsRadioButton() {
crRightBottom, nBorderStyle, dsBorder);
}
- CFX_ByteString csAP_N_OFF = csAP_N_ON;
+ ByteString csAP_N_OFF = csAP_N_ON;
switch (nBorderStyle) {
case BorderStyle::BEVELED: {
@@ -1539,7 +1539,7 @@ void CPWL_AppStream::SetAsRadioButton() {
break;
}
- CFX_ByteString csAP_D_ON;
+ ByteString csAP_D_ON;
if (nStyle == CheckStyle::kCircle) {
CFX_Color crBK = crBackground - 0.25f;
@@ -1563,7 +1563,7 @@ void CPWL_AppStream::SetAsRadioButton() {
crRightBottom, nBorderStyle, dsBorder);
}
- CFX_ByteString csAP_D_OFF = csAP_D_ON;
+ ByteString csAP_D_OFF = csAP_D_ON;
csAP_N_ON += GetRadioButtonAppStream(rcClient, nStyle, crText);
csAP_D_ON += GetRadioButtonAppStream(rcClient, nStyle, crText);
@@ -1574,12 +1574,12 @@ void CPWL_AppStream::SetAsRadioButton() {
Write("D", csAP_D_ON, pControl->GetCheckedAPState());
Write("D", csAP_D_OFF, "Off");
- CFX_ByteString csAS = widget_->GetAppState();
+ ByteString csAS = widget_->GetAppState();
if (csAS.IsEmpty())
widget_->SetAppState("Off");
}
-void CPWL_AppStream::SetAsComboBox(const CFX_WideString* sValue) {
+void CPWL_AppStream::SetAsComboBox(const WideString* sValue) {
CPDF_FormControl* pControl = widget_->GetFormControl();
CPDF_FormField* pField = pControl->GetField();
std::ostringstream sBody;
@@ -1623,7 +1623,7 @@ void CPWL_AppStream::SetAsComboBox(const CFX_WideString* sValue) {
}
CFX_FloatRect rcContent = pEdit->GetContentRect();
- CFX_ByteString sEdit = GetEditAppStream(pEdit.get(), CFX_PointF(), true, 0);
+ ByteString sEdit = GetEditAppStream(pEdit.get(), CFX_PointF(), true, 0);
if (sEdit.GetLength() > 0) {
sBody << "/Tx ";
AutoClosedCommand bmc(&sBody, kMarkedSequenceBeginOperator,
@@ -1645,7 +1645,7 @@ void CPWL_AppStream::SetAsComboBox(const CFX_WideString* sValue) {
sBody << GetDropButtonAppStream(rcButton);
Write("N",
- GetBackgroundAppStream() + GetBorderAppStream() + CFX_ByteString(sBody),
+ GetBackgroundAppStream() + GetBorderAppStream() + ByteString(sBody),
"");
}
@@ -1729,11 +1729,11 @@ void CPWL_AppStream::SetAsListBox() {
<< sList.str();
}
Write("N",
- GetBackgroundAppStream() + GetBorderAppStream() + CFX_ByteString(sBody),
+ GetBackgroundAppStream() + GetBorderAppStream() + ByteString(sBody),
"");
}
-void CPWL_AppStream::SetAsTextField(const CFX_WideString* sValue) {
+void CPWL_AppStream::SetAsTextField(const WideString* sValue) {
CPDF_FormControl* pControl = widget_->GetFormControl();
CPDF_FormField* pField = pControl->GetField();
std::ostringstream sBody;
@@ -1771,7 +1771,7 @@ void CPWL_AppStream::SetAsTextField(const CFX_WideString* sValue) {
float fFontSize = widget_->GetFontSize();
#ifdef PDF_ENABLE_XFA
- CFX_WideString sValueTmp;
+ WideString sValueTmp;
if (!sValue && widget_->GetMixXFAWidget()) {
sValueTmp = widget_->GetValue(true);
sValue = &sValueTmp;
@@ -1802,7 +1802,7 @@ void CPWL_AppStream::SetAsTextField(const CFX_WideString* sValue) {
pEdit->SetText(sValue ? *sValue : pField->GetValue());
CFX_FloatRect rcContent = pEdit->GetContentRect();
- CFX_ByteString sEdit =
+ ByteString sEdit =
GetEditAppStream(pEdit.get(), CFX_PointF(), !bCharArray, subWord);
if (sEdit.GetLength() > 0) {
@@ -1828,7 +1828,7 @@ void CPWL_AppStream::SetAsTextField(const CFX_WideString* sValue) {
if (bCharArray) {
switch (widget_->GetBorderStyle()) {
case BorderStyle::SOLID: {
- CFX_ByteString sColor =
+ ByteString sColor =
GetColorAppStream(widget_->GetBorderPWLColor(), false);
if (sColor.GetLength() > 0) {
AutoClosedQCommand q(&sLines);
@@ -1851,7 +1851,7 @@ void CPWL_AppStream::SetAsTextField(const CFX_WideString* sValue) {
break;
}
case BorderStyle::DASH: {
- CFX_ByteString sColor =
+ ByteString sColor =
GetColorAppStream(widget_->GetBorderPWLColor(), false);
if (sColor.GetLength() > 0) {
CPWL_Dash dsBorder = CPWL_Dash(3, 3, 0);
@@ -1880,16 +1880,15 @@ void CPWL_AppStream::SetAsTextField(const CFX_WideString* sValue) {
}
Write("N",
- GetBackgroundAppStream() + GetBorderAppStream() +
- CFX_ByteString(sLines) + CFX_ByteString(sBody),
+ GetBackgroundAppStream() + GetBorderAppStream() + ByteString(sLines) +
+ ByteString(sBody),
"");
}
-void CPWL_AppStream::AddImage(const CFX_ByteString& sAPType,
- CPDF_Stream* pImage) {
+void CPWL_AppStream::AddImage(const ByteString& sAPType, CPDF_Stream* pImage) {
CPDF_Stream* pStream = dict_->GetStreamFor(sAPType);
CPDF_Dictionary* pStreamDict = pStream->GetDict();
- CFX_ByteString sImageAlias = "IMG";
+ ByteString sImageAlias = "IMG";
if (CPDF_Dictionary* pImageDict = pImage->GetDict()) {
sImageAlias = pImageDict->GetStringFor("Name");
@@ -1908,9 +1907,9 @@ void CPWL_AppStream::AddImage(const CFX_ByteString& sAPType,
pImage->GetObjNum());
}
-void CPWL_AppStream::Write(const CFX_ByteString& sAPType,
- const CFX_ByteString& sContents,
- const CFX_ByteString& sAPState) {
+void CPWL_AppStream::Write(const ByteString& sAPType,
+ const ByteString& sContents,
+ const ByteString& sAPState) {
CPDF_Stream* pStream = nullptr;
CPDF_Dictionary* pParentDict = nullptr;
if (sAPState.IsEmpty()) {
@@ -1947,19 +1946,19 @@ void CPWL_AppStream::Write(const CFX_ByteString& sAPType,
sContents.GetLength());
}
-void CPWL_AppStream::Remove(const CFX_ByteString& sAPType) {
+void CPWL_AppStream::Remove(const ByteString& sAPType) {
dict_->RemoveFor(sAPType);
}
-CFX_ByteString CPWL_AppStream::GetBackgroundAppStream() const {
+ByteString CPWL_AppStream::GetBackgroundAppStream() const {
CFX_Color crBackground = widget_->GetFillPWLColor();
if (crBackground.nColorType != COLORTYPE_TRANSPARENT)
return GetRectFillAppStream(widget_->GetRotatedRect(), crBackground);
- return CFX_ByteString();
+ return ByteString();
}
-CFX_ByteString CPWL_AppStream::GetBorderAppStream() const {
+ByteString CPWL_AppStream::GetBorderAppStream() const {
CFX_FloatRect rcWindow = widget_->GetRotatedRect();
CFX_Color crBorder = widget_->GetBorderPWLColor();
CFX_Color crBackground = widget_->GetFillPWLColor();
diff --git a/fpdfsdk/pwl/cpwl_appstream.h b/fpdfsdk/pwl/cpwl_appstream.h
index 2043c7b0d7..d73e3aa0a7 100644
--- a/fpdfsdk/pwl/cpwl_appstream.h
+++ b/fpdfsdk/pwl/cpwl_appstream.h
@@ -22,19 +22,19 @@ class CPWL_AppStream {
void SetAsPushButton();
void SetAsCheckBox();
void SetAsRadioButton();
- void SetAsComboBox(const CFX_WideString* sValue);
+ void SetAsComboBox(const WideString* sValue);
void SetAsListBox();
- void SetAsTextField(const CFX_WideString* sValue);
+ void SetAsTextField(const WideString* sValue);
private:
- void AddImage(const CFX_ByteString& sAPType, CPDF_Stream* pImage);
- void Write(const CFX_ByteString& sAPType,
- const CFX_ByteString& sContents,
- const CFX_ByteString& sAPState);
- void Remove(const CFX_ByteString& sAPType);
-
- CFX_ByteString GetBackgroundAppStream() const;
- CFX_ByteString GetBorderAppStream() const;
+ void AddImage(const ByteString& sAPType, CPDF_Stream* pImage);
+ void Write(const ByteString& sAPType,
+ const ByteString& sContents,
+ const ByteString& sAPState);
+ void Remove(const ByteString& sAPType);
+
+ ByteString GetBackgroundAppStream() const;
+ ByteString GetBorderAppStream() const;
CFX_UnownedPtr<CPDFSDK_Widget> widget_;
CFX_UnownedPtr<CPDF_Dictionary> dict_;
diff --git a/fpdfsdk/pwl/cpwl_button.cpp b/fpdfsdk/pwl/cpwl_button.cpp
index fc0479be2c..5c06a98fa6 100644
--- a/fpdfsdk/pwl/cpwl_button.cpp
+++ b/fpdfsdk/pwl/cpwl_button.cpp
@@ -11,7 +11,7 @@ CPWL_Button::CPWL_Button() : m_bMouseDown(false) {}
CPWL_Button::~CPWL_Button() {}
-CFX_ByteString CPWL_Button::GetClassName() const {
+ByteString CPWL_Button::GetClassName() const {
return "CPWL_Button";
}
diff --git a/fpdfsdk/pwl/cpwl_button.h b/fpdfsdk/pwl/cpwl_button.h
index f26ae1c1f3..70f5ef1908 100644
--- a/fpdfsdk/pwl/cpwl_button.h
+++ b/fpdfsdk/pwl/cpwl_button.h
@@ -15,7 +15,7 @@ class CPWL_Button : public CPWL_Wnd {
~CPWL_Button() override;
// CPWL_Wnd
- CFX_ByteString GetClassName() const override;
+ ByteString GetClassName() const override;
void OnCreate(CreateParams* pParamsToAdjust) override;
bool OnLButtonDown(const CFX_PointF& point, uint32_t nFlag) override;
bool OnLButtonUp(const CFX_PointF& point, uint32_t nFlag) override;
diff --git a/fpdfsdk/pwl/cpwl_caret.cpp b/fpdfsdk/pwl/cpwl_caret.cpp
index 3d05961601..b1040bc2e3 100644
--- a/fpdfsdk/pwl/cpwl_caret.cpp
+++ b/fpdfsdk/pwl/cpwl_caret.cpp
@@ -19,7 +19,7 @@ CPWL_Caret::CPWL_Caret() : m_bFlash(false), m_fWidth(0.4f), m_nDelay(0) {}
CPWL_Caret::~CPWL_Caret() {}
-CFX_ByteString CPWL_Caret::GetClassName() const {
+ByteString CPWL_Caret::GetClassName() const {
return "CPWL_Caret";
}
diff --git a/fpdfsdk/pwl/cpwl_caret.h b/fpdfsdk/pwl/cpwl_caret.h
index 32034708a7..fb0fa8978c 100644
--- a/fpdfsdk/pwl/cpwl_caret.h
+++ b/fpdfsdk/pwl/cpwl_caret.h
@@ -15,7 +15,7 @@ class CPWL_Caret : public CPWL_Wnd {
~CPWL_Caret() override;
// CPWL_Wnd
- CFX_ByteString GetClassName() const override;
+ ByteString GetClassName() const override;
void DrawThisAppearance(CFX_RenderDevice* pDevice,
const CFX_Matrix& mtUser2Device) override;
void InvalidateRect(CFX_FloatRect* pRect) override;
diff --git a/fpdfsdk/pwl/cpwl_combo_box.cpp b/fpdfsdk/pwl/cpwl_combo_box.cpp
index 03651949b2..5bb9124931 100644
--- a/fpdfsdk/pwl/cpwl_combo_box.cpp
+++ b/fpdfsdk/pwl/cpwl_combo_box.cpp
@@ -147,7 +147,7 @@ CPWL_ComboBox::CPWL_ComboBox() {}
CPWL_ComboBox::~CPWL_ComboBox() {}
-CFX_ByteString CPWL_ComboBox::GetClassName() const {
+ByteString CPWL_ComboBox::GetClassName() const {
return "CPWL_ComboBox";
}
@@ -177,31 +177,31 @@ void CPWL_ComboBox::KillFocus() {
CPWL_Wnd::KillFocus();
}
-CFX_WideString CPWL_ComboBox::GetSelectedText() {
+WideString CPWL_ComboBox::GetSelectedText() {
if (m_pEdit)
return m_pEdit->GetSelectedText();
- return CFX_WideString();
+ return WideString();
}
-void CPWL_ComboBox::ReplaceSelection(const CFX_WideString& text) {
+void CPWL_ComboBox::ReplaceSelection(const WideString& text) {
if (m_pEdit)
m_pEdit->ReplaceSelection(text);
}
-CFX_WideString CPWL_ComboBox::GetText() const {
+WideString CPWL_ComboBox::GetText() const {
if (m_pEdit) {
return m_pEdit->GetText();
}
- return CFX_WideString();
+ return WideString();
}
-void CPWL_ComboBox::SetText(const CFX_WideString& text) {
+void CPWL_ComboBox::SetText(const WideString& text) {
if (m_pEdit)
m_pEdit->SetText(text);
}
-void CPWL_ComboBox::AddString(const CFX_WideString& str) {
+void CPWL_ComboBox::AddString(const WideString& str) {
if (m_pList)
m_pList->AddString(str);
}
diff --git a/fpdfsdk/pwl/cpwl_combo_box.h b/fpdfsdk/pwl/cpwl_combo_box.h
index b431191452..c9fa2cda4b 100644
--- a/fpdfsdk/pwl/cpwl_combo_box.h
+++ b/fpdfsdk/pwl/cpwl_combo_box.h
@@ -50,7 +50,7 @@ class CPWL_ComboBox : public CPWL_Wnd {
CPWL_Edit* GetEdit() const { return m_pEdit.Get(); }
// CPWL_Wnd:
- CFX_ByteString GetClassName() const override;
+ ByteString GetClassName() const override;
void OnCreate(CreateParams* pParamsToAdjust) override;
void OnDestroy() override;
bool OnKeyDown(uint16_t nChar, uint32_t nFlag) override;
@@ -62,14 +62,14 @@ class CPWL_ComboBox : public CPWL_Wnd {
CFX_FloatRect GetFocusRect() const override;
void SetFocus() override;
void KillFocus() override;
- CFX_WideString GetSelectedText() override;
- void ReplaceSelection(const CFX_WideString& text) override;
+ WideString GetSelectedText() override;
+ void ReplaceSelection(const WideString& text) override;
void SetFillerNotify(IPWL_Filler_Notify* pNotify);
- CFX_WideString GetText() const;
- void SetText(const CFX_WideString& text);
- void AddString(const CFX_WideString& str);
+ WideString GetText() const;
+ void SetText(const WideString& text);
+ void AddString(const WideString& str);
int32_t GetSelect() const;
void SetSelect(int32_t nItemIndex);
diff --git a/fpdfsdk/pwl/cpwl_edit.cpp b/fpdfsdk/pwl/cpwl_edit.cpp
index 8fbafd0ca0..c71dbe4be0 100644
--- a/fpdfsdk/pwl/cpwl_edit.cpp
+++ b/fpdfsdk/pwl/cpwl_edit.cpp
@@ -35,18 +35,18 @@ CPWL_Edit::~CPWL_Edit() {
ASSERT(!m_bFocus);
}
-CFX_ByteString CPWL_Edit::GetClassName() const {
+ByteString CPWL_Edit::GetClassName() const {
return PWL_CLASSNAME_EDIT;
}
-void CPWL_Edit::SetText(const CFX_WideString& csText) {
- CFX_WideString swText = csText;
+void CPWL_Edit::SetText(const WideString& csText) {
+ WideString swText = csText;
if (!HasFlag(PES_RICH)) {
m_pEdit->SetText(swText);
return;
}
- CFX_ByteString sValue = CFX_ByteString::FromUnicode(swText);
+ ByteString sValue = ByteString::FromUnicode(swText);
std::unique_ptr<CXML_Element> pXML(
CXML_Element::Parse(sValue.c_str(), sValue.GetLength()));
if (!pXML) {
@@ -62,7 +62,7 @@ void CPWL_Edit::SetText(const CFX_WideString& csText) {
if (!pSubElement || !pSubElement->GetTagName().EqualNoCase("p"))
continue;
- CFX_WideString swSection;
+ WideString swSection;
int nSubChild = pSubElement->CountChildren();
for (int32_t j = 0; j < nSubChild; j++) {
CXML_Content* pSubContent = ToContent(pSubElement->GetChild(j));
@@ -443,7 +443,7 @@ void CPWL_Edit::SetLimitChar(int32_t nLimitChar) {
m_pEdit->SetLimitChar(nLimitChar);
}
-void CPWL_Edit::ReplaceSel(const CFX_WideString& wsText) {
+void CPWL_Edit::ReplaceSel(const WideString& wsText) {
m_pEdit->ClearSelection();
m_pEdit->InsertText(wsText, FX_CHARSET_Default);
}
@@ -463,8 +463,8 @@ bool CPWL_Edit::OnKeyDown(uint16_t nChar, uint32_t nFlag) {
if (nChar == FWL_VKEY_Delete) {
if (m_pFillerNotify) {
- CFX_WideString strChange;
- CFX_WideString strChangeEx;
+ WideString strChange;
+ WideString strChangeEx;
int nSelStart = 0;
int nSelEnd = 0;
@@ -532,7 +532,7 @@ bool CPWL_Edit::OnChar(uint16_t nChar, uint32_t nFlag) {
if (!IsCTRLpressed(nFlag)) {
if (m_pFillerNotify) {
- CFX_WideString swChange;
+ WideString swChange;
int nSelStart = 0;
int nSelEnd = 0;
@@ -550,7 +550,7 @@ bool CPWL_Edit::OnChar(uint16_t nChar, uint32_t nFlag) {
break;
}
- CFX_WideString strChangeEx;
+ WideString strChangeEx;
std::tie(bRC, bExit) = m_pFillerNotify->OnBeforeKeyStroke(
GetAttachedData(), swChange, strChangeEx, nSelStart, nSelEnd, true,
nFlag);
diff --git a/fpdfsdk/pwl/cpwl_edit.h b/fpdfsdk/pwl/cpwl_edit.h
index 3e8de04b47..d61b94730e 100644
--- a/fpdfsdk/pwl/cpwl_edit.h
+++ b/fpdfsdk/pwl/cpwl_edit.h
@@ -27,8 +27,8 @@ class IPWL_Filler_Notify {
float* fPopupRet) = 0;
virtual std::pair<bool, bool> OnBeforeKeyStroke(
CPWL_Wnd::PrivateData* pAttached,
- CFX_WideString& strChange,
- const CFX_WideString& strChangeEx,
+ WideString& strChange,
+ const WideString& strChangeEx,
int nSelStart,
int nSelEnd,
bool bKeyDown,
@@ -47,7 +47,7 @@ class CPWL_Edit : public CPWL_EditCtrl {
~CPWL_Edit() override;
// CPWL_EditCtrl
- CFX_ByteString GetClassName() const override;
+ ByteString GetClassName() const override;
void OnCreated() override;
void RePosChildWnd() override;
CFX_FloatRect GetClientRect() const override;
@@ -80,8 +80,8 @@ class CPWL_Edit : public CPWL_EditCtrl {
void CutText();
- void SetText(const CFX_WideString& csText);
- void ReplaceSel(const CFX_WideString& csText);
+ void SetText(const WideString& csText);
+ void ReplaceSel(const WideString& csText);
bool IsTextFull() const;
diff --git a/fpdfsdk/pwl/cpwl_edit_ctrl.cpp b/fpdfsdk/pwl/cpwl_edit_ctrl.cpp
index 7baaaa8ca5..f0fc408771 100644
--- a/fpdfsdk/pwl/cpwl_edit_ctrl.cpp
+++ b/fpdfsdk/pwl/cpwl_edit_ctrl.cpp
@@ -52,14 +52,14 @@ void CPWL_EditCtrl::SetCursor() {
}
}
-CFX_WideString CPWL_EditCtrl::GetSelectedText() {
+WideString CPWL_EditCtrl::GetSelectedText() {
if (m_pEdit)
return m_pEdit->GetSelectedText();
- return CFX_WideString();
+ return WideString();
}
-void CPWL_EditCtrl::ReplaceSelection(const CFX_WideString& text) {
+void CPWL_EditCtrl::ReplaceSelection(const WideString& text) {
if (!m_pEdit)
return;
@@ -338,7 +338,7 @@ void CPWL_EditCtrl::SetCaret(bool bVisible,
}
}
-CFX_WideString CPWL_EditCtrl::GetText() const {
+WideString CPWL_EditCtrl::GetText() const {
return m_pEdit->GetText();
}
diff --git a/fpdfsdk/pwl/cpwl_edit_ctrl.h b/fpdfsdk/pwl/cpwl_edit_ctrl.h
index eb4470f734..37ac320d8f 100644
--- a/fpdfsdk/pwl/cpwl_edit_ctrl.h
+++ b/fpdfsdk/pwl/cpwl_edit_ctrl.h
@@ -25,7 +25,7 @@ class CPWL_EditCtrl : public CPWL_Wnd {
CPWL_EditCtrl();
~CPWL_EditCtrl() override;
- CFX_WideString GetText() const;
+ WideString GetText() const;
void SetSelection(int32_t nStartChar, int32_t nEndChar);
void GetSelection(int32_t& nStartChar, int32_t& nEndChar) const;
void ClearSelection();
@@ -60,8 +60,8 @@ class CPWL_EditCtrl : public CPWL_Wnd {
void SetFontSize(float fFontSize) override;
float GetFontSize() const override;
void SetCursor() override;
- CFX_WideString GetSelectedText() override;
- void ReplaceSelection(const CFX_WideString& text) override;
+ WideString GetSelectedText() override;
+ void ReplaceSelection(const WideString& text) override;
void SetCaret(bool bVisible,
const CFX_PointF& ptHead,
diff --git a/fpdfsdk/pwl/cpwl_edit_impl.cpp b/fpdfsdk/pwl/cpwl_edit_impl.cpp
index c44301f212..c65199955b 100644
--- a/fpdfsdk/pwl/cpwl_edit_impl.cpp
+++ b/fpdfsdk/pwl/cpwl_edit_impl.cpp
@@ -43,7 +43,7 @@ void DrawTextString(CFX_RenderDevice* pDevice,
CPDF_Font* pFont,
float fFontSize,
const CFX_Matrix& mtUser2Device,
- const CFX_ByteString& str,
+ const ByteString& str,
FX_ARGB crTextFill,
int32_t nHorzScale) {
if (!pFont)
@@ -394,7 +394,7 @@ void CFXEU_Delete::Undo() {
CFXEU_Clear::CFXEU_Clear(CPWL_EditImpl* pEdit,
const CPVT_WordRange& wrSel,
- const CFX_WideString& swText)
+ const WideString& swText)
: m_pEdit(pEdit), m_wrSel(wrSel), m_swText(swText) {
ASSERT(m_pEdit);
}
@@ -417,7 +417,7 @@ void CFXEU_Clear::Undo() {
CFXEU_InsertText::CFXEU_InsertText(CPWL_EditImpl* pEdit,
const CPVT_WordPlace& wpOldPlace,
const CPVT_WordPlace& wpNewPlace,
- const CFX_WideString& swText,
+ const WideString& swText,
int32_t charset)
: m_pEdit(pEdit),
m_wpOld(wpOldPlace),
@@ -526,7 +526,7 @@ void CPWL_EditImpl::DrawEdit(CFX_RenderDevice* pDevice,
DrawTextString(
pDevice, CFX_PointF(ptBT.x + ptOffset.x, ptBT.y + ptOffset.y),
pFontMap->GetPDFFont(nFontIndex), fFontSize, mtUser2Device,
- CFX_ByteString(sTextBuf), crOldFill, nHorzScale);
+ ByteString(sTextBuf), crOldFill, nHorzScale);
sTextBuf.str("");
}
@@ -553,7 +553,7 @@ void CPWL_EditImpl::DrawEdit(CFX_RenderDevice* pDevice,
DrawTextString(pDevice,
CFX_PointF(ptBT.x + ptOffset.x, ptBT.y + ptOffset.y),
pFontMap->GetPDFFont(nFontIndex), fFontSize, mtUser2Device,
- CFX_ByteString(sTextBuf), crOldFill, nHorzScale);
+ ByteString(sTextBuf), crOldFill, nHorzScale);
}
}
@@ -736,8 +736,8 @@ CPVT_WordPlace CPWL_EditImpl::GetCaretWordPlace() const {
return m_wpCaret;
}
-CFX_WideString CPWL_EditImpl::GetText() const {
- CFX_WideString swRet;
+WideString CPWL_EditImpl::GetText() const {
+ WideString swRet;
if (!m_pVT->IsValid())
return swRet;
@@ -757,8 +757,8 @@ CFX_WideString CPWL_EditImpl::GetText() const {
return swRet;
}
-CFX_WideString CPWL_EditImpl::GetRangeText(const CPVT_WordRange& range) const {
- CFX_WideString swRet;
+WideString CPWL_EditImpl::GetRangeText(const CPVT_WordRange& range) const {
+ WideString swRet;
if (!m_pVT->IsValid())
return swRet;
@@ -783,7 +783,7 @@ CFX_WideString CPWL_EditImpl::GetRangeText(const CPVT_WordRange& range) const {
return swRet;
}
-CFX_WideString CPWL_EditImpl::GetSelectedText() const {
+WideString CPWL_EditImpl::GetSelectedText() const {
return GetRangeText(m_SelState.ConvertToWordRange());
}
@@ -802,7 +802,7 @@ CPVT_WordRange CPWL_EditImpl::GetSelectWordRange() const {
return m_SelState.ConvertToWordRange();
}
-void CPWL_EditImpl::SetText(const CFX_WideString& sText) {
+void CPWL_EditImpl::SetText(const WideString& sText) {
Empty();
DoInsertText(CPVT_WordPlace(0, 0, -1), sText, FX_CHARSET_Default);
Paint();
@@ -828,7 +828,7 @@ bool CPWL_EditImpl::ClearSelection() {
return Clear(true, true);
}
-bool CPWL_EditImpl::InsertText(const CFX_WideString& sText, int32_t charset) {
+bool CPWL_EditImpl::InsertText(const WideString& sText, int32_t charset) {
return InsertText(sText, charset, true, true);
}
@@ -1702,7 +1702,7 @@ bool CPWL_EditImpl::Clear(bool bAddUndo, bool bPaint) {
return true;
}
-bool CPWL_EditImpl::InsertText(const CFX_WideString& sText,
+bool CPWL_EditImpl::InsertText(const WideString& sText,
int32_t charset,
bool bAddUndo,
bool bPaint) {
@@ -1836,7 +1836,7 @@ void CPWL_EditImpl::EnableUndo(bool bUndo) {
}
CPVT_WordPlace CPWL_EditImpl::DoInsertText(const CPVT_WordPlace& place,
- const CFX_WideString& sText,
+ const WideString& sText,
int32_t charset) {
CPVT_WordPlace wp = place;
@@ -1877,15 +1877,15 @@ void CPWL_EditImpl::AddEditUndoItem(
m_Undo.AddItem(std::move(pEditUndoItem));
}
-CFX_ByteString CPWL_EditImpl::GetPDFWordString(int32_t nFontIndex,
- uint16_t Word,
- uint16_t SubWord) {
+ByteString CPWL_EditImpl::GetPDFWordString(int32_t nFontIndex,
+ uint16_t Word,
+ uint16_t SubWord) {
IPVT_FontMap* pFontMap = GetFontMap();
CPDF_Font* pPDFFont = pFontMap->GetPDFFont(nFontIndex);
if (!pPDFFont)
- return CFX_ByteString();
+ return ByteString();
- CFX_ByteString sWord;
+ ByteString sWord;
if (SubWord > 0) {
Word = SubWord;
} else {
diff --git a/fpdfsdk/pwl/cpwl_edit_impl.h b/fpdfsdk/pwl/cpwl_edit_impl.h
index 177a0524f4..a63b22cd10 100644
--- a/fpdfsdk/pwl/cpwl_edit_impl.h
+++ b/fpdfsdk/pwl/cpwl_edit_impl.h
@@ -233,7 +233,7 @@ class CFXEU_Clear : public IFX_Edit_UndoItem {
public:
CFXEU_Clear(CPWL_EditImpl* pEdit,
const CPVT_WordRange& wrSel,
- const CFX_WideString& swText);
+ const WideString& swText);
~CFXEU_Clear() override;
// IFX_Edit_UndoItem:
@@ -244,7 +244,7 @@ class CFXEU_Clear : public IFX_Edit_UndoItem {
CFX_UnownedPtr<CPWL_EditImpl> m_pEdit;
CPVT_WordRange m_wrSel;
- CFX_WideString m_swText;
+ WideString m_swText;
};
class CFXEU_InsertText : public IFX_Edit_UndoItem {
@@ -252,7 +252,7 @@ class CFXEU_InsertText : public IFX_Edit_UndoItem {
CFXEU_InsertText(CPWL_EditImpl* pEdit,
const CPVT_WordPlace& wpOldPlace,
const CPVT_WordPlace& wpNewPlace,
- const CFX_WideString& swText,
+ const WideString& swText,
int32_t charset);
~CFXEU_InsertText() override;
@@ -265,7 +265,7 @@ class CFXEU_InsertText : public IFX_Edit_UndoItem {
CPVT_WordPlace m_wpOld;
CPVT_WordPlace m_wpNew;
- CFX_WideString m_swText;
+ WideString m_swText;
int32_t m_nCharset;
};
@@ -323,27 +323,27 @@ class CPWL_EditImpl {
void OnVK_RIGHT(bool bShift, bool bCtrl);
void OnVK_HOME(bool bShift, bool bCtrl);
void OnVK_END(bool bShift, bool bCtrl);
- void SetText(const CFX_WideString& sText);
+ void SetText(const WideString& sText);
bool InsertWord(uint16_t word, int32_t charset);
bool InsertReturn();
bool Backspace();
bool Delete();
bool ClearSelection();
- bool InsertText(const CFX_WideString& sText, int32_t charset);
+ bool InsertText(const WideString& sText, int32_t charset);
bool Redo();
bool Undo();
CPVT_WordPlace WordIndexToWordPlace(int32_t index) const;
CPVT_WordPlace SearchWordPlace(const CFX_PointF& point) const;
int32_t GetCaret() const;
CPVT_WordPlace GetCaretWordPlace() const;
- CFX_WideString GetSelectedText() const;
- CFX_WideString GetText() const;
+ WideString GetSelectedText() const;
+ WideString GetText() const;
float GetFontSize() const;
uint16_t GetPasswordChar() const;
CFX_PointF GetScrollPos() const;
int32_t GetCharArray() const;
CFX_FloatRect GetContentRect() const;
- CFX_WideString GetRangeText(const CPVT_WordRange& range) const;
+ WideString GetRangeText(const CPVT_WordRange& range) const;
int32_t GetHorzScale() const;
float GetCharSpace() const;
void SetSelection(int32_t nStartChar, int32_t nEndChar);
@@ -366,15 +366,15 @@ class CPWL_EditImpl {
bool Empty();
CPVT_WordPlace DoInsertText(const CPVT_WordPlace& place,
- const CFX_WideString& sText,
+ const WideString& sText,
int32_t charset);
int32_t GetCharSetFromUnicode(uint16_t word, int32_t nOldCharset);
int32_t GetTotalLines() const;
- CFX_ByteString GetPDFWordString(int32_t nFontIndex,
- uint16_t Word,
- uint16_t SubWord);
+ ByteString GetPDFWordString(int32_t nFontIndex,
+ uint16_t Word,
+ uint16_t SubWord);
private:
friend class CPWL_EditImpl_Iterator;
@@ -408,7 +408,7 @@ class CPWL_EditImpl {
bool Backspace(bool bAddUndo, bool bPaint);
bool Delete(bool bAddUndo, bool bPaint);
bool Clear(bool bAddUndo, bool bPaint);
- bool InsertText(const CFX_WideString& sText,
+ bool InsertText(const WideString& sText,
int32_t charset,
bool bAddUndo,
bool bPaint);
diff --git a/fpdfsdk/pwl/cpwl_font_map.cpp b/fpdfsdk/pwl/cpwl_font_map.cpp
index 862973541a..94d5fb8518 100644
--- a/fpdfsdk/pwl/cpwl_font_map.cpp
+++ b/fpdfsdk/pwl/cpwl_font_map.cpp
@@ -66,11 +66,11 @@ CPDF_Font* CPWL_FontMap::GetPDFFont(int32_t nFontIndex) {
return nullptr;
}
-CFX_ByteString CPWL_FontMap::GetPDFFontAlias(int32_t nFontIndex) {
+ByteString CPWL_FontMap::GetPDFFontAlias(int32_t nFontIndex) {
if (pdfium::IndexInBounds(m_Data, nFontIndex) && m_Data[nFontIndex])
return m_Data[nFontIndex]->sFontName;
- return CFX_ByteString();
+ return ByteString();
}
bool CPWL_FontMap::KnowWord(int32_t nFontIndex, uint16_t word) {
@@ -122,15 +122,15 @@ int32_t CPWL_FontMap::CharCodeFromUnicode(int32_t nFontIndex, uint16_t word) {
return word < 0xFF ? word : -1;
}
-CFX_ByteString CPWL_FontMap::GetNativeFontName(int32_t nCharset) {
+ByteString CPWL_FontMap::GetNativeFontName(int32_t nCharset) {
for (const auto& pData : m_NativeFont) {
if (pData && pData->nCharset == nCharset)
return pData->sFontName;
}
- CFX_ByteString sNew = GetNativeFont(nCharset);
+ ByteString sNew = GetNativeFont(nCharset);
if (sNew.IsEmpty())
- return CFX_ByteString();
+ return ByteString();
auto pNewData = pdfium::MakeUnique<CPWL_FontMap_Native>();
pNewData->nCharset = nCharset;
@@ -148,7 +148,7 @@ void CPWL_FontMap::Initialize() {
GetFontIndex(kDefaultFontName, FX_CHARSET_ANSI, false);
}
-bool CPWL_FontMap::IsStandardFont(const CFX_ByteString& sFontName) {
+bool CPWL_FontMap::IsStandardFont(const ByteString& sFontName) {
for (size_t i = 0; i < FX_ArraySize(g_sDEStandardFontName); ++i) {
if (sFontName == g_sDEStandardFontName[i])
return true;
@@ -157,8 +157,7 @@ bool CPWL_FontMap::IsStandardFont(const CFX_ByteString& sFontName) {
return false;
}
-int32_t CPWL_FontMap::FindFont(const CFX_ByteString& sFontName,
- int32_t nCharset) {
+int32_t CPWL_FontMap::FindFont(const ByteString& sFontName, int32_t nCharset) {
int32_t i = 0;
for (const auto& pData : m_Data) {
if (pData &&
@@ -171,17 +170,17 @@ int32_t CPWL_FontMap::FindFont(const CFX_ByteString& sFontName,
return -1;
}
-int32_t CPWL_FontMap::GetFontIndex(const CFX_ByteString& sFontName,
+int32_t CPWL_FontMap::GetFontIndex(const ByteString& sFontName,
int32_t nCharset,
bool bFind) {
int32_t nFontIndex = FindFont(EncodeFontAlias(sFontName, nCharset), nCharset);
if (nFontIndex >= 0)
return nFontIndex;
- CFX_ByteString sAlias;
+ ByteString sAlias;
CPDF_Font* pFont = bFind ? FindFontSameCharset(&sAlias, nCharset) : nullptr;
if (!pFont) {
- CFX_ByteString sTemp = sFontName;
+ ByteString sTemp = sFontName;
pFont = AddFontToDocument(GetDocument(), sTemp, nCharset);
sAlias = EncodeFontAlias(sTemp, nCharset);
}
@@ -189,13 +188,13 @@ int32_t CPWL_FontMap::GetFontIndex(const CFX_ByteString& sFontName,
return AddFontData(pFont, sAlias, nCharset);
}
-CPDF_Font* CPWL_FontMap::FindFontSameCharset(CFX_ByteString* sFontAlias,
+CPDF_Font* CPWL_FontMap::FindFontSameCharset(ByteString* sFontAlias,
int32_t nCharset) {
return nullptr;
}
int32_t CPWL_FontMap::AddFontData(CPDF_Font* pFont,
- const CFX_ByteString& sFontAlias,
+ const ByteString& sFontAlias,
int32_t nCharset) {
auto pNewData = pdfium::MakeUnique<CPWL_FontMap_Data>();
pNewData->pFont = pFont;
@@ -205,22 +204,21 @@ int32_t CPWL_FontMap::AddFontData(CPDF_Font* pFont,
return pdfium::CollectionSize<int32_t>(m_Data) - 1;
}
-void CPWL_FontMap::AddedFont(CPDF_Font* pFont,
- const CFX_ByteString& sFontAlias) {}
+void CPWL_FontMap::AddedFont(CPDF_Font* pFont, const ByteString& sFontAlias) {}
-CFX_ByteString CPWL_FontMap::GetNativeFont(int32_t nCharset) {
+ByteString CPWL_FontMap::GetNativeFont(int32_t nCharset) {
if (nCharset == FX_CHARSET_Default)
nCharset = GetNativeCharset();
- CFX_ByteString sFontName = GetDefaultFontByCharset(nCharset);
+ ByteString sFontName = GetDefaultFontByCharset(nCharset);
if (!m_pSystemHandler->FindNativeTrueTypeFont(sFontName))
- return CFX_ByteString();
+ return ByteString();
return sFontName;
}
CPDF_Font* CPWL_FontMap::AddFontToDocument(CPDF_Document* pDoc,
- CFX_ByteString& sFontName,
+ ByteString& sFontName,
uint8_t nCharset) {
if (IsStandardFont(sFontName))
return AddStandardFont(pDoc, sFontName);
@@ -229,7 +227,7 @@ CPDF_Font* CPWL_FontMap::AddFontToDocument(CPDF_Document* pDoc,
}
CPDF_Font* CPWL_FontMap::AddStandardFont(CPDF_Document* pDoc,
- CFX_ByteString& sFontName) {
+ ByteString& sFontName) {
if (!pDoc)
return nullptr;
@@ -246,7 +244,7 @@ CPDF_Font* CPWL_FontMap::AddStandardFont(CPDF_Document* pDoc,
}
CPDF_Font* CPWL_FontMap::AddSystemFont(CPDF_Document* pDoc,
- CFX_ByteString& sFontName,
+ ByteString& sFontName,
uint8_t nCharset) {
if (!pDoc)
return nullptr;
@@ -260,15 +258,15 @@ CPDF_Font* CPWL_FontMap::AddSystemFont(CPDF_Document* pDoc,
nCharset);
}
-CFX_ByteString CPWL_FontMap::EncodeFontAlias(const CFX_ByteString& sFontName,
- int32_t nCharset) {
- CFX_ByteString sPostfix;
+ByteString CPWL_FontMap::EncodeFontAlias(const ByteString& sFontName,
+ int32_t nCharset) {
+ ByteString sPostfix;
sPostfix.Format("_%02X", nCharset);
return EncodeFontAlias(sFontName) + sPostfix;
}
-CFX_ByteString CPWL_FontMap::EncodeFontAlias(const CFX_ByteString& sFontName) {
- CFX_ByteString sRet = sFontName;
+ByteString CPWL_FontMap::EncodeFontAlias(const ByteString& sFontName) {
+ ByteString sRet = sFontName;
sRet.Remove(' ');
return sRet;
}
@@ -349,7 +347,7 @@ const FPDF_CharsetFontMap CPWL_FontMap::defaultTTFMap[] = {
{FX_CHARSET_MSWin_Arabic, "Arial"},
{-1, nullptr}};
-CFX_ByteString CPWL_FontMap::GetDefaultFontByCharset(int32_t nCharset) {
+ByteString CPWL_FontMap::GetDefaultFontByCharset(int32_t nCharset) {
int i = 0;
while (defaultTTFMap[i].charset != -1) {
if (nCharset == defaultTTFMap[i].charset)
diff --git a/fpdfsdk/pwl/cpwl_font_map.h b/fpdfsdk/pwl/cpwl_font_map.h
index 9872779c95..5336949399 100644
--- a/fpdfsdk/pwl/cpwl_font_map.h
+++ b/fpdfsdk/pwl/cpwl_font_map.h
@@ -21,12 +21,12 @@ class CFX_SystemHandler;
struct CPWL_FontMap_Data {
CPDF_Font* pFont;
int32_t nCharset;
- CFX_ByteString sFontName;
+ ByteString sFontName;
};
struct CPWL_FontMap_Native {
int32_t nCharset;
- CFX_ByteString sFontName;
+ ByteString sFontName;
};
class CPWL_FontMap : public IPVT_FontMap {
@@ -36,7 +36,7 @@ class CPWL_FontMap : public IPVT_FontMap {
// IPVT_FontMap
CPDF_Font* GetPDFFont(int32_t nFontIndex) override;
- CFX_ByteString GetPDFFontAlias(int32_t nFontIndex) override;
+ ByteString GetPDFFontAlias(int32_t nFontIndex) override;
int32_t GetWordFontIndex(uint16_t word,
int32_t nCharset,
int32_t nFontIndex) override;
@@ -45,47 +45,46 @@ class CPWL_FontMap : public IPVT_FontMap {
const CPWL_FontMap_Data* GetFontMapData(int32_t nIndex) const;
static int32_t GetNativeCharset();
- CFX_ByteString GetNativeFontName(int32_t nCharset);
+ ByteString GetNativeFontName(int32_t nCharset);
- static CFX_ByteString GetDefaultFontByCharset(int32_t nCharset);
+ static ByteString GetDefaultFontByCharset(int32_t nCharset);
static const FPDF_CharsetFontMap defaultTTFMap[];
protected:
virtual void Initialize();
virtual CPDF_Document* GetDocument();
- virtual CPDF_Font* FindFontSameCharset(CFX_ByteString* sFontAlias,
+ virtual CPDF_Font* FindFontSameCharset(ByteString* sFontAlias,
int32_t nCharset);
- virtual void AddedFont(CPDF_Font* pFont, const CFX_ByteString& sFontAlias);
+ virtual void AddedFont(CPDF_Font* pFont, const ByteString& sFontAlias);
bool KnowWord(int32_t nFontIndex, uint16_t word);
void Empty();
- int32_t GetFontIndex(const CFX_ByteString& sFontName,
+ int32_t GetFontIndex(const ByteString& sFontName,
int32_t nCharset,
bool bFind);
int32_t AddFontData(CPDF_Font* pFont,
- const CFX_ByteString& sFontAlias,
+ const ByteString& sFontAlias,
int32_t nCharset = FX_CHARSET_Default);
- CFX_ByteString EncodeFontAlias(const CFX_ByteString& sFontName,
- int32_t nCharset);
- CFX_ByteString EncodeFontAlias(const CFX_ByteString& sFontName);
+ ByteString EncodeFontAlias(const ByteString& sFontName, int32_t nCharset);
+ ByteString EncodeFontAlias(const ByteString& sFontName);
std::vector<std::unique_ptr<CPWL_FontMap_Data>> m_Data;
std::vector<std::unique_ptr<CPWL_FontMap_Native>> m_NativeFont;
private:
- int32_t FindFont(const CFX_ByteString& sFontName,
+ int32_t FindFont(const ByteString& sFontName,
int32_t nCharset = FX_CHARSET_Default);
- CFX_ByteString GetNativeFont(int32_t nCharset);
+ ByteString GetNativeFont(int32_t nCharset);
CPDF_Font* AddFontToDocument(CPDF_Document* pDoc,
- CFX_ByteString& sFontName,
+ ByteString& sFontName,
uint8_t nCharset);
- bool IsStandardFont(const CFX_ByteString& sFontName);
- CPDF_Font* AddStandardFont(CPDF_Document* pDoc, CFX_ByteString& sFontName);
+ bool IsStandardFont(const ByteString& sFontName);
+ CPDF_Font* AddStandardFont(CPDF_Document* pDoc, ByteString& sFontName);
CPDF_Font* AddSystemFont(CPDF_Document* pDoc,
- CFX_ByteString& sFontName,
+ ByteString& sFontName,
uint8_t nCharset);
std::unique_ptr<CPDF_Document> m_pPDFDoc;
diff --git a/fpdfsdk/pwl/cpwl_icon.cpp b/fpdfsdk/pwl/cpwl_icon.cpp
index 8a2e31da6a..e7669b3d20 100644
--- a/fpdfsdk/pwl/cpwl_icon.cpp
+++ b/fpdfsdk/pwl/cpwl_icon.cpp
@@ -37,12 +37,12 @@ CFX_Matrix CPWL_Icon::GetImageMatrix() {
return CFX_Matrix();
}
-CFX_ByteString CPWL_Icon::GetImageAlias() {
+ByteString CPWL_Icon::GetImageAlias() {
if (!m_pPDFStream)
- return CFX_ByteString();
+ return ByteString();
if (CPDF_Dictionary* pDict = m_pPDFStream->GetDict())
return pDict->GetStringFor("Name");
- return CFX_ByteString();
+ return ByteString();
}
std::pair<float, float> CPWL_Icon::GetIconPosition() {
diff --git a/fpdfsdk/pwl/cpwl_icon.h b/fpdfsdk/pwl/cpwl_icon.h
index 2607e56890..e2f792b9d5 100644
--- a/fpdfsdk/pwl/cpwl_icon.h
+++ b/fpdfsdk/pwl/cpwl_icon.h
@@ -28,7 +28,7 @@ class CPWL_Icon : public CPWL_Wnd {
std::pair<float, float> GetImageOffset();
CFX_Matrix GetImageMatrix();
- CFX_ByteString GetImageAlias();
+ ByteString GetImageAlias();
private:
// left, bottom
diff --git a/fpdfsdk/pwl/cpwl_list_box.cpp b/fpdfsdk/pwl/cpwl_list_box.cpp
index 4090e792e4..b5c629392b 100644
--- a/fpdfsdk/pwl/cpwl_list_box.cpp
+++ b/fpdfsdk/pwl/cpwl_list_box.cpp
@@ -72,7 +72,7 @@ CPWL_ListBox::CPWL_ListBox()
CPWL_ListBox::~CPWL_ListBox() {}
-CFX_ByteString CPWL_ListBox::GetClassName() const {
+ByteString CPWL_ListBox::GetClassName() const {
return "CPWL_ListBox";
}
@@ -260,8 +260,8 @@ bool CPWL_ListBox::OnNotifySelectionChanged(bool bKeyDown, uint32_t nFlag) {
if (!m_pFillerNotify)
return false;
- CFX_WideString swChange = GetText();
- CFX_WideString strChangeEx;
+ WideString swChange = GetText();
+ WideString strChangeEx;
int nSelStart = 0;
int nSelEnd = swChange.GetLength();
bool bRC;
@@ -282,11 +282,11 @@ CFX_FloatRect CPWL_ListBox::GetFocusRect() const {
return CPWL_Wnd::GetFocusRect();
}
-void CPWL_ListBox::AddString(const CFX_WideString& str) {
+void CPWL_ListBox::AddString(const WideString& str) {
m_pList->AddString(str);
}
-CFX_WideString CPWL_ListBox::GetText() const {
+WideString CPWL_ListBox::GetText() const {
return m_pList->GetText();
}
diff --git a/fpdfsdk/pwl/cpwl_list_box.h b/fpdfsdk/pwl/cpwl_list_box.h
index f620ec1050..1e028f7299 100644
--- a/fpdfsdk/pwl/cpwl_list_box.h
+++ b/fpdfsdk/pwl/cpwl_list_box.h
@@ -44,7 +44,7 @@ class CPWL_ListBox : public CPWL_Wnd {
~CPWL_ListBox() override;
// CPWL_Wnd
- CFX_ByteString GetClassName() const override;
+ ByteString GetClassName() const override;
void OnCreated() override;
void OnDestroy() override;
void DrawThisAppearance(CFX_RenderDevice* pDevice,
@@ -66,11 +66,11 @@ class CPWL_ListBox : public CPWL_Wnd {
void SetFontSize(float fFontSize) override;
float GetFontSize() const override;
- virtual CFX_WideString GetText() const;
+ virtual WideString GetText() const;
bool OnNotifySelectionChanged(bool bKeyDown, uint32_t nFlag);
- void AddString(const CFX_WideString& str);
+ void AddString(const WideString& str);
void SetTopVisibleIndex(int32_t nItemIndex);
void ScrollToListItem(int32_t nItemIndex);
void ResetContent();
diff --git a/fpdfsdk/pwl/cpwl_list_impl.cpp b/fpdfsdk/pwl/cpwl_list_impl.cpp
index 94e0606941..da455d06cb 100644
--- a/fpdfsdk/pwl/cpwl_list_impl.cpp
+++ b/fpdfsdk/pwl/cpwl_list_impl.cpp
@@ -29,7 +29,7 @@ void CPWL_ListCtrl::Item::SetFontMap(IPVT_FontMap* pFontMap) {
m_pEdit->SetFontMap(pFontMap);
}
-void CPWL_ListCtrl::Item::SetText(const CFX_WideString& text) {
+void CPWL_ListCtrl::Item::SetText(const WideString& text) {
m_pEdit->SetText(text);
}
@@ -49,7 +49,7 @@ uint16_t CPWL_ListCtrl::Item::GetFirstChar() const {
return word.Word;
}
-CFX_WideString CPWL_ListCtrl::Item::GetText() const {
+WideString CPWL_ListCtrl::Item::GetText() const {
return m_pEdit->GetText();
}
@@ -310,7 +310,7 @@ CFX_FloatRect CPWL_ListCtrl::GetItemRectInternal(int32_t nIndex) const {
return InnerToOuter(rcItem);
}
-void CPWL_ListCtrl::AddString(const CFX_WideString& str) {
+void CPWL_ListCtrl::AddString(const WideString& str) {
AddItem(str);
ReArrange(GetCount() - 1);
}
@@ -551,13 +551,13 @@ int32_t CPWL_ListCtrl::GetItemIndex(const CFX_PointF& point) const {
return -1;
}
-CFX_WideString CPWL_ListCtrl::GetText() const {
+WideString CPWL_ListCtrl::GetText() const {
if (IsMultipleSel())
return GetItemText(m_nCaretIndex);
return GetItemText(m_nSelItem);
}
-void CPWL_ListCtrl::AddItem(const CFX_WideString& str) {
+void CPWL_ListCtrl::AddItem(const WideString& str) {
auto pListItem = pdfium::MakeUnique<Item>();
pListItem->SetFontMap(m_pFontMap.Get());
pListItem->SetFontSize(m_fFontSize);
@@ -630,7 +630,7 @@ bool CPWL_ListCtrl::IsValid(int32_t nItemIndex) const {
return pdfium::IndexInBounds(m_ListItems, nItemIndex);
}
-CFX_WideString CPWL_ListCtrl::GetItemText(int32_t nIndex) const {
+WideString CPWL_ListCtrl::GetItemText(int32_t nIndex) const {
if (pdfium::IndexInBounds(m_ListItems, nIndex) && m_ListItems[nIndex])
return m_ListItems[nIndex]->GetText();
return L"";
diff --git a/fpdfsdk/pwl/cpwl_list_impl.h b/fpdfsdk/pwl/cpwl_list_impl.h
index 9bb0d2969c..18ca0a3a15 100644
--- a/fpdfsdk/pwl/cpwl_list_impl.h
+++ b/fpdfsdk/pwl/cpwl_list_impl.h
@@ -68,13 +68,13 @@ class CPWL_ListCtrl {
CFX_FloatRect GetContentRect() const;
int32_t GetItemIndex(const CFX_PointF& point) const;
- void AddString(const CFX_WideString& str);
+ void AddString(const WideString& str);
void SetTopItem(int32_t nIndex);
void Select(int32_t nItemIndex);
void SetCaret(int32_t nItemIndex);
void Empty();
void Cancel();
- CFX_WideString GetText() const;
+ WideString GetText() const;
void SetFontMap(IPVT_FontMap* pFontMap) { m_pFontMap = pFontMap; }
void SetFontSize(float fFontSize) { m_fFontSize = fFontSize; }
@@ -102,9 +102,9 @@ class CPWL_ListCtrl {
void SetRect(const CFX_FloatRect& rect) { m_rcListItem = rect; }
void SetSelect(bool bSelected) { m_bSelected = bSelected; }
- void SetText(const CFX_WideString& text);
+ void SetText(const WideString& text);
void SetFontSize(float fFontSize);
- CFX_WideString GetText() const;
+ WideString GetText() const;
CFX_FloatRect GetRect() const { return m_rcListItem; }
bool IsSelected() const { return m_bSelected; }
@@ -142,8 +142,8 @@ class CPWL_ListCtrl {
bool IsItemVisible(int32_t nItemIndex) const;
void SetScrollInfo();
void SetScrollPosY(float fy);
- void AddItem(const CFX_WideString& str);
- CFX_WideString GetItemText(int32_t nIndex) const;
+ void AddItem(const WideString& str);
+ WideString GetItemText(int32_t nIndex) const;
void SetItemSelect(int32_t nItemIndex, bool bSelected);
int32_t GetLastSelected() const;
CFX_PointF GetBTPoint() const {
diff --git a/fpdfsdk/pwl/cpwl_scroll_bar.cpp b/fpdfsdk/pwl/cpwl_scroll_bar.cpp
index 15247293a0..e50f778943 100644
--- a/fpdfsdk/pwl/cpwl_scroll_bar.cpp
+++ b/fpdfsdk/pwl/cpwl_scroll_bar.cpp
@@ -127,7 +127,7 @@ CPWL_SBButton::CPWL_SBButton(PWL_SCROLLBAR_TYPE eScrollBarType,
CPWL_SBButton::~CPWL_SBButton() {}
-CFX_ByteString CPWL_SBButton::GetClassName() const {
+ByteString CPWL_SBButton::GetClassName() const {
return "CPWL_SBButton";
}
@@ -325,7 +325,7 @@ CPWL_ScrollBar::CPWL_ScrollBar(PWL_SCROLLBAR_TYPE sbType)
CPWL_ScrollBar::~CPWL_ScrollBar() {}
-CFX_ByteString CPWL_ScrollBar::GetClassName() const {
+ByteString CPWL_ScrollBar::GetClassName() const {
return "CPWL_ScrollBar";
}
diff --git a/fpdfsdk/pwl/cpwl_scroll_bar.h b/fpdfsdk/pwl/cpwl_scroll_bar.h
index 44c72cbbe2..48aef16e38 100644
--- a/fpdfsdk/pwl/cpwl_scroll_bar.h
+++ b/fpdfsdk/pwl/cpwl_scroll_bar.h
@@ -49,7 +49,7 @@ class CPWL_SBButton : public CPWL_Wnd {
~CPWL_SBButton() override;
// CPWL_Wnd
- CFX_ByteString GetClassName() const override;
+ ByteString GetClassName() const override;
void OnCreate(CreateParams* pParamsToAdjust) override;
void DrawThisAppearance(CFX_RenderDevice* pDevice,
const CFX_Matrix& mtUser2Device) override;
@@ -121,7 +121,7 @@ class CPWL_ScrollBar : public CPWL_Wnd {
~CPWL_ScrollBar() override;
// CPWL_Wnd:
- CFX_ByteString GetClassName() const override;
+ ByteString GetClassName() const override;
void OnCreate(CreateParams* pParamsToAdjust) override;
void OnDestroy() override;
void RePosChildWnd() override;
diff --git a/fpdfsdk/pwl/cpwl_special_button.cpp b/fpdfsdk/pwl/cpwl_special_button.cpp
index 53f7f2c1d0..ddca67e5d1 100644
--- a/fpdfsdk/pwl/cpwl_special_button.cpp
+++ b/fpdfsdk/pwl/cpwl_special_button.cpp
@@ -12,7 +12,7 @@ CPWL_PushButton::CPWL_PushButton() {}
CPWL_PushButton::~CPWL_PushButton() {}
-CFX_ByteString CPWL_PushButton::GetClassName() const {
+ByteString CPWL_PushButton::GetClassName() const {
return "CPWL_PushButton";
}
@@ -25,7 +25,7 @@ CPWL_CheckBox::CPWL_CheckBox() : m_bChecked(false) {}
CPWL_CheckBox::~CPWL_CheckBox() {}
-CFX_ByteString CPWL_CheckBox::GetClassName() const {
+ByteString CPWL_CheckBox::GetClassName() const {
return "CPWL_CheckBox";
}
@@ -54,7 +54,7 @@ CPWL_RadioButton::CPWL_RadioButton() : m_bChecked(false) {}
CPWL_RadioButton::~CPWL_RadioButton() {}
-CFX_ByteString CPWL_RadioButton::GetClassName() const {
+ByteString CPWL_RadioButton::GetClassName() const {
return "CPWL_RadioButton";
}
diff --git a/fpdfsdk/pwl/cpwl_special_button.h b/fpdfsdk/pwl/cpwl_special_button.h
index b499542795..076b5298ed 100644
--- a/fpdfsdk/pwl/cpwl_special_button.h
+++ b/fpdfsdk/pwl/cpwl_special_button.h
@@ -15,7 +15,7 @@ class CPWL_PushButton : public CPWL_Button {
~CPWL_PushButton() override;
// CPWL_Button
- CFX_ByteString GetClassName() const override;
+ ByteString GetClassName() const override;
CFX_FloatRect GetFocusRect() const override;
};
@@ -25,7 +25,7 @@ class CPWL_CheckBox : public CPWL_Button {
~CPWL_CheckBox() override;
// CPWL_Button
- CFX_ByteString GetClassName() const override;
+ ByteString GetClassName() const override;
bool OnLButtonUp(const CFX_PointF& point, uint32_t nFlag) override;
bool OnChar(uint16_t nChar, uint32_t nFlag) override;
@@ -42,7 +42,7 @@ class CPWL_RadioButton : public CPWL_Button {
~CPWL_RadioButton() override;
// CPWL_Button
- CFX_ByteString GetClassName() const override;
+ ByteString GetClassName() const override;
bool OnLButtonUp(const CFX_PointF& point, uint32_t nFlag) override;
bool OnChar(uint16_t nChar, uint32_t nFlag) override;
diff --git a/fpdfsdk/pwl/cpwl_wnd.cpp b/fpdfsdk/pwl/cpwl_wnd.cpp
index 401fed3f9c..1c1512e296 100644
--- a/fpdfsdk/pwl/cpwl_wnd.cpp
+++ b/fpdfsdk/pwl/cpwl_wnd.cpp
@@ -146,7 +146,7 @@ CPWL_Wnd::~CPWL_Wnd() {
ASSERT(!m_bCreated);
}
-CFX_ByteString CPWL_Wnd::GetClassName() const {
+ByteString CPWL_Wnd::GetClassName() const {
return "CPWL_Wnd";
}
@@ -361,11 +361,11 @@ PWL_IMPLEMENT_MOUSE_METHOD(OnRButtonUp)
PWL_IMPLEMENT_MOUSE_METHOD(OnMouseMove)
#undef PWL_IMPLEMENT_MOUSE_METHOD
-CFX_WideString CPWL_Wnd::GetSelectedText() {
- return CFX_WideString();
+WideString CPWL_Wnd::GetSelectedText() {
+ return WideString();
}
-void CPWL_Wnd::ReplaceSelection(const CFX_WideString& text) {}
+void CPWL_Wnd::ReplaceSelection(const WideString& text) {}
bool CPWL_Wnd::OnMouseWheel(short zDelta,
const CFX_PointF& point,
diff --git a/fpdfsdk/pwl/cpwl_wnd.h b/fpdfsdk/pwl/cpwl_wnd.h
index 2fd5077a86..17ed06450a 100644
--- a/fpdfsdk/pwl/cpwl_wnd.h
+++ b/fpdfsdk/pwl/cpwl_wnd.h
@@ -152,7 +152,7 @@ class CPWL_Wnd : public CPWL_TimerHandler, public CFX_Observable<CPWL_Wnd> {
CPWL_Wnd();
~CPWL_Wnd() override;
- virtual CFX_ByteString GetClassName() const;
+ virtual ByteString GetClassName() const;
virtual void InvalidateRect(CFX_FloatRect* pRect);
virtual bool OnKeyDown(uint16_t nChar, uint32_t nFlag);
@@ -179,8 +179,8 @@ class CPWL_Wnd : public CPWL_TimerHandler, public CFX_Observable<CPWL_Wnd> {
virtual void SetFontSize(float fFontSize);
virtual float GetFontSize() const;
- virtual CFX_WideString GetSelectedText();
- virtual void ReplaceSelection(const CFX_WideString& text);
+ virtual WideString GetSelectedText();
+ virtual void ReplaceSelection(const WideString& text);
virtual CFX_FloatRect GetFocusRect() const;
virtual CFX_FloatRect GetClientRect() const;