[LyX/master] Clean includes using the output of iwyu tool

Yuriy Skalko yuriy.skalko at gmail.com
Tue Oct 20 08:10:44 UTC 2020


commit 196d9caeb0b9f74d02750f774de1ca63a483803f
Author: Yuriy Skalko <yuriy.skalko at gmail.com>
Date:   Tue Oct 20 11:36:59 2020 +0300

    Clean includes using the output of iwyu tool
---
 src/Author.h                |    2 +-
 src/BiblioInfo.cpp          |    3 ---
 src/BiblioInfo.h            |    2 +-
 src/Buffer.cpp              |    6 ------
 src/Buffer.h                |    6 ++----
 src/BufferEncodings.h       |    4 ++--
 src/BufferList.cpp          |    6 ------
 src/BufferList.h            |    2 +-
 src/BufferParams.cpp        |    3 ---
 src/BufferView.cpp          |   20 +++-----------------
 src/Bullet.cpp              |    1 +
 src/Bullet.h                |    2 +-
 src/Changes.cpp             |    1 -
 src/Compare.cpp             |    1 -
 src/Converter.cpp           |    1 -
 src/Converter.h             |    2 +-
 src/CoordCache.cpp          |    4 ----
 src/Counters.cpp            |    1 +
 src/Counters.h              |    2 +-
 src/Cursor.cpp              |    6 ------
 src/CursorSlice.cpp         |    4 ++--
 src/CutAndPaste.cpp         |    5 -----
 src/CutAndPaste.h           |    2 +-
 src/DepTable.cpp            |    1 -
 src/Encoding.cpp            |    1 +
 src/Encoding.h              |    3 +--
 src/ErrorList.h             |    3 +--
 src/FontList.cpp            |    2 --
 src/Format.h                |    5 ++---
 src/FuncRequest.cpp         |    1 +
 src/FuncRequest.h           |    2 +-
 src/FuncStatus.h            |    2 +-
 src/Graph.cpp               |    2 --
 src/HunspellChecker.cpp     |    4 ----
 src/LaTeX.cpp               |    1 +
 src/LaTeX.h                 |    2 +-
 src/LaTeXFeatures.cpp       |    4 +---
 src/LaTeXFeatures.h         |    2 +-
 src/Language.cpp            |    1 +
 src/Language.h              |    3 +--
 src/LayoutFile.cpp          |    7 -------
 src/Lexer.cpp               |    1 -
 src/Lexer.h                 |    2 --
 src/LyX.cpp                 |    3 ---
 src/LyXRC.cpp               |    5 -----
 src/MetricsInfo.cpp         |    4 ----
 src/PDFOptions.cpp          |    3 +++
 src/PDFOptions.h            |    6 ++----
 src/ParIterator.cpp         |    2 +-
 src/ParIterator.h           |    1 +
 src/Paragraph.cpp           |    4 ++--
 src/Paragraph.h             |    1 -
 src/ParagraphMetrics.cpp    |   24 ++++--------------------
 src/ParagraphParameters.cpp |    5 ++---
 src/ParagraphParameters.h   |    6 +-----
 src/PersonalWordList.cpp    |    3 ---
 src/Row.cpp                 |    2 +-
 src/RowPainter.h            |    2 --
 src/ServerSocket.cpp        |    1 -
 src/TexRow.h                |    3 +--
 src/Text.cpp                |   17 +++++------------
 src/Text.h                  |    7 +++----
 src/Text2.cpp               |   14 +-------------
 src/Text3.cpp               |   10 ++--------
 src/TextClass.cpp           |    5 +----
 src/TextMetrics.cpp         |    4 +---
 src/TextMetrics.h           |    1 -
 src/Thesaurus.cpp           |    4 +---
 src/Thesaurus.h             |    5 +++--
 src/TocBuilder.cpp          |    1 +
 src/TocBuilder.h            |    2 +-
 src/Trans.cpp               |    4 ----
 src/Undo.cpp                |    3 ---
 src/Undo.h                  |    3 ---
 src/VCBackend.cpp           |    1 -
 src/VSpace.cpp              |    1 -
 src/factory.cpp             |    6 +-----
 src/insets/InsetText.cpp    |    2 ++
 src/lyxfind.cpp             |    3 ---
 src/lyxfind.h               |    4 ----
 src/output_xhtml.cpp        |    5 -----
 81 files changed, 72 insertions(+), 240 deletions(-)

diff --git a/src/Author.h b/src/Author.h
index 798cfd8..aa48b5d 100644
--- a/src/Author.h
+++ b/src/Author.h
@@ -12,7 +12,7 @@
 #ifndef AUTHOR_H
 #define AUTHOR_H
 
-#include "support/docstring.h"
+#include "support/strfwd.h"
 
 #include <vector>
 
diff --git a/src/BiblioInfo.cpp b/src/BiblioInfo.cpp
index 486bd5c..cefee85 100644
--- a/src/BiblioInfo.cpp
+++ b/src/BiblioInfo.cpp
@@ -17,13 +17,10 @@
 #include "BiblioInfo.h"
 #include "Buffer.h"
 #include "BufferParams.h"
-#include "buffer_funcs.h"
 #include "Citation.h"
 #include "Encoding.h"
-#include "InsetIterator.h"
 #include "Language.h"
 #include "xml.h"
-#include "Paragraph.h"
 #include "TextClass.h"
 #include "TocBackend.h"
 
diff --git a/src/BiblioInfo.h b/src/BiblioInfo.h
index ca5cdad..008c7c7 100644
--- a/src/BiblioInfo.h
+++ b/src/BiblioInfo.h
@@ -15,7 +15,7 @@
 #ifndef BIBLIOINFO_H
 #define BIBLIOINFO_H
 
-#include "support/docstring.h"
+#include "support/strfwd.h"
 
 #include <map>
 #include <set>
diff --git a/src/Buffer.cpp b/src/Buffer.cpp
index 53ff15b..9ba2373 100644
--- a/src/Buffer.cpp
+++ b/src/Buffer.cpp
@@ -14,7 +14,6 @@
 #include "Buffer.h"
 
 #include "Author.h"
-#include "LayoutFile.h"
 #include "BiblioInfo.h"
 #include "BranchList.h"
 #include "buffer_funcs.h"
@@ -67,9 +66,7 @@
 #include "VCBackend.h"
 #include "version.h"
 #include "WordLangTuple.h"
-#include "WordList.h"
 
-#include "insets/InsetBibtex.h"
 #include "insets/InsetBranch.h"
 #include "insets/InsetInclude.h"
 #include "insets/InsetTabular.h"
@@ -80,7 +77,6 @@
 #include "mathed/InsetMathMacroTemplate.h"
 #include "mathed/MathSupport.h"
 
-#include "graphics/GraphicsCache.h"
 #include "graphics/PreviewLoader.h"
 
 #include "frontends/Application.h"
@@ -97,11 +93,9 @@
 #include "support/FileName.h"
 #include "support/FileNameList.h"
 #include "support/filetools.h"
-#include "support/ForkedCalls.h"
 #include "support/gettext.h"
 #include "support/gzstream.h"
 #include "support/lstrings.h"
-#include "support/lyxalgo.h"
 #include "support/mutex.h"
 #include "support/os.h"
 #include "support/Package.h"
diff --git a/src/Buffer.h b/src/Buffer.h
index 2d96ff9..f65d31d 100644
--- a/src/Buffer.h
+++ b/src/Buffer.h
@@ -48,9 +48,9 @@ class MacroNameSet;
 class MacroSet;
 class OutputParams;
 class otexstream;
-class ParConstIterator;
-class ParIterator;
 class ParagraphList;
+class ParIterator;
+class ParConstIterator;
 class TeXErrors;
 class TexRow;
 class TocBackend;
@@ -93,8 +93,6 @@ typedef std::shared_ptr<CloneList> CloneList_ptr;
  * \author Lars Gullik Bjønnes
  */
 
-class MarkAsExporting;
-
 class Buffer {
 public:
 	/// What type of log will \c getLogName() return?
diff --git a/src/BufferEncodings.h b/src/BufferEncodings.h
index 89275b3..d5a9081 100644
--- a/src/BufferEncodings.h
+++ b/src/BufferEncodings.h
@@ -15,8 +15,8 @@
 #define BUFFER_ENCODINGS_H
 
 #include "Encoding.h"
-#include "support/docstring.h"
-#include "support/types.h"
+
+#include "support/strfwd.h"
 
 namespace lyx {
 
diff --git a/src/BufferList.cpp b/src/BufferList.cpp
index b99f459..0cfbec1 100644
--- a/src/BufferList.cpp
+++ b/src/BufferList.cpp
@@ -15,10 +15,6 @@
 #include "Author.h"
 #include "Buffer.h"
 #include "BufferParams.h"
-#include "Session.h"
-#include "LyX.h"
-#include "output_latex.h"
-#include "ParagraphList.h"
 
 #include "frontends/alert.h"
 
@@ -27,9 +23,7 @@
 #include "support/FileName.h"
 #include "support/FileNameList.h"
 #include "support/filetools.h"
-#include "support/gettext.h"
 #include "support/lstrings.h"
-#include "support/Package.h"
 
 #include "support/lassert.h"
 
diff --git a/src/BufferList.h b/src/BufferList.h
index 053169a..ff51566 100644
--- a/src/BufferList.h
+++ b/src/BufferList.h
@@ -12,7 +12,7 @@
 #ifndef BUFFER_LIST_H
 #define BUFFER_LIST_H
 
-#include "support/docstring.h"
+#include "support/strfwd.h"
 
 #include <vector>
 
diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp
index 8d0d7d1..9d45d80 100644
--- a/src/BufferParams.cpp
+++ b/src/BufferParams.cpp
@@ -21,7 +21,6 @@
 #include "LayoutFile.h"
 #include "BranchList.h"
 #include "Buffer.h"
-#include "buffer_funcs.h"
 #include "Bullet.h"
 #include "CiteEnginesList.h"
 #include "Color.h"
@@ -33,7 +32,6 @@
 #include "Language.h"
 #include "LaTeXFeatures.h"
 #include "LaTeXFonts.h"
-#include "ModuleList.h"
 #include "Font.h"
 #include "Lexer.h"
 #include "LyXRC.h"
@@ -50,7 +48,6 @@
 
 #include "support/convert.h"
 #include "support/debug.h"
-#include "support/docstream.h"
 #include "support/FileName.h"
 #include "support/filetools.h"
 #include "support/gettext.h"
diff --git a/src/BufferView.cpp b/src/BufferView.cpp
index 88fe8fa..fbfe41c 100644
--- a/src/BufferView.cpp
+++ b/src/BufferView.cpp
@@ -18,7 +18,6 @@
 
 #include "BranchList.h"
 #include "Buffer.h"
-#include "buffer_funcs.h"
 #include "BufferList.h"
 #include "BufferParams.h"
 #include "CoordCache.h"
@@ -26,48 +25,34 @@
 #include "CutAndPaste.h"
 #include "DispatchResult.h"
 #include "ErrorList.h"
-#include "factory.h"
-#include "FloatList.h"
 #include "FuncRequest.h"
 #include "FuncStatus.h"
 #include "Intl.h"
-#include "InsetIterator.h"
 #include "Language.h"
-#include "LaTeXFeatures.h"
 #include "LayoutFile.h"
 #include "Lexer.h"
 #include "LyX.h"
 #include "LyXAction.h"
 #include "lyxfind.h"
-#include "Layout.h"
 #include "LyXRC.h"
 #include "MetricsInfo.h"
 #include "Paragraph.h"
-#include "ParagraphParameters.h"
-#include "ParIterator.h"
-#include "RowPainter.h"
 #include "Session.h"
 #include "Text.h"
-#include "TextClass.h"
 #include "TextMetrics.h"
 #include "TexRow.h"
 #include "TocBackend.h"
-#include "WordLangTuple.h"
 
 #include "insets/InsetBibtex.h"
 #include "insets/InsetCitation.h"
 #include "insets/InsetCommand.h" // ChangeRefs
-#include "insets/InsetExternal.h"
 #include "insets/InsetGraphics.h"
-#include "insets/InsetNote.h"
 #include "insets/InsetRef.h"
 #include "insets/InsetText.h"
 
 #include "mathed/MathData.h"
-#include "mathed/InsetMathNest.h"
 
 #include "frontends/alert.h"
-#include "frontends/Application.h"
 #include "frontends/Delegates.h"
 #include "frontends/FontMetrics.h"
 #include "frontends/NullPainter.h"
@@ -76,17 +61,18 @@
 
 #include "support/convert.h"
 #include "support/debug.h"
-#include "support/ExceptionMessage.h"
+#include "support/docstring.h"
 #include "support/filetools.h"
 #include "support/gettext.h"
 #include "support/lassert.h"
 #include "support/Length.h"
 #include "support/lstrings.h"
 #include "support/lyxlib.h"
-#include "support/Package.h"
 #include "support/types.h"
 
+#include <algorithm>
 #include <cerrno>
+#include <cstring>
 #include <fstream>
 #include <functional>
 #include <iterator>
diff --git a/src/Bullet.cpp b/src/Bullet.cpp
index 1f4ef6a..b3bf8e5 100644
--- a/src/Bullet.cpp
+++ b/src/Bullet.cpp
@@ -18,6 +18,7 @@
 
 #include "Bullet.h"
 
+#include "support/docstring.h"
 #include "support/lassert.h"
 
 using namespace std;
diff --git a/src/Bullet.h b/src/Bullet.h
index 6a4f997..8a6da2a 100644
--- a/src/Bullet.h
+++ b/src/Bullet.h
@@ -13,7 +13,7 @@
 #ifndef BULLET_H
 #define BULLET_H
 
-#include "support/docstring.h"
+#include "support/strfwd.h"
 
 
 namespace lyx {
diff --git a/src/Changes.cpp b/src/Changes.cpp
index 63bb021..7e97a24 100644
--- a/src/Changes.cpp
+++ b/src/Changes.cpp
@@ -18,7 +18,6 @@
 #include "Buffer.h"
 #include "BufferParams.h"
 #include "Encoding.h"
-#include "LaTeXFeatures.h"
 #include "LyXRC.h"
 #include "MetricsInfo.h"
 #include "OutputParams.h"
diff --git a/src/Compare.cpp b/src/Compare.cpp
index 490a2ec..49bdac1 100644
--- a/src/Compare.cpp
+++ b/src/Compare.cpp
@@ -24,7 +24,6 @@
 
 #include "support/docstream.h"
 #include "support/lassert.h"
-#include "support/lyxalgo.h"
 #include "support/qstring_helpers.h"
 
 using namespace std;
diff --git a/src/Converter.cpp b/src/Converter.cpp
index 59604d3..ada329e 100644
--- a/src/Converter.cpp
+++ b/src/Converter.cpp
@@ -13,7 +13,6 @@
 #include "Converter.h"
 
 #include "Buffer.h"
-#include "buffer_funcs.h"
 #include "BufferParams.h"
 #include "ConverterCache.h"
 #include "Encoding.h"
diff --git a/src/Converter.h b/src/Converter.h
index e9efa00..914b816 100644
--- a/src/Converter.h
+++ b/src/Converter.h
@@ -14,7 +14,7 @@
 
 #include "Graph.h"
 #include "OutputParams.h"
-#include "support/trivstring.h"
+#include "support/strfwd.h"
 
 #include <vector>
 #include <set>
diff --git a/src/CoordCache.cpp b/src/CoordCache.cpp
index 51f1c5e..2a81328 100644
--- a/src/CoordCache.cpp
+++ b/src/CoordCache.cpp
@@ -11,12 +11,8 @@
 
 #include "CoordCache.h"
 
-#include "Text.h"
 
 #include "support/debug.h"
-#include "support/docstring.h"
-
-#include "insets/Inset.h"
 
 #include "support/lassert.h"
 
diff --git a/src/Counters.cpp b/src/Counters.cpp
index 32968fc..9d7cc23 100644
--- a/src/Counters.cpp
+++ b/src/Counters.cpp
@@ -20,6 +20,7 @@
 #include "support/convert.h"
 #include "support/counter_reps.h"
 #include "support/debug.h"
+#include "support/docstring.h"
 #include "support/gettext.h"
 #include "support/lassert.h"
 #include "support/lstrings.h"
diff --git a/src/Counters.h b/src/Counters.h
index 959a2f4..e411bbb 100644
--- a/src/Counters.h
+++ b/src/Counters.h
@@ -17,7 +17,7 @@
 
 #include "OutputEnums.h"
 
-#include "support/docstring.h"
+#include "support/strfwd.h"
 
 #include <map>
 #include <vector>
diff --git a/src/Cursor.cpp b/src/Cursor.cpp
index 0d68c86..7197b91 100644
--- a/src/Cursor.cpp
+++ b/src/Cursor.cpp
@@ -27,7 +27,6 @@
 #include "LyXAction.h"
 #include "LyXRC.h"
 #include "Paragraph.h"
-#include "ParIterator.h"
 #include "Row.h"
 #include "texstream.h"
 #include "Text.h"
@@ -36,12 +35,10 @@
 
 #include "support/debug.h"
 #include "support/docstream.h"
-#include "support/ExceptionMessage.h"
 #include "support/gettext.h"
 #include "support/lassert.h"
 
 #include "insets/InsetTabular.h"
-#include "insets/InsetText.h"
 
 #include "mathed/InsetMath.h"
 #include "mathed/InsetMathBrace.h"
@@ -1435,10 +1432,7 @@ bool Cursor::atFirstOrLastRow(bool up)
 ///////////////////////////////////////////////////////////////////
 
 #include "mathed/InsetMathChar.h"
-#include "mathed/InsetMathGrid.h"
-#include "mathed/InsetMathScript.h"
 #include "mathed/InsetMathUnknown.h"
-#include "mathed/MathFactory.h"
 #include "mathed/MathStream.h"
 #include "mathed/MathSupport.h"
 
diff --git a/src/CursorSlice.cpp b/src/CursorSlice.cpp
index 20a1634..872a911 100644
--- a/src/CursorSlice.cpp
+++ b/src/CursorSlice.cpp
@@ -17,14 +17,14 @@
 
 #include "Text.h"
 #include "Paragraph.h"
+#include "ParagraphList.h"
 
 #include "support/debug.h"
 
 #include "mathed/InsetMath.h"
 #include "mathed/InsetMathMacro.h"
+#include "mathed/MathData.h"
 
-#include "support/ExceptionMessage.h"
-#include "support/gettext.h"
 #include "support/lassert.h"
 
 #include <ostream>
diff --git a/src/CutAndPaste.cpp b/src/CutAndPaste.cpp
index 772fa49..ee3418d 100644
--- a/src/CutAndPaste.cpp
+++ b/src/CutAndPaste.cpp
@@ -18,7 +18,6 @@
 #include "Author.h"
 #include "BranchList.h"
 #include "Buffer.h"
-#include "buffer_funcs.h"
 #include "BufferList.h"
 #include "BufferParams.h"
 #include "BufferView.h"
@@ -29,7 +28,6 @@
 #include "FuncCode.h"
 #include "FuncRequest.h"
 #include "InsetIterator.h"
-#include "InsetList.h"
 #include "Language.h"
 #include "LyX.h"
 #include "LyXRC.h"
@@ -43,7 +41,6 @@
 #include "insets/InsetBranch.h"
 #include "insets/InsetCitation.h"
 #include "insets/InsetCommand.h"
-#include "insets/InsetFlex.h"
 #include "insets/InsetGraphics.h"
 #include "insets/InsetGraphicsParams.h"
 #include "insets/InsetInclude.h"
@@ -62,13 +59,11 @@
 #include "support/lassert.h"
 #include "support/limited_stack.h"
 #include "support/lstrings.h"
-#include "support/lyxalgo.h"
 #include "support/TempFile.h"
 #include "support/unique_ptr.h"
 
 #include "frontends/alert.h"
 #include "frontends/Clipboard.h"
-#include "frontends/Selection.h"
 
 #include <string>
 #include <tuple>
diff --git a/src/CutAndPaste.h b/src/CutAndPaste.h
index fe68be5..fcbac19 100644
--- a/src/CutAndPaste.h
+++ b/src/CutAndPaste.h
@@ -16,7 +16,7 @@
 
 #include "DocumentClassPtr.h"
 
-#include "support/docstring.h"
+#include "support/strfwd.h"
 
 #include "insets/Inset.h"
 
diff --git a/src/DepTable.cpp b/src/DepTable.cpp
index f8058fe..8b15ec7 100644
--- a/src/DepTable.cpp
+++ b/src/DepTable.cpp
@@ -16,7 +16,6 @@
 
 #include "support/debug.h"
 #include "support/FileName.h"
-#include "support/filetools.h"
 #include "support/lstrings.h"
 #include "support/lyxtime.h"
 
diff --git a/src/Encoding.cpp b/src/Encoding.cpp
index 4dcede4..c7ea237 100644
--- a/src/Encoding.cpp
+++ b/src/Encoding.cpp
@@ -17,6 +17,7 @@
 #include "Lexer.h"
 
 #include "support/debug.h"
+#include "support/docstring.h"
 #include "support/gettext.h"
 #include "support/lstrings.h"
 #include "support/mutex.h"
diff --git a/src/Encoding.h b/src/Encoding.h
index 6a96843..e35f0fd 100644
--- a/src/Encoding.h
+++ b/src/Encoding.h
@@ -13,8 +13,7 @@
 #ifndef ENCODING_H
 #define ENCODING_H
 
-#include "support/docstring.h"
-#include "support/trivstring.h"
+#include "support/strfwd.h"
 #include "support/types.h"
 
 #include <map>
diff --git a/src/ErrorList.h b/src/ErrorList.h
index 3529447..29cb03c 100644
--- a/src/ErrorList.h
+++ b/src/ErrorList.h
@@ -14,8 +14,7 @@
 
 #include "TexRow.h"
 
-#include "support/docstring.h"
-#include "support/types.h"
+#include "support/strfwd.h"
 
 #include <vector>
 
diff --git a/src/FontList.cpp b/src/FontList.cpp
index c326660..67fb835 100644
--- a/src/FontList.cpp
+++ b/src/FontList.cpp
@@ -20,8 +20,6 @@
 
 #include "FontList.h"
 
-#include "support/lyxalgo.h"
-
 using namespace std;
 
 namespace lyx {
diff --git a/src/Format.h b/src/Format.h
index 495d9b1..44b3381 100644
--- a/src/Format.h
+++ b/src/Format.h
@@ -12,11 +12,10 @@
 #ifndef FORMAT_H
 #define FORMAT_H
 
-#include "support/docstring.h"
-#include "support/trivstring.h"
-
 #include "OutputParams.h"
 
+#include "support/strfwd.h"
+
 #include <vector>
 
 namespace lyx {
diff --git a/src/FuncRequest.cpp b/src/FuncRequest.cpp
index 2049210..de93a9f 100644
--- a/src/FuncRequest.cpp
+++ b/src/FuncRequest.cpp
@@ -14,6 +14,7 @@
 #include "LyXAction.h"
 
 #include "support/debug.h"
+#include "support/docstring.h"
 #include "support/lstrings.h"
 
 #include <climits>
diff --git a/src/FuncRequest.h b/src/FuncRequest.h
index 42829ae..6dfde4b 100644
--- a/src/FuncRequest.h
+++ b/src/FuncRequest.h
@@ -14,7 +14,7 @@
 
 #include "FuncCode.h"
 
-#include "support/docstring.h"
+#include "support/strfwd.h"
 
 #include "frontends/KeyModifier.h"
 #include "frontends/mouse_state.h"
diff --git a/src/FuncStatus.h b/src/FuncStatus.h
index 4a632dc..aba6eb8 100644
--- a/src/FuncStatus.h
+++ b/src/FuncStatus.h
@@ -12,7 +12,7 @@
 #ifndef FUNC_STATUS_H
 #define FUNC_STATUS_H
 
-#include "support/docstring.h"
+#include "support/strfwd.h"
 
 
 namespace lyx {
diff --git a/src/Graph.cpp b/src/Graph.cpp
index 036bb38..f78be28 100644
--- a/src/Graph.cpp
+++ b/src/Graph.cpp
@@ -17,8 +17,6 @@
 #include "support/debug.h"
 #include "support/lassert.h"
 
-#include <algorithm>
-
 using namespace std;
 
 namespace lyx {
diff --git a/src/HunspellChecker.cpp b/src/HunspellChecker.cpp
index 015973e..a853652 100644
--- a/src/HunspellChecker.cpp
+++ b/src/HunspellChecker.cpp
@@ -16,17 +16,13 @@
 #include "LyXRC.h"
 #include "WordLangTuple.h"
 
-#include "frontends/alert.h"
-
 #include "support/debug.h"
 #include "support/docstring_list.h"
 #include "support/filetools.h"
 #include "support/Package.h"
 #include "support/FileName.h"
-#include "support/gettext.h"
 #include "support/lassert.h"
 #include "support/lstrings.h"
-#include "support/os.h"
 
 #include <hunspell/hunspell.hxx>
 
diff --git a/src/LaTeX.cpp b/src/LaTeX.cpp
index e88184b..b74b132 100644
--- a/src/LaTeX.cpp
+++ b/src/LaTeX.cpp
@@ -26,6 +26,7 @@
 #include "Language.h"
 
 #include "support/debug.h"
+#include "support/docstring.h"
 #include "support/convert.h"
 #include "support/FileName.h"
 #include "support/filetools.h"
diff --git a/src/LaTeX.h b/src/LaTeX.h
index b76ec1f..c57b03b 100644
--- a/src/LaTeX.h
+++ b/src/LaTeX.h
@@ -16,7 +16,7 @@
 
 #include "OutputParams.h"
 
-#include "support/docstring.h"
+#include "support/strfwd.h"
 #include "support/FileName.h"
 #include "support/signals.h"
 
diff --git a/src/LaTeXFeatures.cpp b/src/LaTeXFeatures.cpp
index 616e24a..347a3e0 100644
--- a/src/LaTeXFeatures.cpp
+++ b/src/LaTeXFeatures.cpp
@@ -27,7 +27,6 @@
 #include "LaTeXFonts.h"
 #include "LaTeXPackages.h"
 #include "Layout.h"
-#include "Lexer.h"
 #include "LyXRC.h"
 #include "TextClass.h"
 #include "TexRow.h"
@@ -37,9 +36,8 @@
 
 #include "support/debug.h"
 #include "support/docstream.h"
-#include "support/FileName.h"
+#include "support/docstring.h"
 #include "support/filetools.h"
-#include "support/gettext.h"
 #include "support/lstrings.h"
 #include "support/regex.h"
 
diff --git a/src/LaTeXFeatures.h b/src/LaTeXFeatures.h
index af27b5c..27edb1f 100644
--- a/src/LaTeXFeatures.h
+++ b/src/LaTeXFeatures.h
@@ -14,7 +14,7 @@
 #define LATEXFEATURES_H
 
 #include "OutputParams.h"
-#include "support/docstring.h"
+#include "support/strfwd.h"
 
 #include <set>
 #include <list>
diff --git a/src/Language.cpp b/src/Language.cpp
index 03146c3..9ad7a9c 100644
--- a/src/Language.cpp
+++ b/src/Language.cpp
@@ -22,6 +22,7 @@
 #include "LyXRC.h"
 
 #include "support/debug.h"
+#include "support/docstring.h"
 #include "support/FileName.h"
 #include "support/filetools.h"
 #include "support/lassert.h"
diff --git a/src/Language.h b/src/Language.h
index ad8badf..0dba749 100644
--- a/src/Language.h
+++ b/src/Language.h
@@ -15,8 +15,7 @@
 #ifndef LANGUAGE_H
 #define LANGUAGE_H
 
-#include "support/docstring.h"
-#include "support/trivstring.h"
+#include "support/strfwd.h"
 
 #include <map>
 #include <set>
diff --git a/src/LayoutFile.cpp b/src/LayoutFile.cpp
index 9c76e5b..1ce04aa 100644
--- a/src/LayoutFile.cpp
+++ b/src/LayoutFile.cpp
@@ -12,20 +12,13 @@
 #include <config.h>
 
 #include "LayoutFile.h"
-#include "Counters.h"
-#include "Floating.h"
-#include "FloatList.h"
 #include "Lexer.h"
 #include "TextClass.h"
 
-#include "frontends/alert.h"
-
 #include "support/debug.h"
 #include "support/FileName.h"
 #include "support/filetools.h"
-#include "support/gettext.h"
 #include "support/lassert.h"
-#include "support/lstrings.h"
 
 #include "support/regex.h"
 #include "support/TempFile.h"
diff --git a/src/Lexer.cpp b/src/Lexer.cpp
index 2711db4..b11bf47 100644
--- a/src/Lexer.cpp
+++ b/src/Lexer.cpp
@@ -24,7 +24,6 @@
 #include "support/lassert.h"
 #include "support/lstrings.h"
 #include "support/lyxalgo.h"
-#include "support/types.h"
 
 #include <functional>
 #include <fstream>
diff --git a/src/Lexer.h b/src/Lexer.h
index 149cc7d..9568b6e 100644
--- a/src/Lexer.h
+++ b/src/Lexer.h
@@ -24,8 +24,6 @@ namespace lyx {
 
 namespace support { class FileName; }
 
-class PushPopHelper;
-
 /** A helper structure to describe a keyword for the Lexer.
 	Usually used bundled in C style arrays and passed to the
 	Lexer using a LexerKeywordTable object.
diff --git a/src/LyX.cpp b/src/LyX.cpp
index 180c4d3..c1369bc 100644
--- a/src/LyX.cpp
+++ b/src/LyX.cpp
@@ -38,7 +38,6 @@
 #include "Language.h"
 #include "LaTeXFonts.h"
 #include "LayoutFile.h"
-#include "Lexer.h"
 #include "LyX.h"
 #include "LyXAction.h"
 #include "LyXRC.h"
@@ -47,7 +46,6 @@
 #include "Server.h"
 #include "ServerSocket.h"
 #include "Session.h"
-#include "WordList.h"
 
 #include "frontends/alert.h"
 #include "frontends/Application.h"
@@ -66,7 +64,6 @@
 #include "support/Package.h"
 #include "support/unique_ptr.h"
 
-#include <algorithm>
 #include <csignal>
 #include <iostream>
 #include <functional>
diff --git a/src/LyXRC.cpp b/src/LyXRC.cpp
index 59bdc70..4fd5a28 100644
--- a/src/LyXRC.cpp
+++ b/src/LyXRC.cpp
@@ -28,23 +28,18 @@
 #include "Lexer.h"
 #include "LyX.h"
 #include "Mover.h"
-#include "Session.h"
 #include "SpellChecker.h"
 #include "version.h"
 
-#include "graphics/GraphicsTypes.h"
-
 #include "support/convert.h"
 #include "support/debug.h"
 #include "support/environment.h"
 #include "support/FileName.h"
 #include "support/filetools.h"
-#include "support/gettext.h"
 #include "support/lstrings.h"
 #include "support/os.h"
 #include "support/Package.h"
 #include "support/TempFile.h"
-#include "support/userinfo.h"
 
 #ifdef USE_MACOSX_PACKAGING
 #include "support/AppleSupport.h"
diff --git a/src/MetricsInfo.cpp b/src/MetricsInfo.cpp
index c4caa75..15e772e 100644
--- a/src/MetricsInfo.cpp
+++ b/src/MetricsInfo.cpp
@@ -10,8 +10,6 @@
 
 #include <config.h>
 
-#include "BufferView.h"
-#include "ColorSet.h"
 #include "LyXRC.h"
 #include "MetricsInfo.h"
 
@@ -22,8 +20,6 @@
 #include "frontends/FontMetrics.h"
 #include "frontends/Painter.h"
 
-#include "support/docstring.h"
-#include "support/lassert.h"
 #include "support/RefChanger.h"
 
 using namespace std;
diff --git a/src/PDFOptions.cpp b/src/PDFOptions.cpp
index 1ec97fd..a3dd1f3 100644
--- a/src/PDFOptions.cpp
+++ b/src/PDFOptions.cpp
@@ -15,10 +15,13 @@
 
 #include "Encoding.h"
 #include "Lexer.h"
+#include "OutputParams.h"
 #include "texstream.h"
 
 #include "support/convert.h"
 #include "support/debug.h"
+#include "support/docstream.h"
+#include "support/docstring.h"
 #include "support/lstrings.h"
 
 #include <sstream>
diff --git a/src/PDFOptions.h b/src/PDFOptions.h
index d74caf4..4ab0d9e 100644
--- a/src/PDFOptions.h
+++ b/src/PDFOptions.h
@@ -12,15 +12,13 @@
 #ifndef PDFOPTIONS_H
 #define PDFOPTIONS_H
 
-#include "OutputParams.h"
-
-#include "support/strfwd.h"
-
 #include <string>
 
 namespace lyx {
 
 class Lexer;
+class OutputParams;
+class otexstream;
 
 // FIXME UNICODE
 // Write functions need to use odostream instead of ostream before
diff --git a/src/ParIterator.cpp b/src/ParIterator.cpp
index 1ddf347..0464839 100644
--- a/src/ParIterator.cpp
+++ b/src/ParIterator.cpp
@@ -12,7 +12,7 @@
 
 #include "ParIterator.h"
 
-#include "Paragraph.h"
+#include "CursorSlice.h"
 #include "Text.h"
 
 #include "insets/Inset.h"
diff --git a/src/ParIterator.h b/src/ParIterator.h
index a4e410b..288b035 100644
--- a/src/ParIterator.h
+++ b/src/ParIterator.h
@@ -21,6 +21,7 @@ namespace lyx {
 
 class Buffer;
 class Inset;
+class Paragraph;
 class ParagraphList;
 
 
diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp
index f3dc50f..98e0514 100644
--- a/src/Paragraph.cpp
+++ b/src/Paragraph.cpp
@@ -20,12 +20,11 @@
 
 #include "Paragraph.h"
 
-#include "LayoutFile.h"
 #include "Buffer.h"
 #include "BufferParams.h"
+#include "BufferEncodings.h"
 #include "Changes.h"
 #include "Counters.h"
-#include "BufferEncodings.h"
 #include "InsetList.h"
 #include "Language.h"
 #include "LaTeXFeatures.h"
@@ -42,6 +41,7 @@
 #include "texstream.h"
 #include "TexRow.h"
 #include "Text.h"
+#include "TextClass.h"
 #include "WordLangTuple.h"
 #include "WordList.h"
 
diff --git a/src/Paragraph.h b/src/Paragraph.h
index 0752dfe..4812684 100644
--- a/src/Paragraph.h
+++ b/src/Paragraph.h
@@ -16,7 +16,6 @@
 #ifndef PARAGRAPH_H
 #define PARAGRAPH_H
 
-#include "FontEnums.h"
 #include "LayoutEnums.h"
 #include "SpellChecker.h"
 
diff --git a/src/ParagraphMetrics.cpp b/src/ParagraphMetrics.cpp
index 72b212b..86a3144 100644
--- a/src/ParagraphMetrics.cpp
+++ b/src/ParagraphMetrics.cpp
@@ -22,34 +22,18 @@
 #include "Buffer.h"
 #include "BufferParams.h"
 #include "BufferView.h"
-#include "Counters.h"
-#include "Encoding.h"
-#include "Language.h"
-#include "LaTeXFeatures.h"
-#include "Layout.h"
 #include "Font.h"
-#include "LyXRC.h"
+#include "Layout.h"
+#include "LayoutEnums.h"
+#include "Paragraph.h"
 #include "Row.h"
-#include "OutputParams.h"
-#include "xml.h"
 #include "TextClass.h"
-#include "TexRow.h"
 
 #include "frontends/FontMetrics.h"
 
-#include "insets/InsetBibitem.h"
-#include "insets/InsetArgument.h"
-
 #include "support/lassert.h"
 #include "support/debug.h"
-#include "support/ExceptionMessage.h"
-#include "support/gettext.h"
-#include "support/lstrings.h"
-#include "support/textutils.h"
-
-#include <algorithm>
-#include <list>
-#include <stack>
+
 #include <sstream>
 
 using namespace std;
diff --git a/src/ParagraphParameters.cpp b/src/ParagraphParameters.cpp
index 90c8705..6ef9224 100644
--- a/src/ParagraphParameters.cpp
+++ b/src/ParagraphParameters.cpp
@@ -16,13 +16,12 @@
 
 #include "ParagraphParameters.h"
 
-#include "Buffer.h"
-#include "support/gettext.h"
 #include "Layout.h"
 #include "Lexer.h"
-#include "Text.h"
 #include "Paragraph.h"
 
+#include "support/debug.h"
+#include "support/docstring.h"
 #include "support/lstrings.h"
 
 #include <sstream>
diff --git a/src/ParagraphParameters.h b/src/ParagraphParameters.h
index b4608e0..36eec30 100644
--- a/src/ParagraphParameters.h
+++ b/src/ParagraphParameters.h
@@ -17,20 +17,16 @@
 #include "LayoutEnums.h"
 #include "Spacing.h"
 
-#include "support/debug.h"
 #include "support/types.h"
-#include "support/docstring.h"
+#include "support/strfwd.h"
 #include "support/Length.h"
 
 
 namespace lyx {
 
-class BufferView;
 class Layout;
-class Length;
 class Lexer;
 class Paragraph;
-class Spacing;
 
 
 ///
diff --git a/src/PersonalWordList.cpp b/src/PersonalWordList.cpp
index 4d3292e..ca61d8a 100644
--- a/src/PersonalWordList.cpp
+++ b/src/PersonalWordList.cpp
@@ -17,15 +17,12 @@
 #include "support/filetools.h"
 #include "support/Package.h"
 #include "support/FileName.h"
-#include "support/lstrings.h"
-#include "support/os.h"
 
 #include <string>
 #include <fstream>
 
 using namespace std;
 using namespace lyx::support;
-using namespace lyx::support::os;
 
 namespace lyx {
 
diff --git a/src/Row.cpp b/src/Row.cpp
index f59b6e4..9ab7f11 100644
--- a/src/Row.cpp
+++ b/src/Row.cpp
@@ -26,8 +26,8 @@
 #include "support/debug.h"
 #include "support/lassert.h"
 #include "support/lstrings.h"
-#include "support/lyxalgo.h"
 
+#include <algorithm>
 #include <ostream>
 
 using namespace std;
diff --git a/src/RowPainter.h b/src/RowPainter.h
index d573cb8..275ff92 100644
--- a/src/RowPainter.h
+++ b/src/RowPainter.h
@@ -23,8 +23,6 @@ class Paragraph;
 class Text;
 class TextMetrics;
 
-namespace frontend { class Painter; }
-
 /**
  * A class used for painting an individual row of text.
  * FIXME: get rid of that class.
diff --git a/src/ServerSocket.cpp b/src/ServerSocket.cpp
index fd903ce..3544235 100644
--- a/src/ServerSocket.cpp
+++ b/src/ServerSocket.cpp
@@ -18,7 +18,6 @@
 
 #include "DispatchResult.h"
 #include "FuncRequest.h"
-#include "LyX.h"
 #include "LyXAction.h"
 
 #include "frontends/Application.h"
diff --git a/src/TexRow.h b/src/TexRow.h
index 8edcd8e..d6617bf 100644
--- a/src/TexRow.h
+++ b/src/TexRow.h
@@ -28,8 +28,7 @@
 #ifndef TEXROW_H
 #define TEXROW_H
 
-#include "support/debug.h"
-#include "support/docstring.h"
+#include "support/strfwd.h"
 #include "support/types.h"
 
 #include <vector>
diff --git a/src/Text.cpp b/src/Text.cpp
index e4eb4ab..5d761ca 100644
--- a/src/Text.cpp
+++ b/src/Text.cpp
@@ -22,19 +22,18 @@
 
 #include "Author.h"
 #include "Buffer.h"
-#include "buffer_funcs.h"
 #include "BufferParams.h"
 #include "BufferView.h"
 #include "Changes.h"
 #include "CompletionList.h"
 #include "Cursor.h"
+#include "CursorSlice.h"
 #include "CutAndPaste.h"
 #include "DispatchResult.h"
 #include "Encoding.h"
 #include "ErrorList.h"
-#include "FuncRequest.h"
 #include "factory.h"
-#include "InsetList.h"
+#include "Font.h"
 #include "Language.h"
 #include "Layout.h"
 #include "Lexer.h"
@@ -42,31 +41,25 @@
 #include "LyXRC.h"
 #include "Paragraph.h"
 #include "ParagraphParameters.h"
-#include "ParIterator.h"
 #include "TextClass.h"
 #include "TextMetrics.h"
-#include "WordLangTuple.h"
+#include "Undo.h"
 #include "WordList.h"
 
+#include "insets/Inset.h"
 #include "insets/InsetText.h"
-#include "insets/InsetBibitem.h"
 #include "insets/InsetCaption.h"
-#include "insets/InsetNewline.h"
-#include "insets/InsetNewpage.h"
-#include "insets/InsetArgument.h"
 #include "insets/InsetIPAMacro.h"
-#include "insets/InsetSpace.h"
 #include "insets/InsetSpecialChar.h"
 #include "insets/InsetTabular.h"
 
 #include "support/convert.h"
 #include "support/debug.h"
 #include "support/docstream.h"
+#include "support/docstring.h"
 #include "support/gettext.h"
 #include "support/lassert.h"
-#include "support/Length.h"
 #include "support/lstrings.h"
-#include "support/lyxalgo.h"
 #include "support/lyxtime.h"
 #include "support/textutils.h"
 #include "support/unique_ptr.h"
diff --git a/src/Text.h b/src/Text.h
index 3faccb8..1c5d439 100644
--- a/src/Text.h
+++ b/src/Text.h
@@ -19,14 +19,13 @@
 
 namespace lyx {
 
-class Buffer;
 class BufferParams;
 class BufferView;
+class Change;
 class CompletionList;
 class Cursor;
 class CursorData;
 class CursorSlice;
-class DocIterator;
 class ErrorList;
 class Font;
 class FontInfo;
@@ -35,8 +34,8 @@ class FuncStatus;
 class Inset;
 class InsetText;
 class Lexer;
-class PainterInfo;
-class Spacing;
+class Paragraph;
+class ParagraphParameters;
 
 /// This class encapsulates the main text data and operations in LyX.
 /// This is more or less the private implementation of InsetText.
diff --git a/src/Text2.cpp b/src/Text2.cpp
index ad5b8aa..cf687f9 100644
--- a/src/Text2.cpp
+++ b/src/Text2.cpp
@@ -23,34 +23,22 @@
 #include "Text.h"
 
 #include "Buffer.h"
-#include "buffer_funcs.h"
-#include "BufferList.h"
 #include "BufferParams.h"
 #include "BufferView.h"
 #include "Changes.h"
 #include "Cursor.h"
-#include "CutAndPaste.h"
-#include "DispatchResult.h"
-#include "ErrorList.h"
 #include "Language.h"
 #include "Layout.h"
-#include "Lexer.h"
-#include "LyX.h"
 #include "LyXRC.h"
 #include "Paragraph.h"
 #include "ParagraphParameters.h"
 #include "TextClass.h"
 #include "TextMetrics.h"
 
-#include "insets/InsetCollapsible.h"
-
-#include "mathed/InsetMathHull.h"
+#include "insets/InsetText.h"
 
 #include "support/lassert.h"
-#include "support/debug.h"
 #include "support/gettext.h"
-#include "support/lyxalgo.h"
-#include "support/textutils.h"
 
 #include <sstream>
 
diff --git a/src/Text3.cpp b/src/Text3.cpp
index 1d3e44d..cf2d701 100644
--- a/src/Text3.cpp
+++ b/src/Text3.cpp
@@ -18,18 +18,15 @@
 #include "Text.h"
 
 #include "BranchList.h"
-#include "FloatList.h"
-#include "FuncStatus.h"
 #include "Buffer.h"
-#include "buffer_funcs.h"
 #include "BufferParams.h"
 #include "BufferView.h"
-#include "Changes.h"
 #include "Cursor.h"
 #include "CutAndPaste.h"
 #include "DispatchResult.h"
-#include "ErrorList.h"
 #include "factory.h"
+#include "FloatList.h"
+#include "FuncStatus.h"
 #include "FuncRequest.h"
 #include "InsetList.h"
 #include "Intl.h"
@@ -75,9 +72,6 @@
 #include "support/lassert.h"
 #include "support/limited_stack.h"
 #include "support/lstrings.h"
-#include "support/lyxalgo.h"
-#include "support/lyxtime.h"
-#include "support/os.h"
 #include "support/regex.h"
 
 #include "mathed/InsetMathHull.h"
diff --git a/src/TextClass.cpp b/src/TextClass.cpp
index 03a7624..42169c1 100644
--- a/src/TextClass.cpp
+++ b/src/TextClass.cpp
@@ -16,22 +16,19 @@
 
 #include "TextClass.h"
 
-#include "LayoutFile.h"
 #include "CiteEnginesList.h"
-#include "Color.h"
 #include "Counters.h"
 #include "Floating.h"
 #include "FloatList.h"
 #include "Layout.h"
+#include "LayoutFile.h"
 #include "Lexer.h"
-#include "Font.h"
 #include "ModuleList.h"
 
 #include "frontends/alert.h"
 
 #include "support/lassert.h"
 #include "support/debug.h"
-#include "support/ExceptionMessage.h"
 #include "support/FileName.h"
 #include "support/filetools.h"
 #include "support/gettext.h"
diff --git a/src/TextMetrics.cpp b/src/TextMetrics.cpp
index c7d9e18..5cd7a60 100644
--- a/src/TextMetrics.cpp
+++ b/src/TextMetrics.cpp
@@ -36,15 +36,13 @@
 
 #include "insets/InsetText.h"
 
-#include "mathed/InsetMathMacroTemplate.h"
+#include "mathed/MacroTable.h"
 
 #include "frontends/FontMetrics.h"
 #include "frontends/NullPainter.h"
 
-#include "support/convert.h"
 #include "support/debug.h"
 #include "support/lassert.h"
-#include "support/lyxlib.h"
 #include "support/RefChanger.h"
 
 #include <stdlib.h>
diff --git a/src/TextMetrics.h b/src/TextMetrics.h
index 9e887f3..f7f30fa 100644
--- a/src/TextMetrics.h
+++ b/src/TextMetrics.h
@@ -28,7 +28,6 @@ namespace lyx {
 class BufferView;
 class Cursor;
 class CursorSlice;
-class DocIterator;
 class MetricsInfo;
 class Text;
 
diff --git a/src/Thesaurus.cpp b/src/Thesaurus.cpp
index 86cbd65..ace03d7 100644
--- a/src/Thesaurus.cpp
+++ b/src/Thesaurus.cpp
@@ -21,17 +21,15 @@
 #include "support/FileNameList.h"
 #include "support/Package.h"
 #include "support/debug.h"
+#include "support/docstring.h"
 #include "support/docstring_list.h"
 #include "support/filetools.h"
-#include "support/gettext.h"
 #include "support/lstrings.h"
 #include "support/os.h"
 
 #include <cstdio>
 #include MYTHES_H_LOCATION
 
-#include "frontends/alert.h"
-
 #include <algorithm>
 #include <cstring>
 #include <fstream>
diff --git a/src/Thesaurus.h b/src/Thesaurus.h
index 52987cd..9c13b04 100644
--- a/src/Thesaurus.h
+++ b/src/Thesaurus.h
@@ -13,14 +13,15 @@
 #ifndef THESAURUS_H
 #define THESAURUS_H
 
-#include "support/docstring.h"
-#include "WordLangTuple.h"
+#include "support/strfwd.h"
 
 #include <map>
 #include <vector>
 
 namespace lyx {
 
+class WordLangTuple;
+
 /**
  * This class provides an interface to whatever thesauri we might support.
  */
diff --git a/src/TocBuilder.cpp b/src/TocBuilder.cpp
index deaace2..dada6f0 100644
--- a/src/TocBuilder.cpp
+++ b/src/TocBuilder.cpp
@@ -12,6 +12,7 @@
 
 #include "TocBuilder.h"
 
+#include "DocIterator.h"
 #include "TocBackend.h"
 
 #include "support/lassert.h"
diff --git a/src/TocBuilder.h b/src/TocBuilder.h
index da016a6..5c34079 100644
--- a/src/TocBuilder.h
+++ b/src/TocBuilder.h
@@ -12,7 +12,6 @@
 #ifndef TOC_BUILDER_H
 #define TOC_BUILDER_H
 
-#include "DocIterator.h"
 #include "Toc.h"
 
 #include "support/strfwd.h"
@@ -22,6 +21,7 @@
 
 namespace lyx {
 
+class DocIterator;
 
 /// Caption-enabled TOC builders
 class TocBuilder
diff --git a/src/Trans.cpp b/src/Trans.cpp
index 02c8f86..5a03665 100644
--- a/src/Trans.cpp
+++ b/src/Trans.cpp
@@ -13,11 +13,7 @@
 
 #include "Trans.h"
 
-#include "Buffer.h"
-#include "BufferView.h"
-#include "Cursor.h"
 #include "Lexer.h"
-#include "LyXRC.h"
 #include "Text.h"
 
 #include "support/debug.h"
diff --git a/src/Undo.cpp b/src/Undo.cpp
index da4d27c..6704490 100644
--- a/src/Undo.cpp
+++ b/src/Undo.cpp
@@ -20,7 +20,6 @@
 #include "Buffer.h"
 #include "BufferList.h"
 #include "BufferParams.h"
-#include "buffer_funcs.h"
 #include "Cursor.h"
 #include "CutAndPaste.h"
 #include "ErrorList.h"
@@ -28,14 +27,12 @@
 #include "ParagraphList.h"
 #include "Text.h"
 
-#include "mathed/MathSupport.h"
 #include "mathed/MathData.h"
 
 #include "insets/Inset.h"
 #include "insets/InsetText.h"
 
 #include "support/debug.h"
-#include "support/gettext.h"
 #include "support/lassert.h"
 #include "support/lyxtime.h"
 
diff --git a/src/Undo.h b/src/Undo.h
index 8b482d2..887f762 100644
--- a/src/Undo.h
+++ b/src/Undo.h
@@ -22,11 +22,8 @@
 namespace lyx {
 
 class Buffer;
-class BufferParams;
 class CursorData;
 class Inset;
-class MathData;
-class ParagraphList;
 
 /// This is used to combine consecutive undo recordings of the same kind.
 enum UndoKind {
diff --git a/src/VCBackend.cpp b/src/VCBackend.cpp
index 309d705..bee398c 100644
--- a/src/VCBackend.cpp
+++ b/src/VCBackend.cpp
@@ -13,7 +13,6 @@
 
 #include "VCBackend.h"
 #include "Buffer.h"
-#include "DispatchResult.h"
 #include "LyX.h"
 #include "FuncRequest.h"
 
diff --git a/src/VSpace.cpp b/src/VSpace.cpp
index d176850..abec3ef 100644
--- a/src/VSpace.cpp
+++ b/src/VSpace.cpp
@@ -16,7 +16,6 @@
 #include "BufferParams.h"
 #include "BufferView.h"
 #include "support/gettext.h"
-#include "Text.h"
 #include "TextMetrics.h" // for defaultRowHeight()
 
 #include "support/convert.h"
diff --git a/src/factory.cpp b/src/factory.cpp
index 0cd3a4c..dd72fe3 100644
--- a/src/factory.cpp
+++ b/src/factory.cpp
@@ -12,13 +12,9 @@
 
 #include "factory.h"
 
-#include "Buffer.h"
-#include "BufferParams.h"
-#include "FloatList.h"
 #include "FuncRequest.h"
 #include "Lexer.h"
 #include "LyX.h"
-#include "TextClass.h"
 
 #include "insets/InsetBibitem.h"
 #include "insets/InsetBibtex.h"
@@ -51,6 +47,7 @@
 #include "insets/InsetArgument.h"
 #include "insets/InsetPhantom.h"
 #include "insets/InsetPreview.h"
+#include "insets/InsetQuotes.h"
 #include "insets/InsetRef.h"
 #include "insets/InsetScript.h"
 #include "insets/InsetSeparator.h"
@@ -67,7 +64,6 @@
 
 #include "support/debug.h"
 #include "support/ExceptionMessage.h"
-#include "support/lassert.h"
 #include "support/lstrings.h"
 #include "support/unique_ptr.h"
 
diff --git a/src/insets/InsetText.cpp b/src/insets/InsetText.cpp
index 10b15c8..6f7a1a4 100644
--- a/src/insets/InsetText.cpp
+++ b/src/insets/InsetText.cpp
@@ -51,6 +51,7 @@
 #include "Text.h"
 #include "TextMetrics.h"
 #include "TocBackend.h"
+#include "TocBuilder.h"
 
 #include "frontends/alert.h"
 #include "frontends/Painter.h"
@@ -63,6 +64,7 @@
 #include "support/RefChanger.h"
 
 #include <algorithm>
+#include <stack>
 
 
 using namespace std;
diff --git a/src/lyxfind.cpp b/src/lyxfind.cpp
index e12d4d2..54683b0 100644
--- a/src/lyxfind.cpp
+++ b/src/lyxfind.cpp
@@ -17,7 +17,6 @@
 #include "lyxfind.h"
 
 #include "Buffer.h"
-#include "buffer_funcs.h"
 #include "BufferList.h"
 #include "BufferParams.h"
 #include "BufferView.h"
@@ -29,8 +28,6 @@
 #include "output_latex.h"
 #include "OutputParams.h"
 #include "Paragraph.h"
-#include "ParIterator.h"
-#include "TexRow.h"
 #include "Text.h"
 #include "Encoding.h"
 
diff --git a/src/lyxfind.h b/src/lyxfind.h
index bfaae8f..9daf4c8 100644
--- a/src/lyxfind.h
+++ b/src/lyxfind.h
@@ -23,14 +23,10 @@
 
 namespace lyx {
 
-
-
-class Buffer;
 class Cursor;
 class BufferView;
 class DocIterator;
 class FuncRequest;
-class Text;
 
 /** Encode the parameters needed to find \c search as a string
  *  that can be dispatched to the LyX core in a FuncRequest wrapper.
diff --git a/src/output_xhtml.cpp b/src/output_xhtml.cpp
index d428761..a4aced6 100644
--- a/src/output_xhtml.cpp
+++ b/src/output_xhtml.cpp
@@ -15,7 +15,6 @@
 #include "output_xhtml.h"
 
 #include "Buffer.h"
-#include "buffer_funcs.h"
 #include "BufferParams.h"
 #include "Counters.h"
 #include "Font.h"
@@ -28,11 +27,7 @@
 #include "Text.h"
 #include "TextClass.h"
 
-#include "support/convert.h"
-#include "support/debug.h"
 #include "support/lassert.h"
-#include "support/lstrings.h"
-#include "support/textutils.h"
 
 #include <stack>
 #include <iostream>


More information about the lyx-cvs mailing list