Commit Graph

26433 Commits

Author SHA1 Message Date
Scott Kostyshak
d255339a4c Remove remnants regarding old XLFD font handling
These fonts are no longer supported by Qt 5 and our code no longer
uses the "xlfd" member of the struct modified in this commit. See
d4ff3a2959.
2020-03-19 12:39:16 -04:00
Scott Kostyshak
d4ff3a2959 Fix Qt dep warn and remove XLFD font workaround
This commit fixes a few warnings from Qt 5.14 regarding
QFont::setRawName() and QFont::rawName() like the following one:

  error: ‘void QFont::setRawName(const QString&)’ is deprecated [-Werror=deprecated-declarations]

These methods were deprecated in Qt 5.3. [1]

This commit removes code from 2002 (539ce478) that worked around a
problem in Qt's handling of XLFD fonts that no longer seems relevant
since XLFD is no longer supported in Qt 5 [2]. Even if the problem
were relevant, setRawName() would not fix anything since it is now
an empty method. [3]

I tested that compilation with Qt 4.8.7 works without error.

[1] https://code.qt.io/cgit/qt/qtbase.git/tree/dist/changes-5.3.0/?h=v5.14.0
[2] https://code.qt.io/cgit/qt/qtbase.git/commit/?id=3a8d7b0b9a4db91415b7bda2582a59a76b3754dc
[3] https://codereview.qt-project.org/c/qt/qtbase/+/100292/
2020-03-19 12:30:27 -04:00
Scott Kostyshak
8583410617 Fix Qt deprecation warns for setTextColor()
This commit fixes the following warning from Qt 5.14:

  error: ‘void QTreeWidgetItem::setTextColor(int, const QColor&)’ is deprecated: Use QTreeWidgetItem::setForeground() instead [-Werror=deprecated-declarations]

setForeground was introduced in Qt 4.2 [1].

We have a couple of commented out uses of a setTextColor() method in
GuiDocument.cpp, but the QTextEdit::setTextColor() is not deprecated so no
change is needed.

[1] https://doc.qt.io/archives/qt-4.8/qtreewidgetitem.html#setForeground
2020-03-19 10:16:47 -04:00
Scott Kostyshak
1d015ee9f3 Fix commented out code 2020-03-19 10:16:47 -04:00
Scott Kostyshak
27ba830b8e Fix Qt deprecation warns for setAutoCompletion()
This commit fixes a few warnings from Qt 5.14 like the following
one:

  error: ‘void QComboBox::setAutoCompletion(bool)’ is deprecated: Use setCompleter() instead. [-Werror=deprecated-declarations]

We only generated setAutoCompletion() from setting the property in
the .ui files. There does not seem to be a .ui file property that
generates setCompleter(). However, the default in both Qt5 [1] and
Qt4 [2] is to enable case-insensitive autocompletion, which seems to
be the same type of autocompletion as when we were relying on
setAutoCompletion(true). Thus, we can remove the properties that set
autocomplete to true. There is only one file, SearchUi.ui, where we
were turning off the autocompletion; we now do so using
setCompleter(0) in GuiSearch::GuiSearch().

[1] https://doc.qt.io/qt-5/qcombobox.html#setCompleter
[2] https://doc.qt.io/archives/qt-4.8/qcombobox.html#setCompleter
2020-03-18 23:17:44 -04:00
Richard Kimberly Heck
861c6167ca Track whether we have warned about mixing layouts across e.g. branches. 2020-03-17 01:54:47 -04:00
Richard Kimberly Heck
b536759c07 Track whether title has been issued via OutputParams.
When branches are used in the title, we may need to track whether
we've issued the title across branch insets. So we put the relevant
variables into OutputParams.
2020-03-17 01:50:28 -04:00
Richard Kimberly Heck
7af6575cf6 Fix bug #11787.
Make sure we are actually at the end of the document before issuing
\maketitle because we are at the end of the document.
2020-03-17 01:39:07 -04:00
Richard Kimberly Heck
771940d5d7 Remove unused function 2020-03-16 02:18:19 -04:00
Richard Kimberly Heck
cf14e81412 Fix some warnings 2020-03-16 02:12:16 -04:00
Richard Kimberly Heck
4732da8dc2 Nullptr warnings 2020-03-16 02:09:39 -04:00
Richard Kimberly Heck
ada09a2cda Fix warning about 'requires' being a keyword. 2020-03-16 01:31:30 -04:00
Richard Kimberly Heck
7c7ea3113f Use ranges and fix nullptr warnings. 2020-03-16 01:31:30 -04:00
Scott Kostyshak
24e0bd3afe Fix Qt deprecation warns for QTime
This commit fixes a couple of warnings from Qt 5.14 like the
following one:

  error: ‘int QTime::restart()’ is deprecated: Use QElapsedTimer instead [-Werror=deprecated-declarations]

