From 024bf6f641b315fe93184b747f13e149bb284bf1 Mon Sep 17 00:00:00 2001 From: cxl Date: Thu, 22 Sep 2016 14:58:17 +0000 Subject: [PATCH] RichText: Fixed QTF new page ^^ with tables git-svn-id: svn://ultimatepp.org/upp/trunk@10233 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/RichText/ParseQtf.cpp | 16 ++++++++-------- uppsrc/RichText/srcdoc.tpp/QTF$en-us.tpp | 10 +++++++++- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/uppsrc/RichText/ParseQtf.cpp b/uppsrc/RichText/ParseQtf.cpp index 8561365a5..0d52ce84b 100644 --- a/uppsrc/RichText/ParseQtf.cpp +++ b/uppsrc/RichText/ParseQtf.cpp @@ -1,5 +1,4 @@ #include "RichText.h" -#include "RichText.h" namespace Upp { @@ -253,14 +252,8 @@ void RichQtfParser::EndPart() } else { Flush(); - if(table.GetCount()) { - RichTable& tab = Table(); - RichTable::Format tabformat = tab.GetFormat(); - if(breakpage) - tabformat.newpage = true; - tab.SetFormat(tabformat); + if(table.GetCount()) table.Top().text.Cat(paragraph, target.GetStyles()); - } else { if(breakpage) paragraph.format.newpage = true; @@ -849,6 +842,13 @@ void RichQtfParser::Parse(const char *qtf, int _accesskey) Table().AddColumn(r); while(Key(':')) Table().AddColumn(ReadNumber()); + if(breakpage) { + RichTable& tab = Table(); + RichTable::Format tabformat = tab.GetFormat(); + tabformat.newpage = true; + tab.SetFormat(tabformat); + breakpage = false; + } TableFormat(); SetFormat(); } diff --git a/uppsrc/RichText/srcdoc.tpp/QTF$en-us.tpp b/uppsrc/RichText/srcdoc.tpp/QTF$en-us.tpp index a9daa6afe..070dfa5e9 100644 --- a/uppsrc/RichText/srcdoc.tpp/QTF$en-us.tpp +++ b/uppsrc/RichText/srcdoc.tpp/QTF$en-us.tpp @@ -626,7 +626,15 @@ in dots.] :: [s0; [C@(128.0.255) `|][/C@(0.0.255) number]] :: [s0; Vertical cell span.] :: [s0; [C@(128.0.255) ;]] -::= [s0; NOP separator. In some cases it helps to separate command code.]}}&] +::= [s0; NOP separator. In some cases it helps to separate command code.] +::^ [s0; [C@(128.0.255) P]] +::= [s0; Page break before table.] +::^ [s0;%- [%%C@(128.0.255) T][/C@(0.0.255) qtf][C@(128.0.255) `^`^][/C@(0.0.255) qtf][C@(128.0.255) `^ +`^]] +:: [s0; New text header / footer, [%-/C@(0.0.255) qtf] is complete embeded +QTF representing header/footer. This QTF can contain field[@5 +`{:VALUE:PAGENUMBER:`} ]to represent page number and[@5 `{:VALUE:PAGECOUNT:`}] +to represent total number of pages.]}}&] [s0;3 &] [s0; Note: There is also legacy support for old table format (from previous QTF version) that is based on [@(128.0.255) `+`+ ]pair