Commit Graph

26284 Commits

Author SHA1 Message Date
Juergen Spitzmueller
d94b708a0f Tell updateBuffer whether an inset is deleted.
Fixes #11747
2020-03-06 13:23:01 +01:00
Juergen Spitzmueller
e6105275af Consider change tracking in setBeginOfBody()
Fixes #11749
2020-03-06 11:49:32 +01:00
Juergen Spitzmueller
21567a260c Use range-based loop 2020-03-06 11:20:46 +01:00
Juergen Spitzmueller
228d738868 Account for changes in insets when checking changes in selection
This is not ideal, see FIXME.

Fixes #11774
2020-03-06 10:53:54 +01:00
Scott Kostyshak
b38a452efb Fix Qt deprecation warning for isItemSelected()
These methods are related to the deprecated setItemSelected() and
setItemHidden() methods that were converted at 24926b2e.
2020-03-05 20:38:31 -05:00
Scott Kostyshak
273af8803d Fix Qt deprecation warning for setItemHidden()
Consistent with commit 24926b2e.
2020-03-05 20:38:31 -05:00
Scott Kostyshak
27ca2bd950 Rename a var "sort" to not mask std::sort()
This allows us to use sort() without the "std" prefix.
2020-03-05 12:46:48 -05:00
Scott Kostyshak
14f369b47f Fix deprecation warnings from use of qSort()
This commit replaces qSort with std::sort to fix warnings from compiling with
Qt 5.14.1. Below is one of the warnings:

  error: ‘void qSort(RandomAccessIterator, RandomAccessIterator, LessThan) [with RandomAccessIterator = QList<lyx::ColorCode>::iterator; LessT$
  an = bool (*)(lyx::ColorCode, lyx::ColorCode)]’ is deprecated: Use std::sort [-Werror=deprecated-declarations]

qSort() has been deprecated since Qt 5.2. Quoting from the ChangeLog [1]:

  With STL no longer being optional for building and using Qt, a number of
  parts of QtAlgorithms no longer make sense, and have therefore been
  deprecated. Replacements are available in the STL, and generally have
  much better performance

There are some cases that require more than just a trivial substitution, but
our code does not appear to use any of those cases.

For some discussion on the differences in speed of std::sort() and
qSort(), see the following:

  https://phabricator.kde.org/D10857

These are just warnings now, but will likely be errors with Qt 6:

  https://bugreports.qt.io/browse/QTBUG-73048

I tested that LyX can still be built against Qt 4.8.7 with this commit.

This commit follows 24926b2e, which also fixes some deprecation warnings.

[1]
https://code.qt.io/cgit/qt/qtbase.git/tree/dist/changes-5.2.0/?h=v5.2.0
2020-03-05 12:44:39 -05:00
Scott Kostyshak
24926b2e23 Fix a few deprecation warnings in Qt 5.14.1
These changes fix a few instances of the following type of warning:

  error: ‘void QListWidget::setItemSelected(const QListWidgetItem*, bool)’ is deprecated: Use QListWidgetItem::setSelected() instead [-Werror=deprecated-declarations]

as well as similar warnings for setItemHidden() and
setItemExpanded(). These are just warnings now, but it is planned to
remove the methods for Qt 6:

  https://bugreports.qt.io/browse/QTBUG-73048

I tested that LyX can still be built against Qt 4.8.7 with this
commit. Indeed, these methods have been deprecated for a while (it
is just that QT_DEPRECATED_WARNINGS was only turned on by default
starting with 5.13.0). See, e.g.,

  https://doc.qt.io/archives/qt-4.7/qlistwidget-obsolete.html
2020-03-05 11:12:31 -05:00
Richard Kimberly Heck
e5b6be0712 Fix bug #10316.
By sending the request through the usual dispatch machinery, we
make sure the cursor is valid when we're done.
2020-03-03 23:17:09 -05:00
Richard Kimberly Heck
15659fed53 Andr'e points out this is wrong. Of course it is, since that is not a pointer. 2020-03-03 14:27:03 -05:00
Jean-Marc Lasgouttes
e99436b529 Do not display caret when we're not ready
Using a dialog may trigger a redraw at times where the metrics caches
have not been updated yet. To fix this, do as in paintEvent() and
abort caret blinking if there is an open undo group.

Move the decision to skip the caret painting to showCaret(), closer to
where real work happens. hideCaret () is now an alias for
showCaret(false), which allows some code refactoring.

See also commit c7496a11b2.

