mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-08-21 22:04:56 -06:00
git-svn-id: svn://ultimatepp.org/upp/trunk@413 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
9eaf2cb811
commit
49f828dcd1
13 changed files with 116 additions and 42 deletions
|
|
@ -94,6 +94,7 @@ void ParaFormating::SetupIndent()
|
|||
void ParaFormating::Set(int unit, const RichText::FormatInfo& formatinfo)
|
||||
{
|
||||
font = formatinfo;
|
||||
ruler.Set(unit, RichText::RULER & formatinfo.paravalid ? formatinfo.ruler : Null);
|
||||
before.Set(unit, RichText::BEFORE & formatinfo.paravalid ? formatinfo.before : Null);
|
||||
lm.Set(unit, RichText::LM & formatinfo.paravalid ? formatinfo.lm : Null);
|
||||
indent.Set(unit, RichText::INDENT & formatinfo.paravalid ? formatinfo.indent : Null);
|
||||
|
|
@ -128,6 +129,10 @@ void ParaFormating::Set(int unit, const RichText::FormatInfo& formatinfo)
|
|||
orphan = Null;
|
||||
orphan.ThreeState();
|
||||
}
|
||||
if(RichText::RULERINK & formatinfo.paravalid)
|
||||
rulerink <<= formatinfo.rulerink;
|
||||
else
|
||||
rulerink <<= Null;
|
||||
tabpos.SetUnit(unit);
|
||||
if(RichText::BULLET & formatinfo.paravalid)
|
||||
bullet <<= formatinfo.bullet;
|
||||
|
|
@ -234,6 +239,14 @@ dword ParaFormating::Get(RichText::FormatInfo& formatinfo)
|
|||
formatinfo.tabsize = ~tabsize;
|
||||
v |= RichText::TABSIZE;
|
||||
}
|
||||
if(!IsNull(ruler)) {
|
||||
formatinfo.ruler = ~ruler;
|
||||
v |= RichText::RULER;
|
||||
}
|
||||
if(!IsNull(rulerink)) {
|
||||
formatinfo.rulerink = ~rulerink;
|
||||
v |= RichText::RULERINK;
|
||||
}
|
||||
return v;
|
||||
}
|
||||
|
||||
|
|
@ -281,6 +294,7 @@ ParaFormating::ParaFormating()
|
|||
reset_number <<=
|
||||
bullet <<= THISBACK(SetupIndent);
|
||||
EnableNumbering();
|
||||
rulerink.NullText("---");
|
||||
}
|
||||
|
||||
struct ParaFormatDlg : public WithParaFormatLayout<TopWindow> {
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
LAYOUT(ParaLayout, 488, 320)
|
||||
LAYOUT(ParaLayout, 488, 352)
|
||||
ITEM(LabelBox, dv___0, SetLabel(t_("Alignment")).LeftPosZ(8, 100).TopPosZ(8, 88))
|
||||
ITEM(Switch, align, SetLabel(t_("Left\nCenter\nRight\nJustify")).LeftPosZ(16, 84).TopPosZ(24, 68))
|
||||
ITEM(LabelBox, dv___2, SetLabel(t_("Spacing")).LeftPosZ(116, 176).TopPosZ(8, 88))
|
||||
|
|
@ -13,33 +13,38 @@ LAYOUT(ParaLayout, 488, 320)
|
|||
ITEM(Option, keep, SetLabel(t_("Keep together")).LeftPosZ(308, 164).TopPosZ(40, 16))
|
||||
ITEM(Option, keepnext, SetLabel(t_("Keep with next")).LeftPosZ(308, 164).TopPosZ(56, 16))
|
||||
ITEM(Option, orphan, SetLabel(t_("Allow orphans")).LeftPosZ(308, 164).TopPosZ(72, 16))
|
||||
ITEM(LabelBox, dv___14, SetLabel(t_("Indentation")).LeftPosZ(8, 176).TopPosZ(104, 124))
|
||||
ITEM(Label, dv___15, SetLabel(t_("Left margin")).LeftPosZ(16, 88).TopPosZ(124, 19))
|
||||
ITEM(UnitEdit, lm, LeftPosZ(108, 68).TopPosZ(124, 19))
|
||||
ITEM(Label, dv___17, SetLabel(t_("ParaLayout_rm_1_SetLabel\aRight margin")).LeftPosZ(16, 88).TopPosZ(148, 19))
|
||||
ITEM(UnitEdit, rm, LeftPosZ(108, 68).TopPosZ(148, 19))
|
||||
ITEM(Label, dv___19, SetLabel(t_("First line")).LeftPosZ(16, 88).TopPosZ(172, 19))
|
||||
ITEM(UnitEdit, indent, LeftPosZ(108, 68).TopPosZ(172, 19))
|
||||
ITEM(Label, dv___21, SetLabel(t_("Bullet")).LeftPosZ(16, 104).TopPosZ(196, 24))
|
||||
ITEM(DropList, bullet, LeftPosZ(124, 52).TopPosZ(196, 24))
|
||||
ITEM(LabelBox, dv___23, SetLabel(t_("Tabs")).LeftPosZ(192, 288).TopPosZ(104, 124))
|
||||
ITEM(ArrayCtrl, tabs, AutoHideSb(true).LeftPosZ(200, 272).TopPosZ(120, 72))
|
||||
ITEM(Label, dv___25, SetLabel(t_("Default tab size")).LeftPosZ(200, 196).TopPosZ(200, 20))
|
||||
ITEM(UnitEdit, tabsize, LeftPosZ(404, 68).TopPosZ(200, 19))
|
||||
ITEM(LabelBox, dv___27, SetLabel(t_("Numbering")).LeftPosZ(8, 472).TopPosZ(236, 76))
|
||||
ITEM(Label, dv___28, SetLabel(t_("Before number")).LeftPosZ(16, 100).TopPosZ(252, 20))
|
||||
ITEM(EditString, before_number, LeftPosZ(116, 72).TopPosZ(252, 19))
|
||||
ITEM(Label, dv___30, SetLabel(t_("After number")).LeftPosZ(208, 100).TopPosZ(252, 20))
|
||||
ITEM(EditString, after_number, LeftPosZ(308, 72).TopPosZ(252, 19))
|
||||
ITEM(Option, reset_number, SetLabel(t_("Reset")).LeftPosZ(400, 72).TopPosZ(252, 20))
|
||||
UNTYPED(n[0], LeftPosZ(16, 54).TopPosZ(284, 19))
|
||||
UNTYPED(n[1], LeftPosZ(72, 54).TopPosZ(284, 19))
|
||||
UNTYPED(n[2], LeftPosZ(128, 54).TopPosZ(284, 19))
|
||||
UNTYPED(n[3], LeftPosZ(184, 54).TopPosZ(284, 19))
|
||||
UNTYPED(n[4], LeftPosZ(240, 54).TopPosZ(284, 19))
|
||||
UNTYPED(n[5], LeftPosZ(296, 54).TopPosZ(284, 19))
|
||||
UNTYPED(n[6], LeftPosZ(352, 54).TopPosZ(284, 19))
|
||||
UNTYPED(n[7], LeftPosZ(408, 54).TopPosZ(284, 19))
|
||||
ITEM(LabelBox, dv___14, SetLabel(t_("Ruler")).LeftPosZ(8, 472).TopPosZ(100, 40))
|
||||
ITEM(Label, dv___15, SetLabel(t_("Ruler height")).LeftPosZ(16, 88).TopPosZ(112, 19))
|
||||
ITEM(UnitEdit, ruler, LeftPosZ(108, 68).TopPosZ(112, 19))
|
||||
ITEM(Label, dv___17, SetLabel(t_("Ink")).LeftPosZ(192, 76).TopPosZ(112, 20))
|
||||
ITEM(ColorPusher, rulerink, LeftPosZ(268, 92).TopPosZ(112, 19))
|
||||
ITEM(LabelBox, dv___19, SetLabel(t_("Indentation")).LeftPosZ(8, 176).TopPosZ(144, 124))
|
||||
ITEM(Label, dv___20, SetLabel(t_("Left margin")).LeftPosZ(16, 88).TopPosZ(164, 19))
|
||||
ITEM(UnitEdit, lm, LeftPosZ(108, 68).TopPosZ(164, 19))
|
||||
ITEM(Label, dv___22, SetLabel(t_("ParaLayout_rm_1_SetLabel\aRight margin")).LeftPosZ(16, 88).TopPosZ(188, 19))
|
||||
ITEM(UnitEdit, rm, LeftPosZ(108, 68).TopPosZ(188, 19))
|
||||
ITEM(Label, dv___24, SetLabel(t_("First line")).LeftPosZ(16, 88).TopPosZ(212, 19))
|
||||
ITEM(UnitEdit, indent, LeftPosZ(108, 68).TopPosZ(212, 19))
|
||||
ITEM(Label, dv___26, SetLabel(t_("Bullet")).LeftPosZ(16, 104).TopPosZ(236, 24))
|
||||
ITEM(DropList, bullet, LeftPosZ(124, 52).TopPosZ(236, 24))
|
||||
ITEM(LabelBox, dv___28, SetLabel(t_("Tabs")).LeftPosZ(192, 288).TopPosZ(144, 124))
|
||||
ITEM(ArrayCtrl, tabs, AutoHideSb(true).LeftPosZ(200, 272).TopPosZ(160, 72))
|
||||
ITEM(Label, dv___30, SetLabel(t_("Default tab size")).LeftPosZ(200, 196).TopPosZ(240, 20))
|
||||
ITEM(UnitEdit, tabsize, LeftPosZ(404, 68).TopPosZ(240, 19))
|
||||
ITEM(LabelBox, dv___32, SetLabel(t_("Numbering")).LeftPosZ(8, 472).TopPosZ(276, 68))
|
||||
ITEM(Label, dv___33, SetLabel(t_("Before number")).LeftPosZ(16, 100).TopPosZ(292, 20))
|
||||
ITEM(EditString, before_number, LeftPosZ(116, 72).TopPosZ(292, 19))
|
||||
ITEM(Label, dv___35, SetLabel(t_("After number")).LeftPosZ(208, 100).TopPosZ(292, 20))
|
||||
ITEM(EditString, after_number, LeftPosZ(308, 72).TopPosZ(292, 19))
|
||||
ITEM(Option, reset_number, SetLabel(t_("Reset")).LeftPosZ(396, 72).TopPosZ(292, 20))
|
||||
UNTYPED(n[0], LeftPosZ(16, 54).TopPosZ(320, 19))
|
||||
UNTYPED(n[1], LeftPosZ(72, 54).TopPosZ(320, 19))
|
||||
UNTYPED(n[2], LeftPosZ(128, 54).TopPosZ(320, 19))
|
||||
UNTYPED(n[3], LeftPosZ(184, 54).TopPosZ(320, 19))
|
||||
UNTYPED(n[4], LeftPosZ(240, 54).TopPosZ(320, 19))
|
||||
UNTYPED(n[5], LeftPosZ(296, 54).TopPosZ(320, 19))
|
||||
UNTYPED(n[6], LeftPosZ(352, 54).TopPosZ(320, 19))
|
||||
UNTYPED(n[7], LeftPosZ(408, 54).TopPosZ(320, 19))
|
||||
END_LAYOUT
|
||||
|
||||
LAYOUT(UnitLayout, 244, 144)
|
||||
|
|
|
|||
|
|
@ -184,6 +184,8 @@ String AsHtml(const RichTxt& text, const RichStyles& styles, Index<String>& css,
|
|||
else
|
||||
if(text.IsPara(i)) {
|
||||
RichPara p = text.Get(i, styles);
|
||||
if(p.format.ruler)
|
||||
html << "<HR>";
|
||||
String lbl;
|
||||
if(!IsNull(p.format.label)) {
|
||||
lbl = labels.Get(p.format.label, Null);
|
||||
|
|
@ -208,7 +210,7 @@ String AsHtml(const RichTxt& text, const RichStyles& styles, Index<String>& css,
|
|||
html << Format("<TD WIDTH=%d></TD>", q);
|
||||
html << Format("<TD VALIGN=\"top\" WIDTH=%d BGCOLOR=\"#F0F0F0\">\r\n",
|
||||
max(z * p.format.indent, 0));
|
||||
p.format.after = p.format.before = p.format.indent = p.format.lm = 0;
|
||||
p.format.ruler = p.format.after = p.format.before = p.format.indent = p.format.lm = 0;
|
||||
}
|
||||
String par = "<P" + FormatClass(css, HtmlParaStyle(p.format, z)) + ">";
|
||||
html << par;
|
||||
|
|
|
|||
|
|
@ -91,6 +91,9 @@ void QTFEncodeParaFormat(String& qtf, const RichPara::Format& format, const Rich
|
|||
FmtNumber(qtf, 'l', style.lm, format.lm);
|
||||
FmtNumber(qtf, 'r', style.rm, format.rm);
|
||||
FmtNumber(qtf, 'i', style.indent, format.indent);
|
||||
FmtNumber(qtf, 'H', style.ruler, format.ruler);
|
||||
if(style.rulerink != format.rulerink)
|
||||
qtf << "h" << FmtColor(format.rulerink);
|
||||
FmtNumber(qtf, 'b', style.before, format.before);
|
||||
FmtNumber(qtf, 'a', style.after, format.after);
|
||||
if(style.newpage != format.newpage)
|
||||
|
|
|
|||
|
|
@ -32,6 +32,10 @@ void RichTxt::FormatInfo::Combine(const RichPara::CharFormat& fmt)
|
|||
charvalid &= ~STRIKEOUT;
|
||||
NoStrikeout();
|
||||
}
|
||||
if(IsNonAntiAliased() != fmt.IsNonAntiAliased()) {
|
||||
charvalid &= ~NOAA;
|
||||
NoNonAntiAliased();
|
||||
}
|
||||
if(capitals != fmt.capitals) {
|
||||
charvalid &= ~CAPITALS;
|
||||
capitals = false;
|
||||
|
|
@ -114,9 +118,12 @@ void RichTxt::FormatInfo::Combine(const RichPara::Format& fmt)
|
|||
}
|
||||
if(styleid != fmt.styleid)
|
||||
paravalid &= ~STYLE;
|
||||
if(linespacing != fmt.linespacing) {
|
||||
if(linespacing != fmt.linespacing)
|
||||
paravalid &= ~SPACING;
|
||||
}
|
||||
if(ruler != fmt.ruler)
|
||||
paravalid &= ~RULER;
|
||||
if(rulerink != fmt.rulerink)
|
||||
paravalid &= ~RULERINK;
|
||||
}
|
||||
|
||||
void RichTxt::FormatInfo::ApplyTo(RichPara::CharFormat& fmt) const
|
||||
|
|
@ -129,6 +136,8 @@ void RichTxt::FormatInfo::ApplyTo(RichPara::CharFormat& fmt) const
|
|||
fmt.Underline(IsUnderline());
|
||||
if(charvalid & STRIKEOUT)
|
||||
fmt.Strikeout(IsStrikeout());
|
||||
if(charvalid & NOAA)
|
||||
fmt.NonAntiAliased(IsNonAntiAliased());
|
||||
if(charvalid & CAPITALS)
|
||||
fmt.capitals = capitals;
|
||||
if(charvalid & DASHED)
|
||||
|
|
@ -158,6 +167,8 @@ void RichTxt::FormatInfo::ApplyTo(RichPara::Format& fmt) const
|
|||
ApplyTo((RichPara::CharFormat &)fmt);
|
||||
if(paravalid & ALIGN)
|
||||
fmt.align = align;
|
||||
if(paravalid & RULER)
|
||||
fmt.ruler = ruler;
|
||||
if(paravalid & BEFORE)
|
||||
fmt.before = before;
|
||||
if(paravalid & LM)
|
||||
|
|
@ -194,6 +205,8 @@ void RichTxt::FormatInfo::ApplyTo(RichPara::Format& fmt) const
|
|||
fmt.styleid = styleid;
|
||||
if(paravalid & SPACING)
|
||||
fmt.linespacing = linespacing;
|
||||
if(paravalid & RULERINK)
|
||||
fmt.rulerink = rulerink;
|
||||
}
|
||||
|
||||
END_UPP_NAMESPACE
|
||||
|
|
|
|||
|
|
@ -108,7 +108,8 @@ struct RichPara {
|
|||
|
||||
struct Format : NumberFormat, CharFormat {
|
||||
int align;
|
||||
int before, lm, indent, rm, after;
|
||||
int ruler, before, lm, indent, rm, after;
|
||||
Color rulerink;
|
||||
int tabsize;
|
||||
int bullet;
|
||||
int linespacing;
|
||||
|
|
|
|||
|
|
@ -133,7 +133,8 @@ RichPara::CharFormat::CharFormat()
|
|||
RichPara::Format::Format()
|
||||
{
|
||||
align = ALIGN_LEFT;
|
||||
before = lm = rm = indent = after = 0;
|
||||
ruler = before = lm = rm = indent = after = 0;
|
||||
rulerink = Black;
|
||||
bullet = 0;
|
||||
keep = newpage = keepnext = orphan = false;
|
||||
tabsize = 296;
|
||||
|
|
@ -283,7 +284,7 @@ void RichPara::PackParts(Stream& out, const RichPara::CharFormat& chrstyle,
|
|||
String RichPara::Pack(const RichPara::Format& style, Array<RichObject>& obj) const
|
||||
{
|
||||
StringStream out;
|
||||
word pattr = 0;
|
||||
dword pattr = 0;
|
||||
if(format.align != style.align) pattr |= 1;
|
||||
if(format.before != style.before) pattr |= 2;
|
||||
if(format.lm != style.lm) pattr |= 4;
|
||||
|
|
@ -300,7 +301,9 @@ String RichPara::Pack(const RichPara::Format& style, Array<RichObject>& obj) con
|
|||
if(NumberingDiffers(format, style)) pattr |= 0x2000;
|
||||
if(format.linespacing != style.linespacing) pattr |= 0x4000;
|
||||
if(format.tab != style.tab) pattr |= 0x8000;
|
||||
out.Put16(pattr);
|
||||
if(format.ruler != style.ruler) pattr |= 0x10000;
|
||||
if(format.rulerink != style.rulerink) pattr |= 0x20000;
|
||||
out.Put32(pattr);
|
||||
if(pattr & 1) out.Put16(format.align);
|
||||
if(pattr & 2) out.Put16(format.before);
|
||||
if(pattr & 4) out.Put16(format.lm);
|
||||
|
|
@ -339,6 +342,12 @@ String RichPara::Pack(const RichPara::Format& style, Array<RichObject>& obj) con
|
|||
}
|
||||
}
|
||||
}
|
||||
if(pattr & 0x10000)
|
||||
out.Put16(format.ruler);
|
||||
if(pattr & 0x20000) {
|
||||
Color c = format.rulerink;
|
||||
c.Serialize(out);
|
||||
}
|
||||
obj.Clear();
|
||||
CharFormat cf = style;
|
||||
if(part.GetCount())
|
||||
|
|
@ -504,7 +513,7 @@ void RichPara::Unpack(const String& data, const Array<RichObject>& obj,
|
|||
|
||||
format = style;
|
||||
|
||||
word pattr = in.Get16();
|
||||
dword pattr = in.Get32();
|
||||
|
||||
if(pattr & 1) format.align = in.Get16();
|
||||
if(pattr & 2) format.before = in.Get16();
|
||||
|
|
@ -539,6 +548,10 @@ void RichPara::Unpack(const String& data, const Array<RichObject>& obj,
|
|||
w.fillchar = in.Get();
|
||||
}
|
||||
}
|
||||
if(pattr & 0x10000)
|
||||
format.ruler = in.Get16();
|
||||
if(pattr & 0x20000)
|
||||
format.rulerink.Serialize(in);
|
||||
part.Clear();
|
||||
int oi = 0;
|
||||
UnpackParts(in, style, part, obj, oi);
|
||||
|
|
@ -643,6 +656,7 @@ void RichPara::Mid(int pos)
|
|||
void RichPara::Dump()
|
||||
{
|
||||
LOG("RichPara dump" << LOG_BEGIN);
|
||||
LOG("RULER: " << format.ruler << " " << format.rulerink);
|
||||
LOG("BEFORE: " << format.before);
|
||||
LOG("INDENT: " << format.indent);
|
||||
LOG("LM: " << format.lm);
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ NAMESPACE_UPP
|
|||
RichPara::Lines RichPara::Begin(const Rect& page, PageY& py, int nbefore, int nline) const
|
||||
{
|
||||
Lines pl = FormatLines(page.Width());
|
||||
int cy = format.before;
|
||||
int cy = format.ruler + format.before;
|
||||
if(format.keep || format.keepnext)
|
||||
cy += pl.BodyHeight();
|
||||
else
|
||||
|
|
@ -23,7 +23,7 @@ RichPara::Lines RichPara::Begin(const Rect& page, PageY& py, int nbefore, int nl
|
|||
py.page++;
|
||||
py.y = page.top;
|
||||
}
|
||||
py.y += format.before;
|
||||
py.y += format.before + format.ruler;
|
||||
pl.Justify(format);
|
||||
return pl;
|
||||
}
|
||||
|
|
@ -153,6 +153,8 @@ void RichPara::Paint(PageDraw& pw, const Rect& page, PageY py, const PaintInfo&
|
|||
PageY opy = py;
|
||||
Lines pl = Begin(page, py, nbefore, nline);
|
||||
bool highlight = pi.highlightpara >= 0 && pi.highlightpara < pl.len;
|
||||
int hy = py.y - format.before - format.ruler;
|
||||
int phy = py.page;
|
||||
if(pi.sell < 0 && pi.selh > 0)
|
||||
for(int p = opy.page; p <= py.page; p++) {
|
||||
int top = z * (p == opy.page ? opy.y : page.top);
|
||||
|
|
@ -359,6 +361,10 @@ void RichPara::Paint(PageDraw& pw, const Rect& page, PageY py, const PaintInfo&
|
|||
pw.Page(py.page).DrawRect(z * page.left, top, z * page.right - z * page.left,
|
||||
z * min(py.y + format.after, page.bottom) - top, InvertColor);
|
||||
}
|
||||
if(format.ruler && hy >= 0 && hy + format.ruler < page.bottom)
|
||||
pw.Page(phy).DrawRect(z * page.left + z * format.lm, z * hy,
|
||||
z * page.right - z * page.left - z * format.rm - z * format.lm,
|
||||
max(1, z * format.ruler), format.rulerink);
|
||||
}
|
||||
|
||||
void RichPara::GetRichPos(RichPos& rp, int pos) const
|
||||
|
|
@ -552,6 +558,11 @@ void operator*=(RichPara::Format& format, Zoom z)
|
|||
{
|
||||
FontHeightRound(format, z);
|
||||
format.before *= z;
|
||||
if(format.ruler) {
|
||||
format.ruler *= z;
|
||||
if(format.ruler == 0)
|
||||
format.ruler = 1;
|
||||
}
|
||||
int ll = format.lm + format.indent;
|
||||
format.lm *= z;
|
||||
format.indent = z * ll - format.lm;
|
||||
|
|
|
|||
|
|
@ -228,9 +228,9 @@ void RichQtfParser::SetFormat()
|
|||
}
|
||||
|
||||
void RichQtfParser::Flush() {
|
||||
SetFormat();
|
||||
if(text.GetLength()) {
|
||||
ASSERT(!istable);
|
||||
paragraph.format = format;
|
||||
paragraph.Cat(text, format);
|
||||
text.Clear();
|
||||
}
|
||||
|
|
@ -639,6 +639,8 @@ void RichQtfParser::Parse(const char *qtf, byte _accesskey)
|
|||
case 'P': format.newpage = !format.newpage; break;
|
||||
case 'k': format.keep = !format.keep; break;
|
||||
case 'K': format.keepnext = !format.keepnext; break;
|
||||
case 'H': format.ruler = GetNumber(); break;
|
||||
case 'h': format.rulerink = GetColor(); break;
|
||||
case 'Q': format.orphan = !format.orphan; break;
|
||||
case 'n': format.before_number = GetText(';'); break;
|
||||
case 'm': format.after_number = GetText(';'); break;
|
||||
|
|
|
|||
|
|
@ -129,7 +129,7 @@ bool RichText::GetInvalid(PageY& top, PageY& bottom, const Rect& page,
|
|||
Sync(r_parti, rc);
|
||||
const Para& pp = part[r_parti].Get<Para>();
|
||||
if(r_paraocx == pp.cx &&
|
||||
r_paraocy == Sum(pp.linecy, 0) + pp.before + pp.after &&
|
||||
r_paraocy == Sum(pp.linecy, 0) + pp.ruler + pp.before + pp.after &&
|
||||
r_keep == pp.keep &&
|
||||
r_keepnext == pp.keepnext &&
|
||||
r_newpage == pp.newpage) {
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ public:
|
|||
LANG = 0x00001000,
|
||||
INDEXENTRY = 0x00002000,
|
||||
DASHED = 0x00004000,
|
||||
NOAA = 0x00008000,
|
||||
};
|
||||
|
||||
enum {
|
||||
|
|
@ -36,6 +37,8 @@ public:
|
|||
ORPHAN = 0x00020000,
|
||||
NUMBERING = 0x00010000,
|
||||
SPACING = 0x00008000,
|
||||
RULER = 0x00004000,
|
||||
RULERINK = 0x00002000,
|
||||
};
|
||||
|
||||
struct FormatInfo : RichPara::Format {
|
||||
|
|
@ -66,6 +69,7 @@ protected:
|
|||
Array<RichObject> object;
|
||||
mutable int cx;
|
||||
mutable int cy;
|
||||
mutable int ruler;
|
||||
mutable int before;
|
||||
mutable Vector<int> linecy;
|
||||
mutable int after;
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ void RichTxt::Sync0(const Para& pp, int parti, const RichContext& rc) const
|
|||
pp.cx = cx;
|
||||
RichPara p = Get(parti, rc.styles);
|
||||
RichPara::Lines pl = p.FormatLines(cx);
|
||||
pp.ruler = p.format.ruler;
|
||||
pp.before = p.format.before;
|
||||
pp.linecy.Clear();
|
||||
pp.linecy.SetCount(pl.GetCount());
|
||||
|
|
@ -60,7 +61,7 @@ PageY RichTxt::GetNextPageY(int parti, const RichContext& rc) const
|
|||
else {
|
||||
Sync(parti, rc);
|
||||
const Para& pp = part[parti].Get<Para>();
|
||||
int cy = pp.before;
|
||||
int cy = pp.before + pp.ruler;
|
||||
if(pp.keep || pp.keepnext)
|
||||
cy += pp.cy;
|
||||
else
|
||||
|
|
@ -72,7 +73,7 @@ PageY RichTxt::GetNextPageY(int parti, const RichContext& rc) const
|
|||
if(pp.keepnext && parti + 1 < part.GetCount() && part[parti + 1].Is<Para>()) {
|
||||
Sync(parti + 1, rc);
|
||||
const Para& p = part[parti + 1].Get<Para>();
|
||||
nbefore = p.before;
|
||||
nbefore = p.before + p.ruler;
|
||||
nline = p.linecy[0];
|
||||
}
|
||||
if(pp.newpage || py.y + cy + nbefore + nline > rc.page.bottom && cy < rc.page.Height()) {
|
||||
|
|
|
|||
|
|
@ -303,6 +303,10 @@ according to ISO 639 and ISO 3166 standards. (example: [*C@3 `"`[%EN`-US_...`]`"
|
|||
::= [s0; Line spacing 1.5.]
|
||||
::^ [s1;C [%00-00 pd]]
|
||||
::= [s0; Line spacing 2.0.]
|
||||
::^ [s1;/C@(0.0.255) [%00-00/@(128.0.255) H][%00-00 number]]
|
||||
::= [s0; Horizontal ruler height (if zero, there is no ruler).]
|
||||
::^ [s1;/C@(0.0.255) [%00-00/@(128.0.255) h][%00-00 color]]
|
||||
::= [s0; Color of horizontal ruler (default is black).]
|
||||
::^ [s1;/C@(0.0.255) [%00-00/@(128.0.255) b][%00-00 number]]
|
||||
::= [s0; Space before paragraph in dots.]
|
||||
::^ [s1;/C@(0.0.255) [%00-00/@(128.0.255) a][%00-00 number]]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue