Commit Graph

2204 Commits

Author SHA1 Message Date
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
Jean-Marc Lasgouttes
4f4d52e8c0 Fix warning with --disable-nls 2020-01-27 15:34:27 +01:00
Jean-Marc Lasgouttes
09130d7a62 Update to boost 1.72
This requires to add a assertion_failed_msg handler. Take this
occasion to cleanup and uniformize the various boost.cpp files that we
have.

This adds 50k line of whatever to the source code.
2020-01-07 16:27:23 +01:00
Jean-Marc Lasgouttes
68c88bc427 Use unsigned values for enum
Otherwise 1 << 31 overflows.

Spotted by cppcheck.
2019-10-27 00:05:41 +02:00
Jean-Marc Lasgouttes
a7c6940f14 Get rid of useless affectation
Spotted by cppcheck.
2019-09-16 00:03:56 +02:00
Jean-Marc Lasgouttes
c6d8592ffb Mark constructors with only one parameter as explicit
Spotted by cppcheck
2019-09-16 00:01:48 +02:00
Jean-Marc Lasgouttes
17c827d177 Various fixes suggested by cppcheck
Rename local variables the hide other ones: get_binary_path, find_python_binary

Use unsigned int for conversion from hex using sscanf().

FileName::checksum(), parsecmd (SystemCall): use explcit values rather
than variable which value is known.
2019-09-13 22:37:16 +02:00
Jean-Marc Lasgouttes
714113655a Follow some of the performance advice from cppcheck
Most of that is changing string to string const &.
2019-09-13 16:23:49 +02:00
Patrick de Visschere
b70c3796a1 #6961 correct the big-endian conversion of UInt32
This is a patch from Patrick de Visschere. Thanks.
2019-09-08 11:11:17 +02:00
Jean-Marc Lasgouttes
5e33e4fc2c Catch improbable exception
We know that the exception is correct, but coverity does not.
It would be much better to check that at compile time...
2019-07-13 00:24:21 +02:00
Juergen Spitzmueller
623f7b4795 Truncate long citation label in the middle rather than the end.
Fixes: #10769
2019-07-09 14:48:11 +02:00
Richard Kimberly Heck
d96a9aa37f Fix bug #10091.
See the discussion. The decision was just to keep re-trying for a
bit, since the lock preventing us from removing the old file seems
to clear after a bit.
2019-07-07 13:13:52 -04:00
Jean-Marc Lasgouttes
e485102ef2 For python 3 require at least 3.5
This handles configure.ac and os::python23. What remains to be done is cmake.
2019-06-28 00:06:28 +02:00
Jean-Marc Lasgouttes
938463b5d6 Fixup 3dc54d4a: fix string encoding issues with Qt4
The culprit here is the constructor QString(QByteArray const &): in
Qt4, it would interpret the byte array as latin1, and in Qt5 as utf8.

Therefore it is safer to use explicitly QString::fromUtf8 instead of
this constructor.

Several places where additionally simplified, in order to avoid some
extra conversions.
2019-06-20 11:27:15 +02:00
Jean-Marc Lasgouttes
5249eaaa60 Use <cstdint> instead of <boost/cstdint.hpp>
This is mandated by C++11.
2019-06-17 16:19:31 +02:00
Jean-Marc Lasgouttes
fbe0caa483 Do not use BOOST_CURRENT_FUNCTION
There is no need to use that, since __func__ is standard in C++11.

Anyway, this code is unused unless one defines USE__func__ to something.
2019-06-17 15:57:03 +02:00
Jean-Marc Lasgouttes
22f599250e Remove support for gcc 4.6
This was kept so long because of Ubuntu 12.04 LTS, but having a
not-really-c++11 compiler is not nice.
2019-06-12 15:03:18 +02:00
José Matos
ad96fd835b Divide the python detection in three functions, with a clear delegation of responsibilities
python23_call: determines if the binary given is appropriate and adds the necessary calling options

find_python_binary: get a list of candidates and choose the right one using python23_call

python: returns the name of the python interpreter that can be found on PATH, using find_python_binary
2019-06-08 12:49:30 +01:00
José Matos
02ee471d9d Move python related functions together to make it easy to read the code. 2019-06-08 12:22:26 +01:00
José Matos
35c299f86d Remove alternative operator representations (and,or) and improve comments for python binary detection. 2019-06-08 09:15:03 +01:00
José Matos
adb779a692 Change python run time detection to privilege python 3 over python 2.
This should work as before but now we also control the python version and ignore it if it is not in the supported range.
2019-06-07 15:27:25 +01:00
Enrico Forestieri
d5567ac36f Compile fix for mingw
This was probably overlooked at [7bb08f10/lyxgit].
2019-04-27 12:53:05 +02:00
Jean-Marc Lasgouttes
26817e9347 remove dummy LyXRC class that was forgotten 2019-04-24 14:54:49 +02:00
Kornel Benko
ef285cb7c4 Amend 7d021a93: Use interprocedural optimization if possible
Discard test programs using dummy_fuctions from the optimization.
This omits warnings about multiple method definitions.
2019-04-24 14:47:44 +02:00
Jean-Marc Lasgouttes
7bb08f10b1 Move initial values of LyXRC members to the header
We use a C++11 construct that puts initial values of members along
with their definition. It is a good construct and now the out of line
constructor and the setDefaults() method can go.

This removes the need to define a dummy constructor in tex2lyx and
client.

The only needed change to the rest of code is a change of signature
for the user_(name|email) to return std::string. They are now called
explicitely from the constructor. We now have to include userinfo.h in
LyXRC.h, but this should not be too expensive.
2019-04-19 14:46:12 +02:00
Juergen Spitzmueller
414db90a5c Indentation 2019-03-25 16:46:03 +01:00
Juergen Spitzmueller
3dc54d4aac Display URL-encoded chars decoded in display path 2019-03-23 15:15:08 +01:00
Jean-Marc Lasgouttes
601244ba92 Use HAVE_LONG_LONG_INT instead of LYX_USE_LONG_LONG
It seems that the extra complication hurts more than it helps (for
example with OpenBSD).

Some adaptation will be needed for cmake.
2019-03-21 14:18:17 +01:00
Günter Milde
dae90c6161 Warn user, if input encodings of master and child document differ. 2019-03-18 18:17:39 +01:00
Jean-Marc Lasgouttes
bdf3924fc7 Update poor man's profiler to use C++11 std::chrono
This is more portable, and the old code prevented in windows to use
instrument several classes at the same time (several .obj files,
actually).

