Skip to content

Commit

Permalink
Merge pull request #28 from sraboy/minor_fixes
Browse files Browse the repository at this point in the history
Minor Fixes
  • Loading branch information
mohabouje authored Feb 12, 2018
2 parents 0a24843 + 023be57 commit cfe59a9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/wintoastlib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ INT64 WinToast::showToast(_In_ const WinToastTemplate& toast, _In_ IWinToastHan
return FAILED(hr) ? -1 : id;
}

ComPtr<IToastNotifier> WinToast::notifier(bool* succeded) const {
ComPtr<IToastNotifier> WinToast::notifier(_In_ bool* succeded) const {
ComPtr<IToastNotificationManagerStatics> notificationManager;
ComPtr<IToastNotifier> notifier;
HRESULT hr = DllImporter::Wrap_GetActivationFactory(WinToastStringWrapper(RuntimeClass_Windows_UI_Notifications_ToastNotificationManager).Get(), &notificationManager);
Expand All @@ -657,9 +657,9 @@ bool WinToast::hideToast(_In_ INT64 id) {
const bool find = _buffer.find(id) != _buffer.end();
if (find) {
bool succeded = false;
ComPtr<IToastNotifier> not = notifier(&succeded);
ComPtr<IToastNotifier> notify = notifier(&succeded);
if (succeded) {
not->Hide(_buffer[id].Get());
notify->Hide(_buffer[id].Get());
}
_buffer.erase(id);
}
Expand All @@ -668,11 +668,11 @@ bool WinToast::hideToast(_In_ INT64 id) {

void WinToast::clear() {
bool succeded = false;
ComPtr<IToastNotifier> not = notifier(&succeded);
ComPtr<IToastNotifier> notify = notifier(&succeded);
if (succeded) {
auto end = _buffer.end();
for (auto it = _buffer.begin(); it != end; ++it) {
not->Hide(it->second.Get());
notify->Hide(it->second.Get());
}
}
_buffer.clear();
Expand Down Expand Up @@ -896,7 +896,7 @@ void WinToastTemplate::setAttributionText(_In_ const std::wstring& attributionTe
_attributionText = attributionText;
}

void WinToastTemplate::addAction(const std::wstring & label)
void WinToastTemplate::addAction(_In_ const std::wstring & label)
{
_actions.push_back(label);
}
2 changes: 1 addition & 1 deletion src/wintoastlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ namespace WinToastLib {
HRESULT setTextFieldHelper(_In_ IXmlDocument *xml, _In_ const std::wstring& text, _In_ int pos);
HRESULT setAttributionTextFieldHelper(_In_ IXmlDocument *xml, _In_ const std::wstring& text);
HRESULT addActionHelper(_In_ IXmlDocument *xml, _In_ const std::wstring& action, _In_ const std::wstring& arguments);
ComPtr<IToastNotifier> WinToast::notifier(_In_ bool* succeded) const;
ComPtr<IToastNotifier> notifier(_In_ bool* succeded) const;
};
}
#endif // WINTOASTLIB_H

0 comments on commit cfe59a9

Please sign in to comment.