This commit changes two uses of QTime to QElapsedTimer, one used
only when the "files" debug flag is set, and the other for timing
whether a script (e.g., knitr) takes longer than a certain amount of
time to run.

QElapsedTimer is superior for these two use cases in that it uses a
monotonic clock if possible, and is thus more robust to certain
changes (e.g., daylight savings changes) [1]. Similarly, the commit
in Qt Base that makes this deprecation [2] mentions the following in
the commit message:

  QElapsedTimer does the job better and without the DST kludges.

Note that QElapsedTimer class was introduced in Qt 4.7, so no
conditioning on Qt version is necessary.

Not all methods of QTime are deprecated and we still use some of
the non-deprecated methods in our code (e.g., to get the current
wall clock time in GuiProgress::currentTime()).

[1] https://doc.qt.io/qt-5/qelapsedtimer.html
[2] https://code.qt.io/cgit/qt/qtbase.git/commit/?id=ed99a591a83a399458f12341d0a1c0b3152f247a
2020-03-15 22:47:08 -04:00
Juergen Spitzmueller
9a31c1b90b update tex2lyx tests 2020-03-15 17:19:23 +01:00
Juergen Spitzmueller
4d7f4762a1 Outliner: Add filter combo for non-output items
Addresses #11442, #10786
2020-03-15 10:46:35 +01:00
Richard Kimberly Heck
f044d3a359 Fix bug #11780.
The preamble snippets are for LaTeX and do not need to be output
with HTML.
2020-03-14 18:31:25 -04:00
Richard Kimberly Heck
5333998570 Use a reference 2020-03-14 18:06:18 -04:00
Juergen Spitzmueller
b96ce9a9c1 Outliner: distinguish non-active refs from broken refs
See #11782
2020-03-14 16:29:53 +01:00
Juergen Spitzmueller
0f9ef6877c Add active refs to non-active labels to brokenrefs toc 2020-03-14 15:35:47 +01:00
Juergen Spitzmueller
a1da60642c Add outliner section for broken refs and citations 2020-03-14 15:18:28 +01:00
Juergen Spitzmueller
4ddc9e2501 Color broken citations, xrefs, and includes
Fixes #11503
2020-03-14 14:17:30 +01:00
Juergen Spitzmueller
bb277747d2 Support log parsing for multi-line warnings wrt undefined references 2020-03-14 11:16:12 +01:00
Juergen Spitzmueller
037b1e1478 thinko 2020-03-14 09:51:07 +01:00
Juergen Spitzmueller
02d2e4aa32 Do not break on undefined references that are part of the family.
Thus a document can be viewed if it contains references to
its master, children or siblings that are being excluded via includeonly,
or viewed standalone if it contains references to its master or siblings.
2020-03-14 09:43:57 +01:00
Juergen Spitzmueller
38a46b43c7 Improve error message 2020-03-14 09:43:16 +01:00
Juergen Spitzmueller
59e3ff27ff Fixup tooltips 2020-03-13 16:24:51 +01:00
Jean-Marc Lasgouttes
7d54d78691 Revert "Do not display caret when we're not ready"
I did not mean to push this.

This reverts commit 9bc255dc89.
2020-03-13 16:23:01 +01:00
Jean-Marc Lasgouttes
65e0aa767d remove constructs and comments about old compilers 2020-03-13 16:15:41 +01:00
Jean-Marc Lasgouttes
9bc255dc89 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-13 16:02:36 +01:00
Juergen Spitzmueller
f4af191403 Introduce maintain unincluded children "mostly"
This is a mode for includeonly handling that is effective and still outputs
at least mostly correct counters and references. This is intended for non-
final editing work.

File format change.
2020-03-13 15:46:35 +01:00
Scott Kostyshak
36208d488e Fix preview check box for include insets
GuiInclude::initialiseParams() calls InsetCommand::string2params()
which calls InsetCommandParams::clear(), however this last function
did not reset the special "preview_" parameter. Now this parameter
is reset to false as part of clear().

