From 7f4db3773e723059ddd50b63b21717cc941ca424 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 21 Feb 2019 15:58:11 +0300 Subject: the less boost and other C++ perversions - the better --- plugins/CurrencyRates/src/CurrencyRateInfoDlg.cpp | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'plugins/CurrencyRates/src/CurrencyRateInfoDlg.cpp') diff --git a/plugins/CurrencyRates/src/CurrencyRateInfoDlg.cpp b/plugins/CurrencyRates/src/CurrencyRateInfoDlg.cpp index 4b9efb3067..c05520686e 100644 --- a/plugins/CurrencyRates/src/CurrencyRateInfoDlg.cpp +++ b/plugins/CurrencyRates/src/CurrencyRateInfoDlg.cpp @@ -14,8 +14,7 @@ MCONTACT g_hContact; inline bool IsMyContact(MCONTACT hContact) { - CCurrencyRatesProviders::TCurrencyRatesProviderPtr pProvider = CModuleInfo::GetCurrencyRateProvidersPtr()->GetContactProviderPtr(hContact); - return (nullptr != pProvider); + return nullptr != GetContactProviderPtr(hContact); } inline MCONTACT get_contact(HWND hWnd) @@ -66,9 +65,7 @@ INT_PTR CALLBACK CurrencyRateInfoDlgProcImpl(MCONTACT hContact, HWND hdlg, UINT } } - CCurrencyRatesProviders::TCurrencyRatesProviderPtr pProvider = CModuleInfo::GetCurrencyRateProvidersPtr()->GetContactProviderPtr(hContact); - - const ICurrencyRatesProvider::CProviderInfo& pi = pProvider->GetInfo(); + const ICurrencyRatesProvider::CProviderInfo& pi = GetContactProviderPtr(hContact)->GetInfo(); tostringstream o; o << TranslateT("Info provided by") << L" " << pi.m_sName << L""; @@ -152,11 +149,9 @@ INT_PTR CurrencyRatesMenu_RefreshContact(WPARAM wp, LPARAM) if (NULL == hContact) return 0; - CCurrencyRatesProviders::TCurrencyRatesProviderPtr pProvider = CModuleInfo::GetCurrencyRateProvidersPtr()->GetContactProviderPtr(hContact); - if (!pProvider) - return 0; - - pProvider->RefreshContact(hContact); + ICurrencyRatesProvider *pProvider = GetContactProviderPtr(hContact); + if (pProvider) + pProvider->RefreshContact(hContact); return 0; } @@ -210,7 +205,7 @@ static INT_PTR CALLBACK CurrencyRateInfoDlgProc1(HWND hdlg, UINT msg, WPARAM wPa int CurrencyRates_OnContactDoubleClick(WPARAM wp, LPARAM/* lp*/) { MCONTACT hContact = MCONTACT(wp); - if (CModuleInfo::GetCurrencyRateProvidersPtr()->GetContactProviderPtr(hContact)) { + if (GetContactProviderPtr(hContact)) { MWindowList hWL = CModuleInfo::GetWindowList(WINDOW_PREFIX_INFO, true); assert(hWL); HWND hWnd = WindowList_Find(hWL, hContact); -- cgit v1.2.3