From 49f828dcd1e4db41babd48b5ce2edcc1dc920554 Mon Sep 17 00:00:00 2001 From: cxl Date: Tue, 9 Sep 2008 10:04:46 +0000 Subject: [PATCH] git-svn-id: svn://ultimatepp.org/upp/trunk@413 f0d560ea-af0d-0410-9eb7-867de7ffcac7 --- uppsrc/RichEdit/ParaFormat.cpp | 14 ++++++ uppsrc/RichEdit/RichEdit.lay | 61 +++++++++++++----------- uppsrc/RichText/EncodeHTML.cpp | 4 +- uppsrc/RichText/EncodeQtf.cpp | 3 ++ uppsrc/RichText/Format.cpp | 17 ++++++- uppsrc/RichText/Para.h | 3 +- uppsrc/RichText/ParaData.cpp | 22 +++++++-- uppsrc/RichText/ParaPaint.cpp | 15 +++++- uppsrc/RichText/ParseQtf.cpp | 4 +- uppsrc/RichText/TextPaint.cpp | 2 +- uppsrc/RichText/Txt.h | 4 ++ uppsrc/RichText/TxtPaint.cpp | 5 +- uppsrc/RichText/srcdoc.tpp/QTF$en-us.tpp | 4 ++ 13 files changed, 116 insertions(+), 42 deletions(-) diff --git a/uppsrc/RichEdit/ParaFormat.cpp b/uppsrc/RichEdit/ParaFormat.cpp index 2dd0b2aa5..eeb6a8bf1 100644 --- a/uppsrc/RichEdit/ParaFormat.cpp +++ b/uppsrc/RichEdit/ParaFormat.cpp @@ -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 { diff --git a/uppsrc/RichEdit/RichEdit.lay b/uppsrc/RichEdit/RichEdit.lay index 3aee0baaa..6a227a856 100644 --- a/uppsrc/RichEdit/RichEdit.lay +++ b/uppsrc/RichEdit/RichEdit.lay @@ -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) diff --git a/uppsrc/RichText/EncodeHTML.cpp b/uppsrc/RichText/EncodeHTML.cpp index 074551287..ad0c0bfdc 100644 --- a/uppsrc/RichText/EncodeHTML.cpp +++ b/uppsrc/RichText/EncodeHTML.cpp @@ -184,6 +184,8 @@ String AsHtml(const RichTxt& text, const RichStyles& styles, Index& css, else if(text.IsPara(i)) { RichPara p = text.Get(i, styles); + if(p.format.ruler) + html << "
"; 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& css, html << Format("", q); html << Format("\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 = ""; html << par; diff --git a/uppsrc/RichText/EncodeQtf.cpp b/uppsrc/RichText/EncodeQtf.cpp index a8ce404b5..4b9c1dd28 100644 --- a/uppsrc/RichText/EncodeQtf.cpp +++ b/uppsrc/RichText/EncodeQtf.cpp @@ -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) diff --git a/uppsrc/RichText/Format.cpp b/uppsrc/RichText/Format.cpp index b5fe76758..ce501aaa2 100644 --- a/uppsrc/RichText/Format.cpp +++ b/uppsrc/RichText/Format.cpp @@ -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 diff --git a/uppsrc/RichText/Para.h b/uppsrc/RichText/Para.h index 164beecad..0ace473bc 100644 --- a/uppsrc/RichText/Para.h +++ b/uppsrc/RichText/Para.h @@ -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; diff --git a/uppsrc/RichText/ParaData.cpp b/uppsrc/RichText/ParaData.cpp index 9c6298eec..e70256eb2 100644 --- a/uppsrc/RichText/ParaData.cpp +++ b/uppsrc/RichText/ParaData.cpp @@ -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& 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& 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& 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& 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& 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); diff --git a/uppsrc/RichText/ParaPaint.cpp b/uppsrc/RichText/ParaPaint.cpp index 444c37384..b34aaad54 100644 --- a/uppsrc/RichText/ParaPaint.cpp +++ b/uppsrc/RichText/ParaPaint.cpp @@ -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; diff --git a/uppsrc/RichText/ParseQtf.cpp b/uppsrc/RichText/ParseQtf.cpp index ac89250d2..3b0ffa737 100644 --- a/uppsrc/RichText/ParseQtf.cpp +++ b/uppsrc/RichText/ParseQtf.cpp @@ -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; diff --git a/uppsrc/RichText/TextPaint.cpp b/uppsrc/RichText/TextPaint.cpp index 0469c292b..2a8e7c66d 100644 --- a/uppsrc/RichText/TextPaint.cpp +++ b/uppsrc/RichText/TextPaint.cpp @@ -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(); 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) { diff --git a/uppsrc/RichText/Txt.h b/uppsrc/RichText/Txt.h index 807f77c88..56fa03ab8 100644 --- a/uppsrc/RichText/Txt.h +++ b/uppsrc/RichText/Txt.h @@ -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 object; mutable int cx; mutable int cy; + mutable int ruler; mutable int before; mutable Vector linecy; mutable int after; diff --git a/uppsrc/RichText/TxtPaint.cpp b/uppsrc/RichText/TxtPaint.cpp index 3cbe46f85..9614b2338 100644 --- a/uppsrc/RichText/TxtPaint.cpp +++ b/uppsrc/RichText/TxtPaint.cpp @@ -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(); - 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()) { Sync(parti + 1, rc); const Para& p = part[parti + 1].Get(); - 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()) { diff --git a/uppsrc/RichText/srcdoc.tpp/QTF$en-us.tpp b/uppsrc/RichText/srcdoc.tpp/QTF$en-us.tpp index 3aeca92f8..2d3fb43ca 100644 --- a/uppsrc/RichText/srcdoc.tpp/QTF$en-us.tpp +++ b/uppsrc/RichText/srcdoc.tpp/QTF$en-us.tpp @@ -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]]