summaryrefslogtreecommitdiff
path: root/fpdfsdk
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2017-11-21 18:07:00 +0000
committerChromium commit bot <commit-bot@chromium.org>2017-11-21 18:07:00 +0000
commit135c6601bd9d12bd935371d3122f8e75391de75b (patch)
tree185227ece2aa6cceb58911d2b25871dab4860251 /fpdfsdk
parentf276e78e190e04b25c3f05b35a28ecdd30bdcf21 (diff)
downloadpdfium-135c6601bd9d12bd935371d3122f8e75391de75b.tar.xz
Add {Byte/Wide}String::Trim().
So callers no longer have to call str.TrimLeft(); str.TrimRight(); Change-Id: If931eaa8d891f487b9618ebbeee5ee294e807846 Reviewed-on: https://pdfium-review.googlesource.com/18990 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'fpdfsdk')
-rw-r--r--fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp b/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp
index bc6c7dbe13..2c13b92d4e 100644
--- a/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp
+++ b/fpdfsdk/fpdfxfa/cpdfxfa_docenvironment.cpp
@@ -853,20 +853,17 @@ bool CPDFXFA_DocEnvironment::MailToInfo(WideString& csURL,
tmp = srcURL.Left(pos.value());
tmp = tmp.Right(tmp.GetLength() - 7);
}
- tmp.TrimLeft();
- tmp.TrimRight();
+ tmp.Trim();
csToAddress = tmp;
srcURL = srcURL.Right(srcURL.GetLength() - (pos.value() + 1));
while (!srcURL.IsEmpty()) {
- srcURL.TrimLeft();
- srcURL.TrimRight();
+ srcURL.Trim();
pos = srcURL.Find(L'&');
tmp = (!pos.has_value()) ? srcURL : srcURL.Left(pos.value());
- tmp.TrimLeft();
- tmp.TrimRight();
+ tmp.Trim();
if (tmp.GetLength() >= 3 && tmp.Left(3).CompareNoCase(L"cc=") == 0) {
tmp = tmp.Right(tmp.GetLength() - 3);
if (!csCCAddress.IsEmpty())
@@ -922,8 +919,7 @@ bool CPDFXFA_DocEnvironment::SubmitDataInternal(CXFA_FFDoc* hDoc,
case XFA_ATTRIBUTEENUM_Xdp: {
WideString csContent;
submitData.GetSubmitXDPContent(csContent);
- csContent.TrimLeft();
- csContent.TrimRight();
+ csContent.Trim();
WideString space;
space.FromLocal(" ");
csContent = space + csContent + space;