Browse Source

Small fixes (upgrade Vala)

develop
Kolan Sh 1 year ago
parent
commit
fd585f9749
  1. 14
      src/latex-struct/DocIfaces.vala
  2. 2
      src/latex-struct/Parser.vala
  3. 2
      src/latex-struct/Subtable.vala
  4. 2
      src/latex-struct/TableParser.vala
  5. 13
      test/parse-test/ParseTest.vala

14
src/latex-struct/DocIfaces.vala

@ -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;
}

2
src/latex-struct/Parser.vala

@ -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;

2
src/latex-struct/Subtable.vala

@ -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)

2
src/latex-struct/TableParser.vala

@ -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 ({}, {}));

13
test/parse-test/ParseTest.vala

@ -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) {

Loading…
Cancel
Save