diff options
author | George Hazan <ghazan@miranda.im> | 2023-04-18 18:55:17 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2023-04-18 18:55:17 +0300 |
commit | c62b3ef92f0499f00bd72581f2acc8f128e82ebb (patch) | |
tree | 1fb2e376aa74c817ae0e62512473b72652abed32 /src | |
parent | 3c5a1a6af8e6cfbd53d0dacffc74819cb1eba2c9 (diff) |
code cleaning
Diffstat (limited to 'src')
-rw-r--r-- | src/core/stdmsg/src/msgdialog.cpp | 12 | ||||
-rw-r--r-- | src/mir_app/src/srmm_log_rtf.cpp | 7 |
2 files changed, 13 insertions, 6 deletions
diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp index d552a0ae64..7c87170fcc 100644 --- a/src/core/stdmsg/src/msgdialog.cpp +++ b/src/core/stdmsg/src/msgdialog.cpp @@ -734,8 +734,6 @@ LRESULT CMsgDialog::WndProc_Message(UINT msg, WPARAM wParam, LPARAM lParam) HRGN region = NULL;
if (wParam == NULLREGION) {
region = CreateRectRgn(rect.left, rect.top, rect.right, rect.bottom);
- HRGN region2 = CreateRectRgn(rect.left + 1, rect.top + 1, rect.right - 1, rect.bottom - 1);
- CombineRgn(region, region, (HRGN)region2, RGN_DIFF);
}
else {
HRGN copy = CreateRectRgn(0, 0, 0, 0);
@@ -744,6 +742,12 @@ LRESULT CMsgDialog::WndProc_Message(UINT msg, WPARAM wParam, LPARAM lParam) else
DeleteObject(copy);
}
+
+ if (region) {
+ HRGN region2 = CreateRectRgn(rect.left + 1, rect.top + 1, rect.right - 1, rect.bottom - 1);
+ CombineRgn(region, region, region2, RGN_DIFF);
+ DeleteObject(region2);
+ }
if (HDC hdc = GetDCEx(m_message.GetHwnd(), region, DCX_WINDOW | DCX_CACHE | DCX_INTERSECTRGN | DCX_LOCKWINDOWUPDATE)) {
HPEN pen = CreatePen(PS_INSIDEFRAME, 1, RGB(0, 220, 0));
@@ -755,9 +759,9 @@ LRESULT CMsgDialog::WndProc_Message(UINT msg, WPARAM wParam, LPARAM lParam) ReleaseDC(m_message.GetHwnd(), hdc);
DeleteObject(pen);
}
-
- if (region)
+ else if (region)
DeleteObject(region);
+
return 0;
}
break;
diff --git a/src/mir_app/src/srmm_log_rtf.cpp b/src/mir_app/src/srmm_log_rtf.cpp index 75290337af..27ebb7d127 100644 --- a/src/mir_app/src/srmm_log_rtf.cpp +++ b/src/mir_app/src/srmm_log_rtf.cpp @@ -201,11 +201,14 @@ INT_PTR CRtfLogWindow::Notify(WPARAM, LPARAM lParam) GetTempPathW(_countof(tszTempPath), tszTempPath);
CMStringW tszFilePath(FORMAT, L"%s%s", tszTempPath, blob.getName());
- if (_waccess(tszFilePath, 0)) {
+ struct _stat st = {};
+ _wstat(tszFilePath, &st);
+ if (st.st_size && st.st_size == blob.getSize() && st.st_size == blob.getTransferred())
+ ShellExecute(nullptr, L"open", tszFilePath.c_str(), nullptr, nullptr, SW_SHOWDEFAULT);
+ else {
OFDTHREAD *dt = new OFDTHREAD(hDbEvent, tszFilePath);
CallProtoService(dbei.szModule, PS_OFFLINEFILE, (WPARAM)dt, 0);
}
- else ShellExecute(nullptr, L"open", tszFilePath.c_str(), nullptr, nullptr, SW_SHOWDEFAULT);
return TRUE;
}
|