Commit Graph

22077 Commits

Author SHA1 Message Date
Enrico Forestieri
1b0cbb6932 Fix building with cmake on cygwin.
Add required libraries for the link stage.
2014-12-26 17:00:23 +01:00
Enrico Forestieri
9126a99e97 Fix bug #9217: [Qt5] QWindowsMime class not available
The support for QWindowsMime has been reintroduced in Qt 5.4.0.
The class name has been changed to QWinMime but the interface
is exactly the same.
2014-12-26 16:53:31 +01:00
Georg Baum
903917f3b8 Add tex2lyx test for KOMA-Script classes
In the future this test case should contain all KOMA-Script features.
Currently, it tests just \captionabove anmd \captionbelow.
2014-12-23 22:33:32 +01:00
Georg Baum
6f34a8a640 Get rid of tr1 support
As discussed on the list. We don't need it anymore, either we have a modern
compiler that supports C++11, or we fall back to boost. I kept and adjusted
the regex #define, since we cannot use std regex completely yet.
2014-12-23 22:18:08 +01:00
Stephan Witt
54b0fa330e Drop runtime support for OS X 10.5 NSSpellChecker 2014-12-23 18:19:27 +01:00
Georg Baum
bb87e0422a Revert parts of 7e69ac220d
This fixes the tex2lyx test test-refstyle-theorems.tex. It seems that the
intent of the fix was to remove a \protect in front of a \caption,
\captionabove or \captionbelow, but the implementation did not really do that.
Furthermore, it is not clear in which cases a \protect in front of a caption
needs to removed, and in which cases it needs to be kept: After looking at the
LyX sources I could not see that caprions are always output with \protect.
2014-12-22 21:32:45 +01:00
Jean-Marc Lasgouttes
e32a3e7f57 Reduce use of double variables in Row
All the code that is run before row metrics have been computed should use int arithmetic. After metrics have been computed, we still need doubles because fully justified rows use double for Row::Element::extra.

Rename Row::x to Row::left_margin and change its type to int.

Rename Row::Element::width() to full_width(). In some places of the code, use dim.wid (the int version without the extra separator) because metrics have not been computed.

Let Row::Element::x2pos take a int& argument instead of double&

Let Row::Element::breakAt take a int argument instead of double
2014-12-22 14:07:24 +01:00
Jean-Marc Lasgouttes
8bab23384a Fix the last clang warnings about overloaded virtual methods
This patch fixes a series of warnings like:
{{{
In file included from ../../master/src/mathed/InsetMathBoldSymbol.cpp:13:
In file included from ../../master/src/mathed/InsetMathBoldSymbol.h:15:
../../master/src/mathed/InsetMathNest.h:37:7: warning: 'lyx::InsetMathNest::metrics' hides overloaded virtual function [-Woverloaded-virtual]
        void metrics(MetricsInfo const & mi) const;
             ^
../../master/src/insets/Inset.h:186:15: note: hidden overloaded virtual function 'lyx::Inset::metrics' declared here: different number of parameters
      (2 vs 1)
        virtual void metrics(MetricsInfo & mi, Dimension & dim) const = 0;
                     ^
}}}
For a description of the problem, see for example:
http://stackoverflow.com/questions/18515183/c-overloaded-virtual-function-warning-by-clang

3 different strategies have been used:
 * in frontend, some functions have been renamed.
 * in InsetMath.h, Inset::write has been explicitly imported too
 * in InsetMathNest.h, since a comment said that hiding Inset::metrics is intended, a special trick has bee used to silence the warning.
