Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ImportedProjects
SVG
Commits
efd6005f
Commit
efd6005f
authored
Jul 15, 2014
by
tebjan
Browse files
color converter now uses invariant culture to parse
parent
76cf593c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Source/Painting/SvgColourConverter.cs
View file @
efd6005f
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Drawing
;
using
System.Drawing
;
using
System.Globalization
;
using
System.Globalization
;
using
System.Linq
;
using
System.Text
;
using
System.Threading
;
namespace
Svg
namespace
Svg
{
{
...
@@ -31,6 +32,9 @@ namespace Svg
...
@@ -31,6 +32,9 @@ namespace Svg
if
(
colour
!=
null
)
if
(
colour
!=
null
)
{
{
var
oldCulture
=
Thread
.
CurrentThread
.
CurrentCulture
;
Thread
.
CurrentThread
.
CurrentCulture
=
System
.
Globalization
.
CultureInfo
.
InvariantCulture
;
colour
=
colour
.
Trim
();
colour
=
colour
.
Trim
();
if
(
colour
.
StartsWith
(
"rgb"
))
if
(
colour
.
StartsWith
(
"rgb"
))
...
@@ -79,6 +83,8 @@ namespace Svg
...
@@ -79,6 +83,8 @@ namespace Svg
colour
=
string
.
Format
(
culture
,
"#{0}{0}{1}{1}{2}{2}"
,
colour
[
1
],
colour
[
2
],
colour
[
3
]);
colour
=
string
.
Format
(
culture
,
"#{0}{0}{1}{1}{2}{2}"
,
colour
[
1
],
colour
[
2
],
colour
[
3
]);
return
base
.
ConvertFrom
(
context
,
culture
,
colour
);
return
base
.
ConvertFrom
(
context
,
culture
,
colour
);
}
}
Thread
.
CurrentThread
.
CurrentCulture
=
oldCulture
;
}
}
return
base
.
ConvertFrom
(
context
,
culture
,
value
);
return
base
.
ConvertFrom
(
context
,
culture
,
value
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment