From 688c186614a50a82b97733cb401e046ea8207352 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20P=C3=B6nitz?= Date: Tue, 6 Nov 2007 21:45:24 +0000 Subject: [PATCH] we assume (more or less) conforming compilers nowadays. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21482 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/Author.cpp | 2 +- src/Box.cpp | 2 +- src/frontends/qt4/Validator.cpp | 3 --- src/insets/InsetBibitem.cpp | 2 +- src/insets/InsetFoot.cpp | 3 ++- src/insets/InsetHFill.cpp | 2 +- src/insets/InsetIndex.cpp | 2 +- src/insets/InsetMarginal.cpp | 2 +- src/insets/InsetTOC.cpp | 2 +- src/insets/InsetTheorem.cpp | 2 +- src/mathed/InsetMathAMSArray.cpp | 3 ++- src/mathed/InsetMathBoldSymbol.cpp | 4 +++- src/mathed/InsetMathComment.cpp | 4 +++- src/mathed/InsetMathEnv.cpp | 4 +++- src/mathed/InsetMathPar.cpp | 4 +++- src/mathed/InsetMathPhantom.cpp | 6 ++---- src/mathed/InsetMathSize.cpp | 4 +++- src/mathed/InsetMathSplit.cpp | 4 +++- src/mathed/InsetMathSubstack.cpp | 5 +++-- src/mathed/InsetMathTabular.cpp | 4 ++-- src/mathed/InsetMathXYMatrix.cpp | 5 +++-- src/mathed/TextPainter.cpp | 3 ++- src/sgml.cpp | 24 +++++++++++------------- src/support/Makefile.am | 2 -- src/support/std_istream.h | 17 ----------------- src/support/std_ostream.h | 17 ----------------- 26 files changed, 53 insertions(+), 79 deletions(-) delete mode 100644 src/support/std_istream.h delete mode 100644 src/support/std_ostream.h diff --git a/src/Author.cpp b/src/Author.cpp index 58751d0710..44acfbc605 100644 --- a/src/Author.cpp +++ b/src/Author.cpp @@ -16,7 +16,7 @@ #include -#include "support/std_istream.h" +#include using std::string; diff --git a/src/Box.cpp b/src/Box.cpp index 918b661d19..d968448aba 100644 --- a/src/Box.cpp +++ b/src/Box.cpp @@ -14,7 +14,7 @@ #include "Box.h" -#include "support/std_ostream.h" +#include using std::ostream; diff --git a/src/frontends/qt4/Validator.cpp b/src/frontends/qt4/Validator.cpp index 11c877b9c4..f0c253112c 100644 --- a/src/frontends/qt4/Validator.cpp +++ b/src/frontends/qt4/Validator.cpp @@ -22,13 +22,10 @@ #include "support/docstring.h" #include "support/lstrings.h" -#include "support/std_ostream.h" #include #include -#include - using lyx::support::isStrDbl; using std::string; diff --git a/src/insets/InsetBibitem.cpp b/src/insets/InsetBibitem.cpp index b4a88a7d05..310cec9b2c 100644 --- a/src/insets/InsetBibitem.cpp +++ b/src/insets/InsetBibitem.cpp @@ -25,10 +25,10 @@ #include "ParagraphList.h" #include "support/lstrings.h" -#include "support/std_ostream.h" #include "support/docstream.h" #include "support/convert.h" +#include namespace lyx { diff --git a/src/insets/InsetFoot.cpp b/src/insets/InsetFoot.cpp index fe15a64f92..1f6cd82c87 100644 --- a/src/insets/InsetFoot.cpp +++ b/src/insets/InsetFoot.cpp @@ -24,9 +24,10 @@ #include "OutputParams.h" #include "ParIterator.h" -#include "support/std_ostream.h" #include "support/lstrings.h" +#include + namespace lyx { using std::string; diff --git a/src/insets/InsetHFill.cpp b/src/insets/InsetHFill.cpp index 968c64223e..e1b832ca72 100644 --- a/src/insets/InsetHFill.cpp +++ b/src/insets/InsetHFill.cpp @@ -13,7 +13,7 @@ #include "InsetHFill.h" #include "gettext.h" -#include "support/std_ostream.h" +#include namespace lyx { diff --git a/src/insets/InsetIndex.cpp b/src/insets/InsetIndex.cpp index aaef4d43c5..6326786d44 100644 --- a/src/insets/InsetIndex.cpp +++ b/src/insets/InsetIndex.cpp @@ -19,7 +19,7 @@ #include "MetricsInfo.h" #include "sgml.h" -#include "support/std_ostream.h" +#include namespace lyx { diff --git a/src/insets/InsetMarginal.cpp b/src/insets/InsetMarginal.cpp index 3a4ed9407d..ce16f7d327 100644 --- a/src/insets/InsetMarginal.cpp +++ b/src/insets/InsetMarginal.cpp @@ -17,7 +17,7 @@ #include "gettext.h" #include "OutputParams.h" -#include "support/std_ostream.h" +#include namespace lyx { diff --git a/src/insets/InsetTOC.cpp b/src/insets/InsetTOC.cpp index 9f91c06f19..f23a87d82d 100644 --- a/src/insets/InsetTOC.cpp +++ b/src/insets/InsetTOC.cpp @@ -20,7 +20,7 @@ #include "OutputParams.h" #include "TocBackend.h" -#include "support/std_ostream.h" +#include namespace lyx { diff --git a/src/insets/InsetTheorem.cpp b/src/insets/InsetTheorem.cpp index 676248caff..066f3bcd76 100644 --- a/src/insets/InsetTheorem.cpp +++ b/src/insets/InsetTheorem.cpp @@ -20,7 +20,7 @@ #include "Text.h" #include "MetricsInfo.h" -#include "support/std_ostream.h" +#include namespace lyx { diff --git a/src/mathed/InsetMathAMSArray.cpp b/src/mathed/InsetMathAMSArray.cpp index cfe9a179ae..1e7d20c206 100644 --- a/src/mathed/InsetMathAMSArray.cpp +++ b/src/mathed/InsetMathAMSArray.cpp @@ -23,7 +23,8 @@ #include "gettext.h" #include "support/lstrings.h" -#include "support/std_ostream.h" + +#include namespace lyx { diff --git a/src/mathed/InsetMathBoldSymbol.cpp b/src/mathed/InsetMathBoldSymbol.cpp index 27ee877c28..6ef4de7099 100644 --- a/src/mathed/InsetMathBoldSymbol.cpp +++ b/src/mathed/InsetMathBoldSymbol.cpp @@ -11,10 +11,12 @@ #include #include "InsetMathBoldSymbol.h" + #include "MathStream.h" #include "MathData.h" #include "LaTeXFeatures.h" -#include "support/std_ostream.h" + +#include namespace lyx { diff --git a/src/mathed/InsetMathComment.cpp b/src/mathed/InsetMathComment.cpp index 4648ba1f17..b856ffc240 100644 --- a/src/mathed/InsetMathComment.cpp +++ b/src/mathed/InsetMathComment.cpp @@ -11,10 +11,12 @@ #include #include "InsetMathComment.h" + #include "MathData.h" #include "MathStream.h" #include "MathSupport.h" -#include "support/std_ostream.h" + +#include namespace lyx { diff --git a/src/mathed/InsetMathEnv.cpp b/src/mathed/InsetMathEnv.cpp index 5965d2969e..adbca074e8 100644 --- a/src/mathed/InsetMathEnv.cpp +++ b/src/mathed/InsetMathEnv.cpp @@ -11,10 +11,12 @@ #include #include "InsetMathEnv.h" + #include "MathData.h" #include "MathStream.h" #include "MathStream.h" -#include "support/std_ostream.h" + +#include namespace lyx { diff --git a/src/mathed/InsetMathPar.cpp b/src/mathed/InsetMathPar.cpp index 38fc9bfc43..f06ac89dc0 100644 --- a/src/mathed/InsetMathPar.cpp +++ b/src/mathed/InsetMathPar.cpp @@ -11,9 +11,11 @@ #include #include "InsetMathPar.h" + #include "MathData.h" #include "MathStream.h" -#include "support/std_ostream.h" + +#include namespace lyx { diff --git a/src/mathed/InsetMathPhantom.cpp b/src/mathed/InsetMathPhantom.cpp index e0ed1a6dd0..0000175ad0 100644 --- a/src/mathed/InsetMathPhantom.cpp +++ b/src/mathed/InsetMathPhantom.cpp @@ -11,13 +11,11 @@ #include #include "InsetMathPhantom.h" -#include "MathStream.h" -#include "MathStream.h" - +#include "MathStream.h" #include "frontends/Painter.h" -#include "support/std_ostream.h" +#include namespace lyx { diff --git a/src/mathed/InsetMathSize.cpp b/src/mathed/InsetMathSize.cpp index e520b4ea6d..42f13d858d 100644 --- a/src/mathed/InsetMathSize.cpp +++ b/src/mathed/InsetMathSize.cpp @@ -11,12 +11,14 @@ #include #include "InsetMathSize.h" + #include "MathData.h" #include "MathParser.h" #include "MathStream.h" #include "support/convert.h" -#include "support/std_ostream.h" + +#include namespace lyx { diff --git a/src/mathed/InsetMathSplit.cpp b/src/mathed/InsetMathSplit.cpp index 3e5666eb3d..287073bc45 100644 --- a/src/mathed/InsetMathSplit.cpp +++ b/src/mathed/InsetMathSplit.cpp @@ -11,6 +11,7 @@ #include #include "InsetMathSplit.h" + #include "MathData.h" #include "MathStream.h" #include "MathStream.h" @@ -21,7 +22,8 @@ #include "LaTeXFeatures.h" #include "support/lstrings.h" -#include "support/std_ostream.h" + +#include namespace lyx { diff --git a/src/mathed/InsetMathSubstack.cpp b/src/mathed/InsetMathSubstack.cpp index bea27a0231..8d72d4798a 100644 --- a/src/mathed/InsetMathSubstack.cpp +++ b/src/mathed/InsetMathSubstack.cpp @@ -10,11 +10,11 @@ #include -#include "LaTeXFeatures.h" #include "InsetMathSubstack.h" + +#include "LaTeXFeatures.h" #include "MathData.h" #include "MathStream.h" -#include "support/std_ostream.h" #include "FuncRequest.h" #include "FuncStatus.h" @@ -22,6 +22,7 @@ #include "support/lstrings.h" +#include namespace lyx { diff --git a/src/mathed/InsetMathTabular.cpp b/src/mathed/InsetMathTabular.cpp index e7309fb026..bb4e5c4838 100644 --- a/src/mathed/InsetMathTabular.cpp +++ b/src/mathed/InsetMathTabular.cpp @@ -11,14 +11,14 @@ #include #include "InsetMathTabular.h" + #include "MathData.h" #include "MathStream.h" #include "MathStream.h" #include "support/lstrings.h" -#include "support/std_ostream.h" -#include +#include namespace lyx { diff --git a/src/mathed/InsetMathXYMatrix.cpp b/src/mathed/InsetMathXYMatrix.cpp index 5e1151ce66..7c6781104a 100644 --- a/src/mathed/InsetMathXYMatrix.cpp +++ b/src/mathed/InsetMathXYMatrix.cpp @@ -11,10 +11,11 @@ #include #include "InsetMathXYMatrix.h" -#include "MathStream.h" #include "LaTeXFeatures.h" -#include "support/std_ostream.h" +#include "MathStream.h" + +#include namespace lyx { diff --git a/src/mathed/TextPainter.cpp b/src/mathed/TextPainter.cpp index fa8ca9944f..6811c40af2 100644 --- a/src/mathed/TextPainter.cpp +++ b/src/mathed/TextPainter.cpp @@ -11,7 +11,8 @@ #include #include "TextPainter.h" -#include "support/std_ostream.h" + +#include namespace lyx { diff --git a/src/sgml.cpp b/src/sgml.cpp index b7871e195b..928e0eb09e 100644 --- a/src/sgml.cpp +++ b/src/sgml.cpp @@ -16,19 +16,18 @@ #include "Buffer.h" #include "BufferParams.h" #include "Counters.h" -#include "Text.h" #include "Layout.h" #include "OutputParams.h" #include "Paragraph.h" +#include "Text.h" +#include "support/convert.h" #include "support/docstream.h" #include "support/lstrings.h" -#include "support/std_ostream.h" -#include "support/convert.h" #include "support/textutils.h" #include -#include +#include namespace lyx { @@ -98,12 +97,12 @@ docstring sgml::escapeChar(char_type c) docstring sgml::escapeString(docstring const & raw) { - odocstringstream bin; + docstring bin; + bin.reserve(raw.size() * 2); // crude approximation is sufficient + for (size_t i = 0; i != raw.size(); ++i) + bin += sgml::escapeChar(raw[i]); - for(docstring::size_type i = 0; i < raw.size(); ++i) { - bin << sgml::escapeChar(raw[i]); - } - return bin.str(); + return bin; } @@ -167,12 +166,11 @@ docstring sgml::cleanID(Buffer const & buf, OutputParams const & runparams, mangle = true; } } - if (mangle) { + + if (mangle) content += "-" + convert(mangleID++); - } - else if (isDigitASCII(content[content.size() - 1])) { + else if (isDigitASCII(content[content.size() - 1])) content += "."; - } mangledNames[orig] = content; diff --git a/src/support/Makefile.am b/src/support/Makefile.am index 1cf431e815..50887db40a 100644 --- a/src/support/Makefile.am +++ b/src/support/Makefile.am @@ -77,8 +77,6 @@ liblyxsupport_la_SOURCES = \ socktools.cpp \ socktools.h \ strfwd.h \ - std_istream.h \ - std_ostream.h \ Systemcall.cpp \ Systemcall.h \ tempname.cpp \ diff --git a/src/support/std_istream.h b/src/support/std_istream.h deleted file mode 100644 index f15cef6401..0000000000 --- a/src/support/std_istream.h +++ /dev/null @@ -1,17 +0,0 @@ -// -*- C++ -*- -/** - * \file std_istream.h - * This file is part of LyX, the document processor. - * Licence details can be found in the file COPYING. - */ - -#ifndef STD_ISTREAM_H -#define STD_ISTREAM_H - -#ifdef HAVE_ISTREAM -#include -#else -#include -#endif - -#endif // NOT STD_ISTREAM_H diff --git a/src/support/std_ostream.h b/src/support/std_ostream.h deleted file mode 100644 index f50e61c2ef..0000000000 --- a/src/support/std_ostream.h +++ /dev/null @@ -1,17 +0,0 @@ -// -*- C++ -*- -/** - * \file std_ostream.h - * This file is part of LyX, the document processor. - * Licence details can be found in the file COPYING. - */ - -#ifndef STD_OSTREAM_H -#define STD_OSTREAM_H - -#ifdef HAVE_OSTREAM -#include -#else -#include -#endif - -#endif // NOT STD_OSTREAM_H