Refactoring patches

Yuriy Skalko yuriy.skalko at gmail.com
Mon Oct 19 08:55:10 UTC 2020


> All these look good to me, so please go on. Pavel

And here is the next update.

Yuriy
-------------- next part --------------
From 50f4ab1a4e69346df9bc313ec61e8878852215ef Mon Sep 17 00:00:00 2001
From: Yuriy Skalko <yuriy.skalko at gmail.com>
Date: Mon, 19 Oct 2020 11:51:00 +0300
Subject: [PATCH] Reduce includes in header files

---
 src/BiblioInfo.h        | 4 ++--
 src/Buffer.h            | 2 +-
 src/BufferView.h        | 1 -
 src/CiteEnginesList.cpp | 1 -
 src/CmdDef.cpp          | 1 +
 src/CmdDef.h            | 4 ++--
 src/Compare.cpp         | 1 +
 src/Compare.h           | 4 ++--
 src/DepTable.cpp        | 1 +
 src/DepTable.h          | 5 +++--
 src/LayoutFile.h        | 3 ++-
 src/Text.h              | 1 +
 src/TextClass.h         | 2 --
 src/buffer_funcs.cpp    | 1 +
 14 files changed, 17 insertions(+), 14 deletions(-)

diff --git a/src/BiblioInfo.h b/src/BiblioInfo.h
index 34bbaf810c..ca5cdad366 100644
--- a/src/BiblioInfo.h
+++ b/src/BiblioInfo.h
@@ -17,8 +17,6 @@
 
 #include "support/docstring.h"
 
-#include "Citation.h"
-
 #include <map>
 #include <set>
 #include <vector>
