Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/api-doc-tools.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Köplinger <alex.koeplinger@outlook.com>2016-02-04 04:37:36 +0300
committerDuncan Mak <duncanm@microsoft.com>2016-10-08 03:31:12 +0300
commit6945b3f8d5fe467c1e39b3e371116bb5215d8214 (patch)
treedf494ae7cbc105fa675bc85d6fe146ce8560b721
parentf3de407a13d9f79c796710b6a8301f152583a368 (diff)
[monodoc] Fix literal formatting on systems where decimal separator is not a dot
E.g. on a German language OS the "make check-mdoc-export-html" test fails with this: ``` diff --exclude=.svn -rup Test/en.expected/Mono.DocTest/Widget.xml Test/en.actual/Mono.DocTest/Widget.xml --- Test/en.expected/Mono.DocTest/Widget.xml 2015-11-18 04:42:11.000000000 +0100 +++ Test/en.actual/Mono.DocTest/Widget.xml 2016-02-04 02:38:09.000000000 +0100 @@ -1061,8 +1061,8 @@ </Docs> </Member> <Member MemberName="PI"> - <MemberSignature Language="C#" Value="protected const double PI = 3.14159;" /> - <MemberSignature Language="ILAsm" Value=".field familyorassembly static literal float64 PI = (3.14159)" /> + <MemberSignature Language="C#" Value="protected const double PI = 3,14159;" /> + <MemberSignature Language="ILAsm" Value=".field familyorassembly static literal float64 PI = (3,14159)" /> <MemberType>Field</MemberType> <AssemblyInfo> <AssemblyVersion>0.0.0.0</AssemblyVersion> @@ -1070,7 +1070,7 @@ <ReturnValue> <ReturnType>System.Double</ReturnType> </ReturnValue> - <MemberValue>3.14159</MemberValue> + <MemberValue>3,14159</MemberValue> <Docs> ``` The fix is to always use InvariantCulture for literal formatting.
-rw-r--r--mdoc/Mono.Documentation/monodocer.cs6
1 files changed, 3 insertions, 3 deletions
diff --git a/mdoc/Mono.Documentation/monodocer.cs b/mdoc/Mono.Documentation/monodocer.cs
index f1b98213..a8f1ccc5 100644
--- a/mdoc/Mono.Documentation/monodocer.cs
+++ b/mdoc/Mono.Documentation/monodocer.cs
@@ -2067,7 +2067,7 @@ class MDocUpdater : MDocCommand
if (val == null) value = "null";
else if (val is Enum) value = val.ToString();
else if (val is IFormattable) {
- value = ((IFormattable)val).ToString();
+ value = ((IFormattable)val).ToString(null, CultureInfo.InvariantCulture);
if (val is string)
value = "\"" + value + "\"";
}
@@ -4966,7 +4966,7 @@ class ILFullMemberFormatter : MemberFormatter {
.Append (val.ToString ())
.Append (')');
else if (val is IFormattable) {
- string value = ((IFormattable)val).ToString();
+ string value = ((IFormattable)val).ToString(null, CultureInfo.InvariantCulture);
buf.Append (" = ");
if (val is string)
buf.Append ("\"" + value + "\"");
@@ -5525,7 +5525,7 @@ class CSharpFullMemberFormatter : MemberFormatter {
else if (val is Enum)
buf.Append (" = ").Append (val.ToString ());
else if (val is IFormattable) {
- string value = ((IFormattable)val).ToString();
+ string value = ((IFormattable)val).ToString(null, CultureInfo.InvariantCulture);
if (val is string)
value = "\"" + value + "\"";
buf.Append (" = ").Append (value);