]> git.lyx.org Git - features.git/commitdiff
Fix compilation warnings on windows.
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 28 Jul 2014 07:46:13 +0000 (09:46 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 28 Jul 2014 07:46:13 +0000 (09:46 +0200)
src/Row.cpp
src/TextMetrics.cpp
src/frontends/qt4/ui/PrefLanguageUi.ui

index 1336d05a20bfbeb76f0dabf33b913a29dd64ac98..cab3ab750c0f17fccc0df093bc07d65ecbf1dae3 100644 (file)
@@ -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_) {
index a5f03648de854271f2261f8fb5d7e03a657f2ad3..0e16ab42b034ea1457d7977323f32b91e3692b7a 100644 (file)
@@ -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();
index 2684ee0ad6bd16fe0f7d0e72b337d0ab9eeecc59..44f2014b94e278965aa30be953a6cbd0268d1842 100644 (file)
   <tabstop>autoBeginCB</tabstop>
   <tabstop>autoEndCB</tabstop>
   <tabstop>markForeignCB</tabstop>
-  <tabstop>rtlGB</tabstop>
   <tabstop>logicalCursorRB</tabstop>
   <tabstop>visualCursorRB</tabstop>
  </tabstops>
   <include location="local">qt_i18n.h</include>
  </includes>
  <resources/>
- <connections>
-  <connection>
-   <sender>rtlGB</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>logicalCursorRB</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>139</x>
-     <y>317</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>162</x>
-     <y>348</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>rtlGB</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>visualCursorRB</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>139</x>
-     <y>317</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>228</x>
-     <y>348</y>
-    </hint>
-   </hints>
-  </connection>
-  <connection>
-   <sender>rtlGB</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>cursorMovementLA</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>139</x>
-     <y>317</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>72</x>
-     <y>348</y>
-    </hint>
-   </hints>
-  </connection>
- </connections>
 </ui>