From: Jean-Marc Lasgouttes Date: Mon, 28 Jul 2014 07:46:13 +0000 (+0200) Subject: Fix compilation warnings on windows. X-Git-Tag: 2.2.0alpha1~1754 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=f9caebd29ff52ceee774af7152f0ad6bd1434071;p=features.git Fix compilation warnings on windows. --- diff --git a/src/Row.cpp b/src/Row.cpp index 1336d05a20..cab3ab750c 100644 --- a/src/Row.cpp +++ b/src/Row.cpp @@ -45,7 +45,7 @@ double Row::Element::pos2x(pos_type const i) const bool const rtl = font.isVisibleRightToLeft(); - int w = 0; + double w = 0; //handle first the two bounds of the element if (i == pos || type != STRING) w = rtl ? width() : 0; @@ -70,7 +70,7 @@ pos_type Row::Element::x2pos(double &x) const case STRING: { FontMetrics const & fm = theFontMetrics(font); // FIXME: is it really necessary for x to be a double? - int xx = x; + int xx = int(x); i = fm.x2pos(str, xx, rtl); x = xx; break; @@ -113,9 +113,9 @@ bool Row::Element::breakAt(double w) return false; str = str.substr(0, new_pos - pos); if (rtl) - dim.wid -= w; + dim.wid -= int(w); else - dim.wid = w; + dim.wid = int(w); endpos = new_pos; return true; } @@ -404,7 +404,7 @@ void Row::shortenIfNeeded(pos_type const keep, int const w) double max_w = w - x; if (first_below->breakAt(max_w)) { end_ = first_below->endpos; - dim_.wid = x + first_below->width(); + dim_.wid = int(x + first_below->width()); // If there are other elements, they should be removed. elements_.erase(boost::next(first_below), end); } else if (first_below->pos > pos_) { diff --git a/src/TextMetrics.cpp b/src/TextMetrics.cpp index a5f03648de..0e16ab42b0 100644 --- a/src/TextMetrics.cpp +++ b/src/TextMetrics.cpp @@ -627,7 +627,7 @@ void TextMetrics::computeRowMetrics(pit_type const pit, row.x += w; break; case LYX_ALIGN_CENTER: - row.dimension().wid = width - w / 2; + row.dimension().wid = width - int(w / 2); row.x += w / 2; break; } @@ -660,7 +660,7 @@ void TextMetrics::computeRowMetrics(pit_type const pit, for ( ; cit != cend; ++cit) { if (row.label_hfill && cit->endpos == body_pos && cit->type == Row::SPACE) - cit->dim.wid -= row.label_hfill * (nlh - 1); + cit->dim.wid -= int(row.label_hfill * (nlh - 1)); if (!cit->inset || !cit->inset->isHfill()) continue; if (pm.hfillExpansion(row, cit->pos)) @@ -680,7 +680,7 @@ int TextMetrics::labelFill(pit_type const pit, Row const & row) const Paragraph const & par = text_->getPar(pit); LBUFERR(par.beginOfBody() > 0 || par.isEnvSeparator(0)); - int w = 0; + double w = 0; Row::const_iterator cit = row.begin(); Row::const_iterator const end = row.end(); // iterate over elements before main body (except the last one, @@ -697,7 +697,7 @@ int TextMetrics::labelFill(pit_type const pit, Row const & row) const FontMetrics const & fm = theFontMetrics(text_->labelFont(par)); - return max(0, fm.width(label) - w); + return max(0, fm.width(label) - int(w)); } @@ -1108,10 +1108,10 @@ pos_type TextMetrics::getPosNearX(Row const & row, int & x, pos_type pos = row.pos(); boundary = false; if (row.empty()) - x = row.x; + x = int(row.x); else if (x <= row.x) { pos = row.front().left_pos(); - x = row.x; + x = int(row.x); } else if (x >= row.width() - row.right_margin) { pos = row.back().right_pos(); x = row.width() - row.right_margin; @@ -1123,7 +1123,7 @@ pos_type TextMetrics::getPosNearX(Row const & row, int & x, if (w <= x && w + cit->width() > x) { double x_offset = x - w; pos = cit->x2pos(x_offset); - x = x_offset + w; + x = int(x_offset + w); break; } w += cit->width(); diff --git a/src/frontends/qt4/ui/PrefLanguageUi.ui b/src/frontends/qt4/ui/PrefLanguageUi.ui index 2684ee0ad6..44f2014b94 100644 --- a/src/frontends/qt4/ui/PrefLanguageUi.ui +++ b/src/frontends/qt4/ui/PrefLanguageUi.ui @@ -305,7 +305,6 @@ autoBeginCB autoEndCB markForeignCB - rtlGB logicalCursorRB visualCursorRB @@ -313,54 +312,4 @@ qt_i18n.h - - - rtlGB - toggled(bool) - logicalCursorRB - setEnabled(bool) - - - 139 - 317 - - - 162 - 348 - - - - - rtlGB - toggled(bool) - visualCursorRB - setEnabled(bool) - - - 139 - 317 - - - 228 - 348 - - - - - rtlGB - toggled(bool) - cursorMovementLA - setEnabled(bool) - - - 139 - 317 - - - 72 - 348 - - - -