Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(395)

Unified Diff: fpdfsdk/javascript/Field.cpp

Issue 2323493002: Pass CFX_WideString further down widget callers (Closed)
Patch Set: Fix comments Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « fpdfsdk/include/cpdfsdk_widget.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: fpdfsdk/javascript/Field.cpp
diff --git a/fpdfsdk/javascript/Field.cpp b/fpdfsdk/javascript/Field.cpp
index a788fb203b6583ed49cd2a2ba45150a64198c810..9ecdec693609d4a5e4ca62d796f832c79b4952de 100644
--- a/fpdfsdk/javascript/Field.cpp
+++ b/fpdfsdk/javascript/Field.cpp
@@ -275,7 +275,7 @@ void Field::UpdateFormField(CPDFSDK_Document* pDocument,
static_cast<CPDFSDK_Widget*>(pAnnot)->OnFormat(bFormatted);
if (pAnnot) {
static_cast<CPDFSDK_Widget*>(pAnnot)->ResetAppearance(
- bFormatted ? sValue.c_str() : nullptr, FALSE);
+ bFormatted ? &sValue : nullptr, FALSE);
}
}
} else {
@@ -319,10 +319,7 @@ void Field::UpdateFormControl(CPDFSDK_Document* pDocument,
nFieldType == FIELDTYPE_TEXTFIELD) {
FX_BOOL bFormatted = FALSE;
CFX_WideString sValue = pWidget->OnFormat(bFormatted);
- if (bFormatted)
- pWidget->ResetAppearance(sValue.c_str(), FALSE);
- else
- pWidget->ResetAppearance(nullptr, FALSE);
+ pWidget->ResetAppearance(bFormatted ? &sValue : nullptr, FALSE);
} else {
pWidget->ResetAppearance(nullptr, FALSE);
}
« no previous file with comments | « fpdfsdk/include/cpdfsdk_widget.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698