2014-12-22 11:02:45 +01:00
Scott Kostyshak
625cea1528 Whitespace 2014-12-21 19:01:52 -05:00
Georg Baum
ed3b3afbe9 Make Converter class thread-safe
Again, this is used in a global list shared by all threads
2014-12-21 22:05:15 +01:00
Georg Baum
0af021878b Make Format class almost thread-safe
This is needed since all formats are stored in a global list which is shared
between threads, but never modfified except from the main thread.
The only missing bit is extension_list_, which is not so easy to do.
2014-12-21 21:40:25 +01:00
Georg Baum
90b1f084bf Improve C++11 support
If we compile in C++11 mode, do not use the boost replacements for bind,
functional and shared_ptr. regex is excluded, since it misses match_partial, and
gcc does not provide a usable one in versions less than 4.9.0.
I also removed the #define for match_partial, since this is dangerous. Now you
get a compile error instead of subtle runtime differences.
2014-12-21 20:22:16 +01:00
Juergen Spitzmueller
c9609fe56a Do not warn about changed modules when changing modules.
Part of #9356
Also fixes #9365
2014-12-21 19:10:13 +01:00
Georg Baum
c4613963fa Add missing using declarations
This fixes using std::tr1::regex for non-MSVC compilers.
2014-12-21 19:05:00 +01:00
Georg Baum
158b9a0e55 ::readlink() needs unistd.h
this is included in some gcc headers, but not in c++11 mode, that is the
reason why we did not get a compile error so far.
2014-12-21 18:13:33 +01:00
Georg Baum
7796ad3a36 Improve llvm libc++ detection
The old detection did only work if CFLAGS contained -std=c++11, since ciso646
was only included for __cplusplus > 199711.
Thanks to Koernel for the cmake part.
2014-12-21 17:26:21 +01:00
Juergen Spitzmueller
9b3e47fd87 Output package options before loading any package.
Fixes: #9355
2014-12-21 12:10:06 +01:00
Juergen Spitzmueller
740d9162c0 When switching classes, warn user about all unapplied document changes
Currently, this is limited to modules.

Part of #9356.
2014-12-21 11:49:08 +01:00
Juergen Spitzmueller
276fa4825d Do not silently dismiss unapplied document changes when adding module
Part of #9356
2014-12-21 11:47:59 +01:00
Juergen Spitzmueller
41c35476e5 Fix initialization order 2014-12-21 10:13:56 +01:00
Scott Kostyshak
15ae3eb85c Initialize recently added forceownlines_ bool
This adds on to the fix for #8875 (a25569eb).
2014-12-20 15:05:20 -05:00
Scott Kostyshak
6da7ee1be1 Whitespace 2014-12-20 15:03:40 -05:00
Georg Baum
d553938c92 Improve and unify error messages
Now the errors given for an unknown layout in copystyle and obsoletedby provide
the same information.
2014-12-09 21:20:56 +01:00
Georg Baum
c6b98a504f Make Encoding class thread-safe
Now all const methods may be called without additional locking.
This is assumed by the threaded LaTeX export, which always useses a globally
unique instance for each encoding.
2014-12-08 22:25:40 +01:00
Georg Baum
364e0f72c4 Fix invalid iterator access 2014-12-08 21:29:25 +01:00
Jean-Marc Lasgouttes
0bdfca2c6e \\subfloat captions are moving arguments
Therefore insets should be protected in these captions.

