summaryrefslogtreecommitdiff
path: root/core/fpdfdoc/cpdf_defaultappearance.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2017-04-07 13:56:13 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-04-07 21:16:15 +0000
commitc4a2b7518949df00651aa3513c93079f1968441e (patch)
tree6befb2de2d0b8222cbc68f3c1cee99a20bea1cd0 /core/fpdfdoc/cpdf_defaultappearance.cpp
parent1835a6fb98286817cdf656f4d1e223bd85ee378f (diff)
downloadpdfium-c4a2b7518949df00651aa3513c93079f1968441e.tar.xz
Cleanup string passing in core/fpdf*
Return strings where possible. Add missing consts to strings passed by ref. Convert non-const cases to pointers. Rename a few methods to be clearer. Change-Id: I86569bc1744f539e6dd67fc73649b272c016328c Reviewed-on: https://pdfium-review.googlesource.com/3951 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Nicolás Peña <npm@chromium.org>
Diffstat (limited to 'core/fpdfdoc/cpdf_defaultappearance.cpp')
-rw-r--r--core/fpdfdoc/cpdf_defaultappearance.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/core/fpdfdoc/cpdf_defaultappearance.cpp b/core/fpdfdoc/cpdf_defaultappearance.cpp
index 1873c1ae58..28213aa33b 100644
--- a/core/fpdfdoc/cpdf_defaultappearance.cpp
+++ b/core/fpdfdoc/cpdf_defaultappearance.cpp
@@ -36,20 +36,19 @@ CFX_ByteString CPDF_DefaultAppearance::GetFontString() {
return csFont;
}
-void CPDF_DefaultAppearance::GetFont(CFX_ByteString& csFontNameTag,
- float& fFontSize) {
- csFontNameTag = "";
- fFontSize = 0;
+CFX_ByteString CPDF_DefaultAppearance::GetFont(float* fFontSize) {
+ *fFontSize = 0.0f;
if (m_csDA.IsEmpty())
- return;
+ return CFX_ByteString();
+ CFX_ByteString csFontNameTag;
CPDF_SimpleParser syntax(m_csDA.AsStringC());
if (syntax.FindTagParamFromStart("Tf", 2)) {
csFontNameTag = CFX_ByteString(syntax.GetWord());
csFontNameTag.Delete(0, 1);
- fFontSize = FX_atof(syntax.GetWord());
+ *fFontSize = FX_atof(syntax.GetWord());
}
- csFontNameTag = PDF_NameDecode(csFontNameTag);
+ return PDF_NameDecode(csFontNameTag);
}
bool CPDF_DefaultAppearance::HasColor(PaintOperation nOperation) {