mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-23 05:25:26 +00:00
#include cosmetics
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21459 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
7bf4f48a4a
commit
9daf07588f
@ -17,6 +17,7 @@
|
||||
#include "gettext.h"
|
||||
#include "debug.h"
|
||||
|
||||
#include "support/docstream.h"
|
||||
#include "support/lstrings.h"
|
||||
#include "support/textutils.h"
|
||||
|
||||
|
@ -10,12 +10,13 @@
|
||||
|
||||
#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"
|
||||
|
@ -10,11 +10,13 @@
|
||||
|
||||
#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"
|
||||
|
||||
|
@ -11,9 +11,10 @@
|
||||
#include <config.h>
|
||||
|
||||
#include "InsetMathBig.h"
|
||||
|
||||
#include "MathSupport.h"
|
||||
#include "MathStream.h"
|
||||
#include "MathStream.h"
|
||||
#include "MetricsInfo.h"
|
||||
|
||||
#include "frontends/FontMetrics.h"
|
||||
|
||||
|
@ -11,10 +11,12 @@
|
||||
#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 {
|
||||
|
@ -11,13 +11,16 @@
|
||||
#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 {
|
||||
|
||||
|
@ -11,14 +11,17 @@
|
||||
#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 {
|
||||
|
||||
|
@ -11,18 +11,21 @@
|
||||
#include <config.h>
|
||||
|
||||
#include "InsetMathCases.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 "FuncStatus.h"
|
||||
#include "LaTeXFeatures.h"
|
||||
#include "support/std_ostream.h"
|
||||
#include "Cursor.h"
|
||||
#include "FuncRequest.h"
|
||||
#include "gettext.h"
|
||||
#include "MetricsInfo.h"
|
||||
|
||||
#include "support/lstrings.h"
|
||||
|
||||
#include <ostream>
|
||||
|
||||
|
||||
namespace lyx {
|
||||
|
||||
|
@ -12,8 +12,10 @@
|
||||
#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');
|
||||
}
|
||||
|
||||
|
||||
|
@ -11,13 +11,15 @@
|
||||
#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 {
|
||||
|
@ -12,15 +12,17 @@
|
||||
#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 {
|
||||
|
@ -12,9 +12,11 @@
|
||||
#include <config.h>
|
||||
|
||||
#include "InsetMathDelim.h"
|
||||
|
||||
#include "MathData.h"
|
||||
#include "MathStream.h"
|
||||
#include "MathSupport.h"
|
||||
#include "MetricsInfo.h"
|
||||
|
||||
#include "frontends/FontMetrics.h"
|
||||
|
||||
|
@ -12,9 +12,11 @@
|
||||
#include <config.h>
|
||||
|
||||
#include "InsetMathDots.h"
|
||||
|
||||
#include "MathStream.h"
|
||||
#include "MathSupport.h"
|
||||
#include "MathParser.h"
|
||||
#include "MetricsInfo.h"
|
||||
|
||||
#include "frontends/FontMetrics.h"
|
||||
|
||||
|
@ -11,10 +11,13 @@
|
||||
#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_ << '>';
|
||||
}
|
||||
|
||||
|
||||
|
@ -11,12 +11,15 @@
|
||||
#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 {
|
||||
|
||||
|
@ -11,11 +11,14 @@
|
||||
#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 {
|
||||
|
@ -11,11 +11,13 @@
|
||||
#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 {
|
||||
|
@ -18,6 +18,7 @@
|
||||
#include "MathData.h"
|
||||
#include "MathStream.h"
|
||||
#include "MathSupport.h"
|
||||
#include "MetricsInfo.h"
|
||||
#include "TextPainter.h"
|
||||
|
||||
#include "frontends/Painter.h"
|
||||
|
@ -11,9 +11,12 @@
|
||||
#include <config.h>
|
||||
|
||||
#include "InsetMathFrameBox.h"
|
||||
|
||||
#include "MathData.h"
|
||||
#include "MathStream.h"
|
||||
#include "MathSupport.h"
|
||||
#include "MetricsInfo.h"
|
||||
|
||||
#include "frontends/Painter.h"
|
||||
|
||||
|
||||
|
@ -11,9 +11,11 @@
|
||||
#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>
|
||||
|
||||
|
@ -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("<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;
|
||||
}
|
||||
|
||||
|
@ -49,6 +49,7 @@
|
||||
|
||||
#include "support/lstrings.h"
|
||||
#include "support/textutils.h"
|
||||
#include "support/docstream.h"
|
||||
|
||||
#include "frontends/Clipboard.h"
|
||||
#include "frontends/Painter.h"
|
||||
|
@ -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"
|
||||
|
||||
|
@ -15,10 +15,11 @@
|
||||
#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"
|
||||
@ -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"
|
||||
|
@ -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 <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"
|
||||
@ -37,14 +38,11 @@
|
||||
#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;
|
||||
|
@ -10,14 +10,17 @@
|
||||
|
||||
#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;
|
||||
}
|
||||
|
||||
|
@ -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_(tag) {}
|
||||
///
|
||||
ETag(char const * const tag) : tag_(from_ascii(tag)) {}
|
||||
///
|
||||
docstring const tag_;
|
||||
char const * const tag_;
|
||||
};
|
||||
|
||||
class MathStream {
|
||||
|
@ -11,14 +11,17 @@
|
||||
|
||||
#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;
|
||||
|
||||
|
||||
///
|
||||
|
Loading…
Reference in New Issue
Block a user