The ParamData class documents (see InsetCommandParams.h) the
following:

  // No parameter may be named "preview", because that is a required
  // flag for all commands.

Thus, we must handle preview_ separately from the other parameters.

This commit fixes #11779.
2020-03-13 10:16:24 -04:00
Juergen Spitzmueller
6c889209a7 Improve performance of includeonly with "maintain counters and references"
First, we do not need to run bibtex/biber on the maintenance run, as
the necessary references will be generated on the includeonly run.

Second, exclude the master from DepTable in maintenance run, as the
master is re-checked in any case in the includeonly run, and as it will
always be detected as changed due to the \includeonly statement, which
will trigger a complete build.

More improvements to follow.
2020-03-13 11:49:07 +01:00
Scott Kostyshak
2b86751057 Fix correction with continuous spellcheck
This commit amends 8d26ae57ba.
2020-03-12 22:22:40 -04:00
Juergen Spitzmueller
b568a49593 Fix UI quirk in IncludeOnly settings
Fixes #11564
2020-03-12 10:37:56 +01:00
Scott Kostyshak
adb7283b69 outline-up/down: preserve cursor's position
There is no need to change the cursor's position to the beginning of
the line.

This change does not affect the behavior of using the buttons in the
Outliner pane, but is useful for using the keyboard shortcuts.
2020-03-11 14:19:05 -04:00
Scott Kostyshak
2cfcd706ab Fix Qt deprecation warns for setting tab
Fix warnings coming from deprecations of QTextEdit::tabStopWidth()
and QFontMetrics::width(). Regarding tabStopWidth(), the ChangeLog
states the following [1]:

  Introduced tabStopDistance property in QTextOption, QTextEdit and
  QPlainTextEdit as replacement for the inconsistently named tabStop and
  tabStopWidth properties. QTextOption::tabStop, QTextEdit::tabStopWidth and
  QPlainTextEdit::tabStopWidth are now deprecated.

Note that QFontMetrics::horizontalAdvance() is what we want here, as
opposed to QFontMetrics::boundingRect(), because we want to know
where to draw the next character after the tab.

[1] https://code.qt.io/cgit/qt/qtbase.git/tree/dist/changes-5.10.0/?h=v5.10.0
2020-03-08 11:48:54 -04:00
Stephan Witt
0885098bd3 #11747 follow-up of change d94b708a0f to fix a compiler warning 2020-03-08 13:33:30 +01:00
Scott Kostyshak
2ee5d3c3d5 Revert "Do not display caret when we're not ready"
This reverts commit e99436b529.

Kornel discovered a regression due to this commit. See:

  https://www.mail-archive.com/search?l=mid&q=20200307121525.56be047b%40admin1-desktop
2020-03-07 16:50:59 -05:00
Richard Kimberly Heck
c32e37b702 Revert b7509419.
There are double updates of dialogs in some cases, but this isn't why.
2020-03-07 16:04:01 -05:00
Juergen Spitzmueller
3bd03709fd Consider CT underlining pref in captions markup 2020-03-07 07:28:37 +01:00
Scott Kostyshak
c6f4682b75 Fix Qt deprecation warn for QPixmapCache::find()
Fix the following warning from Qt 5.14.1:

  error: ‘static bool QPixmapCache::find(const QString&, QPixmap&)’ is deprecated: Use bool find(const QString &, QPixmap*) instead [-Werror=deprecated-declarations]
2020-03-06 22:46:18 -05:00
Scott Kostyshak
690c671b1d Fix Qt deprecation warn for QList::fromSet()
Fix the following warning from Qt 5.14.1:

  error: ‘static QList<T> QList<T>::fromSet(const QSet<T>&) [with T = QString]’ is deprecated: Use QList<T>(set.begin(), set.end()) instead. [-Werror=deprecated-declarations]

Regarding QList::fromSet(), the documentation now states the
following [1]:

  Since Qt 5.14, range constructors are available for Qt's generic
  container classes and should be used in place of this method.

[1] https://doc.qt.io/qt-5/qlist.html
2020-03-06 22:36:12 -05:00
Juergen Spitzmueller
5e21a8fbf7 Markup changed captions in workarea by underline and strikeout, resp. 2020-03-06 18:58:25 +01:00
Juergen Spitzmueller
f5a2d770b8 Footnote: (re-)add a fallback dummy counter 2020-03-06 18:21:18 +01:00
Juergen Spitzmueller
b8cac52759 Use real counter in deleted footnotes 2020-03-06 18:16:34 +01:00
Scott Kostyshak
1045020e05 Fix Qt deprecation warn for setConfirmOverwrite()
Fix the following warning:

  error: ‘void QFileDialog::setConfirmOverwrite(bool)’ is deprecated: Use setOption(DontConfirmOverwrite, !enabled) instead [-Werror=deprecated-declarations]

