1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-26 09:35:28 +00:00

Merge branch 'get_rid_of_std_bind' into 'master'

Get rid of std::bind

See merge request OpenMW/openmw!3023
This commit is contained in:
psi29a 2023-05-17 10:54:43 +00:00
commit 99ed8557bf
3 changed files with 6 additions and 8 deletions

View File

@ -5,7 +5,8 @@ Checks: >
clang-analyzer-*,
-clang-analyzer-optin*,
-clang-analyzer-cplusplus.NewDeleteLeaks,
-clang-analyzer-core.CallAndMessage
-clang-analyzer-core.CallAndMessage,
-modernize-avoid-bind
WarningsAsErrors: >
-*,
boost-*,

View File

@ -326,7 +326,7 @@ namespace MWGui
mScrollBar->eventScrollChangePosition += MyGUI::newDelegate(this, &DialogueWindow::onScrollbarMoved);
mHistory->eventMouseWheel += MyGUI::newDelegate(this, &DialogueWindow::onMouseWheel);
BookPage::ClickCallback callback = std::bind(&DialogueWindow::notifyLinkClicked, this, std::placeholders::_1);
BookPage::ClickCallback callback = [this](TypesetBook::InteractiveId link) { notifyLinkClicked(link); };
mHistory->adviseLinkClicked(callback);
mMainWidget->castType<MyGUI::Window>()->eventWindowChangeCoord

View File

@ -123,9 +123,7 @@ namespace
topicsList->eventItemSelected += MyGUI::newDelegate(this, &JournalWindowImpl::notifyTopicSelected);
{
MWGui::BookPage::ClickCallback callback;
callback = std::bind(&JournalWindowImpl::notifyTopicClicked, this, std::placeholders::_1);
MWGui::BookPage::ClickCallback callback = [this](intptr_t linkId) { notifyTopicClicked(linkId); };
getPage(LeftBookPage)->adviseLinkClicked(callback);
getPage(RightBookPage)->adviseLinkClicked(callback);
@ -137,9 +135,8 @@ namespace
}
{
MWGui::BookPage::ClickCallback callback;
callback = std::bind(&JournalWindowImpl::notifyIndexLinkClicked, this, std::placeholders::_1);
MWGui::BookPage::ClickCallback callback
= [this](MWGui::TypesetBook::InteractiveId index) { notifyIndexLinkClicked(index); };
getPage(LeftTopicIndex)->adviseLinkClicked(callback);
getPage(CenterTopicIndex)->adviseLinkClicked(callback);