Just replace() method is enough. It replaces all occurrences.

--HG--
branch : feature
This commit is contained in:
Roman Telezhynskyi 2017-08-15 15:21:31 +03:00
parent 3b60eaff08
commit b80bd85dec

View file

@ -694,12 +694,9 @@ QString VTranslateVars::PlaceholderToUserText(QString text) const
const QString original = per + i.key() + per;
if (translated != original)
{
while (text.indexOf(original) != -1)
{
text.replace(original, translated);
}
}
++i;
}
return text;
@ -716,12 +713,9 @@ QString VTranslateVars::PlaceholderFromUserText(QString text) const
const QString original = per + i.key() + per;
if (translated != original)
{
while (text.indexOf(translated) != -1)
{
text.replace(translated, original);
}
}
++i;
}
return text;