From 9c3cd4207b2d30b8c00b5f580ae5b51b793f7189 Mon Sep 17 00:00:00 2001 From: GoldenCrystal Date: Sun, 16 Nov 2014 21:27:57 +0100 Subject: [PATCH] Replaced spaces by tabs on files with incoherent indentations. --- UnicodeCharacterInspector/BindableObject.cs | 2 +- .../CharacterInfoViewModel.cs | 2 +- .../CharacterInspectorViewModel.cs | 6 +++--- .../CharacterDecompositionMapping.cs | 2 +- UnicodeInformation.Builder/HttpDataSource.cs | 2 +- UnicodeInformation.Builder/Program.cs | 12 ++++++------ .../UnicodeCharacterDataBuilder.cs | 3 ++- .../UnicodeDataFileReader.cs | 10 +++++----- .../UnicodeDataProcessor.cs | 2 +- .../UnicodeInfoBuilder.cs | 4 ++-- .../UnihanDataFileReader.cs | 2 +- UnicodeInformation.Builder/Utf8Buffer.cs | 2 +- .../CompatibilityFormattingTag.cs | 2 +- UnicodeInformation/EnumHelper.cs | 2 +- UnicodeInformation/UcdFields.cs | 6 +++--- UnicodeInformation/UnicodeBlock.cs | 2 +- UnicodeInformation/UnicodeCategoryInfo.cs | 6 +++--- UnicodeInformation/UnicodeCharInfo.cs | 6 +++--- UnicodeInformation/UnicodeCharacterData.cs | 8 ++++---- UnicodeInformation/UnicodeCharacterRange.cs | 4 ++-- UnicodeInformation/UnicodeInfo.cs | 18 +++++++++--------- UnicodeInformation/UnihanCharacterData.cs | 4 ++-- 22 files changed, 54 insertions(+), 53 deletions(-) diff --git a/UnicodeCharacterInspector/BindableObject.cs b/UnicodeCharacterInspector/BindableObject.cs index c07fb8c..3b1e359 100644 --- a/UnicodeCharacterInspector/BindableObject.cs +++ b/UnicodeCharacterInspector/BindableObject.cs @@ -38,7 +38,7 @@ namespace UnicodeCharacterInspector storage = value; NotifyPropertyChanged(propertyName); return true; - } + } return false; } } diff --git a/UnicodeCharacterInspector/CharacterInfoViewModel.cs b/UnicodeCharacterInspector/CharacterInfoViewModel.cs index 7d59723..5122c89 100644 --- a/UnicodeCharacterInspector/CharacterInfoViewModel.cs +++ b/UnicodeCharacterInspector/CharacterInfoViewModel.cs @@ -47,7 +47,7 @@ namespace UnicodeCharacterInspector { codePoint = 0; characterInfo = UnicodeInfo.GetCharInfo(0); - } + } NotifyPropertyChanged(); UpdateDisplayText(); diff --git a/UnicodeCharacterInspector/CharacterInspectorViewModel.cs b/UnicodeCharacterInspector/CharacterInspectorViewModel.cs index e1a556d..d633d6e 100644 --- a/UnicodeCharacterInspector/CharacterInspectorViewModel.cs +++ b/UnicodeCharacterInspector/CharacterInspectorViewModel.cs @@ -23,7 +23,7 @@ namespace UnicodeCharacterInspector CodePoint = codePoint; Character = char.ConvertFromUtf32(codePoint); DisplayText = UnicodeInfo.GetDisplayText(codePoint); - } + } } private class CharacterCollection : INotifyCollectionChanged, IList @@ -108,7 +108,7 @@ namespace UnicodeCharacterInspector public CharacterInspectorViewModel() { characterCollection = new CharacterCollection(this); - } + } private void NotifyCollectionChanged(NotifyCollectionChangedAction action) { @@ -164,7 +164,7 @@ namespace UnicodeCharacterInspector NotifyPropertyChanged(nameof(SelectedCharacter)); selectedCharacterInfo.Character = null; } - } + } } public ICollection Characters { get { return characterCollection; } } diff --git a/UnicodeInformation.Builder/CharacterDecompositionMapping.cs b/UnicodeInformation.Builder/CharacterDecompositionMapping.cs index c5709de..8cfef80 100644 --- a/UnicodeInformation.Builder/CharacterDecompositionMapping.cs +++ b/UnicodeInformation.Builder/CharacterDecompositionMapping.cs @@ -36,7 +36,7 @@ namespace System.Unicode.Builder index = 0; } - var buffer = stackalloc char[36]; // From the Unicode docs, a decomposition cannot have more than 18 code points. + var buffer = stackalloc char[36]; // From the Unicode docs, a decomposition cannot have more than 18 code points. int charIndex = 0; while (index < s.Length && charIndex < 35) diff --git a/UnicodeInformation.Builder/HttpDataSource.cs b/UnicodeInformation.Builder/HttpDataSource.cs index 129dbd9..0c11b2e 100644 --- a/UnicodeInformation.Builder/HttpDataSource.cs +++ b/UnicodeInformation.Builder/HttpDataSource.cs @@ -24,7 +24,7 @@ namespace System.Unicode.Builder { this.httpClient = new HttpClient(); this.baseUri = baseUri; - } + } public void Dispose() { diff --git a/UnicodeInformation.Builder/Program.cs b/UnicodeInformation.Builder/Program.cs index d52d240..c68b2f5 100644 --- a/UnicodeInformation.Builder/Program.cs +++ b/UnicodeInformation.Builder/Program.cs @@ -21,7 +21,7 @@ namespace System.Unicode.Builder "UnicodeData.txt", "PropList.txt", "DerivedCoreProperties.txt", - "Blocks.txt", + "Blocks.txt", "Jamo.txt", }; @@ -37,7 +37,7 @@ namespace System.Unicode.Builder using (var httpClient = new HttpClient()) { return httpClient.GetByteArrayAsync(HttpDataSource.UnicodeCharacterDataUri + archiveName).Result; - } + } } internal static IDataSource GetDataSource(string archiveName, string directoryName, string[] requiredFiles, bool? shouldDownload, bool? shouldSaveArchive, bool? shouldExtract) @@ -79,7 +79,7 @@ namespace System.Unicode.Builder return new ZipDataSource(File.OpenRead(dataArchiveFileName)); } } - } + } if (shouldDownload != false) { @@ -91,7 +91,7 @@ namespace System.Unicode.Builder try { stream.Write(dataArchiveData, 0, dataArchiveData.Length); - dataArchiveData = null; // Release the reference now, since we won't need it anymore. + dataArchiveData = null; // Release the reference now, since we won't need it anymore. if (shouldExtract == true) { @@ -120,7 +120,7 @@ namespace System.Unicode.Builder } throw new InvalidOperationException(); - } + } private static void Main(string[] args) { @@ -134,6 +134,6 @@ namespace System.Unicode.Builder using (var stream = new DeflateStream(File.Create("ucd.dat"), CompressionLevel.Optimal, false)) data.WriteToStream(stream); - } + } } } diff --git a/UnicodeInformation.Builder/UnicodeCharacterDataBuilder.cs b/UnicodeInformation.Builder/UnicodeCharacterDataBuilder.cs index ed4476e..5f5b58a 100644 --- a/UnicodeInformation.Builder/UnicodeCharacterDataBuilder.cs +++ b/UnicodeInformation.Builder/UnicodeCharacterDataBuilder.cs @@ -167,7 +167,8 @@ namespace System.Unicode.Builder if (name != null) fields |= UcdFields.Name; if (category != UnicodeCategory.OtherNotAssigned) fields |= UcdFields.Category; if (canonicalCombiningClass != CanonicalCombiningClass.NotReordered) fields |= UcdFields.CanonicalCombiningClass; - /*if (bidirectionalClass != 0)*/fields |= UcdFields.BidirectionalClass; + /*if (bidirectionalClass != 0)*/ + fields |= UcdFields.BidirectionalClass; if (characterDecompositionMapping.DecompositionMapping != null) fields |= UcdFields.DecompositionMapping; fields |= (UcdFields)((int)numericType << 6); if (bidirectionalMirrored) fields |= UcdFields.BidirectionalMirrored; diff --git a/UnicodeInformation.Builder/UnicodeDataFileReader.cs b/UnicodeInformation.Builder/UnicodeDataFileReader.cs index 7aac2ab..d60afb5 100644 --- a/UnicodeInformation.Builder/UnicodeDataFileReader.cs +++ b/UnicodeInformation.Builder/UnicodeDataFileReader.cs @@ -59,7 +59,7 @@ namespace System.Unicode.Builder hasField = true; goto Completed; } - } + } else { return false; @@ -82,9 +82,9 @@ namespace System.Unicode.Builder } while (RefillBuffer()); hasField = false; - Completed: ; + Completed:; return hasField; - } + } private string ReadFieldInternal(bool trim) { @@ -121,7 +121,7 @@ namespace System.Unicode.Builder { byte b = byteBuffer[index]; - if (IsNewLineOrComment(b)) // NB: Do not advance to the next byte when end of line has been reached. + if (IsNewLineOrComment(b)) // NB: Do not advance to the next byte when end of line has been reached. { endOffset = index; hasField = false; @@ -192,7 +192,7 @@ namespace System.Unicode.Builder { byte b = byteBuffer[index]; - if (IsNewLineOrComment(b)) // NB: Do not advance to the next byte when end of line has been reached. + if (IsNewLineOrComment(b)) // NB: Do not advance to the next byte when end of line has been reached. { hasField = false; return true; diff --git a/UnicodeInformation.Builder/UnicodeDataProcessor.cs b/UnicodeInformation.Builder/UnicodeDataProcessor.cs index 6deb488..d526619 100644 --- a/UnicodeInformation.Builder/UnicodeDataProcessor.cs +++ b/UnicodeInformation.Builder/UnicodeDataProcessor.cs @@ -73,7 +73,7 @@ namespace System.Unicode.Builder codePoint = new UnicodeCharacterRange(rangeStartCodePoint, codePoint.LastCodePoint); - name = name.Substring(1, name.Length - 8).ToUpperInvariant(); // Upper-case the name in order to respect unicode naming scheme. (Spec says all names are uppercase ASCII) + name = name.Substring(1, name.Length - 8).ToUpperInvariant(); // Upper-case the name in order to respect unicode naming scheme. (Spec says all names are uppercase ASCII) rangeStartCodePoint = -1; } diff --git a/UnicodeInformation.Builder/UnicodeInfoBuilder.cs b/UnicodeInformation.Builder/UnicodeInfoBuilder.cs index efac96b..91bdc42 100644 --- a/UnicodeInformation.Builder/UnicodeInfoBuilder.cs +++ b/UnicodeInformation.Builder/UnicodeInfoBuilder.cs @@ -37,7 +37,7 @@ namespace System.Unicode.Builder if (Δ == 0) return index; else if (Δ < 0) maxIndex = index - 1; else minIndex = index + 1; - } while (minIndex <= maxIndex); + } while (minIndex <= maxIndex); return -1; } @@ -241,7 +241,7 @@ namespace System.Unicode.Builder public void AddBlockEntry(UnicodeBlock block) { blockEntries.Add(block); - } + } //public UnicodeInfo ToUnicodeData() //{ diff --git a/UnicodeInformation.Builder/UnihanDataFileReader.cs b/UnicodeInformation.Builder/UnihanDataFileReader.cs index 7e475ec..7dc8fae 100644 --- a/UnicodeInformation.Builder/UnihanDataFileReader.cs +++ b/UnicodeInformation.Builder/UnihanDataFileReader.cs @@ -22,7 +22,7 @@ namespace System.Unicode.Builder public UnihanDataFileReader(Stream stream, bool leaveOpen) { reader = new UnicodeDataFileReader(stream, '\t', leaveOpen); - } + } public void Dispose() { diff --git a/UnicodeInformation.Builder/Utf8Buffer.cs b/UnicodeInformation.Builder/Utf8Buffer.cs index 2d2bd97..114be0b 100644 --- a/UnicodeInformation.Builder/Utf8Buffer.cs +++ b/UnicodeInformation.Builder/Utf8Buffer.cs @@ -16,7 +16,7 @@ namespace System.Unicode.Builder byte[] buffer; return new Utf8Buffer(bufferStack.TryPop(out buffer) ? buffer : new byte[100]); - } + } private byte[] buffer; private int length; diff --git a/UnicodeInformation/CompatibilityFormattingTag.cs b/UnicodeInformation/CompatibilityFormattingTag.cs index b19e704..4fe821d 100644 --- a/UnicodeInformation/CompatibilityFormattingTag.cs +++ b/UnicodeInformation/CompatibilityFormattingTag.cs @@ -10,7 +10,7 @@ namespace System.Unicode public enum CompatibilityFormattingTag : byte { Canonical = 0, - [ValueName("font"), Display(Name = "font", Description = "Font variant (for example, a blackletter form)")] + [ValueName("font"), Display(Name = "font", Description = "Font variant (for example, a blackletter form)")] Font, [ValueName("noBreak"), Display(Name = "noBreak", Description = "No-break version of a space or hyphen")] NoBreak, diff --git a/UnicodeInformation/EnumHelper.cs b/UnicodeInformation/EnumHelper.cs index 5d8599f..595f0be 100644 --- a/UnicodeInformation/EnumHelper.cs +++ b/UnicodeInformation/EnumHelper.cs @@ -26,7 +26,7 @@ namespace System.Unicode where attr.Name != null select new KeyValuePair(attr.Name, (T)field.GetValue(null)) ).ToDictionary(kvp => kvp.Key, kvp => kvp.Value, StringComparer.OrdinalIgnoreCase); - } + } public static bool TryGetNamedValue(string name, out T value) { diff --git a/UnicodeInformation/UcdFields.cs b/UnicodeInformation/UcdFields.cs index a4c65de..4f6916e 100644 --- a/UnicodeInformation/UcdFields.cs +++ b/UnicodeInformation/UcdFields.cs @@ -12,8 +12,8 @@ namespace System.Unicode internal enum UcdFields : ushort { // Not really a field, just here to indicate that the entry is a range - CodePointRange = 1, - + CodePointRange = 1, + Name = 2, Category = 4, CanonicalCombiningClass = 8, @@ -23,7 +23,7 @@ namespace System.Unicode // NumericType / NumericValue : Not exactly a bit mask here… More like [0…3] << 6 NumericDecimal = 64, NumericDigit = 128, - NumericNumeric = 192, + NumericNumeric = 192, // This is a yes/no field, so obviously, no extra storage is required for this one… BidirectionalMirrored = 256, diff --git a/UnicodeInformation/UnicodeBlock.cs b/UnicodeInformation/UnicodeBlock.cs index 79b2530..971fdaa 100644 --- a/UnicodeInformation/UnicodeBlock.cs +++ b/UnicodeInformation/UnicodeBlock.cs @@ -16,5 +16,5 @@ namespace System.Unicode this.CodePointRange = codePointRange; this.Name = name; } - } + } } diff --git a/UnicodeInformation/UnicodeCategoryInfo.cs b/UnicodeInformation/UnicodeCategoryInfo.cs index a139d23..cd8ad8a 100644 --- a/UnicodeInformation/UnicodeCategoryInfo.cs +++ b/UnicodeInformation/UnicodeCategoryInfo.cs @@ -50,10 +50,10 @@ namespace System.Unicode { var dictionary = new Dictionary(StringComparer.OrdinalIgnoreCase); - foreach (var info in categories) + foreach (var info in categories) { dictionary.Add(info.ShortName, info.Category); - } + } return dictionary; } @@ -83,7 +83,7 @@ namespace System.Unicode public static UnicodeCategoryInfo Get(UnicodeCategory category) { return categories[(int)category]; - } + } public static UnicodeCategoryInfo FromShortName(string name) { diff --git a/UnicodeInformation/UnicodeCharInfo.cs b/UnicodeInformation/UnicodeCharInfo.cs index 89f1ee8..8c13895 100644 --- a/UnicodeInformation/UnicodeCharInfo.cs +++ b/UnicodeInformation/UnicodeCharInfo.cs @@ -23,11 +23,11 @@ namespace System.Unicode return unicodeCharacterData.Name == null || unicodeCharacterData.CodePointRange.IsSingleCodePoint ? unicodeCharacterData.Name : unicodeCharacterData.Name + "-" + codePoint.ToString("X4"); - } + } } - public UnicodeCategory Category { get { return unicodeCharacterData != null ? unicodeCharacterData.Category : UnicodeCategory.OtherNotAssigned; } } - public string Block { get { return block ?? "No_Block"; } } + public UnicodeCategory Category { get { return unicodeCharacterData != null ? unicodeCharacterData.Category : UnicodeCategory.OtherNotAssigned; } } + public string Block { get { return block ?? "No_Block"; } } public CanonicalCombiningClass CanonicalCombiningClass { get { return unicodeCharacterData.CanonicalCombiningClass; } } public BidirectionalClass BidirectionalClass { get { return unicodeCharacterData.BidirectionalClass; } } public CompatibilityFormattingTag DecompositionType { get { return unicodeCharacterData.DecompositionType; } } diff --git a/UnicodeInformation/UnicodeCharacterData.cs b/UnicodeInformation/UnicodeCharacterData.cs index 56ce39c..de7619b 100644 --- a/UnicodeInformation/UnicodeCharacterData.cs +++ b/UnicodeInformation/UnicodeCharacterData.cs @@ -36,17 +36,17 @@ namespace System.Unicode CanonicalCombiningClass canonicalCombiningClass, BidirectionalClass bidirectionalClass, CompatibilityFormattingTag decompositionType, - string decompositionMapping, + string decompositionMapping, UnicodeNumericType numericType, UnicodeRationalNumber numericValue, bool bidirectionalMirrored, string oldName, - string simpleUpperCaseMapping, + string simpleUpperCaseMapping, string simpleLowerCaseMapping, string simpleTitleCaseMapping, ContributoryProperties contributoryProperties, CoreProperties coreProperties, - int[] relatedCodePoints + int[] relatedCodePoints ) { this.CodePointRange = codePointRange; @@ -66,7 +66,7 @@ namespace System.Unicode this.ContributoryProperties = contributoryProperties; this.CoreProperties = coreProperties; this.RelatedCodePoints = relatedCodePoints; - } + } public UnicodeRationalNumber? NumericValue { get { return NumericType != UnicodeNumericType.None ? numericValue : null as UnicodeRationalNumber?; } } } diff --git a/UnicodeInformation/UnicodeCharacterRange.cs b/UnicodeInformation/UnicodeCharacterRange.cs index c2a4ed9..77d88a8 100644 --- a/UnicodeInformation/UnicodeCharacterRange.cs +++ b/UnicodeInformation/UnicodeCharacterRange.cs @@ -52,7 +52,7 @@ namespace System.Unicode if (firstCodePoint < 0 || firstCodePoint > 0x10FFFF) throw new ArgumentOutOfRangeException("firstCodePoint"); if (lastCodePoint < firstCodePoint || lastCodePoint > 0x10FFFF) throw new ArgumentOutOfRangeException("lastCodePoint"); - FirstCodePoint = firstCodePoint; + FirstCodePoint = firstCodePoint; LastCodePoint = lastCodePoint; } @@ -86,7 +86,7 @@ namespace System.Unicode { start = int.Parse(s.Substring(0, rangeSeparatorOffset), NumberStyles.HexNumber); end = int.Parse(s.Substring(rangeSeparatorOffset + 2), NumberStyles.HexNumber); - } + } return new UnicodeCharacterRange(start, end); } diff --git a/UnicodeInformation/UnicodeInfo.cs b/UnicodeInformation/UnicodeInfo.cs index 37d8430..d89694c 100644 --- a/UnicodeInformation/UnicodeInfo.cs +++ b/UnicodeInformation/UnicodeInfo.cs @@ -74,7 +74,7 @@ namespace System.Unicode var codePointRange = (fields & UcdFields.CodePointRange) != 0 ? new UnicodeCharacterRange(ReadCodePoint(reader), ReadCodePoint(reader)) : new UnicodeCharacterRange(ReadCodePoint(reader)); - string name = (fields & UcdFields.Name) != 0 ? reader.ReadString() : null; + string name = (fields & UcdFields.Name) != 0 ? reader.ReadString() : null; var category = (fields & UcdFields.Category) != 0 ? (UnicodeCategory)reader.ReadByte() : UnicodeCategory.OtherNotAssigned; var canonicalCombiningClass = (fields & UcdFields.CanonicalCombiningClass) != 0 ? (CanonicalCombiningClass)reader.ReadByte() : CanonicalCombiningClass.NotReordered; var bidirectionalClass = (fields & UcdFields.BidirectionalClass) != 0 ? (BidirectionalClass)reader.ReadByte() : 0; @@ -109,9 +109,9 @@ namespace System.Unicode simpleTitleCaseMapping, contributoryProperties, coreProperties, - null + null ); - } + } private static UnihanCharacterData ReadUnihanCharacterDataEntry(BinaryReader reader) { @@ -183,7 +183,7 @@ namespace System.Unicode else { return 0x40A0 + (((((b & 0x1F) << 8) | reader.ReadByte()) << 8) | reader.ReadByte()); - } + } } public static Version UnicodeVersion { get { return unicodeVersion; } } @@ -255,7 +255,7 @@ namespace System.Unicode int i = FindBlockIndex(codePoint); return i >= 0 ? blocks[i].Name : null; - } + } public static UnicodeCharInfo GetCharInfo(int codePoint) { @@ -267,25 +267,25 @@ namespace System.Unicode var charInfo = FindUnicodeCodePoint(codePoint); return charInfo != null ? charInfo.Category : UnicodeCategory.OtherNotAssigned; - } + } public static string GetDisplayText(UnicodeCharInfo charInfo) { if (charInfo.CodePoint <= 0x0020) return ((char)(0x2400 + charInfo.CodePoint)).ToString(); else if (charInfo.Category == UnicodeCategory.NonSpacingMark) return "\u25CC" + char.ConvertFromUtf32(charInfo.CodePoint); else return char.ConvertFromUtf32(charInfo.CodePoint); - } + } public static string GetDisplayText(int codePoint) { if (codePoint <= 0x0020) return ((char)(0x2400 + codePoint)).ToString(); else if (GetCategory(codePoint) == UnicodeCategory.NonSpacingMark) return "\u25CC" + char.ConvertFromUtf32(codePoint); else return char.ConvertFromUtf32(codePoint); - } + } public static UnicodeBlock[] GetBlocks() { return (UnicodeBlock[])blocks.Clone(); - } + } } } diff --git a/UnicodeInformation/UnihanCharacterData.cs b/UnicodeInformation/UnihanCharacterData.cs index 0258f89..69d9d03 100644 --- a/UnicodeInformation/UnihanCharacterData.cs +++ b/UnicodeInformation/UnihanCharacterData.cs @@ -66,10 +66,10 @@ namespace System.Unicode if (codePoint < 0x2F800) return codePoint - 0x19400; else if (codePoint < 0x30000) return codePoint - 0x10000; } - } + } throw new ArgumentOutOfRangeException("codePoint"); - } + } internal static int UnpackCodePoint(int packedCodePoint) {