Commit Graph

2167 Commits

Author SHA1 Message Date
Thibaut Cuvelier
789a537182 Refactor computing hashes.
For now, this is only used in FileName, because it does not change the semantics of DocFileName::mangledFileName.
2021-10-19 09:15:44 +02:00
Yuriy Skalko
a9119c3fa8 Remove redundant declarations reported by GCC with -Wredundant-decls option 2021-09-28 20:59:21 +03:00
Yuriy Skalko
325c405541 Remove redundant semicolons reported by GCC with -Wextra-semi option 2021-09-28 11:28:43 +03:00
Jean-Marc Lasgouttes
6bbd88accf Improve (modestly) the performance of font metrics caches
This fixes two performance issues and improves the performance of
TextMetrics::redoParagraph by 15% in a workload that uses the cache a
lot. The difference will be much less when the cache is not used much.

1/ repetion of the hash code computation

The code
  if (cache.contains(key))
  	result = cache[key]:
is not efficient, since qHash(key) has to be computed twice.
To fix this a new Cache::object_str() method is added, which allows
  if (auto * obj = cache.object(key))
  	result = *obj;

2/ code of has code computation

Instead of using a verbose string that is complicated to build as
key, new key structs BreakAtKey and TextLayoutKey are introduced,
along with the relevant qHash() implementation.
2021-09-24 17:12:15 +02:00
Pavel Sanda
5dd96345ab Reformat mangled filenames for (xhtml) export to have them sorted. 2021-07-09 14:35:01 +02:00
Eugene Chornyi
e9d5fc0190 prevent Qt6 from defining UNICODE (Qt6.1.1 and upwards) 2021-06-19 10:48:49 +02:00
Jean-Marc Lasgouttes
67c85f54c4 Fixup 9f92fc92: improve FIXME in SystemcallPrivate::startProcess
I wanted to remove the test  Qt >= 5.15, but now I see that it is
not possible because of QProcess::splitCommand.

Neverthless, the best would be to change parsecmd.
2021-05-20 13:20:20 +02:00
Juergen Spitzmueller
511ba894ff Fix toqstr(chart_type) with Qt6 (#12252) 2021-04-17 15:10:26 +02:00
Jean-Marc Lasgouttes
9ff27f8ce0 Produce an error on bad debug level values
Add new funciton Debug::badValue, that returns the first bad value in a debug
setting string.

Use it to parse the -dbg comand line option and to control the
execution of the debug-level-set lfun.

Use range-based loops in a few places.
2021-03-26 17:55:54 +01:00
Kornel Benko
a9b0f5faae Cmake build with qt6 on MAC
Patch from P. De Visschere
Citing:
I also must exclude the QMacPasteboardMimeGraphics class in
GuiApplication.cpp since QMacPasteboard is not available anymore with qt6.

and add an #include <QStandardPaths> in support/Package.cpp (I suppose
this will pose no problem for qt5 but have not checked it, it's only
needed with USE_MACOSX_PACKAGING)
2021-03-26 13:11:44 +01:00
Kornel Benko
92a50fa273 Cmake build Qt6: Remove some redundant statements. 2021-03-24 11:42:39 +01:00
Kornel Benko
02a3705496 Amend 635a7d77: Allow compiling with Qt6 with cmake
Thanks Scott for checking.
TODO: Check compilation on Windows and Mac.
2021-03-22 16:19:10 +01:00
Enrico Forestieri
6fa973b377 Fix Qt6 deprecation warning about QString::fromUcs4 2021-03-21 17:15:08 +01:00
Juergen Spitzmueller
4a5ae39e8b Revert "Fix Qt6 deprecation warning (QString::fromUcs4(uint))"
This reverts commit 52dff70641.
2021-03-21 16:59:25 +01:00
Juergen Spitzmueller
52dff70641 Fix Qt6 deprecation warning (QString::fromUcs4(uint)) 2021-03-21 12:38:47 +01:00
Eugene Chornyi
4421b721e4 Make all a synonym of any in cmd debug mode 2021-03-21 09:59:23 +01:00
Enrico Forestieri
635a7d77dd Allow compiling with Qt6
This commit allows compiling LyX with Qt6 when using autotools.
For a successful compilation the following 2 conditions must be met.

1) The Qt6 qmake has to come first in PATH, so that the command
   "qmake -v | grep -o 'Qt version .'" returns "Qt version 6".
2) The --enable-qt6 switch has to be passed to the configure command.

If --enable-qt6 is used but Qt6 is not found, Qt5 is tried as a fallback.
If also Qt5 is not found, configuring for Qt4 is attempted.
If --enable-qt6 is not used, then things go as usual. This means that Qt5
is tried first and then Qt4, unless --disable-qt5 is used, in which case
Qt4 is directly attempted. This means that existing scripts should
continue working unmodified.

