]> git.lyx.org Git - lyx.git/commitdiff
#include cosmetics
authorAndré Pönitz <poenitz@gmx.net>
Mon, 5 Nov 2007 23:46:17 +0000 (23:46 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Mon, 5 Nov 2007 23:46:17 +0000 (23:46 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21459 a592a061-630c-0410-9148-cb99ea01b6c8

28 files changed:
src/mathed/InsetMath.cpp
src/mathed/InsetMathAMSArray.cpp
src/mathed/InsetMathArray.cpp
src/mathed/InsetMathBig.cpp
src/mathed/InsetMathBox.cpp
src/mathed/InsetMathBoxed.cpp
src/mathed/InsetMathBrace.cpp
src/mathed/InsetMathCases.cpp
src/mathed/InsetMathChar.cpp
src/mathed/InsetMathColor.cpp
src/mathed/InsetMathDecoration.cpp
src/mathed/InsetMathDelim.cpp
src/mathed/InsetMathDots.cpp
src/mathed/InsetMathExFunc.cpp
src/mathed/InsetMathFBox.cpp
src/mathed/InsetMathFont.cpp
src/mathed/InsetMathFontOld.cpp
src/mathed/InsetMathFrac.cpp
src/mathed/InsetMathFrameBox.cpp
src/mathed/InsetMathGrid.cpp
src/mathed/InsetMathHull.cpp
src/mathed/InsetMathNest.cpp
src/mathed/MathData.cpp
src/mathed/MathExtern.cpp
src/mathed/MathMacroTemplate.cpp
src/mathed/MathStream.cpp
src/mathed/MathStream.h
src/mathed/MathSupport.cpp

index 5147dd1e8ca5be0d73c95ca986ebff9d598a0ca7..00c3fc3df258eb679ba595b1a329f60b283ae82d 100644 (file)
@@ -17,6 +17,7 @@
 #include "gettext.h"
 #include "debug.h"
 
+#include "support/docstream.h"
 #include "support/lstrings.h"
 #include "support/textutils.h"
 
index 4ec493f03fcf7eb5156c3bf3916a2e4531d485ea..cfe9a179ae11d5958d8e8230f68bbd24285452ba 100644 (file)
 
 #include <config.h>
 
-#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"
index 8ce2b8f676758bab948de7553bc1fead6610f8a4..bbfb583b9e4ae57bb189962f23c52c0cc2188743 100644 (file)
 
 #include <config.h>
 
-#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"
 
index 117127e882ba2c303dfaa453d0b1e72dd3e2bef5..cbd5c8a4f0d71ae5b51cc6133fa7a3628e34c9b8 100644 (file)
 #include <config.h>
 
 #include "InsetMathBig.h"
+
 #include "MathSupport.h"
 #include "MathStream.h"
-#include "MathStream.h"
+#include "MetricsInfo.h"
 
 #include "frontends/FontMetrics.h"
 
index 36c1c163506fbda5defb4a6e9f34c8500572380a..3056c72dbc14530d43a842512e790df03d0ace0a 100644 (file)
 #include <config.h>
 
 #include "InsetMathBox.h"
+
 #include "MathData.h"
 #include "MathStream.h"
-#include "MathStream.h"
-#include "support/std_ostream.h"
+#include "MetricsInfo.h"
+
+#include <ostream>
 
 
 namespace lyx {
index b2394a737c1b0c0119b0f801fdcfb89c4d91a02b..ea4aabc717248f45e2b14322e2cbbf827c034d8a 100644 (file)
 #include <config.h>
 
 #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 <ostream>
+
 
 namespace lyx {
 
index 769474941e5e86afa38536d90b1a95a14c22ec15..82797359feb79d93efb4c0ddc1215c3db488de2b 100644 (file)
 #include <config.h>
 
 #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 <ostream>
+
 
 namespace lyx {
 
index ccbbee508ab36edcf32ee95f3d2dd0c3d0c00d06..ee0b4da33bf5dc32c096ea049c62d2f248028070 100644 (file)
 #include <config.h>
 
 #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 <ostream>
+
 
 namespace lyx {
 
index f1e21131e10ef7e06957f7c68d61502ea8368b92..d985d5d69a9dfdc2356014402c57fab7570d331f 100644 (file)
 #include <config.h>
 
 #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<char>(c));
-       }
 
+static bool isBinaryOp(char_type c)
+{
+       return support::contains("+-<>=/*", static_cast<char>(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');
 }
 
 
index e69b690db8386771c64f3c5bebdc3c894afa773d..9246f3d45973f46da82cf2a0ae9258a0a23e2dec 100644 (file)
 #include <config.h>
 
 #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 <ostream>
 
 
 namespace lyx {
index 1dc8a1471bc18784256ddea93cb333d3ad5f2efe..d2a739c4b5230c4b281d1a504dae252b2edcd574 100644 (file)
 #include <config.h>
 
 #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 <ostream>
 
 
 namespace lyx {
index 78d95234289e4271db28c2e62c25f61a488fc850..3580ed683e9e6da94e3c8e97e28cdd695119c0c4 100644 (file)
 #include <config.h>
 
 #include "InsetMathDelim.h"
+
 #include "MathData.h"
 #include "MathStream.h"
 #include "MathSupport.h"
+#include "MetricsInfo.h"
 
 #include "frontends/FontMetrics.h"
 
index fa93e4bb924193d80e18819360d1495f55af1661..7bbfa0b3e02b23700122b4acfbb07f38023fdea7 100644 (file)
 #include <config.h>
 
 #include "InsetMathDots.h"
+
 #include "MathStream.h"
 #include "MathSupport.h"
 #include "MathParser.h"
+#include "MetricsInfo.h"
 
 #include "frontends/FontMetrics.h"
 
index f2471173ed98f8541d81aa378b83fced54eee1f5..360f1c17ef82299412212991b192fde51b754992 100644 (file)
 #include <config.h>
 
 #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() << "</" << name_ << '>';
 }
 
 
index c8d939d5ec1c10acc4491ac15ffe8287da589781..2164ea7433b93ff32680775953190299618311e9 100644 (file)
 #include <config.h>
 
 #include "InsetMathFBox.h"
+
 #include "MathData.h"
 #include "MathStream.h"
+#include "MetricsInfo.h"
 
-#include "support/std_ostream.h"
 #include "frontends/Painter.h"
 
+#include <ostream>
+
 
 namespace lyx {
 
index 81b54be10b966a893f6676e0a6dfd758e9beed0c..33f65751ad8e6bc1a3df49f6f5b1dad0217f49ec 100644 (file)
 #include <config.h>
 
 #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 <ostream>
 
 
 namespace lyx {
index 2df5a1f8d9d1df35419f20ccb6d5f74e7de29c88..c46defe89729d6388d2dac2e05372d55c624ba7b 100644 (file)
 #include <config.h>
 
 #include "InsetMathFontOld.h"
+
 #include "MathData.h"
 #include "MathStream.h"
 #include "MathParser.h"
-#include "MathStream.h"
-#include "support/std_ostream.h"
+#include "MetricsInfo.h"
+
+#include <ostream>
 
 
 namespace lyx {
index aef7818e5ddc7bf86e86f12a3859e52e72064602..5f4fc29ce4596090b8419b50506371aee7f4c1af 100644 (file)
@@ -18,6 +18,7 @@
 #include "MathData.h"
 #include "MathStream.h"
 #include "MathSupport.h"
+#include "MetricsInfo.h"
 #include "TextPainter.h"
 
 #include "frontends/Painter.h"
index f05da83d87088407a0104002a6cb95dc3b019780..4646f5e9e1f7c84238de2337f87ca41fbd6f2755 100644 (file)
 #include <config.h>
 
 #include "InsetMathFrameBox.h"
+
 #include "MathData.h"
 #include "MathStream.h"
 #include "MathSupport.h"
+#include "MetricsInfo.h"
+
 #include "frontends/Painter.h"
 
 
index 5c7d1d1fb796326afb3625775ccd317a0da7178e..ce637a72d8a8f73b2d6ea76489fa91d4f5658f04 100644 (file)
 #include <config.h>
 
 #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 <sstream>
 
index 31befd95e46fac37aa7ee6172a2f290724ca0b42..c144bdcb50715fd4a5baf90ede6053b1844e3ad3 100644 (file)
@@ -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()), "&", "&amp;"), "<", "&lt;"));
-               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()), "&", "&amp;"), "<", "&lt;"));
-               ms << ETag(from_ascii("alt"));
+               ms << ETag("alt");
        }
 
        ms << from_ascii("<graphic fileref=\"eqn/");
@@ -1503,7 +1504,8 @@ int InsetMathHull::docbook(Buffer const & buf, odocstream & os,
        else
                ms << from_ascii("\">");
 
-       ms << ETag(name);
+       ms.cr(); --ms.tab(); ms.os() << "</" << name << '>';
+
        return ms.line() + res;
 }
 
index f2f55151ddad08c29f9c57bcbc1e2032901176c8..014002d0dae967978d07ebc931473ceb26594006 100644 (file)
@@ -49,6 +49,7 @@
 
 #include "support/lstrings.h"
 #include "support/textutils.h"
+#include "support/docstream.h"
 
 #include "frontends/Clipboard.h"
 #include "frontends/Painter.h"
index dc180ccb8e9ec6416a77a9c714f2416099f68296..d9d42c34ae39b21be0390ca4300af4a0a8ebf4c9 100644 (file)
@@ -12,6 +12,7 @@
 #include <config.h>
 
 #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"
 
index 50d5ab5a9bafc04a6822c364e8d9c79e189839b4..13fd640ce95b160b063fd4a02c867ebfcda1c401 100644 (file)
 #include <config.h>
 
 #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"
 #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"
index b6dfba17b11ba6fabef83180dc23eab12d38539c..bc9e3dbf12fdcbe9bf95c588bd0c646a90ec8ec5 100644 (file)
@@ -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.
  *
 
 #include <config.h>
 
+#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"
 #include "frontends/Painter.h"
 
 #include "support/convert.h"
+#include "support/docstream.h"
 #include "support/lstrings.h"
 
 #include "debug.h"
 
-#include <boost/assert.hpp>
-#include <boost/bind.hpp>
-#include <boost/function.hpp>
-
 #include <sstream>
 
 
@@ -100,10 +98,10 @@ MathMacroTemplate::MathMacroTemplate()
 }
 
 
-MathMacroTemplate::MathMacroTemplate(docstring const & name, int numargs, int optionals,
-                                                                                                                                                docstring const & type, 
-                                                                                                                                                std::vector<MathData> const & optionalValues, 
-                                                                                                                                                MathData const & def, MathData const & display)
+MathMacroTemplate::MathMacroTemplate(docstring const & name, int numargs,
+       int optionals, docstring const & type, 
+       std::vector<MathData> 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;
index 31f69518de7d4a65e67ccc9b73f830e5d506d8f5..b5fe0c9a85adb38740404d253bb62063d56fd104 100644 (file)
 
 #include <config.h>
 
+#include "MathStream.h"
+
 #include "InsetMath.h"
 #include "MathData.h"
 #include "MathExtern.h"
-#include "MathStream.h"
 
 #include "support/textutils.h"
 
 #include <algorithm>
+#include <ostream>
+
 
 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() << "</" << t.tag_ << '>';
+       ms.os() << "</" << from_ascii(t.tag_) << '>';
        return ms;
 }
 
index 7787949d019ad6ed08224abcc4ee8b88d31ea710..b107d78abe2e358b11c802827cf5b5bbaa71cf51 100644 (file)
 #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 {
index a01b9294ae8eba9e832b5be036dc4e867b790f5f..ef352584fdbc32e6f29df7aa3c7e7215a3f4815d 100644 (file)
 
 #include <config.h>
 
+#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;
 
 
 ///