mirror of
https://github.com/chibicitiberiu/rainmeter-studio.git
synced 2024-02-24 04:33:31 +00:00
Fixed that %10, %11, etc. doesn't work.
This commit is contained in:
parent
e7e9dd985d
commit
0dd7ab194f
@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="Windows-1252"?>
|
<?xml version="1.0" encoding="Windows-1252"?>
|
||||||
<VisualStudioProject
|
<VisualStudioProject
|
||||||
ProjectType="Visual C++"
|
ProjectType="Visual C++"
|
||||||
Version="9,00"
|
Version="9.00"
|
||||||
Name="Library"
|
Name="Library"
|
||||||
ProjectGUID="{BE9D2400-7F1C-49D6-8498-5CE495491AD6}"
|
ProjectGUID="{BE9D2400-7F1C-49D6-8498-5CE495491AD6}"
|
||||||
TargetFrameworkVersion="0"
|
TargetFrameworkVersion="0"
|
||||||
|
@ -595,9 +595,9 @@ std::wstring CMeter::ReplaceMeasures(std::wstring source)
|
|||||||
WCHAR buffer[64];
|
WCHAR buffer[64];
|
||||||
// Create the actual text (i.e. replace %1, %2, .. with the measure texts)
|
// Create the actual text (i.e. replace %1, %2, .. with the measure texts)
|
||||||
|
|
||||||
for (size_t i = 0; i < stringValues.size(); ++i)
|
for (size_t i = stringValues.size(); i > 0; --i)
|
||||||
{
|
{
|
||||||
wsprintf(buffer, L"%%%i", i + 1);
|
wsprintf(buffer, L"%%%i", i);
|
||||||
|
|
||||||
size_t start = 0;
|
size_t start = 0;
|
||||||
size_t pos = std::wstring::npos;
|
size_t pos = std::wstring::npos;
|
||||||
@ -607,8 +607,8 @@ std::wstring CMeter::ReplaceMeasures(std::wstring source)
|
|||||||
pos = source.find(buffer, start);
|
pos = source.find(buffer, start);
|
||||||
if (pos != std::wstring::npos)
|
if (pos != std::wstring::npos)
|
||||||
{
|
{
|
||||||
source.replace(source.begin() + pos, source.begin() + pos + wcslen(buffer), stringValues[i]);
|
source.replace(source.begin() + pos, source.begin() + pos + wcslen(buffer), stringValues[i - 1]);
|
||||||
start = pos + stringValues[i].length();
|
start = pos + stringValues[i - 1].length();
|
||||||
}
|
}
|
||||||
} while(pos != std::wstring::npos);
|
} while(pos != std::wstring::npos);
|
||||||
}
|
}
|
||||||
|
@ -447,9 +447,9 @@ bool CMeterString::Update()
|
|||||||
// Create the actual text (i.e. replace %1, %2, .. with the measure texts)
|
// Create the actual text (i.e. replace %1, %2, .. with the measure texts)
|
||||||
std::wstring tmpText = m_Text;
|
std::wstring tmpText = m_Text;
|
||||||
|
|
||||||
for (size_t i = 0; i < stringValues.size(); ++i)
|
for (size_t i = stringValues.size(); i > 0; --i)
|
||||||
{
|
{
|
||||||
wsprintf(buffer, L"%%%i", i + 1);
|
wsprintf(buffer, L"%%%i", i);
|
||||||
|
|
||||||
size_t start = 0;
|
size_t start = 0;
|
||||||
size_t pos = std::wstring::npos;
|
size_t pos = std::wstring::npos;
|
||||||
@ -459,8 +459,8 @@ bool CMeterString::Update()
|
|||||||
pos = tmpText.find(buffer, start);
|
pos = tmpText.find(buffer, start);
|
||||||
if (pos != std::wstring::npos)
|
if (pos != std::wstring::npos)
|
||||||
{
|
{
|
||||||
tmpText.replace(tmpText.begin() + pos, tmpText.begin() + pos + wcslen(buffer), stringValues[i]);
|
tmpText.replace(tmpText.begin() + pos, tmpText.begin() + pos + wcslen(buffer), stringValues[i - 1]);
|
||||||
start = pos + stringValues[i].length();
|
start = pos + stringValues[i - 1].length();
|
||||||
}
|
}
|
||||||
} while(pos != std::wstring::npos);
|
} while(pos != std::wstring::npos);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user