Commit Graph

109 Commits

Author SHA1 Message Date
Georg Baum
bc8638bd25 Fix wrong LATTEST
Thanks to Scott for testing. If a macro is unknown (displayed in red), then
macro_ is 0. The LATTEST is now adjusted and works like in MathMacro::write()
where I stole it from.
2015-02-16 22:33:48 +01:00
Georg Baum
33b059bd9d Make macro xhtml export more secure
Actually I wanted to do that in cc87f8100 but forgot to adjust the original
solution completely. Now we do not search for an arbitrary latexkeys instance
which just happens to have the same name as the macro, but we only use the
symbol that was explicitly set for global macros.
2014-12-30 13:30:40 +01:00
Georg Baum
cc87f81002 Fix html export of \ne (second part of bug #9372)
The fix consists of two parts: The needed infrastructure to assign HTML
entities to global math macros, and the actual fix for \ne and \neq.
2014-12-29 21:13:42 +01:00
Jean-Marc Lasgouttes
689e54f34a Make sure that UpdateLocker is used correctly in the future 2014-11-17 11:52:14 +01:00
Georg Baum
0f2069b8a5 Fix recursive math macro crash (bug #9140)
This is different from bug #8999, since in this case a new macro instance is
created. You still get a TeX capacity exceeded error if you try to typeset the
exported document, but this is the same as for bug #8999 and better than a
crash.
2014-11-14 21:30:42 +01:00
Uwe Stöhr
ff85a4902e mathed: bformat infoize messages
- should fix bug #1908
2014-11-14 18:18:30 +01: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
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
Richard Heck
e86cdc4020 Fix bug #8999 by locking math macros while they are updating. 2014-03-05 18:46:38 -05:00
Enrico Forestieri
3c1969574f Fix bug #8889 by always issuing \protect in fragile environments. 2014-02-22 10:30:55 -05:00
Richard Heck
d79225ae98 Remove all messages to user related to assertions. We'll just use
a basic message which is defined in lassert.cpp now.
2013-04-27 17:52:55 -04:00
Richard Heck
1b1f8dd235 Audit all the LASSERT calls, and try to do something sensible at
each failure.

There are several places I was not sure what to do. These are marked
by comments beginning "LASSERT:" so they can be found easily. At the
moment, they are at:

Author.cpp:105: // LASSERT: What should we do here?
Author.cpp:121: // LASSERT: What should we do here?
Buffer.cpp:4525:        // LASSERT: Is it safe to continue here, or should we just return?
Cursor.cpp:345:         // LASSERT: Is it safe to continue here, or should we return?
Cursor.cpp:403:         // LASSERT: Is it safe to continue here, or should we return?
Cursor.cpp:1143:                // LASSERT: There have been several bugs around this code, that seem
CursorSlice.cpp:83:     // LASSERT: This should only ever be called from an InsetMath.
CursorSlice.cpp:92:     // LASSERT: This should only ever be called from an InsetMath.
LayoutFile.cpp:303:                     // LASSERT: Why would this fail?
Text.cpp:995:           // LASSERT: Is it safe to continue here?
2013-04-25 17:27:10 -04:00
Georg Baum
de5e348727 Fix bug #8468: Wrong import of UTF8 CJK.
Actually, the test case showed several problems:
- ERT insets did use layout "Standard", not "Plain Layout"
- The font scale was read correctly, but tex2lyx claimed that it did ignore
  the option "scaled=0.95"
- If a third argument of the CJK environment was given, it caused the whole
  environment to be put in ERT with a broken encoding. This is now fixed for
  the bug test case by using the \font_cjk header variable, but the encoding
  problem still exists for unsupported encodings. I'll file a separate bug
  for that.
- The CJKutf8 package was not handled in the preamble parsing. Therefore the
  chinese comment in the preamble was read with a wrong encoding, and guessing
  the document language did not work.
The new file CJKutf8.tex was created by copying and modifying CJK.tex, but
unfortunately it is impossible to tell git to inherit the history of CJK.tex
for the new file (search the web for git svn copy if you want to know details).
2012-12-30 20:52:49 +01:00
Lars Gullik Bjønnes
43f6b1672b Use empty() to check empty and non-empty'ness not size()
Also add FormatList::empty().
2012-10-27 01:25:38 +02:00
Richard Heck
5855043599 Initial work to fix bug involving embedded macros and
XHTML output.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38613 a592a061-630c-0410-9148-cb99ea01b6c8
2011-05-07 11:57:08 +00:00
Vincent van Ravesteijn
b29ef9e1a5 Fix bug #7444. We are only interested in whether the dimension has been stored in the cache. Therefore we have to use hasDim, otherwise we get a negative response just because the x-y is not set.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38403 a592a061-630c-0410-9148-cb99ea01b6c8
2011-04-15 10:54:52 +00:00
Richard Heck
4052facca6 If we encounter a macro we don't recognize, then export this bit of math
as an image.

The math macro now exports as XHTML + MathML and can be viewed in
Firefox.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38190 a592a061-630c-0410-9148-cb99ea01b6c8
2011-04-01 20:15:43 +00:00
Richard Heck
0b1fdca0fa Fix last commit.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38189 a592a061-630c-0410-9148-cb99ea01b6c8
2011-04-01 20:03:41 +00:00
Richard Heck
75a7a2203d More informative normalization for math macros.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38188 a592a061-630c-0410-9148-cb99ea01b6c8
2011-04-01 20:03:15 +00:00
Enrico Forestieri
3ebcbf5b32 Fix bug #6965 (Crash editing ERT in math mode)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35879 a592a061-630c-0410-9148-cb99ea01b6c8
2010-10-28 11:13:47 +00:00
Vincent van Ravesteijn
49beed7437 Fix bug #6989: Be somewhat more secure with the homebrew dynamic asserts that were changed in r35855.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35863 a592a061-630c-0410-9148-cb99ea01b6c8
2010-10-27 07:04:58 +00:00
Vincent van Ravesteijn
573500dd04 Remove unneccessary uses of dynamic_cast from the code.
A dynamic_cast is necessary when:

- the object to be casted is from an external library because we can't add Qxxx::asXxxx() to Qt e.g.:
    * QAbstractListModel to GuiIdListModel,
    * QValidator to PathValidator,
    * QWidget to TabWorkArea,
    * QWidget to GuiWorkArea;

- the object is to be casted from an interface to the implementing class, because the Interface does not know by whom it is implemented:
    * ProgressInterface to GuiProgress,
    * Application to GuiApplication.

A dynamic_cast can be replaced by:
  - already existing as***Inset() functions, e.g.:
    * asHullInset(),
    * asInsetMath()->asMacro(),
    * asInsetText();

  - a static_cast when we are sure this can't go wrong, e.g.:
    * we are sure that CellData::inset->clone() is an InsetTableCell,
    * in cases where we explicitly check it->lyxCode().


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35855 a592a061-630c-0410-9148-cb99ea01b6c8
2010-10-26 15:03:51 +00:00
Richard Heck
6a80ce62ca DispatchResult::update() ==> DispatchResult::screenUpdate()
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35631 a592a061-630c-0410-9148-cb99ea01b6c8
2010-10-13 17:28:55 +00:00
Jean-Marc Lasgouttes
60445ede53 remove unused headers
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35129 a592a061-630c-0410-9148-cb99ea01b6c8
2010-08-12 09:38:22 +00:00
Richard Heck
0e14f379f3 Rename a couple routines. This will avoid confusion with a forthcoming
patch.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34816 a592a061-630c-0410-9148-cb99ea01b6c8
2010-07-08 20:04:35 +00:00
Vincent van Ravesteijn
8156884090 Make Cursor::disp_ private as it should be.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34144 a592a061-630c-0410-9148-cb99ea01b6c8
2010-04-15 17:34:34 +00:00
Richard Heck
b8550d11e8 Pure HTML output for math macros.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33941 a592a061-630c-0410-9148-cb99ea01b6c8
2010-03-30 00:18:24 +00:00
Abdelrazak Younes
377cdd5f6c Transfer LyXfunc code to GuiApplication::dispatch() and getStatus(). Now
a lot of simplification is possible. Except some instability period...


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33389 a592a061-630c-0410-9148-cb99ea01b6c8
2010-02-09 16:11:13 +00:00
Richard Heck
cb346ae202 Whitespace.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32976 a592a061-630c-0410-9148-cb99ea01b6c8
2010-01-11 19:29:33 +00:00
Richard Heck
bae9393d53 Minor re-organization.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32975 a592a061-630c-0410-9148-cb99ea01b6c8
2010-01-11 18:25:26 +00:00
Richard Heck
c060a85d81 Revert r32684, per Andre's suggestion.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32689 a592a061-630c-0410-9148-cb99ea01b6c8
2009-12-31 15:46:39 +00:00
Richard Heck
8a0134cc8c Introduce a return value for mathmlize(). We will need this to be able
to defer labels.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32684 a592a061-630c-0410-9148-cb99ea01b6c8
2009-12-31 03:50:12 +00:00
Enrico Forestieri
d3378a6b84 Style: insetCur -> inset_cursor
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32049 a592a061-630c-0410-9148-cb99ea01b6c8
2009-11-16 13:31:01 +00:00
Enrico Forestieri
7365a29fea Fix bug #6208: macro crash.
The fix consists in not updating the macro while it is being edited,
and this is accomplished by the changes in MathData::updateMacros().
However, when clicking away with the mouse I was getting another crash,
which is cured by the changes in MathMacro::notifyCursorLeaves().


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32037 a592a061-630c-0410-9148-cb99ea01b6c8
2009-11-15 23:54:45 +00:00
Richard Heck
ae60474513 Get math macros working for MathML.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32004 a592a061-630c-0410-9148-cb99ea01b6c8
2009-11-15 12:30:26 +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
Enrico Forestieri
21fcdfb479 Fix a crash when the modified uncompleted macro is a font changing command.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31379 a592a061-630c-0410-9148-cb99ea01b6c8
2009-09-12 21:20:51 +00:00
Enrico Forestieri
0c2902d0c0 Better fix for bug #5923. Now the macro name can be freely edited.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30425 a592a061-630c-0410-9148-cb99ea01b6c8
2009-07-09 15:21:21 +00:00
Enrico Forestieri
654600486b Fix bug 5541: http://bugzilla.lyx.org/show_bug.cgi?id=5541
This was due to a thinko in http://www.lyx.org/trac/changeset/26002


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@28605 a592a061-630c-0410-9148-cb99ea01b6c8
2009-02-25 12:16:56 +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
Abdelrazak Younes
46b4a8428b Style, const access and small optimizations.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27185 a592a061-630c-0410-9148-cb99ea01b6c8
2008-10-29 08:03:26 +00:00
Enrico Forestieri
7d4ec3f944 Fix bug 5393
http://bugzilla.lyx.org/show_bug.cgi?id=5393


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27044 a592a061-630c-0410-9148-cb99ea01b6c8
2008-10-23 00:48:06 +00:00
Stefan Schimanski
af9206b392 * Call metrics of the parameters with the correct font in MathMacros, for example
if they are in an index and should be drawn smaller.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26927 a592a061-630c-0410-9148-cb99ea01b6c8
2008-10-16 21:27:43 +00:00
Stefan Schimanski
c874e95030 * Be more conservative about leaving out parenthesis by checking for < 0x80.
This fixes lyxmathsym characters as macro arguments.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26802 a592a061-630c-0410-9148-cb99ea01b6c8
2008-10-07 16:24:07 +00:00
Enrico Forestieri
dac70247f0 Fix bug 5041
http://bugzilla.lyx.org/show_bug.cgi?id=5041


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26002 a592a061-630c-0410-9148-cb99ea01b6c8
2008-07-30 15:07:06 +00:00
Enrico Forestieri
aabd9d03bb Fix bug 4992
http://bugzilla.lyx.org/show_bug.cgi?id=4992


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25458 a592a061-630c-0410-9148-cb99ea01b6c8
2008-07-05 23:29:48 +00:00
Enrico Forestieri
2477901f07 Fix color of math macros
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25403 a592a061-630c-0410-9148-cb99ea01b6c8
2008-06-28 22:49:40 +00:00
Enrico Forestieri
c691839abe Fix bug 4687
http://bugzilla.lyx.org/show_bug.cgi?id=4687


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25318 a592a061-630c-0410-9148-cb99ea01b6c8
2008-06-19 09:16:05 +00:00
Enrico Forestieri
e224ef029b Implement the suggestion by Andre'
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25287 a592a061-630c-0410-9148-cb99ea01b6c8
2008-06-17 11:10:43 +00:00
Enrico Forestieri
90837aaf6e Fix bug 1527
http://bugzilla.lyx.org/show_bug.cgi?id=1527

* src/mathed/*.cpp:
	- Track mode (math or text) when outputting latex code and
	  properly wrap commands that are in the wrong mode with
	  either \ensuremath or \lyxmathsym.

* src/mathed/MathParser.cpp:
	- Parse \ensuremath and \lyxmathsym, such that exported latex
	  produces the same result when imported back.
	- Replace latex commands with corresponding unicode symbols.

* src/Encoding.cpp:
	- Implement Encodings::fromLaTeXCommand() for converting either
	  a single or a sequence of latex commands to unicode symbols.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25270 a592a061-630c-0410-9148-cb99ea01b6c8
2008-06-16 01:21:17 +00:00