684 lines
70 KiB
Plaintext
684 lines
70 KiB
Plaintext
|
<!DOCTYPE html>
|
||
|
<html lang="en">
|
||
|
<head>
|
||
|
<meta charset="UTF-8">
|
||
|
<meta name="generator" content="TempleOS V5.03">
|
||
|
<meta name="viewport" content="width=device-width">
|
||
|
<link rel="stylesheet" href="/style/templeos.css">
|
||
|
<script src="/script/templeos.js"></script>
|
||
|
<style type="text/css">
|
||
|
.cF0{color:#000000;background-color:#ffffff;}
|
||
|
.cF1{color:#0000aa;background-color:#ffffff;}
|
||
|
.cF2{color:#00aa00;background-color:#ffffff;}
|
||
|
.cF3{color:#00aaaa;background-color:#ffffff;}
|
||
|
.cF4{color:#aa0000;background-color:#ffffff;}
|
||
|
.cF5{color:#aa00aa;background-color:#ffffff;}
|
||
|
.cF6{color:#aa5500;background-color:#ffffff;}
|
||
|
.cF7{color:#aaaaaa;background-color:#ffffff;}
|
||
|
.cF8{color:#555555;background-color:#ffffff;}
|
||
|
.cF9{color:#5555ff;background-color:#ffffff;}
|
||
|
.cFA{color:#55ff55;background-color:#ffffff;}
|
||
|
.cFB{color:#55ffff;background-color:#ffffff;}
|
||
|
.cFC{color:#ff5555;background-color:#ffffff;}
|
||
|
.cFD{color:#ff55ff;background-color:#ffffff;}
|
||
|
.cFE{color:#ffff55;background-color:#ffffff;}
|
||
|
.cFF{color:#ffffff;background-color:#ffffff;}
|
||
|
</style>
|
||
|
</head>
|
||
|
<body>
|
||
|
<pre id="content">
|
||
|
<a name="l1"></a><span class=cF0>#</span><span class=cF1>help_index</span><span class=cF0> </span><span class=cF6>"DolDoc/Editor"</span><span class=cF0>
|
||
|
<a name="l2"></a>
|
||
|
<a name="l3"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF9>I64</span><span class=cF0> </span><span class=cF5>EdCurU8</span><span class=cF0>(</span><span class=cF9>CDoc</span><span class=cF0> *doc)
|
||
|
<a name="l4"></a>{</span><span class=cF2>//Return cur U8. See </span><a href="/Wb/Adam/DolDoc/DocCodeTools.HC.HTML#l387"><span class=cF4>EdRenumAsm</span></a><span class=cF2> for an example.</span><span class=cF0>
|
||
|
<a name="l5"></a> </span><span class=cF1>Bool</span><span class=cF0> unlock=</span><span class=cF5>DocLock</span><span class=cF0>(doc);
|
||
|
<a name="l6"></a> </span><span class=cF9>CDocEntry</span><span class=cF0> *doc_ce=doc->cur_entry;
|
||
|
<a name="l7"></a> </span><span class=cF9>I64</span><span class=cF0> res=-1;
|
||
|
<a name="l8"></a> </span><span class=cF1>if</span><span class=cF0> (doc_ce->type_u8==</span><span class=cF3>DOCT_TEXT</span><span class=cF0> &&
|
||
|
<a name="l9"></a> doc_ce->min_col<=doc->cur_col<doc_ce->max_col)
|
||
|
<a name="l10"></a> res=doc_ce->tag[doc->cur_col];
|
||
|
<a name="l11"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (doc_ce->type_u8==</span><span class=cF3>DOCT_TAB</span><span class=cF0>)
|
||
|
<a name="l12"></a> res=</span><span class=cF6>'\t'</span><span class=cF0>;
|
||
|
<a name="l13"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (doc_ce->type_u8==</span><span class=cF3>DOCT_NEW_LINE</span><span class=cF0> ||
|
||
|
<a name="l14"></a> doc_ce->type_u8==</span><span class=cF3>DOCT_SOFT_NEW_LINE</span><span class=cF0>)
|
||
|
<a name="l15"></a> res=</span><span class=cF6>'\n'</span><span class=cF0>;
|
||
|
<a name="l16"></a> </span><span class=cF1>if</span><span class=cF0> (unlock)
|
||
|
<a name="l17"></a> </span><span class=cF5>DocUnlock</span><span class=cF0>(doc);
|
||
|
<a name="l18"></a> </span><span class=cF1>return</span><span class=cF0> res;
|
||
|
<a name="l19"></a>}
|
||
|
<a name="l20"></a>
|
||
|
<a name="l21"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>EdCursorLeft</span><span class=cF0>(</span><span class=cF9>CDoc</span><span class=cF0> *doc,</span><span class=cF9>I64</span><span class=cF0> sc=</span><span class=cF3>I64_MIN</span><span class=cF0>)
|
||
|
<a name="l22"></a>{</span><span class=cF2>//Move cursor left. Might need a call to </span><a href="/Wb/Adam/DolDoc/DocRecalc.HC.HTML#l256"><span class=cF4>DocRecalc</span></a><span class=cF2>().</span><span class=cF0>
|
||
|
<a name="l23"></a></span><span class=cF2>//See </span><a href="/Wb/Adam/DolDoc/DocCodeTools.HC.HTML#l387"><span class=cF4>EdRenumAsm</span></a><span class=cF2> for an example.</span><span class=cF0>
|
||
|
<a name="l24"></a> </span><span class=cF1>U8</span><span class=cF0> *dst;
|
||
|
<a name="l25"></a> </span><span class=cF1>Bool</span><span class=cF0> unlock=</span><span class=cF5>DocLock</span><span class=cF0>(doc);
|
||
|
<a name="l26"></a> </span><span class=cF9>CDocEntry</span><span class=cF0> *doc_ce=doc->cur_entry,*original_ce=doc_ce,*doc_ne;
|
||
|
<a name="l27"></a> </span><span class=cF9>I64</span><span class=cF0> cc=doc->cur_col,y=doc_ce->y;
|
||
|
<a name="l28"></a> </span><span class=cF1>if</span><span class=cF0> (sc!=</span><span class=cF3>I64_MIN</span><span class=cF0>) sc=sc.u32[0];
|
||
|
<a name="l29"></a> </span><span class=cF1>if</span><span class=cF0> (sc>=0 && sc&</span><span class=cF3>SCF_CTRL</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l30"></a> </span><span class=cF1>while</span><span class=cF0> (doc_ce->last!=doc && </span><span class=cF7>(</span><span class=cF0>doc_ce->last->y==y ||
|
||
|
<a name="l31"></a> doc_ce->de_flags & (</span><span class=cF3>DOCEF_SKIP</span><span class=cF0>|</span><span class=cF3>DOCEF_FILTER_SKIP</span><span class=cF0>)</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l32"></a> doc_ce=doc_ce->last; </span><span class=cF2>//TODO: sel? recurse?</span><span class=cF0>
|
||
|
<a name="l33"></a> cc=doc_ce->min_col;
|
||
|
<a name="l34"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l35"></a> </span><span class=cF1>if</span><span class=cF0> (cc>doc_ce->min_col) {
|
||
|
<a name="l36"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>IsEditableText</span><span class=cF7>(</span><span class=cF0>doc_ce</span><span class=cF7>)</span><span class=cF0> && cc<doc_ce->max_col) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l37"></a> dst=doc_ce->tag+cc;
|
||
|
<a name="l38"></a> doc_ne=</span><span class=cF5>DocEntryNewTag</span><span class=cF0>(doc,doc_ce,dst);
|
||
|
<a name="l39"></a> *dst=0;
|
||
|
<a name="l40"></a> doc_ce->max_col=cc;
|
||
|
<a name="l41"></a> </span><span class=cF5>QueIns</span><span class=cF0>(doc_ne,doc_ce);
|
||
|
<a name="l42"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l43"></a> cc--;
|
||
|
<a name="l44"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>IsEditableText</span><span class=cF7>(</span><span class=cF0>doc_ce</span><span class=cF7>)</span><span class=cF0> && cc>doc_ce->min_col) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l45"></a> dst=doc_ce->tag+cc;
|
||
|
<a name="l46"></a> doc_ne=</span><span class=cF5>DocEntryNewTag</span><span class=cF0>(doc,doc_ce,dst);
|
||
|
<a name="l47"></a> *dst=0;
|
||
|
<a name="l48"></a> doc_ce->max_col=cc;
|
||
|
<a name="l49"></a> </span><span class=cF5>QueIns</span><span class=cF0>(doc_ne,doc_ce);
|
||
|
<a name="l50"></a> doc_ce=doc_ne;
|
||
|
<a name="l51"></a> cc=doc_ce->min_col;
|
||
|
<a name="l52"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l53"></a> </span><span class=cF1>if</span><span class=cF0> (sc>=0)
|
||
|
<a name="l54"></a> </span><span class=cF5>BEqu</span><span class=cF0>(&doc_ce->type,</span><span class=cF3>DOCEt_SEL</span><span class=cF0>,sc&</span><span class=cF3>SCF_SHIFT</span><span class=cF0>);
|
||
|
<a name="l55"></a> } </span><span class=cF1>else</span><span class=cF0> {
|
||
|
<a name="l56"></a> cc=doc_ce->min_col;
|
||
|
<a name="l57"></a> </span><span class=cF1>while</span><span class=cF0> (doc_ce->last!=doc &&
|
||
|
<a name="l58"></a> </span><span class=cF7>(</span><span class=cF0>doc_ce->last->type_u8==</span><span class=cF3>DOCT_SOFT_NEW_LINE</span><span class=cF0> ||
|
||
|
<a name="l59"></a> doc_ce->last->type_u8==</span><span class=cF3>DOCT_INDENT</span><span class=cF0> ||
|
||
|
<a name="l60"></a> doc_ce->last->de_flags&(</span><span class=cF3>DOCEF_SKIP</span><span class=cF0>|</span><span class=cF3>DOCEF_FILTER_SKIP</span><span class=cF0>)</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l61"></a> doc_ce=doc_ce->last;
|
||
|
<a name="l62"></a> </span><span class=cF1>if</span><span class=cF0> (sc>=0)
|
||
|
<a name="l63"></a> </span><span class=cF5>BEqu</span><span class=cF0>(&doc_ce->type,</span><span class=cF3>DOCEt_SEL</span><span class=cF0>,sc&</span><span class=cF3>SCF_SHIFT</span><span class=cF0>);
|
||
|
<a name="l64"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l65"></a> </span><span class=cF1>if</span><span class=cF0> (doc_ce->last!=doc) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l66"></a> doc_ce=doc_ce->last;
|
||
|
<a name="l67"></a> </span><span class=cF1>if</span><span class=cF0> (doc_ce->max_col>doc_ce->min_col) {
|
||
|
<a name="l68"></a> cc=doc_ce->max_col-1;
|
||
|
<a name="l69"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>IsEditableText</span><span class=cF7>(</span><span class=cF0>doc_ce</span><span class=cF7>)</span><span class=cF0> && cc>doc_ce->min_col) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l70"></a> dst=doc_ce->tag+cc;
|
||
|
<a name="l71"></a> doc_ne=</span><span class=cF5>DocEntryNewTag</span><span class=cF0>(doc,doc_ce,dst);
|
||
|
<a name="l72"></a> *dst=0;
|
||
|
<a name="l73"></a> doc_ce->max_col=cc;
|
||
|
<a name="l74"></a> </span><span class=cF5>QueIns</span><span class=cF0>(doc_ne,doc_ce);
|
||
|
<a name="l75"></a> doc_ce=doc_ne;
|
||
|
<a name="l76"></a> cc=doc_ce->min_col;
|
||
|
<a name="l77"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l78"></a> } </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l79"></a> cc=doc_ce->max_col;
|
||
|
<a name="l80"></a> </span><span class=cF1>if</span><span class=cF0> (sc>=0)
|
||
|
<a name="l81"></a> </span><span class=cF5>BEqu</span><span class=cF0>(&doc_ce->type,</span><span class=cF3>DOCEt_SEL</span><span class=cF0>,sc&</span><span class=cF3>SCF_SHIFT</span><span class=cF0>);
|
||
|
<a name="l82"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l83"></a> }
|
||
|
<a name="l84"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l85"></a> doc->cur_col=cc;
|
||
|
<a name="l86"></a> doc->cur_entry=doc_ce;
|
||
|
<a name="l87"></a> </span><span class=cF1>if</span><span class=cF0> (doc_ce!=original_ce)
|
||
|
<a name="l88"></a> </span><span class=cF5>DocFormBwd</span><span class=cF0>(doc);
|
||
|
<a name="l89"></a> </span><span class=cF1>if</span><span class=cF0> (unlock)
|
||
|
<a name="l90"></a> </span><span class=cF5>DocUnlock</span><span class=cF0>(doc);
|
||
|
<a name="l91"></a>}
|
||
|
<a name="l92"></a>
|
||
|
<a name="l93"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>EdCursorRight</span><span class=cF0>(</span><span class=cF9>CDoc</span><span class=cF0> *doc,</span><span class=cF9>I64</span><span class=cF0> sc=</span><span class=cF3>I64_MIN</span><span class=cF0>)
|
||
|
<a name="l94"></a>{</span><span class=cF2>//Move cursor right. Might need a call to </span><a href="/Wb/Adam/DolDoc/DocRecalc.HC.HTML#l256"><span class=cF4>DocRecalc</span></a><span class=cF2>().</span><span class=cF0>
|
||
|
<a name="l95"></a></span><span class=cF2>//See </span><a href="/Wb/Adam/DolDoc/DocCodeTools.HC.HTML#l387"><span class=cF4>EdRenumAsm</span></a><span class=cF2> for an example.</span><span class=cF0>
|
||
|
<a name="l96"></a> </span><span class=cF1>Bool</span><span class=cF0> unlock=</span><span class=cF5>DocLock</span><span class=cF0>(doc);
|
||
|
<a name="l97"></a> </span><span class=cF1>U8</span><span class=cF0> *dst;
|
||
|
<a name="l98"></a> </span><span class=cF9>CDocEntry</span><span class=cF0> *doc_ce=doc->cur_entry,*original_ce=doc_ce,*doc_ne;
|
||
|
<a name="l99"></a> </span><span class=cF9>I64</span><span class=cF0> cc=doc->cur_col,y=doc_ce->y,old_de_flags,old_color;
|
||
|
<a name="l100"></a> </span><span class=cF1>if</span><span class=cF0> (sc!=</span><span class=cF3>I64_MIN</span><span class=cF0>) sc=sc.u32[0];
|
||
|
<a name="l101"></a> </span><span class=cF1>if</span><span class=cF0> (sc>=0 && sc&</span><span class=cF3>SCF_CTRL</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l102"></a> </span><span class=cF1>while</span><span class=cF0> (doc_ce!=doc && doc_ce->next->y==y &&
|
||
|
<a name="l103"></a> doc_ce->next->type_u8!=</span><span class=cF3>DOCT_SOFT_NEW_LINE</span><span class=cF0> && doc_ce->next!=doc &&
|
||
|
<a name="l104"></a> </span><span class=cF7>(</span><span class=cF0>doc_ce->next->type_u8!=</span><span class=cF3>DOCT_NEW_LINE</span><span class=cF0> || !(doc->flags & </span><span class=cF3>DOCF_FORM</span><span class=cF0>)</span><span class=cF7>)</span><span class=cF0> ||
|
||
|
<a name="l105"></a> doc_ce->de_flags & </span><span class=cF7>(</span><span class=cF3>DOCEF_SKIP</span><span class=cF0>|</span><span class=cF3>DOCEF_FILTER_SKIP</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l106"></a> doc_ce=doc_ce->next;
|
||
|
<a name="l107"></a> </span><span class=cF1>if</span><span class=cF0> (doc_ce->max_col>doc_ce->min_col)
|
||
|
<a name="l108"></a> cc=doc_ce->max_col-1;
|
||
|
<a name="l109"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l110"></a> cc=doc_ce->min_col;
|
||
|
<a name="l111"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l112"></a> </span><span class=cF1>if</span><span class=cF0> (cc<doc_ce->max_col) {
|
||
|
<a name="l113"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>IsEditableText</span><span class=cF7>(</span><span class=cF0>doc_ce</span><span class=cF7>)</span><span class=cF0> && cc>doc_ce->min_col) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l114"></a> dst=doc_ce->tag+cc;
|
||
|
<a name="l115"></a> doc_ne=</span><span class=cF5>DocEntryNewTag</span><span class=cF0>(doc,doc_ce,dst);
|
||
|
<a name="l116"></a> *dst=0;
|
||
|
<a name="l117"></a> doc_ce->max_col=cc;
|
||
|
<a name="l118"></a> </span><span class=cF5>QueIns</span><span class=cF0>(doc_ne,doc_ce);
|
||
|
<a name="l119"></a> doc_ce=doc_ne;
|
||
|
<a name="l120"></a> cc=doc_ce->min_col;
|
||
|
<a name="l121"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l122"></a> cc++;
|
||
|
<a name="l123"></a> old_de_flags=doc_ce->de_flags;
|
||
|
<a name="l124"></a> old_color=doc_ce->type;
|
||
|
<a name="l125"></a> </span><span class=cF1>if</span><span class=cF0> (sc>=0)
|
||
|
<a name="l126"></a> </span><span class=cF5>BEqu</span><span class=cF0>(&doc_ce->type,</span><span class=cF3>DOCEt_SEL</span><span class=cF0>,sc&</span><span class=cF3>SCF_SHIFT</span><span class=cF0>);
|
||
|
<a name="l127"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>IsEditableText</span><span class=cF7>(</span><span class=cF0>doc_ce</span><span class=cF7>)</span><span class=cF0> && cc<doc_ce->max_col) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l128"></a> dst=doc_ce->tag+cc;
|
||
|
<a name="l129"></a> doc_ne=</span><span class=cF5>DocEntryNewTag</span><span class=cF0>(doc,doc_ce,dst);
|
||
|
<a name="l130"></a> *dst=0;
|
||
|
<a name="l131"></a> doc_ne->type=</span><span class=cF3>DOCT_TEXT</span><span class=cF0> | old_color & -0x100;
|
||
|
<a name="l132"></a> doc_ne->de_flags=old_de_flags|</span><span class=cFB>doldoc</span><span class=cF0>.dft_de_flags[</span><span class=cF3>DOCT_TEXT</span><span class=cF0>];
|
||
|
<a name="l133"></a> doc_ce->max_col=cc;
|
||
|
<a name="l134"></a> </span><span class=cF5>QueIns</span><span class=cF0>(doc_ne,doc_ce);
|
||
|
<a name="l135"></a> doc_ce=doc_ne;
|
||
|
<a name="l136"></a> cc=doc_ce->min_col;
|
||
|
<a name="l137"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (cc>=doc_ce->max_col) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l138"></a> doc_ce=doc_ce->next;
|
||
|
<a name="l139"></a> cc=doc_ce->min_col;
|
||
|
<a name="l140"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l141"></a> } </span><span class=cF1>else</span><span class=cF0> {
|
||
|
<a name="l142"></a> </span><span class=cF1>if</span><span class=cF0> (doc_ce!=doc) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l143"></a> </span><span class=cF1>if</span><span class=cF0> (cc<=doc_ce->min_col && sc>=0)
|
||
|
<a name="l144"></a> </span><span class=cF5>BEqu</span><span class=cF0>(&doc_ce->type,</span><span class=cF3>DOCEt_SEL</span><span class=cF0>,sc&</span><span class=cF3>SCF_SHIFT</span><span class=cF0>);
|
||
|
<a name="l145"></a> doc_ce=doc_ce->next;
|
||
|
<a name="l146"></a> </span><span class=cF1>while</span><span class=cF0> (doc_ce!=doc && doc_ce->de_flags&</span><span class=cF7>(</span><span class=cF3>DOCEF_SKIP</span><span class=cF0>|</span><span class=cF3>DOCEF_FILTER_SKIP</span><span class=cF7>)</span><span class=cF0>) {
|
||
|
<a name="l147"></a> </span><span class=cF1>if</span><span class=cF0> (sc>=0)
|
||
|
<a name="l148"></a> </span><span class=cF5>BEqu</span><span class=cF0>(&doc_ce->type,</span><span class=cF3>DOCEt_SEL</span><span class=cF0>,sc&</span><span class=cF3>SCF_SHIFT</span><span class=cF0>);
|
||
|
<a name="l149"></a> doc_ce=doc_ce->next;
|
||
|
<a name="l150"></a> }
|
||
|
<a name="l151"></a> cc=doc_ce->min_col;
|
||
|
<a name="l152"></a> </span><span class=cF1>if</span><span class=cF0> (doc_ce->type_u8==</span><span class=cF3>DOCT_SOFT_NEW_LINE</span><span class=cF0>) {
|
||
|
<a name="l153"></a> </span><span class=cF1>if</span><span class=cF0> (sc>=0)
|
||
|
<a name="l154"></a> </span><span class=cF5>BEqu</span><span class=cF0>(&doc_ce->type,</span><span class=cF3>DOCEt_SEL</span><span class=cF0>,sc&</span><span class=cF3>SCF_SHIFT</span><span class=cF0>);
|
||
|
<a name="l155"></a> doc_ce=doc_ce->next;
|
||
|
<a name="l156"></a> cc=doc_ce->min_col;
|
||
|
<a name="l157"></a> }
|
||
|
<a name="l158"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l159"></a> }
|
||
|
<a name="l160"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l161"></a> doc->cur_col=cc;
|
||
|
<a name="l162"></a> doc->cur_entry=doc_ce;
|
||
|
<a name="l163"></a> </span><span class=cF1>if</span><span class=cF0> (doc_ce!=original_ce)
|
||
|
<a name="l164"></a> </span><span class=cF5>DocFormFwd</span><span class=cF0>(doc);
|
||
|
<a name="l165"></a> </span><span class=cF1>if</span><span class=cF0> (unlock)
|
||
|
<a name="l166"></a> </span><span class=cF5>DocUnlock</span><span class=cF0>(doc);
|
||
|
<a name="l167"></a>}
|
||
|
<a name="l168"></a>
|
||
|
<a name="l169"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>EdLineUp</span><span class=cF0>(</span><span class=cF9>CDoc</span><span class=cF0> *doc,</span><span class=cF9>I64</span><span class=cF0> sc=</span><span class=cF3>I64_MIN</span><span class=cF0>)
|
||
|
<a name="l170"></a>{</span><span class=cF2>//Move cursor up. Might need a call to </span><a href="/Wb/Adam/DolDoc/DocRecalc.HC.HTML#l256"><span class=cF4>DocRecalc</span></a><span class=cF2>().</span><span class=cF0>
|
||
|
<a name="l171"></a></span><span class=cF2>//See </span><a href="/Wb/Adam/DolDoc/DocCodeTools.HC.HTML#l387"><span class=cF4>EdRenumAsm</span></a><span class=cF2> for an example.</span><span class=cF0>
|
||
|
<a name="l172"></a> </span><span class=cF1>Bool</span><span class=cF0> unlock=</span><span class=cF5>DocLock</span><span class=cF0>(doc);
|
||
|
<a name="l173"></a> </span><span class=cF1>U8</span><span class=cF0> *dst;
|
||
|
<a name="l174"></a> </span><span class=cF9>I64</span><span class=cF0> y,x;
|
||
|
<a name="l175"></a> </span><span class=cF9>CDocEntry</span><span class=cF0> *doc_ce=doc->cur_entry,*doc_ne;
|
||
|
<a name="l176"></a>
|
||
|
<a name="l177"></a> </span><span class=cF1>if</span><span class=cF0> (sc!=</span><span class=cF3>I64_MIN</span><span class=cF0>) sc=sc.u32[0];
|
||
|
<a name="l178"></a> </span><span class=cF1>if</span><span class=cF0> (doc_ce->type_u8==</span><span class=cF3>DOCT_HEX_ED</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l179"></a> doc->cur_col=doc->cur_col-doc_ce->hex_ed_width*3;
|
||
|
<a name="l180"></a> </span><span class=cF1>if</span><span class=cF0> (doc->cur_col>=0) {
|
||
|
<a name="l181"></a> </span><span class=cF1>if</span><span class=cF0> (unlock)
|
||
|
<a name="l182"></a> </span><span class=cF5>DocUnlock</span><span class=cF0>(doc);
|
||
|
<a name="l183"></a> </span><span class=cF1>return</span><span class=cF0>;
|
||
|
<a name="l184"></a> } </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l185"></a> doc->cur_col=0;
|
||
|
<a name="l186"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l187"></a> x=doc->x; y=doc->y;
|
||
|
<a name="l188"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>IsEditableText</span><span class=cF7>(</span><span class=cF0>doc_ce</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l189"></a> </span><span class=cF1>if</span><span class=cF0> (doc_ce->min_col<doc->cur_col<doc_ce->max_col-1) {
|
||
|
<a name="l190"></a> dst=doc_ce->tag+doc->cur_col;
|
||
|
<a name="l191"></a> doc_ne=</span><span class=cF5>DocEntryNewTag</span><span class=cF0>(doc,doc_ce,dst);
|
||
|
<a name="l192"></a> *dst=0;
|
||
|
<a name="l193"></a> doc_ne->x=doc_ce->x+doc->cur_col;
|
||
|
<a name="l194"></a> doc_ce->max_col=doc->cur_col;
|
||
|
<a name="l195"></a> </span><span class=cF5>QueIns</span><span class=cF0>(doc_ne,doc_ce);
|
||
|
<a name="l196"></a> } </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (doc->cur_col==doc_ce->min_col && doc_ce->last!=doc)
|
||
|
<a name="l197"></a> doc_ce=doc_ce->last;
|
||
|
<a name="l198"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (doc_ce->last!=doc)
|
||
|
<a name="l199"></a> doc_ce=doc_ce->last;
|
||
|
<a name="l200"></a> </span><span class=cF1>if</span><span class=cF0> (sc>=0)
|
||
|
<a name="l201"></a> </span><span class=cF5>BEqu</span><span class=cF0>(&doc_ce->type,</span><span class=cF3>DOCEt_SEL</span><span class=cF0>,sc&</span><span class=cF3>SCF_SHIFT</span><span class=cF0>);
|
||
|
<a name="l202"></a> doc->cur_entry=doc_ce;
|
||
|
<a name="l203"></a> </span><span class=cF5>DocFormBwd</span><span class=cF0>(doc);
|
||
|
<a name="l204"></a> doc_ce=doc->cur_entry;
|
||
|
<a name="l205"></a> </span><span class=cF1>while</span><span class=cF0> (doc_ce->last!=doc && </span><span class=cF7>(</span><span class=cF0>doc_ce->y>=y ||
|
||
|
<a name="l206"></a> doc_ce->de_flags & (</span><span class=cF3>DOCEF_SKIP</span><span class=cF0>|</span><span class=cF3>DOCEF_FILTER_SKIP</span><span class=cF0>)</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l207"></a> doc_ce=doc_ce->last;
|
||
|
<a name="l208"></a> </span><span class=cF1>if</span><span class=cF0> (sc>=0)
|
||
|
<a name="l209"></a> </span><span class=cF5>BEqu</span><span class=cF0>(&doc_ce->type,</span><span class=cF3>DOCEt_SEL</span><span class=cF0>,sc&</span><span class=cF3>SCF_SHIFT</span><span class=cF0>);
|
||
|
<a name="l210"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l211"></a> y=doc_ce->y;
|
||
|
<a name="l212"></a> doc->y=y;
|
||
|
<a name="l213"></a> </span><span class=cF1>while</span><span class=cF0> (doc_ce!=doc && </span><span class=cF7>(</span><span class=cF0>doc_ce->y>=y && doc_ce->x>=x ||
|
||
|
<a name="l214"></a> doc_ce->de_flags & (</span><span class=cF3>DOCEF_SKIP</span><span class=cF0>|</span><span class=cF3>DOCEF_FILTER_SKIP</span><span class=cF0>)</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l215"></a> </span><span class=cF1>if</span><span class=cF0> (sc>=0)
|
||
|
<a name="l216"></a> </span><span class=cF5>BEqu</span><span class=cF0>(&doc_ce->type,</span><span class=cF3>DOCEt_SEL</span><span class=cF0>,sc&</span><span class=cF3>SCF_SHIFT</span><span class=cF0>);
|
||
|
<a name="l217"></a> doc_ce=doc_ce->last;
|
||
|
<a name="l218"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l219"></a>
|
||
|
<a name="l220"></a> </span><span class=cF1>if</span><span class=cF0> (doc_ce==doc || doc_ce->y<y)
|
||
|
<a name="l221"></a> doc_ce=doc_ce->next;
|
||
|
<a name="l222"></a> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l223"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>IsEditableText</span><span class=cF7>(</span><span class=cF0>doc_ce</span><span class=cF7>)</span><span class=cF0>) {
|
||
|
<a name="l224"></a> </span><span class=cF1>if</span><span class=cF0> (sc>=0)
|
||
|
<a name="l225"></a> </span><span class=cF5>BEqu</span><span class=cF0>(&doc_ce->type,</span><span class=cF3>DOCEt_SEL</span><span class=cF0>,sc&</span><span class=cF3>SCF_SHIFT</span><span class=cF0>);
|
||
|
<a name="l226"></a> } </span><span class=cF1>else</span><span class=cF0> {
|
||
|
<a name="l227"></a> </span><span class=cF1>if</span><span class=cF0> (doc_ce->next->x==x) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l228"></a> doc_ce=doc_ce->next;
|
||
|
<a name="l229"></a> </span><span class=cF1>if</span><span class=cF0> (doc->flags & </span><span class=cF3>DOCF_FORM</span><span class=cF0>)
|
||
|
<a name="l230"></a> </span><span class=cF1>while</span><span class=cF0> (doc_ce->next->x==x &&
|
||
|
<a name="l231"></a> </span><span class=cF7>(</span><span class=cF0>!</span><span class=cF5>Bt</span><span class=cF0>(</span><span class=cFB>doldoc</span><span class=cF0>.type_flags_form,doc_ce->type_u8) &&
|
||
|
<a name="l232"></a> !(doc_ce->de_flags&</span><span class=cF3>DOCEF_LINK</span><span class=cF0>)||
|
||
|
<a name="l233"></a> doc_ce->de_flags&</span><span class=cF3>DOCEF_SKIP_IN_FORM</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l234"></a> doc_ce=doc_ce->next;
|
||
|
<a name="l235"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l236"></a> }
|
||
|
<a name="l237"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l238"></a> </span><span class=cF1>if</span><span class=cF0> (doc_ce->de_flags&</span><span class=cF3>DOCEF_TAG</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l239"></a> doc->cur_col=x-doc_ce->x;
|
||
|
<a name="l240"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>IsEditableText</span><span class=cF7>(</span><span class=cF0>doc_ce</span><span class=cF7>)</span><span class=cF0>) {
|
||
|
<a name="l241"></a> </span><span class=cF1>if</span><span class=cF0> (doc->cur_col>doc_ce->max_col)
|
||
|
<a name="l242"></a> doc->cur_col=doc_ce->max_col;
|
||
|
<a name="l243"></a> } </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (doc->cur_col>=doc_ce->max_col)
|
||
|
<a name="l244"></a> doc->cur_col=doc_ce->max_col-1;
|
||
|
<a name="l245"></a> </span><span class=cF1>if</span><span class=cF0> (doc->cur_col<doc_ce->min_col)
|
||
|
<a name="l246"></a> doc->cur_col=doc_ce->min_col;
|
||
|
<a name="l247"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l248"></a> </span><span class=cF1>if</span><span class=cF0> (doc_ce->type_u8==</span><span class=cF3>DOCT_HEX_ED</span><span class=cF0>) {
|
||
|
<a name="l249"></a> doc->cur_col=</span><span class=cF5>RoundI64</span><span class=cF0>(</span><span class=cF7>(</span><span class=cF0>doc_ce->len-1</span><span class=cF7>)</span><span class=cF0>*3,doc_ce->hex_ed_width*3);
|
||
|
<a name="l250"></a> </span><span class=cF1>if</span><span class=cF0> (doc->cur_col<0)
|
||
|
<a name="l251"></a> doc->cur_col=0;
|
||
|
<a name="l252"></a> } </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l253"></a> doc->cur_col=doc_ce->min_col;
|
||
|
<a name="l254"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l255"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>IsEditableText</span><span class=cF7>(</span><span class=cF0>doc_ce</span><span class=cF7>)</span><span class=cF0> && doc_ce->x<x) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l256"></a> </span><span class=cF1>if</span><span class=cF0> (doc->cur_col<doc_ce->max_col-1) {
|
||
|
<a name="l257"></a> dst=doc_ce->tag+doc->cur_col;
|
||
|
<a name="l258"></a> doc_ne=</span><span class=cF5>DocEntryNewTag</span><span class=cF0>(doc,doc_ce,dst);
|
||
|
<a name="l259"></a> *dst=0;
|
||
|
<a name="l260"></a> </span><span class=cF1>if</span><span class=cF0> (sc>=0) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l261"></a> </span><span class=cF1>if</span><span class=cF0> (sc&</span><span class=cF3>SCF_SHIFT</span><span class=cF0>)
|
||
|
<a name="l262"></a> doc_ne->type=doc_ce->type | </span><span class=cF3>DOCET_SEL</span><span class=cF0>;
|
||
|
<a name="l263"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l264"></a> doc_ne->type=doc_ce->type & ~</span><span class=cF3>DOCET_SEL</span><span class=cF0>;
|
||
|
<a name="l265"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l266"></a> doc_ne->x=doc_ce->x+doc->cur_col;
|
||
|
<a name="l267"></a> doc_ce->max_col=doc->cur_col;
|
||
|
<a name="l268"></a> </span><span class=cF5>QueIns</span><span class=cF0>(doc_ne,doc_ce);
|
||
|
<a name="l269"></a> doc_ce=doc_ne;
|
||
|
<a name="l270"></a> doc->cur_col=doc_ce->min_col;
|
||
|
<a name="l271"></a> }
|
||
|
<a name="l272"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l273"></a> doc->cur_entry=doc_ce;
|
||
|
<a name="l274"></a> </span><span class=cF5>DocFormFwd</span><span class=cF0>(doc);
|
||
|
<a name="l275"></a> doc->x=doc->cur_entry->x+doc->cur_col;
|
||
|
<a name="l276"></a> </span><span class=cF1>if</span><span class=cF0> (unlock)
|
||
|
<a name="l277"></a> </span><span class=cF5>DocUnlock</span><span class=cF0>(doc);
|
||
|
<a name="l278"></a>}
|
||
|
<a name="l279"></a>
|
||
|
<a name="l280"></a></span><span class=cF1>public</span><span class=cF0> </span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>EdLineDown</span><span class=cF0>(</span><span class=cF9>CDoc</span><span class=cF0> *doc,</span><span class=cF9>I64</span><span class=cF0> sc=</span><span class=cF3>I64_MIN</span><span class=cF0>)
|
||
|
<a name="l281"></a>{</span><span class=cF2>//Move cursor down. Might need a call to </span><a href="/Wb/Adam/DolDoc/DocRecalc.HC.HTML#l256"><span class=cF4>DocRecalc</span></a><span class=cF2>().</span><span class=cF0>
|
||
|
<a name="l282"></a></span><span class=cF2>//See </span><a href="/Wb/Adam/DolDoc/DocCodeTools.HC.HTML#l387"><span class=cF4>EdRenumAsm</span></a><span class=cF2> for an example.</span><span class=cF0>
|
||
|
<a name="l283"></a> </span><span class=cF1>Bool</span><span class=cF0> unlock=</span><span class=cF5>DocLock</span><span class=cF0>(doc);
|
||
|
<a name="l284"></a> </span><span class=cF1>U8</span><span class=cF0> *dst;
|
||
|
<a name="l285"></a> </span><span class=cF9>I64</span><span class=cF0> y,x,old_de_flags=0,old_color;
|
||
|
<a name="l286"></a> </span><span class=cF9>CDocEntry</span><span class=cF0> *doc_ce=doc->cur_entry,*doc_ne,*doc_ce2;
|
||
|
<a name="l287"></a> </span><span class=cF1>if</span><span class=cF0> (sc!=</span><span class=cF3>I64_MIN</span><span class=cF0>) sc=sc.u32[0];
|
||
|
<a name="l288"></a> </span><span class=cF1>if</span><span class=cF0> (doc_ce->type_u8==</span><span class=cF3>DOCT_HEX_ED</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l289"></a> doc->cur_col=doc->cur_col+doc_ce->hex_ed_width*3;
|
||
|
<a name="l290"></a> </span><span class=cF1>if</span><span class=cF0> (doc->cur_col>=doc_ce->len*3) {
|
||
|
<a name="l291"></a> doc->cur_entry=doc_ce=doc_ce->next;
|
||
|
<a name="l292"></a> doc->cur_col=doc_ce->min_col;
|
||
|
<a name="l293"></a> doc->x=doc_ce->x+doc->cur_col;
|
||
|
<a name="l294"></a> doc->y=doc_ce->y;
|
||
|
<a name="l295"></a> }
|
||
|
<a name="l296"></a> </span><span class=cF1>if</span><span class=cF0> (unlock)
|
||
|
<a name="l297"></a> </span><span class=cF5>DocUnlock</span><span class=cF0>(doc);
|
||
|
<a name="l298"></a> </span><span class=cF1>return</span><span class=cF0>;
|
||
|
<a name="l299"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l300"></a> x=doc->x; y=doc->y;
|
||
|
<a name="l301"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>IsEditableText</span><span class=cF7>(</span><span class=cF0>doc_ce</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l302"></a> </span><span class=cF1>if</span><span class=cF0> (doc->cur_col>doc_ce->min_col && doc->cur_col<doc_ce->max_col-1) {
|
||
|
<a name="l303"></a> dst=doc_ce->tag+doc->cur_col;
|
||
|
<a name="l304"></a> doc_ne=</span><span class=cF5>DocEntryNewTag</span><span class=cF0>(doc,doc_ce,dst);
|
||
|
<a name="l305"></a> *dst=0;
|
||
|
<a name="l306"></a> </span><span class=cF1>if</span><span class=cF0> (sc>=0) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l307"></a> </span><span class=cF1>if</span><span class=cF0> (sc&</span><span class=cF3>SCF_SHIFT</span><span class=cF0>)
|
||
|
<a name="l308"></a> doc_ne->type=doc_ce->type | </span><span class=cF3>DOCET_SEL</span><span class=cF0>;
|
||
|
<a name="l309"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l310"></a> doc_ne->type=doc_ce->type & ~</span><span class=cF3>DOCET_SEL</span><span class=cF0>;
|
||
|
<a name="l311"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l312"></a> doc_ne->x=doc_ce->x+doc->cur_col;
|
||
|
<a name="l313"></a> doc_ce->max_col=doc->cur_col;
|
||
|
<a name="l314"></a> </span><span class=cF5>QueIns</span><span class=cF0>(doc_ne,doc_ce);
|
||
|
<a name="l315"></a> doc_ce=doc_ne;
|
||
|
<a name="l316"></a> doc->cur_col=doc_ce->min_col;
|
||
|
<a name="l317"></a> }
|
||
|
<a name="l318"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l319"></a> doc_ce2=doc_ce;
|
||
|
<a name="l320"></a> </span><span class=cF1>while</span><span class=cF0> (doc_ce!=doc && </span><span class=cF7>(</span><span class=cF0>doc_ce->y<=y ||
|
||
|
<a name="l321"></a> doc_ce->de_flags & (</span><span class=cF3>DOCEF_SKIP</span><span class=cF0>|</span><span class=cF3>DOCEF_FILTER_SKIP</span><span class=cF0>)</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l322"></a> doc_ce=doc_ce->next;
|
||
|
<a name="l323"></a> y=doc_ce->y;
|
||
|
<a name="l324"></a> doc->y=y;
|
||
|
<a name="l325"></a> </span><span class=cF1>while</span><span class=cF0> (doc_ce!=doc && </span><span class=cF7>(</span><span class=cF0>doc_ce->y<=y && doc_ce->x<=x ||
|
||
|
<a name="l326"></a> doc_ce->de_flags & (</span><span class=cF3>DOCEF_SKIP</span><span class=cF0>|</span><span class=cF3>DOCEF_FILTER_SKIP</span><span class=cF0>)</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l327"></a> old_de_flags=doc_ce->de_flags;
|
||
|
<a name="l328"></a> old_color=doc_ce->type;
|
||
|
<a name="l329"></a> doc_ce=doc_ce->next;
|
||
|
<a name="l330"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l331"></a> </span><span class=cF1>if</span><span class=cF0> (doc_ce->last!=doc && </span><span class=cF7>(</span><span class=cF0>doc_ce->x>x && doc_ce->last->y>=y || doc_ce->y>y</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l332"></a> doc_ce=doc_ce->last;
|
||
|
<a name="l333"></a> doc->cur_entry=doc_ce;
|
||
|
<a name="l334"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>(doc_ce->type_u8==</span><span class=cF3>DOCT_NEW_LINE</span><span class=cF0> ||
|
||
|
<a name="l335"></a> doc_ce->type_u8==</span><span class=cF3>DOCT_SOFT_NEW_LINE</span><span class=cF0> ||
|
||
|
<a name="l336"></a> doc_ce->type_u8==</span><span class=cF3>DOCT_INDENT</span><span class=cF0>) &&
|
||
|
<a name="l337"></a> (doc_ce->last->type_u8==</span><span class=cF3>DOCT_NEW_LINE</span><span class=cF0> ||
|
||
|
<a name="l338"></a> doc_ce->last->type_u8==</span><span class=cF3>DOCT_SOFT_NEW_LINE</span><span class=cF0> ||
|
||
|
<a name="l339"></a> doc_ce->last->type_u8==</span><span class=cF3>DOCT_INDENT</span><span class=cF0>)</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l340"></a> </span><span class=cF5>DocFormBwd</span><span class=cF0>(doc);
|
||
|
<a name="l341"></a> doc_ce=doc->cur_entry;
|
||
|
<a name="l342"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l343"></a> </span><span class=cF1>while</span><span class=cF0> (doc_ce2!=doc && </span><span class=cF7>(</span><span class=cF0>doc_ce2!=doc_ce || </span><span class=cF5>IsEditableText</span><span class=cF0>(doc_ce)</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l344"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF7>(</span><span class=cF0>doc_ce2->y<y || doc_ce2->x<x ||
|
||
|
<a name="l345"></a> doc_ce2->de_flags & (</span><span class=cF3>DOCEF_SKIP</span><span class=cF0>|</span><span class=cF3>DOCEF_FILTER_SKIP</span><span class=cF0>) ||
|
||
|
<a name="l346"></a> doc_ce2->x==x && !doc_ce2->max_col &&
|
||
|
<a name="l347"></a> </span><span class=cF5>Bt</span><span class=cF0>(</span><span class=cFB>doldoc</span><span class=cF0>.type_flags_nontag_invis,doc_ce2->type_u8)</span><span class=cF7>)</span><span class=cF0> && sc>=0)
|
||
|
<a name="l348"></a> </span><span class=cF5>BEqu</span><span class=cF0>(&doc_ce2->type,</span><span class=cF3>DOCEt_SEL</span><span class=cF0>,sc&</span><span class=cF3>SCF_SHIFT</span><span class=cF0>);
|
||
|
<a name="l349"></a> </span><span class=cF1>if</span><span class=cF0> (doc_ce2==doc_ce) </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l350"></a> doc_ce2=doc_ce2->next;
|
||
|
<a name="l351"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l352"></a> </span><span class=cF1>if</span><span class=cF0> (doc_ce->de_flags&</span><span class=cF3>DOCEF_TAG</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l353"></a> doc->cur_col=x-doc_ce->x;
|
||
|
<a name="l354"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>IsEditableText</span><span class=cF7>(</span><span class=cF0>doc_ce</span><span class=cF7>)</span><span class=cF0>) {
|
||
|
<a name="l355"></a> </span><span class=cF1>if</span><span class=cF0> (doc->cur_col>doc_ce->max_col)
|
||
|
<a name="l356"></a> doc->cur_col=doc_ce->max_col;
|
||
|
<a name="l357"></a> } </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (doc->cur_col>=doc_ce->max_col)
|
||
|
<a name="l358"></a> doc->cur_col=doc_ce->max_col-1;
|
||
|
<a name="l359"></a> </span><span class=cF1>if</span><span class=cF0> (doc->cur_col<doc_ce->min_col)
|
||
|
<a name="l360"></a> doc->cur_col=doc_ce->min_col;
|
||
|
<a name="l361"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l362"></a> doc->cur_col=doc_ce->min_col;
|
||
|
<a name="l363"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>IsEditableText</span><span class=cF7>(</span><span class=cF0>doc_ce</span><span class=cF7>)</span><span class=cF0>&&doc_ce->min_col<doc->cur_col<doc_ce->max_col-1) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l364"></a> dst=doc_ce->tag+doc->cur_col;
|
||
|
<a name="l365"></a> doc_ne=</span><span class=cF5>DocEntryNewTag</span><span class=cF0>(doc,doc_ce,dst);
|
||
|
<a name="l366"></a> *dst=0;
|
||
|
<a name="l367"></a> doc_ne->type=</span><span class=cF3>DOCT_TEXT</span><span class=cF0> | old_color & -0x100;
|
||
|
<a name="l368"></a> doc_ne->de_flags=old_de_flags|</span><span class=cFB>doldoc</span><span class=cF0>.dft_de_flags[</span><span class=cF3>DOCT_TEXT</span><span class=cF0>];
|
||
|
<a name="l369"></a> doc_ce->max_col=doc->cur_col;
|
||
|
<a name="l370"></a> doc_ne->x=doc_ce->x+doc->cur_col;
|
||
|
<a name="l371"></a> </span><span class=cF5>QueIns</span><span class=cF0>(doc_ne,doc_ce);
|
||
|
<a name="l372"></a> doc_ce=doc_ne;
|
||
|
<a name="l373"></a> doc->cur_col=doc_ce->min_col;
|
||
|
<a name="l374"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l375"></a> doc->cur_entry=doc_ce;
|
||
|
<a name="l376"></a> </span><span class=cF5>DocFormFwd</span><span class=cF0>(doc);
|
||
|
<a name="l377"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>doc->flags & </span><span class=cF3>DOCF_FORM</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l378"></a> </span><span class=cF1>while</span><span class=cF0> (doc_ce!=doc && doc_ce!=doc->cur_entry) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l379"></a> </span><span class=cF1>if</span><span class=cF0> (sc>=0)
|
||
|
<a name="l380"></a> </span><span class=cF5>BEqu</span><span class=cF0>(&doc_ce->type,</span><span class=cF3>DOCEt_SEL</span><span class=cF0>,sc&</span><span class=cF3>SCF_SHIFT</span><span class=cF0>);
|
||
|
<a name="l381"></a> doc_ce=doc_ce->next;
|
||
|
<a name="l382"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l383"></a> doc->x=doc->cur_entry->x+doc->cur_col;
|
||
|
<a name="l384"></a> </span><span class=cF1>if</span><span class=cF0> (unlock)
|
||
|
<a name="l385"></a> </span><span class=cF5>DocUnlock</span><span class=cF0>(doc);
|
||
|
<a name="l386"></a>}
|
||
|
<a name="l387"></a>
|
||
|
<a name="l388"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>EdCharDel</span><span class=cF0>(</span><span class=cF9>CDoc</span><span class=cF0> *doc)
|
||
|
<a name="l389"></a>{
|
||
|
<a name="l390"></a> </span><span class=cF1>Bool</span><span class=cF0> unlock=</span><span class=cF5>DocLock</span><span class=cF0>(doc);
|
||
|
<a name="l391"></a> </span><span class=cF9>CDocEntry</span><span class=cF0> *doc_ce=doc->cur_entry;
|
||
|
<a name="l392"></a>
|
||
|
<a name="l393"></a> </span><span class=cF1>if</span><span class=cF0> (doc_ce==doc) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l394"></a> </span><span class=cF1>if</span><span class=cF0> (unlock)
|
||
|
<a name="l395"></a> </span><span class=cF5>DocUnlock</span><span class=cF0>(doc);
|
||
|
<a name="l396"></a> </span><span class=cF1>return</span><span class=cF0>;
|
||
|
<a name="l397"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l398"></a> </span><span class=cF1>if</span><span class=cF0> (doc_ce->max_col!=0 &&
|
||
|
<a name="l399"></a> </span><span class=cF7>(</span><span class=cF5>IsEditableText</span><span class=cF0>(doc_ce)||doc_ce->type_u8==</span><span class=cF3>DOCT_DATA</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l400"></a> </span><span class=cF1>if</span><span class=cF0> (doc_ce->type_u8==</span><span class=cF3>DOCT_DATA</span><span class=cF0> && doc_ce->de_flags & </span><span class=cF3>DOCEF_HAS_TERMINATOR</span><span class=cF0> &&
|
||
|
<a name="l401"></a> doc->cur_col==doc_ce->max_col-1) {
|
||
|
<a name="l402"></a> </span><span class=cF1>if</span><span class=cF0> (unlock)
|
||
|
<a name="l403"></a> </span><span class=cF5>DocUnlock</span><span class=cF0>(doc);
|
||
|
<a name="l404"></a> </span><span class=cF1>return</span><span class=cF0>;
|
||
|
<a name="l405"></a> }
|
||
|
<a name="l406"></a> </span><span class=cF1>if</span><span class=cF0> (doc->cur_col<doc_ce->max_col)
|
||
|
<a name="l407"></a> </span><span class=cF5>StrCpy</span><span class=cF0>(doc_ce->tag+doc->cur_col,doc_ce->tag+doc->cur_col+1);
|
||
|
<a name="l408"></a> </span><span class=cF1>if</span><span class=cF0> (doc->cur_col>=doc_ce->max_col-1) {
|
||
|
<a name="l409"></a> doc->cur_entry=doc_ce->next;
|
||
|
<a name="l410"></a> doc->cur_col=doc->cur_entry->min_col;
|
||
|
<a name="l411"></a> }
|
||
|
<a name="l412"></a> </span><span class=cF5>DocRemSoftNewLines</span><span class=cF0>(doc,doc->cur_entry);
|
||
|
<a name="l413"></a> </span><span class=cF1>if</span><span class=cF0> (unlock)
|
||
|
<a name="l414"></a> </span><span class=cF5>DocUnlock</span><span class=cF0>(doc);
|
||
|
<a name="l415"></a> </span><span class=cF1>return</span><span class=cF0>;
|
||
|
<a name="l416"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l417"></a> doc->cur_entry=doc_ce->next;
|
||
|
<a name="l418"></a> doc->cur_col=doc->cur_entry->min_col;
|
||
|
<a name="l419"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>doc_ce->de_flags&</span><span class=cF3>DOCEF_FILTER_SKIP</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l420"></a> </span><span class=cF5>DocEntryDel</span><span class=cF0>(doc,doc_ce);
|
||
|
<a name="l421"></a> </span><span class=cF5>DocRemSoftNewLines</span><span class=cF0>(doc,doc->cur_entry);
|
||
|
<a name="l422"></a> </span><span class=cF1>if</span><span class=cF0> (unlock)
|
||
|
<a name="l423"></a> </span><span class=cF5>DocUnlock</span><span class=cF0>(doc);
|
||
|
<a name="l424"></a>}
|
||
|
<a name="l425"></a>
|
||
|
<a name="l426"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>ChkDollarBufSize</span><span class=cF0>(</span><span class=cF9>CDoc</span><span class=cF0> *doc)
|
||
|
<a name="l427"></a>{
|
||
|
<a name="l428"></a> </span><span class=cF1>U8</span><span class=cF0> *b;
|
||
|
<a name="l429"></a> </span><span class=cF1>if</span><span class=cF0> (doc->dollar_buf_ptr>=doc->dollar_buf_size-2) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l430"></a> doc->dollar_buf_size<<=1;
|
||
|
<a name="l431"></a> b=</span><span class=cF5>MAlloc</span><span class=cF0>(doc->dollar_buf_size,doc->mem_task);
|
||
|
<a name="l432"></a> </span><span class=cF5>MemCpy</span><span class=cF0>(b,doc->dollar_buf,doc->dollar_buf_ptr);
|
||
|
<a name="l433"></a> </span><span class=cF5>Free</span><span class=cF0>(doc->dollar_buf);
|
||
|
<a name="l434"></a> doc->dollar_buf=b;
|
||
|
<a name="l435"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l436"></a>}
|
||
|
<a name="l437"></a>
|
||
|
<a name="l438"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>EdCharIns</span><span class=cF0>(</span><span class=cF9>I64</span><span class=cF0> ch,</span><span class=cF9>I64</span><span class=cF0> sc,</span><span class=cF9>CDoc</span><span class=cF0> *doc)
|
||
|
<a name="l439"></a>{
|
||
|
<a name="l440"></a> </span><span class=cF1>Bool</span><span class=cF0> unlock=</span><span class=cF5>DocLock</span><span class=cF0>(doc);
|
||
|
<a name="l441"></a> </span><span class=cF1>U8</span><span class=cF0> *st,*src,*dst;
|
||
|
<a name="l442"></a> </span><span class=cF9>CDocEntry</span><span class=cF0> *doc_ce=doc->cur_entry,*doc_ne;
|
||
|
<a name="l443"></a> </span><span class=cF9>I64</span><span class=cF0> i,j,m,y=doc_ce->y;
|
||
|
<a name="l444"></a>
|
||
|
<a name="l445"></a> </span><span class=cF1>if</span><span class=cF0> (doc->flags & </span><span class=cF3>DOCF_IN_DOLLAR</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l446"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cFB>char_bmp_printable</span><span class=cF0>,ch</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l447"></a> </span><span class=cF1>goto</span><span class=cF0> ic_done;
|
||
|
<a name="l448"></a> </span><span class=cF5>ChkDollarBufSize</span><span class=cF0>(doc);
|
||
|
<a name="l449"></a> doc->dollar_buf[doc->dollar_buf_ptr++]=ch;
|
||
|
<a name="l450"></a> </span><span class=cF1>if</span><span class=cF0> (ch==</span><span class=cF6>'$'</span><span class=cF0>) {
|
||
|
<a name="l451"></a> </span><span class=cF1>if</span><span class=cF0> (doc->dollar_buf_ptr==2) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l452"></a> doc->flags&=~</span><span class=cF3>DOCF_IN_DOLLAR</span><span class=cF0>;
|
||
|
<a name="l453"></a> doc->dollar_buf_ptr=0;
|
||
|
<a name="l454"></a> </span><span class=cF1>goto</span><span class=cF0> ic_cont;
|
||
|
<a name="l455"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l456"></a> doc->dollar_buf[doc->dollar_buf_ptr]=0;
|
||
|
<a name="l457"></a> doc->flags&=~</span><span class=cF3>DOCF_IN_DOLLAR</span><span class=cF0>;
|
||
|
<a name="l458"></a> </span><span class=cF5>DocPrint</span><span class=cF0>(doc,</span><span class=cF6>"%s"</span><span class=cF0>,doc->dollar_buf);
|
||
|
<a name="l459"></a> doc->dollar_buf_ptr=0;
|
||
|
<a name="l460"></a> </span><span class=cF1>goto</span><span class=cF0> ic_done;
|
||
|
<a name="l461"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l462"></a> } </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l463"></a> </span><span class=cF1>goto</span><span class=cF0> ic_done;
|
||
|
<a name="l464"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l465"></a> </span><span class=cF1>if</span><span class=cF0> (ch==</span><span class=cF6>'$'</span><span class=cF0> && !</span><span class=cF7>(</span><span class=cF0>doc->flags & (</span><span class=cF3>DOCF_PLAIN_TEXT</span><span class=cF0>|</span><span class=cF3>DOCF_PLAIN_TEXT_TABS</span><span class=cF0>)</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l466"></a> doc->flags|=</span><span class=cF3>DOCF_IN_DOLLAR</span><span class=cF0>;
|
||
|
<a name="l467"></a> doc->dollar_buf_ptr=0;
|
||
|
<a name="l468"></a> doc->dollar_buf[doc->dollar_buf_ptr++]=ch;
|
||
|
<a name="l469"></a> </span><span class=cF1>goto</span><span class=cF0> ic_done;
|
||
|
<a name="l470"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l471"></a> </span><span class=cF1>if</span><span class=cF0> (ch==</span><span class=cF6>'\r'</span><span class=cF0>) </span><span class=cF1>goto</span><span class=cF0> ic_done;
|
||
|
<a name="l472"></a>
|
||
|
<a name="l473"></a> ic_cont:
|
||
|
<a name="l474"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF7>(</span><span class=cF0>ch==</span><span class=cF3>CH_SPACE</span><span class=cF0> || ch==</span><span class=cF6>'\n'</span><span class=cF7>)</span><span class=cF0> &&
|
||
|
<a name="l475"></a> !</span><span class=cF7>(</span><span class=cF0>sc & (</span><span class=cF3>SCF_CTRL</span><span class=cF0>|</span><span class=cF3>SCF_SHIFT</span><span class=cF0>)</span><span class=cF7>)</span><span class=cF0> &&
|
||
|
<a name="l476"></a> doc_ce->de_flags &
|
||
|
<a name="l477"></a> </span><span class=cF7>(</span><span class=cF3>DOCEF_LINK</span><span class=cF0>|</span><span class=cF3>DOCEF_TREE</span><span class=cF0>|</span><span class=cF3>DOCEF_LST</span><span class=cF0>|</span><span class=cF3>DOCEF_CHECK_COLLAPSABLE</span><span class=cF0>|
|
||
|
<a name="l478"></a> </span><span class=cF3>DOCEF_LEFT_MACRO</span><span class=cF0>|</span><span class=cF3>DOCEF_LEFT_EXP</span><span class=cF0>|</span><span class=cF3>DOCEF_LEFT_CB</span><span class=cF0>|</span><span class=cF3>DOCEF_LEFT_IN_STR</span><span class=cF0> |
|
||
|
<a name="l479"></a> </span><span class=cF3>DOCEF_RIGHT_MACRO</span><span class=cF0>|</span><span class=cF3>DOCEF_RIGHT_EXP</span><span class=cF0>|</span><span class=cF3>DOCEF_RIGHT_CB</span><span class=cF0>|</span><span class=cF3>DOCEF_RIGHT_IN_STR</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l480"></a> doc->cmd_U8=ch;
|
||
|
<a name="l481"></a> </span><span class=cF5>DocEntryRun</span><span class=cF0>(doc,doc_ce,</span><span class=cF3>FALSE</span><span class=cF0>);
|
||
|
<a name="l482"></a> </span><span class=cF5>DocLock</span><span class=cF0>(doc);
|
||
|
<a name="l483"></a> </span><span class=cF1>goto</span><span class=cF0> ic_done;
|
||
|
<a name="l484"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l485"></a> </span><span class=cF1>if</span><span class=cF0> (doc_ce->type_u8==</span><span class=cF3>DOCT_HEX_ED</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l486"></a> </span><span class=cF1>if</span><span class=cF0> (doc_ce->de_flags&</span><span class=cF3>DOCEF_DEREF_DATA</span><span class=cF0> &&
|
||
|
<a name="l487"></a> !</span><span class=cF7>(</span><span class=cF0>doc_ce->de_flags&</span><span class=cF3>DOCEF_REMALLOC_DATA</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l488"></a> st=doc_ce->data;
|
||
|
<a name="l489"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l490"></a> st=&doc_ce->data;
|
||
|
<a name="l491"></a> i=doc->cur_col;
|
||
|
<a name="l492"></a> j=i%(doc_ce->hex_ed_width*3);
|
||
|
<a name="l493"></a> m=i/(doc_ce->hex_ed_width*3)*doc_ce->hex_ed_width;
|
||
|
<a name="l494"></a> </span><span class=cF1>if</span><span class=cF0> (j>=doc_ce->hex_ed_width<<1)
|
||
|
<a name="l495"></a> st[j-doc_ce->hex_ed_width<<1+m]=ch;
|
||
|
<a name="l496"></a> </span><span class=cF1>else</span><span class=cF0> {
|
||
|
<a name="l497"></a> ch=</span><span class=cF5>ToUpper</span><span class=cF0>(ch)-</span><span class=cF6>'0'</span><span class=cF0>;
|
||
|
<a name="l498"></a> </span><span class=cF1>if</span><span class=cF0> (ch>9) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l499"></a> ch+=</span><span class=cF6>'0'</span><span class=cF0>-</span><span class=cF6>'A'</span><span class=cF0>+10;
|
||
|
<a name="l500"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>10<=ch<=15</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l501"></a> </span><span class=cF1>goto</span><span class=cF0> ic_done;
|
||
|
<a name="l502"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l503"></a> m=j>>1+m;
|
||
|
<a name="l504"></a> </span><span class=cF1>if</span><span class=cF0> (j & 1)
|
||
|
<a name="l505"></a> st[m]=st[m] & 0xF0| ch;
|
||
|
<a name="l506"></a> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l507"></a> st[m]=st[m] & 0xF | ch<<4;
|
||
|
<a name="l508"></a> }
|
||
|
<a name="l509"></a> doc->cur_col++;
|
||
|
<a name="l510"></a> </span><span class=cF1>goto</span><span class=cF0> ic_done;
|
||
|
<a name="l511"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l512"></a> </span><span class=cF1>if</span><span class=cF0> (doc->flags & </span><span class=cF3>DOCF_OVERSTRIKE</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l513"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cFB>char_bmp_displayable</span><span class=cF0>,ch</span><span class=cF7>)</span><span class=cF0>) {
|
||
|
<a name="l514"></a>ic_overstrike:
|
||
|
<a name="l515"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>IsEditableText</span><span class=cF7>(</span><span class=cF0>doc_ce</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l516"></a> </span><span class=cF1>if</span><span class=cF0> (doc->cur_col<doc_ce->max_col) {
|
||
|
<a name="l517"></a> </span><span class=cF1>if</span><span class=cF0> (doc_ce->tag[doc->cur_col]) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l518"></a> doc_ce->tag[doc->cur_col++]=ch;
|
||
|
<a name="l519"></a> </span><span class=cF1>goto</span><span class=cF0> ic_done;
|
||
|
<a name="l520"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l521"></a> } </span><span class=cF1>else</span><span class=cF0> {
|
||
|
<a name="l522"></a> doc_ce=doc_ce->next;
|
||
|
<a name="l523"></a> doc->cur_entry=doc_ce;
|
||
|
<a name="l524"></a> doc->cur_col=doc_ce->min_col;
|
||
|
<a name="l525"></a> </span><span class=cF1>goto</span><span class=cF0> ic_overstrike;
|
||
|
<a name="l526"></a> }
|
||
|
<a name="l527"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (doc_ce->type_u8==</span><span class=cF3>DOCT_DATA</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l528"></a> </span><span class=cF1>if</span><span class=cF0> (doc_ce->de_flags & </span><span class=cF3>DOCEF_HAS_TERMINATOR</span><span class=cF0>) {
|
||
|
<a name="l529"></a> </span><span class=cF1>if</span><span class=cF0> (doc_ce->tag[doc->cur_col] &&
|
||
|
<a name="l530"></a> doc->cur_col<doc_ce->min_col+doc_ce->len) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l531"></a> doc_ce->tag[doc->cur_col++]=ch;
|
||
|
<a name="l532"></a> </span><span class=cF1>if</span><span class=cF0> ( ! doc_ce->tag[doc->cur_col]) {
|
||
|
<a name="l533"></a> doc_ce->tag[doc->cur_col]=</span><span class=cF6>'_'</span><span class=cF0>;
|
||
|
<a name="l534"></a> doc_ce->tag[doc->cur_col+1]=0;
|
||
|
<a name="l535"></a> }
|
||
|
<a name="l536"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (doc_ce->de_flags & </span><span class=cF3>DOCEF_REMALLOC_DATA</span><span class=cF0>)
|
||
|
<a name="l537"></a> </span><span class=cF1>goto</span><span class=cF0> ic_not_overstrike;
|
||
|
<a name="l538"></a> } </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (doc_ce->tag[doc->cur_col])
|
||
|
<a name="l539"></a> doc_ce->tag[doc->cur_col++]=ch;
|
||
|
<a name="l540"></a> </span><span class=cF1>goto</span><span class=cF0> ic_done;
|
||
|
<a name="l541"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l542"></a> doc_ne=</span><span class=cF5>DocEntryNewTag</span><span class=cF0>(doc,doc_ce,&ch);
|
||
|
<a name="l543"></a> doc_ne->type=</span><span class=cF3>DOCT_TEXT</span><span class=cF0> | doc->settings_head.dft_text_attr<<8;
|
||
|
<a name="l544"></a> doc_ne->de_flags=</span><span class=cFB>doldoc</span><span class=cF0>.dft_de_flags[</span><span class=cF3>DOCT_TEXT</span><span class=cF0>];
|
||
|
<a name="l545"></a> </span><span class=cF5>QueIns</span><span class=cF0>(doc_ne,doc_ce->last);
|
||
|
<a name="l546"></a> } </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (ch==</span><span class=cF6>'\n'</span><span class=cF0>) {
|
||
|
<a name="l547"></a> </span><span class=cF1>while</span><span class=cF0> (doc->cur_entry->next!=doc && doc->cur_entry->y==y)
|
||
|
<a name="l548"></a> doc->cur_entry=doc->cur_entry->next;
|
||
|
<a name="l549"></a> doc->cur_col=doc->cur_entry->min_col;
|
||
|
<a name="l550"></a> } </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (ch==</span><span class=cF6>'\t'</span><span class=cF0>) {
|
||
|
<a name="l551"></a> </span><span class=cF1>if</span><span class=cF0> (doc->flags&</span><span class=cF3>DOCF_FORM</span><span class=cF0>)
|
||
|
<a name="l552"></a> </span><span class=cF1>goto</span><span class=cF0> ic_form_tab;
|
||
|
<a name="l553"></a> }
|
||
|
<a name="l554"></a> </span><span class=cF1>goto</span><span class=cF0> ic_done;
|
||
|
<a name="l555"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l556"></a>ic_not_overstrike:
|
||
|
<a name="l557"></a> </span><span class=cF1>if</span><span class=cF0> (ch==</span><span class=cF6>'\n'</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l558"></a> </span><span class=cF1>if</span><span class=cF0> (sc&</span><span class=cF3>SCF_CTRL</span><span class=cF0> && !</span><span class=cF7>(</span><span class=cF0>sc&</span><span class=cF3>SCF_SHIFT</span><span class=cF7>)</span><span class=cF0>) {
|
||
|
<a name="l559"></a> doc_ne=</span><span class=cF5>DocEntryNewBase</span><span class=cF0>(doc,
|
||
|
<a name="l560"></a> </span><span class=cF3>DOCT_PAGE_BREAK</span><span class=cF0>|doc->settings_head.dft_text_attr<<8);
|
||
|
<a name="l561"></a> } </span><span class=cF1>else</span><span class=cF0> {
|
||
|
<a name="l562"></a> doc_ne=</span><span class=cF5>DocEntryNewBase</span><span class=cF0>(doc,
|
||
|
<a name="l563"></a> </span><span class=cF3>DOCT_NEW_LINE</span><span class=cF0>|doc->settings_head.dft_text_attr<<8);
|
||
|
<a name="l564"></a> }
|
||
|
<a name="l565"></a> </span><span class=cF5>DocInsEntry</span><span class=cF0>(doc,doc_ne);
|
||
|
<a name="l566"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (ch==</span><span class=cF6>'\t'</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l567"></a> </span><span class=cF1>if</span><span class=cF0> (doc->flags&</span><span class=cF3>DOCF_FORM</span><span class=cF0> &&
|
||
|
<a name="l568"></a> </span><span class=cF7>(</span><span class=cF5>Bt</span><span class=cF0>(</span><span class=cFB>doldoc</span><span class=cF0>.type_flags_form,doc->cur_entry->type_u8) ||
|
||
|
<a name="l569"></a> doc->cur_entry->de_flags&</span><span class=cF3>DOCEF_LINK</span><span class=cF7>)</span><span class=cF0> &&
|
||
|
<a name="l570"></a> !</span><span class=cF7>(</span><span class=cF0>doc->cur_entry->de_flags&</span><span class=cF3>DOCEF_SKIP_IN_FORM</span><span class=cF7>)</span><span class=cF0>) {
|
||
|
<a name="l571"></a>ic_form_tab:
|
||
|
<a name="l572"></a> doc->cur_entry=doc->cur_entry->next;
|
||
|
<a name="l573"></a> doc->cur_col=doc->cur_entry->min_col;
|
||
|
<a name="l574"></a> </span><span class=cF5>DocFormFwd</span><span class=cF0>(doc);
|
||
|
<a name="l575"></a> </span><span class=cF1>goto</span><span class=cF0> ic_done;
|
||
|
<a name="l576"></a> } </span><span class=cF1>else</span><span class=cF0> {
|
||
|
<a name="l577"></a> doc_ne=</span><span class=cF5>DocEntryNewBase</span><span class=cF0>(doc,</span><span class=cF3>DOCT_TAB</span><span class=cF0>|doc->settings_head.dft_text_attr<<8);
|
||
|
<a name="l578"></a> </span><span class=cF5>DocInsEntry</span><span class=cF0>(doc,doc_ne);
|
||
|
<a name="l579"></a> }
|
||
|
<a name="l580"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l581"></a> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>Bt</span><span class=cF7>(</span><span class=cFB>char_bmp_displayable</span><span class=cF0>,ch</span><span class=cF7>)</span><span class=cF0>) {
|
||
|
<a name="l582"></a> </span><span class=cF1>if</span><span class=cF0> (doc_ce->type_u8==</span><span class=cF3>DOCT_DATA</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l583"></a> </span><span class=cF1>while</span><span class=cF0> (</span><span class=cF3>TRUE</span><span class=cF0>) {
|
||
|
<a name="l584"></a> i=doc_ce->len+doc_ce->min_col;
|
||
|
<a name="l585"></a> </span><span class=cF1>if</span><span class=cF0> (doc_ce->de_flags & </span><span class=cF3>DOCEF_HAS_TERMINATOR</span><span class=cF0>)
|
||
|
<a name="l586"></a> i++;
|
||
|
<a name="l587"></a> </span><span class=cF1>if</span><span class=cF0> (doc_ce->max_col<i) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l588"></a> st=doc_ce->tag;
|
||
|
<a name="l589"></a> doc_ce->max_col++;
|
||
|
<a name="l590"></a> </span><span class=cF1>for</span><span class=cF0> (i=doc_ce->max_col;i>doc->cur_col;i--)
|
||
|
<a name="l591"></a> st[i]=st[i-1];
|
||
|
<a name="l592"></a> st[doc->cur_col++]=ch;
|
||
|
<a name="l593"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l594"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (doc_ce->de_flags & </span><span class=cF3>DOCEF_REMALLOC_DATA</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l595"></a> st=</span><span class=cF5>MAlloc</span><span class=cF0>(doc_ce->max_col+8,doc->mem_task);
|
||
|
<a name="l596"></a> </span><span class=cF5>MemCpy</span><span class=cF0>(st,doc_ce->tag,doc_ce->max_col+1);
|
||
|
<a name="l597"></a> </span><span class=cF5>Free</span><span class=cF0>(doc_ce->tag);
|
||
|
<a name="l598"></a> doc_ce->tag=st;
|
||
|
<a name="l599"></a> doc_ce->len=</span><span class=cF5>MSize</span><span class=cF0>(st)-doc_ce->min_col-2; </span><span class=cF2>//See </span><a href="/Wb/Adam/DolDoc/DocPlain.HC.HTML#l352"><span class=cF4>DataTagWidth</span></a><span class=cF0>
|
||
|
<a name="l600"></a> </span><span class=cF5>Free</span><span class=cF0>(doc_ce->data);
|
||
|
<a name="l601"></a> doc_ce->data=</span><span class=cF5>MAlloc</span><span class=cF0>(doc_ce->len+2,doc->mem_task);
|
||
|
<a name="l602"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0>
|
||
|
<a name="l603"></a> </span><span class=cF1>break</span><span class=cF0>;
|
||
|
<a name="l604"></a> }
|
||
|
<a name="l605"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF1>if</span><span class=cF0> (</span><span class=cF5>IsEditableText</span><span class=cF7>(</span><span class=cF0>doc_ce</span><span class=cF7>)</span><span class=cF0>) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l606"></a> dst=st=</span><span class=cF5>MAlloc</span><span class=cF0>(doc_ce->max_col+2,doc->mem_task);
|
||
|
<a name="l607"></a> src=doc_ce->tag;
|
||
|
<a name="l608"></a> i=doc->cur_col;
|
||
|
<a name="l609"></a> </span><span class=cF1>while</span><span class=cF0> (i-->0)
|
||
|
<a name="l610"></a> *dst++=*src++;
|
||
|
<a name="l611"></a> *dst++=ch;
|
||
|
<a name="l612"></a> </span><span class=cF1>while</span><span class=cF0> (*dst++=*src++);
|
||
|
<a name="l613"></a> </span><span class=cF5>Free</span><span class=cF0>(doc_ce->tag);
|
||
|
<a name="l614"></a> doc_ce->tag=st;
|
||
|
<a name="l615"></a> doc_ce->max_col++;
|
||
|
<a name="l616"></a> doc->cur_col++;
|
||
|
<a name="l617"></a> </span><span class=cF7>}</span><span class=cF0> </span><span class=cF1>else</span><span class=cF0> </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l618"></a> doc_ne=</span><span class=cF5>DocEntryNewTag</span><span class=cF0>(doc,doc_ce,&ch);
|
||
|
<a name="l619"></a> doc_ne->type=</span><span class=cF3>DOCT_TEXT</span><span class=cF0> | doc->settings_head.dft_text_attr<<8;
|
||
|
<a name="l620"></a> doc_ne->de_flags=</span><span class=cFB>doldoc</span><span class=cF0>.dft_de_flags[</span><span class=cF3>DOCT_TEXT</span><span class=cF0>];
|
||
|
<a name="l621"></a> doc_ne->x=doc_ce->x+1;
|
||
|
<a name="l622"></a> </span><span class=cF5>QueIns</span><span class=cF0>(doc_ne,doc_ce->last);
|
||
|
<a name="l623"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l624"></a> }
|
||
|
<a name="l625"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l626"></a>ic_done:
|
||
|
<a name="l627"></a> </span><span class=cF5>DocRemSoftNewLines</span><span class=cF0>(doc,doc->cur_entry);
|
||
|
<a name="l628"></a> </span><span class=cF1>if</span><span class=cF0> (doc->cur_entry->de_flags & </span><span class=cF3>DOCEF_UPDATE_DATA</span><span class=cF0> &&
|
||
|
<a name="l629"></a> </span><span class=cF7>(</span><span class=cF0>doc->cur_entry->type_u8==</span><span class=cF3>DOCT_DATA</span><span class=cF0> ||
|
||
|
<a name="l630"></a> doc->cur_entry->type_u8==</span><span class=cF3>DOCT_CHECK_BOX</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l631"></a> </span><span class=cF5>DocDataScan</span><span class=cF0>(doc,doc->cur_entry);
|
||
|
<a name="l632"></a> </span><span class=cF1>if</span><span class=cF0> (unlock)
|
||
|
<a name="l633"></a> </span><span class=cF5>DocUnlock</span><span class=cF0>(doc);
|
||
|
<a name="l634"></a>}
|
||
|
<a name="l635"></a>
|
||
|
<a name="l636"></a></span><span class=cF1>U0</span><span class=cF0> </span><span class=cF5>EdLineDel</span><span class=cF0>(</span><span class=cF9>CDoc</span><span class=cF0> *doc)
|
||
|
<a name="l637"></a>{
|
||
|
<a name="l638"></a> </span><span class=cF9>CDocEntry</span><span class=cF0> *doc_ce=doc->cur_entry,*doc_ce2;
|
||
|
<a name="l639"></a> </span><span class=cF9>I64</span><span class=cF0> y;
|
||
|
<a name="l640"></a> y=doc->y;
|
||
|
<a name="l641"></a> </span><span class=cF1>while</span><span class=cF0> (doc_ce!=doc && doc_ce->y==y)
|
||
|
<a name="l642"></a> doc_ce=doc_ce->next;
|
||
|
<a name="l643"></a> doc->cur_entry=doc_ce;
|
||
|
<a name="l644"></a> doc->cur_col=doc_ce->min_col;
|
||
|
<a name="l645"></a> doc_ce=doc_ce->last;
|
||
|
<a name="l646"></a> </span><span class=cF1>while</span><span class=cF0> (doc_ce!=doc && doc_ce->y==y) </span><span class=cF7>{</span><span class=cF0>
|
||
|
<a name="l647"></a> doc_ce2=doc_ce->last;
|
||
|
<a name="l648"></a> </span><span class=cF1>if</span><span class=cF0> (!</span><span class=cF7>(</span><span class=cF0>doc_ce->de_flags&</span><span class=cF3>DOCEF_FILTER_SKIP</span><span class=cF7>)</span><span class=cF0>)
|
||
|
<a name="l649"></a> </span><span class=cF5>DocEntryDel</span><span class=cF0>(doc,doc_ce);
|
||
|
<a name="l650"></a> doc_ce=doc_ce2;
|
||
|
<a name="l651"></a> </span><span class=cF7>}</span><span class=cF0>
|
||
|
<a name="l652"></a>}
|
||
|
</span></pre></body>
|
||
|
</html>
|