Consistently use Optional instead of pdfium::Optional.
pdfium::Optional will go away in the near future, as absl::optional
becomes available.
Change-Id: I57b78b1e464011f978d7fe4796a24e421eee9a78
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/85513
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/core/fpdfapi/font/cpdf_tounicodemap.cpp b/core/fpdfapi/font/cpdf_tounicodemap.cpp
index 96649e4..26bb35c 100644
--- a/core/fpdfapi/font/cpdf_tounicodemap.cpp
+++ b/core/fpdfapi/font/cpdf_tounicodemap.cpp
@@ -72,7 +72,7 @@
}
// static
-pdfium::Optional<uint32_t> CPDF_ToUnicodeMap::StringToCode(ByteStringView str) {
+Optional<uint32_t> CPDF_ToUnicodeMap::StringToCode(ByteStringView str) {
size_t len = str.GetLength();
if (len <= 2 || str[0] != '<' || str[len - 1] != '>')
return pdfium::nullopt;
@@ -86,7 +86,7 @@
if (!code.IsValid())
return pdfium::nullopt;
}
- return pdfium::Optional<uint32_t>(code.ValueOrDie());
+ return Optional<uint32_t>(code.ValueOrDie());
}
// static
@@ -148,7 +148,7 @@
if (word.IsEmpty() || word == "endbfchar")
return;
- pdfium::Optional<uint32_t> code = StringToCode(word);
+ Optional<uint32_t> code = StringToCode(word);
if (!code.has_value())
return;
@@ -162,12 +162,12 @@
if (lowcode_str.IsEmpty() || lowcode_str == "endbfrange")
return;
- pdfium::Optional<uint32_t> lowcode_opt = StringToCode(lowcode_str);
+ Optional<uint32_t> lowcode_opt = StringToCode(lowcode_str);
if (!lowcode_opt.has_value())
return;
ByteStringView highcode_str = pParser->GetWord();
- pdfium::Optional<uint32_t> highcode_opt = StringToCode(highcode_str);
+ Optional<uint32_t> highcode_opt = StringToCode(highcode_str);
if (!highcode_opt.has_value())
return;
@@ -184,7 +184,7 @@
WideString destcode = StringToWideString(start);
if (destcode.GetLength() == 1) {
- pdfium::Optional<uint32_t> value_or_error = StringToCode(start);
+ Optional<uint32_t> value_or_error = StringToCode(start);
if (!value_or_error.has_value())
return;
diff --git a/core/fpdfapi/font/cpdf_tounicodemap.h b/core/fpdfapi/font/cpdf_tounicodemap.h
index 2872192..5c719dd 100644
--- a/core/fpdfapi/font/cpdf_tounicodemap.h
+++ b/core/fpdfapi/font/cpdf_tounicodemap.h
@@ -28,7 +28,7 @@
friend class cpdf_tounicodemap_StringToCode_Test;
friend class cpdf_tounicodemap_StringToWideString_Test;
- static pdfium::Optional<uint32_t> StringToCode(ByteStringView str);
+ static Optional<uint32_t> StringToCode(ByteStringView str);
static WideString StringToWideString(ByteStringView str);
void Load(const CPDF_Stream* pStream);
diff --git a/core/fxge/win32/cgdi_device_driver.h b/core/fxge/win32/cgdi_device_driver.h
index b672532..de16a15 100644
--- a/core/fxge/win32/cgdi_device_driver.h
+++ b/core/fxge/win32/cgdi_device_driver.h
@@ -72,7 +72,7 @@
int m_nBitsPerPixel;
const DeviceType m_DeviceType;
int m_RenderCaps;
- pdfium::Optional<FX_RECT> m_BaseClipBox;
+ Optional<FX_RECT> m_BaseClipBox;
};
#endif // CORE_FXGE_WIN32_CGDI_DEVICE_DRIVER_H_