Pass WideStringViews by value.
Bring in-line with best practices regarding views.
via:
sed -i 's/const WideStringView&/WideStringView/g' `git grep -l WideStringView`
Change-Id: I3a44b211d2da8a4e67273db4cdbe2534af2919b6
Reviewed-on: https://pdfium-review.googlesource.com/c/47290
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Tom Sepez <tsepez@chromium.org>
diff --git a/core/fxcrt/cfx_decimal.cpp b/core/fxcrt/cfx_decimal.cpp
index 65fed4e..781aff5 100644
--- a/core/fxcrt/cfx_decimal.cpp
+++ b/core/fxcrt/cfx_decimal.cpp
@@ -294,7 +294,7 @@
m_uFlags = FXMATH_DECIMAL_MAKEFLAGS(val < 0 && IsNotZero(), scale);
}
-CFX_Decimal::CFX_Decimal(const WideStringView& strObj) {
+CFX_Decimal::CFX_Decimal(WideStringView strObj) {
const wchar_t* str = strObj.unterminated_c_str();
const wchar_t* strBound = str + strObj.GetLength();
bool pointmet = false;
diff --git a/core/fxcrt/cfx_decimal.h b/core/fxcrt/cfx_decimal.h
index de6e3de..6542eee 100644
--- a/core/fxcrt/cfx_decimal.h
+++ b/core/fxcrt/cfx_decimal.h
@@ -16,7 +16,7 @@
explicit CFX_Decimal(uint64_t val);
explicit CFX_Decimal(int32_t val);
CFX_Decimal(float val, uint8_t scale);
- explicit CFX_Decimal(const WideStringView& str);
+ explicit CFX_Decimal(WideStringView str);
operator WideString() const;
operator double() const;
diff --git a/core/fxcrt/cfx_fileaccess_posix.cpp b/core/fxcrt/cfx_fileaccess_posix.cpp
index fdba53b..6dfb325 100644
--- a/core/fxcrt/cfx_fileaccess_posix.cpp
+++ b/core/fxcrt/cfx_fileaccess_posix.cpp
@@ -65,8 +65,7 @@
return m_nFD > -1;
}
-bool CFX_FileAccess_Posix::Open(const WideStringView& fileName,
- uint32_t dwMode) {
+bool CFX_FileAccess_Posix::Open(WideStringView fileName, uint32_t dwMode) {
return Open(FX_UTF8Encode(fileName).AsStringView(), dwMode);
}
diff --git a/core/fxcrt/cfx_fileaccess_posix.h b/core/fxcrt/cfx_fileaccess_posix.h
index c759d8c..cc05a5d 100644
--- a/core/fxcrt/cfx_fileaccess_posix.h
+++ b/core/fxcrt/cfx_fileaccess_posix.h
@@ -23,7 +23,7 @@
// FileAccessIface:
bool Open(const ByteStringView& fileName, uint32_t dwMode) override;
- bool Open(const WideStringView& fileName, uint32_t dwMode) override;
+ bool Open(WideStringView fileName, uint32_t dwMode) override;
void Close() override;
FX_FILESIZE GetSize() const override;
FX_FILESIZE GetPosition() const override;
diff --git a/core/fxcrt/cfx_fileaccess_windows.cpp b/core/fxcrt/cfx_fileaccess_windows.cpp
index 242c202..236dc7e 100644
--- a/core/fxcrt/cfx_fileaccess_windows.cpp
+++ b/core/fxcrt/cfx_fileaccess_windows.cpp
@@ -55,8 +55,7 @@
return !!m_hFile;
}
-bool CFX_FileAccess_Windows::Open(const WideStringView& fileName,
- uint32_t dwMode) {
+bool CFX_FileAccess_Windows::Open(WideStringView fileName, uint32_t dwMode) {
if (m_hFile)
return false;
diff --git a/core/fxcrt/cfx_fileaccess_windows.h b/core/fxcrt/cfx_fileaccess_windows.h
index 6d58409..175fb7e 100644
--- a/core/fxcrt/cfx_fileaccess_windows.h
+++ b/core/fxcrt/cfx_fileaccess_windows.h
@@ -21,7 +21,7 @@
// FileAccessIface
bool Open(const ByteStringView& fileName, uint32_t dwMode) override;
- bool Open(const WideStringView& fileName, uint32_t dwMode) override;
+ bool Open(WideStringView fileName, uint32_t dwMode) override;
void Close() override;
FX_FILESIZE GetSize() const override;
FX_FILESIZE GetPosition() const override;
diff --git a/core/fxcrt/cfx_widetextbuf.cpp b/core/fxcrt/cfx_widetextbuf.cpp
index c2af175..61e2a8d 100644
--- a/core/fxcrt/cfx_widetextbuf.cpp
+++ b/core/fxcrt/cfx_widetextbuf.cpp
@@ -25,7 +25,7 @@
return *this;
}
-CFX_WideTextBuf& CFX_WideTextBuf::operator<<(const WideStringView& str) {
+CFX_WideTextBuf& CFX_WideTextBuf::operator<<(WideStringView str) {
AppendBlock(str.unterminated_c_str(), str.GetLength() * sizeof(wchar_t));
return *this;
}
diff --git a/core/fxcrt/cfx_widetextbuf.h b/core/fxcrt/cfx_widetextbuf.h
index c4de5d3..6eaef95 100644
--- a/core/fxcrt/cfx_widetextbuf.h
+++ b/core/fxcrt/cfx_widetextbuf.h
@@ -37,7 +37,7 @@
CFX_WideTextBuf& operator<<(double f);
CFX_WideTextBuf& operator<<(const ByteStringView& ascii);
CFX_WideTextBuf& operator<<(const wchar_t* lpsz);
- CFX_WideTextBuf& operator<<(const WideStringView& str);
+ CFX_WideTextBuf& operator<<(WideStringView str);
CFX_WideTextBuf& operator<<(const WideString& str);
CFX_WideTextBuf& operator<<(const CFX_WideTextBuf& buf);
};
diff --git a/core/fxcrt/css/cfx_cssdeclaration.cpp b/core/fxcrt/css/cfx_cssdeclaration.cpp
index b2187ac..9f24019 100644
--- a/core/fxcrt/css/cfx_cssdeclaration.cpp
+++ b/core/fxcrt/css/cfx_cssdeclaration.cpp
@@ -164,7 +164,7 @@
}
void CFX_CSSDeclaration::AddProperty(const CFX_CSSData::Property* property,
- const WideStringView& value) {
+ WideStringView value) {
ASSERT(!value.IsEmpty());
const wchar_t* pszValue = value.unterminated_c_str();
diff --git a/core/fxcrt/css/cfx_cssdeclaration.h b/core/fxcrt/css/cfx_cssdeclaration.h
index 5092da4..f3d87cc 100644
--- a/core/fxcrt/css/cfx_cssdeclaration.h
+++ b/core/fxcrt/css/cfx_cssdeclaration.h
@@ -46,8 +46,7 @@
bool empty() const { return properties_.empty(); }
- void AddProperty(const CFX_CSSData::Property* property,
- const WideStringView& value);
+ void AddProperty(const CFX_CSSData::Property* property, WideStringView value);
void AddProperty(const WideString& prop, const WideString& value);
size_t PropertyCountForTesting() const;
diff --git a/core/fxcrt/css/cfx_cssselector.cpp b/core/fxcrt/css/cfx_cssselector.cpp
index 510114f..cd90f62 100644
--- a/core/fxcrt/css/cfx_cssselector.cpp
+++ b/core/fxcrt/css/cfx_cssselector.cpp
@@ -49,7 +49,7 @@
// static.
std::unique_ptr<CFX_CSSSelector> CFX_CSSSelector::FromString(
- const WideStringView& str) {
+ WideStringView str) {
ASSERT(!str.IsEmpty());
const wchar_t* psz = str.unterminated_c_str();
diff --git a/core/fxcrt/css/cfx_cssselector.h b/core/fxcrt/css/cfx_cssselector.h
index 62f8b16..14b61ee 100644
--- a/core/fxcrt/css/cfx_cssselector.h
+++ b/core/fxcrt/css/cfx_cssselector.h
@@ -15,7 +15,7 @@
class CFX_CSSSelector {
public:
- static std::unique_ptr<CFX_CSSSelector> FromString(const WideStringView& str);
+ static std::unique_ptr<CFX_CSSSelector> FromString(WideStringView str);
CFX_CSSSelector(CFX_CSSSelectorType eType,
const wchar_t* psz,
diff --git a/core/fxcrt/fileaccess_iface.h b/core/fxcrt/fileaccess_iface.h
index fdabc74..180462b 100644
--- a/core/fxcrt/fileaccess_iface.h
+++ b/core/fxcrt/fileaccess_iface.h
@@ -19,7 +19,7 @@
virtual ~FileAccessIface() = default;
virtual bool Open(const ByteStringView& fileName, uint32_t dwMode) = 0;
- virtual bool Open(const WideStringView& fileName, uint32_t dwMode) = 0;
+ virtual bool Open(WideStringView fileName, uint32_t dwMode) = 0;
virtual void Close() = 0;
virtual FX_FILESIZE GetSize() const = 0;
virtual FX_FILESIZE GetPosition() const = 0;
diff --git a/core/fxcrt/fx_string.cpp b/core/fxcrt/fx_string.cpp
index 64bcd77..58284ab 100644
--- a/core/fxcrt/fx_string.cpp
+++ b/core/fxcrt/fx_string.cpp
@@ -14,7 +14,7 @@
#include "core/fxcrt/fx_extension.h"
#include "third_party/base/compiler_specific.h"
-ByteString FX_UTF8Encode(const WideStringView& wsStr) {
+ByteString FX_UTF8Encode(WideStringView wsStr) {
size_t len = wsStr.GetLength();
const wchar_t* pStr = wsStr.unterminated_c_str();
CFX_UTF8Encoder encoder;
@@ -87,7 +87,7 @@
return bNegative ? -value : value;
}
-float StringToFloat(const WideStringView& wsStr) {
+float StringToFloat(WideStringView wsStr) {
return StringToFloat(FX_UTF8Encode(wsStr).c_str());
}
diff --git a/core/fxcrt/fx_string.h b/core/fxcrt/fx_string.h
index 8d93150..8854ec7 100644
--- a/core/fxcrt/fx_string.h
+++ b/core/fxcrt/fx_string.h
@@ -16,11 +16,11 @@
(((uint32_t)c1 << 24) | ((uint32_t)c2 << 16) | ((uint32_t)c3 << 8) | \
((uint32_t)c4))
-ByteString FX_UTF8Encode(const WideStringView& wsStr);
+ByteString FX_UTF8Encode(WideStringView wsStr);
WideString FX_UTF8Decode(const ByteStringView& bsStr);
float StringToFloat(const ByteStringView& str);
-float StringToFloat(const WideStringView& wsStr);
+float StringToFloat(WideStringView wsStr);
size_t FloatToString(float f, char* buf);
#endif // CORE_FXCRT_FX_STRING_H_
diff --git a/core/fxcrt/widestring.cpp b/core/fxcrt/widestring.cpp
index 1ba0011..5c9f0fa 100644
--- a/core/fxcrt/widestring.cpp
+++ b/core/fxcrt/widestring.cpp
@@ -343,14 +343,14 @@
WideString::WideString(const wchar_t* ptr)
: WideString(ptr, ptr ? wcslen(ptr) : 0) {}
-WideString::WideString(const WideStringView& stringSrc) {
+WideString::WideString(WideStringView stringSrc) {
if (!stringSrc.IsEmpty()) {
m_pData.Reset(StringData::Create(stringSrc.unterminated_c_str(),
stringSrc.GetLength()));
}
}
-WideString::WideString(const WideStringView& str1, const WideStringView& str2) {
+WideString::WideString(WideStringView str1, WideStringView str2) {
FX_SAFE_SIZE_T nSafeLen = str1.GetLength();
nSafeLen += str2.GetLength();
@@ -394,7 +394,7 @@
return *this;
}
-const WideString& WideString::operator=(const WideStringView& stringSrc) {
+const WideString& WideString::operator=(WideStringView stringSrc) {
if (stringSrc.IsEmpty())
clear();
else
@@ -436,7 +436,7 @@
return *this;
}
-const WideString& WideString::operator+=(const WideStringView& str) {
+const WideString& WideString::operator+=(WideStringView str) {
if (!str.IsEmpty())
Concat(str.unterminated_c_str(), str.GetLength());
@@ -454,7 +454,7 @@
wmemcmp(ptr, m_pData->m_String, m_pData->m_nDataLength) == 0;
}
-bool WideString::operator==(const WideStringView& str) const {
+bool WideString::operator==(WideStringView str) const {
if (!m_pData)
return str.IsEmpty();
@@ -482,7 +482,7 @@
return Compare(ptr) < 0;
}
-bool WideString::operator<(const WideStringView& str) const {
+bool WideString::operator<(WideStringView str) const {
if (!m_pData && !str.unterminated_c_str())
return false;
if (c_str() == str.unterminated_c_str())
@@ -757,8 +757,7 @@
: Optional<size_t>();
}
-Optional<size_t> WideString::Find(const WideStringView& subStr,
- size_t start) const {
+Optional<size_t> WideString::Find(WideStringView subStr, size_t start) const {
if (!m_pData)
return Optional<size_t>();
@@ -822,8 +821,7 @@
return count;
}
-size_t WideString::Replace(const WideStringView& pOld,
- const WideStringView& pNew) {
+size_t WideString::Replace(WideStringView pOld, WideStringView pNew) {
if (!m_pData || pOld.IsEmpty())
return 0;
@@ -974,7 +972,7 @@
TrimLeft(str);
}
-void WideString::Trim(const WideStringView& targets) {
+void WideString::Trim(WideStringView targets) {
TrimRight(targets);
TrimLeft(targets);
}
@@ -988,7 +986,7 @@
TrimLeft(str);
}
-void WideString::TrimLeft(const WideStringView& targets) {
+void WideString::TrimLeft(WideStringView targets) {
if (!m_pData || targets.IsEmpty())
return;
@@ -1026,7 +1024,7 @@
TrimRight(str);
}
-void WideString::TrimRight(const WideStringView& targets) {
+void WideString::TrimRight(WideStringView targets) {
if (IsEmpty() || targets.IsEmpty())
return;
@@ -1054,18 +1052,18 @@
return os;
}
-std::wostream& operator<<(std::wostream& os, const WideStringView& str) {
+std::wostream& operator<<(std::wostream& os, WideStringView str) {
return os.write(str.unterminated_c_str(), str.GetLength());
}
-std::ostream& operator<<(std::ostream& os, const WideStringView& str) {
+std::ostream& operator<<(std::ostream& os, WideStringView str) {
os << FX_UTF8Encode(str);
return os;
}
} // namespace fxcrt
-uint32_t FX_HashCode_GetW(const WideStringView& str, bool bIgnoreCase) {
+uint32_t FX_HashCode_GetW(WideStringView str, bool bIgnoreCase) {
uint32_t dwHashCode = 0;
if (bIgnoreCase) {
for (wchar_t c : str) // match FXSYS_towlower() arg type.
diff --git a/core/fxcrt/widestring.h b/core/fxcrt/widestring.h
index d77ba03..3cc2f9a 100644
--- a/core/fxcrt/widestring.h
+++ b/core/fxcrt/widestring.h
@@ -53,8 +53,8 @@
WideString(const wchar_t* ptr, size_t len);
- explicit WideString(const WideStringView& str);
- WideString(const WideStringView& str1, const WideStringView& str2);
+ explicit WideString(WideStringView str);
+ WideString(WideStringView str1, WideStringView str2);
WideString(const std::initializer_list<WideStringView>& list);
~WideString();
@@ -109,25 +109,25 @@
bool IsValidLength(size_t length) const { return length <= GetLength(); }
const WideString& operator=(const wchar_t* str);
- const WideString& operator=(const WideStringView& stringSrc);
+ const WideString& operator=(WideStringView stringSrc);
const WideString& operator=(const WideString& that);
const WideString& operator=(WideString&& that);
const WideString& operator+=(const wchar_t* str);
const WideString& operator+=(wchar_t ch);
const WideString& operator+=(const WideString& str);
- const WideString& operator+=(const WideStringView& str);
+ const WideString& operator+=(WideStringView str);
bool operator==(const wchar_t* ptr) const;
- bool operator==(const WideStringView& str) const;
+ bool operator==(WideStringView str) const;
bool operator==(const WideString& other) const;
bool operator!=(const wchar_t* ptr) const { return !(*this == ptr); }
- bool operator!=(const WideStringView& str) const { return !(*this == str); }
+ bool operator!=(WideStringView str) const { return !(*this == str); }
bool operator!=(const WideString& other) const { return !(*this == other); }
bool operator<(const wchar_t* ptr) const;
- bool operator<(const WideStringView& str) const;
+ bool operator<(WideStringView str) const;
bool operator<(const WideString& other) const;
CharType operator[](const size_t index) const {
@@ -158,15 +158,15 @@
void Trim();
void Trim(wchar_t target);
- void Trim(const WideStringView& targets);
+ void Trim(WideStringView targets);
void TrimLeft();
void TrimLeft(wchar_t target);
- void TrimLeft(const WideStringView& targets);
+ void TrimLeft(WideStringView targets);
void TrimRight();
void TrimRight(wchar_t target);
- void TrimRight(const WideStringView& targets);
+ void TrimRight(WideStringView targets);
void Reserve(size_t len);
@@ -177,10 +177,10 @@
int GetInteger() const;
- Optional<size_t> Find(const WideStringView& pSub, size_t start = 0) const;
+ Optional<size_t> Find(WideStringView pSub, size_t start = 0) const;
Optional<size_t> Find(wchar_t ch, size_t start = 0) const;
- bool Contains(const WideStringView& lpszSub, size_t start = 0) const {
+ bool Contains(WideStringView lpszSub, size_t start = 0) const {
return Find(lpszSub, start).has_value();
}
@@ -188,7 +188,7 @@
return Find(ch, start).has_value();
}
- size_t Replace(const WideStringView& pOld, const WideStringView& pNew);
+ size_t Replace(WideStringView pOld, WideStringView pNew);
size_t Remove(wchar_t ch);
bool IsASCII() const { return AsStringView().IsASCII(); }
@@ -225,20 +225,19 @@
friend StringPool_WideString_Test;
};
-inline WideString operator+(const WideStringView& str1,
- const WideStringView& str2) {
+inline WideString operator+(WideStringView str1, WideStringView str2) {
return WideString(str1, str2);
}
-inline WideString operator+(const WideStringView& str1, const wchar_t* str2) {
+inline WideString operator+(WideStringView str1, const wchar_t* str2) {
return WideString(str1, str2);
}
-inline WideString operator+(const wchar_t* str1, const WideStringView& str2) {
+inline WideString operator+(const wchar_t* str1, WideStringView str2) {
return WideString(str1, str2);
}
-inline WideString operator+(const WideStringView& str1, wchar_t ch) {
+inline WideString operator+(WideStringView str1, wchar_t ch) {
return WideString(str1, WideStringView(ch));
}
-inline WideString operator+(wchar_t ch, const WideStringView& str2) {
+inline WideString operator+(wchar_t ch, WideStringView str2) {
return WideString(ch, str2);
}
inline WideString operator+(const WideString& str1, const WideString& str2) {
@@ -256,24 +255,22 @@
inline WideString operator+(const wchar_t* str1, const WideString& str2) {
return WideString(str1, str2.AsStringView());
}
-inline WideString operator+(const WideString& str1,
- const WideStringView& str2) {
+inline WideString operator+(const WideString& str1, WideStringView str2) {
return WideString(str1.AsStringView(), str2);
}
-inline WideString operator+(const WideStringView& str1,
- const WideString& str2) {
+inline WideString operator+(WideStringView str1, const WideString& str2) {
return WideString(str1, str2.AsStringView());
}
inline bool operator==(const wchar_t* lhs, const WideString& rhs) {
return rhs == lhs;
}
-inline bool operator==(const WideStringView& lhs, const WideString& rhs) {
+inline bool operator==(WideStringView lhs, const WideString& rhs) {
return rhs == lhs;
}
inline bool operator!=(const wchar_t* lhs, const WideString& rhs) {
return rhs != lhs;
}
-inline bool operator!=(const WideStringView& lhs, const WideString& rhs) {
+inline bool operator!=(WideStringView lhs, const WideString& rhs) {
return rhs != lhs;
}
inline bool operator<(const wchar_t* lhs, const WideString& rhs) {
@@ -282,14 +279,14 @@
std::wostream& operator<<(std::wostream& os, const WideString& str);
std::ostream& operator<<(std::ostream& os, const WideString& str);
-std::wostream& operator<<(std::wostream& os, const WideStringView& str);
-std::ostream& operator<<(std::ostream& os, const WideStringView& str);
+std::wostream& operator<<(std::wostream& os, WideStringView str);
+std::ostream& operator<<(std::ostream& os, WideStringView str);
} // namespace fxcrt
using WideString = fxcrt::WideString;
-uint32_t FX_HashCode_GetW(const WideStringView& str, bool bIgnoreCase);
+uint32_t FX_HashCode_GetW(WideStringView str, bool bIgnoreCase);
namespace std {
diff --git a/core/fxcrt/xml/cfx_xmlelement.cpp b/core/fxcrt/xml/cfx_xmlelement.cpp
index e09fc57..6508262 100644
--- a/core/fxcrt/xml/cfx_xmlelement.cpp
+++ b/core/fxcrt/xml/cfx_xmlelement.cpp
@@ -112,12 +112,11 @@
pXMLStream->WriteString(">\n");
}
-CFX_XMLElement* CFX_XMLElement::GetFirstChildNamed(
- const WideStringView& name) const {
+CFX_XMLElement* CFX_XMLElement::GetFirstChildNamed(WideStringView name) const {
return GetNthChildNamed(name, 0);
}
-CFX_XMLElement* CFX_XMLElement::GetNthChildNamed(const WideStringView& name,
+CFX_XMLElement* CFX_XMLElement::GetNthChildNamed(WideStringView name,
size_t idx) const {
for (auto* child = GetFirstChild(); child; child = child->GetNextSibling()) {
CFX_XMLElement* elem = ToXMLElement(child);
diff --git a/core/fxcrt/xml/cfx_xmlelement.h b/core/fxcrt/xml/cfx_xmlelement.h
index 822f5ec..7ebd584 100644
--- a/core/fxcrt/xml/cfx_xmlelement.h
+++ b/core/fxcrt/xml/cfx_xmlelement.h
@@ -35,9 +35,8 @@
void RemoveAttribute(const WideString& name);
- CFX_XMLElement* GetFirstChildNamed(const WideStringView& name) const;
- CFX_XMLElement* GetNthChildNamed(const WideStringView& name,
- size_t idx) const;
+ CFX_XMLElement* GetFirstChildNamed(WideStringView name) const;
+ CFX_XMLElement* GetNthChildNamed(WideStringView name, size_t idx) const;
WideString GetLocalTagName() const;
WideString GetNamespacePrefix() const;
diff --git a/core/fxge/dib/fx_dib_main.cpp b/core/fxge/dib/fx_dib_main.cpp
index 0cf0cba..63b757e 100644
--- a/core/fxge/dib/fx_dib_main.cpp
+++ b/core/fxge/dib/fx_dib_main.cpp
@@ -119,7 +119,7 @@
FXSYS_GetBValue(colorref));
}
-FX_ARGB StringToFXARGB(const WideStringView& wsValue) {
+FX_ARGB StringToFXARGB(WideStringView wsValue) {
static constexpr FX_ARGB kDefaultValue = 0xff000000;
if (wsValue.GetLength() == 0)
return kDefaultValue;
diff --git a/core/fxge/fx_dib.h b/core/fxge/fx_dib.h
index 8cb7040..86173e2 100644
--- a/core/fxge/fx_dib.h
+++ b/core/fxge/fx_dib.h
@@ -138,7 +138,7 @@
FX_ARGB AlphaAndColorRefToArgb(int a, FX_COLORREF colorref);
-FX_ARGB StringToFXARGB(const WideStringView& view);
+FX_ARGB StringToFXARGB(WideStringView view);
#define FXARGB_A(argb) ((uint8_t)((argb) >> 24))
#define FXARGB_R(argb) ((uint8_t)((argb) >> 16))
diff --git a/fpdfsdk/fpdf_formfill_embeddertest.cpp b/fpdfsdk/fpdf_formfill_embeddertest.cpp
index b54fa62..8b6023a 100644
--- a/fpdfsdk/fpdf_formfill_embeddertest.cpp
+++ b/fpdfsdk/fpdf_formfill_embeddertest.cpp
@@ -113,7 +113,7 @@
FORM_OnLButtonUp(form_handle(), page_, 0, end.x, end.y);
}
- void CheckSelection(const WideStringView& expected_string) {
+ void CheckSelection(WideStringView expected_string) {
unsigned long actual_len =
FORM_GetSelectedText(form_handle(), page_, nullptr, 0);
ASSERT_NE(actual_len, 0U);
@@ -127,7 +127,7 @@
EXPECT_EQ(expected_string, WideString::FromUTF16LE(buf.data(), num_chars));
}
- void CheckFocusedFieldText(const WideStringView& expected_string) {
+ void CheckFocusedFieldText(WideStringView expected_string) {
unsigned long actual_len =
FORM_GetFocusedText(form_handle(), page_, nullptr, 0);
ASSERT_NE(actual_len, 0U);
diff --git a/fxbarcode/cbc_codabar.cpp b/fxbarcode/cbc_codabar.cpp
index 1aace5e..5822cbe 100644
--- a/fxbarcode/cbc_codabar.cpp
+++ b/fxbarcode/cbc_codabar.cpp
@@ -31,7 +31,7 @@
CBC_Codabar::~CBC_Codabar() {}
-bool CBC_Codabar::Encode(const WideStringView& contents) {
+bool CBC_Codabar::Encode(WideStringView contents) {
if (contents.IsEmpty())
return false;
diff --git a/fxbarcode/cbc_codabar.h b/fxbarcode/cbc_codabar.h
index 3e2bc6f..a3e1df4 100644
--- a/fxbarcode/cbc_codabar.h
+++ b/fxbarcode/cbc_codabar.h
@@ -20,7 +20,7 @@
// CBC_OneCode:
BC_TYPE GetType() override;
- bool Encode(const WideStringView& contents) override;
+ bool Encode(WideStringView contents) override;
bool RenderDevice(CFX_RenderDevice* device,
const CFX_Matrix* matrix) override;
diff --git a/fxbarcode/cbc_code128.cpp b/fxbarcode/cbc_code128.cpp
index 237ac57..712c1f7 100644
--- a/fxbarcode/cbc_code128.cpp
+++ b/fxbarcode/cbc_code128.cpp
@@ -31,7 +31,7 @@
CBC_Code128::~CBC_Code128() {}
-bool CBC_Code128::Encode(const WideStringView& contents) {
+bool CBC_Code128::Encode(WideStringView contents) {
if (contents.IsEmpty())
return false;
diff --git a/fxbarcode/cbc_code128.h b/fxbarcode/cbc_code128.h
index 606b36e..2ccf07d 100644
--- a/fxbarcode/cbc_code128.h
+++ b/fxbarcode/cbc_code128.h
@@ -20,7 +20,7 @@
// CBC_OneCode:
BC_TYPE GetType() override;
- bool Encode(const WideStringView& contents) override;
+ bool Encode(WideStringView contents) override;
bool RenderDevice(CFX_RenderDevice* device,
const CFX_Matrix* matrix) override;
diff --git a/fxbarcode/cbc_code39.cpp b/fxbarcode/cbc_code39.cpp
index 00c4bc0..63a3c56 100644
--- a/fxbarcode/cbc_code39.cpp
+++ b/fxbarcode/cbc_code39.cpp
@@ -31,7 +31,7 @@
CBC_Code39::~CBC_Code39() {}
-bool CBC_Code39::Encode(const WideStringView& contents) {
+bool CBC_Code39::Encode(WideStringView contents) {
if (contents.IsEmpty())
return false;
diff --git a/fxbarcode/cbc_code39.h b/fxbarcode/cbc_code39.h
index d129fa4..ab48292 100644
--- a/fxbarcode/cbc_code39.h
+++ b/fxbarcode/cbc_code39.h
@@ -21,7 +21,7 @@
// CBC_OneCode:
BC_TYPE GetType() override;
- bool Encode(const WideStringView& contents) override;
+ bool Encode(WideStringView contents) override;
bool RenderDevice(CFX_RenderDevice* device,
const CFX_Matrix* matrix) override;
diff --git a/fxbarcode/cbc_codebase.h b/fxbarcode/cbc_codebase.h
index 86d10c3..75070fa 100644
--- a/fxbarcode/cbc_codebase.h
+++ b/fxbarcode/cbc_codebase.h
@@ -26,7 +26,7 @@
virtual ~CBC_CodeBase();
virtual BC_TYPE GetType() = 0;
- virtual bool Encode(const WideStringView& contents) = 0;
+ virtual bool Encode(WideStringView contents) = 0;
virtual bool RenderDevice(CFX_RenderDevice* device,
const CFX_Matrix* matrix) = 0;
diff --git a/fxbarcode/cbc_datamatrix.cpp b/fxbarcode/cbc_datamatrix.cpp
index bebff2d..e8695d2 100644
--- a/fxbarcode/cbc_datamatrix.cpp
+++ b/fxbarcode/cbc_datamatrix.cpp
@@ -31,7 +31,7 @@
CBC_DataMatrix::~CBC_DataMatrix() = default;
-bool CBC_DataMatrix::Encode(const WideStringView& contents) {
+bool CBC_DataMatrix::Encode(WideStringView contents) {
int32_t width;
int32_t height;
auto* pWriter = GetDataMatrixWriter();
diff --git a/fxbarcode/cbc_datamatrix.h b/fxbarcode/cbc_datamatrix.h
index f28e762..c504c95 100644
--- a/fxbarcode/cbc_datamatrix.h
+++ b/fxbarcode/cbc_datamatrix.h
@@ -19,7 +19,7 @@
~CBC_DataMatrix() override;
// CBC_OneCode:
- bool Encode(const WideStringView& contents) override;
+ bool Encode(WideStringView contents) override;
bool RenderDevice(CFX_RenderDevice* device,
const CFX_Matrix* matrix) override;
BC_TYPE GetType() override;
diff --git a/fxbarcode/cbc_eancode.cpp b/fxbarcode/cbc_eancode.cpp
index 6325b85..ffb116e 100644
--- a/fxbarcode/cbc_eancode.cpp
+++ b/fxbarcode/cbc_eancode.cpp
@@ -19,7 +19,7 @@
return static_cast<CBC_OneDimEANWriter*>(m_pBCWriter.get());
}
-bool CBC_EANCode::Encode(const WideStringView& contents) {
+bool CBC_EANCode::Encode(WideStringView contents) {
if (contents.IsEmpty())
return false;
@@ -42,7 +42,7 @@
device, matrix, m_renderContents.AsStringView());
}
-WideString CBC_EANCode::Preprocess(const WideStringView& contents) {
+WideString CBC_EANCode::Preprocess(WideStringView contents) {
auto* pWriter = GetOneDimEANWriter();
WideString encoded_contents = pWriter->FilterContents(contents);
size_t length = encoded_contents.GetLength();
diff --git a/fxbarcode/cbc_eancode.h b/fxbarcode/cbc_eancode.h
index 5c2e737..572bb42 100644
--- a/fxbarcode/cbc_eancode.h
+++ b/fxbarcode/cbc_eancode.h
@@ -24,13 +24,13 @@
virtual size_t GetMaxLength() const = 0;
// CBC_EANCode:
- bool Encode(const WideStringView& contents) override;
+ bool Encode(WideStringView contents) override;
bool RenderDevice(CFX_RenderDevice* device,
const CFX_Matrix* matrix) override;
protected:
CBC_OneDimEANWriter* GetOneDimEANWriter();
- WideString Preprocess(const WideStringView& contents);
+ WideString Preprocess(WideStringView contents);
WideString m_renderContents;
};
diff --git a/fxbarcode/cbc_onecode.cpp b/fxbarcode/cbc_onecode.cpp
index fb8cb05..05501bd 100644
--- a/fxbarcode/cbc_onecode.cpp
+++ b/fxbarcode/cbc_onecode.cpp
@@ -30,11 +30,11 @@
CBC_OneCode::~CBC_OneCode() {}
-bool CBC_OneCode::CheckContentValidity(const WideStringView& contents) {
+bool CBC_OneCode::CheckContentValidity(WideStringView contents) {
return GetOneDimWriter()->CheckContentValidity(contents);
}
-WideString CBC_OneCode::FilterContents(const WideStringView& contents) {
+WideString CBC_OneCode::FilterContents(WideStringView contents) {
return GetOneDimWriter()->FilterContents(contents);
}
diff --git a/fxbarcode/cbc_onecode.h b/fxbarcode/cbc_onecode.h
index 946911c..4470ad8 100644
--- a/fxbarcode/cbc_onecode.h
+++ b/fxbarcode/cbc_onecode.h
@@ -21,8 +21,8 @@
explicit CBC_OneCode(std::unique_ptr<CBC_Writer> pWriter);
~CBC_OneCode() override;
- virtual bool CheckContentValidity(const WideStringView& contents);
- virtual WideString FilterContents(const WideStringView& contents);
+ virtual bool CheckContentValidity(WideStringView contents);
+ virtual WideString FilterContents(WideStringView contents);
void SetPrintChecksum(bool checksum);
void SetDataLength(int32_t length);
diff --git a/fxbarcode/cbc_pdf417i.cpp b/fxbarcode/cbc_pdf417i.cpp
index 321468b..c3e165b 100644
--- a/fxbarcode/cbc_pdf417i.cpp
+++ b/fxbarcode/cbc_pdf417i.cpp
@@ -31,7 +31,7 @@
CBC_PDF417I::~CBC_PDF417I() {}
-bool CBC_PDF417I::Encode(const WideStringView& contents) {
+bool CBC_PDF417I::Encode(WideStringView contents) {
int32_t width;
int32_t height;
auto* pWriter = GetPDF417Writer();
diff --git a/fxbarcode/cbc_pdf417i.h b/fxbarcode/cbc_pdf417i.h
index 9649010..ab773f9 100644
--- a/fxbarcode/cbc_pdf417i.h
+++ b/fxbarcode/cbc_pdf417i.h
@@ -19,7 +19,7 @@
~CBC_PDF417I() override;
// CBC_CodeBase:
- bool Encode(const WideStringView& contents) override;
+ bool Encode(WideStringView contents) override;
bool RenderDevice(CFX_RenderDevice* device,
const CFX_Matrix* matrix) override;
BC_TYPE GetType() override;
diff --git a/fxbarcode/cbc_qrcode.cpp b/fxbarcode/cbc_qrcode.cpp
index c89387b..5e60fa3 100644
--- a/fxbarcode/cbc_qrcode.cpp
+++ b/fxbarcode/cbc_qrcode.cpp
@@ -31,7 +31,7 @@
CBC_QRCode::~CBC_QRCode() = default;
-bool CBC_QRCode::Encode(const WideStringView& contents) {
+bool CBC_QRCode::Encode(WideStringView contents) {
int32_t width;
int32_t height;
CBC_QRCodeWriter* pWriter = GetQRCodeWriter();
diff --git a/fxbarcode/cbc_qrcode.h b/fxbarcode/cbc_qrcode.h
index 428d615..c541b7e 100644
--- a/fxbarcode/cbc_qrcode.h
+++ b/fxbarcode/cbc_qrcode.h
@@ -19,7 +19,7 @@
~CBC_QRCode() override;
// CBC_CodeBase:
- bool Encode(const WideStringView& contents) override;
+ bool Encode(WideStringView contents) override;
bool RenderDevice(CFX_RenderDevice* device,
const CFX_Matrix* matrix) override;
BC_TYPE GetType() override;
diff --git a/fxbarcode/oned/BC_OneDimWriter.cpp b/fxbarcode/oned/BC_OneDimWriter.cpp
index cd01697..7a343f6 100644
--- a/fxbarcode/oned/BC_OneDimWriter.cpp
+++ b/fxbarcode/oned/BC_OneDimWriter.cpp
@@ -175,7 +175,7 @@
m_fontColor, FXTEXT_CLEARTYPE);
}
-bool CBC_OneDimWriter::ShowChars(const WideStringView& contents,
+bool CBC_OneDimWriter::ShowChars(WideStringView contents,
CFX_RenderDevice* device,
const CFX_Matrix* matrix,
int32_t barWidth,
@@ -233,7 +233,7 @@
bool CBC_OneDimWriter::RenderDeviceResult(CFX_RenderDevice* device,
const CFX_Matrix* matrix,
- const WideStringView& contents) {
+ WideStringView contents) {
if (m_output.empty())
return false;
@@ -256,7 +256,7 @@
ShowChars(contents, device, matrix, m_barWidth, m_multiple);
}
-bool CBC_OneDimWriter::RenderResult(const WideStringView& contents,
+bool CBC_OneDimWriter::RenderResult(WideStringView contents,
uint8_t* code,
int32_t codeLength) {
if (codeLength < 1)
@@ -306,7 +306,6 @@
}
}
-WideString CBC_OneDimWriter::RenderTextContents(
- const WideStringView& contents) {
+WideString CBC_OneDimWriter::RenderTextContents(WideStringView contents) {
return WideString();
}
diff --git a/fxbarcode/oned/BC_OneDimWriter.h b/fxbarcode/oned/BC_OneDimWriter.h
index c910cd6..b73e492 100644
--- a/fxbarcode/oned/BC_OneDimWriter.h
+++ b/fxbarcode/oned/BC_OneDimWriter.h
@@ -25,12 +25,12 @@
CBC_OneDimWriter();
~CBC_OneDimWriter() override;
- virtual bool RenderResult(const WideStringView& contents,
+ virtual bool RenderResult(WideStringView contents,
uint8_t* code,
int32_t codeLength);
- virtual bool CheckContentValidity(const WideStringView& contents) = 0;
- virtual WideString FilterContents(const WideStringView& contents) = 0;
- virtual WideString RenderTextContents(const WideStringView& contents);
+ virtual bool CheckContentValidity(WideStringView contents) = 0;
+ virtual WideString FilterContents(WideStringView contents) = 0;
+ virtual WideString RenderTextContents(WideStringView contents);
virtual void SetPrintChecksum(bool checksum);
virtual void SetDataLength(int32_t length);
virtual void SetCalcChecksum(bool state);
@@ -44,7 +44,7 @@
int32_t& outHeight);
bool RenderDeviceResult(CFX_RenderDevice* device,
const CFX_Matrix* matrix,
- const WideStringView& contents);
+ WideStringView contents);
bool SetFont(CFX_Font* cFont);
protected:
@@ -55,7 +55,7 @@
int32_t hints);
virtual uint8_t* EncodeImpl(const ByteString& contents,
int32_t& outLength) = 0;
- virtual bool ShowChars(const WideStringView& contents,
+ virtual bool ShowChars(WideStringView contents,
CFX_RenderDevice* device,
const CFX_Matrix* matrix,
int32_t barWidth,
diff --git a/fxbarcode/oned/BC_OnedCodaBarWriter.cpp b/fxbarcode/oned/BC_OnedCodaBarWriter.cpp
index 786f82b..c4334c6 100644
--- a/fxbarcode/oned/BC_OnedCodaBarWriter.cpp
+++ b/fxbarcode/oned/BC_OnedCodaBarWriter.cpp
@@ -97,15 +97,13 @@
(isContent && pdfium::ContainsValue(kStartEndChars, narrow_ch));
}
-bool CBC_OnedCodaBarWriter::CheckContentValidity(
- const WideStringView& contents) {
+bool CBC_OnedCodaBarWriter::CheckContentValidity(WideStringView contents) {
return std::all_of(
contents.begin(), contents.end(),
[this](const wchar_t& ch) { return this->FindChar(ch, false); });
}
-WideString CBC_OnedCodaBarWriter::FilterContents(
- const WideStringView& contents) {
+WideString CBC_OnedCodaBarWriter::FilterContents(WideStringView contents) {
WideString filtercontents;
filtercontents.Reserve(contents.GetLength());
wchar_t ch;
@@ -191,14 +189,13 @@
return result;
}
-WideString CBC_OnedCodaBarWriter::encodedContents(
- const WideStringView& contents) {
+WideString CBC_OnedCodaBarWriter::encodedContents(WideStringView contents) {
WideString strStart(static_cast<wchar_t>(m_chStart));
WideString strEnd(static_cast<wchar_t>(m_chEnd));
return strStart + contents + strEnd;
}
-bool CBC_OnedCodaBarWriter::RenderResult(const WideStringView& contents,
+bool CBC_OnedCodaBarWriter::RenderResult(WideStringView contents,
uint8_t* code,
int32_t codeLength) {
return CBC_OneDimWriter::RenderResult(
diff --git a/fxbarcode/oned/BC_OnedCodaBarWriter.h b/fxbarcode/oned/BC_OnedCodaBarWriter.h
index 8147e04..6feb380 100644
--- a/fxbarcode/oned/BC_OnedCodaBarWriter.h
+++ b/fxbarcode/oned/BC_OnedCodaBarWriter.h
@@ -24,11 +24,11 @@
int32_t& outWidth,
int32_t& outHeight,
int32_t hints) override;
- bool RenderResult(const WideStringView& contents,
+ bool RenderResult(WideStringView contents,
uint8_t* code,
int32_t codeLength) override;
- bool CheckContentValidity(const WideStringView& contents) override;
- WideString FilterContents(const WideStringView& contents) override;
+ bool CheckContentValidity(WideStringView contents) override;
+ WideString FilterContents(WideStringView contents) override;
void SetDataLength(int32_t length) override;
bool SetTextLocation(BC_TEXT_LOC location) override;
bool SetWideNarrowRatio(int8_t ratio) override;
@@ -37,7 +37,7 @@
virtual bool FindChar(wchar_t ch, bool isContent);
- WideString encodedContents(const WideStringView& contents);
+ WideString encodedContents(WideStringView contents);
private:
char m_chStart = 'A';
diff --git a/fxbarcode/oned/BC_OnedCode128Writer.cpp b/fxbarcode/oned/BC_OnedCode128Writer.cpp
index c8d1128..1a3995a 100644
--- a/fxbarcode/oned/BC_OnedCode128Writer.cpp
+++ b/fxbarcode/oned/BC_OnedCode128Writer.cpp
@@ -83,8 +83,7 @@
CBC_OnedCode128Writer::~CBC_OnedCode128Writer() = default;
-bool CBC_OnedCode128Writer::CheckContentValidity(
- const WideStringView& contents) {
+bool CBC_OnedCode128Writer::CheckContentValidity(WideStringView contents) {
for (const auto& ch : contents) {
int32_t patternIndex = static_cast<int32_t>(ch);
if (patternIndex < 32 || patternIndex > 126 || patternIndex == 34)
@@ -93,8 +92,7 @@
return true;
}
-WideString CBC_OnedCode128Writer::FilterContents(
- const WideStringView& contents) {
+WideString CBC_OnedCode128Writer::FilterContents(WideStringView contents) {
const wchar_t limit = m_codeFormat == BC_CODE128_B ? 126 : 106;
WideString filtered;
diff --git a/fxbarcode/oned/BC_OnedCode128Writer.h b/fxbarcode/oned/BC_OnedCode128Writer.h
index 3a834e8..370c025 100644
--- a/fxbarcode/oned/BC_OnedCode128Writer.h
+++ b/fxbarcode/oned/BC_OnedCode128Writer.h
@@ -31,8 +31,8 @@
int32_t& outHeight,
int32_t hints) override;
uint8_t* EncodeImpl(const ByteString& contents, int32_t& outLength) override;
- bool CheckContentValidity(const WideStringView& contents) override;
- WideString FilterContents(const WideStringView& contents) override;
+ bool CheckContentValidity(WideStringView contents) override;
+ WideString FilterContents(WideStringView contents) override;
bool SetTextLocation(BC_TEXT_LOC location) override;
BC_TYPE GetType() const { return m_codeFormat; }
diff --git a/fxbarcode/oned/BC_OnedCode39Writer.cpp b/fxbarcode/oned/BC_OnedCode39Writer.cpp
index 4fa2fb5..89decab 100644
--- a/fxbarcode/oned/BC_OnedCode39Writer.cpp
+++ b/fxbarcode/oned/BC_OnedCode39Writer.cpp
@@ -64,13 +64,11 @@
CBC_OnedCode39Writer::~CBC_OnedCode39Writer() = default;
-bool CBC_OnedCode39Writer::CheckContentValidity(
- const WideStringView& contents) {
+bool CBC_OnedCode39Writer::CheckContentValidity(WideStringView contents) {
return std::all_of(contents.begin(), contents.end(), IsInOnedCode39Alphabet);
}
-WideString CBC_OnedCode39Writer::FilterContents(
- const WideStringView& contents) {
+WideString CBC_OnedCode39Writer::FilterContents(WideStringView contents) {
WideString filtercontents;
filtercontents.Reserve(contents.GetLength());
for (size_t i = 0; i < contents.GetLength(); i++) {
@@ -89,8 +87,7 @@
return filtercontents;
}
-WideString CBC_OnedCode39Writer::RenderTextContents(
- const WideStringView& contents) {
+WideString CBC_OnedCode39Writer::RenderTextContents(WideStringView contents) {
WideString renderContents;
for (size_t i = 0; i < contents.GetLength(); i++) {
wchar_t ch = contents[i];
@@ -214,7 +211,7 @@
return result.release();
}
-bool CBC_OnedCode39Writer::encodedContents(const WideStringView& contents,
+bool CBC_OnedCode39Writer::encodedContents(WideStringView contents,
WideString* result) {
*result = WideString(contents);
if (m_bCalcChecksum && m_bPrintChecksum) {
@@ -230,7 +227,7 @@
return true;
}
-bool CBC_OnedCode39Writer::RenderResult(const WideStringView& contents,
+bool CBC_OnedCode39Writer::RenderResult(WideStringView contents,
uint8_t* code,
int32_t codeLength) {
WideString encodedCon;
diff --git a/fxbarcode/oned/BC_OnedCode39Writer.h b/fxbarcode/oned/BC_OnedCode39Writer.h
index b6102bc..945099c 100644
--- a/fxbarcode/oned/BC_OnedCode39Writer.h
+++ b/fxbarcode/oned/BC_OnedCode39Writer.h
@@ -22,16 +22,16 @@
int32_t& outHeight,
int32_t hints) override;
uint8_t* EncodeImpl(const ByteString& contents, int32_t& outLength) override;
- bool RenderResult(const WideStringView& contents,
+ bool RenderResult(WideStringView contents,
uint8_t* code,
int32_t codeLength) override;
- bool CheckContentValidity(const WideStringView& contents) override;
- WideString FilterContents(const WideStringView& contents) override;
- WideString RenderTextContents(const WideStringView& contents) override;
+ bool CheckContentValidity(WideStringView contents) override;
+ WideString FilterContents(WideStringView contents) override;
+ WideString RenderTextContents(WideStringView contents) override;
bool SetTextLocation(BC_TEXT_LOC location) override;
bool SetWideNarrowRatio(int8_t ratio) override;
- bool encodedContents(const WideStringView& contents, WideString* result);
+ bool encodedContents(WideStringView contents, WideString* result);
private:
void ToIntArray(int16_t a, int8_t* toReturn);
diff --git a/fxbarcode/oned/BC_OnedEAN13Writer.cpp b/fxbarcode/oned/BC_OnedEAN13Writer.cpp
index f958868..f302f40 100644
--- a/fxbarcode/oned/BC_OnedEAN13Writer.cpp
+++ b/fxbarcode/oned/BC_OnedEAN13Writer.cpp
@@ -56,12 +56,12 @@
}
CBC_OnedEAN13Writer::~CBC_OnedEAN13Writer() {}
-bool CBC_OnedEAN13Writer::CheckContentValidity(const WideStringView& contents) {
+bool CBC_OnedEAN13Writer::CheckContentValidity(WideStringView contents) {
return std::all_of(contents.begin(), contents.end(),
[](wchar_t c) { return FXSYS_IsDecimalDigit(c); });
}
-WideString CBC_OnedEAN13Writer::FilterContents(const WideStringView& contents) {
+WideString CBC_OnedEAN13Writer::FilterContents(WideStringView contents) {
WideString filtercontents;
filtercontents.Reserve(contents.GetLength());
wchar_t ch;
@@ -124,7 +124,7 @@
return result.release();
}
-bool CBC_OnedEAN13Writer::ShowChars(const WideStringView& contents,
+bool CBC_OnedEAN13Writer::ShowChars(WideStringView contents,
CFX_RenderDevice* device,
const CFX_Matrix* matrix,
int32_t barWidth,
diff --git a/fxbarcode/oned/BC_OnedEAN13Writer.h b/fxbarcode/oned/BC_OnedEAN13Writer.h
index 8436a4f..88fa9cb 100644
--- a/fxbarcode/oned/BC_OnedEAN13Writer.h
+++ b/fxbarcode/oned/BC_OnedEAN13Writer.h
@@ -26,12 +26,12 @@
int32_t& outHeight,
int32_t hints) override;
uint8_t* EncodeImpl(const ByteString& contents, int32_t& outLength) override;
- bool CheckContentValidity(const WideStringView& contents) override;
- WideString FilterContents(const WideStringView& contents) override;
+ bool CheckContentValidity(WideStringView contents) override;
+ WideString FilterContents(WideStringView contents) override;
int32_t CalcChecksum(const ByteString& contents) override;
private:
- bool ShowChars(const WideStringView& contents,
+ bool ShowChars(WideStringView contents,
CFX_RenderDevice* device,
const CFX_Matrix* matrix,
int32_t barWidth,
diff --git a/fxbarcode/oned/BC_OnedEAN8Writer.cpp b/fxbarcode/oned/BC_OnedEAN8Writer.cpp
index 51876af..9e15157 100644
--- a/fxbarcode/oned/BC_OnedEAN8Writer.cpp
+++ b/fxbarcode/oned/BC_OnedEAN8Writer.cpp
@@ -62,12 +62,12 @@
return false;
}
-bool CBC_OnedEAN8Writer::CheckContentValidity(const WideStringView& contents) {
+bool CBC_OnedEAN8Writer::CheckContentValidity(WideStringView contents) {
return std::all_of(contents.begin(), contents.end(),
[](wchar_t c) { return FXSYS_IsDecimalDigit(c); });
}
-WideString CBC_OnedEAN8Writer::FilterContents(const WideStringView& contents) {
+WideString CBC_OnedEAN8Writer::FilterContents(WideStringView contents) {
WideString filtercontents;
filtercontents.Reserve(contents.GetLength());
wchar_t ch;
@@ -124,7 +124,7 @@
return result.release();
}
-bool CBC_OnedEAN8Writer::ShowChars(const WideStringView& contents,
+bool CBC_OnedEAN8Writer::ShowChars(WideStringView contents,
CFX_RenderDevice* device,
const CFX_Matrix* matrix,
int32_t barWidth,
diff --git a/fxbarcode/oned/BC_OnedEAN8Writer.h b/fxbarcode/oned/BC_OnedEAN8Writer.h
index 9d107b9..b71dbb9 100644
--- a/fxbarcode/oned/BC_OnedEAN8Writer.h
+++ b/fxbarcode/oned/BC_OnedEAN8Writer.h
@@ -27,14 +27,14 @@
int32_t& outHeight,
int32_t hints) override;
uint8_t* EncodeImpl(const ByteString& contents, int32_t& outLength) override;
- bool CheckContentValidity(const WideStringView& contents) override;
- WideString FilterContents(const WideStringView& contents) override;
+ bool CheckContentValidity(WideStringView contents) override;
+ WideString FilterContents(WideStringView contents) override;
void SetDataLength(int32_t length) override;
bool SetTextLocation(BC_TEXT_LOC location) override;
int32_t CalcChecksum(const ByteString& contents) override;
private:
- bool ShowChars(const WideStringView& contents,
+ bool ShowChars(WideStringView contents,
CFX_RenderDevice* device,
const CFX_Matrix* matrix,
int32_t barWidth,
diff --git a/fxbarcode/oned/BC_OnedUPCAWriter.cpp b/fxbarcode/oned/BC_OnedUPCAWriter.cpp
index d3b9226..36ce028 100644
--- a/fxbarcode/oned/BC_OnedUPCAWriter.cpp
+++ b/fxbarcode/oned/BC_OnedUPCAWriter.cpp
@@ -38,7 +38,7 @@
CBC_OnedUPCAWriter::~CBC_OnedUPCAWriter() {}
-bool CBC_OnedUPCAWriter::CheckContentValidity(const WideStringView& contents) {
+bool CBC_OnedUPCAWriter::CheckContentValidity(WideStringView contents) {
for (size_t i = 0; i < contents.GetLength(); ++i) {
if (contents[i] < '0' || contents[i] > '9')
return false;
@@ -46,7 +46,7 @@
return true;
}
-WideString CBC_OnedUPCAWriter::FilterContents(const WideStringView& contents) {
+WideString CBC_OnedUPCAWriter::FilterContents(WideStringView contents) {
WideString filtercontents;
filtercontents.Reserve(contents.GetLength());
wchar_t ch;
@@ -102,7 +102,7 @@
return nullptr;
}
-bool CBC_OnedUPCAWriter::ShowChars(const WideStringView& contents,
+bool CBC_OnedUPCAWriter::ShowChars(WideStringView contents,
CFX_RenderDevice* device,
const CFX_Matrix* matrix,
int32_t barWidth,
diff --git a/fxbarcode/oned/BC_OnedUPCAWriter.h b/fxbarcode/oned/BC_OnedUPCAWriter.h
index 8e2f770..991dfe6 100644
--- a/fxbarcode/oned/BC_OnedUPCAWriter.h
+++ b/fxbarcode/oned/BC_OnedUPCAWriter.h
@@ -30,13 +30,13 @@
int32_t& outHeight,
int32_t hints) override;
uint8_t* EncodeImpl(const ByteString& contents, int32_t& outLength) override;
- bool CheckContentValidity(const WideStringView& contents) override;
- WideString FilterContents(const WideStringView& contents) override;
+ bool CheckContentValidity(WideStringView contents) override;
+ WideString FilterContents(WideStringView contents) override;
void InitEANWriter() override;
int32_t CalcChecksum(const ByteString& contents) override;
private:
- bool ShowChars(const WideStringView& contents,
+ bool ShowChars(WideStringView contents,
CFX_RenderDevice* device,
const CFX_Matrix* matrix,
int32_t barWidth,
diff --git a/fxbarcode/pdf417/BC_PDF417.cpp b/fxbarcode/pdf417/BC_PDF417.cpp
index abf9448..b9ba390 100644
--- a/fxbarcode/pdf417/BC_PDF417.cpp
+++ b/fxbarcode/pdf417/BC_PDF417.cpp
@@ -357,7 +357,7 @@
return m_barcodeMatrix.get();
}
-bool CBC_PDF417::GenerateBarcodeLogic(const WideStringView& msg,
+bool CBC_PDF417::GenerateBarcodeLogic(WideStringView msg,
int32_t errorCorrectionLevel) {
int32_t errorCorrectionCodeWords =
CBC_PDF417ErrorCorrection::GetErrorCorrectionCodewordCount(
diff --git a/fxbarcode/pdf417/BC_PDF417.h b/fxbarcode/pdf417/BC_PDF417.h
index 33129b0..b445ede 100644
--- a/fxbarcode/pdf417/BC_PDF417.h
+++ b/fxbarcode/pdf417/BC_PDF417.h
@@ -21,8 +21,7 @@
~CBC_PDF417();
CBC_BarcodeMatrix* getBarcodeMatrix();
- bool GenerateBarcodeLogic(const WideStringView& msg,
- int32_t errorCorrectionLevel);
+ bool GenerateBarcodeLogic(WideStringView msg, int32_t errorCorrectionLevel);
void setDimensions(int32_t maxCols,
int32_t minCols,
int32_t maxRows,
diff --git a/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.cpp b/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.cpp
index 6010b92..ad07f79 100644
--- a/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.cpp
+++ b/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.cpp
@@ -77,7 +77,7 @@
// static
Optional<WideString> CBC_PDF417HighLevelEncoder::EncodeHighLevel(
- const WideStringView& msg) {
+ WideStringView msg) {
ByteString bytes = FX_UTF8Encode(msg);
size_t len = bytes.GetLength();
WideString result;
diff --git a/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.h b/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.h
index 9f65ca6..eb2d30f 100644
--- a/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.h
+++ b/fxbarcode/pdf417/BC_PDF417HighLevelEncoder.h
@@ -19,7 +19,7 @@
CBC_PDF417HighLevelEncoder() = delete;
~CBC_PDF417HighLevelEncoder() = delete;
- static Optional<WideString> EncodeHighLevel(const WideStringView& msg);
+ static Optional<WideString> EncodeHighLevel(WideStringView msg);
private:
enum class EncodingMode { kUnknown = 0, kText, kByte, kNumeric };
diff --git a/fxbarcode/pdf417/BC_PDF417Writer.cpp b/fxbarcode/pdf417/BC_PDF417Writer.cpp
index 71509ff..f9f3624 100644
--- a/fxbarcode/pdf417/BC_PDF417Writer.cpp
+++ b/fxbarcode/pdf417/BC_PDF417Writer.cpp
@@ -43,7 +43,7 @@
return true;
}
-std::vector<uint8_t> CBC_PDF417Writer::Encode(const WideStringView& contents,
+std::vector<uint8_t> CBC_PDF417Writer::Encode(WideStringView contents,
int32_t* pOutWidth,
int32_t* pOutHeight) {
std::vector<uint8_t> results;
diff --git a/fxbarcode/pdf417/BC_PDF417Writer.h b/fxbarcode/pdf417/BC_PDF417Writer.h
index c32508b..10f069a 100644
--- a/fxbarcode/pdf417/BC_PDF417Writer.h
+++ b/fxbarcode/pdf417/BC_PDF417Writer.h
@@ -18,7 +18,7 @@
CBC_PDF417Writer();
~CBC_PDF417Writer() override;
- std::vector<uint8_t> Encode(const WideStringView& contents,
+ std::vector<uint8_t> Encode(WideStringView contents,
int32_t* pOutWidth,
int32_t* pOutHeight);
diff --git a/fxbarcode/qrcode/BC_QRCodeWriter.cpp b/fxbarcode/qrcode/BC_QRCodeWriter.cpp
index 495d7b1..1eead62 100644
--- a/fxbarcode/qrcode/BC_QRCodeWriter.cpp
+++ b/fxbarcode/qrcode/BC_QRCodeWriter.cpp
@@ -43,7 +43,7 @@
return true;
}
-std::vector<uint8_t> CBC_QRCodeWriter::Encode(const WideStringView& contents,
+std::vector<uint8_t> CBC_QRCodeWriter::Encode(WideStringView contents,
int32_t ecLevel,
int32_t* pOutWidth,
int32_t* pOutHeight) {
diff --git a/fxbarcode/qrcode/BC_QRCodeWriter.h b/fxbarcode/qrcode/BC_QRCodeWriter.h
index ade5cb7..3f2cca0 100644
--- a/fxbarcode/qrcode/BC_QRCodeWriter.h
+++ b/fxbarcode/qrcode/BC_QRCodeWriter.h
@@ -16,7 +16,7 @@
CBC_QRCodeWriter();
~CBC_QRCodeWriter() override;
- std::vector<uint8_t> Encode(const WideStringView& contents,
+ std::vector<uint8_t> Encode(WideStringView contents,
int32_t ecLevel,
int32_t* pOutWidth,
int32_t* pOutHeight);
diff --git a/fxbarcode/qrcode/BC_QRCoderEncoder.cpp b/fxbarcode/qrcode/BC_QRCoderEncoder.cpp
index 34971e3..02f42bf 100644
--- a/fxbarcode/qrcode/BC_QRCoderEncoder.cpp
+++ b/fxbarcode/qrcode/BC_QRCoderEncoder.cpp
@@ -400,7 +400,7 @@
} // namespace
// static
-bool CBC_QRCoderEncoder::Encode(const WideStringView& content,
+bool CBC_QRCoderEncoder::Encode(WideStringView content,
const CBC_QRCoderErrorCorrectionLevel* ecLevel,
CBC_QRCoder* qrCode) {
ByteString encoding = "utf8";
diff --git a/fxbarcode/qrcode/BC_QRCoderEncoder.h b/fxbarcode/qrcode/BC_QRCoderEncoder.h
index 9be00c1..75fd2e5 100644
--- a/fxbarcode/qrcode/BC_QRCoderEncoder.h
+++ b/fxbarcode/qrcode/BC_QRCoderEncoder.h
@@ -17,7 +17,7 @@
CBC_QRCoderEncoder() = delete;
~CBC_QRCoderEncoder() = delete;
- static bool Encode(const WideStringView& content,
+ static bool Encode(WideStringView content,
const CBC_QRCoderErrorCorrectionLevel* ecLevel,
CBC_QRCoder* qrCode);
};
diff --git a/fxjs/cfx_v8.cpp b/fxjs/cfx_v8.cpp
index 58b30e5..7f2ce62 100644
--- a/fxjs/cfx_v8.cpp
+++ b/fxjs/cfx_v8.cpp
@@ -115,7 +115,7 @@
.ToLocalChecked();
}
-v8::Local<v8::String> CFX_V8::NewString(const WideStringView& str) {
+v8::Local<v8::String> CFX_V8::NewString(WideStringView str) {
// Conversion from pdfium's wchar_t wide-strings to v8's uint16_t
// wide-strings isn't handled by v8, so use UTF8 as a common
// intermediate format.
diff --git a/fxjs/cfx_v8.h b/fxjs/cfx_v8.h
index 73fb3ac..1310b8f 100644
--- a/fxjs/cfx_v8.h
+++ b/fxjs/cfx_v8.h
@@ -29,7 +29,7 @@
v8::Local<v8::Number> NewNumber(float number);
v8::Local<v8::Boolean> NewBoolean(bool b);
v8::Local<v8::String> NewString(const ByteStringView& str);
- v8::Local<v8::String> NewString(const WideStringView& str);
+ v8::Local<v8::String> NewString(WideStringView str);
v8::Local<v8::Date> NewDate(double d);
int ToInt32(v8::Local<v8::Value> pValue);
diff --git a/fxjs/xfa/cfxjse_engine.cpp b/fxjs/xfa/cfxjse_engine.cpp
index 5b50bf8..33c8b5b 100644
--- a/fxjs/xfa/cfxjse_engine.cpp
+++ b/fxjs/xfa/cfxjse_engine.cpp
@@ -121,7 +121,7 @@
}
bool CFXJSE_Engine::RunScript(CXFA_Script::Type eScriptType,
- const WideStringView& wsScript,
+ WideStringView wsScript,
CFXJSE_Value* hRetValue,
CXFA_Object* pThisObject) {
ByteString btScript;
@@ -150,7 +150,7 @@
}
bool CFXJSE_Engine::QueryNodeByFlag(CXFA_Node* refNode,
- const WideStringView& propname,
+ WideStringView propname,
CFXJSE_Value* pValue,
uint32_t dwFlag,
bool bSetting) {
@@ -563,7 +563,7 @@
}
bool CFXJSE_Engine::ResolveObjects(CXFA_Object* refObject,
- const WideStringView& wsExpression,
+ WideStringView wsExpression,
XFA_RESOLVENODE_RS* resolveNodeRS,
uint32_t dwStyles,
CXFA_Node* bindNode) {
diff --git a/fxjs/xfa/cfxjse_engine.h b/fxjs/xfa/cfxjse_engine.h
index dc71fcb..3e5e6c7 100644
--- a/fxjs/xfa/cfxjse_engine.h
+++ b/fxjs/xfa/cfxjse_engine.h
@@ -71,12 +71,12 @@
void SetEventParam(CXFA_EventParam* param) { m_eventParam = param; }
CXFA_EventParam* GetEventParam() const { return m_eventParam.Get(); }
bool RunScript(CXFA_Script::Type eScriptType,
- const WideStringView& wsScript,
+ WideStringView wsScript,
CFXJSE_Value* pRetValue,
CXFA_Object* pThisObject);
bool ResolveObjects(CXFA_Object* refObject,
- const WideStringView& wsExpression,
+ WideStringView wsExpression,
XFA_RESOLVENODE_RS* resolveNodeRS,
uint32_t dwStyles,
CXFA_Node* bindNode);
@@ -108,7 +108,7 @@
CXFA_Node* pSubform);
void RemoveBuiltInObjs(CFXJSE_Context* pContext) const;
bool QueryNodeByFlag(CXFA_Node* refNode,
- const WideStringView& propname,
+ WideStringView propname,
CFXJSE_Value* pValue,
uint32_t dwFlag,
bool bSetting);
diff --git a/fxjs/xfa/cfxjse_formcalc_context.cpp b/fxjs/xfa/cfxjse_formcalc_context.cpp
index 45a1a65..08348e8 100644
--- a/fxjs/xfa/cfxjse_formcalc_context.cpp
+++ b/fxjs/xfa/cfxjse_formcalc_context.cpp
@@ -5938,7 +5938,7 @@
}
// static.
-bool CFXJSE_FormCalcContext::Translate(const WideStringView& wsFormcalc,
+bool CFXJSE_FormCalcContext::Translate(WideStringView wsFormcalc,
CFX_WideTextBuf* wsJavascript) {
if (wsFormcalc.IsEmpty()) {
wsJavascript->Clear();
diff --git a/fxjs/xfa/cfxjse_formcalc_context.h b/fxjs/xfa/cfxjse_formcalc_context.h
index fcc223d..7c06a58 100644
--- a/fxjs/xfa/cfxjse_formcalc_context.h
+++ b/fxjs/xfa/cfxjse_formcalc_context.h
@@ -383,7 +383,7 @@
CFXJSE_Value* src,
bool* ret);
- static bool Translate(const WideStringView& wsFormcalc,
+ static bool Translate(WideStringView wsFormcalc,
CFX_WideTextBuf* wsJavascript);
void GlobalPropertyGetter(CFXJSE_Value* pValue);
diff --git a/fxjs/xfa/cfxjse_resolveprocessor.cpp b/fxjs/xfa/cfxjse_resolveprocessor.cpp
index 1a89c5b..29bb17c 100644
--- a/fxjs/xfa/cfxjse_resolveprocessor.cpp
+++ b/fxjs/xfa/cfxjse_resolveprocessor.cpp
@@ -199,10 +199,9 @@
return !rnd.m_Objects.empty();
}
-bool CFXJSE_ResolveProcessor::ResolveForAttributeRs(
- CXFA_Object* curNode,
- CFXJSE_ResolveNodeData& rnd,
- const WideStringView& strAttr) {
+bool CFXJSE_ResolveProcessor::ResolveForAttributeRs(CXFA_Object* curNode,
+ CFXJSE_ResolveNodeData& rnd,
+ WideStringView strAttr) {
Optional<XFA_SCRIPTATTRIBUTEINFO> info =
XFA_GetScriptAttributeByName(curNode->GetElementType(), strAttr);
if (!info.has_value())
@@ -483,7 +482,7 @@
return !rnd.m_Objects.empty();
}
-int32_t CFXJSE_ResolveProcessor::GetFilter(const WideStringView& wsExpression,
+int32_t CFXJSE_ResolveProcessor::GetFilter(WideStringView wsExpression,
int32_t nStart,
CFXJSE_ResolveNodeData& rnd) {
ASSERT(nStart > -1);
diff --git a/fxjs/xfa/cfxjse_resolveprocessor.h b/fxjs/xfa/cfxjse_resolveprocessor.h
index 36e3a1c..e3c4ee0 100644
--- a/fxjs/xfa/cfxjse_resolveprocessor.h
+++ b/fxjs/xfa/cfxjse_resolveprocessor.h
@@ -41,7 +41,7 @@
~CFXJSE_ResolveProcessor();
bool Resolve(CFXJSE_ResolveNodeData& rnd);
- int32_t GetFilter(const WideStringView& wsExpression,
+ int32_t GetFilter(WideStringView wsExpression,
int32_t nStart,
CFXJSE_ResolveNodeData& rnd);
void SetIndexDataBind(WideString& wsNextCondition,
@@ -54,7 +54,7 @@
private:
bool ResolveForAttributeRs(CXFA_Object* curNode,
CFXJSE_ResolveNodeData& rnd,
- const WideStringView& strAttr);
+ WideStringView strAttr);
bool ResolveAnyChild(CFXJSE_ResolveNodeData& rnd);
bool ResolveDollar(CFXJSE_ResolveNodeData& rnd);
bool ResolveExcalmatory(CFXJSE_ResolveNodeData& rnd);
diff --git a/fxjs/xfa/cjx_hostpseudomodel.cpp b/fxjs/xfa/cjx_hostpseudomodel.cpp
index 84e84b6..1eeaffa 100644
--- a/fxjs/xfa/cjx_hostpseudomodel.cpp
+++ b/fxjs/xfa/cjx_hostpseudomodel.cpp
@@ -21,7 +21,7 @@
namespace {
-int32_t FilterName(const WideStringView& wsExpression,
+int32_t FilterName(WideStringView wsExpression,
int32_t nStart,
WideString& wsFilter) {
ASSERT(nStart > -1);
diff --git a/fxjs/xfa/cjx_node.cpp b/fxjs/xfa/cjx_node.cpp
index d44bf63..bce17f0 100644
--- a/fxjs/xfa/cjx_node.cpp
+++ b/fxjs/xfa/cjx_node.cpp
@@ -500,7 +500,7 @@
}
}
-int32_t CJX_Node::execSingleEventByName(const WideStringView& wsEventName,
+int32_t CJX_Node::execSingleEventByName(WideStringView wsEventName,
XFA_Element eType) {
CXFA_FFNotify* pNotify = GetDocument()->GetNotify();
if (!pNotify)
diff --git a/fxjs/xfa/cjx_node.h b/fxjs/xfa/cjx_node.h
index 948ec85..4b026b4 100644
--- a/fxjs/xfa/cjx_node.h
+++ b/fxjs/xfa/cjx_node.h
@@ -39,8 +39,7 @@
CXFA_Node* GetXFANode() const;
protected:
- int32_t execSingleEventByName(const WideStringView& wsEventName,
- XFA_Element eType);
+ int32_t execSingleEventByName(WideStringView wsEventName, XFA_Element eType);
private:
static const CJX_MethodSpec MethodSpecs[];
diff --git a/fxjs/xfa/cjx_object.cpp b/fxjs/xfa/cjx_object.cpp
index faaa0ec..4f28096 100644
--- a/fxjs/xfa/cjx_object.cpp
+++ b/fxjs/xfa/cjx_object.cpp
@@ -62,7 +62,7 @@
XFA_KEYTYPE_Element,
};
-void* GetMapKey_Custom(const WideStringView& wsKey) {
+void* GetMapKey_Custom(WideStringView wsKey) {
uint32_t dwKey = FX_HashCode_GetW(wsKey, false);
return (void*)(uintptr_t)((dwKey << 1) | XFA_KEYTYPE_Custom);
}
@@ -216,7 +216,7 @@
}
void CJX_Object::SetAttribute(XFA_Attribute eAttr,
- const WideStringView& wsValue,
+ WideStringView wsValue,
bool bNotify) {
switch (ToNode(GetXFAObject())->GetAttributeType(eAttr)) {
case XFA_AttributeType::Enum: {
@@ -246,13 +246,13 @@
}
}
-void CJX_Object::SetMapModuleString(void* pKey, const WideStringView& wsValue) {
+void CJX_Object::SetMapModuleString(void* pKey, WideStringView wsValue) {
SetMapModuleBuffer(pKey, const_cast<wchar_t*>(wsValue.unterminated_c_str()),
wsValue.GetLength() * sizeof(wchar_t), nullptr);
}
-void CJX_Object::SetAttribute(const WideStringView& wsAttr,
- const WideStringView& wsValue,
+void CJX_Object::SetAttribute(WideStringView wsAttr,
+ WideStringView wsValue,
bool bNotify) {
Optional<XFA_ATTRIBUTEINFO> attr = XFA_GetAttributeByName(wsValue);
if (!attr.has_value()) {
@@ -263,7 +263,7 @@
SetMapModuleString(pKey, wsValue);
}
-WideString CJX_Object::GetAttribute(const WideStringView& attr) {
+WideString CJX_Object::GetAttribute(WideStringView attr) {
return TryAttribute(attr, true).value_or(WideString());
}
@@ -309,7 +309,7 @@
return {};
}
-Optional<WideString> CJX_Object::TryAttribute(const WideStringView& wsAttr,
+Optional<WideString> CJX_Object::TryAttribute(WideStringView wsAttr,
bool bUseDefault) {
Optional<XFA_ATTRIBUTEINFO> attr = XFA_GetAttributeByName(wsAttr);
if (attr.has_value())
@@ -323,7 +323,7 @@
return {WideString(wsValueC)};
}
-void CJX_Object::RemoveAttribute(const WideStringView& wsAttr) {
+void CJX_Object::RemoveAttribute(WideStringView wsAttr) {
void* pKey = GetMapKey_Custom(wsAttr);
if (pKey)
RemoveMapModuleKey(pKey);
diff --git a/fxjs/xfa/cjx_object.h b/fxjs/xfa/cjx_object.h
index 7c4a1ee..5e3025f 100644
--- a/fxjs/xfa/cjx_object.h
+++ b/fxjs/xfa/cjx_object.h
@@ -75,17 +75,14 @@
const std::vector<v8::Local<v8::Value>>& params);
bool HasAttribute(XFA_Attribute eAttr);
- void SetAttribute(XFA_Attribute eAttr,
- const WideStringView& wsValue,
+ void SetAttribute(XFA_Attribute eAttr, WideStringView wsValue, bool bNotify);
+ void SetAttribute(WideStringView wsAttr,
+ WideStringView wsValue,
bool bNotify);
- void SetAttribute(const WideStringView& wsAttr,
- const WideStringView& wsValue,
- bool bNotify);
- void RemoveAttribute(const WideStringView& wsAttr);
- WideString GetAttribute(const WideStringView& attr);
+ void RemoveAttribute(WideStringView wsAttr);
+ WideString GetAttribute(WideStringView attr);
WideString GetAttribute(XFA_Attribute attr);
- Optional<WideString> TryAttribute(const WideStringView& wsAttr,
- bool bUseDefault);
+ Optional<WideString> TryAttribute(WideStringView wsAttr, bool bUseDefault);
Optional<WideString> TryAttribute(XFA_Attribute eAttr, bool bUseDefault);
Optional<WideString> TryContent(bool bScriptModify, bool bProto);
@@ -221,7 +218,7 @@
protected:
void DefineMethods(pdfium::span<const CJX_MethodSpec> methods);
void MoveBufferMapData(CXFA_Object* pSrcModule, CXFA_Object* pDstModule);
- void SetMapModuleString(void* pKey, const WideStringView& wsValue);
+ void SetMapModuleString(void* pKey, WideStringView wsValue);
void ThrowException(const WideString& str) const;
private:
diff --git a/xfa/fde/cfde_textout.cpp b/xfa/fde/cfde_textout.cpp
index 6d7aaea..46527f5 100644
--- a/xfa/fde/cfde_textout.cpp
+++ b/xfa/fde/cfde_textout.cpp
@@ -284,7 +284,7 @@
}
void CFDE_TextOut::DrawLogicText(CFX_RenderDevice* device,
- const WideStringView& str,
+ WideStringView str,
const CFX_RectF& rect) {
ASSERT(m_pFont);
ASSERT(m_fFontSize >= 1.0f);
diff --git a/xfa/fde/cfde_textout.h b/xfa/fde/cfde_textout.h
index 4db7faf..153f3f5 100644
--- a/xfa/fde/cfde_textout.h
+++ b/xfa/fde/cfde_textout.h
@@ -57,7 +57,7 @@
void CalcLogicSize(const WideString& str, CFX_SizeF* pSize);
void CalcLogicSize(const WideString& str, CFX_RectF* pRect);
void DrawLogicText(CFX_RenderDevice* device,
- const WideStringView& str,
+ WideStringView str,
const CFX_RectF& rect);
int32_t GetTotalLines() const { return m_iTotalLines; }
diff --git a/xfa/fgas/crt/cfgas_formatstring.cpp b/xfa/fgas/crt/cfgas_formatstring.cpp
index 6cbd7b2..f0adc7f 100644
--- a/xfa/fgas/crt/cfgas_formatstring.cpp
+++ b/xfa/fgas/crt/cfgas_formatstring.cpp
@@ -767,7 +767,7 @@
return true;
}
-bool FX_TimeFromCanonical(const WideStringView& wsTime,
+bool FX_TimeFromCanonical(WideStringView wsTime,
CFX_DateTime* datetime,
LocaleIface* pLocale) {
if (wsTime.GetLength() == 0)
@@ -922,9 +922,8 @@
return eCategory;
}
-WideString CFGAS_FormatString::GetTextFormat(
- const WideString& wsPattern,
- const WideStringView& wsCategory) const {
+WideString CFGAS_FormatString::GetTextFormat(const WideString& wsPattern,
+ WideStringView wsCategory) const {
int32_t ccf = 0;
int32_t iLenf = wsPattern.GetLength();
const wchar_t* pStr = wsPattern.c_str();
@@ -1854,7 +1853,7 @@
return iText == iLenText;
}
-bool CFGAS_FormatString::FormatStrNum(const WideStringView& wsInputNum,
+bool CFGAS_FormatString::FormatStrNum(WideStringView wsInputNum,
const WideString& wsPattern,
WideString* wsOutput) const {
if (wsInputNum.IsEmpty() || wsPattern.IsEmpty())
diff --git a/xfa/fgas/crt/cfgas_formatstring.h b/xfa/fgas/crt/cfgas_formatstring.h
index 0c51ef3..c581dda 100644
--- a/xfa/fgas/crt/cfgas_formatstring.h
+++ b/xfa/fgas/crt/cfgas_formatstring.h
@@ -15,7 +15,7 @@
class CXFA_LocaleMgr;
bool FX_DateFromCanonical(const WideString& wsDate, CFX_DateTime* datetime);
-bool FX_TimeFromCanonical(const WideStringView& wsTime,
+bool FX_TimeFromCanonical(WideStringView wsTime,
CFX_DateTime* datetime,
LocaleIface* pLocale);
@@ -58,12 +58,12 @@
private:
WideString GetTextFormat(const WideString& wsPattern,
- const WideStringView& wsCategory) const;
+ WideStringView wsCategory) const;
LocaleIface* GetNumericFormat(const WideString& wsPattern,
int32_t* iDotIndex,
uint32_t* dwStyle,
WideString* wsPurgePattern) const;
- bool FormatStrNum(const WideStringView& wsInputNum,
+ bool FormatStrNum(WideStringView wsInputNum,
const WideString& wsPattern,
WideString* wsOutput) const;
FX_DATETIMETYPE GetDateTimeFormat(const WideString& wsPattern,
diff --git a/xfa/fgas/font/cfgas_defaultfontmanager.cpp b/xfa/fgas/font/cfgas_defaultfontmanager.cpp
index 6d97b6a..829c2d3 100644
--- a/xfa/fgas/font/cfgas_defaultfontmanager.cpp
+++ b/xfa/fgas/font/cfgas_defaultfontmanager.cpp
@@ -12,7 +12,7 @@
// static
RetainPtr<CFGAS_GEFont> CFGAS_DefaultFontManager::GetFont(
CFGAS_FontMgr* pFontMgr,
- const WideStringView& wsFontFamily,
+ WideStringView wsFontFamily,
uint32_t dwFontStyles) {
WideString wsFontName(wsFontFamily);
RetainPtr<CFGAS_GEFont> pFont =
@@ -56,7 +56,7 @@
// static
RetainPtr<CFGAS_GEFont> CFGAS_DefaultFontManager::GetDefaultFont(
CFGAS_FontMgr* pFontMgr,
- const WideStringView& wsFontFamily,
+ WideStringView wsFontFamily,
uint32_t dwFontStyles) {
RetainPtr<CFGAS_GEFont> pFont =
pFontMgr->LoadFont(L"Arial Narrow", dwFontStyles, 0xFFFF);
diff --git a/xfa/fgas/font/cfgas_defaultfontmanager.h b/xfa/fgas/font/cfgas_defaultfontmanager.h
index e1b36be..ebf2f3c 100644
--- a/xfa/fgas/font/cfgas_defaultfontmanager.h
+++ b/xfa/fgas/font/cfgas_defaultfontmanager.h
@@ -16,12 +16,11 @@
class CFGAS_DefaultFontManager {
public:
static RetainPtr<CFGAS_GEFont> GetFont(CFGAS_FontMgr* pFontMgr,
- const WideStringView& wsFontFamily,
+ WideStringView wsFontFamily,
uint32_t dwFontStyles);
- static RetainPtr<CFGAS_GEFont> GetDefaultFont(
- CFGAS_FontMgr* pFontMgr,
- const WideStringView& wsFontFamily,
- uint32_t dwFontStyles);
+ static RetainPtr<CFGAS_GEFont> GetDefaultFont(CFGAS_FontMgr* pFontMgr,
+ WideStringView wsFontFamily,
+ uint32_t dwFontStyles);
CFGAS_DefaultFontManager() = delete;
CFGAS_DefaultFontManager(const CFGAS_DefaultFontManager&) = delete;
diff --git a/xfa/fgas/font/cfgas_pdffontmgr.cpp b/xfa/fgas/font/cfgas_pdffontmgr.cpp
index c1d6ada..ee18aa4 100644
--- a/xfa/fgas/font/cfgas_pdffontmgr.cpp
+++ b/xfa/fgas/font/cfgas_pdffontmgr.cpp
@@ -73,10 +73,9 @@
return nullptr;
}
-RetainPtr<CFGAS_GEFont> CFGAS_PDFFontMgr::GetFont(
- const WideStringView& wsFontFamily,
- uint32_t dwFontStyles,
- bool bStrictMatch) {
+RetainPtr<CFGAS_GEFont> CFGAS_PDFFontMgr::GetFont(WideStringView wsFontFamily,
+ uint32_t dwFontStyles,
+ bool bStrictMatch) {
uint32_t dwHashCode = FX_HashCode_GetW(wsFontFamily, false);
ByteString strKey = ByteString::Format("%u%u", dwHashCode, dwFontStyles);
auto it = m_FontMap.find(strKey);
diff --git a/xfa/fgas/font/cfgas_pdffontmgr.h b/xfa/fgas/font/cfgas_pdffontmgr.h
index 08d91c8..38fdd92 100644
--- a/xfa/fgas/font/cfgas_pdffontmgr.h
+++ b/xfa/fgas/font/cfgas_pdffontmgr.h
@@ -22,7 +22,7 @@
explicit CFGAS_PDFFontMgr(CPDF_Document* pDoc, CFGAS_FontMgr* pFontMgr);
~CFGAS_PDFFontMgr();
- RetainPtr<CFGAS_GEFont> GetFont(const WideStringView& wsFontFamily,
+ RetainPtr<CFGAS_GEFont> GetFont(WideStringView wsFontFamily,
uint32_t dwFontStyles,
bool bStrictMatch);
diff --git a/xfa/fgas/font/fgas_fontutils.cpp b/xfa/fgas/font/fgas_fontutils.cpp
index ef3f6d1..3087309 100644
--- a/xfa/fgas/font/fgas_fontutils.cpp
+++ b/xfa/fgas/font/fgas_fontutils.cpp
@@ -1868,7 +1868,7 @@
return nullptr;
}
-WideString FGAS_FontNameToEnglishName(const WideStringView& wsLocalName) {
+WideString FGAS_FontNameToEnglishName(WideStringView wsLocalName) {
uint32_t dwLocalNameHash = FX_HashCode_GetW(wsLocalName, true);
const FGAS_FontInfo* pEnd = g_XFAFontsMap + FX_ArraySize(g_XFAFontsMap);
const FGAS_FontInfo* pFontInfo =
@@ -1881,7 +1881,7 @@
return WideString(wsLocalName);
}
-const FGAS_FontInfo* FGAS_FontInfoByFontName(const WideStringView& wsFontName) {
+const FGAS_FontInfo* FGAS_FontInfoByFontName(WideStringView wsFontName) {
WideString wsFontNameTemp(wsFontName);
wsFontNameTemp.Remove(L' ');
uint32_t dwCurFontNameHash =
diff --git a/xfa/fgas/font/fgas_fontutils.h b/xfa/fgas/font/fgas_fontutils.h
index 93e5a01..ecdcd87 100644
--- a/xfa/fgas/font/fgas_fontutils.h
+++ b/xfa/fgas/font/fgas_fontutils.h
@@ -26,8 +26,8 @@
uint16_t wCodePage;
};
-WideString FGAS_FontNameToEnglishName(const WideStringView& wsLocalName);
+WideString FGAS_FontNameToEnglishName(WideStringView wsLocalName);
-const FGAS_FontInfo* FGAS_FontInfoByFontName(const WideStringView& wsFontName);
+const FGAS_FontInfo* FGAS_FontInfoByFontName(WideStringView wsFontName);
#endif // XFA_FGAS_FONT_FGAS_FONTUTILS_H_
diff --git a/xfa/fwl/cfwl_combobox.cpp b/xfa/fwl/cfwl_combobox.cpp
index b4a79fe..a835528 100644
--- a/xfa/fwl/cfwl_combobox.cpp
+++ b/xfa/fwl/cfwl_combobox.cpp
@@ -42,7 +42,7 @@
return FWL_Type::ComboBox;
}
-void CFWL_ComboBox::AddString(const WideStringView& wsText) {
+void CFWL_ComboBox::AddString(WideStringView wsText) {
m_pListBox->AddString(wsText);
}
diff --git a/xfa/fwl/cfwl_combobox.h b/xfa/fwl/cfwl_combobox.h
index c136ab5..b7350b0 100644
--- a/xfa/fwl/cfwl_combobox.h
+++ b/xfa/fwl/cfwl_combobox.h
@@ -60,7 +60,7 @@
int32_t GetCurSel() const { return m_iCurSel; }
void SetCurSel(int32_t iSel);
- void AddString(const WideStringView& wsText);
+ void AddString(WideStringView wsText);
void RemoveAt(int32_t iIndex);
void RemoveAll();
diff --git a/xfa/fwl/cfwl_listbox.cpp b/xfa/fwl/cfwl_listbox.cpp
index e652ef9..68dfec6 100644
--- a/xfa/fwl/cfwl_listbox.cpp
+++ b/xfa/fwl/cfwl_listbox.cpp
@@ -907,7 +907,7 @@
return it != m_ItemArray.end() ? it - m_ItemArray.begin() : -1;
}
-CFWL_ListItem* CFWL_ListBox::AddString(const WideStringView& wsAdd) {
+CFWL_ListItem* CFWL_ListBox::AddString(WideStringView wsAdd) {
m_ItemArray.emplace_back(
pdfium::MakeUnique<CFWL_ListItem>(WideString(wsAdd)));
return m_ItemArray.back().get();
diff --git a/xfa/fwl/cfwl_listbox.h b/xfa/fwl/cfwl_listbox.h
index 4a7818c..6b0c012 100644
--- a/xfa/fwl/cfwl_listbox.h
+++ b/xfa/fwl/cfwl_listbox.h
@@ -53,7 +53,7 @@
CFWL_ListItem* GetItem(const CFWL_Widget* pWidget, int32_t nIndex) const;
int32_t GetItemIndex(CFWL_Widget* pWidget, CFWL_ListItem* pItem);
- CFWL_ListItem* AddString(const WideStringView& wsAdd);
+ CFWL_ListItem* AddString(WideStringView wsAdd);
void RemoveAt(int32_t iIndex);
void DeleteString(CFWL_ListItem* pItem);
void DeleteAll();
diff --git a/xfa/fwl/cfx_barcode.cpp b/xfa/fwl/cfx_barcode.cpp
index ebb3ef1..47ad6f4 100644
--- a/xfa/fwl/cfx_barcode.cpp
+++ b/xfa/fwl/cfx_barcode.cpp
@@ -222,7 +222,7 @@
return m_pBCEngine && m_pBCEngine->SetErrorCorrectionLevel(level);
}
-bool CFX_Barcode::Encode(const WideStringView& contents) {
+bool CFX_Barcode::Encode(WideStringView contents) {
return m_pBCEngine && m_pBCEngine->Encode(contents);
}
diff --git a/xfa/fwl/cfx_barcode.h b/xfa/fwl/cfx_barcode.h
index 488af04..d387671 100644
--- a/xfa/fwl/cfx_barcode.h
+++ b/xfa/fwl/cfx_barcode.h
@@ -26,7 +26,7 @@
static std::unique_ptr<CFX_Barcode> Create(BC_TYPE type);
BC_TYPE GetType();
- bool Encode(const WideStringView& contents);
+ bool Encode(WideStringView contents);
bool RenderDevice(CFX_RenderDevice* device, const CFX_Matrix* matrix);
diff --git a/xfa/fwl/theme/cfwl_widgettp.cpp b/xfa/fwl/theme/cfwl_widgettp.cpp
index 49365ac..bea8b3b 100644
--- a/xfa/fwl/theme/cfwl_widgettp.cpp
+++ b/xfa/fwl/theme/cfwl_widgettp.cpp
@@ -237,14 +237,14 @@
CFWL_FontData::~CFWL_FontData() {}
-bool CFWL_FontData::Equal(const WideStringView& wsFontFamily,
+bool CFWL_FontData::Equal(WideStringView wsFontFamily,
uint32_t dwFontStyles,
uint16_t wCodePage) {
return m_wsFamily == wsFontFamily && m_dwStyles == dwFontStyles &&
m_dwCodePage == wCodePage;
}
-bool CFWL_FontData::LoadFont(const WideStringView& wsFontFamily,
+bool CFWL_FontData::LoadFont(WideStringView wsFontFamily,
uint32_t dwFontStyles,
uint16_t dwCodePage) {
m_wsFamily = wsFontFamily;
@@ -282,10 +282,9 @@
CFWL_FontManager::~CFWL_FontManager() {}
-RetainPtr<CFGAS_GEFont> CFWL_FontManager::FindFont(
- const WideStringView& wsFontFamily,
- uint32_t dwFontStyles,
- uint16_t wCodePage) {
+RetainPtr<CFGAS_GEFont> CFWL_FontManager::FindFont(WideStringView wsFontFamily,
+ uint32_t dwFontStyles,
+ uint16_t wCodePage) {
for (const auto& pData : m_FontsArray) {
if (pData->Equal(wsFontFamily, dwFontStyles, wCodePage))
return pData->GetFont();
diff --git a/xfa/fwl/theme/cfwl_widgettp.h b/xfa/fwl/theme/cfwl_widgettp.h
index 9871298..05f7174 100644
--- a/xfa/fwl/theme/cfwl_widgettp.h
+++ b/xfa/fwl/theme/cfwl_widgettp.h
@@ -89,10 +89,10 @@
CFWL_FontData();
virtual ~CFWL_FontData();
- bool Equal(const WideStringView& wsFontFamily,
+ bool Equal(WideStringView wsFontFamily,
uint32_t dwFontStyles,
uint16_t wCodePage);
- bool LoadFont(const WideStringView& wsFontFamily,
+ bool LoadFont(WideStringView wsFontFamily,
uint32_t dwFontStyles,
uint16_t wCodePage);
RetainPtr<CFGAS_GEFont> GetFont() const;
@@ -110,7 +110,7 @@
static CFWL_FontManager* GetInstance();
static void DestroyInstance();
- RetainPtr<CFGAS_GEFont> FindFont(const WideStringView& wsFontFamily,
+ RetainPtr<CFGAS_GEFont> FindFont(WideStringView wsFontFamily,
uint32_t dwFontStyles,
uint16_t dwCodePage);
diff --git a/xfa/fxfa/cxfa_ffcombobox.cpp b/xfa/fxfa/cxfa_ffcombobox.cpp
index 51d9536..dd74856 100644
--- a/xfa/fxfa/cxfa_ffcombobox.cpp
+++ b/xfa/fxfa/cxfa_ffcombobox.cpp
@@ -281,8 +281,7 @@
InvalidateRect();
}
-void CXFA_FFComboBox::InsertItem(const WideStringView& wsLabel,
- int32_t nIndex) {
+void CXFA_FFComboBox::InsertItem(WideStringView wsLabel, int32_t nIndex) {
ToComboBox(m_pNormalWidget.get())->AddString(wsLabel);
m_pNormalWidget->Update();
InvalidateRect();
diff --git a/xfa/fxfa/cxfa_ffcombobox.h b/xfa/fxfa/cxfa_ffcombobox.h
index 9ed8c40..d68b61c 100644
--- a/xfa/fxfa/cxfa_ffcombobox.h
+++ b/xfa/fxfa/cxfa_ffcombobox.h
@@ -48,7 +48,7 @@
const CFX_Matrix& matrix) override;
// CXFA_FFDropDown
- void InsertItem(const WideStringView& wsLabel, int32_t nIndex) override;
+ void InsertItem(WideStringView wsLabel, int32_t nIndex) override;
void DeleteItem(int32_t nIndex) override;
void OpenDropDownList();
diff --git a/xfa/fxfa/cxfa_ffdoc.cpp b/xfa/fxfa/cxfa_ffdoc.cpp
index e032d22..c2e10f6 100644
--- a/xfa/fxfa/cxfa_ffdoc.cpp
+++ b/xfa/fxfa/cxfa_ffdoc.cpp
@@ -180,10 +180,9 @@
m_pApp->ClearEventTargets();
}
-RetainPtr<CFX_DIBitmap> CXFA_FFDoc::GetPDFNamedImage(
- const WideStringView& wsName,
- int32_t& iImageXDpi,
- int32_t& iImageYDpi) {
+RetainPtr<CFX_DIBitmap> CXFA_FFDoc::GetPDFNamedImage(WideStringView wsName,
+ int32_t& iImageXDpi,
+ int32_t& iImageYDpi) {
if (!m_pPDFDoc)
return nullptr;
diff --git a/xfa/fxfa/cxfa_ffdoc.h b/xfa/fxfa/cxfa_ffdoc.h
index d2aa74b..73e8d1b 100644
--- a/xfa/fxfa/cxfa_ffdoc.h
+++ b/xfa/fxfa/cxfa_ffdoc.h
@@ -60,7 +60,7 @@
CPDF_Document* GetPDFDoc() const { return m_pPDFDoc.Get(); }
CXFA_FFDocView* GetDocView(CXFA_LayoutProcessor* pLayout);
CXFA_FFDocView* GetDocView();
- RetainPtr<CFX_DIBitmap> GetPDFNamedImage(const WideStringView& wsName,
+ RetainPtr<CFX_DIBitmap> GetPDFNamedImage(WideStringView wsName,
int32_t& iImageXDpi,
int32_t& iImageYDpi);
CFGAS_PDFFontMgr* GetPDFFontMgr() const { return m_pPDFFontMgr.get(); }
diff --git a/xfa/fxfa/cxfa_ffdropdown.h b/xfa/fxfa/cxfa_ffdropdown.h
index 20ed766..f2288df 100644
--- a/xfa/fxfa/cxfa_ffdropdown.h
+++ b/xfa/fxfa/cxfa_ffdropdown.h
@@ -13,7 +13,7 @@
public:
~CXFA_FFDropDown() override;
- virtual void InsertItem(const WideStringView& wsLabel, int32_t nIndex) = 0;
+ virtual void InsertItem(WideStringView wsLabel, int32_t nIndex) = 0;
virtual void DeleteItem(int32_t nIndex) = 0;
protected:
diff --git a/xfa/fxfa/cxfa_fflistbox.cpp b/xfa/fxfa/cxfa_fflistbox.cpp
index 09845e8..b778b72 100644
--- a/xfa/fxfa/cxfa_fflistbox.cpp
+++ b/xfa/fxfa/cxfa_fflistbox.cpp
@@ -165,7 +165,7 @@
InvalidateRect();
}
-void CXFA_FFListBox::InsertItem(const WideStringView& wsLabel, int32_t nIndex) {
+void CXFA_FFListBox::InsertItem(WideStringView wsLabel, int32_t nIndex) {
WideString wsTemp(wsLabel);
ToListBox(m_pNormalWidget.get())->AddString(wsTemp.AsStringView());
m_pNormalWidget->Update();
diff --git a/xfa/fxfa/cxfa_fflistbox.h b/xfa/fxfa/cxfa_fflistbox.h
index d65dd8f..47d87d9 100644
--- a/xfa/fxfa/cxfa_fflistbox.h
+++ b/xfa/fxfa/cxfa_fflistbox.h
@@ -25,7 +25,7 @@
FormFieldType GetFormFieldType() override;
// CXFA_FFDropDown
- void InsertItem(const WideStringView& wsLabel, int32_t nIndex) override;
+ void InsertItem(WideStringView wsLabel, int32_t nIndex) override;
void DeleteItem(int32_t nIndex) override;
void OnSelectChanged(CFWL_Widget* pWidget);
diff --git a/xfa/fxfa/cxfa_fontmgr.cpp b/xfa/fxfa/cxfa_fontmgr.cpp
index 62c3e86..2aadb40 100644
--- a/xfa/fxfa/cxfa_fontmgr.cpp
+++ b/xfa/fxfa/cxfa_fontmgr.cpp
@@ -25,10 +25,9 @@
CXFA_FontMgr::~CXFA_FontMgr() = default;
-RetainPtr<CFGAS_GEFont> CXFA_FontMgr::GetFont(
- CXFA_FFDoc* hDoc,
- const WideStringView& wsFontFamily,
- uint32_t dwFontStyles) {
+RetainPtr<CFGAS_GEFont> CXFA_FontMgr::GetFont(CXFA_FFDoc* hDoc,
+ WideStringView wsFontFamily,
+ uint32_t dwFontStyles) {
uint32_t dwHash = FX_HashCode_GetW(wsFontFamily, false);
ByteString bsKey = ByteString::Format("%u%u%u", dwHash, dwFontStyles, 0xFFFF);
auto iter = m_FontMap.find(bsKey);
diff --git a/xfa/fxfa/cxfa_fontmgr.h b/xfa/fxfa/cxfa_fontmgr.h
index 082c064..2ad45dc 100644
--- a/xfa/fxfa/cxfa_fontmgr.h
+++ b/xfa/fxfa/cxfa_fontmgr.h
@@ -20,7 +20,7 @@
~CXFA_FontMgr();
RetainPtr<CFGAS_GEFont> GetFont(CXFA_FFDoc* hDoc,
- const WideStringView& wsFontFamily,
+ WideStringView wsFontFamily,
uint32_t dwFontStyles);
private:
diff --git a/xfa/fxfa/fm2js/cxfa_fmexpression.cpp b/xfa/fxfa/fm2js/cxfa_fmexpression.cpp
index 3027dea..6fbe21d 100644
--- a/xfa/fxfa/fm2js/cxfa_fmexpression.cpp
+++ b/xfa/fxfa/fm2js/cxfa_fmexpression.cpp
@@ -32,7 +32,7 @@
CXFA_FMExpression::CXFA_FMExpression() = default;
CXFA_FMFunctionDefinition::CXFA_FMFunctionDefinition(
- const WideStringView& wsName,
+ WideStringView wsName,
std::vector<WideStringView>&& arguments,
std::vector<std::unique_ptr<CXFA_FMExpression>>&& expressions)
: CXFA_FMExpression(),
@@ -114,7 +114,7 @@
}
CXFA_FMVarExpression::CXFA_FMVarExpression(
- const WideStringView& wsName,
+ WideStringView wsName,
std::unique_ptr<CXFA_FMSimpleExpression> pInit)
: CXFA_FMExpression(), m_wsName(wsName), m_pInit(std::move(pInit)) {}
@@ -343,7 +343,7 @@
}
CXFA_FMForExpression::CXFA_FMForExpression(
- const WideStringView& wsVariant,
+ WideStringView wsVariant,
std::unique_ptr<CXFA_FMSimpleExpression> pAssignment,
std::unique_ptr<CXFA_FMSimpleExpression> pAccessor,
int32_t iDirection,
@@ -404,7 +404,7 @@
}
CXFA_FMForeachExpression::CXFA_FMForeachExpression(
- const WideStringView& wsIdentifier,
+ WideStringView wsIdentifier,
std::vector<std::unique_ptr<CXFA_FMSimpleExpression>>&& pAccessors,
std::unique_ptr<CXFA_FMExpression> pList)
: CXFA_FMExpression(),
diff --git a/xfa/fxfa/fm2js/cxfa_fmexpression.h b/xfa/fxfa/fm2js/cxfa_fmexpression.h
index 37999a1..2761ef5 100644
--- a/xfa/fxfa/fm2js/cxfa_fmexpression.h
+++ b/xfa/fxfa/fm2js/cxfa_fmexpression.h
@@ -26,7 +26,7 @@
class CXFA_FMFunctionDefinition final : public CXFA_FMExpression {
public:
CXFA_FMFunctionDefinition(
- const WideStringView& wsName,
+ WideStringView wsName,
std::vector<WideStringView>&& arguments,
std::vector<std::unique_ptr<CXFA_FMExpression>>&& expressions);
~CXFA_FMFunctionDefinition() override;
@@ -53,7 +53,7 @@
class CXFA_FMVarExpression final : public CXFA_FMExpression {
public:
- CXFA_FMVarExpression(const WideStringView& wsName,
+ CXFA_FMVarExpression(WideStringView wsName,
std::unique_ptr<CXFA_FMSimpleExpression> pInit);
~CXFA_FMVarExpression() override;
@@ -148,7 +148,7 @@
class CXFA_FMForExpression final : public CXFA_FMExpression {
public:
- CXFA_FMForExpression(const WideStringView& wsVariant,
+ CXFA_FMForExpression(WideStringView wsVariant,
std::unique_ptr<CXFA_FMSimpleExpression> pAssignment,
std::unique_ptr<CXFA_FMSimpleExpression> pAccessor,
int32_t iDirection,
@@ -171,7 +171,7 @@
public:
// Takes ownership of |pAccessors|.
CXFA_FMForeachExpression(
- const WideStringView& wsIdentifier,
+ WideStringView wsIdentifier,
std::vector<std::unique_ptr<CXFA_FMSimpleExpression>>&& pAccessors,
std::unique_ptr<CXFA_FMExpression> pList);
~CXFA_FMForeachExpression() override;
diff --git a/xfa/fxfa/fm2js/cxfa_fmlexer.cpp b/xfa/fxfa/fm2js/cxfa_fmlexer.cpp
index c5aa36e..000a683 100644
--- a/xfa/fxfa/fm2js/cxfa_fmlexer.cpp
+++ b/xfa/fxfa/fm2js/cxfa_fmlexer.cpp
@@ -98,7 +98,7 @@
};
#endif // NDEBUG
-XFA_FM_TOKEN TokenizeIdentifier(const WideStringView& str) {
+XFA_FM_TOKEN TokenizeIdentifier(WideStringView str) {
const XFA_FMKeyword* result =
std::find_if(std::begin(keyWords), std::end(keyWords),
[str](const XFA_FMKeyword& iter) {
@@ -129,7 +129,7 @@
}
#endif // NDEBUG
-CXFA_FMLexer::CXFA_FMLexer(const WideStringView& wsFormCalc)
+CXFA_FMLexer::CXFA_FMLexer(WideStringView wsFormCalc)
: m_cursor(wsFormCalc.unterminated_c_str()),
m_end(m_cursor + wsFormCalc.GetLength()),
m_lexer_error(false) {}
diff --git a/xfa/fxfa/fm2js/cxfa_fmlexer.h b/xfa/fxfa/fm2js/cxfa_fmlexer.h
index 2bea518..bc87898 100644
--- a/xfa/fxfa/fm2js/cxfa_fmlexer.h
+++ b/xfa/fxfa/fm2js/cxfa_fmlexer.h
@@ -102,7 +102,7 @@
class CXFA_FMLexer {
public:
- explicit CXFA_FMLexer(const WideStringView& wsFormcalc);
+ explicit CXFA_FMLexer(WideStringView wsFormcalc);
~CXFA_FMLexer();
CXFA_FMToken NextToken();
diff --git a/xfa/fxfa/fm2js/cxfa_fmparser.cpp b/xfa/fxfa/fm2js/cxfa_fmparser.cpp
index 1de6a04..152b5a1 100644
--- a/xfa/fxfa/fm2js/cxfa_fmparser.cpp
+++ b/xfa/fxfa/fm2js/cxfa_fmparser.cpp
@@ -21,7 +21,7 @@
} // namespace
-CXFA_FMParser::CXFA_FMParser(const WideStringView& wsFormcalc)
+CXFA_FMParser::CXFA_FMParser(WideStringView wsFormcalc)
: m_lexer(pdfium::MakeUnique<CXFA_FMLexer>(wsFormcalc)),
m_error(false),
m_parse_depth(0),
diff --git a/xfa/fxfa/fm2js/cxfa_fmparser.h b/xfa/fxfa/fm2js/cxfa_fmparser.h
index bd66aa7..ad2b367 100644
--- a/xfa/fxfa/fm2js/cxfa_fmparser.h
+++ b/xfa/fxfa/fm2js/cxfa_fmparser.h
@@ -15,7 +15,7 @@
class CXFA_FMParser {
public:
- explicit CXFA_FMParser(const WideStringView& wsFormcalc);
+ explicit CXFA_FMParser(WideStringView wsFormcalc);
~CXFA_FMParser();
std::unique_ptr<CXFA_FMAST> Parse();
diff --git a/xfa/fxfa/parser/cxfa_document.cpp b/xfa/fxfa/parser/cxfa_document.cpp
index 052a316..5d94efc 100644
--- a/xfa/fxfa/parser/cxfa_document.cpp
+++ b/xfa/fxfa/parser/cxfa_document.cpp
@@ -1478,7 +1478,7 @@
}
CXFA_Node* CXFA_Document::GetNodeByID(CXFA_Node* pRoot,
- const WideStringView& wsID) const {
+ WideStringView wsID) const {
if (!pRoot || wsID.IsEmpty())
return nullptr;
diff --git a/xfa/fxfa/parser/cxfa_document.h b/xfa/fxfa/parser/cxfa_document.h
index 0449f06..39e3422 100644
--- a/xfa/fxfa/parser/cxfa_document.h
+++ b/xfa/fxfa/parser/cxfa_document.h
@@ -65,7 +65,7 @@
CXFA_FFNotify* GetNotify() const { return notify_.Get(); }
CXFA_LocaleMgr* GetLocaleMgr();
CXFA_Object* GetXFAObject(XFA_HashCode wsNodeNameHash);
- CXFA_Node* GetNodeByID(CXFA_Node* pRoot, const WideStringView& wsID) const;
+ CXFA_Node* GetNodeByID(CXFA_Node* pRoot, WideStringView wsID) const;
CXFA_Node* GetNotBindNode(
const std::vector<UnownedPtr<CXFA_Object>>& arrayNodes) const;
CXFA_LayoutProcessor* GetLayoutProcessor();
diff --git a/xfa/fxfa/parser/cxfa_document_parser.cpp b/xfa/fxfa/parser/cxfa_document_parser.cpp
index 861a789..2264217 100644
--- a/xfa/fxfa/parser/cxfa_document_parser.cpp
+++ b/xfa/fxfa/parser/cxfa_document_parser.cpp
@@ -45,8 +45,8 @@
}
bool MatchNodeName(CFX_XMLNode* pNode,
- const WideStringView& wsLocalTagName,
- const WideStringView& wsNamespaceURIPrefix,
+ WideStringView wsLocalTagName,
+ WideStringView wsNamespaceURIPrefix,
uint32_t eMatchFlags = XFA_XDPPACKET_FLAGS_NOMATCH) {
CFX_XMLElement* pElement = ToXMLElement(pNode);
if (!pElement)
@@ -67,7 +67,7 @@
return wsNodeStr == wsNamespaceURIPrefix;
}
-bool GetAttributeLocalName(const WideStringView& wsAttributeName,
+bool GetAttributeLocalName(WideStringView wsAttributeName,
WideString& wsLocalAttrName) {
WideString wsAttrName(wsAttributeName);
auto pos = wsAttrName.Find(L':', 0);
@@ -101,8 +101,8 @@
}
bool FindAttributeWithNS(CFX_XMLElement* pElement,
- const WideStringView& wsLocalAttributeName,
- const WideStringView& wsNamespaceURIPrefix,
+ WideStringView wsLocalAttributeName,
+ WideStringView wsNamespaceURIPrefix,
WideString& wsValue,
bool bMatchNSAsPrefix = false) {
if (!pElement)
diff --git a/xfa/fxfa/parser/cxfa_measurement.cpp b/xfa/fxfa/parser/cxfa_measurement.cpp
index 05089c7..bb1987a 100644
--- a/xfa/fxfa/parser/cxfa_measurement.cpp
+++ b/xfa/fxfa/parser/cxfa_measurement.cpp
@@ -18,7 +18,7 @@
} // namespace
-CXFA_Measurement::CXFA_Measurement(const WideStringView& wsMeasure) {
+CXFA_Measurement::CXFA_Measurement(WideStringView wsMeasure) {
SetString(wsMeasure);
}
@@ -30,7 +30,7 @@
Set(fValue, eUnit);
}
-void CXFA_Measurement::SetString(const WideStringView& wsMeasure) {
+void CXFA_Measurement::SetString(WideStringView wsMeasure) {
if (wsMeasure.IsEmpty()) {
m_fValue = 0;
m_eUnit = XFA_Unit::Unknown;
@@ -128,7 +128,7 @@
}
// static
-XFA_Unit CXFA_Measurement::GetUnitFromString(const WideStringView& wsUnit) {
+XFA_Unit CXFA_Measurement::GetUnitFromString(WideStringView wsUnit) {
if (wsUnit.EqualsASCII("mm"))
return XFA_Unit::Mm;
if (wsUnit.EqualsASCII("pt"))
diff --git a/xfa/fxfa/parser/cxfa_measurement.h b/xfa/fxfa/parser/cxfa_measurement.h
index d83af24..b2cf2d5 100644
--- a/xfa/fxfa/parser/cxfa_measurement.h
+++ b/xfa/fxfa/parser/cxfa_measurement.h
@@ -13,11 +13,11 @@
class CXFA_Measurement {
public:
- explicit CXFA_Measurement(const WideStringView& wsMeasure);
+ explicit CXFA_Measurement(WideStringView wsMeasure);
CXFA_Measurement();
CXFA_Measurement(float fValue, XFA_Unit eUnit);
- static XFA_Unit GetUnitFromString(const WideStringView& wsUnit);
+ static XFA_Unit GetUnitFromString(WideStringView wsUnit);
void Set(float fValue, XFA_Unit eUnit) {
m_fValue = fValue;
@@ -31,7 +31,7 @@
float ToUnit(XFA_Unit eUnit) const;
private:
- void SetString(const WideStringView& wsMeasure);
+ void SetString(WideStringView wsMeasure);
bool ToUnitInternal(XFA_Unit eUnit, float* fValue) const;
float m_fValue;
diff --git a/xfa/fxfa/parser/cxfa_node.cpp b/xfa/fxfa/parser/cxfa_node.cpp
index 200e296..bbb6c42 100644
--- a/xfa/fxfa/parser/cxfa_node.cpp
+++ b/xfa/fxfa/parser/cxfa_node.cpp
@@ -1548,7 +1548,7 @@
XFA_AttributeValue::Unknown, false);
}
-CXFA_Node* CXFA_Node::GetFirstChildByName(const WideStringView& wsName) const {
+CXFA_Node* CXFA_Node::GetFirstChildByName(WideStringView wsName) const {
return GetFirstChildByName(FX_HashCode_GetW(wsName, false));
}
@@ -1580,7 +1580,7 @@
}
CXFA_Node* CXFA_Node::GetNextSameNameSiblingInternal(
- const WideStringView& wsNodeName) const {
+ WideStringView wsNodeName) const {
return GetNextSameNameSibling(FX_HashCode_GetW(wsNodeName, false));
}
@@ -3969,8 +3969,7 @@
return pSelectedMember;
}
-CXFA_Node* CXFA_Node::SetSelectedMember(const WideStringView& wsName,
- bool bNotify) {
+CXFA_Node* CXFA_Node::SetSelectedMember(WideStringView wsName, bool bNotify) {
uint32_t nameHash = FX_HashCode_GetW(wsName, false);
for (CXFA_Node* pNode = ToNode(GetFirstChild()); pNode;
pNode = pNode->GetNextSibling()) {
@@ -3982,7 +3981,7 @@
return nullptr;
}
-void CXFA_Node::SetSelectedMemberByValue(const WideStringView& wsValue,
+void CXFA_Node::SetSelectedMemberByValue(WideStringView wsValue,
bool bNotify,
bool bScriptModify,
bool bSyncData) {
@@ -4378,7 +4377,7 @@
wsValue.c_str(), nIndex);
}
-WideString CXFA_Node::GetItemLabel(const WideStringView& wsValue) const {
+WideString CXFA_Node::GetItemLabel(WideStringView wsValue) const {
std::vector<CXFA_Node*> listitems;
CXFA_Node* pItems = GetFirstChild();
for (; pItems; pItems = pItems->GetNextSibling()) {
@@ -4418,7 +4417,7 @@
return pText ? pText->JSObject()->GetContent(false) : WideString();
}
-WideString CXFA_Node::GetItemValue(const WideStringView& wsLabel) {
+WideString CXFA_Node::GetItemValue(WideStringView wsLabel) {
int32_t iCount = 0;
std::vector<CXFA_Node*> listitems;
for (CXFA_Node* pItems = GetFirstChild(); pItems;
diff --git a/xfa/fxfa/parser/cxfa_node.h b/xfa/fxfa/parser/cxfa_node.h
index 8e3cac2..d02835c 100644
--- a/xfa/fxfa/parser/cxfa_node.h
+++ b/xfa/fxfa/parser/cxfa_node.h
@@ -195,7 +195,7 @@
Optional<WideString> GetLocaleName();
XFA_AttributeValue GetIntact();
- CXFA_Node* GetFirstChildByName(const WideStringView& wsNodeName) const;
+ CXFA_Node* GetFirstChildByName(WideStringView wsNodeName) const;
CXFA_Node* GetFirstChildByName(uint32_t dwNodeNameHash) const;
template <typename T>
T* GetFirstChildByClass(XFA_Element eType) const {
@@ -203,7 +203,7 @@
}
CXFA_Node* GetNextSameNameSibling(uint32_t dwNodeNameHash) const;
template <typename T>
- T* GetNextSameNameSibling(const WideStringView& wsNodeName) const {
+ T* GetNextSameNameSibling(WideStringView wsNodeName) const {
return static_cast<T*>(GetNextSameNameSiblingInternal(wsNodeName));
}
template <typename T>
@@ -313,8 +313,8 @@
void SetCheckState(XFA_CHECKSTATE eCheckState, bool bNotify);
CXFA_Node* GetSelectedMember();
- CXFA_Node* SetSelectedMember(const WideStringView& wsName, bool bNotify);
- void SetSelectedMemberByValue(const WideStringView& wsValue,
+ CXFA_Node* SetSelectedMember(WideStringView wsName, bool bNotify);
+ void SetSelectedMemberByValue(WideStringView wsValue,
bool bNotify,
bool bScriptModify,
bool bSyncData);
@@ -350,7 +350,7 @@
bool bScriptModify,
bool bSyncData);
- WideString GetItemValue(const WideStringView& wsLabel);
+ WideString GetItemValue(WideStringView wsLabel);
bool IsHorizontalScrollPolicyOff();
bool IsVerticalScrollPolicyOff();
@@ -416,8 +416,7 @@
XFA_AttributeType eType) const;
CXFA_Node* GetChildInternal(size_t index, XFA_Element eType, bool bOnlyChild);
CXFA_Node* GetFirstChildByClassInternal(XFA_Element eType) const;
- CXFA_Node* GetNextSameNameSiblingInternal(
- const WideStringView& wsNodeName) const;
+ CXFA_Node* GetNextSameNameSiblingInternal(WideStringView wsNodeName) const;
CXFA_Node* GetNextSameClassSiblingInternal(XFA_Element eType) const;
void CalcCaptionSize(CXFA_FFDoc* doc, CFX_SizeF* pszCap);
bool CalculateFieldAutoSize(CXFA_FFDoc* doc, CFX_SizeF* pSize);
@@ -442,7 +441,7 @@
void InsertListTextItem(CXFA_Node* pItems,
const WideString& wsText,
int32_t nIndex);
- WideString GetItemLabel(const WideStringView& wsValue) const;
+ WideString GetItemLabel(WideStringView wsValue) const;
std::pair<XFA_FFWidgetType, CXFA_Ui*> CreateChildUIAndValueNodesIfNeeded();
void CreateValueNodeIfNeeded(CXFA_Value* value, CXFA_Node* pUIChild);
diff --git a/xfa/fxfa/parser/cxfa_nodelocale.cpp b/xfa/fxfa/parser/cxfa_nodelocale.cpp
index 9d495f4..01d2dc5 100644
--- a/xfa/fxfa/parser/cxfa_nodelocale.cpp
+++ b/xfa/fxfa/parser/cxfa_nodelocale.cpp
@@ -135,7 +135,7 @@
}
CXFA_Node* CXFA_NodeLocale::GetNodeByName(CXFA_Node* pParent,
- const WideStringView& wsName) const {
+ WideStringView wsName) const {
CXFA_Node* pChild = pParent ? pParent->GetFirstChild() : nullptr;
while (pChild) {
if (pChild->JSObject()->GetAttribute(XFA_Attribute::Name) == wsName)
@@ -147,7 +147,7 @@
}
WideString CXFA_NodeLocale::GetSymbol(XFA_Element eElement,
- const WideStringView& symbol_type) const {
+ WideStringView symbol_type) const {
CXFA_Node* pSymbols =
m_pLocale ? m_pLocale->GetChild<CXFA_Node>(0, eElement, false) : nullptr;
CXFA_Node* pSymbol = GetNodeByName(pSymbols, symbol_type);
diff --git a/xfa/fxfa/parser/cxfa_nodelocale.h b/xfa/fxfa/parser/cxfa_nodelocale.h
index 8ce70d3..b30decf 100644
--- a/xfa/fxfa/parser/cxfa_nodelocale.h
+++ b/xfa/fxfa/parser/cxfa_nodelocale.h
@@ -38,10 +38,8 @@
WideString GetNumPattern(FX_LOCALENUMSUBCATEGORY eType) const override;
private:
- CXFA_Node* GetNodeByName(CXFA_Node* pParent,
- const WideStringView& wsName) const;
- WideString GetSymbol(XFA_Element eElement,
- const WideStringView& symbol_type) const;
+ CXFA_Node* GetNodeByName(CXFA_Node* pParent, WideStringView wsName) const;
+ WideString GetSymbol(XFA_Element eElement, WideStringView symbol_type) const;
WideString GetCalendarSymbol(XFA_Element eElement,
int index,
bool bAbbr) const;
diff --git a/xfa/fxfa/parser/cxfa_treelist.cpp b/xfa/fxfa/parser/cxfa_treelist.cpp
index 3d0f748..2dbec60 100644
--- a/xfa/fxfa/parser/cxfa_treelist.cpp
+++ b/xfa/fxfa/parser/cxfa_treelist.cpp
@@ -21,7 +21,7 @@
CXFA_TreeList::~CXFA_TreeList() = default;
-CXFA_Node* CXFA_TreeList::NamedItem(const WideStringView& wsName) {
+CXFA_Node* CXFA_TreeList::NamedItem(WideStringView wsName) {
uint32_t dwHashCode = FX_HashCode_GetW(wsName, false);
size_t count = GetLength();
for (size_t i = 0; i < count; i++) {
diff --git a/xfa/fxfa/parser/cxfa_treelist.h b/xfa/fxfa/parser/cxfa_treelist.h
index 997c763..a194e32 100644
--- a/xfa/fxfa/parser/cxfa_treelist.h
+++ b/xfa/fxfa/parser/cxfa_treelist.h
@@ -17,7 +17,7 @@
explicit CXFA_TreeList(CXFA_Document* pDocument);
~CXFA_TreeList() override;
- CXFA_Node* NamedItem(const WideStringView& wsName);
+ CXFA_Node* NamedItem(WideStringView wsName);
};
#endif // XFA_FXFA_PARSER_CXFA_TREELIST_H_
diff --git a/xfa/fxfa/parser/cxfa_xmllocale.cpp b/xfa/fxfa/parser/cxfa_xmllocale.cpp
index 0b7da69..c7a6f47 100644
--- a/xfa/fxfa/parser/cxfa_xmllocale.cpp
+++ b/xfa/fxfa/parser/cxfa_xmllocale.cpp
@@ -121,7 +121,7 @@
return GetCalendarSymbol(L"era", bAD ? 1 : 0, false);
}
-WideString CXFA_XMLLocale::GetCalendarSymbol(const WideStringView& symbol,
+WideString CXFA_XMLLocale::GetCalendarSymbol(WideStringView symbol,
size_t index,
bool bAbbr) const {
CFX_XMLElement* child = locale_->GetFirstChildNamed(L"calendarSymbols");
@@ -209,8 +209,8 @@
}
WideString CXFA_XMLLocale::GetPattern(CFX_XMLElement* patterns,
- const WideStringView& bsTag,
- const WideStringView& wsName) const {
+ WideStringView bsTag,
+ WideStringView wsName) const {
for (auto* child = patterns->GetFirstChild(); child;
child = child->GetNextSibling()) {
CFX_XMLElement* pattern = ToXMLElement(child);
diff --git a/xfa/fxfa/parser/cxfa_xmllocale.h b/xfa/fxfa/parser/cxfa_xmllocale.h
index e0e165b..cacbddc 100644
--- a/xfa/fxfa/parser/cxfa_xmllocale.h
+++ b/xfa/fxfa/parser/cxfa_xmllocale.h
@@ -43,9 +43,9 @@
private:
WideString GetPattern(CFX_XMLElement* pElement,
- const WideStringView& bsTag,
- const WideStringView& wsName) const;
- WideString GetCalendarSymbol(const WideStringView& symbol,
+ WideStringView bsTag,
+ WideStringView wsName) const;
+ WideString GetCalendarSymbol(WideStringView symbol,
size_t index,
bool bAbbr) const;
diff --git a/xfa/fxfa/parser/xfa_basic_data.cpp b/xfa/fxfa/parser/xfa_basic_data.cpp
index 655c11f..72c8790 100644
--- a/xfa/fxfa/parser/xfa_basic_data.cpp
+++ b/xfa/fxfa/parser/xfa_basic_data.cpp
@@ -233,7 +233,7 @@
return {pRecord->name, pRecord->packet_type, pRecord->uri, pRecord->flags};
}
-Optional<XFA_PACKETINFO> XFA_GetPacketByName(const WideStringView& wsName) {
+Optional<XFA_PACKETINFO> XFA_GetPacketByName(WideStringView wsName) {
uint32_t hash = FX_HashCode_GetW(wsName, false);
auto* elem = std::lower_bound(
std::begin(g_PacketTable), std::end(g_PacketTable), hash,
@@ -261,7 +261,7 @@
return g_AttributeTable[static_cast<size_t>(attr)].name;
}
-Optional<XFA_ATTRIBUTEINFO> XFA_GetAttributeByName(const WideStringView& name) {
+Optional<XFA_ATTRIBUTEINFO> XFA_GetAttributeByName(WideStringView name) {
uint32_t hash = FX_HashCode_GetW(name, false);
auto* elem = std::lower_bound(
std::begin(g_AttributeTable), std::end(g_AttributeTable), hash,
@@ -279,8 +279,7 @@
return g_AttributeValueTable[static_cast<int32_t>(item)].pName;
}
-Optional<XFA_AttributeValue> XFA_GetAttributeValueByName(
- const WideStringView& name) {
+Optional<XFA_AttributeValue> XFA_GetAttributeValueByName(WideStringView name) {
auto* it = std::lower_bound(std::begin(g_AttributeValueTable),
std::end(g_AttributeValueTable),
FX_HashCode_GetW(name, false),
diff --git a/xfa/fxfa/parser/xfa_basic_data.h b/xfa/fxfa/parser/xfa_basic_data.h
index da892d6..c6ce222 100644
--- a/xfa/fxfa/parser/xfa_basic_data.h
+++ b/xfa/fxfa/parser/xfa_basic_data.h
@@ -33,17 +33,16 @@
};
XFA_PACKETINFO XFA_GetPacketByIndex(XFA_PacketType ePacket);
-Optional<XFA_PACKETINFO> XFA_GetPacketByName(const WideStringView& wsName);
+Optional<XFA_PACKETINFO> XFA_GetPacketByName(WideStringView wsName);
ByteStringView XFA_ElementToName(XFA_Element elem);
XFA_Element XFA_GetElementByName(const WideString& name);
ByteStringView XFA_AttributeToName(XFA_Attribute attr);
-Optional<XFA_ATTRIBUTEINFO> XFA_GetAttributeByName(const WideStringView& name);
+Optional<XFA_ATTRIBUTEINFO> XFA_GetAttributeByName(WideStringView name);
ByteStringView XFA_AttributeValueToName(XFA_AttributeValue item);
-Optional<XFA_AttributeValue> XFA_GetAttributeValueByName(
- const WideStringView& name);
+Optional<XFA_AttributeValue> XFA_GetAttributeValueByName(WideStringView name);
Optional<XFA_SCRIPTATTRIBUTEINFO> XFA_GetScriptAttributeByName(
XFA_Element eElement,