summaryrefslogtreecommitdiff
path: root/core/fpdfdoc/cpdf_defaultappearance.cpp
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 /core/fpdfdoc/cpdf_defaultappearance.cpp
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 'core/fpdfdoc/cpdf_defaultappearance.cpp')
-rw-r--r--core/fpdfdoc/cpdf_defaultappearance.cpp41
1 files changed, 20 insertions, 21 deletions
diff --git a/core/fpdfdoc/cpdf_defaultappearance.cpp b/core/fpdfdoc/cpdf_defaultappearance.cpp
index 28213aa33b..bd7ea1bc07 100644
--- a/core/fpdfdoc/cpdf_defaultappearance.cpp
+++ b/core/fpdfdoc/cpdf_defaultappearance.cpp
@@ -16,16 +16,16 @@ bool CPDF_DefaultAppearance::HasFont() {
if (m_csDA.IsEmpty())
return false;
- CPDF_SimpleParser syntax(m_csDA.AsStringC());
+ CPDF_SimpleParser syntax(m_csDA.AsStringView());
return syntax.FindTagParamFromStart("Tf", 2);
}
-CFX_ByteString CPDF_DefaultAppearance::GetFontString() {
- CFX_ByteString csFont;
+ByteString CPDF_DefaultAppearance::GetFontString() {
+ ByteString csFont;
if (m_csDA.IsEmpty())
return csFont;
- CPDF_SimpleParser syntax(m_csDA.AsStringC());
+ CPDF_SimpleParser syntax(m_csDA.AsStringView());
if (syntax.FindTagParamFromStart("Tf", 2)) {
csFont += syntax.GetWord();
csFont += " ";
@@ -36,15 +36,15 @@ CFX_ByteString CPDF_DefaultAppearance::GetFontString() {
return csFont;
}
-CFX_ByteString CPDF_DefaultAppearance::GetFont(float* fFontSize) {
+ByteString CPDF_DefaultAppearance::GetFont(float* fFontSize) {
*fFontSize = 0.0f;
if (m_csDA.IsEmpty())
- return CFX_ByteString();
+ return ByteString();
- CFX_ByteString csFontNameTag;
- CPDF_SimpleParser syntax(m_csDA.AsStringC());
+ ByteString csFontNameTag;
+ CPDF_SimpleParser syntax(m_csDA.AsStringView());
if (syntax.FindTagParamFromStart("Tf", 2)) {
- csFontNameTag = CFX_ByteString(syntax.GetWord());
+ csFontNameTag = ByteString(syntax.GetWord());
csFontNameTag.Delete(0, 1);
*fFontSize = FX_atof(syntax.GetWord());
}
@@ -55,7 +55,7 @@ bool CPDF_DefaultAppearance::HasColor(PaintOperation nOperation) {
if (m_csDA.IsEmpty())
return false;
- CPDF_SimpleParser syntax(m_csDA.AsStringC());
+ CPDF_SimpleParser syntax(m_csDA.AsStringView());
if (syntax.FindTagParamFromStart(
(nOperation == PaintOperation::STROKE ? "G" : "g"), 1)) {
return true;
@@ -68,13 +68,12 @@ bool CPDF_DefaultAppearance::HasColor(PaintOperation nOperation) {
(nOperation == PaintOperation::STROKE ? "K" : "k"), 4);
}
-CFX_ByteString CPDF_DefaultAppearance::GetColorString(
- PaintOperation nOperation) {
- CFX_ByteString csColor;
+ByteString CPDF_DefaultAppearance::GetColorString(PaintOperation nOperation) {
+ ByteString csColor;
if (m_csDA.IsEmpty())
return csColor;
- CPDF_SimpleParser syntax(m_csDA.AsStringC());
+ CPDF_SimpleParser syntax(m_csDA.AsStringView());
if (syntax.FindTagParamFromStart(
(nOperation == PaintOperation::STROKE ? "G" : "g"), 1)) {
csColor += syntax.GetWord();
@@ -118,7 +117,7 @@ void CPDF_DefaultAppearance::GetColor(int& iColorType,
if (m_csDA.IsEmpty())
return;
- CPDF_SimpleParser syntax(m_csDA.AsStringC());
+ CPDF_SimpleParser syntax(m_csDA.AsStringView());
if (syntax.FindTagParamFromStart(
(nOperation == PaintOperation::STROKE ? "G" : "g"), 1)) {
iColorType = COLORTYPE_GRAY;
@@ -151,7 +150,7 @@ void CPDF_DefaultAppearance::GetColor(FX_ARGB& color,
if (m_csDA.IsEmpty())
return;
- CPDF_SimpleParser syntax(m_csDA.AsStringC());
+ CPDF_SimpleParser syntax(m_csDA.AsStringView());
if (syntax.FindTagParamFromStart(
(nOperation == PaintOperation::STROKE ? "G" : "g"), 1)) {
iColorType = COLORTYPE_GRAY;
@@ -187,16 +186,16 @@ bool CPDF_DefaultAppearance::HasTextMatrix() {
if (m_csDA.IsEmpty())
return false;
- CPDF_SimpleParser syntax(m_csDA.AsStringC());
+ CPDF_SimpleParser syntax(m_csDA.AsStringView());
return syntax.FindTagParamFromStart("Tm", 6);
}
-CFX_ByteString CPDF_DefaultAppearance::GetTextMatrixString() {
- CFX_ByteString csTM;
+ByteString CPDF_DefaultAppearance::GetTextMatrixString() {
+ ByteString csTM;
if (m_csDA.IsEmpty())
return csTM;
- CPDF_SimpleParser syntax(m_csDA.AsStringC());
+ CPDF_SimpleParser syntax(m_csDA.AsStringView());
if (syntax.FindTagParamFromStart("Tm", 6)) {
for (int i = 0; i < 6; i++) {
csTM += syntax.GetWord();
@@ -211,7 +210,7 @@ CFX_Matrix CPDF_DefaultAppearance::GetTextMatrix() {
if (m_csDA.IsEmpty())
return CFX_Matrix();
- CPDF_SimpleParser syntax(m_csDA.AsStringC());
+ CPDF_SimpleParser syntax(m_csDA.AsStringView());
if (!syntax.FindTagParamFromStart("Tm", 6))
return CFX_Matrix();