No new feature here, bu the code is nicely slower. It might be less
efficient, I am not really at ease with how std::chrono works.
2019-03-17 14:01:02 +01:00
Jean-Marc Lasgouttes
e203bf519b Fix algorithm for finding localized files
Now we search in priority with the GUI language, and then the
language(s) specified in the LANGUAGES environment variable.
Preoviously, the GUI language would only be considered when
LANGUAGES was not set (which was a bug).

Take this opportunity to remove old compatibility code from 2007.
2019-02-06 15:53:47 +01:00
Enrico Forestieri
ad0c9a548b Remove PYTHONPATH from the environment on Windows
This make sure to use the the modules distributed with LyX,
avoiding reconfigure failures.
2019-01-12 18:37:41 +01:00
Enrico Forestieri
69726b832b Fix bug #4269
Call gunzip with quoted filenames as they may contain spaces or
other special characters.
2018-12-29 20:11:56 +01:00
Pavel Sanda
9547e0b765 typo 2018-12-08 00:04:04 +01:00
Pavel Sanda
04fe818b22 Keep permissions of the saved files intact.
Previously the permission were destroyed by the newly created
temporary file -- which is later used as new saved file.
Tested on symlinks as well but only on Linux.
2018-12-07 23:10:46 +01:00
Guillaume MM
131f4b92ba Fix segfault after deleting monitor
The boost signal was sent synchronously, and so made the Qt signal to be posted
in FileMonitor::changed after the boost signal returned, so after the sender was
possibly destroyed.

The solution is to make the boost signal asynchronous using the Qt event loop.

Thanks to Scott Kostyshak for the report and MWE.
2018-12-04 00:05:01 -05:00
Jean-Marc Lasgouttes
76e99e9a20 Remove old workaround that is not needed anymore
This causes a compilation error with boost 1.69.

Fixes bug #11349.
2018-11-04 08:23:49 +00:00
Stephan Witt
d470477ab0 Add dummy implementation for Messages::getIfFound (used when ENABLE_NLS is false) 2018-10-27 16:12:02 +02:00
Jean-Marc Lasgouttes
557c2f2bf0 Compilation fix (with qt4 at least). 2018-10-19 10:02:02 +02:00
Richard Kimberly Heck
1410eeb10e Simplify the code that adds underlining to the layout combo. 2018-10-18 21:49:31 -04:00
Richard Kimberly Heck
1cc859d713 Refactor 2018-10-18 21:49:31 -04:00
Enrico Forestieri
83fc0f924c Fix bug #11210
On Windows, start viewers in detached processes in order to avoid
a crash of the QProcess destructor when their thread terminates.
The opening of a console window is avoided by redirecting to the
null device all standard I/O channels.
2018-09-27 21:21:49 +02:00
Stephan Witt
d9c0807227 Add -headerpad_max_install_names option to linker calls and make run path configuration consistent.
This avoids failures when running install_name_tool on Mac when creating relocatable binaries using the bundled private frameworks.
2018-09-21 21:46:47 +02:00
Richard Kimberly Heck
6014492699 Try yet again try to fix bug #9158.
The problem with the previous attempt was that, every time through
updateBuffer, we looked up the file location using kpsewhich, which
took too long on Windows. The new solution is to cache that info, and
to look it up only when we need it.

Previously, this info would have been re-read whenever we parsed the
bibfiles. So we re-read it now whenever the bibinfo cache is invalid,
which is less often, but should be good enough. We can add more such
re-reads if need be.
2018-09-02 11:50:03 -04:00
Richard Kimberly Heck
a3e87dad80 Revert "Try yet again try to fix bug #9158."
(Unintentionally committed.)

This reverts commit 7b29d4e7aa.
2018-09-02 00:09:19 -04:00
Richard Kimberly Heck
7b29d4e7aa Try yet again try to fix bug #9158.
The problem with the previous attempt was that, every time through
updateBuffer, we looked up the file location using kpsewhich, which
took too long on Windows. The new solution is to cache that info, and
to look it up only when we need it.

Previously, this info would have been re-read whenever we parsed the
bibfiles. So we re-read it now whenever the bibinfo cache is invalid,
which is less often, but should be good enough. We can add more such
re-reads if need be.
2018-09-01 23:13:00 -04:00
Juergen Spitzmueller
ed61ce74b7 So long, date-insert!
This function is superseded by info-insert date, which is much mightier
and more flexible.
2018-08-20 09:25:22 +02:00
Kornel Benko
ed8dfa3fa0 Expand tilde meaning in front of a path name.
This allows to address data in the current lyx-system-directory.
The additional prefix is '~:s/'
The original prefix '~/' still addresses current users home directory.
2018-08-05 10:03:52 +02:00
Juergen Spitzmueller
611df441b6 Consider EuropeanNumberTerminator property when determining text direction
Also, use EuropeanNumberSeparator information rather than relying on an
own (incomplete) list of number separators.

Fixes: #4057
2018-07-22 12:38:22 +02:00
Jean-Marc Lasgouttes
30ec879d3a Add a translator as a fallback to Qt inner one
This reuses code intended only for mac manus and generalizes it. The
list of strings to add to po files is found in
GuiTranslator::translate.

This is useful now that LyX relies on QDialogButtonBox class for its
dialogs. Indeed many languages are not covered natively by Qt.

It is possible to enable the "locace" debug channel to see what
strings are not covered and should be added to our own translation
tables.

In order to make things easier, a new method getIfFound() has been
added to the Messages class, which returns an empty string when no
translation has been found, as Qt's translate() does.
2018-07-18 10:13:05 +02:00
Enrico Forestieri
dfd6afb740 Fix compilation on case insensitive filesystems
In such filesystems, including either Magic.h or magic.h does not
make any difference and the one or other file is included depending
on the search order. In this case, Magic.h was trying to include
itself instead of including magic.h.
2018-07-04 09:42:04 +02:00
Jean-Marc Lasgouttes
c9fd7058ab fix compilation when libmagic is not used 2018-07-03 21:18:26 +02:00
Jean-Marc Lasgouttes
4c6a341ab5 Encapsulate libmagic support in a class
This makes the code much easier to read and, additionally, allows to
parse the magic file with magic_load() only once per session.

As a result, getFormatFromFile is slightly faster.
2018-07-03 11:58:01 +02:00
Juergen Spitzmueller
01d8f41894 Support input of non-ASCII characters in hyperlinks
We transform them to hex representation via
QByteArray::toPercentEncoding()

