diff options
author | tsepez <tsepez@chromium.org> | 2016-05-13 17:51:27 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-05-13 17:51:27 -0700 |
commit | 71a452f8ce12e31cc4e0d8c7878567b0c7fc63c2 (patch) | |
tree | a0ee545eb67b14f9398df98196d88e5150893ce8 /core/fpdfdoc/cpvt_generateap.cpp | |
parent | afe94306e3c542f0d499e7f7706ee5dec4028d8a (diff) | |
download | pdfium-71a452f8ce12e31cc4e0d8c7878567b0c7fc63c2.tar.xz |
Make CFX_ByteString(const CFX_ByteStringC&) explicit.
Add missing helper function to CFX_ByteTextBuf to avoid the
anti-pattern CFX_ByteString(sBuf.AsStringC()), using the name
"Make" to indicate there's an allocation going on in this case.
Change some method arguments to take pre-existing ByteStrings where
possible.
Review-Url: https://codereview.chromium.org/1977093002
Diffstat (limited to 'core/fpdfdoc/cpvt_generateap.cpp')
-rw-r--r-- | core/fpdfdoc/cpvt_generateap.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/core/fpdfdoc/cpvt_generateap.cpp b/core/fpdfdoc/cpvt_generateap.cpp index 2fc0644bcc..adaee6363e 100644 --- a/core/fpdfdoc/cpvt_generateap.cpp +++ b/core/fpdfdoc/cpvt_generateap.cpp @@ -38,7 +38,7 @@ FX_BOOL GenerateWidgetAP(CPDF_Document* pDoc, CPDF_SimpleParser syntax(DA.AsStringC()); syntax.FindTagParamFromStart("Tf", 2); - CFX_ByteString sFontName = syntax.GetWord(); + CFX_ByteString sFontName(syntax.GetWord()); sFontName = PDF_NameDecode(sFontName); if (sFontName.IsEmpty()) return FALSE; @@ -519,7 +519,7 @@ CFX_ByteString CPVT_GenerateAP::GenerateEditAP( if (bContinuous) { if (place.LineCmp(oldplace) != 0) { if (sWords.GetSize() > 0) { - sLineStream << GetWordRenderString(sWords.AsStringC()); + sLineStream << GetWordRenderString(sWords.MakeString()); sEditStream << sLineStream; sLineStream.Clear(); sWords.Clear(); @@ -544,7 +544,7 @@ CFX_ByteString CPVT_GenerateAP::GenerateEditAP( if (pIterator->GetWord(word)) { if (word.nFontIndex != nCurFontIndex) { if (sWords.GetSize() > 0) { - sLineStream << GetWordRenderString(sWords.AsStringC()); + sLineStream << GetWordRenderString(sWords.MakeString()); sWords.Clear(); } sLineStream << GetFontSetString(pFontMap, word.nFontIndex, @@ -575,11 +575,11 @@ CFX_ByteString CPVT_GenerateAP::GenerateEditAP( } } if (sWords.GetSize() > 0) { - sLineStream << GetWordRenderString(sWords.AsStringC()); + sLineStream << GetWordRenderString(sWords.MakeString()); sEditStream << sLineStream; sWords.Clear(); } - return sEditStream.AsStringC(); + return sEditStream.MakeString(); } // Static. @@ -687,7 +687,7 @@ CFX_ByteString CPVT_GenerateAP::GenerateBorderAP( break; } } - return sAppStream.AsStringC(); + return sAppStream.MakeString(); } // Static. @@ -712,7 +712,7 @@ CFX_ByteString CPVT_GenerateAP::GenerateColorAP(const CPVT_Color& color, case CPVT_Color::kTransparent: break; } - return sColorStream.AsStringC(); + return sColorStream.MakeString(); } // Static. @@ -760,5 +760,5 @@ CFX_ByteString CPVT_GenerateAP::GetFontSetString(IPVT_FontMap* pFontMap, if (sFontAlias.GetLength() > 0 && fFontSize > 0) sRet << "/" << sFontAlias << " " << fFontSize << " Tf\n"; } - return sRet.AsStringC(); + return sRet.MakeString(); } |