This commit is contained in:
Yuriy Skalko 2021-10-01 00:37:58 +03:00
parent 9a4a6ca079
commit 6a7c9d12f9
6 changed files with 17 additions and 17 deletions

View File

@ -209,7 +209,7 @@ pit_type Text::outerHook(pit_type par_offset) const
if (par.getDepth() == 0)
return pars_.size();
return depthHook(par_offset, depth_type(par.getDepth() - 1));
return depthHook(par_offset, par.getDepth() - 1);
}
@ -369,7 +369,7 @@ InsetText const & Text::inset() const
void Text::readParToken(Paragraph & par, Lexer & lex,
string const & token, Font & font, Change & change, ErrorList & errorList)
{
Buffer * buf = const_cast<Buffer *>(&owner_->buffer());
Buffer * buf = &owner_->buffer();
BufferParams & bp = buf->params();
if (token[0] != '\\') {

View File

@ -934,7 +934,7 @@ bool Text::deleteEmptyParagraphMechanism(Cursor & cur,
void Text::deleteEmptyParagraphMechanism(pit_type first, pit_type last, bool trackChanges)
{
pos_type last_pos = static_cast<pos_type>(pars_[last].size() - 1);
pos_type last_pos = pars_[last].size() - 1;
deleteEmptyParagraphMechanism(first, last, 0, last_pos, trackChanges);
}

View File

@ -434,7 +434,7 @@ bool TextMetrics::redoParagraph(pit_type const pit, bool const align_rows)
// environment? I think the answer is: when paragraphs are merged;
// when layout is set; when material is pasted.
if (par.brokenBiblio()) {
Cursor & cur = const_cast<Cursor &>(bv_->cursor());
Cursor & cur = bv_->cursor();
// In some cases, we do not know how to record undo
if (&cur.inset() == &text_->inset())
cur.recordUndo(pit, pit);
@ -700,7 +700,7 @@ void TextMetrics::setRowAlignment(Row & row, int width) const
// We don't have to look at the alignment if the row is already
// larger then the permitted width as then we force the
// LEFT_ALIGN'edness!
if (int(row.width()) >= max_width_)
if (row.width() >= max_width_)
return;
if (nh == 0) {
@ -1300,7 +1300,7 @@ pit_type TextMetrics::getPitNearY(int y)
ParagraphMetrics const & pm = it->second;
if (y < it->second.position() - int(pm.ascent())) {
if (y < it->second.position() - pm.ascent()) {
// We are looking for a position that is before the first paragraph in
// the cache (which is in priciple off-screen, that is before the
// visible part.
@ -1315,7 +1315,7 @@ pit_type TextMetrics::getPitNearY(int y)
ParagraphMetrics const & pm_last = par_metrics_[last->first];
if (y >= last->second.position() + int(pm_last.descent())) {
if (y >= last->second.position() + pm_last.descent()) {
// We are looking for a position that is after the last paragraph in
// the cache (which is in priciple off-screen), that is before the
// visible part.
@ -1334,7 +1334,7 @@ pit_type TextMetrics::getPitNearY(int y)
ParagraphMetrics const & pm2 = par_metrics_[it->first];
if (it->first >= pit && int(it->second.position()) - int(pm2.ascent()) <= y) {
if (it->first >= pit && it->second.position() - pm2.ascent() <= y) {
pit = it->first;
yy = it->second.position();
}
@ -1461,7 +1461,7 @@ void TextMetrics::setCursorFromCoordinates(Cursor & cur, int const x, int const
LBUFERR(pm.rows().size());
for (; r < int(pm.rows().size()) - 1; ++r) {
Row const & row = pm.rows()[r];
if (int(yy + row.height()) > y)
if (yy + row.height() > y)
break;
yy += row.height();
}

View File

@ -263,10 +263,10 @@ int VSpace::inPixels(BufferView const & bv) const
// This is how the skips are normally defined by LaTeX.
// But there should be some way to change this per document.
case SMALLSKIP:
return int(default_height / 4);
return default_height / 4;
case MEDSKIP:
return int(default_height / 2);
return default_height / 2;
case BIGSKIP:
return default_height;
@ -276,7 +276,7 @@ int VSpace::inPixels(BufferView const & bv) const
return 3 * default_height;
case HALFLINE:
return int(default_height / 2);
return default_height / 2;
case FULLLINE:
return default_height;

View File

@ -1231,8 +1231,8 @@ void GuiWorkArea::Private::resetScreen()
{
if (use_backingstore_) {
int const pr = p->pixelRatio();
screen_ = QImage(static_cast<int>(pr * p->viewport()->width()),
static_cast<int>(pr * p->viewport()->height()),
screen_ = QImage(pr * p->viewport()->width(),
pr * p->viewport()->height(),
QImage::Format_ARGB32_Premultiplied);
# if QT_VERSION >= 0x050000
screen_.setDevicePixelRatio(pr);

View File

@ -3990,14 +3990,14 @@ MatchResult findAdvFinalize(DocIterator & cur, MatchStringAdv const & match, Mat
max_match.match_len = actual_match_len;
maxl = len;
if (maxl - minl < 4)
len = (int)((maxl + minl)/2);
len = (maxl + minl)/2;
else
len = (int)(minl + (maxl - minl + 3)/4);
len = minl + (maxl - minl + 3)/4;
}
else {
// (actual_match_len < max_match.match_len)
minl = len + 1;
len = (int)((maxl + minl)/2);
len = (maxl + minl)/2;
}
}
len = minl;