1
0
mirror of https://github.com/gnosygnu/xowa.git synced 2024-09-28 22:40:50 +00:00

Gui: Remove unused serialization code for history items [#608]

This commit is contained in:
gnosygnu 2019-11-03 19:49:54 -05:00
parent bdb1945d4f
commit dbdc558ed5
3 changed files with 7 additions and 36 deletions

View File

@ -54,7 +54,5 @@ public abstract class Xogv_tab_base {
return new_hpg;
}
@gplx.Virtual protected void Fetch_page__bgn(byte[] wiki_domain, byte[] page_bry, byte[] qarg_bry) {}
public void Srl_save(Bry_bfr bfr) {history_stack.Srl_save(bfr);}
public void Srl_load(byte[] raw) {history_stack.Srl_load(raw);}
public abstract void Show_page(Xog_history_itm old_itm, Xog_history_itm new_itm, Xoh_page new_hpg);
}

View File

@ -35,16 +35,6 @@ public class Xog_history_itm {
&& redirect_force == comp.redirect_force
;
}
public void Srl_save(Bry_bfr bfr) {
byte[] bmk_bry = Bry_.Replace(Bry_.new_u8(bmk_pos), Byte_ascii.Pipe, Byte_ascii.Tilde); // replace | with ~; EX: "0|1|2" -> "0~1~2"
bfr.Add(key).Add_byte_pipe().Add(bmk_bry).Add_byte_nl();
}
public static Xog_history_itm Srl_load(byte[] raw) {
byte[][] atrs = Bry_split_.Split(raw, Byte_ascii.Pipe);
byte[] bmk_bry = atrs.length == 6 ? atrs[5] : Bry_.Empty;
bmk_bry = Bry_.Replace(bmk_bry, Byte_ascii.Tilde, Byte_ascii.Pipe);
return new Xog_history_itm(atrs[0], atrs[1], atrs[2], atrs[3], atrs[4] == Bool_.Y_bry, String_.new_a7(bmk_bry));
}
public static final String Html_doc_pos_toc = "top";
public static final Xog_history_itm Null = new Xog_history_itm(null, null, null, null, false, null);
}

View File

@ -46,23 +46,6 @@ public class Xog_history_stack {
if (from <= len - 1)
list.Del_range(from, len - 1);
}
public void Srl_save(Bry_bfr bfr) {
int len = list.Count();
for (int i = 0; i < len; ++i) {
Xog_history_itm itm = (Xog_history_itm)list.Get_at(i);
itm.Srl_save(bfr);
}
}
public void Srl_load(byte[] bry) {
list.Clear();
byte[][] lines = Bry_split_.Split_lines(bry);
int len = lines.length;
for (int i = 0; i < len; ++i) {
byte[] line = lines[i];
Xog_history_itm itm = Xog_history_itm.Srl_load(line);
this.Add(itm);
}
}
public void Cur_pos_(int v) {this.cur_pos = v;}
public static final byte Nav_fwd = 1, Nav_bwd = 2, Nav_by_anchor = 3;
}