From 3e7f47be3cd75398b20b7486ed5374967ac0fa71 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 2 Oct 2023 18:11:59 +0300 Subject: missing controls shall not wipe database settings --- src/mir_core/src/Windows/CCtrlCheck.cpp | 4 ++-- src/mir_core/src/Windows/CCtrlColor.cpp | 4 ++-- src/mir_core/src/Windows/CCtrlSlider.cpp | 4 ++-- src/mir_core/src/Windows/CCtrlSpin.cpp | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/mir_core/src/Windows/CCtrlCheck.cpp b/src/mir_core/src/Windows/CCtrlCheck.cpp index 5e69738b23..69bedcece2 100644 --- a/src/mir_core/src/Windows/CCtrlCheck.cpp +++ b/src/mir_core/src/Windows/CCtrlCheck.cpp @@ -41,14 +41,14 @@ bool CCtrlCheck::OnApply() { CSuper::OnApply(); - if (m_dbLink != nullptr) + if (m_hwnd && m_dbLink) SaveInt(GetState()); return true; } void CCtrlCheck::OnReset() { - if (m_dbLink != nullptr) + if (m_hwnd && m_dbLink) SetState(LoadInt()); } diff --git a/src/mir_core/src/Windows/CCtrlColor.cpp b/src/mir_core/src/Windows/CCtrlColor.cpp index b61fb5760a..d41604ecf2 100644 --- a/src/mir_core/src/Windows/CCtrlColor.cpp +++ b/src/mir_core/src/Windows/CCtrlColor.cpp @@ -39,14 +39,14 @@ bool CCtrlColor::OnApply() { CSuper::OnApply(); - if (m_dbLink != nullptr) + if (m_hwnd && m_dbLink) SaveInt(GetColor()); return true; } void CCtrlColor::OnReset() { - if (m_dbLink != nullptr) + if (m_hwnd && m_dbLink) SetColor(LoadInt()); } diff --git a/src/mir_core/src/Windows/CCtrlSlider.cpp b/src/mir_core/src/Windows/CCtrlSlider.cpp index 9938736e42..3bcab67b4c 100644 --- a/src/mir_core/src/Windows/CCtrlSlider.cpp +++ b/src/mir_core/src/Windows/CCtrlSlider.cpp @@ -46,7 +46,7 @@ bool CCtrlSlider::OnApply() { CSuper::OnApply(); - if (m_dbLink != nullptr) + if (m_hwnd && m_dbLink) SaveInt(GetPosition()); return true; } @@ -55,7 +55,7 @@ void CCtrlSlider::OnReset() { SendMsg(TBM_SETRANGE, 0, MAKELONG(m_wMin, m_wMax)); - if (m_dbLink != nullptr) + if (m_hwnd && m_dbLink) SetPosition(LoadInt()); } diff --git a/src/mir_core/src/Windows/CCtrlSpin.cpp b/src/mir_core/src/Windows/CCtrlSpin.cpp index e871296259..f75c7a0f03 100644 --- a/src/mir_core/src/Windows/CCtrlSpin.cpp +++ b/src/mir_core/src/Windows/CCtrlSpin.cpp @@ -51,7 +51,7 @@ bool CCtrlSpin::OnApply() CSuper::OnApply(); m_wCurr = SendMsg(UDM_GETPOS, 0, 0); - if (m_dbLink != nullptr) + if (m_hwnd && m_dbLink) SaveInt(m_wCurr); HWND hwndBuddy = (HWND)SendMsg(UDM_GETBUDDY, 0, 0); @@ -68,7 +68,7 @@ void CCtrlSpin::OnReset() { SendMsg(UDM_SETRANGE, 0, MAKELPARAM(m_wMax, m_wMin)); - if (m_dbLink != nullptr) + if (m_hwnd && m_dbLink) SetPosition(LoadInt()); } -- cgit v1.2.3