Fixes bug: #9346.
2014-12-08 09:43:49 +01:00
Juergen Spitzmueller
cfeddb9293 Add ObsoletedBy tag to InsetLayout
Fixes: #9000.
2014-12-08 09:08:45 +01:00
Georg Baum
5b336954d7 Try to fix compilation on cygwin 2014-12-07 20:43:47 +01:00
Georg Baum
0b30253f2b Fix compilation without trivstring 2014-12-07 20:39:31 +01:00
Georg Baum
c86f299a50 Encapsulate Converter class
Now members are not directly accessible anymore.
2014-12-07 18:35:28 +01:00
Georg Baum
25344de51d Make Language and Encoding threadsafe
Read-only access to these classes is now threadsafe, with one exception:
The encoding neds to be already initialized (i.e. init() must not be called).
This makes bug 9336 unreproducable on my machine, although it is not completely
fixed yet.
2014-12-07 18:26:44 +01:00
Georg Baum
d5aaee1f6b Whitespace 2014-12-07 17:29:12 +01:00
Georg Baum
83bee109db Make trivstring class ready for use
The interface is now 100% unit tested, and the typedefs depend on the new
STD_STRING_USES_COW configuration variable. The only missing bit is to detect
clang and disable STD_STRING_USES_COW for clang.
2014-12-07 13:14:17 +01:00
Georg Baum
46f7b578b2 First version of trivstring class (bug #9336)
As discused on the list. This is not used yet, but it is intended to provide
thread-safe read-access without the need for synchronization if the used STL
implementation does not provide it for std::basic_string. This is the case for
all implementations using copy-on-write.
2014-12-07 13:14:17 +01:00
Juergen Spitzmueller
2614d5a386 Use appropriate (cheaper) conversion. 2014-12-07 13:06:29 +01:00
Uwe Stöhr
0d63bdfc16 tex2lyx/text.cpp: bring back a comment as discussed 2014-12-04 00:57:14 +01:00
Georg Baum
49af9db623 Remove unneeded typedef
docstring is already defined in strfwd.h (which is included from docstring.h).
There are only two possible cases:
Either the typedef in docstring.h defines an identical type (then it is not
needed), or it defines a different type (then it generates a compilation error)
=> it is not needed.
2014-12-03 21:08:13 +01:00
Juergen Spitzmueller
a25569ebb3 Add a layout tag ForceOwnlines that assures an inset is started and terminated by a line break in the LaTeX output.
Fixes: #8875.
2014-12-01 14:56:47 +01:00
Juergen Spitzmueller
e5e8bff75b corrected_env: use breakln instead of hardcoded linebreak 2014-12-01 14:45:11 +01:00
Uwe Stöhr
7e69ac220d tex2lyx: support for KOMA-script's \caption* commands
- To my knowledge tex2lyx supports now all caption constructs provided by LyX.
- InsetArgument is correct here, I therefore deleted the FIXME.
2014-12-01 02:57:12 +01:00
Georg Baum
208e67c7a7 Avoid implicit copy 2014-11-30 12:59:00 +01:00
Georg Baum
38d387d1ab Remove heavy includes 2014-11-30 12:52:01 +01:00
Georg Baum
06cfd26d5e Fix return value of CVS::toString() + cosmetics
CVS::toString() returns a docstring, so rather be explicit than relying on a
cast that not everybody understands how it works at first sight.
2014-11-30 12:41:49 +01:00
Georg Baum
e066dd6bd9 A stringstream is overkill here 2014-11-30 12:37:43 +01:00
Enrico Forestieri
11b7b7234e Fix bug #9342: LaTeX build get stuck for unconventional path name
The reason being that the TEXINPUTS path list was not quoted on Windows.
This was no problem with spaces but some special characters are
interpreted by the shell and can cause problems. In this particular
case, the '&' character was being interpreted as a command separator.
2014-11-27 21:59:09 +01:00
Jean-Marc Lasgouttes
38f8858671 Fix warnings reported by clang
All these problems have the same root: the address of a reference can never be 0, and it does not make sense to test it.
2014-11-27 19:10:43 +01:00
Georg Baum
2c5c2a6683 Better fix for bug #8679
Thanks to Enrico, who noticed that the previous fix did not take into account
the case of nonempty length argument + the next line beginning with [.
Now the parsing is exactly the inverse of InsetMathGrid::eolString().
2014-11-26 22:06:15 +01:00
Jean-Marc Lasgouttes
8d6d21c6d9 Add new variables lyx_build_date/time
These are now in version.cpp. The build machinery should therefore make sure
that version.cpp is recompiled at every compilation.

These variables are now referred to by the other places that made use of __DATE__ and __TIME__.
2014-11-25 18:58:35 +01:00
Uwe Stöhr
bfc4af2d01 tex2lyx/text.cpp: add missing part of a comment 2014-11-25 00:53:35 +01:00
Uwe Stöhr
1427b6fe31 tex2lyx: support for glue lengths in InsetSpace 2014-11-25 00:50:39 +01:00