Fix built-in wxPrintf() for repeated positional parameters

Allow wxPrintf("%1$s %1$s", "foo") to work.

Take into account the possibility that the number of format specifiers
and the number of actual arguments can be different.

Closes #9367.
This commit is contained in:
Vadim Zeitlin
2017-11-25 11:02:52 +01:00
parent dd8155980b
commit 471a771382
3 changed files with 36 additions and 10 deletions

View File

@@ -188,6 +188,8 @@ void StringTestCase::Format()
"4 world hello world 3",
wxString::Format("%4$d %2$s %1$s %2$s %3$d", "hello", "world", 3, 4)
);
CHECK( wxString::Format("%1$o %1$d %1$x", 20) == "24 20 14" );
}
void StringTestCase::FormatUnicode()