Small fixes (upgrade Vala)

This commit is contained in:
Kolan Sh 2020-04-29 11:40:44 +03:00
parent 9d8647207b
commit fd585f9749
5 changed files with 22 additions and 11 deletions

View File

@ -54,8 +54,11 @@ namespace LAview {
public virtual IDoc copy () { public virtual IDoc copy () {
var clone = create_default_instance (); var clone = create_default_instance ();
foreach (T dociface in this) foreach (T dociface in this) {
clone.add ((dociface as IDoc).copy ()); var doc = dociface as IDoc;
assert (doc != null);
clone.add (doc.copy ());
}
return clone; return clone;
} }
@ -66,8 +69,11 @@ namespace LAview {
public virtual string generate () { public virtual string generate () {
var result = new StringBuilder (); var result = new StringBuilder ();
foreach (T dociface in this) foreach (T dociface in this) {
result.append ((dociface as IDoc).generate ()); var doc = dociface as IDoc;
assert (doc != null);
result.append (doc.generate ());
}
return result.str; return result.str;
} }

View File

@ -82,7 +82,7 @@ namespace LAview {
/* back-slash counter for one-line comments */ /* back-slash counter for one-line comments */
protected uint back_slash_counter = 0; protected uint back_slash_counter = 0;
public Parser (Array<Link> links) { protected Parser (Array<Link> links) {
/* initializing scanner links */ /* initializing scanner links */
this.links = links; this.links = links;

View File

@ -228,7 +228,7 @@ namespace LAview {
* @param line_style {@link Row.OpLineStyle} of the operation. * @param line_style {@link Row.OpLineStyle} of the operation.
*/ */
public new Row remove_at (int index, Row.OpLineStyle line_style = Row.OpLineStyle.BORDER_DBLLINES) { public new Row remove_at (int index, Row.OpLineStyle line_style = Row.OpLineStyle.BORDER_DBLLINES) {
if (size > 1 && 0 != line_style & Row.OpLineStyle.HBORDER) { if (size > 1 && 0 != (line_style & Row.OpLineStyle.HBORDER)) {
if (index == 0) if (index == 0)
process_border_lines (this[1], this[index], true); process_border_lines (this[1], this[index], true);
else if (index == size - 1) else if (index == size - 1)

View File

@ -19,7 +19,7 @@ namespace LAview {
protected bool in_caption = false; protected bool in_caption = false;
public TableParser (Array<Link> links) { protected TableParser (Array<Link> links) {
base (links); base (links);
group.append_val (new Link ({}, {})); group.append_val (new Link ({}, {}));

View File

@ -64,10 +64,15 @@ public class Main : Object {
unowned Table.Subtable subtable = null; unowned Table.Subtable subtable = null;
if (subdoc is Table.Tabular) if (subdoc is Table.Tabular) {
subtable = (subdoc as Table.Tabular).table; var t = subdoc as Table.Tabular;
else assert (t != null);
subtable = (subdoc as Table.Longtable).table; subtable = t.table;
} else {
var t = subdoc as Table.Longtable;
assert (t != null);
subtable = t.table;
}
foreach (var row in subtable) { foreach (var row in subtable) {
foreach (var cell in row) { foreach (var cell in row) {