Commit Graph

26250 Commits

Author SHA1 Message Date
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