mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
RichText/RichEdit: Header/Footer support
git-svn-id: svn://ultimatepp.org/upp/trunk@6476 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
09edff5e1c
commit
39d5b3f06d
20 changed files with 474 additions and 82 deletions
|
|
@ -69,6 +69,7 @@ class RichQtfParser {
|
|||
int GetNumber();
|
||||
int ReadNumber();
|
||||
String GetText(int delim);
|
||||
String GetText2(int delim1, int delim2);
|
||||
Color GetColor();
|
||||
void Number2(int& a, int& b);
|
||||
|
||||
|
|
@ -156,6 +157,25 @@ String RichQtfParser::GetText(int delim) {
|
|||
}
|
||||
}
|
||||
|
||||
String RichQtfParser::GetText2(int delim1, int delim2) {
|
||||
String s;
|
||||
for(;;) {
|
||||
if(*term == '\0') return s;
|
||||
if(*term == '`') {
|
||||
term++;
|
||||
if(*term == '\0') return s;
|
||||
s.Cat(*term++);
|
||||
}
|
||||
else
|
||||
if(term[0] == delim1 && term[1] == delim2) {
|
||||
term += 2;
|
||||
return s;
|
||||
}
|
||||
else
|
||||
s.Cat(*term++);
|
||||
}
|
||||
}
|
||||
|
||||
int RichQtfParser::ReadNumber()
|
||||
{
|
||||
if(!IsDigit(*term))
|
||||
|
|
@ -825,6 +845,12 @@ void RichQtfParser::Parse(const char *qtf, int _accesskey)
|
|||
SetFormat();
|
||||
}
|
||||
else
|
||||
if(Key2('^', 'H'))
|
||||
target.SetHeaderQtf(GetText2('^', '^'));
|
||||
else
|
||||
if(Key2('^', 'F'))
|
||||
target.SetFooterQtf(GetText2('^', '^'));
|
||||
else
|
||||
if(Key2('{', ':')) {
|
||||
Flush();
|
||||
String field = GetText(':');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue