Fix font description for non-. decimal separators

Fix wxNativeFontInfo::ToString and FromString to work correctly under
locales that don't use '.' for decimal separator. The code incorrectly
parsed descriptions using ToCDouble and this '.', but wrote them out
using locale's native separator. Fixed by using FromCDouble for output
too.
This commit is contained in:
Václav Slavík
2018-11-03 17:03:14 +01:00
parent b77aa4782d
commit aaa13cf520
3 changed files with 6 additions and 6 deletions

View File

@@ -812,9 +812,9 @@ wxString wxNativeFontInfo::ToString() const
{
wxString s;
s.Printf(wxT("%d;%f;%d;%d;%d;%d;%d;%s;%d"),
s.Printf(wxT("%d;%s;%d;%d;%d;%d;%d;%s;%d"),
1, // version
GetFractionalPointSize(),
wxString::FromCDouble(GetFractionalPointSize()),
family,
(int)style,
weight,

View File

@@ -739,9 +739,9 @@ wxString wxNativeFontInfo::ToString() const
{
wxString s;
s.Printf(wxS("%d;%f;%ld;%ld;%ld;%ld;%ld;%d;%d;%d;%d;%d;%d;%d;%d;%s"),
s.Printf(wxS("%d;%s;%ld;%ld;%ld;%ld;%ld;%d;%d;%d;%d;%d;%d;%d;%d;%s"),
1, // version
pointSize,
wxString::FromCDouble(pointSize),
lf.lfHeight,
lf.lfWidth,
lf.lfEscapement,

View File

@@ -971,9 +971,9 @@ wxString wxNativeFontInfo::ToString() const
{
wxString s;
s.Printf(wxT("%d;%f;%d;%d;%d;%d;%d;%s;%d"),
s.Printf(wxT("%d;%s;%d;%d;%d;%d;%d;%s;%d"),
1, // version
GetFractionalPointSize(),
wxString::FromCDouble(GetFractionalPointSize()),
GetFamily(),
(int)GetStyle(),
GetNumericWeight(),