mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
refactor: replace remaining NULL with nullptr (#40053)
refactor: use nullptr everywhere
This commit is contained in:
@@ -114,8 +114,8 @@ base::win::ScopedHICON ReadICOFromPath(int size, const base::FilePath& path) {
|
||||
|
||||
// Load the icon from file.
|
||||
return base::win::ScopedHICON(
|
||||
static_cast<HICON>(LoadImage(NULL, image_path.value().c_str(), IMAGE_ICON,
|
||||
size, size, LR_LOADFROMFILE)));
|
||||
static_cast<HICON>(LoadImage(nullptr, image_path.value().c_str(),
|
||||
IMAGE_ICON, size, size, LR_LOADFROMFILE)));
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -214,7 +214,7 @@ HICON NativeImage::GetHICON(int size) {
|
||||
|
||||
// Then convert the image to ICO.
|
||||
if (image_.IsEmpty())
|
||||
return NULL;
|
||||
return nullptr;
|
||||
|
||||
auto& hicon = hicons_[size];
|
||||
hicon = IconUtil::CreateHICONFromSkBitmap(image_.AsBitmap());
|
||||
|
||||
@@ -62,7 +62,7 @@ v8::Local<v8::Promise> NativeImage::CreateThumbnailFromPath(
|
||||
hr = pThumbnailCache->GetThumbnail(
|
||||
pItem.Get(), size.width(),
|
||||
WTS_FLAGS::WTS_SCALETOREQUESTEDSIZE | WTS_FLAGS::WTS_SCALEUP, &pThumbnail,
|
||||
NULL, NULL);
|
||||
nullptr, nullptr);
|
||||
|
||||
if (FAILED(hr)) {
|
||||
promise.RejectWithErrorMessage(
|
||||
@@ -71,7 +71,7 @@ v8::Local<v8::Promise> NativeImage::CreateThumbnailFromPath(
|
||||
}
|
||||
|
||||
// Init HBITMAP
|
||||
HBITMAP hBitmap = NULL;
|
||||
HBITMAP hBitmap = nullptr;
|
||||
hr = pThumbnail->GetSharedBitmap(&hBitmap);
|
||||
if (FAILED(hr)) {
|
||||
promise.RejectWithErrorMessage("Failed to extract bitmap from thumbnail");
|
||||
|
||||
Reference in New Issue
Block a user