Refactoring patches

Yuriy Skalko yuriy.skalko at gmail.com
Thu Oct 15 19:56:29 UTC 2020


Here is an update with include cleanup in headers.

Yuriy
-------------- next part --------------
From 6773333ae51c11b1441cc4e1cb616d5fef42c691 Mon Sep 17 00:00:00 2001
From: Yuriy Skalko <yuriy.skalko at gmail.com>
Date: Thu, 15 Oct 2020 21:09:21 +0300
Subject: [PATCH 1/3] Move Cursor.h from TocWidget.h

---
 src/frontends/qt/TocWidget.cpp |  1 +
 src/frontends/qt/TocWidget.h   | 13 ++++++++++---
 2 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/src/frontends/qt/TocWidget.cpp b/src/frontends/qt/TocWidget.cpp
index d001b703f1..45cc6112d2 100644
--- a/src/frontends/qt/TocWidget.cpp
+++ b/src/frontends/qt/TocWidget.cpp
@@ -20,6 +20,7 @@
 
 #include "Buffer.h"
 #include "BufferView.h"
+#include "Cursor.h"
 #include "CutAndPaste.h"
 #include "FuncRequest.h"
 #include "FuncStatus.h"
diff --git a/src/frontends/qt/TocWidget.h b/src/frontends/qt/TocWidget.h
index 15006fac38..c8fa08a6f1 100644
--- a/src/frontends/qt/TocWidget.h
+++ b/src/frontends/qt/TocWidget.h
@@ -15,15 +15,22 @@
 
 #include "ui_TocUi.h"
 
-#include "Cursor.h"
-#include "FuncCode.h"
+#include "FuncRequest.h"
 
+#include <QString>
 #include <QWidget>
 
 class QModelIndex;
-class QString;
+class QPoint;
+class QTimer;
 
 namespace lyx {
+
+class Cursor;
+class DispatchResult;
+class FuncStatus;
+class Inset;
+
 namespace frontend {
 
 class GuiView;
-- 
2.28.0.windows.1

-------------- next part --------------
From 3ece5cad24e5fd68bf91ebb9d4f597128ce3a4f0 Mon Sep 17 00:00:00 2001
From: Yuriy Skalko <yuriy.skalko at gmail.com>
Date: Thu, 15 Oct 2020 22:15:21 +0300
Subject: [PATCH 2/3] Const refactor

---
 src/BufferParams.cpp | 4 ++--
 src/BufferParams.h   | 4 ++--
 src/TextClass.h      | 4 ++--
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp
index 5f5a4cb231..c44200d4ab 100644
--- a/src/BufferParams.cpp
+++ b/src/BufferParams.cpp
@@ -567,7 +567,7 @@ AuthorList const & BufferParams::authors() const
 }
 
 
-void BufferParams::addAuthor(Author a)
+void BufferParams::addAuthor(Author const & a)
 {
 	author_map_[a.bufferId()] = pimpl_->authorlist.record(a);
 }
@@ -3509,7 +3509,7 @@ string const & BufferParams::defaultBiblioStyle() const
 }
 
 
-bool const & BufferParams::fullAuthorList() const
+bool BufferParams::fullAuthorList() const
 {
 	return documentClass().fullAuthorList();
 }
diff --git a/src/BufferParams.h b/src/BufferParams.h
index b42d622fb3..0a68c479a8 100644
--- a/src/BufferParams.h
+++ b/src/BufferParams.h
@@ -446,7 +446,7 @@ public:
 	/// the author list for the document
 	AuthorList & authors();
 	AuthorList const & authors() const;
-	void addAuthor(Author a);
+	void addAuthor(Author const & a);
 
 	/// map of the file's author IDs to AuthorList indexes
 	typedef std::map<int, int> AuthorMap;
@@ -513,7 +513,7 @@ public:
 	/// Get the default BibTeX style file from the TextClass
 	std::string const & defaultBiblioStyle() const;
 	/// whether the BibTeX style supports full author lists
-	bool const & fullAuthorList() const;
+	bool fullAuthorList() const;
 	/// Check if a citation style is an alias to another style
 	std::string getCiteAlias(std::string const & s) const;
 
diff --git a/src/TextClass.h b/src/TextClass.h
index fa9ac20e1d..6ba185aa9c 100644
--- a/src/TextClass.h
+++ b/src/TextClass.h
@@ -553,9 +553,9 @@ public:
 	/// The maximum number of citations before "et al."
 	size_t max_citenames() const { return maxcitenames_; }
 	///