Note in the change that "false" changes to "true" because the option
is *Dont*ConfirmOverwrite.

QFileDialog::setConfirmOverwrite() is obsolete at least since 4.8
and QFileDialog::setOption() is available since 4.5 [1].

[1] https://doc.qt.io/archives/qt-4.8/qfiledialog-obsolete.html
[2] https://doc.qt.io/qt-5/qfiledialog.html#setOption
2020-03-06 09:56:01 -05:00
Scott Kostyshak
1c78b563ff Fix Qt deprecation warn for getContentsMargins()
Fixes the following warning:

  error: ‘void QWidget::getContentsMargins(int*, int*, int*, int*) const’ is deprecated: use contentsMargins() [-Werror=deprecated-declarations]

The new code also has advantages in that 'l' can be set to const and
it is more readable because it is clear that only 'l' is used.

QWidget::getContentsMargins() was deprecated in 5.14.0 [1]. and
QWidget::contentsMargins() is available since 4.6 [2].

[1] https://code.qt.io/cgit/qt/qtbase.git/tree/dist/changes-5.14.0/?h=v5.14.0
[2] https://doc.qt.io/archives/qt-4.8/qlayout.html#contentsMargins
2020-03-06 09:37:43 -05:00
Juergen Spitzmueller
339424ce00 Handle deleted BibTeX/Biblatex bibliographies
Since we cannot strike-out these, we output a placeholder when
show changes in output is active.

Fixes #11762
2020-03-06 13:49:10 +01:00
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
Richard Kimberly Heck
ca40d1f92a Fix a bunch of warnings 2020-02-26 22:29:40 -05:00
Richard Kimberly Heck
2e444dd657 Fix problem with validation when using InsetLayout. 2020-02-26 22:19:36 -05:00
Enrico Forestieri
f28334ac8b Cleaner fix to ensure 32-bit XCB events
This fix still satisfies Valgrind and is cleaner than the approach
at 19c41bd0: instead of using calloc we now use the C++11 specifier
alignas. For more info, see the following ML thread:
https://www.mail-archive.com/search?l=mid&q=20200219024908.5n4x4osni55gylo3%40tallinn
2020-02-25 12:37:51 +01:00
Enrico Forestieri
8977296078 Revert "Fix write to uninitialized bytes for XCB event"
This reverts commit 19c41bd095.

A more efficient fix is on the way.
2020-02-25 12:32:10 +01:00
Jean-Marc Lasgouttes
74540c9896 Fixup d207e85c: paint sublabel with the correct background color
The above mentionned patch did paint the background of the sublabel to
avoid "bold-like" effect. However the correct backgound color is the
row's one, not the inset's one.
2020-02-24 10:41:18 +01:00
Richard Kimberly Heck
a9d9fdc9bf Fix alignment warnings from clang. 2020-02-23 17:15:01 -05:00
Richard Kimberly Heck
34f9ea8275 Use C++11 construct. 2020-02-23 16:59:59 -05:00
Enrico Forestieri
5873a382de Fix FileName::realPath() on Windows
The realPath() implementation on Windows works only for files and
not for directories. By using an API available starting from Vista
it is possible to fix it in a simple way.

I also took into account using the Qt QFileInfo::canonicalFilePath(),
but it turns out to not work when a path component is a junction
(tested with Qt 5.14.1).

Due to this, it is not possible compiling or using LyX on Windows
versions earlier than Vista.
2020-02-23 22:59:03 +01:00
Richard Kimberly Heck
0daceae649 Try again to fix memory leak reported by Scott.
This time, use a shared_ptr.
2020-02-23 16:56:43 -05:00
Richard Kimberly Heck
72c581ebdb Revert "Fix memory leak reported by Scott."
It leads to a double delete error.

