Commit Graph

2833 Commits

Author SHA1 Message Date
Enrico Forestieri
29cebc7fb0 Fix CAS computation of a selected subformula.
Invoking a computer algebra system program for computing a selected
subformula has never worked (checked with all LyX versions back to 1.3)
and, moreover, in the presence of a selection things go awry.
This commit allows this computation by replacing the selected
subformula with the result of the computation.
2014-11-09 21:57:29 +01:00
Enrico Forestieri
9f613a5f7e Fix issue with CAS.
See http://thread.gmane.org/gmane.editors.lyx.devel/153516
This regression was due to a thinko in [43f6b167/lyxgit].
2014-11-09 02:19:00 +01:00
Enrico Forestieri
d1858b89d0 Fix bug #9319: Problems with space inside math and textrm. 2014-11-04 21:36:10 +01:00
Enrico Forestieri
77b0452a30 Fix bug #7970: space disappears from equation when reopening LyX file. 2014-11-04 21:30:49 +01:00
Jean-Marc Lasgouttes
e52a385493 Reimplement inset-select-all in a generic way
There are 3 possible actions (in order)
* select current cell
* select all calls of inset
* select the inset from outside (in the containing inset)

This fixes completely #7727.
2014-11-01 16:54:23 +01:00
Scott Kostyshak
3b96c6e901 Remove line in text export of inline math (#9282)
If there is only one row, a new line should not be appended. If
there is more than one row, the new line should not be appended for
the last row.

For example, if in LyX there was "as you can see in $x$ there..." a
copy/paste would lead to a newline after "x".
2014-10-15 19:18:46 -04:00
Alfredo Braunstein
866fc2afcc mathed/InsetMathHull.cpp (InsetMathHull::doDispatch): do not declare LFUN_FINISHED_* lfuns as undispatched after handling them
Fixes #9289, and an unreported cousin of #3900
2014-10-12 11:07:28 +02:00
Stephan Witt
bf581924c9 Fix possibly uninitialized use of variables 2014-09-03 00:07:26 +02:00
Uwe Stöhr
94a9c127e3 support for the LaTeX commands \x***arrow
- this patch supports the \x***arrow commands provided by the mathtool package
- fileformat change
2014-08-25 00:44:09 +02:00
Jean-Marc
93a43742a5 Fix a bunch of small performance issues spotted by cppcheck
Most of these are about passing const strings parameters as references.
2014-07-05 19:13:10 +02:00
Jean-Marc
1cdbb94ff5 Fix possible bug spotted by cppcheck
I am not sure what this locking is really about, but the new code seems to be the right thing to do.
2014-07-05 19:12:09 +02:00
Georg Baum
f09a9fe2e6 Remove unsafe method FileName::tempName()
FileName::tempName() created a new temp file name by using qt to create a
temporary file with a unique name, and then deleting that file and returning
the name. This was unsafe, since other processes or even other threads of the
running LyX could create files with the same name between deletion and then
using the temp name.
This is fixed by using the TempFile class instead. As a side effect, a few
cases where the temp files were not deleted after usage were fixed as well.
The only place that is still unsafe is createTmpDir().
2014-06-09 13:05:50 +02:00
Georg Baum
c1ac09e11f Fix bug #7954 (now really)
Thanks to maciejr we know now what the remaining problem was with bug 7954:
My unicode symbol fallback works fine, the problem was that a font named
"Symbol" is available on OS X, but it does not use the font-specific encoding
we expect: Almost all glyphs are at their unicode code point.
Therefore the bug is fixed by re-enabling the unicode workaround and blocking
the Symbol font on OS X.
2014-06-07 10:54:17 +02:00
Peter Kümmel
6b4c3036aa std::min/max are defined in <algorithm>
handle error in msvc12 when linking against msvc10 libs
2014-06-07 08:17:20 +02:00
Georg Baum
4cea2efe21 Native support for \notag
This is mainly needed to reduce the amount of ERT if you convert AMS example
documents with tex2lyx. No GUI support is needed, since \notag is equivalent
to \nonumber.
2014-05-27 22:17:35 +02:00
Georg Baum
5dc9568f8d Native support for \smash[t] and \smash[b]
This is a follow-up of bug #8967. The implementation is self-explaining, the
only part which needs a comment is lyx2lyx: Since a 100% correct solution is
not possible, it has been decided not to switch amsmath off in the forward
conversion if no other ams command than \smash[t] and \smash[b] is used, but
to consider it a bug that older versions do not load amsmath automatically for
these commands. In the backward direction it is easy to keep the document
compilable, so just do that.
2014-05-27 22:13:58 +02:00
Enrico Forestieri
7145863466 Generalize control on double blank lines.
We can now tell whether a blank line was just output and so can
avoid outputting another one.
2014-05-20 21:52:29 +02:00
Jean-Marc Lasgouttes
275b7af75e Code cleanup: get rid of RenderPreview::status()
This method is a proxy for LyXRC::preview that forces to forward
declare some wrapper around an enum...

Instead, two simple static methods previewMath() and previewText() are
introduced, that make the code much easier to follow.
2014-05-20 12:19:26 +02:00
Jean-Marc Lasgouttes
3b3d28cf8e Rename misleading parameter.
... and a typo and some whitespace.
2014-05-14 18:09:40 +02:00
Enrico Forestieri
3e681bea4f Fix problem with drawing of math backround with selections. 2014-05-07 14:18:14 -04:00
Jean-Marc Lasgouttes
5c32dc85d5 Fix various warnings issued by clang++.
* remove unused class TexStream.

* remove unused virtual method Inset::cellXOffset

* remove second argument of FileDialog constructor, which was actually
  not used

* remove some dead local code

* remove some unused private members of classes

* in InsetMathNest::updateBuffer, fix the logic of a test
2014-04-22 00:04:04 +02:00
Richard Heck
c0be76a2d6 Whitespace. 2014-04-21 11:52:00 -04:00
Richard Heck
065db68067 Fix a bunch of minor issues discovered by the cppcheck script. 2014-04-21 11:52:00 -04:00
Richard Heck
84d4d45daa Fix two thinkos caught by the cppcheck script. 2014-04-21 11:52:00 -04:00
Juergen Spitzmueller
302228625b Stabilize mouse selection in mathed
Fixes: #9074
2014-04-21 11:51:59 -04:00
Richard Heck
8b00b355ca Change forToc() to forOutliner(), to avoid confusion. The old name
is left over from when the outliner really did just display a TOC.
2014-04-21 11:51:59 -04:00
Richard Heck
7765b1c9a8 Draw a small red frame around preview images that are too small. 2014-04-21 11:51:57 -04:00
Juergen Spitzmueller
33e10ff213 Fix selection drawing after mouse-double/triple in mathed
Fixes: #8829
2014-04-21 11:51:56 -04:00
Juergen Spitzmueller
fb21a63339 Set cursor pos after cursor idx to avoid invalid cursor.
Fixes: #9076
2014-04-04 11:39:22 +02:00
Georg Baum
e85e9424b3 Fix display of predefined macros (bug #9059)
This was a regression of e86cdc40: A newly introduced member variable was
not initialized in the constructor, which made it quite random whether symbols
like \coloneqq where displayed correctly or as an empty edit box.
2014-03-28 23:16:36 +01:00
Georg Baum
c9a49d2145 Arrgh, fix warning 2014-03-09 18:49:09 +01:00
Georg Baum
a6f4aa2d18 MSVC compile fix 2014-03-09 18:19:01 +01:00
Georg Baum
23752e6114 Disable unicode math symbol replacement.
This seems to work only in some cases, so better display the symbol in ERT.
2014-03-09 10:57:09 +01:00
Georg Baum
be0cd47559 Work around broken math symbol display (bug 7954)
This extends the already existing math symbol fallback mechanism in two ways:
1) When considering the availability of the math font, also take broken
   code points into account. These are currently 0x0009 and 0x00ad, depending
   on the platform.
2) If the fallback symbol in the standard "Symbol" font is not given, or if
   the "Symbol" font is not available, or the fallback symbol is one of the
   broken ones, try to use a generic unicode symbol as second fallback instead.
   If this is available, we rely on Qt to find a font which has it. Only if
   this is not available, display the symbol as ERT.