LyX should compile with Qt6 on windows and linux, and possibly also on
mac, but I could not test that. However, it is not guaranteed that it
works as it should. In particular I am not sure that I got right the
conversion from QRegExp to QRegularExpression. For sure, the syntax
highlighting seems to not work right. Someone in the know should take
a look at that. I am able to load documents and compile them but some
thourough testing is needed. However, when compiling for Qt5 or Qt4,
I tried to make sure that the functionality is preserved.
2021-03-15 17:09:09 +01:00
Juergen Spitzmueller
9f92fc92bd Yet another deprecation fix (this is the last one I am aware of) 2021-03-12 12:14:42 +01:00
Juergen Spitzmueller
10f4f2113a Fix deprecation warning (from|toTime_t) 2021-03-12 10:32:03 +01:00
Juergen Spitzmueller
26459a2cf5 Address another deprecation warning.
One left to go.
2021-03-12 10:10:33 +01:00
Thibaut Cuvelier
d8c6bc7c1f Stop using a GCC extension for an unprintable character in regex. 2021-02-13 18:23:20 +01:00
Enrico Forestieri
04c0cce43e Fix make check
We have to explicitly link zlib after [197ea636/lyxgit].
2021-01-31 15:21:23 +01:00
Juergen Spitzmueller
76eae4572e Introduce InputGlobal (#12087)
This is a variant of Input for layout files that only searches build
and system directories and thus allows "InputGlobal name.inc" in a user
file name.inc that attempts to modify its global counterpart.
2021-01-26 08:42:39 +01:00
Kornel Benko
ea5e16d075 Replace calls from make_unique to lyx::make_unique
After advice from Yuriy Skalko to satisfy compilation with clang8
2021-01-15 11:36:14 +01:00
Richard Kimberly Heck
fcea6c471c Revert "Add move constructor and move assignment operator for FileName class"
For now, since it's causing problems on OSX particularly.

This reverts commit 854c9de8fa.
2021-01-14 03:08:12 -05:00
Richard Kimberly Heck
3f3d769107 Count words in hyperlink 2021-01-10 01:54:40 -05:00
Yuriy Skalko
854c9de8fa Add move constructor and move assignment operator for FileName class 2021-01-09 11:23:33 +02:00
Richard Kimberly Heck
cf07d4825f Fix bug #11104. Activate refstyle support for InsetMathRef.
At the moment, there is no support for plurals and capitalization.
A long comment explains why. Support could be added for that without
a format change.
2021-01-05 18:17:53 -05:00
Enrico Forestieri
2099dca5d3 Do not replace nonexistent environment variables
References to environment variables embedded in a filename are expanded
and replaced by their value. However, if a variable does not exist, its
reference is simply erased from the filename, causing havoc (see #7801).

This has been like that since ever and cannot be changed, both for
backward compatibility and because this feature is currently used in
the Windows installer.

A possible backward compatible strategy is leaving as is the reference
to the environment variable (introduced by a $ sign) in the filename
if it does not exist. This is done in this patch, which also assumes
that an escape character is never used in a filename (inserting a $ in
the filename is easy, but I don't think one is able to easily insert
an escape character).
2021-01-04 23:00:42 +01:00
Thibaut Cuvelier
adf62c3184 Fix compilation with MSVC 19. 2021-01-02 17:27:56 +01:00
Yuriy Skalko
197ea63631 Use crc32 calculation from zlib instead of boost 2020-12-28 21:32:56 +02:00
Yuriy Skalko
d9e455b61a Move Trackable class to Server.h 2020-12-19 22:52:57 +02:00
Yuriy Skalko
4f0981e7bb Merge namespace signals2 into namespace lyx 2020-12-19 22:52:51 +02:00
Yuriy Skalko
cbd1b3a2d4 Remove useless declaration 2020-12-19 21:33:33 +02:00
Richard Kimberly Heck
8c805db9d3 Typo 2020-12-18 17:35:58 -05:00
Richard Kimberly Heck
fdbbddecb7 Fix bug with registering files for VC when they are in repo subdirs. 2020-12-18 15:48:51 -05:00
Pavel Sanda
2db26ff522 Compile on older gcc. 2020-12-14 00:01:05 +01:00
Yuriy Skalko
bda4570400 Use new signal library nod instead of boost::signals2
Thanks Enrico for updating autotools files.
2020-12-13 23:11:19 +02:00
Yuriy Skalko
9348c5c635 Use to_string instead of boost::lexical_cast 2020-12-10 20:14:40 +02:00
Jean-Marc Lasgouttes
d9c39232ac Reduce the amount of needed boost headers
boost/signals2.hpp is a convenience header, it seems that
boost/signals2/signal.hpp is enough for our needs.

This allows to get rid of 6MiB of header files in 3rdparty/boost (and
probably to speed-up compilation).
2020-12-09 14:50:18 +01:00
Kornel Benko
a171c651a6 Revert "Amend 3093789e for cmake build"
This reverts commit b3d43404f4.
2020-11-30 10:19:22 +01:00
Yuriy Skalko
7779316e6c Include standard <regex> 2020-11-29 15:27:28 +02:00
Kornel Benko
b3d43404f4 Amend 3093789e for cmake build 2020-11-29 10:04:54 +01:00
Yuriy Skalko
075ae38ec9 Use correct std header 2020-11-29 10:49:59 +02:00
Jean-Marc Lasgouttes
3093789e8d remove most traces of boost::regex
1/ remove boost regex code from 3rdparty/boost. Only the cmake stuff remains.

2/ remove traces of BOOST_LIB since there is no need anymore to
   compile boost stuff.

3/ remove traces of boost regexp in config/lyxinclude.m4 and INSTALL

4/ require gcc 4.9 as minimal version in autoconf.

Unfortunately, the net gain is only 10% of included boost size (now 21M).
2020-11-28 19:59:17 +01:00
Yuriy Skalko
f3ec89cfa1 Always use std::regex
Since now minimum supported GCC is 4.9.
2020-11-27 12:39:59 +02:00
Yuriy Skalko
fdefff1108 Fix signed integer overflow on x = 0, detected by GCC sanitizer 2020-11-27 12:17:22 +02:00
Yuriy Skalko
6a21ec854b Move several common types to support/types.h 2020-11-27 12:16:22 +02:00
Yuriy Skalko
43b16548b4 Cleanup headers 2020-11-25 02:43:16 +02:00
Jean-Marc Lasgouttes
d53b44273c Compilation fix 2020-11-21 19:54:43 +01:00