This reverts commit 11397a2e82.
2020-02-23 16:29:58 -05:00
Richard Kimberly Heck
11397a2e82 Fix memory leak reported by Scott. 2020-02-23 15:54:13 -05:00
Richard Kimberly Heck
86f95062bd Fix some clang warnings.
The first one, a comma instead of a semi-colon, is a weird one.
2020-02-23 15:52:15 -05:00
Richard Kimberly Heck
d11a27a611 Fix nullptr warnings 2020-02-23 15:52:15 -05:00
Richard Kimberly Heck
608b927daf Fix "no extern declaration" warning. 2020-02-23 15:52:15 -05:00
Jean-Marc Lasgouttes
57b400cdff Make sure that spelling marks do not spill ouside of row
This avoids annoying remnants of dotted red lines.

Fixes bug #11755.
2020-02-22 18:02:13 +01:00
Stephan Witt
f2f861f017 Use real path names for buffer lookup by name of temporary external files.
In case of path names for external files containing symbolic links the real path
and the logical path name may be different for the same file or directory.
LyX is using QDir::tempPath() to create the path name of the temporary directory.
The Qt implementation is free to return the logical or the real path name here and
it happens to be different for various platforms and versions.
The most stable and clean solution is to use the real path name consistently.
2020-02-22 12:11:42 +01:00
Stephan Witt
aec491f686 Avoid potential leak of memory pointed to by QTreeWidgetItem subcatItem 2020-02-21 07:57:09 +01:00
Pavel Sanda
4e4bba441d gcc 4.7 leftover 2020-02-20 09:25:00 +01:00
Stephan Witt
2bf7756196 Avoid potential leak of memory pointed to by QTreeWidgetItem catItem 2020-02-20 08:12:08 +01:00
Scott Kostyshak
19c41bd095 Fix write to uninitialized bytes for XCB event
As the xcb_send_event man page [1] states,

  In order to properly initialize these bytes, we allocate 32 bytes
  even though we only need less for an xcb_configure_notify_event_t

This commit fixes the following Valgrind error, which could be
triggered by selecting a letter in LyX:

  ==12698== Syscall param writev(vector[...]) points to uninitialised byte(s)
  ==12698==    at 0x61F578D: __writev (writev.c:26)
  ==12698==    by 0x61F578D: writev (writev.c:24)
  ==12698==    by 0x4A83BFC: ??? (in /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0)
  ==12698==    by 0x4A83FD0: ??? (in /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0)
  ==12698==    by 0x4A84246: ??? (in /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0)
  ==12698==    by 0x4A84ACB: xcb_flush (in /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0)
  ==12698==    by 0x17C8F06: lyx::frontend::GuiApplication::nativeEventFilter(QByteArray const&, void*, long*) (GuiApplication.cpp:3366)
  ==12698==    by 0x5AA4EEE: QAbstractEventDispatcher::filterNativeEvent(QByteArray const&, void*, long*) (qabstracteventdispatcher.cpp:484)

[1] https://www.x.org/releases/current/doc/man/man3/xcb_send_event.3.xhtml
2020-02-19 09:48:54 -05:00
Pavel Sanda
b7af21ad7c Fix memory leak.
Spotted by Scott.
https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg210447.html
2020-02-18 10:03:42 +01:00
Stephan Witt
fc790bc1f5 Add missing check for nullptr on check of language encoding of next paragraph. 2020-02-18 09:03:20 +01:00
Stephan Witt
f904fb2d61 Add missing initialization for local variable.
The autoargs variable is random for empty macro argument lists otherwise.
2020-02-18 08:59:20 +01:00
Stephan Witt
fe02f151f9 Remove useless assignments to a local variables never read later. 2020-02-18 08:55:45 +01:00
Stephan Witt
225de7830e Remove useless assignment to a local variables never read later. 2020-02-18 08:55:00 +01:00
Stephan Witt
febbc3537a Avoid crashes in case of missing document buffer for buffer based conversions. 2020-02-18 08:43:22 +01:00
Richard Kimberly Heck
731feb9f18 Silence some clang warnings. 2020-02-17 12:31:38 -05:00
Richard Kimberly Heck
fb03f2a5ec Fix a strange warning in QtCreator:
/cvs/lyx/lyx-devel/src/frontends/qt/TocModel.cpp:356: warning: loop variable 'toc' has type 'const pair<std::string, shared_ptr<lyx::Toc> > &' (aka 'const pair<basic_string<char>, shared_ptr<vector<lyx::TocItem> > > &') but is initialized with type 'const std::pair<const std::__cxx11::basic_string<char>, std::shared_ptr<std::vector<lyx::TocItem, std::allocator<lyx::TocItem> > > >' resulting in a copy

