summaryrefslogtreecommitdiff
path: root/fpdfsdk/javascript/PublicMethods.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/javascript/PublicMethods.cpp')
-rw-r--r--fpdfsdk/javascript/PublicMethods.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/fpdfsdk/javascript/PublicMethods.cpp b/fpdfsdk/javascript/PublicMethods.cpp
index bf84b9cd91..06ed64c7cc 100644
--- a/fpdfsdk/javascript/PublicMethods.cpp
+++ b/fpdfsdk/javascript/PublicMethods.cpp
@@ -980,11 +980,10 @@ bool CJS_PublicMethods::AFNumber_Keystroke(CJS_Runtime* pRuntime,
}
}
- CFX_WideString wprefix = wstrValue.Mid(0, pEvent->SelStart());
+ CFX_WideString wprefix = wstrValue.Left(pEvent->SelStart());
CFX_WideString wpostfix;
if (pEvent->SelEnd() < wstrValue.GetLength())
- wpostfix = wstrValue.Mid(pEvent->SelEnd(),
- wstrValue.GetLength() - pEvent->SelEnd());
+ wpostfix = wstrValue.Right(wstrValue.GetLength() - pEvent->SelEnd());
val = wprefix + wstrChange + wpostfix;
return true;
}
@@ -1532,14 +1531,13 @@ bool CJS_PublicMethods::AFMergeChange(CJS_Runtime* pRuntime,
CFX_WideString prefix, postfix;
if (pEventHandler->SelStart() >= 0)
- prefix = swValue.Mid(0, pEventHandler->SelStart());
+ prefix = swValue.Left(pEventHandler->SelStart());
else
prefix = L"";
if (pEventHandler->SelEnd() >= 0 &&
pEventHandler->SelEnd() <= swValue.GetLength())
- postfix = swValue.Mid(pEventHandler->SelEnd(),
- swValue.GetLength() - pEventHandler->SelEnd());
+ postfix = swValue.Right(swValue.GetLength() - pEventHandler->SelEnd());
else
postfix = L"";