From 2b8ef58dc021912b2862328b9000cfe37578ea37 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Lars=20Gullik=20Bj=C3=B8nnes?= Date: Thu, 21 Mar 2002 17:42:56 +0000 Subject: [PATCH] ws cleanup git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3804 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/mathed/ChangeLog | 175 +++++++++++++++-------------- src/mathed/formula.C | 30 ++--- src/mathed/formula.h | 6 +- src/mathed/formulabase.C | 46 ++++---- src/mathed/formulabase.h | 14 +-- src/mathed/formulamacro.C | 7 +- src/mathed/formulamacro.h | 8 +- src/mathed/math_amsarrayinset.C | 2 +- src/mathed/math_amsarrayinset.h | 2 +- src/mathed/math_arrayinset.C | 2 +- src/mathed/math_arrayinset.h | 2 +- src/mathed/math_atom.C | 2 +- src/mathed/math_atom.h | 8 +- src/mathed/math_biginset.C | 4 +- src/mathed/math_biginset.h | 2 +- src/mathed/math_binaryopinset.C | 8 +- src/mathed/math_binominset.C | 6 +- src/mathed/math_binominset.h | 2 +- src/mathed/math_braceinset.C | 6 +- src/mathed/math_braceinset.h | 2 +- src/mathed/math_casesinset.C | 2 +- src/mathed/math_casesinset.h | 2 +- src/mathed/math_charinset.C | 6 +- src/mathed/math_cursor.C | 10 +- src/mathed/math_cursor.h | 16 +-- src/mathed/math_data.C | 10 +- src/mathed/math_data.h | 12 +- src/mathed/math_decorationinset.C | 8 +- src/mathed/math_defs.h | 14 +-- src/mathed/math_deliminset.C | 6 +- src/mathed/math_diffinset.C | 3 +- src/mathed/math_diminset.C | 1 - src/mathed/math_diminset.h | 4 +- src/mathed/math_dotsinset.C | 4 +- src/mathed/math_dotsinset.h | 2 +- src/mathed/math_exfuncinset.C | 4 +- src/mathed/math_exintinset.C | 9 +- src/mathed/math_extern.C | 50 ++++----- src/mathed/math_factory.C | 6 +- src/mathed/math_fracbase.h | 2 +- src/mathed/math_fracinset.C | 8 +- src/mathed/math_funcinset.C | 4 +- src/mathed/math_funcliminset.C | 2 +- src/mathed/math_gridinset.C | 116 +++++++++---------- src/mathed/math_gridinset.h | 10 +- src/mathed/math_hash.C | 2 +- src/mathed/math_hullinset.C | 44 ++++---- src/mathed/math_hullinset.h | 2 +- src/mathed/math_inset.C | 4 +- src/mathed/math_inset.h | 10 +- src/mathed/math_iterator.C | 7 +- src/mathed/math_iterator.h | 2 +- src/mathed/math_kerninset.C | 1 - src/mathed/math_limitopinset.C | 2 +- src/mathed/math_macro.C | 10 +- src/mathed/math_macro.h | 4 +- src/mathed/math_macroarg.C | 1 - src/mathed/math_macrotable.C | 8 +- src/mathed/math_macrotemplate.h | 2 +- src/mathed/math_matrixinset.C | 2 +- src/mathed/math_matrixinset.h | 2 +- src/mathed/math_nestinset.C | 1 - src/mathed/math_nestinset.h | 6 +- src/mathed/math_notinset.C | 2 +- src/mathed/math_parser.C | 130 ++++++++++----------- src/mathed/math_parser.h | 4 +- src/mathed/math_pos.C | 2 - src/mathed/math_pos.h | 6 +- src/mathed/math_rootinset.C | 4 +- src/mathed/math_rootinset.h | 4 +- src/mathed/math_scriptinset.C | 36 +++--- src/mathed/math_scriptinset.h | 3 +- src/mathed/math_sizeinset.h | 2 +- src/mathed/math_spaceinset.C | 14 +-- src/mathed/math_specialcharinset.C | 4 +- src/mathed/math_specialcharinset.h | 4 +- src/mathed/math_splitinset.h | 2 +- src/mathed/math_sqrtinset.C | 10 +- src/mathed/math_stackrelinset.C | 4 +- src/mathed/math_stackrelinset.h | 2 +- src/mathed/math_stringinset.C | 18 ++- src/mathed/math_stringinset.h | 2 +- src/mathed/math_substackinset.h | 2 +- src/mathed/math_support.C | 24 ++-- src/mathed/math_symbolinset.C | 6 +- src/mathed/math_undersetinset.C | 4 +- src/mathed/math_undersetinset.h | 2 +- src/mathed/math_unknowninset.C | 4 +- src/mathed/math_xarrowinset.C | 4 +- src/mathed/math_xdata.C | 16 +-- src/mathed/math_xdata.h | 2 +- src/mathed/math_xyarrowinset.C | 2 +- src/mathed/math_xyarrowinset.h | 2 +- src/mathed/math_xymatrixinset.h | 2 +- 94 files changed, 525 insertions(+), 553 deletions(-) diff --git a/src/mathed/ChangeLog b/src/mathed/ChangeLog index 8daf9017a1..852a90d6d3 100644 --- a/src/mathed/ChangeLog +++ b/src/mathed/ChangeLog @@ -1,5 +1,7 @@ 2002-03-21 Lars Gullik Bjønnes + * most files: ws cleanup + * Makefile.am: remove ld -r stuff 2002-03-20 Lars Gullik Bjønnes @@ -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 @@ -45,16 +47,16 @@ 2002-02-08 Otto Tronarp - * math_decorationinset.C: + * math_decorationinset.C: - * math_support.C: + * math_support.C: * math_hash.C: Added \underrightarrow and \underleftarrow 2002-02-08 Martin Vermeer * formulabase.C (localDispatch): fix umlaut handling - + * formulabase.C: pop up math panel on right mouse click 2002-02-01 André Pönitz @@ -101,7 +103,7 @@ 2002-01-10 Jean-Marc Lasgouttes * math_support.C: change latex_mathfontcmds to an array of - kb_action. + kb_action. 2002-01-11 Angus Leeming @@ -128,11 +130,11 @@ 2002-01-09 Jean-Marc Lasgouttes * math_hullinset.C (validate): rename feature "amsstyle" to - "amsmath". + "amsmath". 2002-01-09 Martin Vermeer - * 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 @@ -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 * 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 * formula.C: * math_arrayinset.C: add using std::getline directive. 2001-11-20 André Pönitz - + * formulabase.C: fix mouse positioning using the cursor 2001-11-19 Dekel Tsur @@ -247,13 +249,13 @@ 2001-11-15 Jean-Marc Lasgouttes - * math_extern.C (extractNumber): + * math_extern.C (extractNumber): (extractDiffExponent): add ugly .c_str() 2001-11-08 Jean-Marc Lasgouttes - * 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 * math_cursor.C: fix type mismatches with what was declared in - math_cursor.h. + math_cursor.h. 2001-09-28 Dekel Tsur @@ -376,7 +378,7 @@ 'xxalignt', 'gather' and 'multiline' environments * math_cursor.C: fix handling of | and \| - + 2001-09-04 José Matos * formulabase.C @@ -397,7 +399,7 @@ 2001-08-17 André Pönitz * 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 * 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 @@ -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 - + * 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 - + * math_accentinset.[hC]: rewrite * math_parser.C: @@ -616,11 +618,11 @@ 2001-07-09 Jean-Marc Lasgouttes * formulabase.C (mathDispatchInsertMath): remove bogus return - statement. + statement. 2001-07-09 André Pönitz - * 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 @@ -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 * 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 @@ -826,8 +828,8 @@ 2001-04-16 Allan Rae - * 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 * Makefile.am: @@ -918,7 +920,7 @@ 2001-03-08 André Pönitz - * 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 * 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 * 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 * 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 * 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 * support.C: add some consts @@ -1242,7 +1244,7 @@ 2001-02-14 André Pönitz - * formula.C: reformatting + * formula.C: reformatting * math_cursor.[Ch]: math_iter.[Ch]: @@ -1250,44 +1252,44 @@ 2001-02-14 Lars Gullik Bjønnes - * 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 - + * math_iter.[Ch]: remove 'insert', 'maxsize' and 'ARRAY_SIZE' - * math_cursor.C: reformatting + * math_cursor.C: reformatting 2001-02-14 Jean-Marc Lasgouttes - * 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 - * math_iter.C: reformatting + * math_iter.C: reformatting 2001-02-13 Lars Gullik Bjønnes * 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 * 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 * 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 - + * math_macro.[hC]: replace MathMacroArgument[] with std::vector * math_defs.h: @@ -1376,7 +1378,7 @@ * math_panel.h: * math_symbols.C: replace FL_OBJECTP[] with std::vector - + 2001-02-12 Lars Gullik Bjønnes * math_defs.h (struct MathedRowSt): make all private variables end @@ -1392,7 +1394,7 @@ environment. 2001-02-12 André Pönitz - + * array.[hC]: replace private variable maxsize_ with call to bf_.size() * math_defs.h: replace int[] by std::vector 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 * Many files: add support for the align environment from amsmath. @@ -1418,7 +1420,7 @@ 2001-02-09 André Pönitz * array.h: replace array buffer 'byte bf[]' by 'std::vector 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 - * 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 @@ -1459,4 +1461,3 @@ 2001-01-15 Dekel Tsur * math_draw.C (Metrics): Use the correct GetString. - diff --git a/src/mathed/formula.C b/src/mathed/formula.C index 09930934b4..3b7d102fe8 100644 --- a/src/mathed/formula.C +++ b/src/mathed/formula.C @@ -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; } diff --git a/src/mathed/formula.h b/src/mathed/formula.h index dd2ec650ca..cefe8a8ed8 100644 --- a/src/mathed/formula.h +++ b/src/mathed/formula.h @@ -2,9 +2,9 @@ /* * File: formula.h * Purpose: Declaration of formula inset - * Author: Alejandro Aguilar Sierra + * Author: Alejandro Aguilar Sierra * 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__ diff --git a/src/mathed/formulabase.C b/src/mathed/formulabase.C index 51fde9e14e..8b02a47154 100644 --- a/src/mathed/formulabase.C +++ b/src/mathed/formulabase.C @@ -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 &) -{} +{} diff --git a/src/mathed/formulabase.h b/src/mathed/formulabase.h index 25048df783..67eeaa159a 100644 --- a/src/mathed/formulabase.h +++ b/src/mathed/formulabase.h @@ -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 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_; diff --git a/src/mathed/formulamacro.C b/src/mathed/formulamacro.C index 814bfca680..764321417b 100644 --- a/src/mathed/formulamacro.C +++ b/src/mathed/formulamacro.C @@ -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_); } - diff --git a/src/mathed/formulamacro.h b/src/mathed/formulamacro.h index 407ba74135..5fb3b4e1c6 100644 --- a/src/mathed/formulamacro.h +++ b/src/mathed/formulamacro.h @@ -2,9 +2,9 @@ /* * File: formula.h * Purpose: Declaration of formula inset - * Author: Alejandro Aguilar Sierra + * Author: Alejandro Aguilar Sierra * 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 { diff --git a/src/mathed/math_amsarrayinset.C b/src/mathed/math_amsarrayinset.C index ad53ae2c15..efd88cf89f 100644 --- a/src/mathed/math_amsarrayinset.C +++ b/src/mathed/math_amsarrayinset.C @@ -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()); diff --git a/src/mathed/math_amsarrayinset.h b/src/mathed/math_amsarrayinset.h index 861f51d7da..27154a99be 100644 --- a/src/mathed/math_amsarrayinset.h +++ b/src/mathed/math_amsarrayinset.h @@ -10,7 +10,7 @@ class MathAMSArrayInset : public MathGridInset { -public: +public: /// MathAMSArrayInset(string const & name_, int m, int n); /// diff --git a/src/mathed/math_arrayinset.C b/src/mathed/math_arrayinset.C index e19bf8b25e..41e2d754a0 100644 --- a/src/mathed/math_arrayinset.C +++ b/src/mathed/math_arrayinset.C @@ -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"; diff --git a/src/mathed/math_arrayinset.h b/src/mathed/math_arrayinset.h index ce74bf261c..8a715370d2 100644 --- a/src/mathed/math_arrayinset.h +++ b/src/mathed/math_arrayinset.h @@ -10,7 +10,7 @@ class MathArrayInset : public MathGridInset { -public: +public: /// MathArrayInset(string const &, int m, int n); /// diff --git a/src/mathed/math_atom.C b/src/mathed/math_atom.C index 8e423064ba..76fc538851 100644 --- a/src/mathed/math_atom.C +++ b/src/mathed/math_atom.C @@ -1,6 +1,6 @@ /* * File: math_atom.C - * Purpose: Wrapper for MathInset * + * Purpose: Wrapper for MathInset * * Author: André Pönitz * Created: July 2001 * diff --git a/src/mathed/math_atom.h b/src/mathed/math_atom.h index 2c79655c8a..69d8b47c8d 100644 --- a/src/mathed/math_atom.h +++ b/src/mathed/math_atom.h @@ -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 diff --git a/src/mathed/math_biginset.C b/src/mathed/math_biginset.C index fb9ec3e9f7..cff9a7d239 100644 --- a/src/mathed/math_biginset.C +++ b/src/mathed/math_biginset.C @@ -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_); } diff --git a/src/mathed/math_biginset.h b/src/mathed/math_biginset.h index 850b4b012d..daf0078db0 100644 --- a/src/mathed/math_biginset.h +++ b/src/mathed/math_biginset.h @@ -33,7 +33,7 @@ private: size_type size() const; /// double increase() const; - + /// \bigl or what? string const name_; /// ( or [ or Vert... diff --git a/src/mathed/math_binaryopinset.C b/src/mathed/math_binaryopinset.C index bd1300e07e..b20a12fbca 100644 --- a/src/mathed/math_binaryopinset.C +++ b/src/mathed/math_binaryopinset.C @@ -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); } diff --git a/src/mathed/math_binominset.C b/src/mathed/math_binominset.C index f7aa2693db..20732e7cca 100644 --- a/src/mathed/math_binominset.C +++ b/src/mathed/math_binominset.C @@ -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; } diff --git a/src/mathed/math_binominset.h b/src/mathed/math_binominset.h index 213d19a074..3bac831efe 100644 --- a/src/mathed/math_binominset.h +++ b/src/mathed/math_binominset.h @@ -9,7 +9,7 @@ #endif /** Binom like objects - \author André Pönitz + \author André Pönitz */ class MathBinomInset : public MathFracbaseInset { public: diff --git a/src/mathed/math_braceinset.C b/src/mathed/math_braceinset.C index 6680d7fd22..9e73f78293 100644 --- a/src/mathed/math_braceinset.C +++ b/src/mathed/math_braceinset.C @@ -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) << ']'; } - - diff --git a/src/mathed/math_braceinset.h b/src/mathed/math_braceinset.h index 2957fe031f..adebc05bb0 100644 --- a/src/mathed/math_braceinset.h +++ b/src/mathed/math_braceinset.h @@ -9,7 +9,7 @@ #pragma interface #endif -/** Extra nesting +/** Extra nesting \author André Pönitz */ diff --git a/src/mathed/math_casesinset.C b/src/mathed/math_casesinset.C index 083782564b..cf3b21ff54 100644 --- a/src/mathed/math_casesinset.C +++ b/src/mathed/math_casesinset.C @@ -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); } diff --git a/src/mathed/math_casesinset.h b/src/mathed/math_casesinset.h index ca1ce4b431..07a83a2de6 100644 --- a/src/mathed/math_casesinset.h +++ b/src/mathed/math_casesinset.h @@ -10,7 +10,7 @@ class MathCasesInset : public MathGridInset { -public: +public: /// explicit MathCasesInset(row_type rows = 1u); /// diff --git a/src/mathed/math_charinset.C b/src/mathed/math_charinset.C index 1e65c67936..71a3609ccf 100644 --- a/src/mathed/math_charinset.C +++ b/src/mathed/math_charinset.C @@ -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_); } diff --git a/src/mathed/math_cursor.C b/src/mathed/math_cursor.C index 1200f2cc3e..175a0157a2 100644 --- a/src/mathed/math_cursor.C +++ b/src/mathed/math_cursor.C @@ -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"; diff --git a/src/mathed/math_cursor.h b/src/mathed/math_cursor.h index 433810c229..4f4a19fd65 100644 --- a/src/mathed/math_cursor.h +++ b/src/mathed/math_cursor.h @@ -2,7 +2,7 @@ /* * File: math_cursor.h * Purpose: Declaration of interaction classes for mathed - * Author: Alejandro Aguilar Sierra + * Author: Alejandro Aguilar Sierra * 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(); diff --git a/src/mathed/math_data.C b/src/mathed/math_data.C index b9ecc2e79b..7ef98e0589 100644 --- a/src/mathed/math_data.C +++ b/src/mathed/math_data.C @@ -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; } diff --git a/src/mathed/math_data.h b/src/mathed/math_data.h index a69342d531..2b94c69dd0 100644 --- a/src/mathed/math_data.h +++ b/src/mathed/math_data.h @@ -1,7 +1,7 @@ // -*- C++ -*- /* - * Purpose: A general purpose resizable array. - * Author: Alejandro Aguilar Sierra + * Purpose: A general purpose resizable array. + * Author: Alejandro Aguilar Sierra * 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(); /// diff --git a/src/mathed/math_decorationinset.C b/src/mathed/math_decorationinset.C index a5f9409688..0a70a07924 100644 --- a/src/mathed/math_decorationinset.C +++ b/src/mathed/math_decorationinset.C @@ -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_); diff --git a/src/mathed/math_defs.h b/src/mathed/math_defs.h index 5130dfdcc6..03c03dd4ca 100644 --- a/src/mathed/math_defs.h +++ b/src/mathed/math_defs.h @@ -1,8 +1,8 @@ // -*- C++ -*- /* * File: math_defs.h - * Purpose: Math editor definitions - * Author: Alejandro Aguilar Sierra + * Purpose: Math editor definitions + * Author: Alejandro Aguilar Sierra * 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, diff --git a/src/mathed/math_deliminset.C b/src/mathed/math_deliminset.C index 564bc95532..84525f9d68 100644 --- a/src/mathed/math_deliminset.C +++ b/src/mathed/math_deliminset.C @@ -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) << ")"; diff --git a/src/mathed/math_diffinset.C b/src/mathed/math_diffinset.C index c05620e98a..7708364b2d 100644 --- a/src/mathed/math_diffinset.C +++ b/src/mathed/math_diffinset.C @@ -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"; } - diff --git a/src/mathed/math_diminset.C b/src/mathed/math_diminset.C index c1640dbb7b..e9de770737 100644 --- a/src/mathed/math_diminset.C +++ b/src/mathed/math_diminset.C @@ -1,4 +1,3 @@ - #include "math_diminset.h" #include "Lsstream.h" #include "textpainter.h" diff --git a/src/mathed/math_diminset.h b/src/mathed/math_diminset.h index 601f477b10..64fe5ee58e 100644 --- a/src/mathed/math_diminset.h +++ b/src/mathed/math_diminset.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_; } diff --git a/src/mathed/math_dotsinset.C b/src/mathed/math_dotsinset.C index 6fb6cbacc3..fd25854523 100644 --- a/src/mathed/math_dotsinset.C +++ b/src/mathed/math_dotsinset.C @@ -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 diff --git a/src/mathed/math_dotsinset.h b/src/mathed/math_dotsinset.h index 87869a8421..9ac4f722b9 100644 --- a/src/mathed/math_dotsinset.h +++ b/src/mathed/math_dotsinset.h @@ -29,5 +29,5 @@ protected: mutable int dh_; /// string const name_; -}; +}; #endif diff --git a/src/mathed/math_exfuncinset.C b/src/mathed/math_exfuncinset.C index f9c4f663aa..84ab2df489 100644 --- a/src/mathed/math_exfuncinset.C +++ b/src/mathed/math_exfuncinset.C @@ -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) << '}'; } - - diff --git a/src/mathed/math_exintinset.C b/src/mathed/math_exintinset.C index 81e6b83980..663b527856 100644 --- a/src/mathed/math_exintinset.C +++ b/src/mathed/math_exintinset.C @@ -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 sym(new MathSymbolInset(symbol_)); //if (hasScripts()) // mathmlize(sym, os); - //else + //else sym->mathmlize(os); os << cell(0) << "" << MTag("mrow") << "" @@ -92,4 +92,3 @@ void MathExIntInset::write(WriteStream &) const { lyxerr << "should not happen" << endl; } - diff --git a/src/mathed/math_extern.C b/src/mathed/math_extern.C index 1681338fc1..3cf02b2bd2 100644 --- a/src/mathed/math_extern.C +++ b/src/mathed/math_extern.C @@ -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"); } } - diff --git a/src/mathed/math_factory.C b/src/mathed/math_factory.C index 3200046176..8aec0d4313 100644 --- a/src/mathed/math_factory.C +++ b/src/mathed/math_factory.C @@ -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"; diff --git a/src/mathed/math_fracbase.h b/src/mathed/math_fracbase.h index 71d0b9418b..32d601f347 100644 --- a/src/mathed/math_fracbase.h +++ b/src/mathed/math_fracbase.h @@ -12,7 +12,7 @@ class MathFracbaseInset : public MathNestInset { public: /// MathFracbaseInset(); - /// + /// bool idxUpDown(idx_type &, bool up) const; /// bool idxLeft(idx_type &, pos_type &) const; diff --git a/src/mathed/math_fracinset.C b/src/mathed/math_fracinset.C index 26af46aa5b..6e27e9079c 100644 --- a/src/mathed/math_fracinset.C +++ b/src/mathed/math_fracinset.C @@ -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 "; diff --git a/src/mathed/math_funcinset.C b/src/mathed/math_funcinset.C index d92ec01ede..6f24b2f475 100644 --- a/src/mathed/math_funcinset.C +++ b/src/mathed/math_funcinset.C @@ -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_); } diff --git a/src/mathed/math_funcliminset.C b/src/mathed/math_funcliminset.C index 01c83892e2..dba26a2aa9 100644 --- a/src/mathed/math_funcliminset.C +++ b/src/mathed/math_funcliminset.C @@ -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_); } diff --git a/src/mathed/math_gridinset.C b/src/mathed/math_gridinset.C index 2829a14be8..31143b20c2 100644 --- a/src/mathed/math_gridinset.C +++ b/src/mathed/math_gridinset.C @@ -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); } diff --git a/src/mathed/math_gridinset.h b/src/mathed/math_gridinset.h index 69680a30c8..58d6af14b6 100644 --- a/src/mathed/math_gridinset.h +++ b/src/mathed/math_gridinset.h @@ -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_; /// column info std::vector colinfo_; - /// + /// char v_align_; // add approp. type }; diff --git a/src/mathed/math_hash.C b/src/mathed/math_hash.C index f3d20ce72e..62047308db 100644 --- a/src/mathed/math_hash.C +++ b/src/mathed/math_hash.C @@ -27,7 +27,7 @@ struct key_type { }; -key_type wordlist_array[] = +key_type wordlist_array[] = { {"!", LM_TK_SPACE, 0}, {"#", LM_TK_SPECIAL, '#'}, diff --git a/src/mathed/math_hullinset.C b/src/mathed/math_hullinset.C index d1736f34d7..8a8dbee8aa 100644 --- a/src/mathed/math_hullinset.C +++ b/src/mathed/math_hullinset.C @@ -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(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()); } - - diff --git a/src/mathed/math_hullinset.h b/src/mathed/math_hullinset.h index f112a1c785..6f234e7d0d 100644 --- a/src/mathed/math_hullinset.h +++ b/src/mathed/math_hullinset.h @@ -15,7 +15,7 @@ class LaTeXFeatures; class MathHullInset : public MathGridInset { -public: +public: /// MathHullInset(); /// diff --git a/src/mathed/math_inset.C b/src/mathed/math_inset.C index 526e89c93f..ef12d2c77b 100644 --- a/src/mathed/math_inset.C +++ b/src/mathed/math_inset.C @@ -1,9 +1,9 @@ /* * File: math_inset.C * Purpose: Implementation of insets for mathed - * Author: Alejandro Aguilar Sierra + * Author: Alejandro Aguilar Sierra * Created: January 1996 - * Description: + * Description: * * Dependencies: Xlib, XForms * diff --git a/src/mathed/math_inset.h b/src/mathed/math_inset.h index 2f783048c1..6cbcf808f9 100644 --- a/src/mathed/math_inset.h +++ b/src/mathed/math_inset.h @@ -1,8 +1,8 @@ // -*- C++ -*- /* * File: math_inset.h - * Purpose: Declaration of insets for mathed - * Author: Alejandro Aguilar Sierra + * Purpose: Declaration of insets for mathed + * Author: Alejandro Aguilar Sierra * 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 diff --git a/src/mathed/math_iterator.C b/src/mathed/math_iterator.C index 9d4e9c11ba..628ead5cab 100644 --- a/src/mathed/math_iterator.C +++ b/src/mathed/math_iterator.C @@ -1,4 +1,3 @@ - #include #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(); } diff --git a/src/mathed/math_iterator.h b/src/mathed/math_iterator.h index 70fdef85c7..d30bd47529 100644 --- a/src/mathed/math_iterator.h +++ b/src/mathed/math_iterator.h @@ -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 diff --git a/src/mathed/math_kerninset.C b/src/mathed/math_kerninset.C index ae853e35b7..42b5514ba2 100644 --- a/src/mathed/math_kerninset.C +++ b/src/mathed/math_kerninset.C @@ -59,4 +59,3 @@ void MathKernInset::normalize(NormalStream & os) const { os << "[kern " << wid_.asLatexString() << "]"; } - diff --git a/src/mathed/math_limitopinset.C b/src/mathed/math_limitopinset.C index 7f3dfce4e0..d92e7a69a1 100644 --- a/src/mathed/math_limitopinset.C +++ b/src/mathed/math_limitopinset.C @@ -38,7 +38,7 @@ void MathLimitOpInset::metrics(MathMetricsInfo const &) const void MathLimitOpInset::draw(Painter &, int, int) const -{ +{ lyxerr << "should not happen\n"; } diff --git a/src/mathed/math_macro.C b/src/mathed/math_macro.C index 69e14928f1..b1360a33a5 100644 --- a/src/mathed/math_macro.C +++ b/src/mathed/math_macro.C @@ -1,7 +1,7 @@ /* * File: math_macro.C - * Purpose: Implementation of macro class for mathed - * Author: Alejandro Aguilar Sierra + * Purpose: Implementation of macro class for mathed + * Author: Alejandro Aguilar Sierra * 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 << ' '; } diff --git a/src/mathed/math_macro.h b/src/mathed/math_macro.h index c43ed9cd88..cf1b593206 100644 --- a/src/mathed/math_macro.h +++ b/src/mathed/math_macro.h @@ -1,8 +1,8 @@ // -*- C++ -*- /* * File: math_macro.h - * Purpose: Declaration of macro class for mathed - * Author: Alejandro Aguilar Sierra + * Purpose: Declaration of macro class for mathed + * Author: Alejandro Aguilar Sierra * Created: November 1996 * Description: WYSIWYG math macros * diff --git a/src/mathed/math_macroarg.C b/src/mathed/math_macroarg.C index 2f68f11e89..8033d70b84 100644 --- a/src/mathed/math_macroarg.C +++ b/src/mathed/math_macroarg.C @@ -77,4 +77,3 @@ void MathMacroArgument::substitute(MathMacro const & m) it->nucleus()->handleFont(code_); expanded_ = true; } - diff --git a/src/mathed/math_macrotable.C b/src/mathed/math_macrotable.C index 58e0766051..f98f6c8265 100644 --- a/src/mathed/math_macrotable.C +++ b/src/mathed/math_macrotable.C @@ -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"; diff --git a/src/mathed/math_macrotemplate.h b/src/mathed/math_macrotemplate.h index bab64d1500..726874ff84 100644 --- a/src/mathed/math_macrotemplate.h +++ b/src/mathed/math_macrotemplate.h @@ -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: diff --git a/src/mathed/math_matrixinset.C b/src/mathed/math_matrixinset.C index 1f43e5a9b0..25cece5aa9 100644 --- a/src/mathed/math_matrixinset.C +++ b/src/mathed/math_matrixinset.C @@ -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 << ']'; } diff --git a/src/mathed/math_matrixinset.h b/src/mathed/math_matrixinset.h index f4f2a0aceb..dd1636131b 100644 --- a/src/mathed/math_matrixinset.h +++ b/src/mathed/math_matrixinset.h @@ -11,7 +11,7 @@ // "shortcut" for DelimInset("(",ArrayInset,")") class MathMatrixInset : public MathArrayInset { -public: +public: /// MathMatrixInset(MathArrayInset const &); /// diff --git a/src/mathed/math_nestinset.C b/src/mathed/math_nestinset.C index 0a8df20621..6a11a9dbfe 100644 --- a/src/mathed/math_nestinset.C +++ b/src/mathed/math_nestinset.C @@ -182,4 +182,3 @@ bool MathNestInset::editing() const { return mathcursor && mathcursor->isInside(this); } - diff --git a/src/mathed/math_nestinset.h b/src/mathed/math_nestinset.h index db2fc5cffa..78175a7506 100644 --- a/src/mathed/math_nestinset.h +++ b/src/mathed/math_nestinset.h @@ -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" diff --git a/src/mathed/math_notinset.C b/src/mathed/math_notinset.C index c40640ff3e..ce3db3945c 100644 --- a/src/mathed/math_notinset.C +++ b/src/mathed/math_notinset.C @@ -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 diff --git a/src/mathed/math_parser.C b/src/mathed/math_parser.C index 274e29ae38..f7cead75b0 100644 --- a/src/mathed/math_parser.C +++ b/src/mathed/math_parser.C @@ -1,7 +1,7 @@ /* * File: math_parser.C * Purpose: Parser for mathed - * Author: Alejandro Aguilar Sierra + * Author: Alejandro Aguilar Sierra * 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 }; -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(); diff --git a/src/mathed/math_parser.h b/src/mathed/math_parser.h index 45a7610b90..847accc2a6 100644 --- a/src/mathed/math_parser.h +++ b/src/mathed/math_parser.h @@ -2,7 +2,7 @@ /* * File: math_parser.h * Purpose: Declaration of parsing utilities for mathed - * Author: Alejandro Aguilar Sierra + * Author: Alejandro Aguilar Sierra * 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, /// diff --git a/src/mathed/math_pos.C b/src/mathed/math_pos.C index 4c36ba1a0c..b4d53521db 100644 --- a/src/mathed/math_pos.C +++ b/src/mathed/math_pos.C @@ -92,5 +92,3 @@ bool operator<(MathCursorPos const & p, MathCursorPos const & q) return p.idx_ < q.idx_; return p.pos_ < q.pos_; } - - diff --git a/src/mathed/math_pos.h b/src/mathed/math_pos.h index 5ffa93ceac..4365d8f8e9 100644 --- a/src/mathed/math_pos.h +++ b/src/mathed/math_pos.h @@ -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 diff --git a/src/mathed/math_rootinset.C b/src/mathed/math_rootinset.C index 696e3b086c..2a7185895d 100644 --- a/src/mathed/math_rootinset.C +++ b/src/mathed/math_rootinset.C @@ -1,7 +1,7 @@ /* * File: math_root.C - * Purpose: Implementation of the root object - * Author: Alejandro Aguilar Sierra + * Purpose: Implementation of the root object + * Author: Alejandro Aguilar Sierra * Created: January 1999 * Description: Root math object * diff --git a/src/mathed/math_rootinset.h b/src/mathed/math_rootinset.h index 303aba5608..46034c651f 100644 --- a/src/mathed/math_rootinset.h +++ b/src/mathed/math_rootinset.h @@ -1,8 +1,8 @@ // -*- C++ -*- /* * File: math_root.h - * Purpose: Declaration of the root object - * Author: Alejandro Aguilar Sierra + * Purpose: Declaration of the root object + * Author: Alejandro Aguilar Sierra * Created: January 1999 * Description: Root math object * diff --git a/src/mathed/math_scriptinset.C b/src/mathed/math_scriptinset.C index 010b8f98fc..637411381e 100644 --- a/src/mathed/math_scriptinset.C +++ b/src/mathed/math_scriptinset.C @@ -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_ << ')'; } - - diff --git a/src/mathed/math_scriptinset.h b/src/mathed/math_scriptinset.h index 15eb649f61..29049e9e27 100644 --- a/src/mathed/math_scriptinset.h +++ b/src/mathed/math_scriptinset.h @@ -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 - diff --git a/src/mathed/math_sizeinset.h b/src/mathed/math_sizeinset.h index d9e992e27d..048ffd498a 100644 --- a/src/mathed/math_sizeinset.h +++ b/src/mathed/math_sizeinset.h @@ -34,7 +34,7 @@ public: void normalize(NormalStream &) const; private: - /// + /// latexkeys const * key_; }; diff --git a/src/mathed/math_spaceinset.C b/src/mathed/math_spaceinset.C index d348218c2b..01c50b98b0 100644 --- a/src/mathed/math_spaceinset.C +++ b/src/mathed/math_spaceinset.C @@ -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_] << ' '; } - - diff --git a/src/mathed/math_specialcharinset.C b/src/mathed/math_specialcharinset.C index 91b9197a8e..b00c832f5b 100644 --- a/src/mathed/math_specialcharinset.C +++ b/src/mathed/math_specialcharinset.C @@ -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_); } diff --git a/src/mathed/math_specialcharinset.h b/src/mathed/math_specialcharinset.h index ab1e717c11..118760ed0c 100644 --- a/src/mathed/math_specialcharinset.h +++ b/src/mathed/math_specialcharinset.h @@ -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; diff --git a/src/mathed/math_splitinset.h b/src/mathed/math_splitinset.h index 540efaf2a8..4225bae7c0 100644 --- a/src/mathed/math_splitinset.h +++ b/src/mathed/math_splitinset.h @@ -11,7 +11,7 @@ class MathSplitInset : public MathGridInset { -public: +public: /// explicit MathSplitInset(string const & name); /// diff --git a/src/mathed/math_sqrtinset.C b/src/mathed/math_sqrtinset.C index 85a0053980..ccece1e119 100644 --- a/src/mathed/math_sqrtinset.C +++ b/src/mathed/math_sqrtinset.C @@ -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(), '\\'); diff --git a/src/mathed/math_stackrelinset.C b/src/mathed/math_stackrelinset.C index 6663718b20..73500944eb 100644 --- a/src/mathed/math_stackrelinset.C +++ b/src/mathed/math_stackrelinset.C @@ -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(); } diff --git a/src/mathed/math_stackrelinset.h b/src/mathed/math_stackrelinset.h index 699dffe402..7c2e8cd475 100644 --- a/src/mathed/math_stackrelinset.h +++ b/src/mathed/math_stackrelinset.h @@ -8,7 +8,7 @@ #pragma interface #endif -/** Stackrel objects +/** Stackrel objects \author André Pönitz */ class MathStackrelInset : public MathFracbaseInset { diff --git a/src/mathed/math_stringinset.C b/src/mathed/math_stringinset.C index c39a4e4ab7..7ad73aa37e 100644 --- a/src/mathed/math_stringinset.C +++ b/src/mathed/math_stringinset.C @@ -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_; } - - diff --git a/src/mathed/math_stringinset.h b/src/mathed/math_stringinset.h index f1aa039d2f..58cfcd3783 100644 --- a/src/mathed/math_stringinset.h +++ b/src/mathed/math_stringinset.h @@ -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; diff --git a/src/mathed/math_substackinset.h b/src/mathed/math_substackinset.h index 788a85edd0..4b3115efcf 100644 --- a/src/mathed/math_substackinset.h +++ b/src/mathed/math_substackinset.h @@ -10,7 +10,7 @@ class MathSubstackInset : public MathGridInset { -public: +public: /// MathSubstackInset(); /// diff --git a/src/mathed/math_support.C b/src/mathed/math_support.C index edb659011a..29b9f171eb 100644 --- a/src/mathed/math_support.C +++ b/src/mathed/math_support.C @@ -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 + " "; } - - diff --git a/src/mathed/math_symbolinset.C b/src/mathed/math_symbolinset.C index 962e34d219..952dc816ae 100644 --- a/src/mathed/math_symbolinset.C +++ b/src/mathed/math_symbolinset.C @@ -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(); } - - diff --git a/src/mathed/math_undersetinset.C b/src/mathed/math_undersetinset.C index 112401e823..c06fa46dda 100644 --- a/src/mathed/math_undersetinset.C +++ b/src/mathed/math_undersetinset.C @@ -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; } diff --git a/src/mathed/math_undersetinset.h b/src/mathed/math_undersetinset.h index bfb66fe126..35ed008fee 100644 --- a/src/mathed/math_undersetinset.h +++ b/src/mathed/math_undersetinset.h @@ -8,7 +8,7 @@ #pragma interface #endif -/** Underset objects +/** Underset objects \author André Pönitz */ class MathUndersetInset : public MathFracbaseInset { diff --git a/src/mathed/math_unknowninset.C b/src/mathed/math_unknowninset.C index ad14c66d1c..3c8b54319a 100644 --- a/src/mathed/math_unknowninset.C +++ b/src/mathed/math_unknowninset.C @@ -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_); } diff --git a/src/mathed/math_xarrowinset.C b/src/mathed/math_xarrowinset.C index 217d95a2f7..32959e666e 100644 --- a/src/mathed/math_xarrowinset.C +++ b/src/mathed/math_xarrowinset.C @@ -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_); } diff --git a/src/mathed/math_xdata.C b/src/mathed/math_xdata.C index e0bb7bac49..292d82d7b1 100644 --- a/src/mathed/math_xdata.C +++ b/src/mathed/math_xdata.C @@ -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); diff --git a/src/mathed/math_xdata.h b/src/mathed/math_xdata.h index 48518de561..41e4eedaab 100644 --- a/src/mathed/math_xdata.h +++ b/src/mathed/math_xdata.h @@ -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_; diff --git a/src/mathed/math_xyarrowinset.C b/src/mathed/math_xyarrowinset.C index 4a48b4228d..5f3489f3e3 100644 --- a/src/mathed/math_xyarrowinset.C +++ b/src/mathed/math_xyarrowinset.C @@ -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); - + } } diff --git a/src/mathed/math_xyarrowinset.h b/src/mathed/math_xyarrowinset.h index a9022ee6ae..a6534e23b7 100644 --- a/src/mathed/math_xyarrowinset.h +++ b/src/mathed/math_xyarrowinset.h @@ -13,7 +13,7 @@ class MathXYMatrixInset; class MathXYArrowInset : public MathNestInset { -public: +public: /// MathXYArrowInset(); /// diff --git a/src/mathed/math_xymatrixinset.h b/src/mathed/math_xymatrixinset.h index 1522fc4a01..3cabea91d5 100644 --- a/src/mathed/math_xymatrixinset.h +++ b/src/mathed/math_xymatrixinset.h @@ -10,7 +10,7 @@ class MathXYMatrixInset : public MathGridInset { -public: +public: /// MathXYMatrixInset(); /// -- 2.39.2