]> git.lyx.org Git - features.git/commitdiff
Fix warnings
authorRichard Kimberly Heck <rikiheck@lyx.org>
Mon, 18 May 2020 05:15:50 +0000 (01:15 -0400)
committerRichard Kimberly Heck <rikiheck@lyx.org>
Mon, 18 May 2020 05:15:50 +0000 (01:15 -0400)
src/frontends/qt/GuiWorkArea.cpp
src/frontends/qt/GuiWorkArea.h

index 90b17bae6ca93bedce26a82c0e5f739e18f4e2ec..424d22cc020bb7c74763ff37edbd698509a1dd62 100644 (file)
@@ -239,7 +239,7 @@ SyntheticMouseEvent::SyntheticMouseEvent()
 
 
 GuiWorkArea::Private::Private(GuiWorkArea * parent)
-: p(parent), buffer_view_(0), lyx_view_(0), caret_(0),
+: p(parent), buffer_view_(nullptr), lyx_view_(nullptr), caret_(nullptr),
   caret_visible_(false), need_resize_(false), preedit_lines_(1),
   last_pixel_ratio_(1.0), completer_(new GuiCompleter(p, p)),
   dialog_mode_(false), shell_escape_(false), read_only_(false),
@@ -1206,7 +1206,7 @@ void GuiWorkArea::Private::paintPreeditText(GuiPainter & pain)
        bool cursor_is_visible = false;
        for (auto const & attr : preedit_attr_) {
                if (attr.type == QInputMethodEvent::Cursor) {
-                       cursor_pos = attr.start;
+                       cursor_pos = size_t(attr.start);
                        cursor_is_visible = attr.length != 0;
                        break;
                }
@@ -1225,8 +1225,8 @@ void GuiWorkArea::Private::paintPreeditText(GuiPainter & pain)
                        if (attr.type == QInputMethodEvent::TextFormat) {
                                if (attr.start <= int(cursor_pos)
                                        && int(cursor_pos) < attr.start + attr.length) {
-                                               rStart = attr.start;
-                                               rLength = attr.length;
+                                               rStart = size_t(attr.start);
+                                               rLength = size_t(attr.length);
                                                if (!cursor_is_visible)
                                                        cursor_pos += rLength;
                                                break;
@@ -1752,11 +1752,11 @@ GuiWorkArea * TabWorkArea::workArea(Buffer & buffer) const
        // showing the same buffer.
        for (int i = 0; i != count(); ++i) {
                GuiWorkArea * wa = workArea(i);
-               LASSERT(wa, return 0);
+               LASSERT(wa, return nullptr);
                if (&wa->bufferView().buffer() == &buffer)
                        return wa;
        }
-       return 0;
+       return nullptr;
 }
 
 
@@ -2011,7 +2011,7 @@ bool operator==(DisplayPath const & a, DisplayPath const & b)
 
 void TabWorkArea::updateTabTexts()
 {
-       size_t n = count();
+       int const n = count();
        if (n == 0)
                return;
        std::list<DisplayPath> paths;
@@ -2019,7 +2019,7 @@ void TabWorkArea::updateTabTexts()
 
        // collect full names first: path into postfix, empty prefix and
        // filename without extension
-       for (size_t i = 0; i < n; ++i) {
+       for (int i = 0; i < n; ++i) {
                GuiWorkArea * i_wa = workArea(i);
                FileName const fn = i_wa->bufferView().buffer().fileName();
                paths.push_back(DisplayPath(i, fn));
index 22e8bfdc0a32cc0589ee605230d714520baf8490..6aae1dfdd4f07351f5b68eecbd85482b04673cb6 100644 (file)
@@ -212,7 +212,7 @@ class TabWorkArea : public QTabWidget
 {
        Q_OBJECT
 public:
-       TabWorkArea(QWidget * parent = 0);
+       TabWorkArea(QWidget * parent = nullptr);
 
        /// hide QTabWidget methods
        GuiWorkAreaContainer * currentWidget() const;
@@ -293,7 +293,7 @@ protected:
 
 public:
        /// wa != 0
-       GuiWorkAreaContainer(GuiWorkArea * wa, QWidget * parent = 0);
+       GuiWorkAreaContainer(GuiWorkArea * wa, QWidget * parent = nullptr);
        /// non-null
        GuiWorkArea * workArea() const { return wa_; }
 };