From: André Pönitz Date: Mon, 5 Nov 2007 23:46:17 +0000 (+0000) Subject: #include cosmetics X-Git-Tag: 1.6.10~7465 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=9daf07588f49b52eb5e2fd5e8e8a58705e2e447e;p=features.git #include cosmetics git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21459 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/mathed/InsetMath.cpp b/src/mathed/InsetMath.cpp index 5147dd1e8c..00c3fc3df2 100644 --- a/src/mathed/InsetMath.cpp +++ b/src/mathed/InsetMath.cpp @@ -17,6 +17,7 @@ #include "gettext.h" #include "debug.h" +#include "support/docstream.h" #include "support/lstrings.h" #include "support/textutils.h" diff --git a/src/mathed/InsetMathAMSArray.cpp b/src/mathed/InsetMathAMSArray.cpp index 4ec493f03f..cfe9a179ae 100644 --- a/src/mathed/InsetMathAMSArray.cpp +++ b/src/mathed/InsetMathAMSArray.cpp @@ -10,12 +10,13 @@ #include -#include "LaTeXFeatures.h" #include "InsetMathAMSArray.h" + +#include "LaTeXFeatures.h" #include "MathData.h" #include "MathStream.h" -#include "MathStream.h" #include "MathSupport.h" +#include "MetricsInfo.h" #include "FuncRequest.h" #include "FuncStatus.h" diff --git a/src/mathed/InsetMathArray.cpp b/src/mathed/InsetMathArray.cpp index 8ce2b8f676..bbfb583b9e 100644 --- a/src/mathed/InsetMathArray.cpp +++ b/src/mathed/InsetMathArray.cpp @@ -10,11 +10,13 @@ #include -#include "LaTeXFeatures.h" #include "InsetMathArray.h" + +#include "LaTeXFeatures.h" #include "MathData.h" #include "MathParser.h" #include "MathStream.h" +#include "MetricsInfo.h" #include "support/lstrings.h" diff --git a/src/mathed/InsetMathBig.cpp b/src/mathed/InsetMathBig.cpp index 117127e882..cbd5c8a4f0 100644 --- a/src/mathed/InsetMathBig.cpp +++ b/src/mathed/InsetMathBig.cpp @@ -11,9 +11,10 @@ #include #include "InsetMathBig.h" + #include "MathSupport.h" #include "MathStream.h" -#include "MathStream.h" +#include "MetricsInfo.h" #include "frontends/FontMetrics.h" diff --git a/src/mathed/InsetMathBox.cpp b/src/mathed/InsetMathBox.cpp index 36c1c16350..3056c72dbc 100644 --- a/src/mathed/InsetMathBox.cpp +++ b/src/mathed/InsetMathBox.cpp @@ -11,10 +11,12 @@ #include #include "InsetMathBox.h" + #include "MathData.h" #include "MathStream.h" -#include "MathStream.h" -#include "support/std_ostream.h" +#include "MetricsInfo.h" + +#include namespace lyx { diff --git a/src/mathed/InsetMathBoxed.cpp b/src/mathed/InsetMathBoxed.cpp index b2394a737c..ea4aabc717 100644 --- a/src/mathed/InsetMathBoxed.cpp +++ b/src/mathed/InsetMathBoxed.cpp @@ -11,13 +11,16 @@ #include #include "InsetMathBoxed.h" + +#include "LaTeXFeatures.h" #include "MathData.h" #include "MathStream.h" -#include "LaTeXFeatures.h" +#include "MetricsInfo.h" -#include "support/std_ostream.h" #include "frontends/Painter.h" +#include + namespace lyx { diff --git a/src/mathed/InsetMathBrace.cpp b/src/mathed/InsetMathBrace.cpp index 769474941e..82797359fe 100644 --- a/src/mathed/InsetMathBrace.cpp +++ b/src/mathed/InsetMathBrace.cpp @@ -11,14 +11,17 @@ #include #include "InsetMathBrace.h" + #include "MathData.h" #include "MathStream.h" #include "MathSupport.h" +#include "MetricsInfo.h" #include "frontends/FontMetrics.h" #include "frontends/Painter.h" -#include "support/std_ostream.h" +#include + namespace lyx { diff --git a/src/mathed/InsetMathCases.cpp b/src/mathed/InsetMathCases.cpp index ccbbee508a..ee0b4da33b 100644 --- a/src/mathed/InsetMathCases.cpp +++ b/src/mathed/InsetMathCases.cpp @@ -11,18 +11,21 @@ #include #include "InsetMathCases.h" -#include "MathData.h" -#include "MathStream.h" -#include "MathSupport.h" -#include "FuncStatus.h" -#include "LaTeXFeatures.h" -#include "support/std_ostream.h" + #include "Cursor.h" #include "FuncRequest.h" +#include "FuncStatus.h" #include "gettext.h" +#include "LaTeXFeatures.h" +#include "MathData.h" +#include "MathStream.h" +#include "MathSupport.h" +#include "MetricsInfo.h" #include "support/lstrings.h" +#include + namespace lyx { diff --git a/src/mathed/InsetMathChar.cpp b/src/mathed/InsetMathChar.cpp index f1e21131e1..d985d5d69a 100644 --- a/src/mathed/InsetMathChar.cpp +++ b/src/mathed/InsetMathChar.cpp @@ -12,8 +12,10 @@ #include #include "InsetMathChar.h" + #include "MathSupport.h" #include "MathStream.h" +#include "MetricsInfo.h" #include "debug.h" #include "Dimension.h" @@ -28,19 +30,16 @@ namespace lyx { extern bool has_math_fonts; -namespace { - - bool isBinaryOp(char_type c) - { - return support::contains("+-<>=/*", static_cast(c)); - } +static bool isBinaryOp(char_type c) +{ + return support::contains("+-<>=/*", static_cast(c)); +} - bool slanted(char_type c) - { - return ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z'); - } +static bool slanted(char_type c) +{ + return ('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z'); } diff --git a/src/mathed/InsetMathColor.cpp b/src/mathed/InsetMathColor.cpp index e69b690db8..9246f3d459 100644 --- a/src/mathed/InsetMathColor.cpp +++ b/src/mathed/InsetMathColor.cpp @@ -11,13 +11,15 @@ #include #include "Color.h" + #include "InsetMathColor.h" +#include "LaTeXFeatures.h" #include "MathData.h" #include "MathStream.h" #include "MathSupport.h" -#include "LaTeXFeatures.h" +#include "MetricsInfo.h" -#include "support/std_ostream.h" +#include namespace lyx { diff --git a/src/mathed/InsetMathDecoration.cpp b/src/mathed/InsetMathDecoration.cpp index 1dc8a1471b..d2a739c4b5 100644 --- a/src/mathed/InsetMathDecoration.cpp +++ b/src/mathed/InsetMathDecoration.cpp @@ -12,15 +12,17 @@ #include #include "InsetMathDecoration.h" + #include "MathData.h" #include "MathParser.h" #include "MathSupport.h" #include "MathStream.h" +#include "MetricsInfo.h" #include "LaTeXFeatures.h" #include "debug.h" -#include "support/std_ostream.h" +#include namespace lyx { diff --git a/src/mathed/InsetMathDelim.cpp b/src/mathed/InsetMathDelim.cpp index 78d9523428..3580ed683e 100644 --- a/src/mathed/InsetMathDelim.cpp +++ b/src/mathed/InsetMathDelim.cpp @@ -12,9 +12,11 @@ #include #include "InsetMathDelim.h" + #include "MathData.h" #include "MathStream.h" #include "MathSupport.h" +#include "MetricsInfo.h" #include "frontends/FontMetrics.h" diff --git a/src/mathed/InsetMathDots.cpp b/src/mathed/InsetMathDots.cpp index fa93e4bb92..7bbfa0b3e0 100644 --- a/src/mathed/InsetMathDots.cpp +++ b/src/mathed/InsetMathDots.cpp @@ -12,9 +12,11 @@ #include #include "InsetMathDots.h" + #include "MathStream.h" #include "MathSupport.h" #include "MathParser.h" +#include "MetricsInfo.h" #include "frontends/FontMetrics.h" diff --git a/src/mathed/InsetMathExFunc.cpp b/src/mathed/InsetMathExFunc.cpp index f2471173ed..360f1c17ef 100644 --- a/src/mathed/InsetMathExFunc.cpp +++ b/src/mathed/InsetMathExFunc.cpp @@ -11,10 +11,13 @@ #include #include "InsetMathExFunc.h" + #include "MathData.h" #include "MathStream.h" -#include "MathStream.h" #include "MathSupport.h" +#include "MetricsInfo.h" + +#include "support/docstream.h" namespace lyx { @@ -124,7 +127,9 @@ void InsetMathExFunc::mathematica(MathematicaStream & os) const void InsetMathExFunc::mathmlize(MathStream & os) const { - os << MTag(name_.c_str()) << cell(0) << ETag(name_.c_str()); + ++os.tab(); os.cr(); os.os() << '<' << name_ << '>'; + os << cell(0); + os.cr(); --os.tab(); os.os() << "'; } diff --git a/src/mathed/InsetMathFBox.cpp b/src/mathed/InsetMathFBox.cpp index c8d939d5ec..2164ea7433 100644 --- a/src/mathed/InsetMathFBox.cpp +++ b/src/mathed/InsetMathFBox.cpp @@ -11,12 +11,15 @@ #include #include "InsetMathFBox.h" + #include "MathData.h" #include "MathStream.h" +#include "MetricsInfo.h" -#include "support/std_ostream.h" #include "frontends/Painter.h" +#include + namespace lyx { diff --git a/src/mathed/InsetMathFont.cpp b/src/mathed/InsetMathFont.cpp index 81b54be10b..33f65751ad 100644 --- a/src/mathed/InsetMathFont.cpp +++ b/src/mathed/InsetMathFont.cpp @@ -11,11 +11,14 @@ #include #include "InsetMathFont.h" + +#include "LaTeXFeatures.h" #include "MathData.h" #include "MathStream.h" #include "MathParser.h" -#include "LaTeXFeatures.h" -#include "support/std_ostream.h" +#include "MetricsInfo.h" + +#include namespace lyx { diff --git a/src/mathed/InsetMathFontOld.cpp b/src/mathed/InsetMathFontOld.cpp index 2df5a1f8d9..c46defe897 100644 --- a/src/mathed/InsetMathFontOld.cpp +++ b/src/mathed/InsetMathFontOld.cpp @@ -11,11 +11,13 @@ #include #include "InsetMathFontOld.h" + #include "MathData.h" #include "MathStream.h" #include "MathParser.h" -#include "MathStream.h" -#include "support/std_ostream.h" +#include "MetricsInfo.h" + +#include namespace lyx { diff --git a/src/mathed/InsetMathFrac.cpp b/src/mathed/InsetMathFrac.cpp index aef7818e5d..5f4fc29ce4 100644 --- a/src/mathed/InsetMathFrac.cpp +++ b/src/mathed/InsetMathFrac.cpp @@ -18,6 +18,7 @@ #include "MathData.h" #include "MathStream.h" #include "MathSupport.h" +#include "MetricsInfo.h" #include "TextPainter.h" #include "frontends/Painter.h" diff --git a/src/mathed/InsetMathFrameBox.cpp b/src/mathed/InsetMathFrameBox.cpp index f05da83d87..4646f5e9e1 100644 --- a/src/mathed/InsetMathFrameBox.cpp +++ b/src/mathed/InsetMathFrameBox.cpp @@ -11,9 +11,12 @@ #include #include "InsetMathFrameBox.h" + #include "MathData.h" #include "MathStream.h" #include "MathSupport.h" +#include "MetricsInfo.h" + #include "frontends/Painter.h" diff --git a/src/mathed/InsetMathGrid.cpp b/src/mathed/InsetMathGrid.cpp index 5c7d1d1fb7..ce637a72d8 100644 --- a/src/mathed/InsetMathGrid.cpp +++ b/src/mathed/InsetMathGrid.cpp @@ -11,9 +11,11 @@ #include #include "InsetMathGrid.h" + #include "MathData.h" #include "MathParser.h" #include "MathStream.h" +#include "MetricsInfo.h" #include "BufferView.h" #include "CutAndPaste.h" @@ -27,6 +29,7 @@ #include "frontends/Painter.h" #include "support/lstrings.h" +#include "support/docstream.h" #include diff --git a/src/mathed/InsetMathHull.cpp b/src/mathed/InsetMathHull.cpp index 31befd95e4..c144bdcb50 100644 --- a/src/mathed/InsetMathHull.cpp +++ b/src/mathed/InsetMathHull.cpp @@ -1468,28 +1468,29 @@ int InsetMathHull::docbook(Buffer const & buf, odocstream & os, docstring bname = name; if (!label(0).empty()) bname += " id='" + sgml::cleanID(buf, runparams, label(0)) + "'"; - ms << MTag(bname); + + ++ms.tab(); ms.cr(); ms.os() << '<' << bname << '>'; odocstringstream ls; if (runparams.flavor == OutputParams::XML) { - ms << MTag(from_ascii("alt role='tex' ")); + ms << MTag("alt role='tex' "); // Workaround for db2latex: db2latex always includes equations with // \ensuremath{} or \begin{display}\end{display} // so we strip LyX' math environment WriteStream wi(ls, false, false); InsetMathGrid::write(wi); ms << from_utf8(subst(subst(to_utf8(ls.str()), "&", "&"), "<", "<")); - ms << ETag(from_ascii("alt")); - ms << MTag(from_ascii("math")); - ms << ETag(from_ascii("alt")); - ms << MTag(from_ascii("math")); + ms << ETag("alt"); + ms << MTag("math"); + ms << ETag("alt"); + ms << MTag("math"); InsetMathGrid::mathmlize(ms); - ms << ETag(from_ascii("math")); + ms << ETag("math"); } else { - ms << MTag(from_ascii("alt role='tex'")); + ms << MTag("alt role='tex'"); res = latex(buf, ls, runparams); ms << from_utf8(subst(subst(to_utf8(ls.str()), "&", "&"), "<", "<")); - ms << ETag(from_ascii("alt")); + ms << ETag("alt"); } ms << from_ascii(""); - ms << ETag(name); + ms.cr(); --ms.tab(); ms.os() << "'; + return ms.line() + res; } diff --git a/src/mathed/InsetMathNest.cpp b/src/mathed/InsetMathNest.cpp index f2f55151dd..014002d0da 100644 --- a/src/mathed/InsetMathNest.cpp +++ b/src/mathed/InsetMathNest.cpp @@ -49,6 +49,7 @@ #include "support/lstrings.h" #include "support/textutils.h" +#include "support/docstream.h" #include "frontends/Clipboard.h" #include "frontends/Painter.h" diff --git a/src/mathed/MathData.cpp b/src/mathed/MathData.cpp index dc180ccb8e..d9d42c34ae 100644 --- a/src/mathed/MathData.cpp +++ b/src/mathed/MathData.cpp @@ -12,6 +12,7 @@ #include #include "MathData.h" + #include "InsetMathBrace.h" #include "InsetMathFont.h" #include "InsetMathScript.h" @@ -19,6 +20,7 @@ #include "MathMacro.h" #include "MathStream.h" #include "MathSupport.h" +#include "MetricsInfo.h" #include "ReplaceData.h" #include "Buffer.h" @@ -27,6 +29,8 @@ #include "Cursor.h" #include "debug.h" +#include "support/docstream.h" + #include "frontends/FontMetrics.h" #include "frontends/Painter.h" diff --git a/src/mathed/MathExtern.cpp b/src/mathed/MathExtern.cpp index 50d5ab5a9b..13fd640ce9 100644 --- a/src/mathed/MathExtern.cpp +++ b/src/mathed/MathExtern.cpp @@ -15,10 +15,11 @@ #include #include "MathExtern.h" + +#include "debug.h" #include "InsetMathArray.h" #include "InsetMathChar.h" #include "InsetMathDelim.h" -#include "MathData.h" #include "InsetMathDiff.h" #include "InsetMathExFunc.h" #include "InsetMathExInt.h" @@ -26,13 +27,15 @@ #include "InsetMathFrac.h" #include "InsetMathLim.h" #include "InsetMathMatrix.h" -#include "MathStream.h" #include "InsetMathNumber.h" #include "InsetMathScript.h" #include "InsetMathString.h" #include "InsetMathSymbol.h" +#include "MathData.h" #include "MathParser.h" -#include "debug.h" +#include "MathStream.h" + +#include "support/docstream.h" #include "support/filetools.h" #include "support/lstrings.h" #include "support/lyxlib.h" diff --git a/src/mathed/MathMacroTemplate.cpp b/src/mathed/MathMacroTemplate.cpp index b6dfba17b1..bc9e3dbf12 100644 --- a/src/mathed/MathMacroTemplate.cpp +++ b/src/mathed/MathMacroTemplate.cpp @@ -1,5 +1,5 @@ /** - * \file math_macrotemplate.C + * \file MathMacroTemplate.cpp * This file is part of LyX, the document processor. * Licence details can be found in the file COPYING. * @@ -10,13 +10,14 @@ #include +#include "MathMacroTemplate.h" + #include "DocIterator.h" #include "InsetMathBrace.h" #include "InsetMathChar.h" #include "InsetMathSqrt.h" #include "MathMacro.h" #include "MathMacroArgument.h" -#include "MathMacroTemplate.h" #include "MathStream.h" #include "MathParser.h" #include "MathSupport.h" @@ -37,14 +38,11 @@ #include "frontends/Painter.h" #include "support/convert.h" +#include "support/docstream.h" #include "support/lstrings.h" #include "debug.h" -#include -#include -#include - #include @@ -100,10 +98,10 @@ MathMacroTemplate::MathMacroTemplate() } -MathMacroTemplate::MathMacroTemplate(docstring const & name, int numargs, int optionals, - docstring const & type, - std::vector const & optionalValues, - MathData const & def, MathData const & display) +MathMacroTemplate::MathMacroTemplate(docstring const & name, int numargs, + int optionals, docstring const & type, + std::vector const & optionalValues, + MathData const & def, MathData const & display) : InsetMathNest(optionals + 3), numargs_(numargs), optionals_(optionals), optionalValues_(optionalValues), type_(type) { @@ -586,7 +584,7 @@ void MathMacroTemplate::doDispatch(Cursor & cur, FuncRequest & cmd) } -bool MathMacroTemplate::getStatus(Cursor & cur, FuncRequest const & cmd, +bool MathMacroTemplate::getStatus(Cursor & /*cur*/, FuncRequest const & cmd, FuncStatus & flag) const { bool ret = true; diff --git a/src/mathed/MathStream.cpp b/src/mathed/MathStream.cpp index 31f69518de..b5fe0c9a85 100644 --- a/src/mathed/MathStream.cpp +++ b/src/mathed/MathStream.cpp @@ -10,14 +10,17 @@ #include +#include "MathStream.h" + #include "InsetMath.h" #include "MathData.h" #include "MathExtern.h" -#include "MathStream.h" #include "support/textutils.h" #include +#include + namespace lyx { @@ -225,7 +228,7 @@ MathStream & operator<<(MathStream & ms, MTag const & t) { ++ms.tab(); ms.cr(); - ms.os() << '<' << t.tag_ << '>'; + ms.os() << '<' << from_ascii(t.tag_) << '>'; return ms; } @@ -235,7 +238,7 @@ MathStream & operator<<(MathStream & ms, ETag const & t) ms.cr(); if (ms.tab() > 0) --ms.tab(); - ms.os() << "'; + ms.os() << "'; return ms; } diff --git a/src/mathed/MathStream.h b/src/mathed/MathStream.h index 7787949d01..b107d78abe 100644 --- a/src/mathed/MathStream.h +++ b/src/mathed/MathStream.h @@ -12,14 +12,10 @@ #ifndef MATH_MATHMLSTREAM_H #define MATH_MATHMLSTREAM_H +#include "support/strfwd.h" -// Please keep all four streams in one file until the interface has -// settled. - - +// FIXME: Move to individual insets #include "MetricsInfo.h" -#include "support/docstream.h" -#include "support/docstring.h" namespace lyx { @@ -95,21 +91,17 @@ WriteStream & operator<<(WriteStream &, unsigned int); class MTag { public: /// - MTag(docstring const tag) : tag_(tag) {} + MTag(char const * const tag) : tag_(tag) {} /// - MTag(char const * const tag) : tag_(from_ascii(tag)) {} - /// - docstring const tag_; + char const * const tag_; }; class ETag { public: /// - ETag(docstring const tag) : tag_(tag) {} - /// - ETag(char const * const tag) : tag_(from_ascii(tag)) {} + ETag(char const * const tag) : tag_(tag) {} /// - docstring const tag_; + char const * const tag_; }; class MathStream { diff --git a/src/mathed/MathSupport.cpp b/src/mathed/MathSupport.cpp index a01b9294ae..ef352584fd 100644 --- a/src/mathed/MathSupport.cpp +++ b/src/mathed/MathSupport.cpp @@ -11,14 +11,17 @@ #include +#include "MathSupport.h" + #include "InsetMath.h" #include "MathData.h" #include "MathParser.h" #include "MathStream.h" -#include "MathSupport.h" #include "debug.h" +#include "support/docstream.h" + #include "frontends/FontLoader.h" #include "frontends/FontMetrics.h" #include "frontends/Painter.h" @@ -33,7 +36,6 @@ using frontend::Painter; using std::max; using std::endl; -using std::vector; ///