Fixes: #11165
2018-06-09 11:52:55 +02:00
Jean-Marc Lasgouttes
32f37250d5 Catch exception in replaceEnvironmentPath
This exception in the regex constructor is only theoretical (our regex
are hardcoded), but this is creating coverity noise.

Additionally, revert the following commits that are not needed anymore:
6b6fa94c: Catch exceptions to please coverity
c2ed75fd: Fixup 6b6fa94c: coverity says there are more possible exceptions.

This commit is better viewed with 'git show -b'.
2018-06-04 11:39:41 +02:00
Juergen Spitzmueller
2ecc3b09c6 Set correct path to (biblatex) bibliography databases that are entered relative to child documents.
Fixes: #11105
2018-04-07 22:09:06 +02:00
Richard Kimberly Heck
83b1ac3b55 Fix bug #11084.
Allow unicode-insert to accept a sequence of codepoints.
2018-03-21 23:08:38 -04:00
Jean-Marc Lasgouttes
dc2ad44562 Make pmprof use the correct unit in report 2018-03-07 11:54:40 +01:00
Juergen Spitzmueller
84658d37e2 Remove createTempFile method
and use the new and safer tempFileName() method instead for the creation
of temporary directories
2018-02-08 12:16:30 +01:00
Juergen Spitzmueller
9e2928be68 Re-add method to get a temporary file name without persistent QTemporaryFile object
This is needed for cases where the temp file has to be manually removed
at some point (e.g., if temp files are used as conversion target, and
the initial file only serves as a placeholder), since QTemporaryFile
objects cannot be manually removed at least on Windows (they are always
kept open internally even after close()). See
​http://lists.qt-project.org/pipermail/interest/2013-August/008352.html

In order to avoid race conditions due to duplicate names (the issue why
the old method was removed), we record all used temp file names.

Fixes: #9139
2018-02-08 11:31:23 +01:00
Jean-Marc Lasgouttes
57d6835a90 Spacing 2018-01-12 12:27:03 +01:00
Jean-Marc Lasgouttes
706c9f2aa5 Fixup 27eb415d: do not define mymkdir() when it is not used.
Pleases coverity.
2018-01-12 12:24:58 +01:00
Jean-Marc Lasgouttes
4f21f788b4 Looks like these are not needed for tests in support/ 2018-01-08 11:20:06 +01:00
Jean-Marc Lasgouttes
586890f09e Make #include directories explicit 2018-01-08 11:19:15 +01:00
Jean-Marc Lasgouttes
d77b05db80 Move the inPixels(MetricsBase) help from Length to MetricsBase.
A basic class like Length should not depend on something from
frontend.

This change allows to remove several dummy implementations of
theFontMetrics().
2018-01-05 20:14:04 +01:00
Jean-Marc Lasgouttes
39a8000589 Do not use Application for a 'cancel export' boolean
It is not good for a support function to depend of anything outside of
it, especially Application.

Here the boolean that indicates that export should be canceled is put
in Systemcall. This allows to remove all the dummy theApp() function
that have been added here and there for linking needs.
2018-01-02 16:01:07 +01:00
Richard Heck
61b1a20185 Fix crash after cancellation code.
I thought we didn't use clones when exporting from the command line.
We probably shouldn't.
2017-12-25 13:07:58 -05:00
Richard Heck
56071d2fb0 Dummy theApp() method should return a pointer. 2017-12-23 14:40:18 -05:00
Kornel Benko
35eabe1ea7 Fix linking errors for check_filetools, check_trivstring, check_convert, check_lstrings
This may amend f1df7e478d
2017-12-22 07:19:13 +01:00
Richard Heck
165c9e92a4 Systemcall infrastructure for canceling background processes. 2017-12-21 18:55:39 -05:00
Uwe Stöhr
5ebff51e99 gzstream.cpp: whitespace fix 2017-12-16 13:09:39 +01:00
Richard Heck
b954f478e3 Fix #10858 compiler warnings. 2017-12-15 23:41:32 -05:00
Richard Heck
1182e303b1 Fix #10852 compiler warnings. 2017-12-15 23:28:33 -05:00
Richard Heck
27eb415d25 Probably fix #10850 compiler warnings. 2017-12-15 23:25:51 -05:00
Richard Heck
9f56f97d8e Fix bug #9847.
Spaces are, amazingly, allowed at the end of bibliography keys. So we
introduce a new parameter allowing getVectorFromString not to trim
whitespace, and then use it.
2017-10-18 16:42:47 -04:00
Juergen Spitzmueller
b498646b2e Fix some spelling errors reported by Sven
Fixes: #10678
2017-09-22 09:29:16 +02:00
Kornel Benko
187824da3c Amend d6285d5, copy & paste error, urrrrg 2017-08-04 16:16:08 +02:00
Kornel Benko
d6285d52e7 For cmake case try to use the newly built .gmo files first. 2017-08-04 16:06:32 +02:00
Kornel Benko
b5a4e79736 Since boost dir may not exist anymore, use the lyx-src dir for out-of-source build detection 2017-08-02 18:44:32 +02:00
Christian Ridderström
e30f3d76d2 Bulk cleanup/fix incorrect annotation at the end of namespaces.
This commit does a bulk fix of incorrect annotations (comments) at the
end of namespaces.

The commit was generated by initially running clang-format, and then
from the diff of the result extracting the hunks corresponding to
fixes of namespace comments. The changes being applied and all the
results have been manually reviewed. The source code successfully
builds on macOS.

Further details on the steps below, in case they're of interest to
someone else in the future.

1. Checkout a fresh and up to date version of src/

    git pull && git checkout -- src && git status src

2. Ensure there's a suitable .clang-format in place, i.e. with options
   to fix the comment at the end of namespaces, including:

    FixNamespaceComments:                           true
    SpacesBeforeTrailingComments:                   1

and that clang-format is >= 5.0.0, by doing e.g.:

    clang-format -dump-config | grep Comments:
    clang-format --version

3. Apply clang-format to the source:

    clang-format -i $(find src -name "*.cpp" -or -name "*.h")

4. Create and filter out hunks related to fixing the namespace

    git diff -U0 src > tmp.patch
    grepdiff '^} // namespace' --output-matching=hunk tmp.patch  > fix_namespace.patch

