Skip to content

Commit

Permalink
fix 4599
Browse files Browse the repository at this point in the history
  • Loading branch information
alabuzhev committed Mar 25, 2016
1 parent 5efc477 commit 710cac0
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 19 deletions.
6 changes: 5 additions & 1 deletion far/changelog
@@ -1,4 +1,8 @@
drkns 25.03.2016 01:21:22 +0200 - build 4600
drkns 25.03.2016 10:08:48 +0200 - build 4601

1. Уточнение 4599.

drkns 25.03.2016 01:21:22 +0200 - build 4600

1. Уточнение 4574.

Expand Down
38 changes: 21 additions & 17 deletions far/plugapi.cpp
Expand Up @@ -1251,30 +1251,34 @@ intptr_t WINAPI apiMessageFn(const GUID* PluginId,const GUID* Id,unsigned __int6
break;
}

const auto AssignStrings = [&](const auto& Source)
{
if (!Source.empty())
{
Title = *Source.begin();
if (Buttons.empty())
{
MsgItems.assign(std::next(Source.begin()), Source.end() - ButtonsNumber);
Buttons.assign(Source.end() - ButtonsNumber, Source.end());
}
else
{
// FMSG_MB_* is active
MsgItems.assign(std::next(Source.begin()), Source.end());
}
}

};

if (Flags & FMSG_ALLINONE)
{
std::vector<string> Strings;
split(Strings, reinterpret_cast<const wchar_t*>(Items), STLF_NOTRIM | STLF_ALLOWEMPTY | STLF_NOUNQUOTE | STLF_NOQUOTING, L"\n");
if (!Strings.empty())
{
Title = Strings[0];
MsgItems.assign(Strings.cbegin() + 1, Strings.cend() - ButtonsNumber);
Buttons.assign(Strings.cend() - ButtonsNumber, Strings.cend());
}
AssignStrings(Strings);
}
else
{
Title = Items[0];
if (Buttons.empty())
{
MsgItems.assign(Items + 1, Items + ItemsNumber - ButtonsNumber);
Buttons.assign(Items + ItemsNumber - ButtonsNumber, Items + ItemsNumber);
}
else
{
// FMSG_MB_* is active
MsgItems.assign(Items + 1, Items + ItemsNumber);
}
AssignStrings(make_range(Items, Items + ItemsNumber));
}

Plugin* PluginNumber = GuidToPlugin(PluginId);
Expand Down
2 changes: 1 addition & 1 deletion far/vbuild.m4
@@ -1 +1 @@
m4_define(BUILD,4600)m4_dnl
m4_define(BUILD,4601)m4_dnl

0 comments on commit 710cac0

Please sign in to comment.