This ensures that we do never get a symbol which is not displayed: Either
it can be displayed, with or without fallback, or it will be shown as ERT.
2014-03-08 11:13:39 +01:00
Georg Baum
a09ec1fe43 whitespace 2014-03-08 10:57:24 +01:00
Richard Heck
e86cdc4020 Fix bug #8999 by locking math macros while they are updating. 2014-03-05 18:46:38 -05:00
Georg Baum
07afd76b7c Fix compilation with libc++
libc++ (http://libcxx.llvm.org/) is used on OS X with newer XCode.
The patch is from Benjamin Piwowarski <benjamin.piwowarski@lip6.fr>, I only
added more comments.
The changes regarding implicit conversion to bool of std::iostream work
because both the C++98 and C++11 standards guarantee that boolean evaluation
of streams returns !fail(). See e.g.
http://stackoverflow.com/questions/1334858/why-dont-iostream-objects-overload-operator-bool
for details.
2014-03-04 23:27:57 +01:00
Georg Baum
5dedf8005d Fix dataloss for align env inside math
The math parser aborts with an error message on \begin{align} and
\begin{align*} if this is not the hull inset. This is now fixed, however
this is not complete support for these two environments (the GUI does not
respect the numbering). It is only the minimal fix that ensures that no data
loss occurs for documents imported by tex2lyx.
2014-02-27 21:25:19 +01:00
Georg Baum
7f373e8de1 Fix misparsing of alternative simple formulas
This comes from trying to run tex2lyx on the AMS math test document
testmath.tex. Both \(...\) and \begin{math}...\end{math} are defined as
inline math formulas in standard LaTeX. tex2lyx recognizes this, but the
math parser in LyX did not handle "\begin_inset Formula \(" and
"\begin_inset Formula \begin{math}" correctly.
The fix is simple and safe: If we are in undecided mode (this is only true
for the first token of a math inset), create a hull inset of the respective
kind. Otherwise, handle the commands as before.
2014-02-26 21:54:09 +01:00
Georg Baum
9130bdb5ec Add missing math delim decorations
This avoids a message "Deco was not found. Programming error?" on stderr.
The added decorations are defined by amsmath, and equivalent to \vert (single
vertical bar) and \Vert (double vertical bar), respectively. They are used to
distinguish the single and paired versions (for use with \left and \right).
These symbols should cause amsmath to be loaded, but this would be too
dangerous to implement now.
2014-02-26 21:18:31 +01:00
Georg Baum
bd79001387 whitespace 2014-02-25 21:21:47 +01:00
Georg Baum
877e73e0a2 Fix bug #8784 (mathml export for scripts)
For displaystyle scripts we need to use munder, mover or munderover.
2014-02-22 19:01:20 +01:00
Enrico Forestieri
3c1969574f Fix bug #8889 by always issuing \protect in fragile environments. 2014-02-22 10:30:55 -05:00
Georg Baum
acb7906fb5 Fix remaining part of bug #8967
Now interactive insertion of \smash[t] and \smash[b] is possible again.
\smash with optional argument behaves now exactly as in LyX 2.0.x, and without
optional argument it is supported by InsetMathPhantom.
2014-02-21 21:31:35 +01:00
Georg Baum
227675ee02 Fix regression of 18779013 for \smash
When adding native support for \smash in 18779013 I overlooked that amsmath
redefines \smash to take an optional argument t or b. These optional
arguments are not parsed correctly anymore (bug 8967). This change fixes
the regression, so that \smash with optional argument appears in red, as it
was before th introduction of the native smash inset.
In the future, we should have native support for \smash[t] and \smash[b]
as well, but this would be a file format change (automatic amsmath loading),
and it is too late for 2.1.0.
2014-02-19 20:50:57 +01:00
Uwe Stöhr
789a6ebf2a InsetMathXArrow.cpp; code simplification 2014-02-17 02:11:57 +01:00
Uwe Stöhr
e9ce68dddc InsetMathXArrow.cpp: the cells of \xleftarrow must be centered
the cells are centered in the output so also center them in LyX
2014-02-17 01:23:16 +01:00
Uwe Stöhr
8c33f73cc7 MathSupport.cpp: fix drawing of leftrightarrow
- to see the difference use this in a formula:
\overleftrightarrow{aasasasasassdsdsdasdsdsd}
2014-02-17 01:19:31 +01:00
Jean-Marc Lasgouttes
e7a1cce551 Rename some LFUN names to match their text name
Also, rename copy-label-as-reference to label-copy-as-reference and update LFUNs.lyx accordingly.
2014-02-13 13:50:33 +01:00
Juergen Spitzmueller
8b1504d7ad Do not crash with empty (invalid) math environments (part of #8359) 2014-02-10 09:24:14 +01:00