5. Filter out hunks corresponding to simple fixes into to a separate patch:

    pcregrep -M -e '^diff[^\n]+\nindex[^\n]+\n--- [^\n]+\n\+\+\+ [^\n]+\n'  \
        -e '^@@ -[0-9]+ \+[0-9]+ @@[^\n]*\n-\}[^\n]*\n\+\}[^\n]*\n'         \
        fix_namespace.patch > fix_namespace_simple.patch

6. Manually review the simple patch and then apply it, after first
   restoring the source.

    git checkout -- src
    patch -p1 < fix_namespace_simple.path

7. Manually review the (simple) changes and then stage the changes

    git diff src
    git add src

8. Again apply clang-format and filter out hunks related to any
   remaining fixes to the namespace, this time filter with more
   context. There will be fewer hunks as all the simple cases have
   already been handled:

    clang-format -i $(find src -name "*.cpp" -or -name "*.h")
    git diff src > tmp.patch
    grepdiff '^} // namespace' --output-matching=hunk tmp.patch  > fix_namespace2.patch

9. Manually review/edit the resulting patch file to remove hunks for files
   which need to be dealt with manually, noting the file names and
   line numbers. Then restore files to as before applying clang-format
   and apply the patch:

    git checkout src
    patch -p1 < fix_namespace2.patch

10. Manually fix the files noted in the previous step. Stage files,
    review changes and commit.
2017-07-23 13:11:54 +02:00
Jean-Marc Lasgouttes
fc75cbd88f Remove copy-and-paste error 2017-07-11 13:43:32 +02:00
Jean-Marc Lasgouttes
0ba385800e Rewrite stripName without regex
Using a regular expression to find /src/ or \src\ in a string is overkill,
and since regexes can throw exceptions, it makes coverity nervous.

The new code is simpler anyway.
2017-07-06 15:26:32 +02:00
Richard Heck
fd5a950d7f Fix whitespace in some more files. 2017-07-03 14:46:27 -04:00
Richard Heck
00e4902ea3 Fix trailing whitespace in txt files. 2017-07-03 13:53:41 -04:00
Richard Heck
75bfed5507 Fix trailing whitespace in cpp files. 2017-07-03 13:53:14 -04:00
Richard Heck
51aebc9327 Fix whitespace at EOL. 2017-07-03 13:46:30 -04:00
Guillaume MM
fd6189b7e3 Remove FileMonitorBlocker which does not work reliably on all platforms 2017-06-11 19:51:17 +02:00
Guillaume MM
b30161b591 If the external modification is a deletion, do not ask for reloading.
The behavour when hitting "reload" on a deleted file was also confusing.
2017-06-11 19:51:17 +02:00
Guillaume MM
2058faaa3b Prevent false positives in external modifications
When the Buffer is notified to be externally modified, check that the
file contents have changed using the checksum.

Document the shortcoming of FileMonitorBlocker.

