Browse Source

Small fixes (upgrade Vala)

develop
Kolan Sh 12 months ago
parent
commit
fd585f9749
5 changed files with 22 additions and 11 deletions
  1. +10
    -4
      src/latex-struct/DocIfaces.vala
  2. +1
    -1
      src/latex-struct/Parser.vala
  3. +1
    -1
      src/latex-struct/Subtable.vala
  4. +1
    -1
      src/latex-struct/TableParser.vala
  5. +9
    -4
      test/parse-test/ParseTest.vala

+ 10
- 4
src/latex-struct/DocIfaces.vala 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;
}


+ 1
- 1
src/latex-struct/Parser.vala 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;


+ 1
- 1
src/latex-struct/Subtable.vala 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)


+ 1
- 1
src/latex-struct/TableParser.vala 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 ({}, {}));


+ 9
- 4
test/parse-test/ParseTest.vala 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) {


Loading…
Cancel
Save