summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdfformfill.cpp
diff options
context:
space:
mode:
authorRyan Harrison <rharrison@chromium.org>2017-09-18 14:23:18 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-09-18 18:40:16 +0000
commit275e260a6cd4a8e506ba974feb85ebcd926c1739 (patch)
tree2029b9158ec044764ceff122fe5fb5d0a3f123d1 /fpdfsdk/fpdfformfill.cpp
parent450fbeaaabf1ab340c1018de2e58f1950657517e (diff)
downloadpdfium-275e260a6cd4a8e506ba974feb85ebcd926c1739.tar.xz
Convert string class names
Automated using git grep & sed. Replace StringC classes with StringView classes. Remove the CFX_ prefix and put string classes in fxcrt namespace. Change AsStringC() to AsStringView(). Rename tests from TEST(fxcrt, *String*Foo) to TEST(*String*, Foo). Couple of tests needed to have their names regularlized. BUG=pdfium:894 Change-Id: I7ca038685c8d803795f3ed02545124f7a224c83d Reviewed-on: https://pdfium-review.googlesource.com/14151 Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'fpdfsdk/fpdfformfill.cpp')
-rw-r--r--fpdfsdk/fpdfformfill.cpp34
1 files changed, 17 insertions, 17 deletions
diff --git a/fpdfsdk/fpdfformfill.cpp b/fpdfsdk/fpdfformfill.cpp
index 1b5cc483a8..77cba50c7c 100644
--- a/fpdfsdk/fpdfformfill.cpp
+++ b/fpdfsdk/fpdfformfill.cpp
@@ -66,11 +66,11 @@ CPDFSDK_PageView* FormHandleToPageView(FPDF_FORMHANDLE hHandle,
}
#ifdef PDF_ENABLE_XFA
-std::vector<CFX_ByteString>* FromFPDFStringHandle(FPDF_STRINGHANDLE handle) {
- return static_cast<std::vector<CFX_ByteString>*>(handle);
+std::vector<ByteString>* FromFPDFStringHandle(FPDF_STRINGHANDLE handle) {
+ return static_cast<std::vector<ByteString>*>(handle);
}
-FPDF_STRINGHANDLE ToFPDFStringHandle(std::vector<CFX_ByteString>* strings) {
+FPDF_STRINGHANDLE ToFPDFStringHandle(std::vector<ByteString>* strings) {
return static_cast<FPDF_STRINGHANDLE>(strings);
}
#endif // PDF_ENABLE_XFA
@@ -387,8 +387,8 @@ FORM_GetSelectedText(FPDF_FORMHANDLE hHandle,
if (!pPageView)
return 0;
- CFX_WideString wide_str_form_text = pPageView->GetSelectedText();
- CFX_ByteString encoded_form_text = wide_str_form_text.UTF16LE_Encode();
+ WideString wide_str_form_text = pPageView->GetSelectedText();
+ ByteString encoded_form_text = wide_str_form_text.UTF16LE_Encode();
unsigned long form_text_len = encoded_form_text.GetLength();
if (buffer && buflen >= form_text_len)
@@ -404,8 +404,8 @@ FPDF_EXPORT void FPDF_CALLCONV FORM_ReplaceSelection(FPDF_FORMHANDLE hHandle,
if (!pPageView)
return;
- FX_STRSIZE len = CFX_WideString::WStringLength(wsText);
- CFX_WideString wide_str_text = CFX_WideString::FromUTF16LE(wsText, len);
+ FX_STRSIZE len = WideString::WStringLength(wsText);
+ WideString wide_str_text = WideString::FromUTF16LE(wsText, len);
pPageView->ReplaceSelection(wide_str_text);
}
@@ -500,10 +500,10 @@ FPDF_EXPORT void FPDF_CALLCONV FPDF_Widget_Copy(FPDF_DOCUMENT document,
pContext->GetDocType() != XFA_DocType::Static)
return;
- CFX_WideString wsCpText;
+ WideString wsCpText;
static_cast<CXFA_FFWidget*>(hWidget)->Copy(wsCpText);
- CFX_ByteString bsCpText = wsCpText.UTF16LE_Encode();
+ ByteString bsCpText = wsCpText.UTF16LE_Encode();
uint32_t len = bsCpText.GetLength() / sizeof(unsigned short);
if (!wsText) {
*size = len;
@@ -532,10 +532,10 @@ FPDF_EXPORT void FPDF_CALLCONV FPDF_Widget_Cut(FPDF_DOCUMENT document,
pContext->GetDocType() != XFA_DocType::Static)
return;
- CFX_WideString wsCpText;
+ WideString wsCpText;
static_cast<CXFA_FFWidget*>(hWidget)->Cut(wsCpText);
- CFX_ByteString bsCpText = wsCpText.UTF16LE_Encode();
+ ByteString bsCpText = wsCpText.UTF16LE_Encode();
uint32_t len = bsCpText.GetLength() / sizeof(unsigned short);
if (!wsText) {
*size = len;
@@ -564,7 +564,7 @@ FPDF_EXPORT void FPDF_CALLCONV FPDF_Widget_Paste(FPDF_DOCUMENT document,
pContext->GetDocType() != XFA_DocType::Static)
return;
- CFX_WideString wstr = CFX_WideString::FromUTF16LE(wsText, size);
+ WideString wstr = WideString::FromUTF16LE(wsText, size);
static_cast<CXFA_FFWidget*>(hWidget)->Paste(wstr);
}
@@ -585,7 +585,7 @@ FPDF_Widget_ReplaceSpellCheckWord(FPDF_DOCUMENT document,
CFX_PointF ptPopup;
ptPopup.x = x;
ptPopup.y = y;
- CFX_ByteStringC bs(bsText);
+ ByteStringView bs(bsText);
static_cast<CXFA_FFWidget*>(hWidget)->ReplaceSpellCheckWord(ptPopup, bs);
}
@@ -606,7 +606,7 @@ FPDF_Widget_GetSpellCheckWords(FPDF_DOCUMENT document,
CFX_PointF ptPopup;
ptPopup.x = x;
ptPopup.y = y;
- auto sSuggestWords = pdfium::MakeUnique<std::vector<CFX_ByteString>>();
+ auto sSuggestWords = pdfium::MakeUnique<std::vector<ByteString>>();
static_cast<CXFA_FFWidget*>(hWidget)->GetSuggestWords(ptPopup,
sSuggestWords.get());
@@ -616,7 +616,7 @@ FPDF_Widget_GetSpellCheckWords(FPDF_DOCUMENT document,
FPDF_EXPORT int FPDF_CALLCONV
FPDF_StringHandleCounts(FPDF_STRINGHANDLE sHandle) {
- std::vector<CFX_ByteString>* sSuggestWords = FromFPDFStringHandle(sHandle);
+ std::vector<ByteString>* sSuggestWords = FromFPDFStringHandle(sHandle);
return sSuggestWords ? pdfium::CollectionSize<int>(*sSuggestWords) : -1;
}
@@ -632,7 +632,7 @@ FPDF_StringHandleGetStringByIndex(FPDF_STRINGHANDLE sHandle,
if (index < 0 || index >= count)
return false;
- std::vector<CFX_ByteString>* sSuggestWords = FromFPDFStringHandle(sHandle);
+ std::vector<ByteString>* sSuggestWords = FromFPDFStringHandle(sHandle);
uint32_t len = (*sSuggestWords)[index].GetLength();
if (!bsText) {
*size = len;
@@ -658,7 +658,7 @@ FPDF_StringHandleAddString(FPDF_STRINGHANDLE stringHandle,
if (!stringHandle || !bsText || size == 0)
return false;
- FromFPDFStringHandle(stringHandle)->push_back(CFX_ByteString(bsText, size));
+ FromFPDFStringHandle(stringHandle)->push_back(ByteString(bsText, size));
return true;
}
#endif // PDF_ENABLE_XFA