Fixes bug #11763 (although it does not trigger on master).
2020-03-03 12:30:27 +01:00
Richard Kimberly Heck
84e91772eb Fix nullptr warning 2020-03-03 00:08:46 -05:00
Richard Kimberly Heck
37c5cae58b Send a DispatchResult object with dispatch requests to the TOC.
This allows us to request a buffer update.
2020-03-03 00:08:06 -05:00
Richard Kimberly Heck
bd0bf2125c Fix nullptr warnings 2020-03-01 15:31:58 -05:00
Kornel Benko
9c4642fbcc Cmake tests: Amend f6f51587 2020-02-29 20:37:04 +01:00
Richard Kimberly Heck
4a81983edd Avoid a copy. 2020-02-29 05:55:20 -05:00
Richard Kimberly Heck
585823704a Fix warnings and use ranges. 2020-02-29 00:21:02 -05:00
Richard Kimberly Heck
9afc001fc5 Fix warnings 2020-02-29 00:21:00 -05:00
Richard Kimberly Heck
33d663720b Fix a bunch of warnings 2020-02-29 00:06:35 -05:00
Richard Kimberly Heck
99bf96c56b Fix warnings in support/. 2020-02-29 00:06:35 -05:00
Richard Kimberly Heck
4460df3292 Fix header. 2020-02-29 00:06:35 -05:00
Richard Kimberly Heck
56a5a8280e Null pointers. 2020-02-29 00:06:35 -05:00
Richard Kimberly Heck
8d26ae57ba Use ranges, fix warning 2020-02-28 01:55:05 -05:00
Richard Kimberly Heck
5baca8171f Use ranges, fix warning 2020-02-28 01:48:10 -05:00
Richard Kimberly Heck
969a1bab7d Use range 2020-02-28 01:44:48 -05:00
Richard Kimberly Heck
12d164393e Fix nullptr warnings 2020-02-28 01:42:32 -05:00
Richard Kimberly Heck
cf37ad8c80 Use ranges, fix warnings 2020-02-28 01:40:30 -05:00
Richard Kimberly Heck
084baebbf9 Fix nullptr warnings 2020-02-28 01:28:08 -05:00
Richard Kimberly Heck
3f9aa81452 Use ranges, fix warnings 2020-02-28 01:25:30 -05:00
Richard Kimberly Heck
94f64cd304 Fix warnings 2020-02-28 01:21:02 -05:00
Richard Kimberly Heck
5728625b65 Fix warnings 2020-02-28 01:16:21 -05:00
Richard Kimberly Heck
a9e663546b Use range 2020-02-28 01:16:10 -05:00
Richard Kimberly Heck
31c511d2ce Fix warnings 2020-02-28 01:09:45 -05:00
Richard Kimberly Heck
83779e7972 Use range and rename private variable 2020-02-28 01:08:28 -05:00
Richard Kimberly Heck
5b5b6998cb Use more ranges 2020-02-28 01:06:22 -05:00
Richard Kimberly Heck
7a66c93265 Use ranges 2020-02-28 00:52:38 -05:00
Richard Kimberly Heck
81597aabdb Polish 2020-02-28 00:39:50 -05:00
Richard Kimberly Heck
62af7ee772 More requires --> required, for C++2a. 2020-02-28 00:36:55 -05:00
Richard Kimberly Heck
21b4ecca7f Apparently, "requires" is a keyword in C++2a. 2020-02-28 00:28:18 -05:00
Richard Kimberly Heck
0dc9fca86e Remove code that has not been used since 2010.
See 208acbc72.
2020-02-28 00:21:48 -05:00
Richard Kimberly Heck
b750941910 Stop dialogs from updating twice all the time.
I've long wondered why dialogs seem to update twice when it seems
they just need to update once. It seems it was this code. But it
was only put there to deal with a problem with code in the button
controllers that was disabled in 2007! So I'm going to try removing
it. If we start seeing weird behavior with dialogs in master, then
this will be why.
2020-02-28 00:11:45 -05:00
Richard Kimberly Heck
f53243f81b Fix warnings 2020-02-28 00:10:23 -05:00
Richard Kimberly Heck
78ade7e6ec Remove code that has not been used for 13 years. 2020-02-28 00:08:30 -05:00
Richard Kimberly Heck
1948391a94 Fix warnings. 2020-02-28 00:07:53 -05:00
Richard Kimberly Heck
c483565522 Fix a bunch of warnings. 2020-02-27 23:58:01 -05:00
Richard Kimberly Heck
2165855d5e Revert unintended change 2020-02-27 14:36:46 -05:00
Richard Kimberly Heck
f4d5122a10 Fix null pointer warnings. 2020-02-27 00:05:41 -05:00
Richard Kimberly Heck
79bcf68018 Fix warning (and simplify) 2020-02-26 23:37:24 -05:00
Richard Kimberly Heck
64f7da961a Fix bug #11748.
Track the last chosen citation style when we clear the entries.
2020-02-26 23:00:09 -05:00