Fixes #10642.
2017-06-11 19:51:17 +02:00
Guillaume MM
db58111360 Properly track the lifetime of signals2::slots (#8261)
Starting at 61b2bd5e, boost::bind was progressively replaced with
std::bind. They are not interchangeable though. boost::bind implements
the tracking of boost::signals{,2}::trackable objects. Now that
std::bind has completely replaced boost::bind, tracking never occurred.

This commit replaces boost::signals2::trackable with the new preferred
boost::signals2 methods: scoped_connections or slot::track_foreign. The
support::Trackable class introduced is less safe but easier for transitioning
old code.

Fixes the crash at #8261.
2017-06-11 19:51:17 +02:00
Guillaume MM
752a0a1e48 Correct debug message 2017-05-15 02:28:48 +02:00
Guillaume MM
c76cbead59 Cosmetic 2017-05-13 16:12:25 +02:00
Guillaume MM
974d33ad01 Remove spurious error "QFileSystemWatcher::removePath: path is empty" 2017-05-01 19:31:42 +02:00
Jean-Marc Lasgouttes
b250eb5a46 Autotools: use silent rule for moc in src/support. 2017-04-18 14:45:05 +02:00
Stephan Witt
b5c2859a92 Revert "update canAutoOpenFile/autoOpenFile implementation to new MacOSX API, avoid deprecated calls"
This reverts commit d568846e03.

Unfortunately the used alternative API LSCopyDefaultApplicationURLForContentType
is available with 10.10 and later only and cannot be used therefore. So there
is no alternative to deprecated calls ATM. LyX 2.3 should run on 10.7 at least.
2017-04-17 01:42:38 +02:00
Tommaso Cucinotta
664798128a findadv: almost all test cases, including \regex[{}, back to working with std::regex. 2017-04-17 00:15:26 +02:00
Stephan Witt
28fd15307b Care for a tilde in front of a path name. A path name with tilde sign at start is interpreted as relative to the current users home directory. 2017-04-15 13:30:35 +02:00
Enrico Forestieri
031748d9c8 Avoid an assertion when compiling in debug mode with MSVC 2015
Seemingly, when removing an argument from argv, and thus inserting
a null pointer to shorten the array, causes an assertion because
the null pointer is not a valid heap pointer (sic!)

Fixes bug #10440
2017-04-12 21:19:42 +02:00
Stephan Witt
d568846e03 update canAutoOpenFile/autoOpenFile implementation to new MacOSX API, avoid deprecated calls 2017-04-08 21:01:17 +02:00
Enrico Forestieri
d996ec8992 On windows, use the unicode version of ShellExecute 2017-03-28 01:32:59 +02:00
Jean-Marc Lasgouttes
522f3517e1 Handle properly exception that can be thrown by to_local8bit
Remove the use of this function in GuiAlert.

This was spotted by coverity
2017-03-27 16:13:26 +02:00
Jean-Marc Lasgouttes
2a0e4c199c Fix coverity issues about exceptions
There a some exceptions related to the fact that BOOST_ASSERT throws
an unhandled exception, which is fait enough. This is handled by
uploading a modeling file to coverity.

The second batch of issues are related to the use of lexical_cast in
convert.cpp. We use now a wrapper around boost::lexical_cast that does
not throw but return empty strings instead. I am not sure actually of
when lexical_cast could fail.
2017-03-24 16:47:35 +01:00
Guillaume Munch
c779e9806e Cosmetic 2017-03-19 14:41:17 +01:00
Guillaume Munch
9926927fb1 Ressurect old FileMonitor à la Frankenstein
ActiveFileMonitor combines QFileSystemWatcher with the previous checksum
approach.
2017-03-19 14:41:17 +01:00
Guillaume Munch
6c4b9c97cb Blocking signals also blocks the notification of file creation (#10595) 2017-03-19 14:41:17 +01:00
Guillaume Munch
fa9ab74ffa Correct ownership
One can now delete a file monitor if a blocker is active.
2017-03-19 14:41:17 +01:00
Jean-Marc Lasgouttes
7a124ab861 Fixup commit 50060053
Fix two instances where theFormats() was used instead of a local parameter.

Fix layout test.
2017-03-14 14:26:26 +01:00
Guillaume Munch
797bb2df14 Fix compilation with 5 <= qt < 5.4 2017-03-11 22:22:27 +01:00
Guillaume Munch
24f68aff8d Nonsense for whoever insists on using gcc4.6 & qt4.8 in 2017 2017-03-11 00:50:57 +01:00
Guillaume Munch
f96d7a8b2c Remove legacy FileMonitor 2017-03-11 00:50:57 +01:00
Guillaume Munch
caa54e80ee Implement FileMonitor as a wrapper for QFileSystemWatcher
The new file monitor supports both boost and qt signals. It is implemented in a
ressource-safe way.
2017-03-11 00:50:57 +01:00
Jean-Marc Lasgouttes
ce0c11ba4e Remove unreachable return statements
They were needed long ago to avoid gcc warnings, but now all they do
is create coverity warnings.
2017-03-09 15:05:33 +01:00
Kornel Benko
5d3d26b024 Cmake build: Adapt handling of mytheslib to automek behaviour
The added cmake-parameter is:
  -DLYX_EXTERNAL_MYTHES=<value>
where <value> is one of
  AUTO	(Default) Search first on system for mythes (lib and include)
  ON	Use installed only (errors if not installed)
  OFF	Compile the provided source in 3rdparty
2017-03-07 14:27:08 +01:00
Kornel Benko
15babdc0f1 Amend 0e50ad8 'move mythes sources to 3rdparty' for cmake build. 2017-03-06 19:31:23 +01:00
Jean-Marc Lasgouttes
0e50ad8b16 Update bundled mythes to version 1.2.5
Move it to 3rdparty/ directory alongside the other ones.
2017-03-06 17:08:38 +01:00
Jean-Marc Lasgouttes
8a9ea4d264 Initialize properly pointer
Fixes coverity issue 23411
2017-02-25 00:20:51 +01:00
Guillaume Munch
8353a53cc3 Clarify comment 2017-02-22 16:57:13 +01:00
Jean-Marc Lasgouttes
e04079aa52 Fixup to 33b696c8: fix compilation with gcc 4.6 2017-02-21 06:21:49 +01:00
Guillaume Munch
33b696c8ac Introduce support/Cache.h
Useful to cache copies of objects, including shared_ptrs. No risks of dangling
pointer, and avoid naked pointers in the source.

Fix memory leak when compiling with Qt5.
2017-02-21 00:06:07 +01:00
Juergen Spitzmueller
c59375d679 Move protectArgument function to lstrings
This will be useful to other insets as well.
2017-01-29 12:08:29 +01:00
Juergen Spitzmueller
ef387c81af Handle backslash in escape function.
Fixes: #4595.

Candidate for stable
2017-01-27 09:15:47 +01:00
Juergen Spitzmueller
867cdb0662 Extend the Bibfiles cache
For biblatex, we need the file name as it was entered in the inset
(abs path, rel path, only file name) in order to resolve it properly
for the export (as in the BibTeX inset intself).

Therefore, we now store a pair<docstring, FileName>.

A FileNamePairList has been added to FileNameList for this purpose.
2017-01-02 13:00:14 +01:00
Juergen Spitzmueller
c0000cc405 Improve quotation mark opening/closing guess
Fixes: #8831

This introduces
* a new inset member isPartOfTextSequence() that returns
whether the inset produces something visible at the current position
in the text flow
* an isOpenPunctuation() test that returns whether a character is in the
'Punctuation, Open' unicode class. This is used instead of just checking
for two (Western, ASCII) opening brackets

It also fixes the isChar() and isLetter() value of InsetSpecialChar,
since some types have not been assigned correctly.
2016-12-27 12:06:54 +01:00
Jean-Marc Lasgouttes
c5119c97fc Add caching for the QTextLayout objects we use
The QTextLayout handling is terribly slow on Qt 4.8.7, but some
caching has been added in Qt5 that makes it much faster. For some
reason, it is not that slow with Qt 4.8.1.

Caches are introduced for the three following methods

* width(doctring), controlled by CACHE_METRICS_WIDTH. This cache already
  existed, but the code has been cleaned up

* getTextLayout, controlled by CACHE_METRICS_QTEXTLAYOUT (disabled by
  default on Qt5, which does its own caching). This is used for pos2x
  and x2pos and now for drawing of text too. The previous code used a
  trivial caching scheme of the last used QTextLayout, but now they
  are properly kept in a QCache. Moreover, the cacheEnabled() property
  is enabled for these QTextLayout object (not sure what this does).

* breakAt, controlled by CACHE_METRICS_BREAKAT. This is the only user
  of QTextLayout which did not have some kind of caching already.

For some weird reasons related to Argument-dependent look-up, the
qHash(docstring) function has to be defined in std namespace, since
lyx::docstring is actually std::basic_string<wchar_t>.

[NOTE: this version has profiling hooks, enabled by commenting out the line
  #define DISABLE_PMPROF
that should eventually be removed.]
2016-12-19 18:47:18 +01:00
Jean-Marc Lasgouttes
c139aef379 Add a way to disable the poor man's profiler
Just define DISABLE_PMPROF _before_ #including the header.
2016-12-09 15:47:19 +01:00
Tommaso Cucinotta
9c1142c880 Remove unneeded templatization code from bformat(). 2016-12-04 17:10:10 +01:00
Guillaume Munch
e449e70e38 Simplify Changers interface
In fact having an extra parameter "bool cond" is no longer useful because it can
now always be emulated with a ternary operator:
	Changers dummy = cond ? do_change() : Changer();
2016-11-21 00:08:11 +01:00
Guillaume Munch
1f945177b9 Docstringify getLongString in general and preamble snippets in particular
Prepare ground for TexRow InPreamble
2016-10-17 00:16:59 +02:00
Guillaume Munch
efbec20320 Fix the compare_locale function by relying on Qt's (#9030) 2016-08-28 01:30:53 +01:00
Enrico Forestieri
589f49ff36 Use only one file for dummy implementations 2016-08-20 00:41:04 +02:00
Kornel Benko
3c9d5d3cda Cmake build: Add verbose variable to some dummy_functions.cpp 2016-08-19 11:15:10 +02:00
Enrico Forestieri
fb46b3a1ee Fix exit code from runCommand on Windows
On Windows, runCommand has never returned the exit code of the
spawned process but the result of correctly closing the input handle.

Fixes #10327
2016-08-17 22:58:13 +02:00
Enrico Forestieri
2a371bb4b3 Add verbose option
Using the option -v (--verbose) all spawned commands are print
on the terminal. Note that this was done by default on previous
versions.
2016-08-17 22:32:14 +02:00
Guillaume Munch
2fd2e65745 C++11 supports thread-safe initialization of statics
A static local variable is guaranteed to be initialized only once, and in time.

Lambda expressions can be used to perform complex initialization of those static
variables on the spot.

(starting from: gcc >= 4.8, msvc >= 2015)
2016-07-31 18:34:33 +01:00
Scott Kostyshak
c659fd4f74 Remove the now unused lyx::support::expandPath()
The function is no longer used in LyX's sources (as of the previous
comit, 9b64d7bd) and is thus removed with this commit. Perhaps the
advantage this function had over other path functions we have has
disappeared over time (see e.g. 1a7b7f65).
2016-07-29 13:17:09 -04:00
Jean-Marc Lasgouttes
be1c3f5fe3 Poor man's profiler: add support for cache hit/miss
This is still very basic profiling, but it seems to get the work done.
2016-07-05 15:31:17 +02:00
Stephan Witt
b035528c1c Fix missing include for malloc prototype after header cleanup in change 489dca71cd 2016-07-04 08:33:03 +02:00
Guillaume Munch
489dca71cd Simplifications, mainly removal of boost::function and useless std::bind 2016-07-03 01:39:32 +02:00
Stephan Witt
1440b6a2fc Compile fix after change 4b64aaf, replace missing constructor for C-string with docstring variant 2016-07-02 08:30:34 +02:00
Stephan Witt
994844cb34 Correct indentation 2016-07-02 08:30:34 +02:00
Guillaume Munch
7d456a93e4 Use move when passed by value
Also unduplicate code.
2016-06-26 19:38:16 +01:00
Georg Baum
14fa2c7162 Remove using directives from headers
The only exceptions are:

- The purpose of the header is to drag in the used symbol, e.g. unique_ptr.h
- The used symbol is inside a class or a namespace other than lyx

The reason for this is that global 'using' statements effectively forbid to
use the used symbols in any other namespace in the whole program, since simply
adding or removing an #include of the corresponding header subtly changes the
name lookup. The namespace lyx is sort of global, so it should not have these
statements either.
2016-06-26 18:22:59 +02:00
Georg Baum
8e9321dec2 Amend 10b4a47185 2016-06-16 20:25:43 +02:00
Georg Baum
10b4a47185 Expose python 3 support to some testing
LyX will now always use the default python interpreter. This will hopefully
help us sto see if one of them fails in some cases.
2016-06-16 20:22:40 +02:00
Guillaume Munch
52dd5dc84f Fix compilation with gcc 4.6 part II 2016-06-15 14:42:34 +01:00
Guillaume Munch
b148629d56 Fix compilation with gcc 4.6 2016-06-14 16:44:40 +01:00
Guillaume Munch
b7abd752fa amend 6144bbfb 2016-06-14 01:34:16 +01:00
Guillaume Munch
aef8746712 amend e2bc7ffa 2016-06-14 00:21:26 +01:00
Guillaume Munch
e2bc7ffae3 RefChanger
RefChanger temporarily assigns a value to a non-const reference of any
kind. RefChanger provides a flexible and uniform generalisation of the various
scope guards previously derived from the old Changer class in MetricsInfo.h.

As before, a temporary assignment lasts as long as the Changer object lives. But
the new Changer is movable. In particular, contorsions are no longer needed to
change a private field. Special code can be moved into the appropriate classes,
and it is no longer necessary to create a new class for each specific use.

Syntax change:

   FontSetChanger dummy(mi.base, value);
-> Changer dummy = mi.base.changeFontSet(value);

New function for generating arbitrary Changers:

  Changer dummy = make_change(ref, val, condition);

Bugfix:

* Fix the display of \displaystyle{\substack{\frac{xyz}{}}} (missing style
  change).
2016-06-13 08:46:15 +01:00
Guillaume Munch
6144bbfbf8 Replace foreach with for
C++11 allows foreach-style iterations with the following syntax:

for (auto & element : container) {
 ...
}
2016-06-12 19:17:33 +01:00
Guillaume Munch
32ff5f0f30 climits
It's as you prefer, Jean-Marc.
2016-06-12 19:17:33 +01:00
Guillaume Munch
8e4648f38c Add missing header
Spotted by jkulesza
2016-06-11 05:08:23 +01:00
Georg Baum
2047ea5eb4 Replace Boost.Signals with Boost.Signals2
Boost.Signals is deprecated. This fixes bug #9943.
The only thing left to do is to rewrite (or get rid of) the boost -mt test
in config/lyxinclude.m4 not to use signals anymore.
2016-06-09 22:25:34 +02:00
Guillaume Munch
e87febd0de Exercise: simplify the definition of IconvProcessor
It is no longer needed to create fake copy constructors and assignment and to
deal with deletion by hand, thanks to unique_ptr, the inference of move
constructor and assignment operator, and the compatibility of standard
containers with movable objects.
2016-06-09 19:16:44 +01:00
Guillaume Munch
8d640dc776 Remove non-copyable idioms
Two better ways of making a class non-copyable in C++11:

* Store the p. impl. in a unique_ptr (for the cases of classes with p. impl.),
  or:

* Define publicly the copy constructor and assignment as deleted

Lots of other classes could be cleaned up in this way.
2016-06-09 19:16:44 +01:00
Jean-Marc Lasgouttes
664fca5566 Initialize correctly SystemcallPrivate in constructor
It seems that Error is the best possibility when nothing has been done yet.

Found by Coverity
2016-06-09 17:34:14 +02:00
Jean-Marc Lasgouttes
7800c05788 Initialize bool member of Package in default constructor
Found by Coverity
2016-06-09 17:26:55 +02:00
Guillaume Munch
b032e2dfaf Replace support/shared_ptr.h and boost::shared_ptr with std::shared_ptr
shared_ptrs now only require the <memory> header.
2016-06-09 15:21:39 +01:00
Guillaume Munch
af5f69cea7 unique_ptr and make_unique 2016-06-09 15:21:39 +01:00
Georg Baum
273c67d8aa Require a C++11 compiler
As discussed on the list. If no C++11 compiler is found configuration stops
with an error. There are now unneeded parts of boost, the will be removed in
a second commit.
2016-06-07 20:34:52 +02:00
Jean-Marc Lasgouttes
d0a318c742 We do not use <boost/scoped_array.hpp> anymore
The code using it  was removed at 81959251.
2016-05-29 17:55:45 -04:00
Jean-Marc Lasgouttes
5ee778af75 Remove support/metahash.h
It turns out that it did not take off since introduced in 2011. It is better to remove it and the associated boost headers (extract.sh was run against boost 1.60 to do the update).

Since we will move away from several boost classes when transitioning to C++11, it is good to start by removing lesser used ones.
2016-05-29 17:55:45 -04:00
Jean-Marc Lasgouttes
68a1f9a44e Do not use of boost::tokenizer
It is easier to use instead getVectorFromString for the use we have of this tokenizer. The two places are environment.cpp (path stuff) and qt_helpers (file fileters). The new code is much shorter.

This allow to remove boost/tokenizer.hpp and friends from our boost tree.
2016-05-29 17:55:45 -04:00
Georg Baum
d2e3a201b9 Do not redefine WINVER
Compiling different parts of the sources with different WINVER may lead to
subtle and hard to detect problems. Better use the same value everywhere.
The existing error message suggests that this was wanted anyway, and it
fixes a compiler warning when cross-compiling for mingw on linux. Our code
does not require a specific value, only a minimum value of 0x5000, which
means the resulting executable will require at least Windows 2000.
2016-05-29 17:55:44 -04:00
Georg Baum
08afc52c4c Configure included iconv with autotools
The included iconv should not be used on Linux or OS X, but (depending on
local configuration) it might be needed for crosscompiling a mingw target
from Linux. Now the user can choose whether to use the included iconv or not.
cmake does already support that.

eilseq.m4 was taken from the original libiconv 1.14 package.
2016-05-29 17:55:43 -04:00
Georg Baum
637fbb7ac9 Use c-style cast as in original
static_cast does not work
2016-05-29 17:55:43 -04:00
Georg Baum
127e5b1955 Add forgotten zlib includes
I forgot this in 9b822b25ae5. Also remove a comment that is no longer true.
2016-05-29 17:55:43 -04:00
Georg Baum
d5f2bad461 Mingw-w64 build fixes for long long
On mingw-w64, long long (64bit wide) is larger than long (32bit wide).
Therefore we need some more specializations for string, docstring,
otextstream and << overloaded ostream functions. The configuration code
is by me, the source code changes by Shankar Giri Venkita Giri (bug 10053).
2016-05-29 17:55:43 -04:00
Shankar Giri Venkita Giri
88b68ee004 Fix return types for mingw-w64
This is needed for warning-free compilation with mingw-w64, and does not hurt
for other build configurations. Patch by Shankar Giri Venkita Giri (bug 10053).
2016-05-29 17:55:43 -04:00
Guillaume Munch
4154e088b0 GuiChanges: provide feedback when there are no more changes
Remove FIXMEs: date and time localisation
2016-05-29 17:55:42 -04:00
Peter Kümmel
a0a472c16e msvc2015: always incude strfwd.h first, to prevent crashes of our
typedefed streams.
2016-04-02 11:03:17 +02:00
Peter Kümmel
44c57bb9d8 msvc2015: _wgetmainargs is not available ony more 2016-04-02 11:00:42 +02:00
Georg Baum
c0ce79452f Introduce proper integer rounding function
This fixes a failing unit test with 32bit gcc 4.9.3 and -O2 optimization:
It computed 9953 instead of 9954 for Length::inPixels() of value 2342.
The reason for this is probably different rounding behaviour caused by storing
the unrounded value in a processor register (uses 80bit accuracy) vs. writing
it back to memory (uses 64bit accuracy). The unrounded value is very close to
9953.5 (which is not representable as an exact IEEE floating point value).

Apart from that, having a proper function for rounding makes the code more
readable, and has the nice side effect to make Length::inPB() work for
negative lengths as well.
2016-02-17 21:42:37 +01:00
Georg Baum
de3e5280f6 Open tex2lyx input files with correct encoding
We open the input file now twice: The first time in latin1 encoding to read
the document encoding from the preamble. This does always work, since
traditional TeX does not allow non-ASCII contents without an encoding changing
command (except for comments, but we do not need them, and using latin1 rather
than utf8 ensures that they do not produce an iconv exception, but are simply
recored with wrong characters), and we do detect the utf8 based TeX engines
XeTeX and LuaTeX as well. The second time we open the file directly with the
document encoding.

This fixes a few tex2lyx tests on OS X, since changing the encoding of an
open file steam does not work with clang on OS X. Files using more than one
encoding are still broken, but all single-encoding files are fixed now.
2016-01-31 12:54:59 +01:00
Georg Baum
92d0835e14 Avoid encoding changes of open streams if possible
Changing the codecvt_facet of a file stream after the file has been opened
does not work with clang on OS X. Therefore we avoid it if possible (i. e. the
new encoding is the same as the old one).
2016-01-31 12:49:17 +01:00
Georg Baum
8171272d1f Fix file locking problem on windows (bug 9925)
External processes cannot access files which are open in LyX. Therefore the
temp files created by the external inset need to be closed right after
creation. The symptom was that the date inset did not produce any outout on
windows (bug 9925). This change reverts a small part of f09a9fe2.
Although the date inset is unimportant and will probably be removed, this
change is important for all external insets that make use of temp files.
2016-01-26 21:49:08 +01:00
Scott Kostyshak
20addbbf36 Qt 5.6 renames signal QProcesss::error()
QProcesss::error() was renamed to QProcesss::errorOccurred().

The renaming was done to avoid confusion from overloading (see the
documentation for the signal before the renaming [1]).

For more details, see this Qt bug report [2].

[1] http://doc.qt.io/qt-5/qprocess.html#error-1
[2] https://codereview.qt-project.org/#/c/114451/
2016-01-24 12:07:52 -05:00
Stephan Witt
3d00aef3ac use QStandardPaths::GenericDataLocation instead of QStandardPaths::DataLocation to get common user_support_dir path for all LyX binaries (LyX, tex2lyx and lyxclient) 2016-01-24 15:19:54 +01:00
Pavel Sanda
555b08c325 Comment only. 2016-01-18 14:29:37 -08:00
Peter Kümmel
e1c893127f boost dir is used for out-of-source build detection 2015-12-20 14:00:04 +01:00
Guillaume Munch
400703aff1 Convert remaining C++ files to UTF-8 2015-12-05 19:33:24 +00:00
Georg Baum
e8211fb931 Fix C++11 std::regex incompatibility
boost::regex supports escape sequences starting with a backslash in format
strings of regex_replace, but std::regex does not. Therefore format strings
involving literal backslashes have to be written differently for both flavours.

The special MSVC handling in regex.h is removed, since it is not needed
anymore, and using grep syntax would definitely be wrong.
2015-11-24 20:31:14 +01:00
Georg Baum
08317ecc0b Fix some thinkos in MSVC regex hack
The changed code is not used, but I tried to use a similar approach for
boost::regex, and found some problems:
- regex_replace and regex_search are implemented in the replacement, so they
  must not be used directly
- an smatch object must be given by reference (as in the called methods),
  otherwise an exception would be thrown at runtime
- the commented out regex_replace version is actually needed

This code is supposed to be deleted, but nevertheless I wanted to record here
how it had to be modified if it was actually needed.
2015-11-22 13:02:39 +01:00
Kornel Benko
c9f6ed309f Cmake monolithic build: Some corrections.
In the src/support directory do not use src/support/AppleScriptProxy.cpp if not APPLE.
In the src/client directory remove inclusion of src/TexRow.cpp
2015-11-17 21:21:00 +01:00
Juergen Spitzmueller
2a223b0933 Rename function that was ambiguous from a monolithic perspective.
Cures one monolithic build issue with CMake.
2015-11-16 08:20:54 +01:00
Enrico Forestieri
76dfde36d4 Fix bugs #2645 (export BIBINPUTS) and #6634 (Better support for external files in ERT)
Other than BIBINPUTS, also BSTINPUTS and TEXFONTS are exported.
They do not replicate the setting for TEXINPUTS but are set such
that the current dir (i.e., the temp dir) and the document dir
are also searched for bibtex and fonts related files.
2015-11-03 23:28:36 +01:00
Guillaume Munch
671c7e12e5 Amend bb344452
Repair the senseless truncation on long file names
2015-10-21 15:02:12 +01:00
Guillaume Munch
7a60c96dfa msvc: Proper fix for compilation of TexRow
This bug in MSVC 10 was fixed at e948caf6, but the workaround belongs to
strfwd.h.

Thanks Vincent and Georg.
2015-10-20 21:29:19 +02:00
Vincent van Ravesteijn
990446c0e1 msvc: Move implementation of numpunct<> functions to cpp file
These functions use lyx::from_ascii which means they need to include
docstring.h, but that results in a circular include.
2015-10-20 21:28:40 +02:00
Jean-Marc Lasgouttes
b14c0530eb Assorted cppcheck fixes
Remove member disp_ that is defined both in Cursor and CursorData classes

Pass parameter of convert<T>(docstring const) templates as const reference for performance.
2015-10-20 09:58:46 +02:00
Georg Baum
79f11f4e7d Fix std::string docstream output error
This was made visible by aab1b145a5, since xhtml export for
lib/doc/Additional.lyx caused an exception. However, the cause for this was
already present earlier: All attempts to output a std::string to an
odocstream resulted in trying to change the encoding of the stream instead,
since there is no operator<<(odocstream &, std::string) defined, and an
implicit conversion to SetEnc happened instead.
This is fixed by making the SetEnc constructor explicit and adjusting all
code parts that did not compile anymore after that. The parts of the code
that did use the wrong output operator were the std::string version of
htmlize() from output_xhtml.cpp and all changed parts in the other .cpp files.
I also removed the std::string versions of html::htmlize() and
html::cleanAttr(), since it was difficult to see which encodings were used
with these. Now we are always explcit when using html::cleanAttr() and
html::htmlize().
2015-10-15 20:52:28 +02:00
Georg Baum
8a047a4112 Add missing intializations
These were found by cppcheck:
Member variable 'x' is not initialized in the constructor.
The crash #9788 would not have happened if this had been done earlier.
2015-10-10 21:04:28 +02:00
Stephan Witt
989c72530e Avoid the use of a static NSAutoreleasePool.
This seems to cause crashes on exit from time to time.
2015-10-09 08:16:24 +02:00
Guillaume Munch
bb344452c8 Consistency of ellipses across the UI
Use the function support:truncateWithEllipsis() to shorten a docstring with
... at the end. Actually we use U+2026 HORIZONTAL ELLIPSIS instead of "..." when
automatically shortening strings. This is to be consistent with Qt's own
truncation and is much nicer on the screen.

This includes the bugs #9575 and #9572 regarding broken text elision in the
outliner.

Known issues (non-regressions):

* TocBackend::updateItem() should be rewritten to update all TOCs. (#8386)

* "..." should be replaced with … everywhere else on the interface (including
  translation strings).

* We should prefer to rely on QFontMetrics::elidedText() to truncate strings
  with an ellipsis whenever possible, or an equivalent for the buffer view
  dependent on the font metrics. See the warning in src/support/lstrings.h.
2015-10-05 21:16:16 +01:00
Jean-Marc Lasgouttes
b7909e7e6c Remove support for precompiled headers for autotools
This was turned off by default for a long time, and it does not seem
to have any use these days.
2015-09-25 12:05:40 +02:00
Georg Baum
b6aed54c45 Fix cppcheck variable scope warnings
These were all flagged by "(style) The scope of the variable 'x' can be reduced."
Narowing the scope improves readability, and if it is in a loop then the
compiler will be clever enough to produce efficient code, we do not need
manual optimization for POD types.
2015-09-20 10:42:35 +02:00
Guillaume Munch
12de677fcc Support for (std|boost)::make_shared 2015-09-15 15:25:32 +01:00
Georg Baum
699a6db9fa Add some missing member variable initializations
These were all found by cppcheck. Even in constructors that are there "only
because of std containers" the class should be initialized correctly. You can
never know whether such an object does not get used, and then a nice crash
caused by dereferencing a NULL-pointer is better than undefined behaviour.
2015-09-13 19:47:21 +02:00
Jean-Marc Lasgouttes
1e4adc512e In fileLock, take in account the case where the file cannot be opened
overity issue 23352
2015-09-12 23:53:19 +02:00