[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lyx-devel
Subject:    RE: feature request
From:       "Leuven, E." <E.Leuven () uva ! nl>
Date:       2006-04-09 12:15:51
Message-ID: D1B515FFD30A1B4289F6E13EA363CAFDA17D96 () struik ! uva ! nl
[Download RAW message or body]


> 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:

	case LFUN_PARAGRAPH_MOVE_DOWN: {
		pit_type begpit = cur.selBegin().pit()-1;
		pit_type pit = cur.selEnd().pit();
		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;
	}


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?

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...

thanks, edwin



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic