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

View File

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

View File

@ -228,7 +228,7 @@ namespace LAview {
* @param line_style {@link Row.OpLineStyle} of the operation.
*/
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)
process_border_lines (this[1], this[index], true);
else if (index == size - 1)

View File

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

View File

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