Skip to content

Commit

Permalink
trivial
Browse files Browse the repository at this point in the history
  • Loading branch information
katahiromz committed Jun 21, 2018
1 parent 2d9d158 commit 27fc882
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/MAddResDlg.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -216,13 +216,13 @@ class MAddResDlg : public MDialogBase
}
}

bool bOK = false;
bool bTemplateToAdd = false;
bool bAdded = false;

// if there is sample and no file was specified, then
if (file.empty() && HasSample(type, lang))
{
bOK = true; // assume OK
bTemplateToAdd = true; // assume OK

if (Res_HasNoName(type))
{
Expand All @@ -243,22 +243,22 @@ class MAddResDlg : public MDialogBase
else
{
// otherwise it's not OK
bOK = false;
bTemplateToAdd = false;
}

// set one to the name if it's RT_STRING or RT_MESSAGETABLE
if (type == RT_STRING || type == RT_MESSAGETABLE)
{
name = 1;
name = 1; // it will be fixed later
}

if (bOK) // it's OK
if (bTemplateToAdd) // it's OK
{
// add an empty entry (data will be set later)
g_res.add_lang_entry(type, name, lang);
bAdded = true;

// store the result
// store the results
m_type = type;
m_name = name;
m_lang = lang;
Expand All @@ -268,7 +268,7 @@ class MAddResDlg : public MDialogBase

// try to load the file if not OK
MByteStreamEx bs;
if (!bOK && !bs.LoadFromFile(file.c_str()))
if (!bTemplateToAdd && !bs.LoadFromFile(file.c_str()))
{
// error
ErrorBoxDx(IDS_CANNOTADDRES);
Expand All @@ -281,7 +281,7 @@ class MAddResDlg : public MDialogBase
// add the data from the file
g_res.add_lang_entry(type, name, lang, bs.data());

// store the result
// store the results
m_type = type;
m_name = name;
m_lang = lang;
Expand Down Expand Up @@ -415,6 +415,7 @@ class MAddResDlg : public MDialogBase
break;

case IDCANCEL:
// cancel the dialog
EndDialog(IDCANCEL);
break;

Expand Down

0 comments on commit 27fc882

Please sign in to comment.