diff options
author | MikalaiR <nikolay.romanovich@narod.ru> | 2015-08-28 17:11:36 +0000 |
---|---|---|
committer | MikalaiR <nikolay.romanovich@narod.ru> | 2015-08-28 17:11:36 +0000 |
commit | 9d81a96b2de32c863829cc048a516b943180fc79 (patch) | |
tree | db1df1c0b88ff085c83a23c8a51e6367ee3a7114 | |
parent | 7496a513f28bf3bdf303f49c2f25de8e7506e51a (diff) |
Toaster: includes cleanup
git-svn-id: http://svn.miranda-ng.org/main/trunk@15066 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r-- | plugins/Toaster/src/stdafx.h | 9 | ||||
-rw-r--r-- | plugins/Toaster/src/string_reference_wrapper.h | 9 | ||||
-rw-r--r-- | plugins/Toaster/src/toast_notification.cpp | 8 |
3 files changed, 5 insertions, 21 deletions
diff --git a/plugins/Toaster/src/stdafx.h b/plugins/Toaster/src/stdafx.h index 8df66f4598..a0dc262a7d 100644 --- a/plugins/Toaster/src/stdafx.h +++ b/plugins/Toaster/src/stdafx.h @@ -3,12 +3,6 @@ #pragma comment(linker,"\"/manifestdependency:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
-#include <Windows.h>
-#include <SDKDDKVer.h>
-#include <intsafe.h>
-#include <time.h>
-#include <roapi.h>
-#include <wrl\client.h>
#include <wrl\implements.h>
#include <windows.ui.notifications.h>
@@ -16,17 +10,16 @@ #include <m_system.h>
#include <m_system_cpp.h>
#include <m_core.h>
-#include <m_utils.h>
#include <m_langpack.h>
#include <m_avatars.h>
#include <m_protocols.h>
#include <m_popup.h>
#include <m_message.h>
#include <m_chat.h>
+#include <m_string.h>
#include "version.h"
#include "resource.h"
-#include <strsafe.h>
typedef void(__cdecl *pEventHandler)(void*);
const wchar_t AppUserModelID[] = _T("MirandaNG");
diff --git a/plugins/Toaster/src/string_reference_wrapper.h b/plugins/Toaster/src/string_reference_wrapper.h index ca0f8afd9f..d272ed14c7 100644 --- a/plugins/Toaster/src/string_reference_wrapper.h +++ b/plugins/Toaster/src/string_reference_wrapper.h @@ -25,14 +25,7 @@ public: template <size_t _>
StringReferenceWrapper(_In_reads_(_) wchar_t(&stringRef)[_]) throw()
{
- UINT32 length;
- HRESULT hr = SizeTToUInt32(wcslen(stringRef), &length);
-
- if (FAILED(hr))
- {
- RaiseException(static_cast<DWORD>(STATUS_INVALID_PARAMETER), EXCEPTION_NONCONTINUABLE, 0, nullptr);
- }
-
+ UINT32 length = wcslen(stringRef);
WindowsCreateStringReference(stringRef, length, &_header, &_hstring);
}
diff --git a/plugins/Toaster/src/toast_notification.cpp b/plugins/Toaster/src/toast_notification.cpp index 5c67f4dc0c..fa3dcfa1ce 100644 --- a/plugins/Toaster/src/toast_notification.cpp +++ b/plugins/Toaster/src/toast_notification.cpp @@ -96,13 +96,11 @@ HRESULT ToastNotification::SetTextValues(_In_reads_(textValuesCount) wchar_t** t HRESULT ToastNotification::SetImageSrc(_In_z_ wchar_t* imagePath, _In_ ABI::Windows::Data::Xml::Dom::IXmlDocument* xml)
{
- wchar_t imageSrc[MAX_PATH] = L"file:///";
- HRESULT hr = StringCchCat(imageSrc, ARRAYSIZE(imageSrc), imagePath);
- if (FAILED(hr))
- return hr;
+ wchar_t imageSrc[MAX_PATH];
+ mir_snwprintf(imageSrc, _T("file:///%s"), imagePath);
Microsoft::WRL::ComPtr<ABI::Windows::Data::Xml::Dom::IXmlNode> imageNode;
- hr = GetNodeByTag(StringReferenceWrapper(L"image").Get(), &imageNode, xml);
+ HRESULT hr = GetNodeByTag(StringReferenceWrapper(L"image").Get(), &imageNode, xml);
Microsoft::WRL::ComPtr<ABI::Windows::Data::Xml::Dom::IXmlNamedNodeMap> attributes;
hr = imageNode->get_Attributes(&attributes);
|