Skip to content

Commit

Permalink
Removed/fixed code causing compiler warnings.
Browse files Browse the repository at this point in the history
Warnings about unused variables and missing override.
Changed SimpleSelector constructor so no inherited classes accidentally would get _code="*"
  • Loading branch information
Peter Hultqvist committed Feb 5, 2014
1 parent 08afb10 commit 1681ff9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion ExCSS/Model/Selector/SelectorList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@ IEnumerator IEnumerable.GetEnumerator()
return ((IEnumerable)Selectors).GetEnumerator();
}

public abstract string ToString(bool friendlyFormat, int indentation = 0);
public override abstract string ToString(bool friendlyFormat, int indentation = 0);
}
}
13 changes: 7 additions & 6 deletions ExCSS/Model/Selector/SimpleSelector.cs
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
using ExCSS.Model;
using System;
using ExCSS.Model;
// ReSharper disable once CheckNamespace


namespace ExCSS
{
public class SimpleSelector
{
private static readonly SimpleSelector GlobalSelector = new SimpleSelector();
private readonly string _code;
internal static readonly SimpleSelector All = new SimpleSelector();
internal static readonly SimpleSelector All = new SimpleSelector("*");

public SimpleSelector()
protected SimpleSelector()
{
_code = "*";
//Leave _code = null
}

public SimpleSelector(string selectorText)
Expand Down Expand Up @@ -131,6 +130,8 @@ public override string ToString()

public virtual string ToString(bool friendlyFormat, int indentation = 0)
{
if (_code == null)
throw new InvalidOperationException();
return _code;
}
}
Expand Down
2 changes: 0 additions & 2 deletions ExCSS/StylesheetReader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,9 @@ internal class StylesheetReader
private TextReader _reader;
private readonly StringBuilder _buffer;
private bool _lineWithReturn;
private Encoding _encoding;

StylesheetReader()
{
_encoding = HtmlEncoding.Suggest(CultureInfo.CurrentUICulture.Name);
_buffer = new StringBuilder();
_collengths = new Stack<int>();
Column = 1;
Expand Down

0 comments on commit 1681ff9

Please sign in to comment.