Small fixes (upgrade Vala)
This commit is contained in:
parent
e624ab7c2b
commit
3e214e8234
|
@ -1,6 +1,6 @@
|
||||||
[submodule "cmake/backbone"]
|
[submodule "cmake/backbone"]
|
||||||
path = cmake/backbone
|
path = cmake/backbone
|
||||||
url = git@git.backbone.ws:kolan/cmake.backbone.git
|
url = https://git.backbone.ws/kolan/cmake.backbone.git
|
||||||
[submodule "util/backbone-utils"]
|
[submodule "util/backbone-utils"]
|
||||||
path = util/backbone
|
path = util/backbone
|
||||||
url = git@git.backbone.ws:kolan/cmake.backbone-utils.git
|
url = https://git.backbone.ws/kolan/cmake.backbone-utils.git
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit 206751e1f4814716d716f6bc297c280d4bf1dcf7
|
Subproject commit 902b996551e600ceb53eb895fbce6a37b5247693
|
|
@ -1,6 +1,6 @@
|
||||||
SET (LibName ${PROJECT_LOWERCASE_NAME}-iface)
|
SET (LibName ${PROJECT_LOWERCASE_NAME}-iface)
|
||||||
FILE (GLOB_RECURSE LibSources RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} CoreInterface.vala)
|
FILE (GLOB_RECURSE LibSources RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} CoreInterface.vala)
|
||||||
SET (LibPackages gee-0.8 gmodule-2.0 gio-2.0 gobject-plugin-iface-0)
|
SET (LibPackages posix gee-0.8 gmodule-2.0 gio-2.0 gobject-plugin-iface-0)
|
||||||
SET (LibInstall ON)
|
SET (LibInstall ON)
|
||||||
SET (LibExtraSources ${CMAKE_CURRENT_BINARY_DIR}/library_constructor.c)
|
SET (LibExtraSources ${CMAKE_CURRENT_BINARY_DIR}/library_constructor.c)
|
||||||
SET (LC_RELATIVE_PREFIX "..")
|
SET (LC_RELATIVE_PREFIX "..")
|
||||||
|
|
|
@ -78,10 +78,6 @@ namespace LAview.Core {
|
||||||
* Request Answer Value.
|
* Request Answer Value.
|
||||||
*/
|
*/
|
||||||
public abstract class AnswerValue : Object {
|
public abstract class AnswerValue : Object {
|
||||||
/**
|
|
||||||
* Constructs a new ``AnswerValue``.
|
|
||||||
*/
|
|
||||||
public AnswerValue () { }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -434,7 +434,9 @@ namespace LAview.Core {
|
||||||
}
|
}
|
||||||
switch (table.get_type().name()) {
|
switch (table.get_type().name()) {
|
||||||
case "LAviewTableTabular":
|
case "LAviewTableTabular":
|
||||||
if (subtable_has_addcols ((table as Table.Tabular).table, col_index)) return true;
|
var t = table as Table.Tabular;
|
||||||
|
assert (t != null);
|
||||||
|
if (subtable_has_addcols (t.table, col_index)) return true;
|
||||||
break;
|
break;
|
||||||
case "LAviewTableLongtable":
|
case "LAviewTableLongtable":
|
||||||
var longtable = table as Table.Longtable;
|
var longtable = table as Table.Longtable;
|
||||||
|
@ -503,7 +505,9 @@ namespace LAview.Core {
|
||||||
try {
|
try {
|
||||||
var regex = new Regex ("{\\[}[^][}{]*{\\]}");
|
var regex = new Regex ("{\\[}[^][}{]*{\\]}");
|
||||||
MatchInfo match_info;
|
MatchInfo match_info;
|
||||||
regex.match ((subdoc as Text).text, 0, out match_info);
|
var text = subdoc as Text;
|
||||||
|
assert (text != null);
|
||||||
|
regex.match (text.text, 0, out match_info);
|
||||||
while (match_info.matches ()) {
|
while (match_info.matches ()) {
|
||||||
string object_suffix, object_cmd;
|
string object_suffix, object_cmd;
|
||||||
var word = match_info.fetch (0);
|
var word = match_info.fetch (0);
|
||||||
|
@ -512,14 +516,18 @@ namespace LAview.Core {
|
||||||
if (plugin == null) { match_info.next(); continue; }
|
if (plugin == null) { match_info.next(); continue; }
|
||||||
var req = requests[plugin.get_name() + object_suffix][object_cmd];
|
var req = requests[plugin.get_name() + object_suffix][object_cmd];
|
||||||
if (req is AnswerArray1D) {
|
if (req is AnswerArray1D) {
|
||||||
|
var arr = req as AnswerArray1D;
|
||||||
|
assert (arr != null);
|
||||||
if (rowsvv_b[t,i] && ! colsv_b[j])
|
if (rowsvv_b[t,i] && ! colsv_b[j])
|
||||||
resize_info.rowsvv[t,i] = int.max(resize_info.rowsvv[t,i], (req as AnswerArray1D).value.length);
|
resize_info.rowsvv[t,i] = int.max(resize_info.rowsvv[t,i], arr.value.length);
|
||||||
else if (colsv_b[j] && !rowsvv_b[t,i])
|
else if (colsv_b[j] && !rowsvv_b[t,i])
|
||||||
resize_info.colsv[j] = int.max(resize_info.colsv[j], (req as AnswerArray1D).value.length);
|
resize_info.colsv[j] = int.max(resize_info.colsv[j], arr.value.length);
|
||||||
} else if (req is AnswerArray2D) {
|
} else if (req is AnswerArray2D) {
|
||||||
|
var arr = req as AnswerArray2D;
|
||||||
|
assert (arr != null);
|
||||||
if (colsv_b[j] && rowsvv_b[t,i]) {
|
if (colsv_b[j] && rowsvv_b[t,i]) {
|
||||||
resize_info.rowsvv[t,i] = int.max(resize_info.rowsvv[t,i], (req as AnswerArray2D).value.length[0]);
|
resize_info.rowsvv[t,i] = int.max(resize_info.rowsvv[t,i], arr.value.length[0]);
|
||||||
resize_info.colsv[j] = int.max(resize_info.colsv[j], (req as AnswerArray2D).value.length[1]);
|
resize_info.colsv[j] = int.max(resize_info.colsv[j], arr.value.length[1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
match_info.next();
|
match_info.next();
|
||||||
|
@ -637,7 +645,9 @@ namespace LAview.Core {
|
||||||
var tabular = doc as Table.Tabular;
|
var tabular = doc as Table.Tabular;
|
||||||
var resize_info_new = new ResizeInfo();
|
var resize_info_new = new ResizeInfo();
|
||||||
if (stage == Stage.FILL) resize_table (tabular, resize_info_new);
|
if (stage == Stage.FILL) resize_table (tabular, resize_info_new);
|
||||||
doc_stack.push_tail ((doc as Table.Tabular).table);
|
var table = doc as Table.Tabular;
|
||||||
|
assert (table != null);
|
||||||
|
doc_stack.push_tail (table.table);
|
||||||
recursive_walk (doc_stack, requests, stage, resize_info_new);
|
recursive_walk (doc_stack, requests, stage, resize_info_new);
|
||||||
doc_stack.pop_tail ();
|
doc_stack.pop_tail ();
|
||||||
if (stage == Stage.FILL && stack_len > 1)
|
if (stage == Stage.FILL && stack_len > 1)
|
||||||
|
@ -666,7 +676,9 @@ namespace LAview.Core {
|
||||||
ret = split_table (doc_stack.peek_nth (stack_len - 2) as Glob, longtable, resize_info_new);
|
ret = split_table (doc_stack.peek_nth (stack_len - 2) as Glob, longtable, resize_info_new);
|
||||||
break;
|
break;
|
||||||
case "LAviewTableSubtable":
|
case "LAviewTableSubtable":
|
||||||
doc_stack.push_tail ((doc as Table.Subtable).caption);
|
var table = doc as Table.Subtable;
|
||||||
|
assert (table != null);
|
||||||
|
doc_stack.push_tail (table.caption);
|
||||||
recursive_walk (doc_stack, requests, stage, resize_info);
|
recursive_walk (doc_stack, requests, stage, resize_info);
|
||||||
doc_stack.pop_tail ();
|
doc_stack.pop_tail ();
|
||||||
foreach (var subdoc in doc as Table.Subtable) {
|
foreach (var subdoc in doc as Table.Subtable) {
|
||||||
|
@ -676,15 +688,19 @@ namespace LAview.Core {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "LAviewTableCell":
|
case "LAviewTableCell":
|
||||||
doc_stack.push_tail ((doc as Table.Cell).contents);
|
var cell = doc as Table.Cell;
|
||||||
|
assert (cell != null);
|
||||||
|
doc_stack.push_tail (cell.contents);
|
||||||
recursive_walk (doc_stack, requests, stage, resize_info);
|
recursive_walk (doc_stack, requests, stage, resize_info);
|
||||||
doc_stack.pop_tail ();
|
doc_stack.pop_tail ();
|
||||||
break;
|
break;
|
||||||
case "LAviewGraphics":
|
case "LAviewGraphics":
|
||||||
var path = (doc as Graphics).path;
|
var graphics = doc as Graphics;
|
||||||
string object_suffix, object_cmd;
|
assert (graphics != null);
|
||||||
var plugin = find_plugin (path, out object_suffix, out object_cmd);
|
var path = graphics.path;
|
||||||
if (plugin == null) break;
|
string object_suffix, object_cmd;
|
||||||
|
var plugin = find_plugin (path, out object_suffix, out object_cmd);
|
||||||
|
if (plugin == null) break;
|
||||||
switch (stage) {
|
switch (stage) {
|
||||||
case Stage.ANALYSE:
|
case Stage.ANALYSE:
|
||||||
if (!requests.has_key(plugin.get_name() + object_suffix))
|
if (!requests.has_key(plugin.get_name() + object_suffix))
|
||||||
|
@ -692,8 +708,9 @@ namespace LAview.Core {
|
||||||
requests[plugin.get_name() + object_suffix][object_cmd] = new AnswerString();
|
requests[plugin.get_name() + object_suffix][object_cmd] = new AnswerString();
|
||||||
break;
|
break;
|
||||||
case Stage.FILL:
|
case Stage.FILL:
|
||||||
(doc as Graphics).path =
|
var answer = requests[plugin.get_name() + object_suffix][object_cmd] as AnswerString;
|
||||||
(requests[plugin.get_name() + object_suffix][object_cmd] as AnswerString).value;
|
assert (answer != null);
|
||||||
|
graphics.path = answer.value;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -703,8 +720,10 @@ namespace LAview.Core {
|
||||||
/* Replace requests with answers */
|
/* Replace requests with answers */
|
||||||
var regex = new Regex ("{\\[}[^][}{]*{\\]}");
|
var regex = new Regex ("{\\[}[^][}{]*{\\]}");
|
||||||
MatchInfo match_info;
|
MatchInfo match_info;
|
||||||
regex.match ((doc as Text).text, 0, out match_info);
|
var text = doc as Text;
|
||||||
var out_text = (doc as Text).text;
|
assert (text != null);
|
||||||
|
regex.match (text.text, 0, out match_info);
|
||||||
|
var out_text = text.text;
|
||||||
|
|
||||||
while (match_info.matches ()) {
|
while (match_info.matches ()) {
|
||||||
var word = match_info.fetch (0);
|
var word = match_info.fetch (0);
|
||||||
|
@ -765,7 +784,9 @@ namespace LAview.Core {
|
||||||
out_text = _("IdxError");
|
out_text = _("IdxError");
|
||||||
break;
|
break;
|
||||||
default: // Text/String
|
default: // Text/String
|
||||||
out_text = out_text.replace("{[}"+request+"{]}", plain_to_tex((answer as AnswerString).value));
|
var a = answer as AnswerString;
|
||||||
|
assert (a != null);
|
||||||
|
out_text = out_text.replace("{[}"+request+"{]}", plain_to_tex(a.value));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -782,7 +803,9 @@ namespace LAview.Core {
|
||||||
out_text = out_text.replace(word, "");
|
out_text = out_text.replace(word, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
(doc as Text).text = out_text ;
|
var t = doc as Text;
|
||||||
|
assert (t != null);
|
||||||
|
t.text = out_text ;
|
||||||
} catch (RegexError e) {}
|
} catch (RegexError e) {}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -52,8 +52,13 @@ namespace LAview.Core {
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool is_equal_to (ITemplate template) {
|
public bool is_equal_to (ITemplate template) {
|
||||||
if (template is LyxTemplate)
|
if (template is LyxTemplate) {
|
||||||
return (template as LyxTemplate).file.get_path() == file.get_path();
|
var templ = template as LyxTemplate;
|
||||||
|
if (templ != null)
|
||||||
|
return templ.file.get_path() == file.get_path();
|
||||||
|
else
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -77,8 +82,13 @@ namespace LAview.Core {
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool is_equal_to (ITemplate template) {
|
public bool is_equal_to (ITemplate template) {
|
||||||
if (template is TexTemplate)
|
if (template is TexTemplate) {
|
||||||
return (template as TexTemplate).file.get_path() == file.get_path();
|
var templ = template as TexTemplate;
|
||||||
|
if (templ != null)
|
||||||
|
return templ.file.get_path() == file.get_path();
|
||||||
|
else
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue