summaryrefslogtreecommitdiff
path: root/fpdfsdk/cpdfsdk_widget.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 /fpdfsdk/cpdfsdk_widget.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 'fpdfsdk/cpdfsdk_widget.cpp')
-rw-r--r--fpdfsdk/cpdfsdk_widget.cpp18
1 files changed, 7 insertions, 11 deletions
diff --git a/fpdfsdk/cpdfsdk_widget.cpp b/fpdfsdk/cpdfsdk_widget.cpp
index e65a94b2b3..5f0bf1dc17 100644
--- a/fpdfsdk/cpdfsdk_widget.cpp
+++ b/fpdfsdk/cpdfsdk_widget.cpp
@@ -588,10 +588,8 @@ bool CPDFSDK_Widget::GetTextColor(FX_COLORREF& color) const {
float CPDFSDK_Widget::GetFontSize() const {
CPDF_FormControl* pFormCtrl = GetFormControl();
CPDF_DefaultAppearance pDa = pFormCtrl->GetDefaultAppearance();
- CFX_ByteString csFont = "";
- float fFontSize = 0.0f;
- pDa.GetFont(csFont, fFontSize);
-
+ float fFontSize;
+ pDa.GetFont(&fFontSize);
return fFontSize;
}
@@ -930,21 +928,20 @@ void CPDFSDK_Widget::ResetAppearance_PushButton() {
CPWL_Color crText(COLORTYPE_GRAY, 0);
- float fFontSize = 12.0f;
CFX_ByteString csNameTag;
-
CPDF_DefaultAppearance da = pControl->GetDefaultAppearance();
if (da.HasColor()) {
da.GetColor(iColorType, fc);
crText = CPWL_Color(iColorType, fc[0], fc[1], fc[2], fc[3]);
}
-
+ float fFontSize = 12.0f;
if (da.HasFont())
- da.GetFont(csNameTag, fFontSize);
+ csNameTag = da.GetFont(&fFontSize);
CFX_WideString csWCaption;
- CFX_WideString csNormalCaption, csRolloverCaption, csDownCaption;
-
+ CFX_WideString csNormalCaption;
+ CFX_WideString csRolloverCaption;
+ CFX_WideString csDownCaption;
if (pControl->HasMKEntry("CA"))
csNormalCaption = pControl->GetNormalCaption();
@@ -957,7 +954,6 @@ void CPDFSDK_Widget::ResetAppearance_PushButton() {
CPDF_Stream* pNormalIcon = nullptr;
CPDF_Stream* pRolloverIcon = nullptr;
CPDF_Stream* pDownIcon = nullptr;
-
if (pControl->HasMKEntry("I"))
pNormalIcon = pControl->GetNormalIcon();