[prev in list] [next in list] [prev in thread] [next in thread]
List: lyx-devel
Subject: Re: feature request
From: Andre Poenitz <andre.poenitz () mathematik ! tu-chemnitz ! de>
Date: 2006-04-10 10:25:47
Message-ID: 20060410102547.GD951 () millo ! mpi ! htwm ! de
[Download RAW message or body]
On Sun, Apr 09, 2006 at 02:15:51PM +0200, Leuven, E. wrote:
> > Also with active selection spanning more than the
> > current paragraph?
>
> no, it only handles single paragraphs.
>
> am trying to addresss this and have the following:
Better disable it when a selection is active. I doubt it is possible to
get (close to) right without using the cut&paste mechanism.
> case LFUN_PARAGRAPH_MOVE_DOWN: {
> pit_type begpit = cur.selBegin().pit()-1;
> pit_type pit = cur.selEnd().pit();
s/-/ - /
> bool counterUpdate = true;
> while (pit>begpit) {
> std::swap(pars_[pit], pars_[pit+1]);
> --pit;
> }
> ++cur.pit();
> if (cur.selection()) {
> // adjust selection
> }
>
> if (counterUpdate)
> updateCounters(cur.buffer());
> needsUpdate = true;
> break;
> }
Undo?
> i am not able to adjust the selection.
>
> ++cur.pit() moves the selection at the cursor side, but not at the
> point where the selection was started. hints?
Yes. Don't try it. There are dragons.
> second thing the code above does not do is flag whether we need to
> update the counters. the looping is over paragraphs, whereas
> needsCounterUpdate() wants a ParIterator...
I wonder (not related to this patch) whether the updateCounter stuff
should be made a bit more asynchronous from the user code's point of
view. I.e. just give the kernel a hint that certain counters are
out-of-date, but not actually re-create them.
Andre'
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic