Commit Graph

146 Commits

Author SHA1 Message Date
Vincent van Ravesteijn
6b96abd211 Correctly paint the background of the instant preview of a displayed equation.
For a displayed equation, the height is artificially increased by a displayMargin() in InsetMathHull::metrics if it is a displayed equation and there is a preview. 

This extra height is not covered by the preview image and what one can see is the background as drawn by the MathHull inset. The color of this background should be either Color_mathbg or Color_background depending on whether the preview is shown or not.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32560 a592a061-630c-0410-9148-cb99ea01b6c8
2009-12-17 14:09:37 +00:00
Richard Heck
9e149b8919 Fix a few MathML things: the default output and the output of limits.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32542 a592a061-630c-0410-9148-cb99ea01b6c8
2009-12-16 14:53:23 +00:00
Richard Heck
5f27992e16 Restore the MathML output we had before. Still work to be done here.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32540 a592a061-630c-0410-9148-cb99ea01b6c8
2009-12-15 13:14:57 +00:00
Vincent van Ravesteijn
80ac638d42 Fix trunk after r32352.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32353 a592a061-630c-0410-9148-cb99ea01b6c8
2009-12-05 01:07:38 +00:00
Vincent van Ravesteijn
b56e4c5697 Do not start loading a preview each time one is added. This caused LyX to generate LaTeX code of the document over and over again for each math inset. As a consequence, the loading of the User's Guide took ages.
Fixes a bug introduced in r32157 while fixing bug #4360.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32352 a592a061-630c-0410-9148-cb99ea01b6c8
2009-12-05 00:43:28 +00:00
Richard Heck
996505c2ae This patch introduces an optional argument to Buffer::updateLabels(), so
as to allow us to call the routine when we are preparing for output and
so to do certain things we might not want to do every time. 

This is an abuse of updateLabels(), in a way, but updateLabels() long
ago became the general recurse-through-the-Buffer routine, and to
implement the sort of thing I want to do here in validate(), say, much
of the code in updateLabels()---in particular, the counter-update
code---would have to be duplicated. So I believe this is the best, and
easiest, way to go.

Actual use of the new argument will follow.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32318 a592a061-630c-0410-9148-cb99ea01b6c8
2009-12-04 03:03:38 +00:00
Vincent van Ravesteijn
92c8561674 Some cosmetics after r32157.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32159 a592a061-630c-0410-9148-cb99ea01b6c8
2009-11-22 21:45:51 +00:00
Vincent van Ravesteijn
f19b6178a9 Fix bug #4360: Instant preview does not render formulas which contain math-macro from input file.
Patch from Stefan.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32157 a592a061-630c-0410-9148-cb99ea01b6c8
2009-11-22 20:50:35 +00:00
Richard Heck
83c7a5576f Fix silly bit.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31981 a592a061-630c-0410-9148-cb99ea01b6c8
2009-11-14 15:55:51 +00:00
Richard Heck
54b4b8e6b4 Get MathML output for XHTML working a bit.
Turns out MathML is already here, for the most part, so this will
not be too bad at all. 

Anyone else think that is very cool?!



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31979 a592a061-630c-0410-9148-cb99ea01b6c8
2009-11-14 15:25:32 +00:00
Enrico Forestieri
f83a6cc3af Don't use updateMacros() in the math parser, in order to avoid
performance problems when loading documents with lots of macros.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31907 a592a061-630c-0410-9148-cb99ea01b6c8
2009-11-08 18:47:33 +00:00
Abdelrazak Younes
882e2eeb7b InsetCommand ctor: Pass 'Buffer *'
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31902 a592a061-630c-0410-9148-cb99ea01b6c8
2009-11-08 16:10:34 +00:00
Abdelrazak Younes
82c7e15e64 Uniformize Inset construction (passing Buffer * everywhere). Lots of cleanup to do still...
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31901 a592a061-630c-0410-9148-cb99ea01b6c8
2009-11-08 15:53:21 +00:00
Abdelrazak Younes
ff4460603e Make Buffer argument mandatory in most of the InsetMath based class... boring work...
Math manual loads and save correctly it seems but expect some instability period.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31898 a592a061-630c-0410-9148-cb99ea01b6c8
2009-11-08 11:45:46 +00:00
Pavel Sanda
dac1c003d6 Unneeded headers.
It would be interesting to know how many headers do we actually use in our code.
Nice task for some script.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31893 a592a061-630c-0410-9148-cb99ea01b6c8
2009-11-07 12:54:19 +00:00
Pavel Sanda
f57a4615cd Header sort order
../treeview.patch

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31892 a592a061-630c-0410-9148-cb99ea01b6c8
2009-11-07 12:54:08 +00:00
Enrico Forestieri
a1a34443ef Fix bug #5530: LyX expansion in math-macro overwritten by default one.
This patch initializes the buffer_ member of a MathHull inset in most
(but not all) cases. The problems with buffer_ should be greatly
allievated now, but there still can be some corner case.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31873 a592a061-630c-0410-9148-cb99ea01b6c8
2009-11-06 15:18:48 +00:00
Vincent van Ravesteijn
d63403205b Fix bug #5968: Assertion while reading a document with multiple equation labels.
This is another ad-hoc solution for the problem of a zero buffer pointer while reading a document or when using cut&paste.

This simple solution would be suitable for branch.

see also e.g. r29085, r28319, bug #5688.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31861 a592a061-630c-0410-9148-cb99ea01b6c8
2009-11-05 00:38:09 +00:00
Jean-Marc Lasgouttes
60dca30530 disable the del-suppresses-equation-label-at-end feature (not easy to describe, is it?) when there is a selection
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31600 a592a061-630c-0410-9148-cb99ea01b6c8
2009-10-12 15:20:23 +00:00
Enrico Forestieri
a7c944b280 Fix bug #6250: LyX 1.6.4 crashes when copying Japanese text in math to clipboard
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31572 a592a061-630c-0410-9148-cb99ea01b6c8
2009-10-09 21:33:08 +00:00
Pavel Sanda
ab36804b6c Fix searching bug #6139.
Patch by Tommaso.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31053 a592a061-630c-0410-9148-cb99ea01b6c8
2009-08-15 15:35:14 +00:00
Jürgen Spitzmüller
89e7f60e1d Catch encoding exception when performing instant preview on an uncodable char (bug 6116).
* MathStream{.cpp, h}:
	- replace bool dryrun() by enum output that also knows whether the stream is for instant preview
* InsetMathHull.cpp:
	- tell the stream whether we use it for instant preview.
* MathString.cpp (write):
	- gracefully catch encoding exception for instant preview.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30895 a592a061-630c-0410-9148-cb99ea01b6c8
