mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-08-24 14:22:40 -06:00
RichText: fixed...
git-svn-id: svn://ultimatepp.org/upp/trunk@1528 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
73ed7a4fa5
commit
0c6ebc29e4
3 changed files with 5 additions and 3 deletions
|
|
@ -67,7 +67,7 @@ protected:
|
|||
int length;
|
||||
String content;
|
||||
Array<RichObject> object;
|
||||
LazyUpdate dirty;
|
||||
mutable LazyUpdate dirty;
|
||||
int64 updateserial;
|
||||
mutable int ccx;
|
||||
mutable int cy;
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@ void RichTxt::Para::Invalidate()
|
|||
{
|
||||
INTERLOCKED {
|
||||
static int64 ss;
|
||||
dirty.Invalidate();
|
||||
updateserial = ++ss;
|
||||
dirty.Invalidate();
|
||||
ccx = -1;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ void RichTxt::Sync0(const Para& pp, int parti, const RichContext& rc) const
|
|||
{
|
||||
int cx = rc.page.Width();
|
||||
pp.ccx = cx;
|
||||
RichPara p = Get(parti, rc.styles, true);
|
||||
RichPara p = Get(parti, rc.styles, false);
|
||||
RichPara::Lines pl = p.FormatLines(cx);
|
||||
pp.ruler = p.format.ruler;
|
||||
pp.before = p.format.before;
|
||||
|
|
@ -44,6 +44,8 @@ inline void RichTxt::Sync(int parti, const RichContext& rc) const {
|
|||
int cx = rc.page.Width();
|
||||
ASSERT(part[parti].Is<Para>());
|
||||
const Para& pp = part[parti].Get<Para>();
|
||||
if(rc.page.Width() != pp.ccx)
|
||||
pp.dirty.Invalidate();
|
||||
if(pp.dirty.BeginUpdate()) {
|
||||
Sync0(pp, parti, rc);
|
||||
pp.dirty.EndUpdate();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue