#include "insets/insettext.h"
#include "frontends/Alert.h"
-#include "frontends/Clipboard.h"
#include "frontends/Dialogs.h"
#include "frontends/FileDialog.h"
#include "frontends/font_metrics.h"
#include "frontends/Gui.h"
#include "frontends/LyXView.h"
+#include "frontends/Selection.h"
#include "graphics/Previews.h"
xsel_cache_.set = cur.selection();
sel = cur.selectionAsString(false);
if (!sel.empty())
- owner_->gui().clipboard().put(sel);
+ owner_->gui().selection().put(sel);
}
}
bool singlePar = flags & Update::SinglePar;
needs_redraw_ = flags & (Update::Force | Update::SinglePar);
+ updateMetrics(singlePar);
+
if ((flags & (Update::FitCursor | Update::MultiParSel))
&& (fitCursor() || multiParSel())) {
needs_redraw_ = true;
// The coordinates of all these paragraphs are correct, cache them
int y = y1;
+ CoordCache::InnerParPosCache & parPos = theCoords.parPos()[text];
for (lyx::pit_type pit = pit1; pit <= pit2; ++pit) {
- y += text->getPar(pit).ascent();
- theCoords.parPos()[text][pit] = Point(0, y);
+ Paragraph & par = text->getPar(pit);
+ y += par.ascent();
+ parPos[pit] = Point(0, y);
if (singlepar && pit == cursor_.bottom().pit()) {
// In Single Paragraph mode, collect here the
// y1 and y2 of the (one) paragraph the cursor is in
- y1 = y - text->getPar(pit).ascent();
- y2 = y + text->getPar(pit).descent();
+ y1 = y - par.ascent();
+ y2 = y + par.descent();
}
- y += text->getPar(pit).descent();
+ y += par.descent();
}
if (singlepar) {