@@ -28,6 +26,8 @@ namespace lyx {
 
 class Buffer;
 class BufferParams;
+class CitationStyle;
+class CiteItem;
 class XMLStream;
 
 /// \param latex_str a LaTeX command, "cite", "Citep*", etc
diff --git a/src/Buffer.h b/src/Buffer.h
index 8aa8478500..2d96ff938e 100644
--- a/src/Buffer.h
+++ b/src/Buffer.h
@@ -17,7 +17,6 @@
 #include "support/unique_ptr.h"
 #include "support/strfwd.h"
 #include "support/types.h"
-#include "support/FileNameList.h"
 
 #include <map>
 #include <list>
@@ -66,6 +65,7 @@ class WorkAreaManager;
 namespace support {
 class DocFileName;
 class FileName;
+class FileNameList;
 } // namespace support
 
 namespace graphics {
diff --git a/src/BufferView.h b/src/BufferView.h
index 22f0d92765..74e29c6424 100644
--- a/src/BufferView.h
+++ b/src/BufferView.h
@@ -46,7 +46,6 @@ class MathData;
 class MathRow;
 class ParagraphMetrics;
 class Point;
-class TexRow;
 class Text;
 class TextMetrics;
 
diff --git a/src/CiteEnginesList.cpp b/src/CiteEnginesList.cpp
index 7d7ad3f7df..aeb60dd56a 100644
--- a/src/CiteEnginesList.cpp
+++ b/src/CiteEnginesList.cpp
@@ -14,7 +14,6 @@
 
 #include "CiteEnginesList.h"
 
-#include "Citation.h"
 #include "LaTeXFeatures.h"
 #include "Lexer.h"
 
diff --git a/src/CmdDef.cpp b/src/CmdDef.cpp
index 8a480bd4df..08cd7dd6a9 100644
--- a/src/CmdDef.cpp
+++ b/src/CmdDef.cpp
@@ -12,6 +12,7 @@
 
 #include "CmdDef.h"
 
+#include "FuncRequest.h"
 #include "LyXAction.h"
 #include "Lexer.h"
 
diff --git a/src/CmdDef.h b/src/CmdDef.h
index 5fb6e366b6..946730e64e 100644
--- a/src/CmdDef.h
+++ b/src/CmdDef.h
@@ -12,8 +12,6 @@
 #ifndef CMDDEF_H
 #define CMDDEF_H
 
-#include "FuncRequest.h"
-
 #include "support/strfwd.h"
 
 #include <map>
@@ -21,6 +19,8 @@
 
 namespace lyx {
 
+class FuncRequest;
+
 /// Creates command definitions
 class CmdDef {
 private:
diff --git a/src/Compare.cpp b/src/Compare.cpp
index aaadf8258a..490a2ec0bd 100644
--- a/src/Compare.cpp
+++ b/src/Compare.cpp
@@ -13,6 +13,7 @@
 #include "Compare.h"
 
 #include "Author.h"
+#include "Buffer.h"
 #include "BufferParams.h"
 #include "Changes.h"
 #include "CutAndPaste.h"
diff --git a/src/Compare.h b/src/Compare.h
index 40ecf5c23a..1c93fb58ce 100644
--- a/src/Compare.h
+++ b/src/Compare.h
@@ -12,8 +12,6 @@
 #ifndef COMPARE_H
 #define COMPARE_H
 
-#include "Buffer.h"
-
 #include <QObject>
 #include <QThread>
 #include <QTimer>
@@ -22,6 +20,8 @@
 
 namespace lyx {
 
+class Buffer;
+
 /**
  * The options that are used by the Comparison algorithm
  * and are set in the GuiCompare Dialog.
diff --git a/src/DepTable.cpp b/src/DepTable.cpp
index 853edf22c8..f8058fee30 100644
--- a/src/DepTable.cpp
+++ b/src/DepTable.cpp
@@ -15,6 +15,7 @@
 #include "DepTable.h"
 
 #include "support/debug.h"
+#include "support/FileName.h"
 #include "support/filetools.h"
 #include "support/lstrings.h"
 #include "support/lyxtime.h"
diff --git a/src/DepTable.h b/src/DepTable.h
index 0d78ab8f53..13498b7593 100644
--- a/src/DepTable.h
+++ b/src/DepTable.h
@@ -13,14 +13,15 @@
 #ifndef DEP_TABLE_H
 #define DEP_TABLE_H
 
-#include "support/FileName.h"
-
+#include <ctime>
 #include <map>
 #include <string>
 
 
 namespace lyx {
 
+namespace support { class FileName; }
+
 ///
 class DepTable {
 public:
diff --git a/src/LayoutFile.h b/src/LayoutFile.h
index fe86532266..81dff9de78 100644
--- a/src/LayoutFile.h
+++ b/src/LayoutFile.h
@@ -13,7 +13,6 @@
 #ifndef BASECLASSLIST_H
 #define BASECLASSLIST_H
 
-#include "LayoutModuleList.h"
 #include "TextClass.h"
 
 #include "support/strfwd.h"
@@ -24,6 +23,8 @@
 
 namespace lyx {
 
+class LayoutModuleList;
+
 /// Index into LayoutFileList. Basically a 'strong typedef'.
 class LayoutFileIndex {
 public:
diff --git a/src/Text.h b/src/Text.h
index 723e66b80d..3faccb8c59 100644
--- a/src/Text.h
+++ b/src/Text.h
@@ -33,6 +33,7 @@ class FontInfo;
 class FuncRequest;
 class FuncStatus;
 class Inset;
+class InsetText;
 class Lexer;
 class PainterInfo;
 class Spacing;
diff --git a/src/TextClass.h b/src/TextClass.h
index 5314f391fb..741bf33d8f 100644
--- a/src/TextClass.h
+++ b/src/TextClass.h
@@ -15,7 +15,6 @@
 #include "DocumentClassPtr.h"
 #include "FloatList.h"
 #include "FontInfo.h"
-#include "Layout.h"
 #include "LayoutEnums.h"
 #include "LayoutModuleList.h"
 
@@ -38,7 +37,6 @@ namespace lyx {
 
 namespace support { class FileName; }
 
-class Counters;
 class FloatList;
 class Layout;
 class LayoutFile;
diff --git a/src/buffer_funcs.cpp b/src/buffer_funcs.cpp
index 8ac7e97360..58aa12d99a 100644
--- a/src/buffer_funcs.cpp
+++ b/src/buffer_funcs.cpp
@@ -22,6 +22,7 @@
 #include "support/lassert.h"
 #include "support/convert.h"
 #include "support/debug.h"
+#include "support/FileName.h"
 #include "support/filetools.h"
 #include "support/gettext.h"
 #include "support/lstrings.h"
-- 
2.28.0.windows.1



More information about the lyx-devel mailing list