-	bool const & fullAuthorList() const { return cite_full_author_list_; }
+	bool fullAuthorList() const { return cite_full_author_list_; }
 	///
-	bool const & bibInToc() const { return bibintoc_; }
+	bool bibInToc() const { return bibintoc_; }
 protected:
 	/// Constructs a DocumentClass based upon a LayoutFile.
 	DocumentClass(LayoutFile const & tc);
-- 
2.28.0.windows.1

-------------- next part --------------
From 07a93e32e1cc866d1ea0638ed75d214f1cbbdbbc Mon Sep 17 00:00:00 2001
From: Yuriy Skalko <yuriy.skalko at gmail.com>
Date: Thu, 15 Oct 2020 22:27:52 +0300
Subject: [PATCH 3/3] Move Author.h, Format.h from BufferParams.h

---
 src/BufferParams.cpp             | 1 +
 src/BufferParams.h               | 5 +++--
 src/CutAndPaste.cpp              | 1 +
 src/frontends/qt/GuiDocument.cpp | 1 +
 src/frontends/qt/GuiView.cpp     | 1 +
 src/insets/InsetTabular.cpp      | 1 +
 6 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/BufferParams.cpp b/src/BufferParams.cpp
index c44200d4ab..8d0d7d13d4 100644
--- a/src/BufferParams.cpp
+++ b/src/BufferParams.cpp
@@ -28,6 +28,7 @@
 #include "ColorSet.h"
 #include "Converter.h"
 #include "Encoding.h"
+#include "Format.h"
 #include "IndicesList.h"
 #include "Language.h"
 #include "LaTeXFeatures.h"
diff --git a/src/BufferParams.h b/src/BufferParams.h
index 0a68c479a8..6a5ded8260 100644
--- a/src/BufferParams.h
+++ b/src/BufferParams.h
@@ -15,10 +15,8 @@
 #ifndef BUFFERPARAMS_H
 #define BUFFERPARAMS_H
 
-#include "Author.h"
 #include "Citation.h"
 #include "DocumentClassPtr.h"
-#include "Format.h"
 #include "LayoutModuleList.h"
 #include "OutputParams.h"
 #include "paper.h"
@@ -34,11 +32,14 @@ namespace lyx {
 
 namespace support { class FileName; }
 
+class Author;
+class AuthorList;
 class BranchList;
 class Bullet;
 class DocumentClass;
 class Encoding;
 class Font;
+class Format;
 class IndicesList;
 class Language;
 class LayoutFile;
diff --git a/src/CutAndPaste.cpp b/src/CutAndPaste.cpp
index fd0b73ce6f..772fa49b5e 100644
--- a/src/CutAndPaste.cpp
+++ b/src/CutAndPaste.cpp
@@ -15,6 +15,7 @@
 
 #include "CutAndPaste.h"
 
+#include "Author.h"
 #include "BranchList.h"
 #include "Buffer.h"
 #include "buffer_funcs.h"
diff --git a/src/frontends/qt/GuiDocument.cpp b/src/frontends/qt/GuiDocument.cpp
index d4f388db08..883b283629 100644
--- a/src/frontends/qt/GuiDocument.cpp
+++ b/src/frontends/qt/GuiDocument.cpp
@@ -33,6 +33,7 @@
 #include "Cursor.h"
 #include "Encoding.h"
 #include "FloatPlacement.h"
+#include "Format.h"
 #include "FuncRequest.h"
 #include "IndicesList.h"
 #include "Language.h"
diff --git a/src/frontends/qt/GuiView.cpp b/src/frontends/qt/GuiView.cpp
index c33a06f104..d417ffecd9 100644
--- a/src/frontends/qt/GuiView.cpp
+++ b/src/frontends/qt/GuiView.cpp
@@ -47,6 +47,7 @@
 #include "CutAndPaste.h"
 #include "Encoding.h"
 #include "ErrorList.h"
+#include "Format.h"
 #include "FuncStatus.h"
 #include "FuncRequest.h"
 #include "Language.h"
diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp
index afd29761e9..00d9bc1fbb 100644
--- a/src/insets/InsetTabular.cpp
+++ b/src/insets/InsetTabular.cpp
@@ -22,6 +22,7 @@
 
 #include "InsetTabular.h"
 
+#include "Author.h"
 #include "buffer_funcs.h"
 #include "Buffer.h"
 #include "BufferParams.h"
-- 
2.28.0.windows.1



More information about the lyx-devel mailing list