mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
ws cleanup
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3804 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
8283e978f8
commit
2b8ef58dc0
@ -1,5 +1,7 @@
|
||||
2002-03-21 Lars Gullik Bjønnes <larsbj@birdstep.com>
|
||||
|
||||
* most files: ws cleanup
|
||||
|
||||
* Makefile.am: remove ld -r stuff
|
||||
|
||||
2002-03-20 Lars Gullik Bjønnes <larsbj@birdstep.com>
|
||||
@ -17,7 +19,7 @@
|
||||
|
||||
* math_inset.C (metrics): parameter "mi" is never referenced. Removed.
|
||||
* math_hullinset.C (metrics): ditto.
|
||||
|
||||
|
||||
|
||||
2002-03-12 André Pönitz <poenitz@gmx.net>
|
||||
|
||||
@ -45,16 +47,16 @@
|
||||
|
||||
2002-02-08 Otto Tronarp <otttr440@student.liu.se>
|
||||
|
||||
* math_decorationinset.C:
|
||||
* math_decorationinset.C:
|
||||
|
||||
* math_support.C:
|
||||
* math_support.C:
|
||||
|
||||
* math_hash.C: Added \underrightarrow and \underleftarrow
|
||||
|
||||
2002-02-08 Martin Vermeer <martin.vermeer@hut.fi>
|
||||
|
||||
* formulabase.C (localDispatch): fix umlaut handling
|
||||
|
||||
|
||||
* formulabase.C: pop up math panel on right mouse click
|
||||
|
||||
2002-02-01 André Pönitz <poenitz@gmx.net>
|
||||
@ -101,7 +103,7 @@
|
||||
2002-01-10 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
|
||||
|
||||
* math_support.C: change latex_mathfontcmds to an array of
|
||||
kb_action.
|
||||
kb_action.
|
||||
|
||||
2002-01-11 Angus Leeming <a.leeming@ic.ac.uk>
|
||||
|
||||
@ -128,11 +130,11 @@
|
||||
2002-01-09 Jean-Marc Lasgouttes <lasgouttes@freesurf.fr>
|
||||
|
||||
* math_hullinset.C (validate): rename feature "amsstyle" to
|
||||
"amsmath".
|
||||
"amsmath".
|
||||
|
||||
2002-01-09 Martin Vermeer <martin.vermeer@hut.fi>
|
||||
|
||||
* math_support.C: modified to support a mathed pop-up for math
|
||||
* math_support.C: modified to support a mathed pop-up for math
|
||||
size "styles" and font types.
|
||||
|
||||
2002-01-07 Angus Leeming <a.leeming@ic.ac.uk>
|
||||
@ -166,7 +168,7 @@
|
||||
|
||||
* math_parser.C: user std::fill to fill the catcodes. (please
|
||||
check this one...), and some consts.
|
||||
|
||||
|
||||
2001-12-11 André Pönitz <poenitz@gmx.net>
|
||||
|
||||
* math_cursor.C: allow cut&paste of rectangular regions of cells
|
||||
@ -212,23 +214,23 @@
|
||||
* math_symbolinset.C:
|
||||
* math_unknowninset.C: include math_streamstr.h and remove
|
||||
unneeded c_str()
|
||||
|
||||
|
||||
* math_symbolinset.[Ch]: add constructor taking string
|
||||
|
||||
|
||||
* math_mathmlstream.C: move includes around
|
||||
|
||||
* math_streamstr.[Ch]: add operator<<(Stream, string) for
|
||||
NormalStream, MapleStream, MathMLStream and OctaveStream
|
||||
|
||||
|
||||
* math_gridinset.C: user LyXLength::zero
|
||||
|
||||
|
||||
2001-11-19 Angus Leeming <a.leeming@ic.ac.uk>
|
||||
|
||||
* formula.C:
|
||||
* math_arrayinset.C: add using std::getline directive.
|
||||
|
||||
2001-11-20 André Pönitz <poenitz@gmx.net>
|
||||
|
||||
|
||||
* formulabase.C: fix mouse positioning using the cursor
|
||||
|
||||
2001-11-19 Dekel Tsur <dekelts@tau.ac.il>
|
||||
@ -247,13 +249,13 @@
|
||||
|
||||
2001-11-15 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
|
||||
|
||||
* math_extern.C (extractNumber):
|
||||
* math_extern.C (extractNumber):
|
||||
(extractDiffExponent): add ugly .c_str()
|
||||
|
||||
2001-11-08 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
|
||||
|
||||
* math_arrayinset.C (MathArrayInset):
|
||||
* formula.C (pipeThroughMaple):
|
||||
* math_arrayinset.C (MathArrayInset):
|
||||
* formula.C (pipeThroughMaple):
|
||||
(pipeThroughOctave): add ugly .c_str() to help compile
|
||||
with lyxstring
|
||||
|
||||
@ -281,7 +283,7 @@
|
||||
* math_*inset.[Ch]: remove MathStyles cache from insets that
|
||||
don't need it
|
||||
|
||||
* support.C:
|
||||
* support.C:
|
||||
formulabase.C: fix math font sizes in headings etc
|
||||
|
||||
* math_inset.[Ch]:
|
||||
@ -333,7 +335,7 @@
|
||||
2001-09-27 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
|
||||
|
||||
* math_cursor.C: fix type mismatches with what was declared in
|
||||
math_cursor.h.
|
||||
math_cursor.h.
|
||||
|
||||
2001-09-28 Dekel Tsur <dekelts@tau.ac.il>
|
||||
|
||||
@ -376,7 +378,7 @@
|
||||
'xxalignt', 'gather' and 'multiline' environments
|
||||
|
||||
* math_cursor.C: fix handling of | and \|
|
||||
|
||||
|
||||
2001-09-04 José Matos <jamatos@fep.up.pt>
|
||||
|
||||
* formulabase.C
|
||||
@ -397,7 +399,7 @@
|
||||
2001-08-17 André Pönitz <poenitz@gmx.net>
|
||||
|
||||
* math_hash.C: Use std::map instead of faking it
|
||||
|
||||
|
||||
* symbol_def.h: remove unneeded symbol definitions
|
||||
|
||||
* support.C: use the decorations' name for drawing
|
||||
@ -423,7 +425,7 @@
|
||||
2001-08-31 Dekel Tsur <dekelts@tau.ac.il>
|
||||
|
||||
* math_hash.C: Read symbols information from external file
|
||||
many files: Add support for latex symbol fonts
|
||||
many files: Add support for latex symbol fonts
|
||||
|
||||
2001-08-18 Dekel Tsur <dekelts@tau.ac.il>
|
||||
|
||||
@ -489,7 +491,7 @@
|
||||
* math_bigopinset.[Ch]: revival for things like \int, \sum
|
||||
|
||||
* math_funcliminset.[Ch]: dedicated new inset for \lim, \max, \min...
|
||||
|
||||
|
||||
* math_diminset.h: make cache variables mutable, remove const_cast
|
||||
|
||||
* formulabase.[Ch]: remove unneeded convertFont()
|
||||
@ -518,7 +520,7 @@
|
||||
the width_/ascent_/descent_ cache
|
||||
|
||||
2001-07-25 André Pönitz <poenitz@gmx.net>
|
||||
|
||||
|
||||
* formulabase.C: re-enable 'space enlargement' feature
|
||||
|
||||
* math_scriptinset.C:
|
||||
@ -535,7 +537,7 @@
|
||||
* formulabase.C: fix memory leak
|
||||
|
||||
* math_cursor.C: ^ now copies selection into new srriptinset
|
||||
|
||||
|
||||
* xarray.C: less crude MathXArray::x2pos for preciser cursor positioning
|
||||
using the mouse
|
||||
|
||||
@ -586,11 +588,11 @@
|
||||
|
||||
* math_updowninset.[hC]: new base class for script and bigop insets
|
||||
*.[hC]: subsequent changes to all Metric() functions
|
||||
|
||||
|
||||
* math_parser.C: small changes (\sqrt0 is read properly now)
|
||||
|
||||
|
||||
2001-07-10 André Pönitz <poenitz@gmx.net>
|
||||
|
||||
|
||||
* math_accentinset.[hC]: rewrite
|
||||
|
||||
* math_parser.C:
|
||||
@ -616,11 +618,11 @@
|
||||
2001-07-09 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
|
||||
|
||||
* formulabase.C (mathDispatchInsertMath): remove bogus return
|
||||
statement.
|
||||
statement.
|
||||
|
||||
2001-07-09 André Pönitz <poenitz@gmx.net>
|
||||
|
||||
* math_*inset.C: Change order of arguments in MathInset constructor
|
||||
* math_*inset.C: Change order of arguments in MathInset constructor
|
||||
|
||||
* math_cursor.C: Remove broken "increase space" feature for a while
|
||||
|
||||
@ -658,7 +660,7 @@
|
||||
|
||||
* *.C: remove all "using namespace std" directives (not
|
||||
good!!) and replaced it with relevant "using" directives.
|
||||
|
||||
|
||||
* math_macrotemplate.C (Clone): change return type to MathInset*
|
||||
|
||||
2001-06-27 Lars Gullik Bjønnes <larsbj@birdstep.com>
|
||||
@ -680,7 +682,7 @@
|
||||
* math_macrotemplate.C (Write): std:: qualify ostream
|
||||
|
||||
* math_bigopinset.C (Metrics): std:: qualify max, and include
|
||||
functional
|
||||
functional
|
||||
|
||||
* math_matrixinset.h: include vector and std:: qualify it.
|
||||
|
||||
@ -697,7 +699,7 @@
|
||||
* math_cursor.C (Right): Fixes for cursor movement.
|
||||
|
||||
* formula.C (draw): New background color for math.
|
||||
|
||||
|
||||
* math_cursor.C: Fixes for toggling labels on/off in math.
|
||||
Fixes for infinity and other symbols that didn't appear in
|
||||
LaTeX.
|
||||
@ -720,7 +722,7 @@
|
||||
|
||||
* math_cursor.C: Cursor improvements after a few dead-ends
|
||||
in the evolution of cursor movement were tested and scrapped.
|
||||
|
||||
|
||||
2001-06-24 The LyX Project <Asger>
|
||||
|
||||
* math_cursor.C: Renamed stack to path.
|
||||
@ -769,7 +771,7 @@
|
||||
declared in std:: namespace.
|
||||
|
||||
* math_macrotemplate.h: do not use explicitely std::string, but
|
||||
string.
|
||||
string.
|
||||
|
||||
* math_macroarg.C: avoid bringing the whole std:: namespace in
|
||||
global-land. When you do that, there is an ambiguity between
|
||||
@ -800,7 +802,7 @@
|
||||
* math_macro.[Ch]:
|
||||
* math_macrotable.[Ch]:
|
||||
* math_macroarg.[Ch]: restructuring of macro handling
|
||||
* several files:
|
||||
* several files:
|
||||
|
||||
2001-04-25 Angus Leeming <a.leeming@ic.ac.uk>
|
||||
|
||||
@ -826,8 +828,8 @@
|
||||
|
||||
2001-04-16 Allan Rae <rae@lyx.org>
|
||||
|
||||
* formula.C (Latex, getLabelList, LocalDispatch):
|
||||
* math_parser.C (mathed_parse):
|
||||
* formula.C (Latex, getLabelList, LocalDispatch):
|
||||
* math_parser.C (mathed_parse):
|
||||
* math_parinset.C (Write): #warning triggers an error on Sun CC 6.0 as
|
||||
an unrecognised preprocessor directive. So ensure they're wrapped.
|
||||
|
||||
@ -849,7 +851,7 @@
|
||||
* math_matrixinset.h:
|
||||
* math_parinset.[Ch]:
|
||||
* math_rowst.[Ch]: move MathedRowContainer::row_ to the base
|
||||
|
||||
|
||||
2001-03-13 John Levon <moz@compsoc.man.ac.uk>
|
||||
|
||||
* Makefile.am:
|
||||
@ -918,7 +920,7 @@
|
||||
|
||||
2001-03-08 André Pönitz <poenitz@gmx.net>
|
||||
|
||||
* math_rowst.h: give MathedRowContainer an 'insert' method.
|
||||
* math_rowst.h: give MathedRowContainer an 'insert' method.
|
||||
|
||||
* math_xiter.C: new 'container()' method to encapsulated access to
|
||||
the MathParInset's MathedRowContainer
|
||||
@ -928,13 +930,13 @@
|
||||
|
||||
* math_matrixinset.[hC]: remove copy constructr and destructor. Those
|
||||
automatically created by the compiler are ok now.
|
||||
|
||||
|
||||
2001-03-06 André Pönitz <poenitz@gmx.net>
|
||||
|
||||
* array.[Ch]: factor out deep_copy,
|
||||
remove third argument from raw_pointer_insert
|
||||
remove third argument from raw_pointer_insert
|
||||
|
||||
* math_iter.[Ch]: remove unused function Clear()
|
||||
* math_iter.[Ch]: remove unused function Clear()
|
||||
|
||||
* math_cursor.C: change signature of MathStackXIter:push()
|
||||
whitespace changes
|
||||
@ -1002,7 +1004,7 @@
|
||||
shared_ptr, let constructor take a shared_ptr
|
||||
|
||||
* math_macro.C (MathMacro): take shared_ptr as arg, remove double
|
||||
initialization.
|
||||
initialization.
|
||||
(draw): remove unneded update, remove removed update of x,y
|
||||
(GetXY): call tmplates GetMacroXY directly
|
||||
(SetFocus): call Metrics() instead of update()
|
||||
@ -1022,7 +1024,7 @@
|
||||
|
||||
* math_cursor.C: changes because of the above
|
||||
* math_parser.C: changes because of the abobe
|
||||
|
||||
|
||||
* formulamacro.h: change tmacro_ to be a shared_ptr, remove
|
||||
default arg on constructor.
|
||||
* formulamacro.C: changes because of the above
|
||||
@ -1109,7 +1111,7 @@
|
||||
(~MathFuncInset): remove
|
||||
|
||||
* math_fracinset.h: make MathParInset den_ a real object and not a
|
||||
pointer.
|
||||
pointer.
|
||||
|
||||
* math_fracinset.C (MathFracInset): clean up, move initalization
|
||||
to initialization list
|
||||
@ -1117,7 +1119,7 @@
|
||||
(Clone): remove leak
|
||||
|
||||
* math_draw.C: delete file
|
||||
|
||||
|
||||
* math_dotsinset.[Ch]: add pragma
|
||||
|
||||
* math_bigopinset.h: make protected variables private add '_' to vars.
|
||||
@ -1146,14 +1148,14 @@
|
||||
* math_macroarg.C (MathMacroArgument): delete
|
||||
* math_macro.C (~MathMacro): delete
|
||||
* math_macrotemplate.C (~MathMacroTemplate): delete
|
||||
|
||||
|
||||
* math_decorationinset.[Ch]: add pragma
|
||||
* math_deliminset.[Ch]: likewise
|
||||
* math_fracinset.[Ch]: likewise
|
||||
* math_macroarg.[Ch]: likewise
|
||||
* math_macrotemplate.[Ch]: likewise
|
||||
* math_matrixinset.[Ch]: likewise
|
||||
|
||||
|
||||
* formulamacro.C (Read): set contents of tmacro_ to ar.
|
||||
|
||||
* formulamacro.h: add '_' to private variables.
|
||||
@ -1174,7 +1176,7 @@
|
||||
* move MathIter::Copy(int, int) to MathArray::shrink(pos, pos)
|
||||
|
||||
* several files: subsequent changes
|
||||
|
||||
|
||||
* math_cursor.C: make selarray a proper MathArray
|
||||
|
||||
* several files: Change "MathedArray *" to "MathedArray &"
|
||||
@ -1187,7 +1189,7 @@
|
||||
2001-02-14 André Pönitz <poenitz@gmx.net>
|
||||
|
||||
* array.[Ch]: "deep" copy constructor and assignment operator for
|
||||
MathArray
|
||||
MathArray
|
||||
|
||||
* math_iter.[Ch]: seperate Copy() from Copy(int, int)
|
||||
|
||||
@ -1197,7 +1199,7 @@
|
||||
2001-02-14 André Pönitz <poenitz@gmx.net>
|
||||
|
||||
* array.[Ch]: remove constructor and enums ARRAY_MIN_SIZE and
|
||||
ARRAY_STEP
|
||||
ARRAY_STEP
|
||||
|
||||
* math_iter.C: default-construct and resize array
|
||||
|
||||
@ -1211,7 +1213,7 @@
|
||||
of private variables.
|
||||
|
||||
* changes to several files because of the above.
|
||||
|
||||
|
||||
2001-02-14 André Pönitz <poenitz@gmx.net>
|
||||
|
||||
* math_iter.[Ch]: hide fcode_
|
||||
@ -1230,7 +1232,7 @@
|
||||
|
||||
* move funcs to more localized files, more general cleanup.
|
||||
Constify several local vars. Doxygen changes. Formatting.
|
||||
|
||||
|
||||
2001-02-15 Lars Gullik Bjønnes <larsbj@lyx.org>
|
||||
|
||||
* support.C: add some consts
|
||||
@ -1242,7 +1244,7 @@
|
||||
|
||||
2001-02-14 André Pönitz <poenitz@gmx.net>
|
||||
|
||||
* formula.C: reformatting
|
||||
* formula.C: reformatting
|
||||
|
||||
* math_cursor.[Ch]:
|
||||
math_iter.[Ch]:
|
||||
@ -1250,44 +1252,44 @@
|
||||
|
||||
2001-02-14 Lars Gullik Bjønnes <larsbj@lyx.org>
|
||||
|
||||
* math_parser.C:
|
||||
* math_panel.C:
|
||||
* math_parser.C:
|
||||
* math_panel.C:
|
||||
* formula.C: remove cruft
|
||||
|
||||
* array.C (begin): new method
|
||||
(end): ditto
|
||||
|
||||
2001-02-14 André Pönitz <poenitz@gmx.net>
|
||||
|
||||
|
||||
* math_iter.[Ch]: remove 'insert', 'maxsize' and 'ARRAY_SIZE'
|
||||
|
||||
* math_cursor.C: reformatting
|
||||
* math_cursor.C: reformatting
|
||||
|
||||
2001-02-14 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
|
||||
|
||||
* math_spaceinset.C:
|
||||
* math_root.C:
|
||||
* math_matrixinset.C:
|
||||
* math_macrotemplate.C:
|
||||
* math_funcinset.C:
|
||||
* math_fracinset.C:
|
||||
* math_dotsinset.C:
|
||||
* math_deliminset.C:
|
||||
* math_decorationinset.C:
|
||||
* math_bigopinset.C:
|
||||
* math_accentinset.C:
|
||||
* math_spaceinset.C:
|
||||
* math_root.C:
|
||||
* math_matrixinset.C:
|
||||
* math_macrotemplate.C:
|
||||
* math_funcinset.C:
|
||||
* math_fracinset.C:
|
||||
* math_dotsinset.C:
|
||||
* math_deliminset.C:
|
||||
* math_decorationinset.C:
|
||||
* math_bigopinset.C:
|
||||
* math_accentinset.C:
|
||||
* math_sqrtinset.C: include LOstream.h and add using directive.
|
||||
|
||||
2001-02-14 André Pönitz <poenitz@gmx.net>
|
||||
|
||||
* math_iter.C: reformatting
|
||||
* math_iter.C: reformatting
|
||||
|
||||
2001-02-13 Lars Gullik Bjønnes <larsbj@lyx.org>
|
||||
|
||||
* math_spaceinset.C (GetSpace): move here
|
||||
|
||||
* math_parinset.C: add debug.h, move several prev. inlined methods
|
||||
here.
|
||||
here.
|
||||
|
||||
* math_macrotable.C math_xiter.C support.C: add debug.h
|
||||
|
||||
@ -1347,28 +1349,28 @@
|
||||
2001-02-13 Jean-Marc Lasgouttes <Jean-Marc.Lasgouttes@inria.fr>
|
||||
|
||||
* Makefile.am (libmathed_la_SOURCES): remove duplicate
|
||||
math_sqrtinset.
|
||||
math_sqrtinset.
|
||||
|
||||
* support.C:
|
||||
* math_xiter.C:
|
||||
* support.C:
|
||||
* math_xiter.C:
|
||||
* math_parinset.C: add a bunch of "using" directives.
|
||||
|
||||
* math_funcinset.h:
|
||||
* math_decorationinset.h:
|
||||
* math_bigopinset.h:
|
||||
* math_funcinset.h:
|
||||
* math_decorationinset.h:
|
||||
* math_bigopinset.h:
|
||||
* math_spaceinset.h: remove more couples of inline.
|
||||
|
||||
2001-02-13 Lars Gullik Bjønnes <larsbj@lyx.org>
|
||||
|
||||
* math_xiter.h: remove a couple of "inline"
|
||||
|
||||
* array.C (strange_copy): fix bug (hopefully)
|
||||
* array.C (strange_copy): fix bug (hopefully)
|
||||
* many files: add a lot of new files and move methods to the class
|
||||
files they belong to. Only first attempt at cleanup more will
|
||||
follow.
|
||||
|
||||
|
||||
2001-02-12 André Pönitz <poenitz@gmx.net>
|
||||
|
||||
|
||||
* math_macro.[hC]: replace MathMacroArgument[] with
|
||||
std::vector<MathMacroArgument>
|
||||
* math_defs.h:
|
||||
@ -1376,7 +1378,7 @@
|
||||
* math_panel.h:
|
||||
* math_symbols.C: replace FL_OBJECTP[] with
|
||||
std::vector<FL_OBJECT*>
|
||||
|
||||
|
||||
2001-02-12 Lars Gullik Bjønnes <larsbj@lyx.org>
|
||||
|
||||
* math_defs.h (struct MathedRowSt): make all private variables end
|
||||
@ -1392,7 +1394,7 @@
|
||||
environment.
|
||||
|
||||
2001-02-12 André Pönitz <poenitz@gmx.net>
|
||||
|
||||
|
||||
* array.[hC]: replace private variable maxsize_ with call to
|
||||
bf_.size()
|
||||
* math_defs.h: replace int[] by std::vector<int> for
|
||||
@ -1406,11 +1408,11 @@
|
||||
changed name from LyxArrayBase to MathedArray.
|
||||
changed name of some methods to start with lowerchar.
|
||||
moved inline methods to array.C
|
||||
|
||||
|
||||
* math_iter.C + several file: changes because of the above.
|
||||
|
||||
* array.C: new file with the prev inline methods.
|
||||
|
||||
|
||||
2001-02-10 Dekel Tsur <dekelts@tau.ac.il>
|
||||
|
||||
* Many files: add support for the align environment from amsmath.
|
||||
@ -1418,7 +1420,7 @@
|
||||
2001-02-09 André Pönitz <poenitz@gmx.net>
|
||||
|
||||
* array.h: replace array buffer 'byte bf[]' by 'std::vector<byte> bf'
|
||||
* several files: subsequent changes
|
||||
* several files: subsequent changes
|
||||
* math_iter.h: remove unused prototype
|
||||
* array.h: ditto.
|
||||
|
||||
@ -1439,7 +1441,7 @@
|
||||
|
||||
2001-02-02 Dekel Tsur <dekelts@tau.ac.il>
|
||||
|
||||
* Many files: Add support for multline and alignat environments from
|
||||
* Many files: Add support for multline and alignat environments from
|
||||
amsmath.
|
||||
|
||||
2001-02-02 Dekel Tsur <dekelts@tau.ac.il>
|
||||
@ -1459,4 +1461,3 @@
|
||||
2001-01-15 Dekel Tsur <dekelts@tau.ac.il>
|
||||
|
||||
* math_draw.C (Metrics): Use the correct GetString.
|
||||
|
||||
|
@ -92,7 +92,7 @@ namespace {
|
||||
"eval(`latex/latex/*`)):\n";
|
||||
|
||||
// remove spurious \\noalign{\\medskip} in matrix output
|
||||
header +=
|
||||
header +=
|
||||
"`latex/latex/matrix`:= "
|
||||
"subs(`\\\\\\\\\\\\noalign{\\\\medskip}` = `\\\\\\\\`,"
|
||||
"eval(`latex/latex/matrix`)):\n";
|
||||
@ -111,7 +111,7 @@ namespace {
|
||||
//
|
||||
// ... > echo "1A;" | mint -i 1 -S -s -q
|
||||
// on line 1: 1A;
|
||||
// ^ syntax error -
|
||||
// ^ syntax error -
|
||||
// Probably missing an operator such as * p
|
||||
//
|
||||
lyxerr << "checking expr: '" << expr << "'\n";
|
||||
@ -143,8 +143,8 @@ namespace {
|
||||
mathed_parse_cell(res, out);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
MathArray pipeThroughOctave(string const &, MathArray const & ar)
|
||||
{
|
||||
ostringstream os;
|
||||
@ -155,13 +155,13 @@ namespace {
|
||||
|
||||
for (int i = 0; i < 100; ++i) { // at most 100 attempts
|
||||
//
|
||||
// try to fix missing '*' the hard way
|
||||
// try to fix missing '*' the hard way
|
||||
// parse error:
|
||||
// >>> ([[1 2 3 ];[2 3 1 ];[3 1 2 ]])([[1 2 3 ];[2 3 1 ];[3 1 2 ]])
|
||||
// ^
|
||||
//
|
||||
lyxerr << "checking expr: '" << expr << "'\n";
|
||||
out = captureOutput("octave -q 2>&1", expr);
|
||||
out = captureOutput("octave -q 2>&1", expr);
|
||||
lyxerr << "checking out: '" << out << "'\n";
|
||||
|
||||
// leave loop if expression syntax is probably ok
|
||||
@ -234,7 +234,7 @@ namespace {
|
||||
lyxerr << "converter to '" << lang << "' not found\n";
|
||||
return MathArray();
|
||||
}
|
||||
|
||||
|
||||
// run external sript
|
||||
string out = captureOutput(file, data);
|
||||
MathArray res;
|
||||
@ -255,7 +255,7 @@ InsetFormula::InsetFormula(MathInsetTypes t)
|
||||
{}
|
||||
|
||||
|
||||
InsetFormula::InsetFormula(string const & s)
|
||||
InsetFormula::InsetFormula(string const & s)
|
||||
{
|
||||
if (s.size()) {
|
||||
bool res = mathed_parse_normal(par_, s);
|
||||
@ -388,7 +388,7 @@ InsetFormula::localDispatch(BufferView * bv, kb_action action,
|
||||
|
||||
switch (action) {
|
||||
|
||||
case LFUN_BREAKLINE:
|
||||
case LFUN_BREAKLINE:
|
||||
bv->lockedInsetStoreUndo(Undo::INSERT);
|
||||
mathcursor->breakLine();
|
||||
mathcursor->normalize();
|
||||
@ -496,11 +496,11 @@ InsetFormula::localDispatch(BufferView * bv, kb_action action,
|
||||
updateLocal(bv, true);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
case LFUN_PASTESELECTION:
|
||||
{
|
||||
string const clip = bv->getClipboard();
|
||||
if (!clip.empty())
|
||||
if (!clip.empty())
|
||||
mathed_parse_normal(par_, clip);
|
||||
break;
|
||||
}
|
||||
@ -523,14 +523,14 @@ void InsetFormula::handleExtern(const string & arg)
|
||||
{
|
||||
// where are we?
|
||||
if (!mathcursor)
|
||||
return;
|
||||
return;
|
||||
|
||||
string lang;
|
||||
string extra;
|
||||
istringstream iss(arg.c_str());
|
||||
iss >> lang >> extra;
|
||||
if (extra.empty())
|
||||
extra = "noextra";
|
||||
extra = "noextra";
|
||||
|
||||
bool selected = mathcursor->selection();
|
||||
|
||||
@ -588,9 +588,9 @@ void InsetFormula::validate(LaTeXFeatures & features) const
|
||||
|
||||
bool InsetFormula::insetAllowed(Inset::Code code) const
|
||||
{
|
||||
return
|
||||
return
|
||||
(code == Inset::LABEL_CODE && display())
|
||||
|| code == Inset::ERT_CODE;
|
||||
|| code == Inset::ERT_CODE;
|
||||
}
|
||||
|
||||
|
||||
|
@ -2,9 +2,9 @@
|
||||
/*
|
||||
* File: formula.h
|
||||
* Purpose: Declaration of formula inset
|
||||
* Author: Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
|
||||
* Author: Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
|
||||
* Created: January 1996
|
||||
* Description: Allows the edition of math paragraphs inside Lyx.
|
||||
* Description: Allows the edition of math paragraphs inside Lyx.
|
||||
*
|
||||
* Copyright: 1996, Alejandro Aguilar Sierra
|
||||
*
|
||||
@ -14,7 +14,7 @@
|
||||
* the GNU General Public Licence version 2 or later.
|
||||
*/
|
||||
|
||||
#ifndef INSET_FORMULA_H
|
||||
#ifndef INSET_FORMULA_H
|
||||
#define INSET_FORMULA_H
|
||||
|
||||
#ifdef __GNUG__
|
||||
|
@ -70,7 +70,7 @@ int hack_y;
|
||||
int hack_button;
|
||||
|
||||
|
||||
void handleFont(BufferView * bv, string const & arg, MathTextCodes t)
|
||||
void handleFont(BufferView * bv, string const & arg, MathTextCodes t)
|
||||
{
|
||||
if (mathcursor->selection())
|
||||
bv->lockedInsetStoreUndo(Undo::EDIT);
|
||||
@ -133,14 +133,14 @@ void InsetFormulaBase::validate(LaTeXFeatures &) const
|
||||
{}
|
||||
|
||||
|
||||
void InsetFormulaBase::metrics(BufferView * bv, LyXFont const & f) const
|
||||
void InsetFormulaBase::metrics(BufferView * bv, LyXFont const & f) const
|
||||
{
|
||||
font_ = f;
|
||||
metrics(bv);
|
||||
}
|
||||
|
||||
|
||||
void InsetFormulaBase::metrics(BufferView * bv) const
|
||||
void InsetFormulaBase::metrics(BufferView * bv) const
|
||||
{
|
||||
if (bv)
|
||||
view_ = bv;
|
||||
@ -279,7 +279,7 @@ void InsetFormulaBase::updateLocal(BufferView * bv, bool dirty)
|
||||
|
||||
|
||||
bool InsetFormulaBase::insetButtonRelease(BufferView * bv,
|
||||
int /*x*/, int /*y*/, int /*button*/)
|
||||
int /*x*/, int /*y*/, int /*button*/)
|
||||
{
|
||||
if (!mathcursor)
|
||||
return false;
|
||||
@ -328,7 +328,7 @@ void InsetFormulaBase::insetButtonPress(BufferView * bv,
|
||||
bv->getLyXText()->selectionAsString(bv->buffer(), false);
|
||||
mathed_parse_cell(ar, sel);
|
||||
mathcursor->insert(ar);
|
||||
}
|
||||
}
|
||||
break;
|
||||
*/
|
||||
case 3:
|
||||
@ -353,9 +353,9 @@ void InsetFormulaBase::insetMotionNotify(BufferView * bv,
|
||||
first_x = x;
|
||||
first_y = y;
|
||||
|
||||
if (!mathcursor->selection())
|
||||
if (!mathcursor->selection())
|
||||
mathcursor->selStart();
|
||||
|
||||
|
||||
//lyxerr << "insetMotionNotify: " << x + xo_ << ' ' << y + yo_
|
||||
// << ' ' << button << "\n";
|
||||
hideInsetCursor(bv);
|
||||
@ -378,7 +378,7 @@ InsetFormulaBase::localDispatch(BufferView * bv, kb_action action,
|
||||
//lyxerr << "InsetFormulaBase::localDispatch: act: " << action
|
||||
// << " arg: '" << arg << "' cursor: " << mathcursor << "\n";
|
||||
|
||||
if (!mathcursor)
|
||||
if (!mathcursor)
|
||||
return UNDISPATCHED;
|
||||
|
||||
if (mathcursor->asHyperActiveInset()) {
|
||||
@ -568,7 +568,7 @@ InsetFormulaBase::localDispatch(BufferView * bv, kb_action action,
|
||||
case LFUN_DEFAULT: handleFont(bv, arg, LM_TC_VAR); break;
|
||||
case LFUN_FREE: handleFont(bv, arg, LM_TC_TEXTRM); break;
|
||||
|
||||
case LFUN_GREEK:
|
||||
case LFUN_GREEK:
|
||||
handleFont(bv, arg, LM_TC_GREEK1);
|
||||
if (arg.size())
|
||||
mathcursor->interpret(arg);
|
||||
@ -618,7 +618,7 @@ InsetFormulaBase::localDispatch(BufferView * bv, kb_action action,
|
||||
updateLocal(bv, true);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
case LFUN_SUPERSCRIPT:
|
||||
case LFUN_SUBSCRIPT:
|
||||
{
|
||||
@ -627,7 +627,7 @@ InsetFormulaBase::localDispatch(BufferView * bv, kb_action action,
|
||||
updateLocal(bv, true);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
case LFUN_MATH_DELIM:
|
||||
{
|
||||
lyxerr << "formulabase::LFUN_MATH_DELIM, arg: '" << arg << "'\n";
|
||||
@ -825,7 +825,7 @@ bool InsetFormulaBase::searchForward(BufferView * bv, string const & str,
|
||||
//lyxerr << "reset lastformula to " << this << "\n";
|
||||
lastformula = this;
|
||||
laststr = str;
|
||||
current = ibegin(par().nucleus());
|
||||
current = ibegin(par().nucleus());
|
||||
ar.clear();
|
||||
mathed_parse_cell(ar, str);
|
||||
} else {
|
||||
@ -893,7 +893,7 @@ void mathDispatchCreation(BufferView * bv, string const & arg, bool display)
|
||||
} else {
|
||||
// create a macro if we see "\\newcommand" somewhere, and an ordinary
|
||||
// formula otherwise
|
||||
if (sel.find("\\newcommand") == string::npos)
|
||||
if (sel.find("\\newcommand") == string::npos)
|
||||
f = new InsetFormula(sel);
|
||||
else {
|
||||
string name;
|
||||
@ -914,7 +914,7 @@ void mathDispatchMathDisplay(BufferView * bv, string const & arg)
|
||||
mathDispatchCreation(bv, arg, true);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void mathDispatchMathMode(BufferView * bv, string const & arg)
|
||||
{
|
||||
mathDispatchCreation(bv, arg, false);
|
||||
@ -944,20 +944,20 @@ void mathDispatchMathMacro(BufferView * bv, string const & arg)
|
||||
|
||||
void mathDispatchMathDelim(BufferView * bv, string const & arg)
|
||||
{
|
||||
if (bv->available()) {
|
||||
if (bv->available()) {
|
||||
if (openNewInset(bv, new InsetFormula))
|
||||
bv->theLockingInset()->localDispatch(bv, LFUN_MATH_DELIM, arg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void mathDispatchInsertMatrix(BufferView * bv, string const & arg)
|
||||
{
|
||||
if (bv->available()) {
|
||||
{
|
||||
if (bv->available()) {
|
||||
if (openNewInset(bv, new InsetFormula))
|
||||
bv->theLockingInset()->localDispatch(bv, LFUN_INSERT_MATRIX, arg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void mathDispatchInsertMath(BufferView * bv, string const & arg)
|
||||
@ -974,16 +974,16 @@ void mathDispatchInsertMath(BufferView * bv, string const & arg)
|
||||
|
||||
|
||||
void mathDispatchGreek(BufferView * bv, string const & arg)
|
||||
{
|
||||
if (bv->available()) {
|
||||
{
|
||||
if (bv->available()) {
|
||||
InsetFormula * f = new InsetFormula;
|
||||
if (openNewInset(bv, f)) {
|
||||
bv->theLockingInset()->localDispatch(bv, LFUN_GREEK, arg);
|
||||
bv->unlockInset(f);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void mathDispatch(BufferView *, kb_action, string const &)
|
||||
{}
|
||||
{}
|
||||
|
@ -4,7 +4,7 @@
|
||||
* Purpose: Common parts of the math LyX insets
|
||||
* Author: André Pönitz
|
||||
* Created: May 2001
|
||||
* Description: Allows the edition of math paragraphs inside Lyx.
|
||||
* Description: Allows the edition of math paragraphs inside Lyx.
|
||||
*
|
||||
* Copyright: 2001, The LyX Project
|
||||
*
|
||||
@ -12,7 +12,7 @@
|
||||
* the GNU General Public Licence version 2 or later.
|
||||
*/
|
||||
|
||||
#ifndef INSET_FORMULABASE_H
|
||||
#ifndef INSET_FORMULABASE_H
|
||||
#define INSET_FORMULABASE_H
|
||||
|
||||
#ifdef __GNUG__
|
||||
@ -87,10 +87,10 @@ public:
|
||||
virtual void insetMotionNotify(BufferView *, int x, int y, int state);
|
||||
///
|
||||
virtual void insetUnlock(BufferView *);
|
||||
|
||||
|
||||
/// To allow transparent use of math editing functions
|
||||
virtual RESULT localDispatch(BufferView *, kb_action, string const &);
|
||||
|
||||
|
||||
///
|
||||
virtual std::vector<string> const getLabelList() const;
|
||||
///
|
||||
@ -104,10 +104,10 @@ public:
|
||||
|
||||
///
|
||||
virtual bool searchForward(BufferView *, string const &,
|
||||
bool = true, bool = false);
|
||||
bool = true, bool = false);
|
||||
///
|
||||
virtual bool searchBackward(BufferView *, string const &,
|
||||
bool = true, bool = false);
|
||||
bool = true, bool = false);
|
||||
///
|
||||
virtual bool isTextInset() const { return true; }
|
||||
///
|
||||
@ -123,7 +123,7 @@ private:
|
||||
void handleAccent(BufferView * bv, string const & arg, string const & name);
|
||||
|
||||
///
|
||||
mutable BufferView * view_;
|
||||
mutable BufferView * view_;
|
||||
///
|
||||
mutable LyXFont font_;
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
* Purpose: Implementation of the formula macro LyX inset
|
||||
* Author: André Pönitz, based on ideas of Alejandro Aguilar Sierra
|
||||
* Created: March 2001
|
||||
* Description: Allows the edition of math macros inside Lyx.
|
||||
* Description: Allows the edition of math macros inside Lyx.
|
||||
*
|
||||
* Copyright: 2001 The LyX Project
|
||||
*
|
||||
@ -76,7 +76,7 @@ void InsetFormulaMacro::write(Buffer const *, ostream & os) const
|
||||
}
|
||||
|
||||
|
||||
int InsetFormulaMacro::latex(Buffer const *, ostream & os, bool fragile,
|
||||
int InsetFormulaMacro::latex(Buffer const *, ostream & os, bool fragile,
|
||||
bool /*free_spacing*/) const
|
||||
{
|
||||
WriteStream wi(os, fragile);
|
||||
@ -172,7 +172,7 @@ void InsetFormulaMacro::draw(BufferView * bv, LyXFont const & f,
|
||||
|
||||
// label
|
||||
font.setColor(LColor::math);
|
||||
|
||||
|
||||
int const a = y - ascent(bv, font) + 1;
|
||||
int const w = width(bv, font) - 2;
|
||||
int const h = ascent(bv, font) + descent(bv, font) - 2;
|
||||
@ -193,4 +193,3 @@ void InsetFormulaMacro::draw(BufferView * bv, LyXFont const & f,
|
||||
yo_ = y;
|
||||
par()->draw(pain, xo_, yo_);
|
||||
}
|
||||
|
||||
|
@ -2,9 +2,9 @@
|
||||
/*
|
||||
* File: formula.h
|
||||
* Purpose: Declaration of formula inset
|
||||
* Author: Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
|
||||
* Author: Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
|
||||
* Created: January 1996
|
||||
* Description: Allows the edition of math paragraphs inside Lyx.
|
||||
* Description: Allows the edition of math paragraphs inside Lyx.
|
||||
*
|
||||
* Copyright: 1996, Alejandro Aguilar Sierra
|
||||
*
|
||||
@ -14,7 +14,7 @@
|
||||
* the GNU General Public Licence version 2 or later.
|
||||
*/
|
||||
|
||||
#ifndef INSET_FORMULA_MACRO_H
|
||||
#ifndef INSET_FORMULA_MACRO_H
|
||||
#define INSET_FORMULA_MACRO_H
|
||||
|
||||
#include "formulabase.h"
|
||||
@ -26,7 +26,7 @@
|
||||
class MathMacroTemplate;
|
||||
|
||||
// InsetFormulaMacro's only knows its name and asks the global
|
||||
// MathMacroTable if it needs to know more.
|
||||
// MathMacroTable if it needs to know more.
|
||||
|
||||
///
|
||||
class InsetFormulaMacro: public InsetFormulaBase {
|
||||
|
@ -67,7 +67,7 @@ void MathAMSArrayInset::metrics(MathMetricsInfo const & st) const
|
||||
|
||||
|
||||
void MathAMSArrayInset::draw(Painter & pain, int x, int y) const
|
||||
{
|
||||
{
|
||||
MathGridInset::draw(pain, x + 6, y);
|
||||
int yy = y - ascent_;
|
||||
mathed_draw_deco(pain, x + 1, yy, 5, height(), name_left());
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
|
||||
class MathAMSArrayInset : public MathGridInset {
|
||||
public:
|
||||
public:
|
||||
///
|
||||
MathAMSArrayInset(string const & name_, int m, int n);
|
||||
///
|
||||
|
@ -81,7 +81,7 @@ void MathArrayInset::write(WriteStream & os) const
|
||||
os << "\\protect";
|
||||
os << "\\begin{" << name_ << "}";
|
||||
|
||||
if (v_align_ == 't' || v_align_ == 'b')
|
||||
if (v_align_ == 't' || v_align_ == 'b')
|
||||
os << '[' << char(v_align_) << ']';
|
||||
os << '{' << halign() << "}\n";
|
||||
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
|
||||
class MathArrayInset : public MathGridInset {
|
||||
public:
|
||||
public:
|
||||
///
|
||||
MathArrayInset(string const &, int m, int n);
|
||||
///
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
* File: math_atom.C
|
||||
* Purpose: Wrapper for MathInset *
|
||||
* Purpose: Wrapper for MathInset *
|
||||
* Author: André Pönitz
|
||||
* Created: July 2001
|
||||
*
|
||||
|
@ -7,12 +7,12 @@
|
||||
#pragma interface
|
||||
#endif
|
||||
|
||||
/**
|
||||
/**
|
||||
The 'atom' is the major blob in math typesetting. And 'atom' consists
|
||||
of a nucleus, an optional superscript, and an optional subscript.
|
||||
|
||||
Exactly where the subscript and superscript are drawn depends on the
|
||||
size, and type, of the nucleus they are attached to.
|
||||
size, and type, of the nucleus they are attached to.
|
||||
|
||||
Jules
|
||||
|
||||
@ -33,7 +33,7 @@ Andre'
|
||||
class MathInset;
|
||||
|
||||
class MathAtom {
|
||||
public:
|
||||
public:
|
||||
/// default constructor, object is useless, but we need it to put it into
|
||||
// std::containers
|
||||
MathAtom();
|
||||
@ -42,7 +42,7 @@ public:
|
||||
/// copy constructor, invokes nucleus_->clone()
|
||||
MathAtom(MathAtom const &);
|
||||
/// we really need to clean up
|
||||
~MathAtom();
|
||||
~MathAtom();
|
||||
/// assignment invokes nucleus_->clone()
|
||||
void operator=(MathAtom const &);
|
||||
/// change inset under the hood
|
||||
|
@ -17,7 +17,7 @@ MathBigInset::MathBigInset(string const & name, string const & delim)
|
||||
|
||||
|
||||
MathInset * MathBigInset::clone() const
|
||||
{
|
||||
{
|
||||
return new MathBigInset(*this);
|
||||
}
|
||||
|
||||
@ -53,7 +53,7 @@ void MathBigInset::metrics(MathMetricsInfo const & mi) const
|
||||
|
||||
|
||||
void MathBigInset::draw(Painter & pain, int x, int y) const
|
||||
{
|
||||
{
|
||||
mathed_draw_deco(pain, x + 1, y - ascent_, 4, height(), delim_);
|
||||
}
|
||||
|
||||
|
@ -33,7 +33,7 @@ private:
|
||||
size_type size() const;
|
||||
///
|
||||
double increase() const;
|
||||
|
||||
|
||||
/// \bigl or what?
|
||||
string const name_;
|
||||
/// ( or [ or Vert...
|
||||
|
@ -20,7 +20,7 @@ MathBinaryOpInset::MathBinaryOpInset(char op)
|
||||
|
||||
|
||||
MathInset * MathBinaryOpInset::clone() const
|
||||
{
|
||||
{
|
||||
return new MathBinaryOpInset(*this);
|
||||
}
|
||||
|
||||
@ -43,10 +43,10 @@ void MathBinaryOpInset::metrics(MathMetricsInfo const & mi) const
|
||||
|
||||
|
||||
void MathBinaryOpInset::draw(Painter & pain, int x, int y) const
|
||||
{
|
||||
xcell(0).draw(pain, x, y);
|
||||
{
|
||||
xcell(0).draw(pain, x, y);
|
||||
drawChar(pain, LM_TC_CONST, mi_, x + xcell(0).width() , y, op_);
|
||||
xcell(1).draw(pain, x + width() - xcell(1).width(), y);
|
||||
xcell(1).draw(pain, x + width() - xcell(1).width(), y);
|
||||
}
|
||||
|
||||
|
||||
|
@ -18,7 +18,7 @@ MathBinomInset::MathBinomInset()
|
||||
|
||||
|
||||
MathInset * MathBinomInset::clone() const
|
||||
{
|
||||
{
|
||||
return new MathBinomInset(*this);
|
||||
}
|
||||
|
||||
@ -41,8 +41,8 @@ void MathBinomInset::metrics(MathMetricsInfo const & st) const
|
||||
xcell(0).metrics(mi);
|
||||
xcell(1).metrics(mi);
|
||||
ascent_ = xcell(0).height() + 4 + 5;
|
||||
descent_ = xcell(1).height() + 4 - 5;
|
||||
width_ = max(xcell(0).width(), xcell(1).width()) + 2 * dw() + 4;
|
||||
descent_ = xcell(1).height() + 4 - 5;
|
||||
width_ = max(xcell(0).width(), xcell(1).width()) + 2 * dw() + 4;
|
||||
}
|
||||
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
#endif
|
||||
|
||||
/** Binom like objects
|
||||
\author André Pönitz
|
||||
\author André Pönitz
|
||||
*/
|
||||
class MathBinomInset : public MathFracbaseInset {
|
||||
public:
|
||||
|
@ -19,7 +19,7 @@ MathBraceInset::MathBraceInset()
|
||||
|
||||
|
||||
MathInset * MathBraceInset::clone() const
|
||||
{
|
||||
{
|
||||
return new MathBraceInset(*this);
|
||||
}
|
||||
|
||||
@ -37,7 +37,7 @@ void MathBraceInset::metrics(MathMetricsInfo const & mi) const
|
||||
|
||||
|
||||
void MathBraceInset::draw(Painter & pain, int x, int y) const
|
||||
{
|
||||
{
|
||||
drawChar(pain, font_, x, y, '{');
|
||||
xcell(0).draw(pain, x + wid_, y);
|
||||
drawChar(pain, font_, x + width_ - wid_, y, '}');
|
||||
@ -54,5 +54,3 @@ void MathBraceInset::normalize(NormalStream & os) const
|
||||
{
|
||||
os << "[block " << cell(0) << ']';
|
||||
}
|
||||
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
#pragma interface
|
||||
#endif
|
||||
|
||||
/** Extra nesting
|
||||
/** Extra nesting
|
||||
\author André Pönitz
|
||||
*/
|
||||
|
||||
|
@ -30,7 +30,7 @@ void MathCasesInset::metrics(MathMetricsInfo const & mi) const
|
||||
|
||||
|
||||
void MathCasesInset::draw(Painter & pain, int x, int y) const
|
||||
{
|
||||
{
|
||||
mathed_draw_deco(pain, x + 1, y - ascent(), 6, height(), "{");
|
||||
MathGridInset::draw(pain, x + 8, y);
|
||||
}
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
|
||||
class MathCasesInset : public MathGridInset {
|
||||
public:
|
||||
public:
|
||||
///
|
||||
explicit MathCasesInset(row_type rows = 1u);
|
||||
///
|
||||
|
@ -57,7 +57,7 @@ MathTextCodes MathCharInset::nativeCode(char c)
|
||||
|
||||
|
||||
MathInset * MathCharInset::clone() const
|
||||
{
|
||||
{
|
||||
return new MathCharInset(*this);
|
||||
}
|
||||
|
||||
@ -72,7 +72,7 @@ void MathCharInset::metrics(MathMetricsInfo const & mi) const
|
||||
|
||||
|
||||
void MathCharInset::draw(Painter & pain, int x, int y) const
|
||||
{
|
||||
{
|
||||
//lyxerr << "drawing '" << char_ << "' code: " << code_ << endl;
|
||||
if (isBinaryOp(char_, code_))
|
||||
x += lyxfont::width(' ', font_);
|
||||
@ -89,7 +89,7 @@ void MathCharInset::metricsT(TextMetricsInfo const &) const
|
||||
|
||||
|
||||
void MathCharInset::drawT(TextPainter & pain, int x, int y) const
|
||||
{
|
||||
{
|
||||
//lyxerr << "drawing text '" << char_ << "' code: " << code_ << endl;
|
||||
pain.draw(x, y, char_);
|
||||
}
|
||||
|
@ -358,7 +358,7 @@ void MathCursor::last()
|
||||
|
||||
|
||||
bool positionable(MathCursor::cursor_type const & cursor,
|
||||
MathCursor::cursor_type const & anchor)
|
||||
MathCursor::cursor_type const & anchor)
|
||||
{
|
||||
// avoid deeper nested insets when selecting
|
||||
if (cursor.size() > anchor.size())
|
||||
@ -946,12 +946,12 @@ void MathCursor::normalize()
|
||||
}
|
||||
#endif
|
||||
|
||||
if (idx() >= par()->nargs()) {
|
||||
if (idx() >= par()->nargs()) {
|
||||
lyxerr << "this should not really happen - 1: "
|
||||
<< idx() << " " << par()->nargs() << "\n";
|
||||
dump("error 2");
|
||||
}
|
||||
idx() = min(idx(), par()->nargs() - 1);
|
||||
idx() = min(idx(), par()->nargs() - 1);
|
||||
|
||||
if (pos() > size()) {
|
||||
lyxerr << "this should not really happen - 2: "
|
||||
@ -1238,7 +1238,7 @@ bool MathCursor::goUpDown(bool up)
|
||||
if (!popLeft()) {
|
||||
// no such inset found, just take something "above"
|
||||
///lyxerr << "updown: handled by strange case\n";
|
||||
return
|
||||
return
|
||||
bruteFind(xo, yo,
|
||||
formula()->xlow(),
|
||||
formula()->xhigh(),
|
||||
@ -1363,7 +1363,7 @@ bool MathCursor::interpret(string const & s)
|
||||
}
|
||||
|
||||
// prevent entering of recursive macros
|
||||
if (formula()->lyxCode() == Inset::MATHMACRO_CODE
|
||||
if (formula()->lyxCode() == Inset::MATHMACRO_CODE
|
||||
&& formula()->getInsetName() == s.substr(1))
|
||||
{
|
||||
lyxerr << "can't enter recursive macro\n";
|
||||
|
@ -2,7 +2,7 @@
|
||||
/*
|
||||
* File: math_cursor.h
|
||||
* Purpose: Declaration of interaction classes for mathed
|
||||
* Author: Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
|
||||
* Author: Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
|
||||
* Created: January 1996
|
||||
* Description: MathCursor control all user interaction
|
||||
*
|
||||
@ -128,7 +128,7 @@ public:
|
||||
bool inMacroMode() const;
|
||||
/// are we currently typing '#1' or '#2' or...?
|
||||
bool inMacroArgMode() const;
|
||||
|
||||
|
||||
// Local selection methods
|
||||
///
|
||||
bool selection() const;
|
||||
@ -158,7 +158,7 @@ public:
|
||||
void handleNest(MathInset * p);
|
||||
/// splits cells and shifts right part to the next cell
|
||||
void splitCell();
|
||||
/// splits line and insert new row of cell
|
||||
/// splits line and insert new row of cell
|
||||
void breakLine();
|
||||
/// read contents of line into an array
|
||||
void readLine(MathArray & ar) const;
|
||||
@ -185,12 +185,12 @@ public:
|
||||
|
||||
/// make sure cursor position is valid
|
||||
void normalize();
|
||||
/// mark current cursor trace for redraw
|
||||
/// mark current cursor trace for redraw
|
||||
void touch();
|
||||
///
|
||||
UpdatableInset * asHyperActiveInset() const;
|
||||
|
||||
/// enter a MathInset
|
||||
/// enter a MathInset
|
||||
void push(MathAtom & par);
|
||||
/// enter a MathInset from the front
|
||||
void pushLeft(MathAtom & par);
|
||||
@ -236,7 +236,7 @@ public:
|
||||
void dump(char const * str) const;
|
||||
///
|
||||
void stripFromLastEqualSign();
|
||||
/// moves on
|
||||
/// moves on
|
||||
void setSelection(cursor_type const & where, size_type n);
|
||||
///
|
||||
void insert(char);
|
||||
@ -244,7 +244,7 @@ public:
|
||||
/// hack for reveal codes
|
||||
void markInsert();
|
||||
void markErase();
|
||||
|
||||
|
||||
///
|
||||
friend class Selection;
|
||||
|
||||
@ -268,7 +268,7 @@ private:
|
||||
MathInset::difference_type macroNamePos() const;
|
||||
///
|
||||
void insert(char, MathTextCodes t);
|
||||
/// can we enter the inset?
|
||||
/// can we enter the inset?
|
||||
bool openable(MathAtom const &, bool selection) const;
|
||||
/// write access to cursor cell position
|
||||
pos_type & pos();
|
||||
|
@ -66,7 +66,7 @@ void MathArray::insert(size_type pos, MathArray const & ar)
|
||||
|
||||
|
||||
void MathArray::push_back(MathAtom const & t)
|
||||
{
|
||||
{
|
||||
bf_.push_back(t);
|
||||
}
|
||||
|
||||
@ -85,7 +85,7 @@ void MathArray::clear()
|
||||
|
||||
void MathArray::swap(MathArray & ar)
|
||||
{
|
||||
if (this != &ar)
|
||||
if (this != &ar)
|
||||
bf_.swap(ar.bf_);
|
||||
}
|
||||
|
||||
@ -176,7 +176,7 @@ void MathArray::validate(LaTeXFeatures & features) const
|
||||
|
||||
|
||||
void MathArray::pop_back()
|
||||
{
|
||||
{
|
||||
if (!size()) {
|
||||
lyxerr << "pop_back from empty array!\n";
|
||||
return;
|
||||
@ -219,7 +219,7 @@ bool MathArray::matchpart(MathArray const & ar, pos_type pos) const
|
||||
{
|
||||
if (size() < ar.size() + pos)
|
||||
return false;
|
||||
const_iterator it = begin() + pos;
|
||||
const_iterator it = begin() + pos;
|
||||
for (const_iterator jt = ar.begin(); jt != ar.end(); ++jt, ++it)
|
||||
if (!jt->nucleus()->match(it->nucleus()))
|
||||
return false;
|
||||
@ -265,6 +265,6 @@ bool MathArray::contains(MathArray const & ar) const
|
||||
for (const_iterator it = begin(); it != end(); ++it)
|
||||
if (it->nucleus()->contains(ar))
|
||||
return true;
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
// -*- C++ -*-
|
||||
/*
|
||||
* Purpose: A general purpose resizable array.
|
||||
* Author: Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
|
||||
* Purpose: A general purpose resizable array.
|
||||
* Author: Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
|
||||
* Created: January 1996
|
||||
*
|
||||
* Dependencies: None (almost)
|
||||
@ -33,7 +33,7 @@ class ReplaceData;
|
||||
|
||||
/** \class MathArray
|
||||
\brief Low level container for math insets
|
||||
|
||||
|
||||
\author Alejandro Aguilar Sierra
|
||||
\author André Pönitz
|
||||
\author Lars Gullik Bjønnes
|
||||
@ -73,7 +73,7 @@ public:
|
||||
void clear();
|
||||
///
|
||||
void swap(MathArray &);
|
||||
|
||||
|
||||
///
|
||||
void insert(size_type pos, MathAtom const &);
|
||||
///
|
||||
@ -126,9 +126,9 @@ public:
|
||||
///
|
||||
void validate(LaTeXFeatures &) const;
|
||||
///
|
||||
const_iterator begin() const;
|
||||
const_iterator begin() const;
|
||||
///
|
||||
const_iterator end() const;
|
||||
const_iterator end() const;
|
||||
///
|
||||
iterator begin();
|
||||
///
|
||||
|
@ -17,7 +17,7 @@ MathDecorationInset::MathDecorationInset(string const & name)
|
||||
|
||||
|
||||
MathInset * MathDecorationInset::clone() const
|
||||
{
|
||||
{
|
||||
return new MathDecorationInset(*this);
|
||||
}
|
||||
|
||||
@ -81,7 +81,7 @@ void MathDecorationInset::metrics(MathMetricsInfo const & mi) const
|
||||
ascent_ = xcell(0).ascent();
|
||||
descent_ = xcell(0).descent();
|
||||
|
||||
dh_ = 6; //mathed_char_height(LM_TC_VAR, mi(), 'I', ascent_, descent_);
|
||||
dh_ = 6; //mathed_char_height(LM_TC_VAR, mi(), 'I', ascent_, descent_);
|
||||
dw_ = 6; //mathed_char_width(LM_TC_VAR, mi, 'x');
|
||||
|
||||
if (upper()) {
|
||||
@ -95,9 +95,9 @@ void MathDecorationInset::metrics(MathMetricsInfo const & mi) const
|
||||
|
||||
|
||||
void MathDecorationInset::draw(Painter & pain, int x, int y) const
|
||||
{
|
||||
{
|
||||
xcell(0).draw(pain, x, y);
|
||||
if (wide())
|
||||
if (wide())
|
||||
mathed_draw_deco(pain, x, y + dy_, width_, dh_, name_);
|
||||
else
|
||||
mathed_draw_deco(pain, x + (width_ - dw_) / 2, y + dy_, dw_, dh_, name_);
|
||||
|
@ -1,8 +1,8 @@
|
||||
// -*- C++ -*-
|
||||
/*
|
||||
* File: math_defs.h
|
||||
* Purpose: Math editor definitions
|
||||
* Author: Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
|
||||
* Purpose: Math editor definitions
|
||||
* Author: Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
|
||||
* Created: January 1996
|
||||
* Description: Math paragraph and objects for a WYSIWYG math editor.
|
||||
*
|
||||
@ -14,7 +14,7 @@
|
||||
*
|
||||
* You are free to use and modify this code under the terms of
|
||||
* the GNU General Public Licence version 2 or later.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef MATH_DEFS
|
||||
@ -27,7 +27,7 @@
|
||||
|
||||
///
|
||||
enum MathTextCodes {
|
||||
///
|
||||
///
|
||||
LM_TC_MIN = 0,
|
||||
/// internal code for variables
|
||||
LM_TC_VAR,
|
||||
@ -53,7 +53,7 @@ enum MathTextCodes {
|
||||
LM_TC_IT,
|
||||
///
|
||||
LM_TC_TEXTRM,
|
||||
/// math mode TeX characters ",;:{}"
|
||||
/// math mode TeX characters ",;:{}"
|
||||
LM_TC_TEX,
|
||||
/// internal code when typing greek
|
||||
LM_TC_GREEK,
|
||||
@ -80,13 +80,13 @@ enum MathTextCodes {
|
||||
};
|
||||
|
||||
|
||||
/// Types of lyx-math insets
|
||||
/// Types of lyx-math insets
|
||||
enum MathInsetTypes {
|
||||
///
|
||||
LM_OT_SIMPLE = 0,
|
||||
///
|
||||
LM_OT_EQUATION,
|
||||
///
|
||||
///
|
||||
LM_OT_EQNARRAY,
|
||||
///
|
||||
LM_OT_ALIGN,
|
||||
|
@ -21,7 +21,7 @@ MathDelimInset::MathDelimInset(string const & l, string const & r)
|
||||
|
||||
|
||||
MathInset * MathDelimInset::clone() const
|
||||
{
|
||||
{
|
||||
return new MathDelimInset(*this);
|
||||
}
|
||||
|
||||
@ -68,7 +68,7 @@ void MathDelimInset::metrics(MathMetricsInfo const & mi) const
|
||||
|
||||
|
||||
void MathDelimInset::draw(Painter & pain, int x, int y) const
|
||||
{
|
||||
{
|
||||
int const w = dw();
|
||||
int const b = y - ascent_;
|
||||
xcell(0).draw(pain, x + w + 4, y);
|
||||
@ -101,7 +101,7 @@ void MathDelimInset::maplize(MapleStream & os) const
|
||||
bool mat =
|
||||
cell(0).size() == 1 && cell(0).begin()->nucleus()
|
||||
&& cell(0).begin()->nucleus()->asMatrixInset();
|
||||
if (mat)
|
||||
if (mat)
|
||||
os << "linalg[det](" << cell(0) << ")";
|
||||
else
|
||||
os << "abs(" << cell(0) << ")";
|
||||
|
@ -39,7 +39,7 @@ void MathDiffInset::metrics(MathMetricsInfo const &) const
|
||||
|
||||
|
||||
void MathDiffInset::draw(Painter &, int, int) const
|
||||
{
|
||||
{
|
||||
lyxerr << "should not happen\n";
|
||||
}
|
||||
|
||||
@ -72,4 +72,3 @@ void MathDiffInset::write(WriteStream &) const
|
||||
{
|
||||
lyxerr << "should not happen\n";
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
#include "math_diminset.h"
|
||||
#include "Lsstream.h"
|
||||
#include "textpainter.h"
|
||||
|
@ -10,9 +10,9 @@ class MathDimInset : public MathInset {
|
||||
public:
|
||||
/// not sure whether the initialization is really necessary
|
||||
MathDimInset() : width_(0), ascent_(0), descent_(0) {}
|
||||
/// read ascent value (should be inline according to gprof)
|
||||
/// read ascent value (should be inline according to gprof)
|
||||
int ascent() const { return ascent_; }
|
||||
/// read descent
|
||||
/// read descent
|
||||
int descent() const { return descent_; }
|
||||
/// read width
|
||||
int width() const { return width_; }
|
||||
|
@ -18,7 +18,7 @@ MathDotsInset::MathDotsInset(string const & name)
|
||||
MathInset * MathDotsInset::clone() const
|
||||
{
|
||||
return new MathDotsInset(*this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void MathDotsInset::metrics(MathMetricsInfo const & mi) const
|
||||
@ -32,7 +32,7 @@ void MathDotsInset::metrics(MathMetricsInfo const & mi) const
|
||||
case 'v': width_ /= 2;
|
||||
case 'd': dh_ = ascent_; break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void MathDotsInset::draw(Painter & pain, int x, int y) const
|
||||
|
@ -29,5 +29,5 @@ protected:
|
||||
mutable int dh_;
|
||||
///
|
||||
string const name_;
|
||||
};
|
||||
};
|
||||
#endif
|
||||
|
@ -25,7 +25,7 @@ void MathExFuncInset::metrics(MathMetricsInfo const & mi) const
|
||||
|
||||
|
||||
void MathExFuncInset::draw(Painter & pain, int x, int y) const
|
||||
{
|
||||
{
|
||||
drawStr(pain, font_, x, y, name_);
|
||||
}
|
||||
|
||||
@ -58,5 +58,3 @@ void MathExFuncInset::write(WriteStream & os) const
|
||||
{
|
||||
os << '\\' << name_ << '{' << cell(0) << '}';
|
||||
}
|
||||
|
||||
|
||||
|
@ -44,7 +44,7 @@ bool MathExIntInset::hasScripts() const
|
||||
|
||||
void MathExIntInset::normalize(NormalStream & os) const
|
||||
{
|
||||
os << '[' << symbol_ << ' ' << cell(0) << ' ' << cell(1) << ' '
|
||||
os << '[' << symbol_ << ' ' << cell(0) << ' ' << cell(1) << ' '
|
||||
<< cell(2) << ' ' << cell(3) << ']';
|
||||
}
|
||||
|
||||
@ -56,7 +56,7 @@ void MathExIntInset::metrics(MathMetricsInfo const &) const
|
||||
|
||||
|
||||
void MathExIntInset::draw(Painter &, int, int) const
|
||||
{
|
||||
{
|
||||
lyxerr << "should not happen" << endl;
|
||||
}
|
||||
|
||||
@ -66,7 +66,7 @@ void MathExIntInset::maplize(MapleStream & os) const
|
||||
os << symbol_ << '(';
|
||||
if (cell(0).size())
|
||||
os << cell(0);
|
||||
else
|
||||
else
|
||||
os << '1';
|
||||
os << ',' << cell(1);
|
||||
if (hasScripts())
|
||||
@ -80,7 +80,7 @@ void MathExIntInset::mathmlize(MathMLStream & os) const
|
||||
boost::scoped_ptr<MathSymbolInset> sym(new MathSymbolInset(symbol_));
|
||||
//if (hasScripts())
|
||||
// mathmlize(sym, os);
|
||||
//else
|
||||
//else
|
||||
sym->mathmlize(os);
|
||||
os << cell(0) << "<mo> ⁢ </mo>"
|
||||
<< MTag("mrow") << "<mo> ⅆ </mo>"
|
||||
@ -92,4 +92,3 @@ void MathExIntInset::write(WriteStream &) const
|
||||
{
|
||||
lyxerr << "should not happen" << endl;
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
// This file contains most of the magic that extracts "context
|
||||
// information" from the unstructered layout-oriented stuff in an
|
||||
// MathArray.
|
||||
@ -28,7 +27,7 @@ using std::find_if;
|
||||
|
||||
ostream & operator<<(ostream & os, MathArray const & ar)
|
||||
{
|
||||
NormalStream ns(os);
|
||||
NormalStream ns(os);
|
||||
ns << ar;
|
||||
return os;
|
||||
}
|
||||
@ -42,7 +41,7 @@ typedef MathInset * ReplaceArgumentFunc(const MathArray & ar);
|
||||
|
||||
|
||||
|
||||
// try to extract a super/subscript
|
||||
// try to extract a super/subscript
|
||||
// modify iterator position to point behind the thing
|
||||
bool extractScript(MathArray & ar,
|
||||
MathArray::iterator & pos, MathArray::iterator last)
|
||||
@ -260,13 +259,13 @@ void replaceNested(
|
||||
ar.erase(it + 1, jt + 1);
|
||||
(*it).reset(p);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//
|
||||
// split scripts into seperate super- and subscript insets. sub goes in
|
||||
// front of super...
|
||||
// front of super...
|
||||
//
|
||||
|
||||
void splitScripts(MathArray & ar)
|
||||
@ -286,13 +285,13 @@ void splitScripts(MathArray & ar)
|
||||
|
||||
// create extra script inset and move superscript over
|
||||
MathScriptInset * q = new MathScriptInset;
|
||||
q->ensure(true);
|
||||
q->ensure(true);
|
||||
q->up().data_.swap(p->up().data_);
|
||||
p->removeScript(true);
|
||||
|
||||
// insert new inset behind
|
||||
++i;
|
||||
ar.insert(i, MathAtom(q));
|
||||
ar.insert(i, MathAtom(q));
|
||||
}
|
||||
//lyxerr << "\nScripts to: " << ar << "\n";
|
||||
}
|
||||
@ -385,10 +384,10 @@ void extractFunctions(MathArray & ar)
|
||||
|
||||
string name;
|
||||
// is it a function?
|
||||
if ((*it)->asFuncInset()) {
|
||||
if ((*it)->asFuncInset()) {
|
||||
// it certainly is if it is well known...
|
||||
name = (*it)->asFuncInset()->name();
|
||||
} else {
|
||||
} else {
|
||||
// is this a user defined function?
|
||||
// it it probably not, if it doesn't have a name.
|
||||
if (!extractString((*it).nucleus(), name))
|
||||
@ -408,7 +407,7 @@ void extractFunctions(MathArray & ar)
|
||||
// 'sin' '^2' 'x' -> 'sin(x)' '^2'
|
||||
MathArray exp;
|
||||
extractScript(exp, jt, ar.end());
|
||||
|
||||
|
||||
// create a proper inset as replacement
|
||||
MathExFuncInset * p = new MathExFuncInset(name);
|
||||
|
||||
@ -417,7 +416,7 @@ void extractFunctions(MathArray & ar)
|
||||
|
||||
// replace the function name by a real function inset
|
||||
(*it).reset(p);
|
||||
|
||||
|
||||
// remove the source of the argument from the array
|
||||
ar.erase(it + 1, st);
|
||||
|
||||
@ -425,7 +424,7 @@ void extractFunctions(MathArray & ar)
|
||||
ar.insert(i + 1, exp);
|
||||
//lyxerr << "\nFunctions to: " << ar << "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
@ -480,7 +479,7 @@ void extractIntegrals(MathArray & ar)
|
||||
// collect subscript if any
|
||||
MathArray::iterator st = it + 1;
|
||||
if (st != ar.end())
|
||||
if (MathScriptInset * sub = (*st)->asScriptInset())
|
||||
if (MathScriptInset * sub = (*st)->asScriptInset())
|
||||
if (sub->hasDown()) {
|
||||
p->cell(2) = sub->down().data_;
|
||||
++st;
|
||||
@ -488,7 +487,7 @@ void extractIntegrals(MathArray & ar)
|
||||
|
||||
// collect superscript if any
|
||||
if (st != ar.end())
|
||||
if (MathScriptInset * sup = (*st)->asScriptInset())
|
||||
if (MathScriptInset * sup = (*st)->asScriptInset())
|
||||
if (sup->hasUp()) {
|
||||
p->cell(3) = sup->up().data_;
|
||||
++st;
|
||||
@ -499,7 +498,7 @@ void extractIntegrals(MathArray & ar)
|
||||
|
||||
// use the "thing" behind the 'd' as differential
|
||||
MathArray::iterator tt = extractArgument(p->cell(1), jt + 1, ar.end());
|
||||
|
||||
|
||||
// remove used parts
|
||||
ar.erase(it + 1, tt);
|
||||
(*it).reset(p);
|
||||
@ -632,7 +631,7 @@ void extractDiff(MathArray & ar)
|
||||
// is this a "differential fraction"?
|
||||
if (!testDiffFrac(it->nucleus()))
|
||||
continue;
|
||||
|
||||
|
||||
MathFracInset * f = (*it)->asFracInset();
|
||||
if (!f) {
|
||||
lyxerr << "should not happen\n";
|
||||
@ -643,20 +642,20 @@ void extractDiff(MathArray & ar)
|
||||
MathDiffInset * diff = new MathDiffInset;
|
||||
|
||||
// collect function, let jt point behind last used item
|
||||
MathArray::iterator jt = it + 1;
|
||||
//int n = 1;
|
||||
MathArray::iterator jt = it + 1;
|
||||
//int n = 1;
|
||||
MathArray & numer = f->cell(0);
|
||||
if (numer.size() > 1 && numer.at(1)->asScriptInset()) {
|
||||
// this is something like d^n f(x) / d... or d^n / d...
|
||||
// FIXME
|
||||
//n = 1;
|
||||
if (numer.size() > 2)
|
||||
//n = 1;
|
||||
if (numer.size() > 2)
|
||||
diff->cell(0) = MathArray(numer.begin() + 2, numer.end());
|
||||
else
|
||||
jt = extractArgument(diff->cell(0), jt, ar.end());
|
||||
} else {
|
||||
// simply d f(x) / d... or d/d...
|
||||
if (numer.size() > 1)
|
||||
if (numer.size() > 1)
|
||||
diff->cell(0) = MathArray(numer.begin() + 1, numer.end());
|
||||
else
|
||||
jt = extractArgument(diff->cell(0), jt, ar.end());
|
||||
@ -725,7 +724,7 @@ void write(MathArray const & dat, WriteStream & wi)
|
||||
q->write2(p, wi);
|
||||
++it;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
p->write(wi);
|
||||
}
|
||||
@ -748,7 +747,7 @@ void octavize(MathArray const & dat, OctaveStream & os)
|
||||
if (it + 1 != ar.end()) {
|
||||
if (MathScriptInset const * q = asScript(it)) {
|
||||
q->octavize2(p, os);
|
||||
++it;
|
||||
++it;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@ -766,7 +765,7 @@ void maplize(MathArray const & dat, MapleStream & os)
|
||||
if (it + 1 != ar.end()) {
|
||||
if (MathScriptInset const * q = asScript(it)) {
|
||||
q->maplize2(p, os);
|
||||
++it;
|
||||
++it;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@ -790,7 +789,7 @@ void mathmlize(MathArray const & dat, MathMLStream & os)
|
||||
if (it + 1 != ar.end()) {
|
||||
if (MathScriptInset const * q = asScript(it)) {
|
||||
q->mathmlize2(p, os);
|
||||
++it;
|
||||
++it;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
@ -799,4 +798,3 @@ void mathmlize(MathArray const & dat, MathMLStream & os)
|
||||
os << ETag("mrow");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -52,7 +52,7 @@ MathAtom createMathInset(latexkeys const * l)
|
||||
return MathAtom(new MathStackrelInset);
|
||||
case LM_TK_UNDERSET:
|
||||
return MathAtom(new MathUndersetInset);
|
||||
case LM_TK_KERN:
|
||||
case LM_TK_KERN:
|
||||
return MathAtom(new MathKernInset);
|
||||
case LM_TK_BINOM:
|
||||
case LM_TK_CHOOSE:
|
||||
@ -117,14 +117,14 @@ MathAtom createMathInset(string const & s)
|
||||
return MathAtom(new MathArrayInset(s, 1, 1));
|
||||
|
||||
if (s == "pmatrix" || s == "bmatrix" || s == "vmatrix" || s == "Vmatrix" ||
|
||||
s == "matrix")
|
||||
s == "matrix")
|
||||
return MathAtom(new MathAMSArrayInset(s));
|
||||
|
||||
latexkeys const * l = in_word_set(s);
|
||||
if (l)
|
||||
return createMathInset(l);
|
||||
|
||||
if (MathMacroTable::has(s))
|
||||
if (MathMacroTable::has(s))
|
||||
return MathAtom(new MathMacro(s));
|
||||
|
||||
//cerr << "creating inset 2 with name: '" << s << "'\n";
|
||||
|
@ -12,7 +12,7 @@ class MathFracbaseInset : public MathNestInset {
|
||||
public:
|
||||
///
|
||||
MathFracbaseInset();
|
||||
///
|
||||
///
|
||||
bool idxUpDown(idx_type &, bool up) const;
|
||||
///
|
||||
bool idxLeft(idx_type &, pos_type &) const;
|
||||
|
@ -18,7 +18,7 @@ MathFracInset::MathFracInset(bool atop)
|
||||
|
||||
|
||||
MathInset * MathFracInset::clone() const
|
||||
{
|
||||
{
|
||||
return new MathFracInset(*this);
|
||||
}
|
||||
|
||||
@ -35,9 +35,9 @@ void MathFracInset::metrics(MathMetricsInfo const & mi) const
|
||||
smallerStyleFrac(m);
|
||||
xcell(0).metrics(m);
|
||||
xcell(1).metrics(m);
|
||||
width_ = max(xcell(0).width(), xcell(1).width()) + 2;
|
||||
width_ = max(xcell(0).width(), xcell(1).width()) + 2;
|
||||
ascent_ = xcell(0).height() + 2 + 5;
|
||||
descent_ = xcell(1).height() + 2 - 5;
|
||||
descent_ = xcell(1).height() + 2 - 5;
|
||||
}
|
||||
|
||||
|
||||
@ -82,7 +82,7 @@ void MathFracInset::write(WriteStream & os) const
|
||||
|
||||
void MathFracInset::normalize(NormalStream & os) const
|
||||
{
|
||||
if (atop_)
|
||||
if (atop_)
|
||||
os << "[atop ";
|
||||
else
|
||||
os << "[frac ";
|
||||
|
@ -38,7 +38,7 @@ void MathFuncInset::setName(string const & n)
|
||||
}
|
||||
|
||||
|
||||
void MathFuncInset::metrics(MathMetricsInfo const & mi) const
|
||||
void MathFuncInset::metrics(MathMetricsInfo const & mi) const
|
||||
{
|
||||
whichFont(font_, LM_TC_TEXTRM, mi);
|
||||
mathed_string_dim(font_, name_, ascent_, descent_, width_);
|
||||
@ -46,7 +46,7 @@ void MathFuncInset::metrics(MathMetricsInfo const & mi) const
|
||||
|
||||
|
||||
void MathFuncInset::draw(Painter & pain, int x, int y) const
|
||||
{
|
||||
{
|
||||
drawStr(pain, font_, x, y, name_);
|
||||
}
|
||||
|
||||
|
@ -44,6 +44,6 @@ void MathFuncLimInset::metrics(MathMetricsInfo const & mi) const
|
||||
|
||||
|
||||
void MathFuncLimInset::draw(Painter & pain, int x, int y) const
|
||||
{
|
||||
{
|
||||
drawStr(pain, font_, x, y, name_);
|
||||
}
|
||||
|
@ -29,7 +29,7 @@ string verboseHLine(int n)
|
||||
}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
MathGridInset::RowInfo::RowInfo()
|
||||
@ -48,7 +48,7 @@ int MathGridInset::RowInfo::skipPixels() const
|
||||
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
MathGridInset::ColInfo::ColInfo()
|
||||
@ -56,14 +56,14 @@ MathGridInset::ColInfo::ColInfo()
|
||||
{}
|
||||
|
||||
|
||||
//////////////////////////////////////////////////////////////
|
||||
//////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
MathGridInset::MathGridInset(char v, string const & h)
|
||||
: MathNestInset(guessColumns(h)), rowinfo_(2), colinfo_(guessColumns(h) + 1)
|
||||
{
|
||||
setDefaults();
|
||||
valign(v);
|
||||
valign(v);
|
||||
halign(h);
|
||||
}
|
||||
|
||||
@ -79,7 +79,7 @@ MathGridInset::MathGridInset(col_type m, row_type n, char v, string const & h)
|
||||
: MathNestInset(m * n), rowinfo_(n + 1), colinfo_(m + 1), v_align_(v)
|
||||
{
|
||||
setDefaults();
|
||||
valign(v);
|
||||
valign(v);
|
||||
halign(h);
|
||||
}
|
||||
|
||||
@ -124,7 +124,7 @@ void MathGridInset::halign(string const & hh)
|
||||
lyxerr << "unkown column separator: '" << c << "'\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
col_type n = hh.size();
|
||||
if (n > ncols())
|
||||
@ -163,7 +163,7 @@ string MathGridInset::halign() const
|
||||
for (col_type col = 0; col < ncols(); ++col) {
|
||||
res += string(colinfo_[col].lines_, '|');
|
||||
res += colinfo_[col].align_;
|
||||
}
|
||||
}
|
||||
return res + string(colinfo_[ncols()].lines_, '|');
|
||||
}
|
||||
|
||||
@ -240,7 +240,7 @@ void MathGridInset::metrics(MathMetricsInfo const & mi) const
|
||||
// compute vertical offsets
|
||||
rowinfo_[0].offset_ = 0;
|
||||
for (row_type row = 1; row <= nrows(); ++row) {
|
||||
rowinfo_[row].offset_ =
|
||||
rowinfo_[row].offset_ =
|
||||
rowinfo_[row - 1].offset_ +
|
||||
rowinfo_[row - 1].descent_ +
|
||||
rowinfo_[row - 1].skipPixels() +
|
||||
@ -263,12 +263,12 @@ void MathGridInset::metrics(MathMetricsInfo const & mi) const
|
||||
}
|
||||
for (row_type row = 0; row <= nrows(); ++row)
|
||||
rowinfo_[row].offset_ -= h;
|
||||
|
||||
|
||||
|
||||
// compute absolute sizes of horizontal structure
|
||||
for (col_type col = 0; col < ncols(); ++col) {
|
||||
int wid = 0;
|
||||
for (row_type row = 0; row < nrows(); ++row)
|
||||
for (row_type row = 0; row < nrows(); ++row)
|
||||
wid = max(wid, xcell(index(row, col)).width());
|
||||
colinfo_[col].width_ = wid;
|
||||
}
|
||||
@ -279,30 +279,30 @@ void MathGridInset::metrics(MathMetricsInfo const & mi) const
|
||||
for (col_type col = 1; col <= ncols(); ++col) {
|
||||
colinfo_[col].offset_ =
|
||||
colinfo_[col - 1].offset_ +
|
||||
colinfo_[col - 1].width_ +
|
||||
colinfo_[col - 1].width_ +
|
||||
colinfo_[col - 1].skip_ +
|
||||
colsep() +
|
||||
colsep() +
|
||||
colinfo_[col].lines_ * vlinesep();
|
||||
}
|
||||
|
||||
|
||||
width_ = colinfo_[ncols() - 1].offset_
|
||||
+ colinfo_[ncols() - 1].width_
|
||||
+ vlinesep() * colinfo_[ncols()].lines_
|
||||
+ border();
|
||||
width_ = colinfo_[ncols() - 1].offset_
|
||||
+ colinfo_[ncols() - 1].width_
|
||||
+ vlinesep() * colinfo_[ncols()].lines_
|
||||
+ border();
|
||||
|
||||
ascent_ = - rowinfo_[0].offset_
|
||||
+ rowinfo_[0].ascent_
|
||||
+ hlinesep() * rowinfo_[0].lines_
|
||||
+ border();
|
||||
ascent_ = - rowinfo_[0].offset_
|
||||
+ rowinfo_[0].ascent_
|
||||
+ hlinesep() * rowinfo_[0].lines_
|
||||
+ border();
|
||||
|
||||
descent_ = rowinfo_[nrows() - 1].offset_
|
||||
+ rowinfo_[nrows() - 1].descent_
|
||||
+ hlinesep() * rowinfo_[nrows()].lines_
|
||||
+ border();
|
||||
+ rowinfo_[nrows() - 1].descent_
|
||||
+ hlinesep() * rowinfo_[nrows()].lines_
|
||||
+ border();
|
||||
|
||||
|
||||
/*
|
||||
/*
|
||||
// Increase ws_[i] for 'R' columns (except the first one)
|
||||
for (int i = 1; i < nc_; ++i)
|
||||
if (align_[i] == 'R')
|
||||
@ -311,10 +311,10 @@ void MathGridInset::metrics(MathMetricsInfo const & mi) const
|
||||
if (align_[0] == 'C')
|
||||
if (ws_[0] < 7 * workwidth / 8)
|
||||
ws_[0] = 7 * workwidth / 8;
|
||||
|
||||
|
||||
// Adjust local tabs
|
||||
width = colsep();
|
||||
for (cxrow = row_.begin(); cxrow; ++cxrow) {
|
||||
for (cxrow = row_.begin(); cxrow; ++cxrow) {
|
||||
int rg = COLSEP;
|
||||
int lf = 0;
|
||||
for (int i = 0; i < nc_; ++i) {
|
||||
@ -328,7 +328,7 @@ void MathGridInset::metrics(MathMetricsInfo const & mi) const
|
||||
lf = 0;
|
||||
break;
|
||||
case 'c':
|
||||
lf = (ws_[i] - cxrow->getTab(i))/2;
|
||||
lf = (ws_[i] - cxrow->getTab(i))/2;
|
||||
break;
|
||||
case 'r':
|
||||
case 'R':
|
||||
@ -340,7 +340,7 @@ void MathGridInset::metrics(MathMetricsInfo const & mi) const
|
||||
else if (cxrow.is_last())
|
||||
lf = ws_[i] - cxrow->getTab(i);
|
||||
else
|
||||
lf = (ws_[i] - cxrow->getTab(i))/2;
|
||||
lf = (ws_[i] - cxrow->getTab(i))/2;
|
||||
break;
|
||||
}
|
||||
int const ww = (isvoid) ? lf : lf + cxrow->getTab(i);
|
||||
@ -380,7 +380,7 @@ void MathGridInset::metricsT(TextMetricsInfo const & mi) const
|
||||
{
|
||||
// let the cells adjust themselves
|
||||
//MathNestInset::metrics(mi);
|
||||
for (idx_type i = 0; i < nargs(); ++i)
|
||||
for (idx_type i = 0; i < nargs(); ++i)
|
||||
xcell(i).metricsT(mi);
|
||||
|
||||
// compute absolute sizes of vertical structure
|
||||
@ -402,7 +402,7 @@ void MathGridInset::metricsT(TextMetricsInfo const & mi) const
|
||||
// compute vertical offsets
|
||||
rowinfo_[0].offset_ = 0;
|
||||
for (row_type row = 1; row <= nrows(); ++row) {
|
||||
rowinfo_[row].offset_ =
|
||||
rowinfo_[row].offset_ =
|
||||
rowinfo_[row - 1].offset_ +
|
||||
rowinfo_[row - 1].descent_ +
|
||||
//rowinfo_[row - 1].skipPixels() +
|
||||
@ -425,12 +425,12 @@ void MathGridInset::metricsT(TextMetricsInfo const & mi) const
|
||||
}
|
||||
for (row_type row = 0; row <= nrows(); ++row)
|
||||
rowinfo_[row].offset_ -= h;
|
||||
|
||||
|
||||
|
||||
// compute absolute sizes of horizontal structure
|
||||
for (col_type col = 0; col < ncols(); ++col) {
|
||||
int wid = 0;
|
||||
for (row_type row = 0; row < nrows(); ++row)
|
||||
for (row_type row = 0; row < nrows(); ++row)
|
||||
wid = max(wid, xcell(index(row, col)).width());
|
||||
colinfo_[col].width_ = wid;
|
||||
}
|
||||
@ -441,27 +441,27 @@ void MathGridInset::metricsT(TextMetricsInfo const & mi) const
|
||||
for (col_type col = 1; col <= ncols(); ++col) {
|
||||
colinfo_[col].offset_ =
|
||||
colinfo_[col - 1].offset_ +
|
||||
colinfo_[col - 1].width_ +
|
||||
colinfo_[col - 1].width_ +
|
||||
colinfo_[col - 1].skip_ +
|
||||
1 ; //colsep() +
|
||||
1 ; //colsep() +
|
||||
//colinfo_[col].lines_ * vlinesep();
|
||||
}
|
||||
|
||||
|
||||
width_ = colinfo_[ncols() - 1].offset_
|
||||
+ colinfo_[ncols() - 1].width_
|
||||
//+ vlinesep() * colinfo_[ncols()].lines_
|
||||
+ 2;
|
||||
width_ = colinfo_[ncols() - 1].offset_
|
||||
+ colinfo_[ncols() - 1].width_
|
||||
//+ vlinesep() * colinfo_[ncols()].lines_
|
||||
+ 2;
|
||||
|
||||
ascent_ = - rowinfo_[0].offset_
|
||||
+ rowinfo_[0].ascent_
|
||||
//+ hlinesep() * rowinfo_[0].lines_
|
||||
+ 1;
|
||||
ascent_ = - rowinfo_[0].offset_
|
||||
+ rowinfo_[0].ascent_
|
||||
//+ hlinesep() * rowinfo_[0].lines_
|
||||
+ 1;
|
||||
|
||||
descent_ = rowinfo_[nrows() - 1].offset_
|
||||
+ rowinfo_[nrows() - 1].descent_
|
||||
//+ hlinesep() * rowinfo_[nrows()].lines_
|
||||
+ 1;
|
||||
+ rowinfo_[nrows() - 1].descent_
|
||||
//+ hlinesep() * rowinfo_[nrows()].lines_
|
||||
+ 1;
|
||||
|
||||
}
|
||||
|
||||
@ -525,7 +525,7 @@ void MathGridInset::delRow(row_type row)
|
||||
if (nrows() == 1)
|
||||
return;
|
||||
|
||||
cells_type::iterator it = cells_.begin() + row * ncols();
|
||||
cells_type::iterator it = cells_.begin() + row * ncols();
|
||||
cells_.erase(it, it + ncols());
|
||||
|
||||
rowinfo_.erase(rowinfo_.begin() + row);
|
||||
@ -537,7 +537,7 @@ void MathGridInset::addCol(col_type newcol)
|
||||
const col_type nc = ncols();
|
||||
const row_type nr = nrows();
|
||||
cells_type new_cells((nc + 1) * nr);
|
||||
|
||||
|
||||
for (row_type row = 0; row < nr; ++row)
|
||||
for (col_type col = 0; col < nc; ++col)
|
||||
new_cells[row * (nc + 1) + col + (col > newcol)]
|
||||
@ -557,7 +557,7 @@ void MathGridInset::delCol(col_type col)
|
||||
return;
|
||||
|
||||
cells_type tmpcells;
|
||||
for (col_type i = 0; i < nargs(); ++i)
|
||||
for (col_type i = 0; i < nargs(); ++i)
|
||||
if (i % ncols() != col)
|
||||
tmpcells.push_back(cells_[i]);
|
||||
swap(cells_, tmpcells);
|
||||
@ -572,9 +572,9 @@ int MathGridInset::cellXOffset(idx_type idx) const
|
||||
int x = colinfo_[c].offset_;
|
||||
char align = colinfo_[c].align_;
|
||||
if (align == 'r' || align == 'R')
|
||||
x += colinfo_[c].width_ - xcell(idx).width();
|
||||
x += colinfo_[c].width_ - xcell(idx).width();
|
||||
if (align == 'c' || align == 'C')
|
||||
x += (colinfo_[c].width_ - xcell(idx).width()) / 2;
|
||||
x += (colinfo_[c].width_ - xcell(idx).width()) / 2;
|
||||
return x;
|
||||
}
|
||||
|
||||
@ -600,7 +600,7 @@ bool MathGridInset::idxUpDown(idx_type & idx, bool up) const
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool MathGridInset::idxLeft(idx_type & idx, pos_type & pos) const
|
||||
{
|
||||
// leave matrix if on the left hand edge
|
||||
@ -610,8 +610,8 @@ bool MathGridInset::idxLeft(idx_type & idx, pos_type & pos) const
|
||||
pos = cell(idx).size();
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
bool MathGridInset::idxRight(idx_type & idx, pos_type & pos) const
|
||||
{
|
||||
// leave matrix if on the right hand edge
|
||||
@ -632,7 +632,7 @@ bool MathGridInset::idxFirst(idx_type & idx, pos_type & pos) const
|
||||
case 'b':
|
||||
idx = (nrows() - 1) * ncols();
|
||||
break;
|
||||
default:
|
||||
default:
|
||||
idx = ((nrows() - 1) / 2) * ncols();
|
||||
}
|
||||
pos = 0;
|
||||
@ -714,14 +714,14 @@ void MathGridInset::idxDelete(idx_type & idx, bool & popit, bool & deleteit)
|
||||
// move cells if necessary
|
||||
for (idx_type i = index(row(idx), 0); i < idx; ++i)
|
||||
cell(i).swap(cell(i + ncols()));
|
||||
|
||||
|
||||
delRow(row(idx));
|
||||
|
||||
if (idx >= nargs())
|
||||
idx = nargs() - 1;
|
||||
|
||||
// undo effect of Ctrl-Tab (i.e. pull next cell)
|
||||
//if (idx + 1 != nargs())
|
||||
//if (idx + 1 != nargs())
|
||||
// cell(idx).swap(cell(idx + 1));
|
||||
}
|
||||
|
||||
@ -772,7 +772,7 @@ void MathGridInset::mathmlize(MathMLStream & os) const
|
||||
os << MTag("mtable");
|
||||
for (row_type row = 0; row < nrows(); ++row) {
|
||||
os << MTag("mtr");
|
||||
for (col_type col = 0; col < ncols(); ++col)
|
||||
for (col_type col = 0; col < ncols(); ++col)
|
||||
os << cell(index(row, col));
|
||||
os << ETag("mtr");
|
||||
}
|
||||
@ -784,7 +784,7 @@ void MathGridInset::write(WriteStream & os) const
|
||||
{
|
||||
for (row_type row = 0; row < nrows(); ++row) {
|
||||
os << verboseHLine(rowinfo_[row].lines_);
|
||||
for (col_type col = 0; col < ncols(); ++col)
|
||||
for (col_type col = 0; col < ncols(); ++col)
|
||||
os << cell(index(row, col)) << eocString(col);
|
||||
os << eolString(row);
|
||||
}
|
||||
|
@ -40,7 +40,7 @@ class MathGridInset : public MathNestInset {
|
||||
|
||||
// additional per-row information
|
||||
struct ColInfo {
|
||||
///
|
||||
///
|
||||
ColInfo();
|
||||
/// currently possible: 'l', 'c', 'r'
|
||||
char align_;
|
||||
@ -50,7 +50,7 @@ class MathGridInset : public MathNestInset {
|
||||
mutable int width_;
|
||||
/// cached offset
|
||||
mutable int offset_;
|
||||
/// do we need a line to the left?
|
||||
/// do we need a line to the left?
|
||||
bool leftline_;
|
||||
/// do we need a line to the right?
|
||||
bool rightline_;
|
||||
@ -60,7 +60,7 @@ class MathGridInset : public MathNestInset {
|
||||
int skip_;
|
||||
};
|
||||
|
||||
public:
|
||||
public:
|
||||
/// constructor from columns description, creates one row
|
||||
MathGridInset(char valign, string const & halign);
|
||||
/// Note: columns first!
|
||||
@ -131,7 +131,7 @@ public:
|
||||
bool idxEnd(idx_type &, pos_type &) const;
|
||||
///
|
||||
void idxDelete(idx_type &, bool &, bool &);
|
||||
|
||||
|
||||
///
|
||||
virtual void addRow(row_type);
|
||||
///
|
||||
@ -187,7 +187,7 @@ protected:
|
||||
std::vector<RowInfo> rowinfo_;
|
||||
/// column info
|
||||
std::vector<ColInfo> colinfo_;
|
||||
///
|
||||
///
|
||||
char v_align_; // add approp. type
|
||||
};
|
||||
|
||||
|
@ -27,7 +27,7 @@ struct key_type {
|
||||
};
|
||||
|
||||
|
||||
key_type wordlist_array[] =
|
||||
key_type wordlist_array[] =
|
||||
{
|
||||
{"!", LM_TK_SPACE, 0},
|
||||
{"#", LM_TK_SPECIAL, '#'},
|
||||
|
@ -65,7 +65,7 @@ namespace {
|
||||
if (s == "multline") return LM_OT_MULTLINE;
|
||||
if (s == "gather") return LM_OT_GATHER;
|
||||
return LM_OT_SIMPLE;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
string normalName(MathInsetTypes t)
|
||||
@ -83,7 +83,7 @@ namespace {
|
||||
default: break;
|
||||
}
|
||||
return "unknown";
|
||||
}
|
||||
}
|
||||
|
||||
} // end anon namespace
|
||||
|
||||
@ -165,7 +165,7 @@ void MathHullInset::metrics(MathMetricsInfo const & mi) const
|
||||
if (display()) {
|
||||
ascent_ += 12;
|
||||
descent_ += 12;
|
||||
}
|
||||
}
|
||||
|
||||
if (numberedType()) {
|
||||
whichFont(mi_.font, LM_TC_BF, mi_);
|
||||
@ -226,13 +226,13 @@ string MathHullInset::label(row_type row) const
|
||||
|
||||
void MathHullInset::label(row_type row, string const & label)
|
||||
{
|
||||
label_[row] = label;
|
||||
label_[row] = label;
|
||||
}
|
||||
|
||||
|
||||
void MathHullInset::numbered(row_type row, bool num)
|
||||
{
|
||||
nonum_[row] = !num;
|
||||
nonum_[row] = !num;
|
||||
}
|
||||
|
||||
|
||||
@ -246,7 +246,7 @@ bool MathHullInset::ams() const
|
||||
{
|
||||
return true;
|
||||
/*
|
||||
return
|
||||
return
|
||||
objtype_ == LM_OT_ALIGN ||
|
||||
objtype_ == LM_OT_MULTLINE ||
|
||||
objtype_ == LM_OT_GATHER ||
|
||||
@ -315,9 +315,9 @@ void MathHullInset::header_write(WriteStream & os) const
|
||||
|
||||
case LM_OT_EQUATION:
|
||||
if (n)
|
||||
os << "\\begin{equation" << star(n) << "}\n";
|
||||
os << "\\begin{equation" << star(n) << "}\n";
|
||||
else
|
||||
os << "\\[\n";
|
||||
os << "\\[\n";
|
||||
break;
|
||||
|
||||
case LM_OT_EQNARRAY:
|
||||
@ -339,7 +339,7 @@ void MathHullInset::header_write(WriteStream & os) const
|
||||
break;
|
||||
|
||||
case LM_OT_XXALIGNAT:
|
||||
os << "\\begin{xxalignat}"
|
||||
os << "\\begin{xxalignat}"
|
||||
<< "{" << static_cast<unsigned int>(ncols()/2) << "}\n";
|
||||
break;
|
||||
|
||||
@ -368,9 +368,9 @@ void MathHullInset::footer_write(WriteStream & os) const
|
||||
|
||||
case LM_OT_EQUATION:
|
||||
if (n)
|
||||
os << "\\end{equation" << star(n) << "}\n";
|
||||
os << "\\end{equation" << star(n) << "}\n";
|
||||
else
|
||||
os << "\\]\n";
|
||||
os << "\\]\n";
|
||||
break;
|
||||
|
||||
case LM_OT_EQNARRAY:
|
||||
@ -407,7 +407,7 @@ void MathHullInset::footer_write(WriteStream & os) const
|
||||
}
|
||||
|
||||
|
||||
void MathHullInset::addRow(row_type row)
|
||||
void MathHullInset::addRow(row_type row)
|
||||
{
|
||||
nonum_.insert(nonum_.begin() + row + 1, !numberedType());
|
||||
label_.insert(label_.begin() + row + 1, string());
|
||||
@ -423,7 +423,7 @@ void MathHullInset::appendRow()
|
||||
}
|
||||
|
||||
|
||||
void MathHullInset::delRow(row_type row)
|
||||
void MathHullInset::delRow(row_type row)
|
||||
{
|
||||
MathGridInset::delRow(row);
|
||||
nonum_.erase(nonum_.begin() + row);
|
||||
@ -541,7 +541,7 @@ void MathHullInset::mutate(MathInsetTypes newtype)
|
||||
setType(LM_OT_SIMPLE);
|
||||
break;
|
||||
|
||||
case LM_OT_ALIGN:
|
||||
case LM_OT_ALIGN:
|
||||
case LM_OT_ALIGNAT:
|
||||
case LM_OT_XALIGNAT:
|
||||
case LM_OT_XXALIGNAT: {
|
||||
@ -549,7 +549,7 @@ void MathHullInset::mutate(MathInsetTypes newtype)
|
||||
MathGridInset::addCol(1);
|
||||
|
||||
// split it "nicely"
|
||||
pos_type pos = firstRelOp(cell(0));
|
||||
pos_type pos = firstRelOp(cell(0));
|
||||
cell(1) = cell(0);
|
||||
cell(0).erase(pos, cell(0).size());
|
||||
cell(1).erase(0, pos);
|
||||
@ -564,7 +564,7 @@ void MathHullInset::mutate(MathInsetTypes newtype)
|
||||
MathGridInset::addCol(1);
|
||||
|
||||
// split it "nicely" on the firest relop
|
||||
pos_type pos = firstRelOp(cell(0));
|
||||
pos_type pos = firstRelOp(cell(0));
|
||||
cell(1) = MathArray(cell(0), pos, cell(0).size());
|
||||
cell(0).erase(pos, cell(0).size());
|
||||
|
||||
@ -633,7 +633,7 @@ void MathHullInset::mutate(MathInsetTypes newtype)
|
||||
setType(LM_OT_EQNARRAY);
|
||||
mutate(newtype);
|
||||
break;
|
||||
|
||||
|
||||
case LM_OT_ALIGNAT:
|
||||
case LM_OT_XALIGNAT:
|
||||
case LM_OT_XXALIGNAT:
|
||||
@ -684,11 +684,11 @@ void MathHullInset::mutate(MathInsetTypes newtype)
|
||||
void MathHullInset::write(WriteStream & os) const
|
||||
{
|
||||
header_write(os);
|
||||
|
||||
|
||||
bool n = numberedType();
|
||||
|
||||
|
||||
for (row_type row = 0; row < nrows(); ++row) {
|
||||
for (col_type col = 0; col < ncols(); ++col)
|
||||
for (col_type col = 0; col < ncols(); ++col)
|
||||
os << cell(index(row, col)) << eocString(col);
|
||||
if (n) {
|
||||
if (!label_[row].empty())
|
||||
@ -698,7 +698,7 @@ void MathHullInset::write(WriteStream & os) const
|
||||
}
|
||||
os << eolString(row);
|
||||
}
|
||||
|
||||
|
||||
footer_write(os);
|
||||
}
|
||||
|
||||
@ -722,5 +722,3 @@ void MathHullInset::check() const
|
||||
lyx::Assert(nonum_.size() == nrows());
|
||||
lyx::Assert(label_.size() == nrows());
|
||||
}
|
||||
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
||||
class LaTeXFeatures;
|
||||
|
||||
class MathHullInset : public MathGridInset {
|
||||
public:
|
||||
public:
|
||||
///
|
||||
MathHullInset();
|
||||
///
|
||||
|
@ -1,9 +1,9 @@
|
||||
/*
|
||||
* File: math_inset.C
|
||||
* Purpose: Implementation of insets for mathed
|
||||
* Author: Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
|
||||
* Author: Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
|
||||
* Created: January 1996
|
||||
* Description:
|
||||
* Description:
|
||||
*
|
||||
* Dependencies: Xlib, XForms
|
||||
*
|
||||
|
@ -1,8 +1,8 @@
|
||||
// -*- C++ -*-
|
||||
/*
|
||||
* File: math_inset.h
|
||||
* Purpose: Declaration of insets for mathed
|
||||
* Author: Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
|
||||
* Purpose: Declaration of insets for mathed
|
||||
* Author: Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
|
||||
* Created: January 1996
|
||||
* Description: Math paragraph and objects for a WYSIWYG math editor.
|
||||
*
|
||||
@ -35,7 +35,7 @@
|
||||
|
||||
Abstract base class for all math objects. A math insets is for use of the
|
||||
math editor only, it isn't a general LyX inset. It's used to represent all
|
||||
the math objects.
|
||||
the math objects.
|
||||
|
||||
Math insets do not know there parents, a cursor position or things
|
||||
like that. The are dumb object that are contained in other math insets
|
||||
@ -80,7 +80,7 @@ class MathPosFinder;
|
||||
|
||||
|
||||
class MathInset {
|
||||
public:
|
||||
public:
|
||||
/// short of anything else reasonable
|
||||
typedef MathArray::size_type size_type;
|
||||
/// type for cursor positions differences within a cell
|
||||
@ -163,7 +163,7 @@ public:
|
||||
virtual MathXArray & xcell(idx_type);
|
||||
/// return cell plus drawing cache given its number
|
||||
virtual MathXArray const & xcell(idx_type) const;
|
||||
|
||||
|
||||
/// the number of columns of this inset if it is grid-like
|
||||
virtual col_type ncols() const { return 1; }
|
||||
/// the number of rows of this inset if it is grid-like
|
||||
|
@ -1,4 +1,3 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include "math_iterator.h"
|
||||
@ -116,7 +115,7 @@ void MathIterator::operator++()
|
||||
|
||||
// otherwise leave array, move on one position
|
||||
// this might yield pos() == size(), but that's a ok.
|
||||
pop();
|
||||
pop();
|
||||
// it certainly invalidates top
|
||||
++position().pos_;
|
||||
}
|
||||
@ -135,7 +134,7 @@ bool operator==(MathIterator const & it, MathIterator const & jt)
|
||||
//lyxerr << "==: " << it.cursor().size() << " " << jt.cursor().size() << endl;
|
||||
if (it.cursor().size() != jt.cursor().size())
|
||||
return false;
|
||||
return it.cursor() == jt.cursor();
|
||||
return it.cursor() == jt.cursor();
|
||||
}
|
||||
|
||||
|
||||
@ -144,7 +143,7 @@ bool operator!=(MathIterator const & it, MathIterator const & jt)
|
||||
//lyxerr << "!=: " << it.cursor().size() << " " << jt.cursor().size() << endl;
|
||||
if (it.cursor().size() != jt.cursor().size())
|
||||
return true;
|
||||
return it.cursor() != jt.cursor();
|
||||
return it.cursor() != jt.cursor();
|
||||
}
|
||||
|
||||
|
||||
|
@ -37,7 +37,7 @@ public:
|
||||
/// read access to top most item
|
||||
MathArray const & cell() const;
|
||||
|
||||
private:
|
||||
private:
|
||||
/// own level down
|
||||
void push(MathInset *);
|
||||
/// own level up
|
||||
|
@ -59,4 +59,3 @@ void MathKernInset::normalize(NormalStream & os) const
|
||||
{
|
||||
os << "[kern " << wid_.asLatexString() << "]";
|
||||
}
|
||||
|
||||
|
@ -38,7 +38,7 @@ void MathLimitOpInset::metrics(MathMetricsInfo const &) const
|
||||
|
||||
|
||||
void MathLimitOpInset::draw(Painter &, int, int) const
|
||||
{
|
||||
{
|
||||
lyxerr << "should not happen\n";
|
||||
}
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* File: math_macro.C
|
||||
* Purpose: Implementation of macro class for mathed
|
||||
* Author: Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
|
||||
* Purpose: Implementation of macro class for mathed
|
||||
* Author: Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
|
||||
* Created: November 1996
|
||||
* Description: WYSIWYG math macros
|
||||
*
|
||||
@ -98,7 +98,7 @@ void MathMacro::metrics(MathMetricsInfo const & mi) const
|
||||
descent_ += max(c.descent(), ldes) + 5;
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
expanded_ = tmplate_->xcell(0);
|
||||
expanded_.data_.substitute(*this);
|
||||
@ -214,7 +214,7 @@ void MathMacro::octavize(OctaveStream & os) const
|
||||
void MathMacro::normalize(NormalStream & os) const
|
||||
{
|
||||
os << "[macro " << name() << " ";
|
||||
for (idx_type i = 0; i < nargs(); ++i)
|
||||
for (idx_type i = 0; i < nargs(); ++i)
|
||||
os << cell(i) << ' ';
|
||||
os << ']';
|
||||
}
|
||||
@ -225,7 +225,7 @@ void MathMacro::write(WriteStream & os) const
|
||||
os << '\\' << name();
|
||||
for (idx_type i = 0; i < nargs(); ++i)
|
||||
os << '{' << cell(i) << '}';
|
||||
if (nargs() == 0)
|
||||
if (nargs() == 0)
|
||||
os << ' ';
|
||||
}
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
// -*- C++ -*-
|
||||
/*
|
||||
* File: math_macro.h
|
||||
* Purpose: Declaration of macro class for mathed
|
||||
* Author: Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
|
||||
* Purpose: Declaration of macro class for mathed
|
||||
* Author: Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
|
||||
* Created: November 1996
|
||||
* Description: WYSIWYG math macros
|
||||
*
|
||||
|
@ -77,4 +77,3 @@ void MathMacroArgument::substitute(MathMacro const & m)
|
||||
it->nucleus()->handleFont(code_);
|
||||
expanded_ = true;
|
||||
}
|
||||
|
||||
|
@ -35,14 +35,14 @@ void MathMacroTable::dump()
|
||||
MathAtom & MathMacroTable::provide(string const & name)
|
||||
{
|
||||
builtinMacros();
|
||||
|
||||
|
||||
table_type::iterator pos = macro_table.find(name);
|
||||
|
||||
if (pos == macro_table.end()) {
|
||||
lyxerr << "MathMacroTable::provideTemplate: no template with name '"
|
||||
<< name << "' available.\n";
|
||||
}
|
||||
|
||||
|
||||
return pos->second;
|
||||
}
|
||||
|
||||
@ -75,9 +75,9 @@ bool MathMacroTable::has(string const & name)
|
||||
void MathMacroTable::builtinMacros()
|
||||
{
|
||||
static bool built = false;
|
||||
|
||||
|
||||
if (built)
|
||||
return;
|
||||
return;
|
||||
|
||||
built = true;
|
||||
//lyxerr[Debug::MATHED] << "Building macros\n";
|
||||
|
@ -14,7 +14,7 @@ class MathMacro;
|
||||
/** This class contains the macro definition
|
||||
\author Alejandro Aguilar Sierra
|
||||
*/
|
||||
//class MathMacroTemplate : public MathInset, boost::noncopyable
|
||||
//class MathMacroTemplate : public MathInset, boost::noncopyable
|
||||
|
||||
class MathMacroTemplate : public MathNestInset {
|
||||
public:
|
||||
|
@ -56,7 +56,7 @@ void MathMatrixInset::octavize(OctaveStream & os) const
|
||||
if (row)
|
||||
os << ';';
|
||||
os << '[';
|
||||
for (col_type col = 0; col < ncols(); ++col)
|
||||
for (col_type col = 0; col < ncols(); ++col)
|
||||
os << cell(index(row, col)) << ' ';
|
||||
os << ']';
|
||||
}
|
||||
|
@ -11,7 +11,7 @@
|
||||
// "shortcut" for DelimInset("(",ArrayInset,")")
|
||||
|
||||
class MathMatrixInset : public MathArrayInset {
|
||||
public:
|
||||
public:
|
||||
///
|
||||
MathMatrixInset(MathArrayInset const &);
|
||||
///
|
||||
|
@ -182,4 +182,3 @@ bool MathNestInset::editing() const
|
||||
{
|
||||
return mathcursor && mathcursor->isInside(this);
|
||||
}
|
||||
|
||||
|
@ -16,14 +16,14 @@
|
||||
class LaTeXFeatures;
|
||||
|
||||
class MathNestInset : public MathDimInset {
|
||||
public:
|
||||
public:
|
||||
/// nestinsets have a fixed size to start with
|
||||
explicit MathNestInset(idx_type ncells);
|
||||
|
||||
/// the size is usuall some sort of convex hull of the cells
|
||||
void metrics(MathMetricsInfo const & st) const;
|
||||
/// appends itself with macro arguments substituted
|
||||
void substitute(MathMacro const & macro);
|
||||
void substitute(MathMacro const & macro);
|
||||
/// identifies NestInsets
|
||||
MathNestInset * asNestInset() { return this; }
|
||||
|
||||
@ -58,7 +58,7 @@ public:
|
||||
MathXArray & xcell(idx_type);
|
||||
/// direct access to the cell including the drawing cache
|
||||
MathXArray const & xcell(idx_type) const;
|
||||
|
||||
|
||||
/// can we move into this cell (see macroarg.h)
|
||||
bool isActive() const { return nargs() > 0; }
|
||||
/// request "external features"
|
||||
|
@ -41,7 +41,7 @@ void MathNotInset::metrics(MathMetricsInfo const & mi) const
|
||||
|
||||
|
||||
void MathNotInset::draw(Painter & pain, int x, int y) const
|
||||
{
|
||||
{
|
||||
if (math_font_available(LM_TC_CMSY))
|
||||
drawChar(pain, font_, x, y, 54);
|
||||
else
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* File: math_parser.C
|
||||
* Purpose: Parser for mathed
|
||||
* Author: Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
|
||||
* Author: Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
|
||||
* Created: January 1996
|
||||
* Description: Parse LaTeX2e math mode code.
|
||||
*
|
||||
@ -15,7 +15,7 @@
|
||||
* the GNU General Public Licence version 2 or later.
|
||||
*/
|
||||
|
||||
/*
|
||||
/*
|
||||
|
||||
If someone desperately needs partial "structures" (such as a few cells of
|
||||
an array inset or similar) (s)he could uses the following hack as starting
|
||||
@ -109,7 +109,7 @@ void add(MathArray & ar, char c, MathTextCodes code)
|
||||
|
||||
// These are TeX's catcodes
|
||||
enum CatCode {
|
||||
catEscape, // 0 backslash
|
||||
catEscape, // 0 backslash
|
||||
catBegin, // 1 {
|
||||
catEnd, // 2 }
|
||||
catMath, // 3 $
|
||||
@ -118,7 +118,7 @@ enum CatCode {
|
||||
catParameter, // 6 #
|
||||
catSuper, // 7 ^
|
||||
catSub, // 8 _
|
||||
catIgnore, // 9
|
||||
catIgnore, // 9
|
||||
catSpace, // 10 space
|
||||
catLetter, // 11 a-zA-Z
|
||||
catOther, // 12 none of the above
|
||||
@ -127,7 +127,7 @@ enum CatCode {
|
||||
catInvalid // 15 <delete>
|
||||
};
|
||||
|
||||
CatCode theCatcode[256];
|
||||
CatCode theCatcode[256];
|
||||
|
||||
|
||||
inline CatCode catcode(unsigned char c)
|
||||
@ -155,21 +155,21 @@ void catInit()
|
||||
fill(theCatcode + 'a', theCatcode + 'z' + 1, catLetter);
|
||||
fill(theCatcode + 'A', theCatcode + 'Z' + 1, catLetter);
|
||||
|
||||
theCatcode['\\'] = catEscape;
|
||||
theCatcode['{'] = catBegin;
|
||||
theCatcode['}'] = catEnd;
|
||||
theCatcode['$'] = catMath;
|
||||
theCatcode['&'] = catAlign;
|
||||
theCatcode['\n'] = catNewline;
|
||||
theCatcode['#'] = catParameter;
|
||||
theCatcode['^'] = catSuper;
|
||||
theCatcode['_'] = catSub;
|
||||
theCatcode[''] = catIgnore;
|
||||
theCatcode[' '] = catSpace;
|
||||
theCatcode['\t'] = catSpace;
|
||||
theCatcode['\r'] = catSpace;
|
||||
theCatcode['~'] = catActive;
|
||||
theCatcode['%'] = catComment;
|
||||
theCatcode['\\'] = catEscape;
|
||||
theCatcode['{'] = catBegin;
|
||||
theCatcode['}'] = catEnd;
|
||||
theCatcode['$'] = catMath;
|
||||
theCatcode['&'] = catAlign;
|
||||
theCatcode['\n'] = catNewline;
|
||||
theCatcode['#'] = catParameter;
|
||||
theCatcode['^'] = catSuper;
|
||||
theCatcode['_'] = catSub;
|
||||
theCatcode[''] = catIgnore;
|
||||
theCatcode[' '] = catSpace;
|
||||
theCatcode['\t'] = catSpace;
|
||||
theCatcode['\r'] = catSpace;
|
||||
theCatcode['~'] = catActive;
|
||||
theCatcode['%'] = catComment;
|
||||
}
|
||||
|
||||
|
||||
@ -198,7 +198,7 @@ public:
|
||||
///
|
||||
bool isCR() const;
|
||||
|
||||
private:
|
||||
private:
|
||||
///
|
||||
string cs_;
|
||||
///
|
||||
@ -221,7 +221,7 @@ string Token::asString() const
|
||||
//bool operator==(Token const & s, Token const & t)
|
||||
//{
|
||||
// return s.character() == t.character()
|
||||
// && s.cat() == t.cat() && s.cs() == t.cs();
|
||||
// && s.cat() == t.cat() && s.cs() == t.cs();
|
||||
//}
|
||||
//
|
||||
//bool operator!=(Token const & s, Token const & t)
|
||||
@ -433,9 +433,9 @@ string Parser::getArg(char lf, char rg)
|
||||
string result;
|
||||
char c = getChar();
|
||||
|
||||
if (c != lf)
|
||||
if (c != lf)
|
||||
putback();
|
||||
else
|
||||
else
|
||||
while ((c = getChar()) != rg && good())
|
||||
result += c;
|
||||
|
||||
@ -476,7 +476,7 @@ void Parser::skipSpaceTokens(istream & is, char c)
|
||||
void Parser::tokenize(string const & buffer)
|
||||
{
|
||||
static bool init_done = false;
|
||||
|
||||
|
||||
if (!init_done) {
|
||||
catInit();
|
||||
init_done = true;
|
||||
@ -490,13 +490,13 @@ void Parser::tokenize(string const & buffer)
|
||||
|
||||
switch (catcode(c)) {
|
||||
case catNewline: {
|
||||
++lineno_;
|
||||
++lineno_;
|
||||
is.get(c);
|
||||
if (catcode(c) == catNewline)
|
||||
; //push_back(Token("par"));
|
||||
else {
|
||||
push_back(Token(' ', catSpace));
|
||||
is.putback(c);
|
||||
is.putback(c);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@ -504,7 +504,7 @@ void Parser::tokenize(string const & buffer)
|
||||
case catComment: {
|
||||
while (is.get(c) && catcode(c) != catNewline)
|
||||
;
|
||||
++lineno_;
|
||||
++lineno_;
|
||||
break;
|
||||
}
|
||||
|
||||
@ -519,7 +519,7 @@ void Parser::tokenize(string const & buffer)
|
||||
while (is.get(c) && catcode(c) == catLetter)
|
||||
s += c;
|
||||
skipSpaceTokens(is, c);
|
||||
}
|
||||
}
|
||||
push_back(Token(s));
|
||||
}
|
||||
break;
|
||||
@ -558,7 +558,7 @@ void Parser::dump() const
|
||||
}
|
||||
|
||||
|
||||
void Parser::error(string const & msg)
|
||||
void Parser::error(string const & msg)
|
||||
{
|
||||
lyxerr << "Line ~" << lineno_ << ": Math parse error: " << msg << endl;
|
||||
dump();
|
||||
@ -568,7 +568,7 @@ void Parser::error(string const & msg)
|
||||
|
||||
|
||||
bool Parser::parse_lines(MathAtom & t, bool numbered, bool outmost)
|
||||
{
|
||||
{
|
||||
MathGridInset * p = t->asGridInset();
|
||||
if (!p) {
|
||||
dump();
|
||||
@ -593,7 +593,7 @@ bool Parser::parse_lines(MathAtom & t, bool numbered, bool outmost)
|
||||
//lyxerr << "reading cell " << row << " " << col << " "
|
||||
// << p->ncols() << "\n";
|
||||
//lyxerr << "ncols: " << p->ncols() << "\n";
|
||||
|
||||
|
||||
if (col >= p->ncols()) {
|
||||
//lyxerr << "adding col " << col << "\n";
|
||||
p->addCol(p->ncols());
|
||||
@ -612,7 +612,7 @@ bool Parser::parse_lines(MathAtom & t, bool numbered, bool outmost)
|
||||
// << row << " " << col << "\n";
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
// skip the ampersand
|
||||
getToken();
|
||||
}
|
||||
@ -666,7 +666,7 @@ bool Parser::parse_lines(MathAtom & t, bool numbered, bool outmost)
|
||||
|
||||
|
||||
bool Parser::parse_lines2(MathAtom & t, bool braced)
|
||||
{
|
||||
{
|
||||
MathGridInset * p = t->asGridInset();
|
||||
if (!p) {
|
||||
lyxerr << "error in Parser::parse_lines() 1\n";
|
||||
@ -677,7 +677,7 @@ bool Parser::parse_lines2(MathAtom & t, bool braced)
|
||||
// reading a row
|
||||
for (MathInset::col_type col = 0; true; ++col) {
|
||||
//lyxerr << "reading cell " << row << " " << col << " " << p->ncols() << "\n";
|
||||
|
||||
|
||||
if (col >= p->ncols()) {
|
||||
//lyxerr << "adding col " << col << "\n";
|
||||
p->addCol(p->ncols());
|
||||
@ -691,7 +691,7 @@ bool Parser::parse_lines2(MathAtom & t, bool braced)
|
||||
//lyxerr << "less cells read than normal in row/col: " << row << " " << col << "\n";
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
// skip the ampersand
|
||||
getToken();
|
||||
}
|
||||
@ -750,7 +750,7 @@ bool Parser::parse_macro(string & name)
|
||||
}
|
||||
|
||||
string arg = getArg('[', ']');
|
||||
int narg = arg.empty() ? 0 : atoi(arg.c_str());
|
||||
int narg = arg.empty() ? 0 : atoi(arg.c_str());
|
||||
|
||||
if (getToken().cat() != catBegin) {
|
||||
lyxerr << "'{' in \\newcommand expected (2)\n";
|
||||
@ -906,7 +906,7 @@ void Parser::parse_into1(MathArray & array, unsigned flags, MathTextCodes code)
|
||||
|
||||
while (good()) {
|
||||
Token const & t = getToken();
|
||||
|
||||
|
||||
#ifdef FILEDEBUG
|
||||
lyxerr << "t: " << t << " flags: " << flags << "\n";
|
||||
//array.dump();
|
||||
@ -918,7 +918,7 @@ void Parser::parse_into1(MathArray & array, unsigned flags, MathTextCodes code)
|
||||
continue;
|
||||
|
||||
flags &= ~FLAG_ITEM;
|
||||
if (t.cat() == catBegin) {
|
||||
if (t.cat() == catBegin) {
|
||||
// skip the brace and collect everything to the next matching
|
||||
// closing brace
|
||||
flags |= FLAG_BRACE_LAST;
|
||||
@ -978,7 +978,7 @@ void Parser::parse_into1(MathArray & array, unsigned flags, MathTextCodes code)
|
||||
// ignore braces around simple items
|
||||
if ((ar.size() == 1 && !ar.front()->needsBraces()
|
||||
|| (ar.size() == 2 && !ar.front()->needsBraces()
|
||||
&& ar.back()->asScriptInset()))
|
||||
&& ar.back()->asScriptInset()))
|
||||
|| (ar.size() == 0 && array.size() == 0))
|
||||
{
|
||||
array.push_back(ar);
|
||||
@ -996,17 +996,17 @@ void Parser::parse_into1(MathArray & array, unsigned flags, MathTextCodes code)
|
||||
lyx::Assert(0);
|
||||
add(array, '}', LM_TC_TEX);
|
||||
}
|
||||
|
||||
|
||||
else if (t.cat() == catAlign) {
|
||||
lyxerr << "found tab unexpectedly, array: '" << array << "'\n";
|
||||
//lyxerr << "found tab unexpectedly\n";
|
||||
add(array, '&', LM_TC_TEX);
|
||||
}
|
||||
|
||||
|
||||
else if (t.cat() == catSuper || t.cat() == catSub) {
|
||||
bool up = (t.cat() == catSuper);
|
||||
MathScriptInset * p = 0;
|
||||
if (array.size())
|
||||
MathScriptInset * p = 0;
|
||||
if (array.size())
|
||||
p = array.back()->asScriptInset();
|
||||
if (!p || p->has(up)) {
|
||||
array.push_back(MathAtom(new MathScriptInset(up)));
|
||||
@ -1023,12 +1023,12 @@ void Parser::parse_into1(MathArray & array, unsigned flags, MathTextCodes code)
|
||||
|
||||
else if (t.cat() == catOther)
|
||||
add(array, t.character(), code);
|
||||
|
||||
|
||||
//
|
||||
// control sequences
|
||||
//
|
||||
//
|
||||
else if (t.cs() == "protect")
|
||||
// ignore \\protect, will be re-added during output
|
||||
// ignore \\protect, will be re-added during output
|
||||
;
|
||||
|
||||
else if (t.cs() == "end")
|
||||
@ -1046,13 +1046,13 @@ void Parser::parse_into1(MathArray & array, unsigned flags, MathTextCodes code)
|
||||
lyxerr << "found newline unexpectedly\n";
|
||||
array.push_back(createMathInset("\\"));
|
||||
}
|
||||
|
||||
|
||||
else if (t.cs() == "limits")
|
||||
limits = 1;
|
||||
|
||||
|
||||
else if (t.cs() == "nolimits")
|
||||
limits = -1;
|
||||
|
||||
|
||||
else if (t.cs() == "nonumber")
|
||||
curr_num_ = false;
|
||||
|
||||
@ -1071,7 +1071,7 @@ void Parser::parse_into1(MathArray & array, unsigned flags, MathTextCodes code)
|
||||
parse_into(array.back()->cell(0), FLAG_ITEM);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
else if (t.cs() == "left") {
|
||||
string l = getToken().asString();
|
||||
MathArray ar;
|
||||
@ -1081,7 +1081,7 @@ void Parser::parse_into1(MathArray & array, unsigned flags, MathTextCodes code)
|
||||
dl->cell(0) = ar;
|
||||
array.push_back(dl);
|
||||
}
|
||||
|
||||
|
||||
else if (t.cs() == "right") {
|
||||
if (!(flags & FLAG_RIGHT)) {
|
||||
//lyxerr << "got so far: '" << array << "'\n";
|
||||
@ -1091,24 +1091,24 @@ void Parser::parse_into1(MathArray & array, unsigned flags, MathTextCodes code)
|
||||
}
|
||||
|
||||
else if (t.cs() == "begin") {
|
||||
string const name = getArg('{', '}');
|
||||
string const name = getArg('{', '}');
|
||||
if (name == "array" || name == "subarray") {
|
||||
string const valign = getArg('[', ']') + 'c';
|
||||
string const halign = getArg('{', '}');
|
||||
array.push_back(MathAtom(new MathArrayInset(name, valign[0], halign)));
|
||||
parse_lines(array.back(), false, false);
|
||||
} else if (name == "split" || name == "cases" ||
|
||||
name == "gathered" || name == "aligned") {
|
||||
name == "gathered" || name == "aligned") {
|
||||
array.push_back(createMathInset(name));
|
||||
parse_lines(array.back(), false, false);
|
||||
} else if (name == "matrix" || name == "pmatrix" || name == "bmatrix" ||
|
||||
name == "vmatrix" || name == "Vmatrix") {
|
||||
name == "vmatrix" || name == "Vmatrix") {
|
||||
array.push_back(createMathInset(name));
|
||||
parse_lines2(array.back(), false);
|
||||
} else
|
||||
lyxerr << "unknow math inset begin '" << name << "'\n";
|
||||
} else
|
||||
lyxerr << "unknow math inset begin '" << name << "'\n";
|
||||
}
|
||||
|
||||
|
||||
else if (t.cs() == "kern") {
|
||||
#ifdef WITH_WARNINGS
|
||||
#warning A hack...
|
||||
@ -1117,7 +1117,7 @@ void Parser::parse_into1(MathArray & array, unsigned flags, MathTextCodes code)
|
||||
while (1) {
|
||||
Token const & t = getToken();
|
||||
if (!good()) {
|
||||
putback();
|
||||
putback();
|
||||
break;
|
||||
}
|
||||
s += t.character();
|
||||
@ -1183,13 +1183,13 @@ void Parser::parse_into1(MathArray & array, unsigned flags, MathTextCodes code)
|
||||
//array.push_back(createMathInset(t.cs()));
|
||||
array.push_back(MathAtom(new MathBoxInset(t.cs())));
|
||||
// slurp in the argument of mbox
|
||||
|
||||
|
||||
MathBoxInset * p = array.back()->asBoxInset();
|
||||
//lyx::assert(p);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
else if (t.cs().size()) {
|
||||
latexkeys const * l = in_word_set(t.cs());
|
||||
if (l) {
|
||||
@ -1197,8 +1197,8 @@ void Parser::parse_into1(MathArray & array, unsigned flags, MathTextCodes code)
|
||||
//lyxerr << "starting font\n";
|
||||
//CatCode catSpaceSave = theCatcode[' '];
|
||||
//if (l->id == LM_TC_TEXTRM) {
|
||||
// // temporarily change catcode
|
||||
// theCatcode[' '] = catLetter;
|
||||
// // temporarily change catcode
|
||||
// theCatcode[' '] = catLetter;
|
||||
//}
|
||||
|
||||
MathArray ar;
|
||||
@ -1229,7 +1229,7 @@ void Parser::parse_into1(MathArray & array, unsigned flags, MathTextCodes code)
|
||||
|
||||
else {
|
||||
MathAtom p = createMathInset(t.cs());
|
||||
for (MathInset::idx_type i = 0; i < p->nargs(); ++i)
|
||||
for (MathInset::idx_type i = 0; i < p->nargs(); ++i)
|
||||
parse_into(p->cell(i), FLAG_ITEM);
|
||||
array.push_back(p);
|
||||
}
|
||||
@ -1252,7 +1252,7 @@ void Parser::parse_into1(MathArray & array, unsigned flags, MathTextCodes code)
|
||||
|
||||
if (panic) {
|
||||
lyxerr << " Math Panic, expect problems!\n";
|
||||
// Search for the end command.
|
||||
// Search for the end command.
|
||||
Token t;
|
||||
do {
|
||||
t = getToken();
|
||||
|
@ -2,7 +2,7 @@
|
||||
/*
|
||||
* File: math_parser.h
|
||||
* Purpose: Declaration of parsing utilities for mathed
|
||||
* Author: Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
|
||||
* Author: Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
|
||||
* Created: January 1996
|
||||
* Description: Parse LaTeX2e math mode code.
|
||||
*
|
||||
@ -100,7 +100,7 @@ enum MathTokenEnum
|
||||
///
|
||||
LM_TK_SPECIAL,
|
||||
///
|
||||
LM_TK_ARGUMENT,
|
||||
LM_TK_ARGUMENT,
|
||||
///
|
||||
LM_TK_NEWCOMMAND,
|
||||
///
|
||||
|
@ -92,5 +92,3 @@ bool operator<(MathCursorPos const & p, MathCursorPos const & q)
|
||||
return p.idx_ < q.idx_;
|
||||
return p.pos_ < q.pos_;
|
||||
}
|
||||
|
||||
|
||||
|
@ -5,12 +5,12 @@
|
||||
#include "math_xdata.h"
|
||||
|
||||
|
||||
/// Description of a position
|
||||
/// Description of a position
|
||||
class MathCursorPos {
|
||||
public:
|
||||
///
|
||||
///
|
||||
MathCursorPos();
|
||||
///
|
||||
///
|
||||
explicit MathCursorPos(MathInset *);
|
||||
|
||||
/// returns cell corresponding to this position
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* File: math_root.C
|
||||
* Purpose: Implementation of the root object
|
||||
* Author: Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
|
||||
* Purpose: Implementation of the root object
|
||||
* Author: Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
|
||||
* Created: January 1999
|
||||
* Description: Root math object
|
||||
*
|
||||
|
@ -1,8 +1,8 @@
|
||||
// -*- C++ -*-
|
||||
/*
|
||||
* File: math_root.h
|
||||
* Purpose: Declaration of the root object
|
||||
* Author: Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
|
||||
* Purpose: Declaration of the root object
|
||||
* Author: Alejandro Aguilar Sierra <asierra@servidor.unam.mx>
|
||||
* Created: January 1999
|
||||
* Description: Root math object
|
||||
*
|
||||
|
@ -85,7 +85,7 @@ int MathScriptInset::dy0(MathInset const * nuc) const
|
||||
int des = down().ascent();
|
||||
if (hasLimits(nuc))
|
||||
des += nd + 2;
|
||||
else
|
||||
else
|
||||
des = max(des, nd);
|
||||
return des;
|
||||
}
|
||||
@ -99,7 +99,7 @@ int MathScriptInset::dy1(MathInset const * nuc) const
|
||||
int asc = up().descent();
|
||||
if (hasLimits(nuc))
|
||||
asc += na + 2;
|
||||
else
|
||||
else
|
||||
asc = max(asc, na);
|
||||
asc = max(asc, mathed_char_ascent(font_, 'I'));
|
||||
return asc;
|
||||
@ -178,14 +178,14 @@ int MathScriptInset::ndes(MathInset const * nuc) const
|
||||
|
||||
|
||||
void MathScriptInset::metrics(MathMetricsInfo const & mi) const
|
||||
{
|
||||
{
|
||||
metrics(0, mi);
|
||||
}
|
||||
|
||||
|
||||
void MathScriptInset::metrics(MathInset const * nuc,
|
||||
MathMetricsInfo const & mi) const
|
||||
{
|
||||
{
|
||||
MathMetricsInfo m = mi;
|
||||
smallerStyleScript(m);
|
||||
MathNestInset::metrics(m);
|
||||
@ -199,21 +199,21 @@ void MathScriptInset::metrics(MathInset const * nuc,
|
||||
|
||||
|
||||
void MathScriptInset::draw(Painter & pain, int x, int y) const
|
||||
{
|
||||
{
|
||||
//lyxerr << "unexpected call to MathScriptInset::draw()\n";
|
||||
draw(0, pain, x, y);
|
||||
}
|
||||
|
||||
|
||||
void MathScriptInset::metricsT(TextMetricsInfo const & mi) const
|
||||
{
|
||||
{
|
||||
metricsT(0, mi);
|
||||
}
|
||||
|
||||
|
||||
void MathScriptInset::metricsT(MathInset const * nuc,
|
||||
TextMetricsInfo const & mi) const
|
||||
{
|
||||
{
|
||||
if (hasUp())
|
||||
up().metricsT(mi);
|
||||
if (hasDown())
|
||||
@ -228,7 +228,7 @@ void MathScriptInset::metricsT(MathInset const * nuc,
|
||||
|
||||
void MathScriptInset::draw(MathInset const * nuc, Painter & pain,
|
||||
int x, int y) const
|
||||
{
|
||||
{
|
||||
if (nuc)
|
||||
nuc->draw(pain, x + dxx(nuc), y);
|
||||
else // if (editing())
|
||||
@ -242,7 +242,7 @@ void MathScriptInset::draw(MathInset const * nuc, Painter & pain,
|
||||
}
|
||||
|
||||
void MathScriptInset::drawT(TextPainter & pain, int x, int y) const
|
||||
{
|
||||
{
|
||||
//lyxerr << "unexpected call to MathScriptInset::draw()\n";
|
||||
drawT(0, pain, x, y);
|
||||
}
|
||||
@ -250,7 +250,7 @@ void MathScriptInset::drawT(TextPainter & pain, int x, int y) const
|
||||
|
||||
void MathScriptInset::drawT(MathInset const * nuc, TextPainter & pain,
|
||||
int x, int y) const
|
||||
{
|
||||
{
|
||||
if (nuc)
|
||||
nuc->drawT(pain, x + dxx(nuc), y);
|
||||
if (hasUp())
|
||||
@ -269,12 +269,12 @@ bool MathScriptInset::hasLimits(MathInset const * nuc) const
|
||||
if (limits_ == -1)
|
||||
return false;
|
||||
|
||||
// we can only display limits if the nucleus wants some
|
||||
// we can only display limits if the nucleus wants some
|
||||
if (!nuc)
|
||||
return false;
|
||||
if (!nuc->isScriptable())
|
||||
return false;
|
||||
|
||||
|
||||
// per default \int has limits beside the \int even in displayed formulas
|
||||
if (nuc->asSymbolInset())
|
||||
if (nuc->asSymbolInset()->name().find("int") != string::npos)
|
||||
@ -341,7 +341,7 @@ bool MathScriptInset::idxLeft(MathInset::idx_type &,
|
||||
|
||||
|
||||
void MathScriptInset::write(WriteStream & os) const
|
||||
{
|
||||
{
|
||||
//lyxerr << "unexpected call to MathScriptInset::write()\n";
|
||||
write2(0, os);
|
||||
}
|
||||
@ -372,7 +372,7 @@ void MathScriptInset::write2(MathInset const * nuc, WriteStream & os) const
|
||||
|
||||
|
||||
void MathScriptInset::normalize(NormalStream & os) const
|
||||
{
|
||||
{
|
||||
//lyxerr << "unexpected call to MathScriptInset::normalize()\n";
|
||||
normalize2(0, os);
|
||||
}
|
||||
@ -383,11 +383,11 @@ void MathScriptInset::normalize2(MathInset const * nuc, NormalStream & os) const
|
||||
bool d = hasDown() && down().data_.size();
|
||||
bool u = hasUp() && up().data_.size();
|
||||
|
||||
if (u)
|
||||
if (u)
|
||||
os << "[sup ";
|
||||
if (d)
|
||||
os << "[sub ";
|
||||
|
||||
|
||||
if (nuc)
|
||||
os << nuc << ' ';
|
||||
else
|
||||
@ -395,7 +395,7 @@ void MathScriptInset::normalize2(MathInset const * nuc, NormalStream & os) const
|
||||
|
||||
if (d)
|
||||
os << down().data_ << ']';
|
||||
if (u)
|
||||
if (u)
|
||||
os << up().data_ << ']';
|
||||
}
|
||||
|
||||
@ -446,5 +446,3 @@ void MathScriptInset::octavize2(MathInset const * nuc, OctaveStream & os) const
|
||||
if (hasUp() && up().data_.size())
|
||||
os << "^(" << up().data_ << ')';
|
||||
}
|
||||
|
||||
|
||||
|
@ -117,7 +117,7 @@ private:
|
||||
bool hasLimits(MathInset const * nuc) const;
|
||||
|
||||
/// possible subscript (index 0) and superscript (index 1)
|
||||
bool script_[2];
|
||||
bool script_[2];
|
||||
/// 1 - "limits", -1 - "nolimits", 0 - "default"
|
||||
int limits_;
|
||||
/// cached font
|
||||
@ -125,4 +125,3 @@ private:
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -34,7 +34,7 @@ public:
|
||||
void normalize(NormalStream &) const;
|
||||
|
||||
private:
|
||||
///
|
||||
///
|
||||
latexkeys const * key_;
|
||||
};
|
||||
|
||||
|
@ -35,20 +35,20 @@ void MathSpaceInset::metrics(MathMetricsInfo const &) const
|
||||
|
||||
|
||||
void MathSpaceInset::draw(Painter & pain, int x, int y) const
|
||||
{
|
||||
|
||||
{
|
||||
|
||||
// XPoint p[4] = {{++x, y-3}, {x, y}, {x+width-2, y}, {x+width-2, y-3}};
|
||||
|
||||
|
||||
// Sadly, HP-UX CC can't handle that kind of initialization.
|
||||
|
||||
|
||||
int xp[4];
|
||||
int yp[4];
|
||||
|
||||
|
||||
xp[0] = ++x; yp[0] = y - 3;
|
||||
xp[1] = x; yp[1] = y;
|
||||
xp[2] = x + width_ - 2; yp[2] = y;
|
||||
xp[3] = x + width_ - 2; yp[3] = y - 3;
|
||||
|
||||
|
||||
pain.lines(xp, yp, 4, space_ ? LColor::latex : LColor::math);
|
||||
}
|
||||
|
||||
@ -82,5 +82,3 @@ void MathSpaceInset::write(WriteStream & os) const
|
||||
if (space_ >= 0 && space_ < 6)
|
||||
os << '\\' << latex_mathspace[space_] << ' ';
|
||||
}
|
||||
|
||||
|
||||
|
@ -13,7 +13,7 @@ MathSpecialCharInset::MathSpecialCharInset(char c)
|
||||
|
||||
|
||||
MathInset * MathSpecialCharInset::clone() const
|
||||
{
|
||||
{
|
||||
return new MathSpecialCharInset(*this);
|
||||
}
|
||||
|
||||
@ -43,7 +43,7 @@ void MathSpecialCharInset::metrics(MathMetricsInfo const & mi) const
|
||||
|
||||
|
||||
void MathSpecialCharInset::draw(Painter & pain, int x, int y) const
|
||||
{
|
||||
{
|
||||
drawChar(pain, font_, x, y, char_);
|
||||
}
|
||||
|
||||
|
@ -8,7 +8,7 @@
|
||||
#pragma interface
|
||||
#endif
|
||||
|
||||
/** An inset for characters like {, #, and $ that need to be escaped
|
||||
/** An inset for characters like {, #, and $ that need to be escaped
|
||||
when written out, but can be inserted by a single keystroke
|
||||
\author André Pönitz
|
||||
*/
|
||||
@ -27,7 +27,7 @@ public:
|
||||
void write(WriteStream & os) const;
|
||||
///
|
||||
void normalize(NormalStream &) const;
|
||||
///
|
||||
///
|
||||
int ascent() const;
|
||||
///
|
||||
int descent() const;
|
||||
|
@ -11,7 +11,7 @@
|
||||
|
||||
|
||||
class MathSplitInset : public MathGridInset {
|
||||
public:
|
||||
public:
|
||||
///
|
||||
explicit MathSplitInset(string const & name);
|
||||
///
|
||||
|
@ -15,7 +15,7 @@ MathSqrtInset::MathSqrtInset()
|
||||
|
||||
|
||||
MathInset * MathSqrtInset::clone() const
|
||||
{
|
||||
{
|
||||
return new MathSqrtInset(*this);
|
||||
}
|
||||
|
||||
@ -30,8 +30,8 @@ void MathSqrtInset::metrics(MathMetricsInfo const & mi) const
|
||||
|
||||
|
||||
void MathSqrtInset::draw(Painter & pain, int x, int y) const
|
||||
{
|
||||
xcell(0).draw(pain, x + 10, y);
|
||||
{
|
||||
xcell(0).draw(pain, x + 10, y);
|
||||
int const a = ascent_;
|
||||
int const d = descent_;
|
||||
int xp[4];
|
||||
@ -54,8 +54,8 @@ void MathSqrtInset::metricsT(TextMetricsInfo const & mi) const
|
||||
|
||||
|
||||
void MathSqrtInset::drawT(TextPainter & pain, int x, int y) const
|
||||
{
|
||||
xcell(0).drawT(pain, x + 2, y);
|
||||
{
|
||||
xcell(0).drawT(pain, x + 2, y);
|
||||
pain.horizontalLine(x + 2, y - xcell(0).ascent(), xcell(0).width(), '_');
|
||||
pain.verticalLine (x + 1, y - xcell(0).ascent() + 1, xcell(0).height());
|
||||
pain.draw(x, y + xcell(0).descent(), '\\');
|
||||
|
@ -15,7 +15,7 @@ MathStackrelInset::MathStackrelInset()
|
||||
|
||||
|
||||
MathInset * MathStackrelInset::clone() const
|
||||
{
|
||||
{
|
||||
return new MathStackrelInset(*this);
|
||||
}
|
||||
|
||||
@ -26,7 +26,7 @@ void MathStackrelInset::metrics(MathMetricsInfo const & mi) const
|
||||
smallerStyleFrac(m);
|
||||
xcell(0).metrics(m);
|
||||
xcell(1).metrics(mi);
|
||||
width_ = max(xcell(0).width(), xcell(1).width()) + 4;
|
||||
width_ = max(xcell(0).width(), xcell(1).width()) + 4;
|
||||
ascent_ = xcell(1).ascent() + xcell(0).height() + 4;
|
||||
descent_ = xcell(1).descent();
|
||||
}
|
||||
|
@ -8,7 +8,7 @@
|
||||
#pragma interface
|
||||
#endif
|
||||
|
||||
/** Stackrel objects
|
||||
/** Stackrel objects
|
||||
\author André Pönitz
|
||||
*/
|
||||
class MathStackrelInset : public MathFracbaseInset {
|
||||
|
@ -27,7 +27,7 @@ MathStringInset::MathStringInset(string const & s, MathTextCodes t)
|
||||
|
||||
|
||||
MathInset * MathStringInset::clone() const
|
||||
{
|
||||
{
|
||||
return new MathStringInset(*this);
|
||||
}
|
||||
|
||||
@ -65,7 +65,7 @@ void MathStringInset::metrics(MathMetricsInfo const & mi) const
|
||||
|
||||
|
||||
void MathStringInset::draw(Painter & pain, int x, int y) const
|
||||
{
|
||||
{
|
||||
//lyxerr << "drawing '" << str_ << "' code: " << code_ << endl;
|
||||
drawStr(pain, font_, x, y, str_);
|
||||
}
|
||||
@ -82,11 +82,11 @@ void MathStringInset::maplize(MapleStream & os) const
|
||||
if (code_ != LM_TC_VAR || str_.size() <= 1) {
|
||||
os << ' ' << str_ << ' ';
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// insert '*' between adjacent chars if type is LM_TC_VAR
|
||||
os << str_[0];
|
||||
for (string::size_type i = 1; i < str_.size(); ++i)
|
||||
for (string::size_type i = 1; i < str_.size(); ++i)
|
||||
os << '*' << str_[i];
|
||||
}
|
||||
|
||||
@ -96,11 +96,11 @@ void MathStringInset::octavize(OctaveStream & os) const
|
||||
if (code_ != LM_TC_VAR || str_.size() <= 1) {
|
||||
os << ' ' << str_ << ' ';
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// insert '*' between adjacent chars if type is LM_TC_VAR
|
||||
os << str_[0];
|
||||
for (string::size_type i = 1; i < str_.size(); ++i)
|
||||
for (string::size_type i = 1; i < str_.size(); ++i)
|
||||
os << '*' << str_[i];
|
||||
}
|
||||
|
||||
@ -120,10 +120,8 @@ void MathStringInset::mathmlize(MathMLStream & os) const
|
||||
|
||||
void MathStringInset::write(WriteStream & os) const
|
||||
{
|
||||
if (math_font_name(code_))
|
||||
if (math_font_name(code_))
|
||||
os << '\\' << math_font_name(code_) << '{' << str_ << '}';
|
||||
else
|
||||
else
|
||||
os << str_;
|
||||
}
|
||||
|
||||
|
||||
|
@ -24,7 +24,7 @@ public:
|
||||
void metrics(MathMetricsInfo const & st) const;
|
||||
///
|
||||
void draw(Painter &, int x, int y) const;
|
||||
///
|
||||
///
|
||||
int ascent() const;
|
||||
///
|
||||
int descent() const;
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
|
||||
class MathSubstackInset : public MathGridInset {
|
||||
public:
|
||||
public:
|
||||
///
|
||||
MathSubstackInset();
|
||||
///
|
||||
|
@ -124,8 +124,8 @@ LyXFont const & whichFontBaseIntern(MathTextCodes type)
|
||||
mathed_init_fonts();
|
||||
|
||||
switch (type) {
|
||||
case LM_TC_SYMB:
|
||||
case LM_TC_BOLDSYMB:
|
||||
case LM_TC_SYMB:
|
||||
case LM_TC_BOLDSYMB:
|
||||
return MathFonts[FONT_SYMBOLI];
|
||||
|
||||
case LM_TC_VAR:
|
||||
@ -495,8 +495,8 @@ named_deco_struct deco_table[] = {
|
||||
{"uparrow", arrow, 0 },
|
||||
{"Uparrow", Arrow, 0 },
|
||||
{"updownarrow", udarrow, 0 },
|
||||
{"Updownarrow", Udarrow, 0 },
|
||||
|
||||
{"Updownarrow", Udarrow, 0 },
|
||||
|
||||
// Accents
|
||||
{"ddot", ddot, 0 },
|
||||
{"dddot", dddot, 0 },
|
||||
@ -510,7 +510,7 @@ named_deco_struct deco_table[] = {
|
||||
{"breve", parenth, 1 },
|
||||
{"vec", arrow, 3 },
|
||||
{"not", slash, 0 },
|
||||
|
||||
|
||||
// Dots
|
||||
{"ldots", hline3, 0 },
|
||||
{"cdots", hline3, 0 },
|
||||
@ -618,22 +618,22 @@ void mathed_draw_deco(Painter & pain, int x, int y, int w, int h,
|
||||
pain.line(x + w/2, y, x + w/2, y + h,
|
||||
LColor::mathcursor, Painter::line_onoffdash);
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
deco_struct const * mds = search_deco(name);
|
||||
if (!mds) {
|
||||
lyxerr << "Deco was not found. Programming error?\n";
|
||||
lyxerr << "name: '" << name << "'\n";
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
int const n = (w < h) ? w : h;
|
||||
int const r = mds->angle;
|
||||
double const * d = mds->data;
|
||||
|
||||
|
||||
if (h > 70 && (name == "(" || name == ")"))
|
||||
d = parenthHigh;
|
||||
|
||||
|
||||
Matrix mt(r, w, h);
|
||||
Matrix sqmt(r, n, n);
|
||||
|
||||
@ -750,7 +750,7 @@ char const * math_font_name(MathTextCodes code)
|
||||
"textrm"
|
||||
};
|
||||
|
||||
if (code >= LM_TC_RM && code <= LM_TC_TEXTRM)
|
||||
if (code >= LM_TC_RM && code <= LM_TC_TEXTRM)
|
||||
return theFontNames[code - LM_TC_RM];
|
||||
return 0;
|
||||
}
|
||||
@ -773,5 +773,3 @@ string convertDelimToLatexName(string const & name)
|
||||
return name;
|
||||
return "\\" + name + " ";
|
||||
}
|
||||
|
||||
|
||||
|
@ -98,7 +98,7 @@ void MathSymbolInset::metrics(MathMetricsInfo const & mi) const
|
||||
|
||||
|
||||
void MathSymbolInset::draw(Painter & pain, int x, int y) const
|
||||
{
|
||||
{
|
||||
if (isRelOp())
|
||||
x += 3;
|
||||
MathTextCodes Code = code();
|
||||
@ -117,7 +117,7 @@ void MathSymbolInset::draw(Painter & pain, int x, int y) const
|
||||
|
||||
|
||||
bool MathSymbolInset::isRelOp() const
|
||||
{
|
||||
{
|
||||
return sym_->type == "mathrel";
|
||||
}
|
||||
|
||||
@ -200,5 +200,3 @@ void MathSymbolInset::infoize(ostream & os) const
|
||||
{
|
||||
os << '\\' << name();
|
||||
}
|
||||
|
||||
|
||||
|
@ -15,7 +15,7 @@ MathUndersetInset::MathUndersetInset()
|
||||
|
||||
|
||||
MathInset * MathUndersetInset::clone() const
|
||||
{
|
||||
{
|
||||
return new MathUndersetInset(*this);
|
||||
}
|
||||
|
||||
@ -26,7 +26,7 @@ void MathUndersetInset::metrics(MathMetricsInfo const & mi) const
|
||||
smallerStyleFrac(m);
|
||||
xcell(0).metrics(m);
|
||||
xcell(1).metrics(mi);
|
||||
width_ = max(xcell(0).width(), xcell(1).width()) + 4;
|
||||
width_ = max(xcell(0).width(), xcell(1).width()) + 4;
|
||||
ascent_ = xcell(1).ascent();
|
||||
descent_ = xcell(1).descent() + xcell(0).height() + 4;
|
||||
}
|
||||
|
@ -8,7 +8,7 @@
|
||||
#pragma interface
|
||||
#endif
|
||||
|
||||
/** Underset objects
|
||||
/** Underset objects
|
||||
\author André Pönitz
|
||||
*/
|
||||
class MathUndersetInset : public MathFracbaseInset {
|
||||
|
@ -57,7 +57,7 @@ void MathUnknownInset::normalize(NormalStream & os) const
|
||||
}
|
||||
|
||||
|
||||
void MathUnknownInset::metrics(MathMetricsInfo const & mi) const
|
||||
void MathUnknownInset::metrics(MathMetricsInfo const & mi) const
|
||||
{
|
||||
whichFont(font_, LM_TC_TEX, mi);
|
||||
mathed_string_dim(font_, name_, ascent_, descent_, width_);
|
||||
@ -65,7 +65,7 @@ void MathUnknownInset::metrics(MathMetricsInfo const & mi) const
|
||||
|
||||
|
||||
void MathUnknownInset::draw(Painter & pain, int x, int y) const
|
||||
{
|
||||
{
|
||||
drawStr(pain, font_, x, y, name_);
|
||||
}
|
||||
|
||||
|
@ -17,7 +17,7 @@ MathXArrowInset::MathXArrowInset(string const & name)
|
||||
|
||||
|
||||
MathInset * MathXArrowInset::clone() const
|
||||
{
|
||||
{
|
||||
return new MathXArrowInset(*this);
|
||||
}
|
||||
|
||||
@ -34,7 +34,7 @@ void MathXArrowInset::metrics(MathMetricsInfo const & st) const
|
||||
|
||||
|
||||
void MathXArrowInset::draw(Painter & pain, int x, int y) const
|
||||
{
|
||||
{
|
||||
xcell(0).draw(pain, x + 5, y - 10);
|
||||
mathed_draw_deco(pain, x + 1, y - 7, width_ - 2, 5, name_);
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ MathXArray::MathXArray()
|
||||
|
||||
|
||||
void MathXArray::touch() const
|
||||
{
|
||||
{
|
||||
clean_ = false;
|
||||
drawn_ = false;
|
||||
}
|
||||
@ -58,16 +58,16 @@ void MathXArray::metrics(MathMetricsInfo const & mi) const
|
||||
q->metrics(p, mi);
|
||||
ascent_ = max(ascent_, q->ascent2(p));
|
||||
descent_ = max(descent_, q->descent2(p));
|
||||
width_ += q->width2(p);
|
||||
width_ += q->width2(p);
|
||||
++it;
|
||||
} else {
|
||||
p->metrics(mi);
|
||||
ascent_ = max(ascent_, p->ascent());
|
||||
descent_ = max(descent_, p->descent());
|
||||
width_ += p->width();
|
||||
width_ += p->width();
|
||||
}
|
||||
}
|
||||
//lyxerr << "MathXArray::metrics(): '" << ascent_ << " "
|
||||
//lyxerr << "MathXArray::metrics(): '" << ascent_ << " "
|
||||
// << descent_ << " " << width_ << "'\n";
|
||||
}
|
||||
|
||||
@ -130,13 +130,13 @@ void MathXArray::metricsT(TextMetricsInfo const & mi) const
|
||||
q->metricsT(p, mi);
|
||||
ascent_ = max(ascent_, q->ascent2(p));
|
||||
descent_ = max(descent_, q->descent2(p));
|
||||
width_ += q->width2(p);
|
||||
width_ += q->width2(p);
|
||||
++it;
|
||||
} else {
|
||||
p->metricsT(mi);
|
||||
ascent_ = max(ascent_, p->ascent());
|
||||
descent_ = max(descent_, p->descent());
|
||||
width_ += p->width();
|
||||
width_ += p->width();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -232,7 +232,7 @@ int MathXArray::dist(int x, int y) const
|
||||
else if (y > yo_ + descent_)
|
||||
yy = y - yo_ - descent_;
|
||||
|
||||
return xx + yy;
|
||||
return xx + yy;
|
||||
}
|
||||
|
||||
|
||||
@ -248,7 +248,7 @@ void MathXArray::boundingBox(int & x1, int & x2, int & y1, int & y2)
|
||||
void MathXArray::findPos(MathPosFinder & f) const
|
||||
{
|
||||
double x = xo_;
|
||||
double y = yo_;
|
||||
double y = yo_;
|
||||
for (const_iterator it = begin(); it < end(); ++it) {
|
||||
// check this position in the cell first
|
||||
f.visit(x, y);
|
||||
|
@ -77,7 +77,7 @@ public:
|
||||
const_iterator begin() const { return data_.begin(); }
|
||||
/// end iterator of the underlying MathArray
|
||||
const_iterator end() const { return data_.end(); }
|
||||
|
||||
|
||||
public:
|
||||
/// the underlying MathArray
|
||||
MathArray data_;
|
||||
|
@ -111,7 +111,7 @@ void MathXYArrowInset::draw(Painter & pain, int x, int y) const
|
||||
MathXArray const & t = targetCell();
|
||||
pain.line(s.xm(), s.ym(), t.xm(), t.ym(), LColor::math);
|
||||
xcell(1).draw(pain, (s.xm() + t.xm())/2, (s.ym() + t.ym())/2);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
class MathXYMatrixInset;
|
||||
|
||||
class MathXYArrowInset : public MathNestInset {
|
||||
public:
|
||||
public:
|
||||
///
|
||||
MathXYArrowInset();
|
||||
///
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
|
||||
class MathXYMatrixInset : public MathGridInset {
|
||||
public:
|
||||
public:
|
||||
///
|
||||
MathXYMatrixInset();
|
||||
///
|
||||
|
Loading…
Reference in New Issue
Block a user