Code cleanup.

This commit is contained in:
spx
2011-11-27 12:46:59 +00:00
parent 34005f14a4
commit d622c88d69
3 changed files with 18 additions and 11 deletions

View File

@ -21,10 +21,17 @@ static int Measure_GetOption(lua_State* L)
std::wstring strTmp = LuaManager::ToWide(L, 2);
strTmp = parser.GetValue(self->GetOriginalName(), strTmp, L"");
parser.SetBuiltInVariable(L"CURRENTSECTION", self->GetOriginalName()); // Set temporarily
parser.ReplaceVariables(strTmp);
parser.SetBuiltInVariable(L"CURRENTSECTION", L""); // Reset
parser.ReplaceMeasures(strTmp);
if (strTmp.size() >= 3)
{
if (strTmp.find(L'#') != std::wstring::npos)
{
static const std::wstring CURRENTSECTION = L"CURRENTSECTION";
parser.SetBuiltInVariable(CURRENTSECTION, self->GetOriginalName()); // Set temporarily
parser.ReplaceVariables(strTmp);
parser.SetBuiltInVariable(CURRENTSECTION, L""); // Reset
}
parser.ReplaceMeasures(strTmp);
}
LuaManager::PushWide(L, strTmp.c_str());
return 1;