2009-08-07 05:25:22 +00:00
Jean-Marc Lasgouttes
ca7b18a5db Try to implement properly recursive setBuffer. Normally, implmenting
for InsetMathNest and InsetMathHull is enough.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30847 a592a061-630c-0410-9148-cb99ea01b6c8
2009-08-03 10:30:34 +00:00
Vincent van Ravesteijn
b62b366a67 Fix bug #2969: Double labels appear on empty lines of multi-line equations.
This reverts part of r10553. There, an extra '//' was added when the last line was empty. However, this really makes an extra line and that is visible when the lines have a line number. The bug #2067 that would have been fixed by this does not seem to 'exist' anymore.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30795 a592a061-630c-0410-9148-cb99ea01b6c8
2009-07-26 20:25:11 +00:00
Richard Heck
0facb603fe Give inset codes to all the math insets, so we get more information when
we run into assertions.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30634 a592a061-630c-0410-9148-cb99ea01b6c8
2009-07-16 19:00:24 +00:00
Jean-Marc Lasgouttes
78c45693ef remove all trace of editMessage
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30585 a592a061-630c-0410-9148-cb99ea01b6c8
2009-07-14 18:56:13 +00:00
Pavel Sanda
49ea9227cd Fix leftover from r27378. Patch and report from John McCabe-Dansted.
Presumably it fixes
"r30414 unselects insets after a fraction of a second. 1.5.7 doesn't exhibit this bug"
http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg152960.html

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30536 a592a061-630c-0410-9148-cb99ea01b6c8
2009-07-13 09:50:46 +00:00
Enrico Forestieri
4559c29eeb Reintroduce workaround due to nested math hulls as it is not
guaranteed that LyX is always able to replace $...$ constructs
with \ensuremath{...}.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30145 a592a061-630c-0410-9148-cb99ea01b6c8
2009-06-16 21:22:32 +00:00
Vincent van Ravesteijn
1458ac6a7c Set flag for LFUN_MATH_MUTATE. Also, remove some 'ghost code' from InsetMathNest (if this had a purpose it should have been documented).
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29764 a592a061-630c-0410-9148-cb99ea01b6c8
2009-05-21 12:45:31 +00:00
Vincent van Ravesteijn
788b0097a6 Hide "Number this line" for single line equations.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29762 a592a061-630c-0410-9148-cb99ea01b6c8
2009-05-21 10:14:07 +00:00
Vincent van Ravesteijn
60b26d1aac Fix the copy label as ref for equations from the context menu.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29754 a592a061-630c-0410-9148-cb99ea01b6c8
2009-05-20 23:58:29 +00:00
Vincent van Ravesteijn
8996be1208 Restore Object.Event order for:
- LFUN_LABEL_COPY_AS_REF,
- LFUN_LABEL_INSERT_AS_REF.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29680 a592a061-630c-0410-9148-cb99ea01b6c8
2009-05-15 21:05:19 +00:00
Vincent van Ravesteijn
13da98685d * InsetMathHull.cpp : constify.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29679 a592a061-630c-0410-9148-cb99ea01b6c8
2009-05-15 20:57:48 +00:00
Vincent van Ravesteijn
3c976db90b Fix bug #5948: Copy as reference for equation labels.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29678 a592a061-630c-0410-9148-cb99ea01b6c8
2009-05-15 20:54:15 +00:00
Enrico Forestieri
024378db01 Remove workaround due to nested math hulls. See:
http://thread.gmane.org/gmane.editors.lyx.devel/110190/focus=110242


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29600 a592a061-630c-0410-9148-cb99ea01b6c8
2009-05-09 21:16:04 +00:00
Jürgen Spitzmüller
48d5e2a579 please Jean-Marc.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@28324 a592a061-630c-0410-9148-cb99ea01b6c8
2009-02-02 13:53:41 +00:00
Jürgen Spitzmüller
66e455ba29 * InsetMathHull (numbered):
- prevent NULL pointer (bug 5688).

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@28319 a592a061-630c-0410-9148-cb99ea01b6c8
2009-02-02 13:27:57 +00:00
André Pönitz
6192345f60 add Buffer * member to DocIterator
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27603 a592a061-630c-0410-9148-cb99ea01b6c8
2008-11-17 11:46:07 +00:00
André Pönitz
f8f5a7b28d move updateLables to buffer
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27562 a592a061-630c-0410-9148-cb99ea01b6c8
2008-11-16 16:43:49 +00:00
André Pönitz
ae7a262a78 less negated logic
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27553 a592a061-630c-0410-9148-cb99ea01b6c8
2008-11-16 14:57:03 +00:00
Stephan Witt
2b30ed58ef enable LFUN_MATH_NUMBER_LINE_TOGGLE when display() is not inline
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27552 a592a061-630c-0410-9148-cb99ea01b6c8
2008-11-16 14:55:30 +00:00
Abdelrazak Younes
f000a62b0d part 7
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27524 a592a061-630c-0410-9148-cb99ea01b6c8
2008-11-16 00:18:52 +00:00
Jürgen Spitzmüller
16fee5c01d * InsetMathHull (eolString):
- revert rev. 27412. This is more complicated.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27437 a592a061-630c-0410-9148-cb99ea01b6c8
2008-11-15 11:04:35 +00:00
André Pönitz
f1cba8ff64 more latin1..utf8 schanges. all of src/* should be utf8 now
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27425 a592a061-630c-0410-9148-cb99ea01b6c8
2008-11-14 15:58:50 +00:00
Jürgen Spitzmüller
c8ecd8d24a * InsetMathHull (eolString):
- Properly escape non-ASCII characters in equation labels (bug 5512).

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27412 a592a061-630c-0410-9148-cb99ea01b6c8
2008-11-14 10:05:07 +00:00
Enrico Forestieri
28fe97b553 Avoid creating bad math insets with Ctrl+M
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27214 a592a061-630c-0410-9148-cb99ea01b6c8
2008-10-31 15:19:39 +00:00
Abdelrazak Younes
84eec959c5 Revert 27186 which fixed an invalid bug.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27189 a592a061-630c-0410-9148-cb99ea01b6c8
2008-10-29 15:33:52 +00:00
Abdelrazak Younes
8939303131 Fix http://bugzilla.lyx.org/show_bug.cgi?id=5392
The problem is that, for an unknown reason, an InsetMathHull is used *inside* an InsetMathHull. This is the reason why we have two levels of instant preview. I don't know if that was intended.

When moving the cursor, only the doDispatch() of the enclosing InsetMathHull is
called, not the inner one; so we don't have a chance to detect that the inner InsetMathHull should leave its preview mode.

The new leavePreview() method ensures that the screen will be redrawn if needed with cursor movement.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27186 a592a061-630c-0410-9148-cb99ea01b6c8
2008-10-29 09:24:54 +00:00
Pavel Sanda
e4808961c9 Another selection painting patch, PainterInfo::backgroundColor introduced.
Patch by Vincent.

http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg145438.html



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27097 a592a061-630c-0410-9148-cb99ea01b6c8
2008-10-25 10:47:38 +00:00
Enrico Forestieri
02ebfa000b Fix bug 3397
http://bugzilla.lyx.org/show_bug.cgi?id=3397


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26934 a592a061-630c-0410-9148-cb99ea01b6c8
2008-10-17 21:40:11 +00:00