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:
@@ -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,
|
||||
|
@@ -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,
|
||||
|
@@ -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(),
|
||||
|
Reference in New Issue
Block a user