/cvs/lyx/lyx-devel/src/frontends/qt/TocModel.cpp:356: use non-reference type 'pair<std::string, shared_ptr<lyx::Toc> >' (aka 'pair<basic_string<char>, shared_ptr<vector<lyx::TocItem> > >') to keep the copy or type 'const std::pair<const std::__cxx11::basic_string<char>, std::shared_ptr<std::vector<lyx::TocItem, std::allocator<lyx::TocItem> > > > &' to prevent copying

Easier just to use 'auto'.
2020-02-17 12:31:38 -05:00
Stephan Witt
f12c4dbcd9 Remove unnecessary assertion after explicit buffer pointer check. 2020-02-17 14:35:03 +01:00
Stephan Witt
a1d68511ac Avoid potential crashes with missing document buffer in dispatch of buffer based LFUNs.
Use LASSERT with appropriate action instead of LATTEST assertions.
Debug build is unchanged and asserts, release build skips the action gracefully.
2020-02-17 13:36:37 +01:00
Stephan Witt
0f1f00db27 Code cleanup: avoid repeating temp_dir method calls while local variable has a result already. 2020-02-17 13:25:35 +01:00
Juergen Spitzmueller
4debbdd6b6 Restore custom tmp directory
Fixes #1174
2020-02-17 09:00:08 +01:00
Pavel Sanda
2db6a81156 Unify handling in dispatchVC.
All these check could be actually dropped, because unless dispatchVC
is called directly, getstatus would already handle it.
2020-02-15 20:55:14 +01:00
Juergen Spitzmueller
e31364fdcb whitespace 2020-02-15 09:26:43 +01:00
Juergen Spitzmueller
195393f401 Fix Python detection on windows
Patch by Eugene Chornyi
2020-02-15 09:26:08 +01:00
Stephan Witt
6dab8739eb Avoid uninitialized position variables in case of current inset not doing the assignment 2020-02-14 12:11:10 +01:00
Stephan Witt
aca95619b8 Avoid potential leak of memory pointed to by QStandardItem catItem 2020-02-13 16:39:14 +01:00
Richard Kimberly Heck
b175f5a315 Fix bug #11737.
We need to use the FileName methods when moving or removing a file,
so that refresh() gets called.

(cherry picked from commit d930913898)
2020-02-13 00:11:23 -05:00
Juergen Spitzmueller
40b1a6f9b1 Revert "Fix bug #11712."
This breaks on Linux

This reverts commit fdf81a9bab.
2020-02-12 16:11:01 +01:00
Richard Kimberly Heck
fdf81a9bab Fix bug #11712.
Fixes some escaping issues on Windows especially

Patch from Eugene.
2020-02-12 09:25:13 -05:00
Stephan Witt
e900b61d46 Make cell index of tabular local for column loop. 2020-02-12 12:32:31 +01:00
Stephan Witt
3ee1bcad04 Remove another unnecessary assignment 2020-02-12 12:28:18 +01:00
Enrico Forestieri
926c846abb Remove unnecessary assignments 2020-02-10 21:59:52 +01:00
Enrico Forestieri
536d476d38 Make sure to not dereference a null pointer. 2020-02-10 21:54:07 +01:00
Juergen Spitzmueller
b8546139c8 Properly resize columns of child document table widget 2020-02-07 17:23:14 +01:00
Juergen Spitzmueller
4fd4310ea7 Indentation fixes 2020-02-07 16:03:56 +01:00
Stephan Witt
59fa0b2592 Fix a crash with uninitialized buffer member of MathData
See the details here: https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg210294.html
2020-02-07 10:17:33 +01:00
Stephan Witt
a50e07db46 update canAutoOpenFile/autoOpenFile implementation to new MacOSX API, avoid deprecated calls 2020-02-06 21:52:46 +01:00
Richard Kimberly Heck
5188f0fcff Don't need to remove the file if it doesn't exist. (This would cause a five second delay in that case.) 2020-02-03 11:37:12 -05:00
Scott Kostyshak
05f2494008 Remove a finishUndo() after a recordUndo()
finishUndo() is only helpful in the presence of undos of type INSERT
or DELETE.

See the following ML thread for details:

  https://www.mail-archive.com/search?l=mid&q=b721c098-c7ee-d12f-1cdf-067dda9aa5cf%40lyx.org
2020-02-02 16:10:59 -05:00
Juergen Spitzmueller
dce9e44a14 Ignore geometry-related settings if the class provides geometry
Fixes #11724
2020-01-29 11:25:01 +01:00