Convert to absl::optional, part 2.
Search and replace. Then clang-format. Leave the headers alone for now.
Bug: pdfium:1726
Change-Id: I767fab04333e0fc95761f21190a2763920d51b93
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/85518
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
diff --git a/samples/pdfium_test.cc b/samples/pdfium_test.cc
index 36db5ff..87f8975 100644
--- a/samples/pdfium_test.cc
+++ b/samples/pdfium_test.cc
@@ -176,7 +176,7 @@
return flags;
}
-Optional<std::string> ExpandDirectoryPath(const std::string& path) {
+absl::optional<std::string> ExpandDirectoryPath(const std::string& path) {
#if defined(WORDEXP_AVAILABLE)
wordexp_t expansion;
if (wordexp(path.c_str(), &expansion, 0) != 0 || expansion.we_wordc < 1) {
@@ -185,7 +185,7 @@
}
// Need to contruct the return value before hand, since wordfree will
// deallocate |expansion|.
- Optional<std::string> ret_val = {expansion.we_wordv[0]};
+ absl::optional<std::string> ret_val = {expansion.we_wordv[0]};
wordfree(&expansion);
return ret_val;
#else
@@ -193,7 +193,7 @@
#endif // WORDEXP_AVAILABLE
}
-Optional<const char*> GetCustomFontPath(const Options& options) {
+absl::optional<const char*> GetCustomFontPath(const Options& options) {
#if defined(__APPLE__) || (defined(__linux__) && !defined(__ANDROID__))
// Set custom font path to an empty path. This avoids the fallback to default
// font paths.
@@ -533,7 +533,7 @@
return false;
}
std::string path = value;
- Optional<std::string> expanded_path = ExpandDirectoryPath(path);
+ absl::optional<std::string> expanded_path = ExpandDirectoryPath(path);
if (!expanded_path.has_value()) {
fprintf(stderr, "Failed to expand --font-dir, %s\n", path.c_str());
return false;
@@ -588,7 +588,7 @@
return false;
}
std::string path = value;
- Optional<std::string> expanded_path = ExpandDirectoryPath(path);
+ absl::optional<std::string> expanded_path = ExpandDirectoryPath(path);
if (!expanded_path.has_value()) {
fprintf(stderr, "Failed to expand --bin-dir, %s\n", path.c_str());
return false;
@@ -1224,7 +1224,7 @@
#endif // PDF_ENABLE_V8
const char* path_array[2] = {nullptr, nullptr};
- Optional<const char*> custom_font_path = GetCustomFontPath(options);
+ absl::optional<const char*> custom_font_path = GetCustomFontPath(options);
if (custom_font_path.has_value()) {
path_array[0] = custom_font_path.value();
config.m_pUserFontPaths = path_array;
diff --git a/testing/scoped_set_tz.h b/testing/scoped_set_tz.h
index 19c633c..68269b9 100644
--- a/testing/scoped_set_tz.h
+++ b/testing/scoped_set_tz.h
@@ -20,7 +20,7 @@
~ScopedSetTZ();
private:
- Optional<std::string> old_tz_;
+ absl::optional<std::string> old_tz_;
};
#endif // TESTING_SCOPED_SET_TZ_H_
diff --git a/third_party/base/template_util.h b/third_party/base/template_util.h
index b5e1a1e..2e26a8b 100644
--- a/third_party/base/template_util.h
+++ b/third_party/base/template_util.h
@@ -131,8 +131,9 @@
#if defined(__GNUC__) && !defined(__clang__) && __GNUC__ <= 7
// Workaround for g++7 and earlier family.
// Due to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80654, without this
-// Optional<std::vector<T>> where T is non-copyable causes a compile error.
-// As we know it is not trivially copy constructible, explicitly declare so.
+// absl::optional<std::vector<T>> where T is non-copyable causes a compile
+// error. As we know it is not trivially copy constructible, explicitly declare
+// so.
template <typename T>
struct is_trivially_copy_constructible
: std::is_trivially_copy_constructible<T> {};
diff --git a/xfa/fgas/font/cfgas_fontmgr.h b/xfa/fgas/font/cfgas_fontmgr.h
index 8cab66d..ed67cb9 100644
--- a/xfa/fgas/font/cfgas_fontmgr.h
+++ b/xfa/fgas/font/cfgas_fontmgr.h
@@ -147,7 +147,7 @@
std::deque<FX_FONTDESCRIPTOR> m_FontFaces;
#else
std::vector<std::unique_ptr<CFGAS_FontDescriptor>> m_InstalledFonts;
- std::map<uint32_t, Optional<std::vector<CFGAS_FontDescriptorInfo>>>
+ std::map<uint32_t, absl::optional<std::vector<CFGAS_FontDescriptorInfo>>>
m_Hash2CandidateList;
#endif // defined(OS_WIN)
};
diff --git a/xfa/fgas/font/cfgas_gefont.cpp b/xfa/fgas/font/cfgas_gefont.cpp
index bdbc5e8..9ab418a 100644
--- a/xfa/fgas/font/cfgas_gefont.cpp
+++ b/xfa/fgas/font/cfgas_gefont.cpp
@@ -152,7 +152,7 @@
return dwStyles;
}
-Optional<uint16_t> CFGAS_GEFont::GetCharWidth(wchar_t wUnicode) {
+absl::optional<uint16_t> CFGAS_GEFont::GetCharWidth(wchar_t wUnicode) {
auto it = m_CharWidthMap.find(wUnicode);
if (it != m_CharWidthMap.end())
return it->second;
@@ -177,7 +177,7 @@
return width;
}
-Optional<FX_RECT> CFGAS_GEFont::GetCharBBox(wchar_t wUnicode) {
+absl::optional<FX_RECT> CFGAS_GEFont::GetCharBBox(wchar_t wUnicode) {
auto it = m_BBoxMap.find(wUnicode);
if (it != m_BBoxMap.end())
return it->second;
@@ -191,7 +191,7 @@
if (pFont.Get() != this)
return pFont->GetCharBBox(wUnicode);
- Optional<FX_RECT> rtBBox = m_pFont->GetGlyphBBox(iGlyph);
+ absl::optional<FX_RECT> rtBBox = m_pFont->GetGlyphBBox(iGlyph);
if (rtBBox.has_value())
m_BBoxMap[wUnicode] = rtBBox.value();
diff --git a/xfa/fgas/font/cfgas_gefont.h b/xfa/fgas/font/cfgas_gefont.h
index b11dbbf..741958a 100644
--- a/xfa/fgas/font/cfgas_gefont.h
+++ b/xfa/fgas/font/cfgas_gefont.h
@@ -40,11 +40,11 @@
const ByteString& font_family);
uint32_t GetFontStyles() const;
- Optional<uint16_t> GetCharWidth(wchar_t wUnicode);
+ absl::optional<uint16_t> GetCharWidth(wchar_t wUnicode);
int32_t GetGlyphIndex(wchar_t wUnicode);
int32_t GetAscent() const;
int32_t GetDescent() const;
- Optional<FX_RECT> GetCharBBox(wchar_t wUnicode);
+ absl::optional<FX_RECT> GetCharBBox(wchar_t wUnicode);
RetainPtr<CFGAS_GEFont> GetSubstFont(int32_t iGlyphIndex);
CFX_Font* GetDevFont() const { return m_pFont.Get(); }
@@ -71,11 +71,11 @@
bool bRecursive);
WideString GetFamilyName() const;
- Optional<uint32_t> m_dwLogFontStyle;
+ absl::optional<uint32_t> m_dwLogFontStyle;
RetainPtr<CPDF_Font> m_pPDFFont; // Must come before |m_pFont|.
MaybeOwned<CFX_Font> m_pFont; // Must come before |m_pFontEncoding|.
std::unique_ptr<CFX_UnicodeEncodingEx> m_pFontEncoding;
- std::map<wchar_t, Optional<uint16_t>> m_CharWidthMap;
+ std::map<wchar_t, absl::optional<uint16_t>> m_CharWidthMap;
std::map<wchar_t, FX_RECT> m_BBoxMap;
std::vector<RetainPtr<CFGAS_GEFont>> m_SubstFonts;
std::map<wchar_t, RetainPtr<CFGAS_GEFont>> m_FontMapper;
diff --git a/xfa/fgas/layout/cfgas_rtfbreak.cpp b/xfa/fgas/layout/cfgas_rtfbreak.cpp
index 401bdfa..b290c2d 100644
--- a/xfa/fgas/layout/cfgas_rtfbreak.cpp
+++ b/xfa/fgas/layout/cfgas_rtfbreak.cpp
@@ -123,7 +123,7 @@
}
void CFGAS_RTFBreak::AppendChar_Combination(CFGAS_Char* pCurChar) {
- Optional<uint16_t> iCharWidthRet;
+ absl::optional<uint16_t> iCharWidthRet;
if (m_pFont) {
iCharWidthRet = m_pFont->GetCharWidth(pCurChar->char_code());
}
@@ -213,7 +213,7 @@
pLastChar->GetCharType() == FX_CHARTYPE::kArabicAlef);
FX_SAFE_INT32 iCharWidth = 0;
if (m_pFont) {
- Optional<uint16_t> iCharWidthRet = m_pFont->GetCharWidth(wForm);
+ absl::optional<uint16_t> iCharWidthRet = m_pFont->GetCharWidth(wForm);
if (iCharWidthRet.has_value()) {
iCharWidth = iCharWidthRet.value();
} else {
@@ -242,7 +242,7 @@
nullptr);
FX_SAFE_INT32 iCharWidth = 0;
if (m_pFont) {
- Optional<uint16_t> iCharWidthRet = m_pFont->GetCharWidth(wForm);
+ absl::optional<uint16_t> iCharWidthRet = m_pFont->GetCharWidth(wForm);
if (!iCharWidthRet.has_value())
iCharWidthRet = m_pFont->GetCharWidth(pCurChar->char_code());
iCharWidth = iCharWidthRet.value_or(0);
diff --git a/xfa/fgas/layout/cfgas_txtbreak.cpp b/xfa/fgas/layout/cfgas_txtbreak.cpp
index 3845f11..49e7031 100644
--- a/xfa/fgas/layout/cfgas_txtbreak.cpp
+++ b/xfa/fgas/layout/cfgas_txtbreak.cpp
@@ -64,7 +64,7 @@
if (pLastChar &&
(pLastChar->m_dwCharStyles & FX_TXTCHARSTYLE_ArabicShadda) == 0) {
wchar_t wLast = pLastChar->char_code();
- Optional<uint16_t> maybe_shadda;
+ absl::optional<uint16_t> maybe_shadda;
if (wch == pdfium::arabic::kArabicShadda) {
maybe_shadda = pdfium::arabic::GetArabicFromShaddaTable(wLast);
} else if (wLast == pdfium::arabic::kArabicShadda) {
@@ -77,7 +77,7 @@
pLastChar->m_iCharWidth = 0;
}
}
- Optional<uint16_t> iCharWidthRet;
+ absl::optional<uint16_t> iCharWidthRet;
if (m_pFont) {
iCharWidthRet = m_pFont->GetCharWidth(wch);
}
@@ -742,7 +742,7 @@
} else if (i < iLength) {
wNext = *pStr;
}
- Optional<uint16_t> maybe_shadda;
+ absl::optional<uint16_t> maybe_shadda;
if (wch == pdfium::arabic::kArabicShadda) {
maybe_shadda = pdfium::arabic::GetArabicFromShaddaTable(wNext);
} else if (wNext == pdfium::arabic::kArabicShadda) {
@@ -833,7 +833,7 @@
pCharPos->m_Origin.x += fOffset;
}
if (chartype == FX_CHARTYPE::kCombination) {
- Optional<FX_RECT> rtBBox = pFont->GetCharBBox(wForm);
+ absl::optional<FX_RECT> rtBBox = pFont->GetCharBBox(wForm);
if (rtBBox.has_value()) {
pCharPos->m_Origin.y =
fYBase + fFontSize -
@@ -843,7 +843,7 @@
wLast != pdfium::unicode::kZeroWidthNoBreakSpace) {
if (pdfium::unicode::GetCharType(wLast) ==
FX_CHARTYPE::kCombination) {
- Optional<FX_RECT> rtOtherBox = pFont->GetCharBBox(wLast);
+ absl::optional<FX_RECT> rtOtherBox = pFont->GetCharBBox(wLast);
if (rtOtherBox.has_value()) {
pCharPos->m_Origin.y -=
fFontSize * rtOtherBox.value().Height() / iMaxHeight;
diff --git a/xfa/fgas/layout/fgas_arabic.cpp b/xfa/fgas/layout/fgas_arabic.cpp
index 1f71759..9327524 100644
--- a/xfa/fgas/layout/fgas_arabic.cpp
+++ b/xfa/fgas/layout/fgas_arabic.cpp
@@ -212,7 +212,7 @@
return (eNext < FX_CHARTYPE::kArabicAlef) ? ft->wFinal : ft->wMedial;
}
-Optional<wchar_t> GetArabicFromShaddaTable(wchar_t shadda) {
+absl::optional<wchar_t> GetArabicFromShaddaTable(wchar_t shadda) {
if (shadda < kFirstShaddaTableEntry || shadda > kLastShaddaTableEntry)
return absl::nullopt;
diff --git a/xfa/fgas/layout/fgas_arabic.h b/xfa/fgas/layout/fgas_arabic.h
index d7fa64c..f141bd0 100644
--- a/xfa/fgas/layout/fgas_arabic.h
+++ b/xfa/fgas/layout/fgas_arabic.h
@@ -23,7 +23,7 @@
wchar_t GetFormChar(const CFGAS_Char* cur,
const CFGAS_Char* prev,
const CFGAS_Char* next);
-Optional<wchar_t> GetArabicFromShaddaTable(wchar_t shadda);
+absl::optional<wchar_t> GetArabicFromShaddaTable(wchar_t shadda);
} // namespace arabic
} // namespace pdfium
diff --git a/xfa/fwl/cfwl_barcode.h b/xfa/fwl/cfwl_barcode.h
index 7700650..82020ba 100644
--- a/xfa/fwl/cfwl_barcode.h
+++ b/xfa/fwl/cfwl_barcode.h
@@ -62,17 +62,17 @@
BC_TYPE m_type = BC_TYPE::kUnknown;
Status m_eStatus = Status::kNormal;
- Optional<BC_TEXT_LOC> m_eTextLocation;
- Optional<BC_CHAR_ENCODING> m_eCharEncoding;
- Optional<bool> m_bCalChecksum;
- Optional<bool> m_bPrintChecksum;
- Optional<char> m_cStartChar;
- Optional<char> m_cEndChar;
- Optional<int8_t> m_nWideNarrowRatio;
- Optional<int32_t> m_nModuleHeight;
- Optional<int32_t> m_nModuleWidth;
- Optional<int32_t> m_nDataLength;
- Optional<int32_t> m_nECLevel;
+ absl::optional<BC_TEXT_LOC> m_eTextLocation;
+ absl::optional<BC_CHAR_ENCODING> m_eCharEncoding;
+ absl::optional<bool> m_bCalChecksum;
+ absl::optional<bool> m_bPrintChecksum;
+ absl::optional<char> m_cStartChar;
+ absl::optional<char> m_cEndChar;
+ absl::optional<int8_t> m_nWideNarrowRatio;
+ absl::optional<int32_t> m_nModuleHeight;
+ absl::optional<int32_t> m_nModuleWidth;
+ absl::optional<int32_t> m_nDataLength;
+ absl::optional<int32_t> m_nECLevel;
std::unique_ptr<CFX_Barcode> m_pBarcodeEngine;
};
diff --git a/xfa/fwl/cfwl_combobox.h b/xfa/fwl/cfwl_combobox.h
index 029f3e9..695d373 100644
--- a/xfa/fwl/cfwl_combobox.h
+++ b/xfa/fwl/cfwl_combobox.h
@@ -72,8 +72,8 @@
return EditCanCopy();
}
bool EditCanSelectAll() const { return m_pEdit->GetTextLength() > 0; }
- Optional<WideString> EditCopy() const { return m_pEdit->Copy(); }
- Optional<WideString> EditCut() { return m_pEdit->Cut(); }
+ absl::optional<WideString> EditCopy() const { return m_pEdit->Copy(); }
+ absl::optional<WideString> EditCut() { return m_pEdit->Cut(); }
bool EditPaste(const WideString& wsPaste) { return m_pEdit->Paste(wsPaste); }
void EditSelectAll() { m_pEdit->SelectAll(); }
void EditDelete() { m_pEdit->ClearText(); }
diff --git a/xfa/fwl/cfwl_datetimepicker.cpp b/xfa/fwl/cfwl_datetimepicker.cpp
index 3d19bf5..085df3c 100644
--- a/xfa/fwl/cfwl_datetimepicker.cpp
+++ b/xfa/fwl/cfwl_datetimepicker.cpp
@@ -436,11 +436,11 @@
m_pEdit->ClearSelection();
}
-Optional<WideString> CFWL_DateTimePicker::Copy() {
+absl::optional<WideString> CFWL_DateTimePicker::Copy() {
return m_pEdit->Copy();
}
-Optional<WideString> CFWL_DateTimePicker::Cut() {
+absl::optional<WideString> CFWL_DateTimePicker::Cut() {
return m_pEdit->Cut();
}
diff --git a/xfa/fwl/cfwl_datetimepicker.h b/xfa/fwl/cfwl_datetimepicker.h
index 9c144a7..060a780 100644
--- a/xfa/fwl/cfwl_datetimepicker.h
+++ b/xfa/fwl/cfwl_datetimepicker.h
@@ -60,8 +60,8 @@
std::pair<size_t, size_t> GetSelection() const {
return m_pEdit->GetSelection();
}
- Optional<WideString> Copy();
- Optional<WideString> Cut();
+ absl::optional<WideString> Copy();
+ absl::optional<WideString> Cut();
bool Paste(const WideString& wsPaste);
bool Undo();
bool Redo();
diff --git a/xfa/fwl/cfwl_edit.cpp b/xfa/fwl/cfwl_edit.cpp
index d13fc55..534b45e 100644
--- a/xfa/fwl/cfwl_edit.cpp
+++ b/xfa/fwl/cfwl_edit.cpp
@@ -204,14 +204,14 @@
m_pEditEngine->SetAliasChar(wAlias);
}
-Optional<WideString> CFWL_Edit::Copy() {
+absl::optional<WideString> CFWL_Edit::Copy() {
if (!m_pEditEngine->HasSelection())
return absl::nullopt;
return m_pEditEngine->GetSelectedText();
}
-Optional<WideString> CFWL_Edit::Cut() {
+absl::optional<WideString> CFWL_Edit::Cut() {
if (!m_pEditEngine->HasSelection())
return absl::nullopt;
diff --git a/xfa/fwl/cfwl_edit.h b/xfa/fwl/cfwl_edit.h
index 258926b..a9ce04b 100644
--- a/xfa/fwl/cfwl_edit.h
+++ b/xfa/fwl/cfwl_edit.h
@@ -80,8 +80,8 @@
int32_t GetLimit() const;
void SetLimit(int32_t nLimit);
void SetAliasChar(wchar_t wAlias);
- Optional<WideString> Copy();
- Optional<WideString> Cut();
+ absl::optional<WideString> Copy();
+ absl::optional<WideString> Cut();
bool Paste(const WideString& wsPaste);
bool Undo();
bool Redo();
diff --git a/xfa/fxfa/cxfa_ffbarcode.cpp b/xfa/fxfa/cxfa_ffbarcode.cpp
index ba9e741..ad9b71f 100644
--- a/xfa/fxfa/cxfa_ffbarcode.cpp
+++ b/xfa/fxfa/cxfa_ffbarcode.cpp
@@ -93,7 +93,8 @@
{0xfb48155c, "code3Of9", BC_TYPE::kCode39},
};
-Optional<BC_CHAR_ENCODING> CharEncodingFromString(const WideString& value) {
+absl::optional<BC_CHAR_ENCODING> CharEncodingFromString(
+ const WideString& value) {
if (value.CompareNoCase(L"UTF-16"))
return BC_CHAR_ENCODING::kUnicode;
if (value.CompareNoCase(L"UTF-8"))
@@ -101,7 +102,7 @@
return absl::nullopt;
}
-Optional<BC_TEXT_LOC> TextLocFromAttribute(XFA_AttributeValue value) {
+absl::optional<BC_TEXT_LOC> TextLocFromAttribute(XFA_AttributeValue value) {
switch (value) {
case XFA_AttributeValue::None:
return BC_TEXT_LOC::kNone;
@@ -197,56 +198,57 @@
auto* pBarCodeWidget = static_cast<CFWL_Barcode*>(GetNormalWidget());
pBarCodeWidget->SetType(bc_type);
- Optional<WideString> encoding_string = barcode_->GetCharEncoding();
+ absl::optional<WideString> encoding_string = barcode_->GetCharEncoding();
if (encoding_string.has_value()) {
- Optional<BC_CHAR_ENCODING> encoding =
+ absl::optional<BC_CHAR_ENCODING> encoding =
CharEncodingFromString(encoding_string.value());
if (encoding.has_value())
pBarCodeWidget->SetCharEncoding(encoding.value());
}
- Optional<bool> calcChecksum = barcode_->GetChecksum();
+ absl::optional<bool> calcChecksum = barcode_->GetChecksum();
if (calcChecksum.has_value())
pBarCodeWidget->SetCalChecksum(calcChecksum.value());
- Optional<int32_t> dataLen = barcode_->GetDataLength();
+ absl::optional<int32_t> dataLen = barcode_->GetDataLength();
if (dataLen.has_value())
pBarCodeWidget->SetDataLength(dataLen.value());
- Optional<char> startChar = barcode_->GetStartChar();
+ absl::optional<char> startChar = barcode_->GetStartChar();
if (startChar.has_value())
pBarCodeWidget->SetStartChar(startChar.value());
- Optional<char> endChar = barcode_->GetEndChar();
+ absl::optional<char> endChar = barcode_->GetEndChar();
if (endChar.has_value())
pBarCodeWidget->SetEndChar(endChar.value());
- Optional<int32_t> ecLevel = barcode_->GetECLevel();
+ absl::optional<int32_t> ecLevel = barcode_->GetECLevel();
if (ecLevel.has_value())
pBarCodeWidget->SetErrorCorrectionLevel(ecLevel.value());
- Optional<int32_t> width = barcode_->GetModuleWidth();
+ absl::optional<int32_t> width = barcode_->GetModuleWidth();
if (width.has_value())
pBarCodeWidget->SetModuleWidth(width.value());
- Optional<int32_t> height = barcode_->GetModuleHeight();
+ absl::optional<int32_t> height = barcode_->GetModuleHeight();
if (height.has_value())
pBarCodeWidget->SetModuleHeight(height.value());
- Optional<bool> printCheck = barcode_->GetPrintChecksum();
+ absl::optional<bool> printCheck = barcode_->GetPrintChecksum();
if (printCheck.has_value())
pBarCodeWidget->SetPrintChecksum(printCheck.value());
- Optional<XFA_AttributeValue> text_attr = barcode_->GetTextLocation();
+ absl::optional<XFA_AttributeValue> text_attr = barcode_->GetTextLocation();
if (text_attr.has_value()) {
- Optional<BC_TEXT_LOC> textLoc = TextLocFromAttribute(text_attr.value());
+ absl::optional<BC_TEXT_LOC> textLoc =
+ TextLocFromAttribute(text_attr.value());
if (textLoc.has_value())
pBarCodeWidget->SetTextLocation(textLoc.value());
}
// Truncated is currently not a supported flag.
- Optional<int8_t> ratio = barcode_->GetWideNarrowRatio();
+ absl::optional<int8_t> ratio = barcode_->GetWideNarrowRatio();
if (ratio.has_value())
pBarCodeWidget->SetWideNarrowRatio(ratio.value());
diff --git a/xfa/fxfa/cxfa_ffcombobox.cpp b/xfa/fxfa/cxfa_ffcombobox.cpp
index bda6163..1bb4929 100644
--- a/xfa/fxfa/cxfa_ffcombobox.cpp
+++ b/xfa/fxfa/cxfa_ffcombobox.cpp
@@ -254,11 +254,11 @@
ToComboBox(GetNormalWidget())->EditRedo();
}
-Optional<WideString> CXFA_FFComboBox::Copy() {
+absl::optional<WideString> CXFA_FFComboBox::Copy() {
return ToComboBox(GetNormalWidget())->EditCopy();
}
-Optional<WideString> CXFA_FFComboBox::Cut() {
+absl::optional<WideString> CXFA_FFComboBox::Cut() {
if (!m_pNode->IsChoiceListAllowTextEntry())
return absl::nullopt;
diff --git a/xfa/fxfa/cxfa_ffcombobox.h b/xfa/fxfa/cxfa_ffcombobox.h
index 63d5640..c35a96a 100644
--- a/xfa/fxfa/cxfa_ffcombobox.h
+++ b/xfa/fxfa/cxfa_ffcombobox.h
@@ -37,8 +37,8 @@
bool CanSelectAll() override;
bool Undo() override;
bool Redo() override;
- Optional<WideString> Copy() override;
- Optional<WideString> Cut() override;
+ absl::optional<WideString> Copy() override;
+ absl::optional<WideString> Cut() override;
bool Paste(const WideString& wsPaste) override;
void SelectAll() override;
void Delete() override;
diff --git a/xfa/fxfa/cxfa_ffdatetimeedit.cpp b/xfa/fxfa/cxfa_ffdatetimeedit.cpp
index 8e7ea30..cb3a1cd 100644
--- a/xfa/fxfa/cxfa_ffdatetimeedit.cpp
+++ b/xfa/fxfa/cxfa_ffdatetimeedit.cpp
@@ -92,7 +92,7 @@
GetNormalWidget()->ModifyStyleExts(dwExtendedStyle, 0xFFFFFFFF);
uint32_t dwEditStyles = 0;
- Optional<int32_t> numCells = m_pNode->GetNumberOfCells();
+ absl::optional<int32_t> numCells = m_pNode->GetNumberOfCells();
if (numCells.has_value() && numCells.value() > 0) {
dwEditStyles |= FWL_STYLEEXT_EDT_CombText;
pPicker->SetEditLimit(numCells.value());
@@ -244,7 +244,7 @@
return GetPickerWidget()->GetEditTextLength() > 0;
}
-Optional<WideString> CXFA_FFDateTimeEdit::Copy() {
+absl::optional<WideString> CXFA_FFDateTimeEdit::Copy() {
return GetPickerWidget()->Copy();
}
@@ -256,7 +256,7 @@
return GetPickerWidget()->Redo();
}
-Optional<WideString> CXFA_FFDateTimeEdit::Cut() {
+absl::optional<WideString> CXFA_FFDateTimeEdit::Cut() {
return GetPickerWidget()->Cut();
}
diff --git a/xfa/fxfa/cxfa_ffdatetimeedit.h b/xfa/fxfa/cxfa_ffdatetimeedit.h
index 6a4d416..b20e703 100644
--- a/xfa/fxfa/cxfa_ffdatetimeedit.h
+++ b/xfa/fxfa/cxfa_ffdatetimeedit.h
@@ -39,8 +39,8 @@
bool CanSelectAll() override;
bool Undo() override;
bool Redo() override;
- Optional<WideString> Copy() override;
- Optional<WideString> Cut() override;
+ absl::optional<WideString> Copy() override;
+ absl::optional<WideString> Cut() override;
bool Paste(const WideString& wsPaste) override;
void SelectAll() override;
void Delete() override;
diff --git a/xfa/fxfa/cxfa_ffdocview.cpp b/xfa/fxfa/cxfa_ffdocview.cpp
index 8be2f1e..ae6eaca 100644
--- a/xfa/fxfa/cxfa_ffdocview.cpp
+++ b/xfa/fxfa/cxfa_ffdocview.cpp
@@ -452,7 +452,7 @@
pRefNode = node->IsWidgetReady() ? node : nullptr;
}
WideString wsExpression = (!pRefNode ? L"$form." : L"") + wsName;
- Optional<CFXJSE_Engine::ResolveResult> maybeResult =
+ absl::optional<CFXJSE_Engine::ResolveResult> maybeResult =
pScriptContext->ResolveObjects(
pRefNode, wsExpression.AsStringView(),
Mask<XFA_ResolveFlag>{
@@ -649,7 +649,7 @@
CFXJSE_Engine* pScriptContext =
pWidgetNode->GetDocument()->GetScriptContext();
WideString wsRef = item->GetRef();
- Optional<CFXJSE_Engine::ResolveResult> maybeRS =
+ absl::optional<CFXJSE_Engine::ResolveResult> maybeRS =
pScriptContext->ResolveObjects(
pWidgetNode, wsRef.AsStringView(),
Mask<XFA_ResolveFlag>{
diff --git a/xfa/fxfa/cxfa_ffnumericedit.cpp b/xfa/fxfa/cxfa_ffnumericedit.cpp
index 32903f4..8e18195 100644
--- a/xfa/fxfa/cxfa_ffnumericedit.cpp
+++ b/xfa/fxfa/cxfa_ffnumericedit.cpp
@@ -55,7 +55,7 @@
if (!m_pNode->IsHorizontalScrollPolicyOff())
dwExtendedStyle |= FWL_STYLEEXT_EDT_AutoHScroll;
- Optional<int32_t> numCells = m_pNode->GetNumberOfCells();
+ absl::optional<int32_t> numCells = m_pNode->GetNumberOfCells();
if (numCells.has_value() && numCells.value() > 0) {
dwExtendedStyle |= FWL_STYLEEXT_EDT_CombText;
pWidget->SetLimit(numCells.value());
diff --git a/xfa/fxfa/cxfa_ffpageview.cpp b/xfa/fxfa/cxfa_ffpageview.cpp
index 50399a8..3c160eb 100644
--- a/xfa/fxfa/cxfa_ffpageview.cpp
+++ b/xfa/fxfa/cxfa_ffpageview.cpp
@@ -426,7 +426,7 @@
CXFA_Traverse* pTraverse =
pTraversal->GetChild<CXFA_Traverse>(0, XFA_Element::Traverse, false);
if (pTraverse) {
- Optional<WideString> traverseWidgetName =
+ absl::optional<WideString> traverseWidgetName =
pTraverse->JSObject()->TryAttribute(XFA_Attribute::Ref, true);
if (traverseWidgetName.has_value())
return FindWidgetByName(traverseWidgetName.value(), pWidget);
diff --git a/xfa/fxfa/cxfa_fftextedit.cpp b/xfa/fxfa/cxfa_fftextedit.cpp
index 38bdfee..6bf2503 100644
--- a/xfa/fxfa/cxfa_fftextedit.cpp
+++ b/xfa/fxfa/cxfa_fftextedit.cpp
@@ -100,7 +100,7 @@
if (eType == XFA_Element::ExData)
iMaxChars = 0;
- Optional<int32_t> numCells = m_pNode->GetNumberOfCells();
+ absl::optional<int32_t> numCells = m_pNode->GetNumberOfCells();
if (!numCells.has_value()) {
pWidget->SetLimit(iMaxChars);
} else if (numCells == 0) {
@@ -401,11 +401,11 @@
return ToEdit(GetNormalWidget())->Redo();
}
-Optional<WideString> CXFA_FFTextEdit::Copy() {
+absl::optional<WideString> CXFA_FFTextEdit::Copy() {
return ToEdit(GetNormalWidget())->Copy();
}
-Optional<WideString> CXFA_FFTextEdit::Cut() {
+absl::optional<WideString> CXFA_FFTextEdit::Cut() {
return ToEdit(GetNormalWidget())->Cut();
}
diff --git a/xfa/fxfa/cxfa_fftextedit.h b/xfa/fxfa/cxfa_fftextedit.h
index 2fb39ed..d680974 100644
--- a/xfa/fxfa/cxfa_fftextedit.h
+++ b/xfa/fxfa/cxfa_fftextedit.h
@@ -62,8 +62,8 @@
bool CanSelectAll() override;
bool Undo() override;
bool Redo() override;
- Optional<WideString> Copy() override;
- Optional<WideString> Cut() override;
+ absl::optional<WideString> Copy() override;
+ absl::optional<WideString> Cut() override;
bool Paste(const WideString& wsPaste) override;
void SelectAll() override;
void Delete() override;
diff --git a/xfa/fxfa/cxfa_ffwidget.cpp b/xfa/fxfa/cxfa_ffwidget.cpp
index 01008bf..95df80e 100644
--- a/xfa/fxfa/cxfa_ffwidget.cpp
+++ b/xfa/fxfa/cxfa_ffwidget.cpp
@@ -508,11 +508,11 @@
return false;
}
-Optional<WideString> CXFA_FFWidget::Copy() {
+absl::optional<WideString> CXFA_FFWidget::Copy() {
return absl::nullopt;
}
-Optional<WideString> CXFA_FFWidget::Cut() {
+absl::optional<WideString> CXFA_FFWidget::Cut() {
return absl::nullopt;
}
diff --git a/xfa/fxfa/cxfa_ffwidget.h b/xfa/fxfa/cxfa_ffwidget.h
index 5df2c70..45fc009 100644
--- a/xfa/fxfa/cxfa_ffwidget.h
+++ b/xfa/fxfa/cxfa_ffwidget.h
@@ -148,8 +148,8 @@
virtual bool CanDeSelect();
virtual bool Undo();
virtual bool Redo();
- virtual Optional<WideString> Copy();
- virtual Optional<WideString> Cut();
+ virtual absl::optional<WideString> Copy();
+ virtual absl::optional<WideString> Cut();
virtual bool Paste(const WideString& wsPaste);
virtual void SelectAll();
virtual void Delete();
diff --git a/xfa/fxfa/cxfa_textlayout.cpp b/xfa/fxfa/cxfa_textlayout.cpp
index bc29013..3f90538 100644
--- a/xfa/fxfa/cxfa_textlayout.cpp
+++ b/xfa/fxfa/cxfa_textlayout.cpp
@@ -812,7 +812,7 @@
while (iTabCount-- > 0)
wsText += L'\t';
} else {
- Optional<WideString> obj =
+ absl::optional<WideString> obj =
m_pTextParser->GetEmbeddedObj(m_pTextProvider, pXMLNode);
if (obj.has_value())
wsText = obj.value();
diff --git a/xfa/fxfa/cxfa_textparser.cpp b/xfa/fxfa/cxfa_textparser.cpp
index e98f7be..1877eeb 100644
--- a/xfa/fxfa/cxfa_textparser.cpp
+++ b/xfa/fxfa/cxfa_textparser.cpp
@@ -351,7 +351,7 @@
}
if (pStyle) {
- Optional<WideString> last_family = pStyle->GetLastFontFamily();
+ absl::optional<WideString> last_family = pStyle->GetLastFontFamily();
if (last_family.has_value())
wsFamily = last_family.value();
@@ -500,7 +500,7 @@
return fLineHeight;
}
-Optional<WideString> CXFA_TextParser::GetEmbeddedObj(
+absl::optional<WideString> CXFA_TextParser::GetEmbeddedObj(
const CXFA_TextProvider* pTextProvider,
const CFX_XMLNode* pXMLNode) {
if (!pXMLNode)
diff --git a/xfa/fxfa/cxfa_textparser.h b/xfa/fxfa/cxfa_textparser.h
index f6d633d..7a7c306 100644
--- a/xfa/fxfa/cxfa_textparser.h
+++ b/xfa/fxfa/cxfa_textparser.h
@@ -110,8 +110,9 @@
bool bFirst,
float fVerScale) const;
- Optional<WideString> GetEmbeddedObj(const CXFA_TextProvider* pTextProvider,
- const CFX_XMLNode* pXMLNode);
+ absl::optional<WideString> GetEmbeddedObj(
+ const CXFA_TextProvider* pTextProvider,
+ const CFX_XMLNode* pXMLNode);
Context* GetParseContextFromMap(const CFX_XMLNode* pXMLNode);
protected:
diff --git a/xfa/fxfa/cxfa_textprovider.cpp b/xfa/fxfa/cxfa_textprovider.cpp
index f93b788..76449ed 100644
--- a/xfa/fxfa/cxfa_textprovider.cpp
+++ b/xfa/fxfa/cxfa_textprovider.cpp
@@ -53,8 +53,9 @@
CXFA_Node* pChildNode = pValueNode->GetFirstChild();
if (pChildNode && pChildNode->GetElementType() == XFA_Element::ExData) {
- Optional<WideString> contentType = pChildNode->JSObject()->TryAttribute(
- XFA_Attribute::ContentType, false);
+ absl::optional<WideString> contentType =
+ pChildNode->JSObject()->TryAttribute(XFA_Attribute::ContentType,
+ false);
if (contentType.has_value() &&
contentType.value().EqualsASCII("text/html")) {
*bRichText = true;
@@ -76,8 +77,9 @@
CXFA_Node* pChildNode = pValueNode->GetFirstChild();
if (pChildNode && pChildNode->GetElementType() == XFA_Element::ExData) {
- Optional<WideString> contentType = pChildNode->JSObject()->TryAttribute(
- XFA_Attribute::ContentType, false);
+ absl::optional<WideString> contentType =
+ pChildNode->JSObject()->TryAttribute(XFA_Attribute::ContentType,
+ false);
if (contentType.has_value() &&
contentType.value().EqualsASCII("text/html")) {
*bRichText = true;
@@ -130,7 +132,7 @@
return !m_pNode->TryWidth().has_value();
}
-Optional<WideString> CXFA_TextProvider::GetEmbeddedObj(
+absl::optional<WideString> CXFA_TextProvider::GetEmbeddedObj(
const WideString& wsAttr) const {
if (m_eType != Type::kText)
return absl::nullopt;
diff --git a/xfa/fxfa/cxfa_textprovider.h b/xfa/fxfa/cxfa_textprovider.h
index 138e429..f0c9fa1 100644
--- a/xfa/fxfa/cxfa_textprovider.h
+++ b/xfa/fxfa/cxfa_textprovider.h
@@ -37,7 +37,7 @@
CXFA_Para* GetParaIfExists();
CXFA_Font* GetFontIfExists();
bool IsCheckButtonAndAutoWidth() const;
- Optional<WideString> GetEmbeddedObj(const WideString& wsAttr) const;
+ absl::optional<WideString> GetEmbeddedObj(const WideString& wsAttr) const;
private:
CXFA_TextProvider(CXFA_Node* pNode, Type eType);
diff --git a/xfa/fxfa/fm2js/cxfa_fmexpression.cpp b/xfa/fxfa/fm2js/cxfa_fmexpression.cpp
index da7cd40..a080b46 100644
--- a/xfa/fxfa/fm2js/cxfa_fmexpression.cpp
+++ b/xfa/fxfa/fm2js/cxfa_fmexpression.cpp
@@ -771,7 +771,7 @@
ContainerTrace(visitor, expressions_);
}
-Optional<CFX_WideTextBuf> CXFA_FMAST::ToJavaScript() const {
+absl::optional<CFX_WideTextBuf> CXFA_FMAST::ToJavaScript() const {
CFX_WideTextBuf js;
if (expressions_.empty()) {
js << "// comments only";
diff --git a/xfa/fxfa/fm2js/cxfa_fmexpression.h b/xfa/fxfa/fm2js/cxfa_fmexpression.h
index 15e2ca1..0e015f7 100644
--- a/xfa/fxfa/fm2js/cxfa_fmexpression.h
+++ b/xfa/fxfa/fm2js/cxfa_fmexpression.h
@@ -595,7 +595,7 @@
~CXFA_FMAST();
void Trace(cppgc::Visitor* visitor) const;
- Optional<CFX_WideTextBuf> ToJavaScript() const;
+ absl::optional<CFX_WideTextBuf> ToJavaScript() const;
private:
explicit CXFA_FMAST(
diff --git a/xfa/fxfa/fm2js/cxfa_fmparser.cpp b/xfa/fxfa/fm2js/cxfa_fmparser.cpp
index 1625d2b..89a2faa 100644
--- a/xfa/fxfa/fm2js/cxfa_fmparser.cpp
+++ b/xfa/fxfa/fm2js/cxfa_fmparser.cpp
@@ -651,7 +651,7 @@
switch (m_token.m_type) {
case TOKlparen: {
- Optional<std::vector<cppgc::Member<CXFA_FMSimpleExpression>>>
+ absl::optional<std::vector<cppgc::Member<CXFA_FMSimpleExpression>>>
expressions = ParseArgumentList();
if (!expressions.has_value())
return nullptr;
@@ -682,7 +682,7 @@
if (!NextToken())
return nullptr;
if (m_token.m_type == TOKlparen) {
- Optional<std::vector<cppgc::Member<CXFA_FMSimpleExpression>>>
+ absl::optional<std::vector<cppgc::Member<CXFA_FMSimpleExpression>>>
expressions = ParseArgumentList();
if (!expressions.has_value())
return nullptr;
@@ -800,7 +800,7 @@
// Argument lists are zero or more comma seperated simple expressions found
// between '(' and ')'
-Optional<std::vector<cppgc::Member<CXFA_FMSimpleExpression>>>
+absl::optional<std::vector<cppgc::Member<CXFA_FMSimpleExpression>>>
CXFA_FMParser::ParseArgumentList() {
if (m_token.m_type != TOKlparen || !NextToken())
return absl::nullopt;
diff --git a/xfa/fxfa/fm2js/cxfa_fmparser.h b/xfa/fxfa/fm2js/cxfa_fmparser.h
index fa32f5a..8d1ab69 100644
--- a/xfa/fxfa/fm2js/cxfa_fmparser.h
+++ b/xfa/fxfa/fm2js/cxfa_fmparser.h
@@ -60,7 +60,7 @@
CXFA_FMSimpleExpression* ParsePostExpression(CXFA_FMSimpleExpression* e);
CXFA_FMSimpleExpression* ParseIndexExpression();
CXFA_FMSimpleExpression* ParseLiteral();
- Optional<std::vector<cppgc::Member<CXFA_FMSimpleExpression>>>
+ absl::optional<std::vector<cppgc::Member<CXFA_FMSimpleExpression>>>
ParseArgumentList();
UnownedPtr<cppgc::Heap> const m_heap;
diff --git a/xfa/fxfa/fm2js/cxfa_fmparser_unittest.cpp b/xfa/fxfa/fm2js/cxfa_fmparser_unittest.cpp
index ade2b05..74f69d9 100644
--- a/xfa/fxfa/fm2js/cxfa_fmparser_unittest.cpp
+++ b/xfa/fxfa/fm2js/cxfa_fmparser_unittest.cpp
@@ -19,7 +19,7 @@
EXPECT_FALSE(parser.HasError());
CXFA_FMToJavaScriptDepth::Reset();
- Optional<CFX_WideTextBuf> buf = ast->ToJavaScript();
+ absl::optional<CFX_WideTextBuf> buf = ast->ToJavaScript();
ASSERT_TRUE(buf.has_value());
// TODO(dsinclair): This is a little weird .....
EXPECT_STREQ(L"// comments only", buf.value().MakeString().c_str());
@@ -35,7 +35,7 @@
// EXPECT_TRUE(parser.HasError());
CXFA_FMToJavaScriptDepth::Reset();
- Optional<CFX_WideTextBuf> buf = ast->ToJavaScript();
+ absl::optional<CFX_WideTextBuf> buf = ast->ToJavaScript();
ASSERT_TRUE(buf.has_value());
EXPECT_STREQ(L"// comments only", buf.value().MakeString().c_str());
}
@@ -65,7 +65,7 @@
EXPECT_FALSE(parser.HasError());
CXFA_FMToJavaScriptDepth::Reset();
- Optional<CFX_WideTextBuf> buf = ast->ToJavaScript();
+ absl::optional<CFX_WideTextBuf> buf = ast->ToJavaScript();
ASSERT_TRUE(buf.has_value());
EXPECT_STREQ(ret, buf.value().MakeString().c_str());
}
@@ -135,7 +135,7 @@
EXPECT_FALSE(parser.HasError());
CXFA_FMToJavaScriptDepth::Reset();
- Optional<CFX_WideTextBuf> buf = ast->ToJavaScript();
+ absl::optional<CFX_WideTextBuf> buf = ast->ToJavaScript();
ASSERT_TRUE(buf.has_value());
EXPECT_EQ(ret, buf.value().AsStringView());
}
@@ -201,7 +201,7 @@
EXPECT_FALSE(parser.HasError());
CXFA_FMToJavaScriptDepth::Reset();
- Optional<CFX_WideTextBuf> buf = ast->ToJavaScript();
+ absl::optional<CFX_WideTextBuf> buf = ast->ToJavaScript();
ASSERT_TRUE(buf.has_value());
EXPECT_STREQ(ret, buf.value().MakeString().c_str());
}
@@ -240,7 +240,7 @@
EXPECT_FALSE(parser.HasError());
CXFA_FMToJavaScriptDepth::Reset();
- Optional<CFX_WideTextBuf> buf = ast->ToJavaScript();
+ absl::optional<CFX_WideTextBuf> buf = ast->ToJavaScript();
ASSERT_TRUE(buf.has_value());
EXPECT_STREQ(ret, buf.value().MakeString().c_str());
}
@@ -329,7 +329,7 @@
EXPECT_FALSE(parser.HasError());
CXFA_FMToJavaScriptDepth::Reset();
- Optional<CFX_WideTextBuf> buf = ast->ToJavaScript();
+ absl::optional<CFX_WideTextBuf> buf = ast->ToJavaScript();
ASSERT_TRUE(buf.has_value());
EXPECT_STREQ(ret, buf.value().MakeString().c_str());
}
@@ -371,7 +371,7 @@
EXPECT_FALSE(parser.HasError());
CXFA_FMToJavaScriptDepth::Reset();
- Optional<CFX_WideTextBuf> buf = ast->ToJavaScript();
+ absl::optional<CFX_WideTextBuf> buf = ast->ToJavaScript();
ASSERT_TRUE(buf.has_value());
EXPECT_STREQ(ret, buf.value().MakeString().c_str());
}
@@ -403,7 +403,7 @@
EXPECT_FALSE(parser.HasError());
CXFA_FMToJavaScriptDepth::Reset();
- Optional<CFX_WideTextBuf> buf = ast->ToJavaScript();
+ absl::optional<CFX_WideTextBuf> buf = ast->ToJavaScript();
ASSERT_TRUE(buf.has_value());
EXPECT_STREQ(ret, buf.value().MakeString().c_str());
}
@@ -437,7 +437,7 @@
EXPECT_FALSE(parser.HasError());
CXFA_FMToJavaScriptDepth::Reset();
- Optional<CFX_WideTextBuf> buf = ast->ToJavaScript();
+ absl::optional<CFX_WideTextBuf> buf = ast->ToJavaScript();
ASSERT_TRUE(buf.has_value());
EXPECT_STREQ(ret, buf.value().MakeString().c_str());
}
@@ -471,7 +471,7 @@
EXPECT_FALSE(parser.HasError());
CXFA_FMToJavaScriptDepth::Reset();
- Optional<CFX_WideTextBuf> buf = ast->ToJavaScript();
+ absl::optional<CFX_WideTextBuf> buf = ast->ToJavaScript();
ASSERT_TRUE(buf.has_value());
EXPECT_STREQ(ret, buf.value().MakeString().c_str());
}
@@ -505,7 +505,7 @@
EXPECT_FALSE(parser.HasError());
CXFA_FMToJavaScriptDepth::Reset();
- Optional<CFX_WideTextBuf> buf = ast->ToJavaScript();
+ absl::optional<CFX_WideTextBuf> buf = ast->ToJavaScript();
ASSERT_TRUE(buf.has_value());
EXPECT_STREQ(ret, buf.value().MakeString().c_str());
}
diff --git a/xfa/fxfa/layout/cxfa_contentlayoutprocessor.cpp b/xfa/fxfa/layout/cxfa_contentlayoutprocessor.cpp
index ebe30d5..a9778c1 100644
--- a/xfa/fxfa/layout/cxfa_contentlayoutprocessor.cpp
+++ b/xfa/fxfa/layout/cxfa_contentlayoutprocessor.cpp
@@ -93,14 +93,14 @@
CFX_SizeF containerSize;
if (eType == XFA_Element::Subform || eType == XFA_Element::ExclGroup) {
- Optional<CXFA_Measurement> wValue =
+ absl::optional<CXFA_Measurement> wValue =
pFormNode->JSObject()->TryMeasure(XFA_Attribute::W, false);
if (wValue.has_value() && wValue->GetValue() > kXFALayoutPrecision) {
containerSize.width = wValue->ToUnit(XFA_Unit::Pt);
*bContainerWidthAutoSize = false;
}
- Optional<CXFA_Measurement> hValue =
+ absl::optional<CXFA_Measurement> hValue =
pFormNode->JSObject()->TryMeasure(XFA_Attribute::H, false);
if (hValue.has_value() && hValue->GetValue() > kXFALayoutPrecision) {
containerSize.height = hValue->ToUnit(XFA_Unit::Pt);
@@ -109,14 +109,14 @@
}
if (*bContainerWidthAutoSize && eType == XFA_Element::Subform) {
- Optional<CXFA_Measurement> maxW =
+ absl::optional<CXFA_Measurement> maxW =
pFormNode->JSObject()->TryMeasure(XFA_Attribute::MaxW, false);
if (maxW.has_value() && maxW->GetValue() > kXFALayoutPrecision) {
containerSize.width = maxW->ToUnit(XFA_Unit::Pt);
*bContainerWidthAutoSize = false;
}
- Optional<CXFA_Measurement> maxH =
+ absl::optional<CXFA_Measurement> maxH =
pFormNode->JSObject()->TryMeasure(XFA_Attribute::MaxH, false);
if (maxH.has_value() && maxH->GetValue() > kXFALayoutPrecision) {
containerSize.height = maxH->ToUnit(XFA_Unit::Pt);
@@ -139,12 +139,12 @@
if (bContainerWidthAutoSize) {
componentSize.width = fContentCalculatedWidth;
if (pMarginNode) {
- Optional<CXFA_Measurement> leftInset =
+ absl::optional<CXFA_Measurement> leftInset =
pMarginNode->JSObject()->TryMeasure(XFA_Attribute::LeftInset, false);
if (leftInset.has_value())
componentSize.width += leftInset->ToUnit(XFA_Unit::Pt);
- Optional<CXFA_Measurement> rightInset =
+ absl::optional<CXFA_Measurement> rightInset =
pMarginNode->JSObject()->TryMeasure(XFA_Attribute::RightInset, false);
if (rightInset.has_value())
componentSize.width += rightInset->ToUnit(XFA_Unit::Pt);
@@ -154,12 +154,12 @@
if (bContainerHeightAutoSize) {
componentSize.height = fContentCalculatedHeight;
if (pMarginNode) {
- Optional<CXFA_Measurement> topInset =
+ absl::optional<CXFA_Measurement> topInset =
pMarginNode->JSObject()->TryMeasure(XFA_Attribute::TopInset, false);
if (topInset.has_value())
componentSize.height += topInset->ToUnit(XFA_Unit::Pt);
- Optional<CXFA_Measurement> bottomInset =
+ absl::optional<CXFA_Measurement> bottomInset =
pMarginNode->JSObject()->TryMeasure(XFA_Attribute::BottomInset,
false);
if (bottomInset.has_value())
@@ -338,7 +338,7 @@
XFA_AttributeValue GetLayout(CXFA_Node* pFormNode, bool* bRootForceTb) {
*bRootForceTb = false;
- Optional<XFA_AttributeValue> layoutMode =
+ absl::optional<XFA_AttributeValue> layoutMode =
pFormNode->JSObject()->TryEnum(XFA_Attribute::Layout, false);
if (layoutMode.has_value())
return layoutMode.value();
@@ -367,7 +367,7 @@
if (!bPreFind)
eKeepType = XFA_Attribute::Next;
- Optional<XFA_AttributeValue> previous =
+ absl::optional<XFA_AttributeValue> previous =
pKeep->JSObject()->TryEnum(eKeepType, false);
if (previous == XFA_AttributeValue::ContentArea ||
previous == XFA_AttributeValue::PageArea) {
@@ -383,7 +383,7 @@
if (!bPreFind)
eKeepType = XFA_Attribute::Previous;
- Optional<XFA_AttributeValue> next =
+ absl::optional<XFA_AttributeValue> next =
pKeep->JSObject()->TryEnum(eKeepType, false);
if (next == XFA_AttributeValue::ContentArea ||
next == XFA_AttributeValue::PageArea) {
@@ -392,7 +392,7 @@
return false;
}
-Optional<CXFA_ContentLayoutProcessor::Stage> FindBreakNode(
+absl::optional<CXFA_ContentLayoutProcessor::Stage> FindBreakNode(
CXFA_Node* pContainerNode,
bool bBreakBefore,
CXFA_Node** pCurActionNode) {
@@ -493,7 +493,7 @@
while (bChanged) {
bChanged = false;
{
- Optional<float> fRelSplitPos = pFormNode->FindSplitPos(
+ absl::optional<float> fRelSplitPos = pFormNode->FindSplitPos(
pNotify->GetFFDoc()->GetDocView(), pLayoutItem->GetIndex(),
*fProposedSplitPos - fCurVerticalOffset);
if (fRelSplitPos.has_value()) {
@@ -872,7 +872,7 @@
break;
}
- Optional<Stage> ret;
+ absl::optional<Stage> ret;
switch (nCurStage) {
case Stage::kKeep:
ret = HandleKeep(pChildContainer->GetFirstChild(), &pCurActionNode);
@@ -930,7 +930,7 @@
return {Stage::kDone, nullptr};
}
-Optional<CXFA_ContentLayoutProcessor::Stage>
+absl::optional<CXFA_ContentLayoutProcessor::Stage>
CXFA_ContentLayoutProcessor::ProcessKeepNodesForCheckNext(
CXFA_Node** pCurActionNode,
CXFA_Node** pNextContainer,
@@ -961,7 +961,7 @@
return absl::nullopt;
}
- Optional<Stage> ret =
+ absl::optional<Stage> ret =
FindBreakNode((*pNextContainer)->GetFirstChild(), true, pCurActionNode);
if (!ret.has_value()) {
*pNextContainer = m_pKeepHeadNode;
@@ -972,7 +972,7 @@
return ret;
}
-Optional<CXFA_ContentLayoutProcessor::Stage>
+absl::optional<CXFA_ContentLayoutProcessor::Stage>
CXFA_ContentLayoutProcessor::ProcessKeepNodesForBreakBefore(
CXFA_Node** pCurActionNode,
CXFA_Node* pContainerNode) {
@@ -1643,7 +1643,7 @@
if (!bUseBreakControl || !m_pViewLayoutProcessor)
break;
- Optional<CXFA_ViewLayoutProcessor::BreakData> break_data =
+ absl::optional<CXFA_ViewLayoutProcessor::BreakData> break_data =
m_pViewLayoutProcessor->ProcessBreakBefore(m_pCurChildNode);
if (!break_data.has_value() || !break_data.value().bCreatePage ||
GetFormNode()->GetElementType() == XFA_Element::Form) {
@@ -1684,7 +1684,7 @@
if (!bUseBreakControl || !m_pViewLayoutProcessor)
break;
- Optional<CXFA_ViewLayoutProcessor::BreakData> break_data =
+ absl::optional<CXFA_ViewLayoutProcessor::BreakData> break_data =
m_pViewLayoutProcessor->ProcessBreakAfter(m_pCurChildNode);
if (!break_data.has_value() ||
GetFormNode()->GetElementType() == XFA_Element::Form) {
@@ -2430,7 +2430,7 @@
pFormNode = pLayoutContext->m_pOverflowNode.Get();
bUseInherited = true;
}
- Optional<CXFA_ViewLayoutProcessor::OverflowData> overflow_data =
+ absl::optional<CXFA_ViewLayoutProcessor::OverflowData> overflow_data =
m_pViewLayoutProcessor->ProcessOverflow(pFormNode, false);
if (overflow_data.has_value()) {
pOverflowLeaderNode = overflow_data.value().pLeader;
@@ -2632,7 +2632,7 @@
if (pProcessor->GetFormNode()->GetIntact() == XFA_AttributeValue::None &&
eLayout == XFA_AttributeValue::Tb) {
if (m_pViewLayoutProcessor) {
- Optional<CXFA_ViewLayoutProcessor::OverflowData> overflow_data =
+ absl::optional<CXFA_ViewLayoutProcessor::OverflowData> overflow_data =
m_pViewLayoutProcessor->ProcessOverflow(pFormNode, true);
if (overflow_data.has_value()) {
pOverflowLeaderNode = overflow_data.value().pLeader;
@@ -2653,7 +2653,7 @@
if (!pFormNode && pLayoutContext)
pFormNode = pLayoutContext->m_pOverflowProcessor->GetFormNode();
if (m_pViewLayoutProcessor) {
- Optional<CXFA_ViewLayoutProcessor::OverflowData> overflow_data =
+ absl::optional<CXFA_ViewLayoutProcessor::OverflowData> overflow_data =
m_pViewLayoutProcessor->ProcessOverflow(pFormNode, true);
if (overflow_data.has_value()) {
pOverflowLeaderNode = overflow_data.value().pLeader;
@@ -2668,7 +2668,7 @@
return Result::kPageFullBreak;
}
-Optional<CXFA_ContentLayoutProcessor::Stage>
+absl::optional<CXFA_ContentLayoutProcessor::Stage>
CXFA_ContentLayoutProcessor::HandleKeep(CXFA_Node* pBreakAfterNode,
CXFA_Node** pCurActionNode) {
if (m_bKeepBreakFinish)
@@ -2676,7 +2676,7 @@
return FindBreakNode(pBreakAfterNode, false, pCurActionNode);
}
-Optional<CXFA_ContentLayoutProcessor::Stage>
+absl::optional<CXFA_ContentLayoutProcessor::Stage>
CXFA_ContentLayoutProcessor::HandleBookendLeader(CXFA_Node* pParentContainer,
CXFA_Node** pCurActionNode) {
for (CXFA_Node* pBookendNode = *pCurActionNode
@@ -2695,7 +2695,7 @@
return absl::nullopt;
}
-Optional<CXFA_ContentLayoutProcessor::Stage>
+absl::optional<CXFA_ContentLayoutProcessor::Stage>
CXFA_ContentLayoutProcessor::HandleBreakBefore(CXFA_Node* pChildContainer,
CXFA_Node** pCurActionNode) {
if (!*pCurActionNode)
@@ -2703,7 +2703,8 @@
CXFA_Node* pBreakBeforeNode = (*pCurActionNode)->GetNextSibling();
if (!m_bKeepBreakFinish) {
- Optional<Stage> ret = FindBreakNode(pBreakBeforeNode, true, pCurActionNode);
+ absl::optional<Stage> ret =
+ FindBreakNode(pBreakBeforeNode, true, pCurActionNode);
if (ret.has_value())
return ret.value();
}
@@ -2714,7 +2715,7 @@
return Stage::kContainer;
}
-Optional<CXFA_ContentLayoutProcessor::Stage>
+absl::optional<CXFA_ContentLayoutProcessor::Stage>
CXFA_ContentLayoutProcessor::HandleBreakAfter(CXFA_Node* pChildContainer,
CXFA_Node** pCurActionNode) {
if (*pCurActionNode) {
@@ -2726,7 +2727,7 @@
return HandleKeep(pBreakAfterNode, pCurActionNode);
}
-Optional<CXFA_ContentLayoutProcessor::Stage>
+absl::optional<CXFA_ContentLayoutProcessor::Stage>
CXFA_ContentLayoutProcessor::HandleCheckNextChildContainer(
CXFA_Node* pParentContainer,
CXFA_Node* pChildContainer,
@@ -2744,7 +2745,7 @@
return absl::nullopt;
bool bLastKeep = false;
- Optional<Stage> ret = ProcessKeepNodesForCheckNext(
+ absl::optional<Stage> ret = ProcessKeepNodesForCheckNext(
pCurActionNode, &pNextChildContainer, &bLastKeep);
if (ret.has_value())
return ret.value();
@@ -2759,7 +2760,7 @@
return m_bIsProcessKeep ? Stage::kKeep : Stage::kContainer;
}
-Optional<CXFA_ContentLayoutProcessor::Stage>
+absl::optional<CXFA_ContentLayoutProcessor::Stage>
CXFA_ContentLayoutProcessor::HandleBookendTrailer(CXFA_Node* pParentContainer,
CXFA_Node** pCurActionNode) {
for (CXFA_Node* pBookendNode = *pCurActionNode
diff --git a/xfa/fxfa/layout/cxfa_contentlayoutprocessor.h b/xfa/fxfa/layout/cxfa_contentlayoutprocessor.h
index f76b9a8..59175c8 100644
--- a/xfa/fxfa/layout/cxfa_contentlayoutprocessor.h
+++ b/xfa/fxfa/layout/cxfa_contentlayoutprocessor.h
@@ -72,7 +72,7 @@
Context();
~Context();
- Optional<float> m_fCurColumnWidth;
+ absl::optional<float> m_fCurColumnWidth;
UnownedPtr<std::vector<float>> m_prgSpecifiedColumnWidths;
UnownedPtr<CXFA_ContentLayoutProcessor> m_pOverflowProcessor; // OK, stack
UnownedPtr<CXFA_Node> m_pOverflowNode; // Ok, stack
@@ -155,12 +155,13 @@
CXFA_Node* pParentContainer,
CXFA_Node* pCurActionNode);
- Optional<Stage> ProcessKeepNodesForCheckNext(CXFA_Node** pCurActionNode,
- CXFA_Node** pNextContainer,
- bool* pLastKeepNode);
+ absl::optional<Stage> ProcessKeepNodesForCheckNext(CXFA_Node** pCurActionNode,
+ CXFA_Node** pNextContainer,
+ bool* pLastKeepNode);
- Optional<Stage> ProcessKeepNodesForBreakBefore(CXFA_Node** pCurActionNode,
- CXFA_Node* pContainerNode);
+ absl::optional<Stage> ProcessKeepNodesForBreakBefore(
+ CXFA_Node** pCurActionNode,
+ CXFA_Node* pContainerNode);
CXFA_Node* GetSubformSetParent(CXFA_Node* pSubformSet);
@@ -192,19 +193,20 @@
Context* pLayoutContext,
bool bNewRow);
- Optional<Stage> HandleKeep(CXFA_Node* pBreakAfterNode,
- CXFA_Node** pCurActionNode);
- Optional<Stage> HandleBookendLeader(CXFA_Node* pParentContainer,
- CXFA_Node** pCurActionNode);
- Optional<Stage> HandleBreakBefore(CXFA_Node* pChildContainer,
- CXFA_Node** pCurActionNode);
- Optional<Stage> HandleBreakAfter(CXFA_Node* pChildContainer,
+ absl::optional<Stage> HandleKeep(CXFA_Node* pBreakAfterNode,
CXFA_Node** pCurActionNode);
- Optional<Stage> HandleCheckNextChildContainer(CXFA_Node* pParentContainer,
- CXFA_Node* pChildContainer,
- CXFA_Node** pCurActionNode);
- Optional<Stage> HandleBookendTrailer(CXFA_Node* pParentContainer,
- CXFA_Node** pCurActionNode);
+ absl::optional<Stage> HandleBookendLeader(CXFA_Node* pParentContainer,
+ CXFA_Node** pCurActionNode);
+ absl::optional<Stage> HandleBreakBefore(CXFA_Node* pChildContainer,
+ CXFA_Node** pCurActionNode);
+ absl::optional<Stage> HandleBreakAfter(CXFA_Node* pChildContainer,
+ CXFA_Node** pCurActionNode);
+ absl::optional<Stage> HandleCheckNextChildContainer(
+ CXFA_Node* pParentContainer,
+ CXFA_Node* pChildContainer,
+ CXFA_Node** pCurActionNode);
+ absl::optional<Stage> HandleBookendTrailer(CXFA_Node* pParentContainer,
+ CXFA_Node** pCurActionNode);
void ProcessKeepNodesEnd();
void AdjustContainerSpecifiedSize(Context* pContext,
CFX_SizeF* pSize,
diff --git a/xfa/fxfa/layout/cxfa_viewlayoutprocessor.cpp b/xfa/fxfa/layout/cxfa_viewlayoutprocessor.cpp
index b6e864c..086e02d 100644
--- a/xfa/fxfa/layout/cxfa_viewlayoutprocessor.cpp
+++ b/xfa/fxfa/layout/cxfa_viewlayoutprocessor.cpp
@@ -185,7 +185,7 @@
bool bTargetAllFind = true;
while (iSplitIndex != -1) {
WideString wsExpr;
- Optional<size_t> iSplitNextIndex = 0;
+ absl::optional<size_t> iSplitNextIndex = 0;
if (!bTargetAllFind) {
iSplitNextIndex = pTargetAll->Find(' ', iSplitIndex);
if (!iSplitNextIndex.has_value())
@@ -210,7 +210,7 @@
if (wsExpr.First(4).EqualsASCII("som(") && wsExpr.Back() == L')')
wsProcessedTarget = wsExpr.Substr(4, wsExpr.GetLength() - 5);
- Optional<CFXJSE_Engine::ResolveResult> maybeResult =
+ absl::optional<CFXJSE_Engine::ResolveResult> maybeResult =
pDocument->GetScriptContext()->ResolveObjects(
pPageSetRoot, wsProcessedTarget.AsStringView(),
Mask<XFA_ResolveFlag>{
@@ -233,7 +233,7 @@
}
// Note: Returning nullptr is not the same as returning absl::nullopt.
-Optional<CXFA_ViewLayoutItem*> CheckContentAreaNotUsed(
+absl::optional<CXFA_ViewLayoutItem*> CheckContentAreaNotUsed(
CXFA_ViewLayoutItem* pPageAreaLayoutItem,
CXFA_Node* pContentArea) {
for (CXFA_LayoutItem* pChild = pPageAreaLayoutItem->GetFirstChild(); pChild;
@@ -879,17 +879,17 @@
return ret;
}
-Optional<CXFA_ViewLayoutProcessor::BreakData>
+absl::optional<CXFA_ViewLayoutProcessor::BreakData>
CXFA_ViewLayoutProcessor::ProcessBreakBefore(const CXFA_Node* pBreakNode) {
return ProcessBreakBeforeOrAfter(pBreakNode, /*before=*/true);
}
-Optional<CXFA_ViewLayoutProcessor::BreakData>
+absl::optional<CXFA_ViewLayoutProcessor::BreakData>
CXFA_ViewLayoutProcessor::ProcessBreakAfter(const CXFA_Node* pBreakNode) {
return ProcessBreakBeforeOrAfter(pBreakNode, /*before=*/false);
}
-Optional<CXFA_ViewLayoutProcessor::BreakData>
+absl::optional<CXFA_ViewLayoutProcessor::BreakData>
CXFA_ViewLayoutProcessor::ProcessBreakBeforeOrAfter(const CXFA_Node* pBreakNode,
bool bBefore) {
CXFA_Node* pFormNode = pBreakNode->GetContainerParent();
@@ -1043,7 +1043,7 @@
return true;
}
-Optional<CXFA_ViewLayoutProcessor::OverflowData>
+absl::optional<CXFA_ViewLayoutProcessor::OverflowData>
CXFA_ViewLayoutProcessor::ProcessOverflow(CXFA_Node* pFormNode,
bool bCreatePage) {
if (!pFormNode)
@@ -1155,7 +1155,7 @@
CXFA_Node* pOccurNode =
pPageSet->GetFirstChildByClass<CXFA_Occur>(XFA_Element::Occur);
if (pOccurNode) {
- Optional<int32_t> ret =
+ absl::optional<int32_t> ret =
pOccurNode->JSObject()->TryInteger(XFA_Attribute::Max, false);
if (ret.has_value())
iMax = ret.value();
@@ -1324,7 +1324,7 @@
if (m_ePageSetMode != XFA_AttributeValue::DuplexPaginated)
return true;
- Optional<XFA_AttributeValue> ret =
+ absl::optional<XFA_AttributeValue> ret =
pPageArea->JSObject()->TryEnum(XFA_Attribute::OddOrEven, true);
if (!ret.has_value() || ret == XFA_AttributeValue::Any)
return true;
@@ -1353,7 +1353,7 @@
CXFA_Node* pOccurNode =
m_pCurPageArea->GetFirstChildByClass<CXFA_Occur>(XFA_Element::Occur);
if (pOccurNode) {
- Optional<int32_t> ret =
+ absl::optional<int32_t> ret =
pOccurNode->JSObject()->TryInteger(XFA_Attribute::Max, false);
if (ret.has_value())
iMax = ret.value();
@@ -1415,8 +1415,9 @@
if (pContentArea->GetParent() != m_pCurPageArea)
return false;
- Optional<CXFA_ViewLayoutItem*> pContentAreaLayout = CheckContentAreaNotUsed(
- GetCurrentViewRecord()->pCurPageArea.Get(), pContentArea);
+ absl::optional<CXFA_ViewLayoutItem*> pContentAreaLayout =
+ CheckContentAreaNotUsed(GetCurrentViewRecord()->pCurPageArea.Get(),
+ pContentArea);
if (!pContentAreaLayout.has_value())
return false;
if (pContentAreaLayout.value()) {
@@ -1457,7 +1458,7 @@
return 0;
int32_t iMin = 0;
- Optional<int32_t> ret;
+ absl::optional<int32_t> ret;
CXFA_Node* pOccurNode =
pPageArea->GetFirstChildByClass<CXFA_Occur>(XFA_Element::Occur);
if (pOccurNode) {
@@ -1501,7 +1502,7 @@
if (!pOccurNode)
return;
- Optional<int32_t> iMin =
+ absl::optional<int32_t> iMin =
pOccurNode->JSObject()->TryInteger(XFA_Attribute::Min, false);
if (!iMin.has_value() || iCurSetCount >= iMin.value())
return;
@@ -1566,7 +1567,7 @@
CXFA_Node* pOccurNode =
pPageNode->GetFirstChildByClass<CXFA_Occur>(XFA_Element::Occur);
int32_t iMax = 0;
- Optional<int32_t> ret;
+ absl::optional<int32_t> ret;
if (pOccurNode) {
ret = pOccurNode->JSObject()->TryInteger(XFA_Attribute::Max, false);
if (ret.has_value())
diff --git a/xfa/fxfa/layout/cxfa_viewlayoutprocessor.h b/xfa/fxfa/layout/cxfa_viewlayoutprocessor.h
index 59529b0..526b7aa 100644
--- a/xfa/fxfa/layout/cxfa_viewlayoutprocessor.h
+++ b/xfa/fxfa/layout/cxfa_viewlayoutprocessor.h
@@ -62,10 +62,10 @@
CXFA_ViewLayoutItem* GetRootLayoutItem() const {
return m_pPageSetRootLayoutItem.Get();
}
- Optional<BreakData> ProcessBreakBefore(const CXFA_Node* pBreakNode);
- Optional<BreakData> ProcessBreakAfter(const CXFA_Node* pBreakNode);
- Optional<OverflowData> ProcessOverflow(CXFA_Node* pFormNode,
- bool bCreatePage);
+ absl::optional<BreakData> ProcessBreakBefore(const CXFA_Node* pBreakNode);
+ absl::optional<BreakData> ProcessBreakAfter(const CXFA_Node* pBreakNode);
+ absl::optional<OverflowData> ProcessOverflow(CXFA_Node* pFormNode,
+ bool bCreatePage);
CXFA_Node* QueryOverflow(CXFA_Node* pFormNode);
CXFA_Node* ProcessBookendLeader(const CXFA_Node* pBookendNode);
CXFA_Node* ProcessBookendTrailer(const CXFA_Node* pBookendNode);
@@ -130,8 +130,9 @@
bool bLeader);
CXFA_Node* ResolveBookendLeaderOrTrailer(const CXFA_Node* pBookendNode,
bool bLeader);
- Optional<BreakData> ProcessBreakBeforeOrAfter(const CXFA_Node* pBreakNode,
- bool bBefore);
+ absl::optional<BreakData> ProcessBreakBeforeOrAfter(
+ const CXFA_Node* pBreakNode,
+ bool bBefore);
BreakData ExecuteBreakBeforeOrAfter(const CXFA_Node* pCurNode, bool bBefore);
int32_t CreateMinPageRecord(CXFA_Node* pPageArea,
diff --git a/xfa/fxfa/parser/cxfa_barcode.cpp b/xfa/fxfa/parser/cxfa_barcode.cpp
index dd1efba..0b3636f 100644
--- a/xfa/fxfa/parser/cxfa_barcode.cpp
+++ b/xfa/fxfa/parser/cxfa_barcode.cpp
@@ -64,12 +64,12 @@
return WideString(JSObject()->GetCData(XFA_Attribute::Type));
}
-Optional<WideString> CXFA_Barcode::GetCharEncoding() {
+absl::optional<WideString> CXFA_Barcode::GetCharEncoding() {
return JSObject()->TryCData(XFA_Attribute::CharEncoding, true);
}
-Optional<bool> CXFA_Barcode::GetChecksum() {
- Optional<XFA_AttributeValue> checksum =
+absl::optional<bool> CXFA_Barcode::GetChecksum() {
+ absl::optional<XFA_AttributeValue> checksum =
JSObject()->TryEnum(XFA_Attribute::Checksum, true);
if (!checksum.has_value())
return absl::nullopt;
@@ -88,8 +88,8 @@
return absl::nullopt;
}
-Optional<int32_t> CXFA_Barcode::GetDataLength() {
- Optional<WideString> wsDataLength =
+absl::optional<int32_t> CXFA_Barcode::GetDataLength() {
+ absl::optional<WideString> wsDataLength =
JSObject()->TryCData(XFA_Attribute::DataLength, true);
if (!wsDataLength.has_value())
return absl::nullopt;
@@ -97,8 +97,8 @@
return FXSYS_wtoi(wsDataLength->c_str());
}
-Optional<char> CXFA_Barcode::GetStartChar() {
- Optional<WideString> wsStartEndChar =
+absl::optional<char> CXFA_Barcode::GetStartChar() {
+ absl::optional<WideString> wsStartEndChar =
JSObject()->TryCData(XFA_Attribute::StartChar, true);
if (!wsStartEndChar.has_value() || wsStartEndChar->IsEmpty())
return absl::nullopt;
@@ -106,8 +106,8 @@
return static_cast<char>(wsStartEndChar.value()[0]);
}
-Optional<char> CXFA_Barcode::GetEndChar() {
- Optional<WideString> wsStartEndChar =
+absl::optional<char> CXFA_Barcode::GetEndChar() {
+ absl::optional<WideString> wsStartEndChar =
JSObject()->TryCData(XFA_Attribute::EndChar, true);
if (!wsStartEndChar.has_value() || wsStartEndChar->IsEmpty())
return absl::nullopt;
@@ -115,16 +115,16 @@
return static_cast<char>(wsStartEndChar.value()[0]);
}
-Optional<int32_t> CXFA_Barcode::GetECLevel() {
- Optional<WideString> wsECLevel =
+absl::optional<int32_t> CXFA_Barcode::GetECLevel() {
+ absl::optional<WideString> wsECLevel =
JSObject()->TryCData(XFA_Attribute::ErrorCorrectionLevel, true);
if (!wsECLevel.has_value())
return absl::nullopt;
return FXSYS_wtoi(wsECLevel->c_str());
}
-Optional<int32_t> CXFA_Barcode::GetModuleWidth() {
- Optional<CXFA_Measurement> moduleWidthHeight =
+absl::optional<int32_t> CXFA_Barcode::GetModuleWidth() {
+ absl::optional<CXFA_Measurement> moduleWidthHeight =
JSObject()->TryMeasure(XFA_Attribute::ModuleWidth, true);
if (!moduleWidthHeight.has_value())
return absl::nullopt;
@@ -132,8 +132,8 @@
return static_cast<int32_t>(moduleWidthHeight->ToUnit(XFA_Unit::Pt));
}
-Optional<int32_t> CXFA_Barcode::GetModuleHeight() {
- Optional<CXFA_Measurement> moduleWidthHeight =
+absl::optional<int32_t> CXFA_Barcode::GetModuleHeight() {
+ absl::optional<CXFA_Measurement> moduleWidthHeight =
JSObject()->TryMeasure(XFA_Attribute::ModuleHeight, true);
if (!moduleWidthHeight.has_value())
return absl::nullopt;
@@ -141,25 +141,25 @@
return static_cast<int32_t>(moduleWidthHeight->ToUnit(XFA_Unit::Pt));
}
-Optional<bool> CXFA_Barcode::GetPrintChecksum() {
+absl::optional<bool> CXFA_Barcode::GetPrintChecksum() {
return JSObject()->TryBoolean(XFA_Attribute::PrintCheckDigit, true);
}
-Optional<XFA_AttributeValue> CXFA_Barcode::GetTextLocation() {
+absl::optional<XFA_AttributeValue> CXFA_Barcode::GetTextLocation() {
return JSObject()->TryEnum(XFA_Attribute::TextLocation, true);
}
-Optional<bool> CXFA_Barcode::GetTruncate() {
+absl::optional<bool> CXFA_Barcode::GetTruncate() {
return JSObject()->TryBoolean(XFA_Attribute::Truncate, true);
}
-Optional<int8_t> CXFA_Barcode::GetWideNarrowRatio() {
- Optional<WideString> wsWideNarrowRatio =
+absl::optional<int8_t> CXFA_Barcode::GetWideNarrowRatio() {
+ absl::optional<WideString> wsWideNarrowRatio =
JSObject()->TryCData(XFA_Attribute::WideNarrowRatio, true);
if (!wsWideNarrowRatio.has_value())
return absl::nullopt;
- Optional<size_t> ptPos = wsWideNarrowRatio->Find(':');
+ absl::optional<size_t> ptPos = wsWideNarrowRatio->Find(':');
if (!ptPos.has_value())
return static_cast<int8_t>(FXSYS_wtoi(wsWideNarrowRatio->c_str()));
diff --git a/xfa/fxfa/parser/cxfa_barcode.h b/xfa/fxfa/parser/cxfa_barcode.h
index 520e5d1..1ae6d08 100644
--- a/xfa/fxfa/parser/cxfa_barcode.h
+++ b/xfa/fxfa/parser/cxfa_barcode.h
@@ -18,18 +18,18 @@
XFA_FFWidgetType GetDefaultFFWidgetType() const override;
WideString GetBarcodeType();
- Optional<WideString> GetCharEncoding();
- Optional<bool> GetChecksum();
- Optional<int32_t> GetDataLength();
- Optional<char> GetStartChar();
- Optional<char> GetEndChar();
- Optional<int32_t> GetECLevel();
- Optional<int32_t> GetModuleWidth();
- Optional<int32_t> GetModuleHeight();
- Optional<bool> GetPrintChecksum();
- Optional<XFA_AttributeValue> GetTextLocation();
- Optional<bool> GetTruncate();
- Optional<int8_t> GetWideNarrowRatio();
+ absl::optional<WideString> GetCharEncoding();
+ absl::optional<bool> GetChecksum();
+ absl::optional<int32_t> GetDataLength();
+ absl::optional<char> GetStartChar();
+ absl::optional<char> GetEndChar();
+ absl::optional<int32_t> GetECLevel();
+ absl::optional<int32_t> GetModuleWidth();
+ absl::optional<int32_t> GetModuleHeight();
+ absl::optional<bool> GetPrintChecksum();
+ absl::optional<XFA_AttributeValue> GetTextLocation();
+ absl::optional<bool> GetTruncate();
+ absl::optional<int8_t> GetWideNarrowRatio();
private:
CXFA_Barcode(CXFA_Document* doc, XFA_PacketType packet);
diff --git a/xfa/fxfa/parser/cxfa_box.cpp b/xfa/fxfa/parser/cxfa_box.cpp
index 40a85c7..4ab2519 100644
--- a/xfa/fxfa/parser/cxfa_box.cpp
+++ b/xfa/fxfa/parser/cxfa_box.cpp
@@ -108,11 +108,11 @@
return JSObject()->GetBoolean(XFA_Attribute::Circular);
}
-Optional<int32_t> CXFA_Box::GetStartAngle() {
+absl::optional<int32_t> CXFA_Box::GetStartAngle() {
return JSObject()->TryInteger(XFA_Attribute::StartAngle, false);
}
-Optional<int32_t> CXFA_Box::GetSweepAngle() {
+absl::optional<int32_t> CXFA_Box::GetSweepAngle() {
return JSObject()->TryInteger(XFA_Attribute::SweepAngle, false);
}
@@ -256,8 +256,8 @@
rtDraw.top = center.y - b;
rtDraw.width = a + a;
rtDraw.height = b + b;
- Optional<int32_t> startAngle = GetStartAngle();
- Optional<int32_t> sweepAngle = GetSweepAngle();
+ absl::optional<int32_t> startAngle = GetStartAngle();
+ absl::optional<int32_t> sweepAngle = GetSweepAngle();
if (!startAngle.has_value() && !sweepAngle.has_value()) {
fillPath->AddEllipse(rtDraw);
return;
diff --git a/xfa/fxfa/parser/cxfa_box.h b/xfa/fxfa/parser/cxfa_box.h
index 0c12ada..c4d00e1 100644
--- a/xfa/fxfa/parser/cxfa_box.h
+++ b/xfa/fxfa/parser/cxfa_box.h
@@ -52,8 +52,8 @@
private:
bool IsCircular();
- Optional<int32_t> GetStartAngle();
- Optional<int32_t> GetSweepAngle();
+ absl::optional<int32_t> GetStartAngle();
+ absl::optional<int32_t> GetSweepAngle();
std::vector<CXFA_Stroke*> GetStrokesInternal(bool bNull);
void DrawFill(const std::vector<CXFA_Stroke*>& strokes,
diff --git a/xfa/fxfa/parser/cxfa_color.cpp b/xfa/fxfa/parser/cxfa_color.cpp
index d16f14d..74d9c07 100644
--- a/xfa/fxfa/parser/cxfa_color.cpp
+++ b/xfa/fxfa/parser/cxfa_color.cpp
@@ -95,12 +95,14 @@
CXFA_Color::~CXFA_Color() = default;
FX_ARGB CXFA_Color::GetValue() const {
- Optional<WideString> val = JSObject()->TryCData(XFA_Attribute::Value, false);
+ absl::optional<WideString> val =
+ JSObject()->TryCData(XFA_Attribute::Value, false);
return val.has_value() ? StringToFXARGB(val->AsStringView()) : 0xFF000000;
}
FX_ARGB CXFA_Color::GetValueOrDefault(FX_ARGB defaultValue) const {
- Optional<WideString> val = JSObject()->TryCData(XFA_Attribute::Value, false);
+ absl::optional<WideString> val =
+ JSObject()->TryCData(XFA_Attribute::Value, false);
return val.has_value() ? StringToFXARGB(val->AsStringView()) : defaultValue;
}
diff --git a/xfa/fxfa/parser/cxfa_document.cpp b/xfa/fxfa/parser/cxfa_document.cpp
index 484ad2b..634daec 100644
--- a/xfa/fxfa/parser/cxfa_document.cpp
+++ b/xfa/fxfa/parser/cxfa_document.cpp
@@ -106,7 +106,7 @@
if (!pContentRawDataNode) {
XFA_Element element = XFA_Element::Sharptext;
if (pChildNode->GetElementType() == XFA_Element::ExData) {
- Optional<WideString> contentType =
+ absl::optional<WideString> contentType =
pChildNode->JSObject()->TryAttribute(XFA_Attribute::ContentType,
false);
if (contentType.has_value()) {
@@ -352,7 +352,7 @@
dwFlags |= XFA_ResolveFlag::kParent;
dwFlags |= XFA_ResolveFlag::kSiblings;
}
- Optional<CFXJSE_Engine::ResolveResult> maybeResult =
+ absl::optional<CFXJSE_Engine::ResolveResult> maybeResult =
pDocument->GetScriptContext()->ResolveObjectsWithBindNode(
pDataScope, wsRef.AsStringView(), dwFlags, pTemplateNode);
if (!maybeResult.has_value())
@@ -752,7 +752,7 @@
if (pDDGroupNode->GetElementType() != XFA_Element::DataGroup)
continue;
- Optional<WideString> ns = pDDGroupNode->JSObject()->TryNamespace();
+ absl::optional<WideString> ns = pDDGroupNode->JSObject()->TryNamespace();
if (!ns.has_value() ||
!ns.value().EqualsASCII("http://ns.adobe.com/data-description/")) {
continue;
@@ -1201,7 +1201,7 @@
: WideString();
const Mask<XFA_ResolveFlag> kFlags = {XFA_ResolveFlag::kChildren,
XFA_ResolveFlag::kCreateNode};
- Optional<CFXJSE_Engine::ResolveResult> maybeResult =
+ absl::optional<CFXJSE_Engine::ResolveResult> maybeResult =
pDocument->GetScriptContext()->ResolveObjectsWithBindNode(
pDataScope, wsRef.AsStringView(), kFlags, pTemplateNode);
CXFA_Object* pObject =
@@ -1259,7 +1259,8 @@
if (pDDGroupNode->GetElementType() != XFA_Element::DataGroup)
continue;
- Optional<WideString> ns = pDDGroupNode->JSObject()->TryNamespace();
+ absl::optional<WideString> ns =
+ pDDGroupNode->JSObject()->TryNamespace();
if (!ns.has_value() ||
!ns.value().EqualsASCII("http://ns.adobe.com/data-description/")) {
continue;
@@ -1340,12 +1341,12 @@
if (pDatasetsChild->GetNameHash() != XFA_HASHCODE_Data)
continue;
- Optional<WideString> namespaceURI =
+ absl::optional<WideString> namespaceURI =
pDatasetsChild->JSObject()->TryNamespace();
if (!namespaceURI.has_value())
continue;
- Optional<WideString> datasetsURI =
+ absl::optional<WideString> datasetsURI =
pDatasetsNode->JSObject()->TryNamespace();
if (!datasetsURI.has_value())
continue;
@@ -1578,7 +1579,7 @@
CXFA_Node* pProtoNode = nullptr;
if (!wsSOM.IsEmpty()) {
- Optional<CFXJSE_Engine::ResolveResult> maybeResult =
+ absl::optional<CFXJSE_Engine::ResolveResult> maybeResult =
m_pScriptContext->ResolveObjects(
pUseHrefNode, wsSOM,
Mask<XFA_ResolveFlag>{
@@ -1681,7 +1682,7 @@
continue;
if (!pDDRoot && pChildNode->GetNameHash() == XFA_HASHCODE_DataDescription) {
- Optional<WideString> namespaceURI =
+ absl::optional<WideString> namespaceURI =
pChildNode->JSObject()->TryNamespace();
if (!namespaceURI.has_value())
continue;
@@ -1690,7 +1691,7 @@
pDDRoot = pChildNode;
}
} else if (!pDataRoot && pChildNode->GetNameHash() == XFA_HASHCODE_Data) {
- Optional<WideString> namespaceURI =
+ absl::optional<WideString> namespaceURI =
pChildNode->JSObject()->TryNamespace();
if (!namespaceURI.has_value())
continue;
diff --git a/xfa/fxfa/parser/cxfa_document.h b/xfa/fxfa/parser/cxfa_document.h
index bbada2d..677e9d1 100644
--- a/xfa/fxfa/parser/cxfa_document.h
+++ b/xfa/fxfa/parser/cxfa_document.h
@@ -165,7 +165,7 @@
std::map<uint32_t, cppgc::Member<CXFA_Node>> m_rgGlobalBinding;
std::vector<cppgc::Member<CXFA_Node>> m_pPendingPageSet;
XFA_VERSION m_eCurVersionMode = XFA_VERSION_DEFAULT;
- Optional<bool> m_Interactive;
+ absl::optional<bool> m_Interactive;
bool m_bStrictScoping = false;
bool m_bScripting = false;
};
diff --git a/xfa/fxfa/parser/cxfa_document_builder.cpp b/xfa/fxfa/parser/cxfa_document_builder.cpp
index db4bdbc..24f666d 100644
--- a/xfa/fxfa/parser/cxfa_document_builder.cpp
+++ b/xfa/fxfa/parser/cxfa_document_builder.cpp
@@ -98,9 +98,10 @@
return true;
}
-Optional<WideString> FindAttributeWithNS(CFX_XMLElement* pElement,
- WideStringView wsLocalAttributeName,
- WideStringView wsNamespaceURIPrefix) {
+absl::optional<WideString> FindAttributeWithNS(
+ CFX_XMLElement* pElement,
+ WideStringView wsLocalAttributeName,
+ WideStringView wsNamespaceURIPrefix) {
WideString wsAttrNS;
for (auto it : pElement->GetAttributes()) {
auto pos = it.first.Find(L':', 0);
@@ -377,7 +378,7 @@
continue;
WideString wsPacketName = pElement->GetLocalTagName();
- Optional<XFA_PACKETINFO> packet_info =
+ absl::optional<XFA_PACKETINFO> packet_info =
XFA_GetPacketByName(wsPacketName.AsStringView());
if (packet_info.has_value() && packet_info.value().uri &&
!MatchNodeName(pElement, packet_info.value().name,
@@ -677,7 +678,7 @@
if (wsAttrName.EqualsASCII("nil") && it.second.EqualsASCII("true"))
IsNeedValue = false;
- Optional<XFA_ATTRIBUTEINFO> attr =
+ absl::optional<XFA_ATTRIBUTEINFO> attr =
XFA_GetAttributeByName(wsAttrName.AsStringView());
if (!attr.has_value())
continue;
@@ -795,7 +796,7 @@
XFA_Element eNodeType = XFA_Element::DataModel;
if (eNodeType == XFA_Element::DataModel) {
- Optional<WideString> wsDataNodeAttr =
+ absl::optional<WideString> wsDataNodeAttr =
FindAttributeWithNS(pXMLElement, L"dataNode",
L"http://www.xfa.org/schema/xfa-data/1.0/");
if (wsDataNodeAttr.has_value()) {
@@ -806,7 +807,7 @@
}
}
if (eNodeType == XFA_Element::DataModel) {
- Optional<WideString> wsContentType =
+ absl::optional<WideString> wsContentType =
FindAttributeWithNS(pXMLElement, L"contentType",
L"http://www.xfa.org/schema/xfa-data/1.0/");
if (wsContentType.has_value() && !wsContentType.value().IsEmpty())
diff --git a/xfa/fxfa/parser/cxfa_localemgr.cpp b/xfa/fxfa/parser/cxfa_localemgr.cpp
index 3e92d0d..74cd665 100644
--- a/xfa/fxfa/parser/cxfa_localemgr.cpp
+++ b/xfa/fxfa/parser/cxfa_localemgr.cpp
@@ -1232,7 +1232,7 @@
m_pDefLocale = pLocale;
}
-Optional<WideString> CXFA_LocaleMgr::GetConfigLocaleName(
+absl::optional<WideString> CXFA_LocaleMgr::GetConfigLocaleName(
CXFA_Node* pConfig) const {
if (m_bConfigLocaleCached)
return m_wsConfigLocale;
@@ -1261,7 +1261,7 @@
if (!pLocale)
return m_wsConfigLocale;
- Optional<WideString> wsMaybeLocale =
+ absl::optional<WideString> wsMaybeLocale =
pLocale->JSObject()->TryCData(XFA_Attribute::Value, false);
if (!wsMaybeLocale.has_value() || wsMaybeLocale.value().IsEmpty())
return m_wsConfigLocale;
diff --git a/xfa/fxfa/parser/cxfa_localemgr.h b/xfa/fxfa/parser/cxfa_localemgr.h
index d5d97b6..596cbe5 100644
--- a/xfa/fxfa/parser/cxfa_localemgr.h
+++ b/xfa/fxfa/parser/cxfa_localemgr.h
@@ -52,7 +52,7 @@
GCedLocaleIface* GetLocaleByName(const WideString& wsLocaleName) override;
void SetDefLocale(GCedLocaleIface* pLocale);
- Optional<WideString> GetConfigLocaleName(CXFA_Node* pConfig) const;
+ absl::optional<WideString> GetConfigLocaleName(CXFA_Node* pConfig) const;
private:
CXFA_LocaleMgr(cppgc::Heap* pHeap,
@@ -74,7 +74,7 @@
// 3. we might have tried and gotten something.
// So |m_bConfigLocaleCached| indicates whether we've already tried,
// and |m_wsConfigLocale| is the possibly nothing we got if we tried.
- mutable Optional<WideString> m_wsConfigLocale;
+ mutable absl::optional<WideString> m_wsConfigLocale;
mutable bool m_bConfigLocaleCached = false;
LangID m_eDeflcid;
diff --git a/xfa/fxfa/parser/cxfa_margin.cpp b/xfa/fxfa/parser/cxfa_margin.cpp
index aff9cd4..eec2aef 100644
--- a/xfa/fxfa/parser/cxfa_margin.cpp
+++ b/xfa/fxfa/parser/cxfa_margin.cpp
@@ -57,18 +57,18 @@
return TryBottomInset().value_or(0);
}
-Optional<float> CXFA_Margin::TryLeftInset() const {
+absl::optional<float> CXFA_Margin::TryLeftInset() const {
return JSObject()->TryMeasureAsFloat(XFA_Attribute::LeftInset);
}
-Optional<float> CXFA_Margin::TryTopInset() const {
+absl::optional<float> CXFA_Margin::TryTopInset() const {
return JSObject()->TryMeasureAsFloat(XFA_Attribute::TopInset);
}
-Optional<float> CXFA_Margin::TryRightInset() const {
+absl::optional<float> CXFA_Margin::TryRightInset() const {
return JSObject()->TryMeasureAsFloat(XFA_Attribute::RightInset);
}
-Optional<float> CXFA_Margin::TryBottomInset() const {
+absl::optional<float> CXFA_Margin::TryBottomInset() const {
return JSObject()->TryMeasureAsFloat(XFA_Attribute::BottomInset);
}
diff --git a/xfa/fxfa/parser/cxfa_margin.h b/xfa/fxfa/parser/cxfa_margin.h
index bb32da9..24b0174 100644
--- a/xfa/fxfa/parser/cxfa_margin.h
+++ b/xfa/fxfa/parser/cxfa_margin.h
@@ -19,10 +19,10 @@
float GetRightInset() const;
float GetBottomInset() const;
- Optional<float> TryLeftInset() const;
- Optional<float> TryTopInset() const;
- Optional<float> TryRightInset() const;
- Optional<float> TryBottomInset() const;
+ absl::optional<float> TryLeftInset() const;
+ absl::optional<float> TryTopInset() const;
+ absl::optional<float> TryRightInset() const;
+ absl::optional<float> TryBottomInset() const;
private:
CXFA_Margin(CXFA_Document* doc, XFA_PacketType packet);
diff --git a/xfa/fxfa/parser/cxfa_node.cpp b/xfa/fxfa/parser/cxfa_node.cpp
index 64cb174..64bb803 100644
--- a/xfa/fxfa/parser/cxfa_node.cpp
+++ b/xfa/fxfa/parser/cxfa_node.cpp
@@ -1156,7 +1156,7 @@
return pNewNode;
}
-Optional<XFA_Element> CXFA_Node::GetFirstPropertyWithFlag(
+absl::optional<XFA_Element> CXFA_Node::GetFirstPropertyWithFlag(
XFA_PropertyFlag flag) const {
for (const auto& prop : m_Properties) {
if (prop.flags & flag)
@@ -1240,7 +1240,7 @@
if (!bFilterOneOfProperties || !nodes.empty())
return nodes;
- Optional<XFA_Element> property =
+ absl::optional<XFA_Element> property =
GetFirstPropertyWithFlag(XFA_PropertyFlag::kDefaultOneOf);
if (!property.has_value())
return nodes;
@@ -1405,7 +1405,7 @@
}
GCedLocaleIface* CXFA_Node::GetLocale() {
- Optional<WideString> localeName = GetLocaleName();
+ absl::optional<WideString> localeName = GetLocaleName();
if (!localeName.has_value())
return nullptr;
if (localeName.value().EqualsASCII("ambient"))
@@ -1413,7 +1413,7 @@
return GetDocument()->GetLocaleMgr()->GetLocaleByName(localeName.value());
}
-Optional<WideString> CXFA_Node::GetLocaleName() {
+absl::optional<WideString> CXFA_Node::GetLocaleName() {
CXFA_Node* pForm = ToNode(GetDocument()->GetXFAObject(XFA_HASHCODE_Form));
if (!pForm)
return absl::nullopt;
@@ -1423,7 +1423,7 @@
if (!pTopSubform)
return absl::nullopt;
- Optional<WideString> localeName;
+ absl::optional<WideString> localeName;
CXFA_Node* pLocaleNode = this;
do {
localeName =
@@ -1459,7 +1459,8 @@
XFA_AttributeValue eLayoutType =
layout.value_or(XFA_AttributeValue::Position);
if (pKeep) {
- Optional<XFA_AttributeValue> intact = GetIntactFromKeep(pKeep, eLayoutType);
+ absl::optional<XFA_AttributeValue> intact =
+ GetIntactFromKeep(pKeep, eLayoutType);
if (intact.has_value())
return intact.value();
}
@@ -1491,7 +1492,7 @@
XFA_VERSION version = m_pDocument->GetCurVersionMode();
if (eParLayout == XFA_AttributeValue::Tb && version < XFA_VERSION_208) {
- Optional<CXFA_Measurement> measureH =
+ absl::optional<CXFA_Measurement> measureH =
JSObject()->TryMeasure(XFA_Attribute::H, false);
if (measureH.has_value())
return XFA_AttributeValue::ContentArea;
@@ -2032,23 +2033,26 @@
return pInstance;
}
-Optional<bool> CXFA_Node::GetDefaultBoolean(XFA_Attribute attr) const {
- Optional<void*> value = GetDefaultValue(attr, XFA_AttributeType::Boolean);
+absl::optional<bool> CXFA_Node::GetDefaultBoolean(XFA_Attribute attr) const {
+ absl::optional<void*> value =
+ GetDefaultValue(attr, XFA_AttributeType::Boolean);
if (!value.has_value())
return absl::nullopt;
return !!value.value();
}
-Optional<int32_t> CXFA_Node::GetDefaultInteger(XFA_Attribute attr) const {
- Optional<void*> value = GetDefaultValue(attr, XFA_AttributeType::Integer);
+absl::optional<int32_t> CXFA_Node::GetDefaultInteger(XFA_Attribute attr) const {
+ absl::optional<void*> value =
+ GetDefaultValue(attr, XFA_AttributeType::Integer);
if (!value.has_value())
return absl::nullopt;
return static_cast<int32_t>(reinterpret_cast<uintptr_t>(value.value()));
}
-Optional<CXFA_Measurement> CXFA_Node::GetDefaultMeasurement(
+absl::optional<CXFA_Measurement> CXFA_Node::GetDefaultMeasurement(
XFA_Attribute attr) const {
- Optional<void*> value = GetDefaultValue(attr, XFA_AttributeType::Measure);
+ absl::optional<void*> value =
+ GetDefaultValue(attr, XFA_AttributeType::Measure);
if (!value.has_value())
return absl::nullopt;
@@ -2056,25 +2060,27 @@
return CXFA_Measurement(str.AsStringView());
}
-Optional<WideString> CXFA_Node::GetDefaultCData(XFA_Attribute attr) const {
- Optional<void*> value = GetDefaultValue(attr, XFA_AttributeType::CData);
+absl::optional<WideString> CXFA_Node::GetDefaultCData(
+ XFA_Attribute attr) const {
+ absl::optional<void*> value = GetDefaultValue(attr, XFA_AttributeType::CData);
if (!value.has_value())
return absl::nullopt;
return WideString(static_cast<const wchar_t*>(value.value()));
}
-Optional<XFA_AttributeValue> CXFA_Node::GetDefaultEnum(
+absl::optional<XFA_AttributeValue> CXFA_Node::GetDefaultEnum(
XFA_Attribute attr) const {
- Optional<void*> value = GetDefaultValue(attr, XFA_AttributeType::Enum);
+ absl::optional<void*> value = GetDefaultValue(attr, XFA_AttributeType::Enum);
if (!value.has_value())
return absl::nullopt;
return static_cast<XFA_AttributeValue>(
reinterpret_cast<uintptr_t>(value.value()));
}
-Optional<void*> CXFA_Node::GetDefaultValue(XFA_Attribute attr,
- XFA_AttributeType eType) const {
+absl::optional<void*> CXFA_Node::GetDefaultValue(
+ XFA_Attribute attr,
+ XFA_AttributeType eType) const {
const AttributeData* data = GetAttributeData(attr);
if (!data || data->type != eType)
return absl::nullopt;
@@ -2242,7 +2248,7 @@
}
int32_t CXFA_Node::GetRotate() const {
- Optional<int32_t> degrees =
+ absl::optional<int32_t> degrees =
JSObject()->TryInteger(XFA_Attribute::Rotate, false);
return degrees.has_value() ? XFA_MapRotation(degrees.value()) / 90 * 90 : 0;
}
@@ -2334,10 +2340,10 @@
return JSObject()->GetProperty<CXFA_Bind>(0, XFA_Element::Bind);
}
-Optional<XFA_AttributeValue> CXFA_Node::GetIntactFromKeep(
+absl::optional<XFA_AttributeValue> CXFA_Node::GetIntactFromKeep(
const CXFA_Keep* pKeep,
XFA_AttributeValue eLayoutType) const {
- Optional<XFA_AttributeValue> intact =
+ absl::optional<XFA_AttributeValue> intact =
pKeep->JSObject()->TryEnum(XFA_Attribute::Intact, false);
if (!intact.has_value())
return absl::nullopt;
@@ -2354,7 +2360,7 @@
return intact;
}
- Optional<XFA_AttributeValue> value =
+ absl::optional<XFA_AttributeValue> value =
pKeep->JSObject()->TryEnum(XFA_Attribute::Previous, false);
if (value == XFA_AttributeValue::ContentArea ||
value == XFA_AttributeValue::PageArea) {
@@ -2366,7 +2372,7 @@
if (!pNode)
return intact;
- Optional<XFA_AttributeValue> ret =
+ absl::optional<XFA_AttributeValue> ret =
pNode->JSObject()->TryEnum(XFA_Attribute::Next, false);
if (ret == XFA_AttributeValue::ContentArea ||
ret == XFA_AttributeValue::PageArea) {
@@ -2375,27 +2381,27 @@
return intact;
}
-Optional<float> CXFA_Node::TryWidth() {
+absl::optional<float> CXFA_Node::TryWidth() {
return JSObject()->TryMeasureAsFloat(XFA_Attribute::W);
}
-Optional<float> CXFA_Node::TryHeight() {
+absl::optional<float> CXFA_Node::TryHeight() {
return JSObject()->TryMeasureAsFloat(XFA_Attribute::H);
}
-Optional<float> CXFA_Node::TryMinWidth() {
+absl::optional<float> CXFA_Node::TryMinWidth() {
return JSObject()->TryMeasureAsFloat(XFA_Attribute::MinW);
}
-Optional<float> CXFA_Node::TryMinHeight() {
+absl::optional<float> CXFA_Node::TryMinHeight() {
return JSObject()->TryMeasureAsFloat(XFA_Attribute::MinH);
}
-Optional<float> CXFA_Node::TryMaxWidth() {
+absl::optional<float> CXFA_Node::TryMaxWidth() {
return JSObject()->TryMeasureAsFloat(XFA_Attribute::MaxW);
}
-Optional<float> CXFA_Node::TryMaxHeight() {
+absl::optional<float> CXFA_Node::TryMaxHeight() {
return JSObject()->TryMeasureAsFloat(XFA_Attribute::MaxH);
}
@@ -2996,10 +3002,10 @@
if (border && border->GetPresence() != XFA_AttributeValue::Visible)
return CFX_RectF();
- Optional<float> left = mgUI->TryLeftInset();
- Optional<float> top = mgUI->TryTopInset();
- Optional<float> right = mgUI->TryRightInset();
- Optional<float> bottom = mgUI->TryBottomInset();
+ absl::optional<float> left = mgUI->TryLeftInset();
+ absl::optional<float> top = mgUI->TryTopInset();
+ absl::optional<float> right = mgUI->TryRightInset();
+ absl::optional<float> bottom = mgUI->TryBottomInset();
if (border) {
bool bVisible = false;
float fThickness = 0;
@@ -3243,28 +3249,28 @@
if (para)
pSize->width += para->GetMarginLeft() + para->GetTextIndent();
- Optional<float> width = TryWidth();
+ absl::optional<float> width = TryWidth();
if (width.has_value()) {
pSize->width = width.value();
} else {
- Optional<float> min = TryMinWidth();
+ absl::optional<float> min = TryMinWidth();
if (min.has_value())
pSize->width = std::max(pSize->width, min.value());
- Optional<float> max = TryMaxWidth();
+ absl::optional<float> max = TryMaxWidth();
if (max.has_value() && max.value() > 0)
pSize->width = std::min(pSize->width, max.value());
}
- Optional<float> height = TryHeight();
+ absl::optional<float> height = TryHeight();
if (height.has_value()) {
pSize->height = height.value();
} else {
- Optional<float> min = TryMinHeight();
+ absl::optional<float> min = TryMinHeight();
if (min.has_value())
pSize->height = std::max(pSize->height, min.value());
- Optional<float> max = TryMaxHeight();
+ absl::optional<float> max = TryMaxHeight();
if (max.has_value() && max.value() > 0)
pSize->height = std::min(pSize->height, max.value());
}
@@ -3373,7 +3379,7 @@
XFA_UnitPx2Pt(img_height, dpi.height));
CFX_RectF rtFit;
- Optional<float> width = TryWidth();
+ absl::optional<float> width = TryWidth();
if (width.has_value()) {
rtFit.width = width.value();
GetWidthWithoutMargin(rtFit.width);
@@ -3381,7 +3387,7 @@
rtFit.width = rtImage.width;
}
- Optional<float> height = TryHeight();
+ absl::optional<float> height = TryHeight();
if (height.has_value()) {
rtFit.height = height.value();
GetHeightWithoutMargin(rtFit.height);
@@ -3447,11 +3453,11 @@
if (margin)
fWidthCalc += margin->GetLeftInset() + margin->GetRightInset();
- Optional<float> min = TryMinWidth();
+ absl::optional<float> min = TryMinWidth();
if (min.has_value())
fWidthCalc = std::max(fWidthCalc, min.value());
- Optional<float> max = TryMaxWidth();
+ absl::optional<float> max = TryMaxWidth();
if (max.has_value() && max.value() > 0)
fWidthCalc = std::min(fWidthCalc, max.value());
@@ -3470,11 +3476,11 @@
if (margin)
fHeightCalc += margin->GetTopInset() + margin->GetBottomInset();
- Optional<float> min = TryMinHeight();
+ absl::optional<float> min = TryMinHeight();
if (min.has_value())
fHeightCalc = std::max(fHeightCalc, min.value());
- Optional<float> max = TryMaxHeight();
+ absl::optional<float> max = TryMaxHeight();
if (max.has_value() && max.value() > 0)
fHeightCalc = std::min(fHeightCalc, max.value());
@@ -3504,7 +3510,7 @@
m_pLayoutData->m_fWidgetHeight = -1;
float fWidth = 0;
if (*pCalcWidth > 0 && *pCalcHeight < 0) {
- Optional<float> height = TryHeight();
+ absl::optional<float> height = TryHeight();
if (height.has_value()) {
*pCalcHeight = height.value();
} else {
@@ -3517,8 +3523,8 @@
return;
}
if (*pCalcWidth < 0 && *pCalcHeight < 0) {
- Optional<float> height;
- Optional<float> width = TryWidth();
+ absl::optional<float> height;
+ absl::optional<float> width = TryWidth();
if (width.has_value()) {
fWidth = width.value();
height = TryHeight();
@@ -3578,9 +3584,9 @@
return sz;
}
-Optional<float> CXFA_Node::FindSplitPos(CXFA_FFDocView* pDocView,
- size_t szBlockIndex,
- float fCalcHeight) {
+absl::optional<float> CXFA_Node::FindSplitPos(CXFA_FFDocView* pDocView,
+ size_t szBlockIndex,
+ float fCalcHeight) {
if (GetFFWidgetType() == XFA_FFWidgetType::kSubform)
return absl::nullopt;
@@ -3856,7 +3862,7 @@
pTextLayout->StartLayout(fWidth);
}
if (*pCalcWidth < 0 && *pCalcHeight < 0) {
- Optional<float> width = TryWidth();
+ absl::optional<float> width = TryWidth();
if (width.has_value()) {
pTextLayout->StartLayout(GetWidthWithoutMargin(width.value()));
*pCalcWidth = width.value();
@@ -3989,7 +3995,8 @@
CXFA_Node* pText = pItems->GetFirstChild();
int32_t i = 0;
while (pText) {
- Optional<WideString> wsContent = pText->JSObject()->TryContent(false, true);
+ absl::optional<WideString> wsContent =
+ pText->JSObject()->TryContent(false, true);
if (wsContent == wsValue)
return static_cast<XFA_CheckState>(i);
@@ -4208,8 +4215,8 @@
return pItem->CountChildren(XFA_Element::Unknown, false);
}
-Optional<WideString> CXFA_Node::GetChoiceListItem(int32_t nIndex,
- bool bSaveValue) {
+absl::optional<WideString> CXFA_Node::GetChoiceListItem(int32_t nIndex,
+ bool bSaveValue) {
std::vector<CXFA_Node*> pItemsArray;
int32_t iCount = 0;
for (CXFA_Node* pNode = GetFirstChild(); pNode;
@@ -4598,7 +4605,7 @@
return false;
}
-Optional<int32_t> CXFA_Node::GetNumberOfCells() {
+absl::optional<int32_t> CXFA_Node::GetNumberOfCells() {
CXFA_Node* pUIChild = GetUIChildNode();
if (!pUIChild)
return absl::nullopt;
@@ -4724,7 +4731,7 @@
auto* pPicture =
pFormat->GetChild<CXFA_Picture>(0, XFA_Element::Picture, false);
if (pPicture) {
- Optional<WideString> picture =
+ absl::optional<WideString> picture =
pPicture->JSObject()->TryContent(false, true);
if (picture.has_value())
return picture.value();
@@ -4759,7 +4766,7 @@
if (pUI) {
if (CXFA_Picture* pPicture =
pUI->GetChild<CXFA_Picture>(0, XFA_Element::Picture, false)) {
- Optional<WideString> picture =
+ absl::optional<WideString> picture =
pPicture->JSObject()->TryContent(false, true);
if (picture.has_value())
return picture.value();
diff --git a/xfa/fxfa/parser/cxfa_node.h b/xfa/fxfa/parser/cxfa_node.h
index c6cec42..f4344fd 100644
--- a/xfa/fxfa/parser/cxfa_node.h
+++ b/xfa/fxfa/parser/cxfa_node.h
@@ -222,7 +222,7 @@
bool HasBindItem() const;
CXFA_Node* GetContainerNode();
GCedLocaleIface* GetLocale();
- Optional<WideString> GetLocaleName();
+ absl::optional<WideString> GetLocaleName();
XFA_AttributeValue GetIntact();
WideString GetNameExpression();
@@ -252,11 +252,12 @@
CXFA_Node* GetInstanceMgrOfSubform();
- Optional<bool> GetDefaultBoolean(XFA_Attribute attr) const;
- Optional<int32_t> GetDefaultInteger(XFA_Attribute attr) const;
- Optional<CXFA_Measurement> GetDefaultMeasurement(XFA_Attribute attr) const;
- Optional<WideString> GetDefaultCData(XFA_Attribute attr) const;
- Optional<XFA_AttributeValue> GetDefaultEnum(XFA_Attribute attr) const;
+ absl::optional<bool> GetDefaultBoolean(XFA_Attribute attr) const;
+ absl::optional<int32_t> GetDefaultInteger(XFA_Attribute attr) const;
+ absl::optional<CXFA_Measurement> GetDefaultMeasurement(
+ XFA_Attribute attr) const;
+ absl::optional<WideString> GetDefaultCData(XFA_Attribute attr) const;
+ absl::optional<XFA_AttributeValue> GetDefaultEnum(XFA_Attribute attr) const;
bool IsOpenAccess() const;
@@ -281,7 +282,7 @@
WideString GetRawValue() const;
int32_t GetRotate() const;
- Optional<float> TryWidth();
+ absl::optional<float> TryWidth();
CXFA_Node* GetExclGroupIfExists();
@@ -320,9 +321,9 @@
void StartWidgetLayout(CXFA_FFDoc* doc,
float* pCalcWidth,
float* pCalcHeight);
- Optional<float> FindSplitPos(CXFA_FFDocView* pDocView,
- size_t szBlockIndex,
- float fCalcHeight);
+ absl::optional<float> FindSplitPos(CXFA_FFDocView* pDocView,
+ size_t szBlockIndex,
+ float fCalcHeight);
bool LoadCaption(CXFA_FFDoc* doc);
CXFA_TextLayout* GetCaptionTextLayout();
@@ -364,7 +365,7 @@
bool IsChoiceListAllowTextEntry();
int32_t CountChoiceListItems(bool bSaveValue);
- Optional<WideString> GetChoiceListItem(int32_t nIndex, bool bSaveValue);
+ absl::optional<WideString> GetChoiceListItem(int32_t nIndex, bool bSaveValue);
bool IsChoiceListMultiSelect();
bool IsChoiceListCommitOnSelect();
std::vector<WideString> GetChoiceListItems(bool bSaveValue);
@@ -394,7 +395,7 @@
bool IsHorizontalScrollPolicyOff();
bool IsVerticalScrollPolicyOff();
- Optional<int32_t> GetNumberOfCells();
+ absl::optional<int32_t> GetNumberOfCells();
bool SetValue(XFA_ValuePicture eValueType, const WideString& wsValue);
WideString GetValue(XFA_ValuePicture eValueType);
@@ -442,10 +443,11 @@
bool HasFlag(XFA_NodeFlag dwFlag) const;
const PropertyData* GetPropertyData(XFA_Element property) const;
const AttributeData* GetAttributeData(XFA_Attribute attr) const;
- Optional<XFA_Element> GetFirstPropertyWithFlag(XFA_PropertyFlag flag) const;
+ absl::optional<XFA_Element> GetFirstPropertyWithFlag(
+ XFA_PropertyFlag flag) const;
void OnRemoved(bool bNotify) const;
- Optional<void*> GetDefaultValue(XFA_Attribute attr,
- XFA_AttributeType eType) const;
+ absl::optional<void*> GetDefaultValue(XFA_Attribute attr,
+ XFA_AttributeType eType) const;
CXFA_Node* GetChildInternal(size_t index,
XFA_Element eType,
bool bOnlyChild) const;
@@ -494,16 +496,16 @@
void SyncValue(const WideString& wsValue, bool bNotify);
CXFA_Value* GetDefaultValueIfExists();
CXFA_Bind* GetBindIfExists() const;
- Optional<XFA_AttributeValue> GetIntactFromKeep(
+ absl::optional<XFA_AttributeValue> GetIntactFromKeep(
const CXFA_Keep* pKeep,
XFA_AttributeValue eLayoutType) const;
CXFA_Node* GetTransparentParent();
- Optional<float> TryHeight();
- Optional<float> TryMinWidth();
- Optional<float> TryMinHeight();
- Optional<float> TryMaxWidth();
- Optional<float> TryMaxHeight();
+ absl::optional<float> TryHeight();
+ absl::optional<float> TryMinWidth();
+ absl::optional<float> TryMinHeight();
+ absl::optional<float> TryMaxWidth();
+ absl::optional<float> TryMaxHeight();
XFA_EventError ProcessEventInternal(CXFA_FFDocView* pDocView,
XFA_AttributeValue iActivity,
CXFA_Event* event,
diff --git a/xfa/fxfa/parser/cxfa_occur.cpp b/xfa/fxfa/parser/cxfa_occur.cpp
index 18084ae..67ef712 100644
--- a/xfa/fxfa/parser/cxfa_occur.cpp
+++ b/xfa/fxfa/parser/cxfa_occur.cpp
@@ -41,12 +41,14 @@
CXFA_Occur::~CXFA_Occur() = default;
int32_t CXFA_Occur::GetMax() {
- Optional<int32_t> max = JSObject()->TryInteger(XFA_Attribute::Max, true);
+ absl::optional<int32_t> max =
+ JSObject()->TryInteger(XFA_Attribute::Max, true);
return max.has_value() ? max.value() : GetMin();
}
int32_t CXFA_Occur::GetMin() {
- Optional<int32_t> min = JSObject()->TryInteger(XFA_Attribute::Min, true);
+ absl::optional<int32_t> min =
+ JSObject()->TryInteger(XFA_Attribute::Min, true);
return min.has_value() && min.value() >= 0 ? min.value() : 1;
}
@@ -54,7 +56,7 @@
int32_t iMin = GetMin();
int32_t iMax = GetMax();
- Optional<int32_t> init =
+ absl::optional<int32_t> init =
JSObject()->TryInteger(XFA_Attribute::Initial, false);
return {iMin, iMax,
init.has_value() && init.value() >= iMin ? init.value() : iMin};
diff --git a/xfa/fxfa/parser/cxfa_script.cpp b/xfa/fxfa/parser/cxfa_script.cpp
index 1938830..e5791ca 100644
--- a/xfa/fxfa/parser/cxfa_script.cpp
+++ b/xfa/fxfa/parser/cxfa_script.cpp
@@ -48,7 +48,7 @@
CXFA_Script::~CXFA_Script() = default;
CXFA_Script::Type CXFA_Script::GetContentType() {
- Optional<WideString> cData =
+ absl::optional<WideString> cData =
JSObject()->TryCData(XFA_Attribute::ContentType, false);
if (!cData.has_value())
return Type::Formcalc;
diff --git a/xfa/fxfa/parser/cxfa_validate.cpp b/xfa/fxfa/parser/cxfa_validate.cpp
index 3cd3aba..c37c106 100644
--- a/xfa/fxfa/parser/cxfa_validate.cpp
+++ b/xfa/fxfa/parser/cxfa_validate.cpp
@@ -62,7 +62,7 @@
}
void CXFA_Validate::SetNullTest(const WideString& wsValue) {
- Optional<XFA_AttributeValue> item =
+ absl::optional<XFA_AttributeValue> item =
XFA_GetAttributeValueByName(wsValue.AsStringView());
JSObject()->SetEnum(
XFA_Attribute::NullTest,
diff --git a/xfa/fxfa/parser/xfa_basic_data.cpp b/xfa/fxfa/parser/xfa_basic_data.cpp
index 4be2101..7994f88 100644
--- a/xfa/fxfa/parser/xfa_basic_data.cpp
+++ b/xfa/fxfa/parser/xfa_basic_data.cpp
@@ -165,7 +165,7 @@
return kPacketTable[static_cast<uint8_t>(ePacket)].info;
}
-Optional<XFA_PACKETINFO> XFA_GetPacketByName(WideStringView wsName) {
+absl::optional<XFA_PACKETINFO> XFA_GetPacketByName(WideStringView wsName) {
uint32_t hash = FX_HashCode_GetW(wsName);
auto* elem = std::lower_bound(
std::begin(kPacketTable), std::end(kPacketTable), hash,
@@ -196,7 +196,7 @@
return kAttributeNames[static_cast<size_t>(attr)];
}
-Optional<XFA_ATTRIBUTEINFO> XFA_GetAttributeByName(WideStringView name) {
+absl::optional<XFA_ATTRIBUTEINFO> XFA_GetAttributeByName(WideStringView name) {
uint32_t hash = FX_HashCode_GetW(name);
auto* elem = std::lower_bound(
std::begin(kAttributeRecords), std::end(kAttributeRecords), hash,
@@ -218,7 +218,8 @@
return kAttributeValueNames[static_cast<int32_t>(item)];
}
-Optional<XFA_AttributeValue> XFA_GetAttributeValueByName(WideStringView name) {
+absl::optional<XFA_AttributeValue> XFA_GetAttributeValueByName(
+ WideStringView name) {
auto* it =
std::lower_bound(std::begin(kAttributeValueRecords),
std::end(kAttributeValueRecords), FX_HashCode_GetW(name),
@@ -235,10 +236,11 @@
return it->eName;
}
-Optional<XFA_SCRIPTATTRIBUTEINFO> XFA_GetScriptAttributeByName(
+absl::optional<XFA_SCRIPTATTRIBUTEINFO> XFA_GetScriptAttributeByName(
XFA_Element element,
WideStringView attribute_name) {
- Optional<XFA_ATTRIBUTEINFO> attr = XFA_GetAttributeByName(attribute_name);
+ absl::optional<XFA_ATTRIBUTEINFO> attr =
+ XFA_GetAttributeByName(attribute_name);
if (!attr.has_value())
return absl::nullopt;
diff --git a/xfa/fxfa/parser/xfa_basic_data.h b/xfa/fxfa/parser/xfa_basic_data.h
index 9605b82..42ce8c6 100644
--- a/xfa/fxfa/parser/xfa_basic_data.h
+++ b/xfa/fxfa/parser/xfa_basic_data.h
@@ -51,18 +51,19 @@
};
XFA_PACKETINFO XFA_GetPacketByIndex(XFA_PacketType ePacket);
-Optional<XFA_PACKETINFO> XFA_GetPacketByName(WideStringView wsName);
+absl::optional<XFA_PACKETINFO> XFA_GetPacketByName(WideStringView wsName);
ByteStringView XFA_ElementToName(XFA_Element elem);
XFA_Element XFA_GetElementByName(WideStringView name);
ByteStringView XFA_AttributeToName(XFA_Attribute attr);
-Optional<XFA_ATTRIBUTEINFO> XFA_GetAttributeByName(WideStringView name);
+absl::optional<XFA_ATTRIBUTEINFO> XFA_GetAttributeByName(WideStringView name);
ByteStringView XFA_AttributeValueToName(XFA_AttributeValue item);
-Optional<XFA_AttributeValue> XFA_GetAttributeValueByName(WideStringView name);
+absl::optional<XFA_AttributeValue> XFA_GetAttributeValueByName(
+ WideStringView name);
-Optional<XFA_SCRIPTATTRIBUTEINFO> XFA_GetScriptAttributeByName(
+absl::optional<XFA_SCRIPTATTRIBUTEINFO> XFA_GetScriptAttributeByName(
XFA_Element eElement,
WideStringView wsAttributeName);
diff --git a/xfa/fxfa/parser/xfa_basic_data_unittest.cpp b/xfa/fxfa/parser/xfa_basic_data_unittest.cpp
index 9202703..53a80eb 100644
--- a/xfa/fxfa/parser/xfa_basic_data_unittest.cpp
+++ b/xfa/fxfa/parser/xfa_basic_data_unittest.cpp
@@ -7,7 +7,7 @@
#include "testing/gtest/include/gtest/gtest.h"
TEST(XFABasicDataTest, GetPacketByName) {
- Optional<XFA_PACKETINFO> result = XFA_GetPacketByName(L"");
+ absl::optional<XFA_PACKETINFO> result = XFA_GetPacketByName(L"");
EXPECT_FALSE(result.has_value());
result = XFA_GetPacketByName(L"nonesuch");
@@ -49,7 +49,7 @@
}
TEST(XFABasicDataTest, GetAttributeByName) {
- Optional<XFA_ATTRIBUTEINFO> result = XFA_GetAttributeByName(L"");
+ absl::optional<XFA_ATTRIBUTEINFO> result = XFA_GetAttributeByName(L"");
EXPECT_FALSE(result.has_value());
result = XFA_GetAttributeByName(L"nonesuch");
@@ -74,7 +74,7 @@
}
TEST(XFABasicDataTest, GetAttributeValueByName) {
- Optional<XFA_AttributeValue> result = XFA_GetAttributeValueByName(L"");
+ absl::optional<XFA_AttributeValue> result = XFA_GetAttributeValueByName(L"");
EXPECT_FALSE(result.has_value());
result = XFA_GetAttributeValueByName(L"nonesuch");
diff --git a/xfa/fxfa/parser/xfa_utils.cpp b/xfa/fxfa/parser/xfa_utils.cpp
index 6541e63..2f199cf 100644
--- a/xfa/fxfa/parser/xfa_utils.cpp
+++ b/xfa/fxfa/parser/xfa_utils.cpp
@@ -112,7 +112,7 @@
}
bool ContentNodeNeedtoExport(CXFA_Node* pContentNode) {
- Optional<WideString> wsContent =
+ absl::optional<WideString> wsContent =
pContentNode->JSObject()->TryContent(false, false);
if (!wsContent.has_value())
return false;
@@ -140,7 +140,8 @@
if (!bProto && !pNode->JSObject()->HasAttribute(eName))
return;
- Optional<WideString> value = pNode->JSObject()->TryAttribute(eName, false);
+ absl::optional<WideString> value =
+ pNode->JSObject()->TryAttribute(eName, false);
if (!value.has_value())
return;
@@ -186,7 +187,7 @@
if (!pRawValueNode)
break;
- Optional<WideString> contentType =
+ absl::optional<WideString> contentType =
pNode->JSObject()->TryAttribute(XFA_Attribute::ContentType, false);
if (pRawValueNode->GetElementType() == XFA_Element::SharpxHTML &&
contentType.has_value() &&
@@ -206,8 +207,9 @@
} else if (pRawValueNode->GetElementType() == XFA_Element::Sharpxml &&
contentType.has_value() &&
contentType.value().EqualsASCII("text/xml")) {
- Optional<WideString> rawValue = pRawValueNode->JSObject()->TryAttribute(
- XFA_Attribute::Value, false);
+ absl::optional<WideString> rawValue =
+ pRawValueNode->JSObject()->TryAttribute(XFA_Attribute::Value,
+ false);
if (!rawValue.has_value() || rawValue->IsEmpty())
break;
@@ -348,7 +350,8 @@
if (!pTemplateRoot)
return WideString();
- Optional<WideString> templateNS = pTemplateRoot->JSObject()->TryNamespace();
+ absl::optional<WideString> templateNS =
+ pTemplateRoot->JSObject()->TryNamespace();
if (!templateNS.has_value())
return WideString();