commit 32b0624d71a8dddcffcb1ef4fe5189a224510c41
Author: Pavel Sanda <sa...@lyx.org>
Date:   Fri May 23 02:13:01 2025 +0200

    Couple more cases where forward decls are enough.
    
    There remain dozens filtered candidates where we could do the same trick but
    the included classes are actually used within methods and any attempt to 
access
    candidate class->members later would break the compilation, so let's stop
    the optimization here.
---
 src/frontends/qt/GuiInfo.cpp | 4 +++-
 src/insets/InsetCitation.cpp | 3 ++-
 src/insets/InsetFootlike.cpp | 4 ++--
 src/insets/InsetIPAMacro.cpp | 3 ++-
 src/insets/InsetLine.cpp     | 3 ++-
 src/mathed/InsetMathFrac.cpp | 3 ++-
 src/mathed/InsetMathSqrt.cpp | 3 ++-
 7 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/src/frontends/qt/GuiInfo.cpp b/src/frontends/qt/GuiInfo.cpp
index 7bf1644f40..f8a1d6e86e 100644
--- a/src/frontends/qt/GuiInfo.cpp
+++ b/src/frontends/qt/GuiInfo.cpp
@@ -15,7 +15,6 @@
 
 #include "qt_helpers.h"
 
-#include "Buffer.h"
 #include "BufferView.h"
 #include "Language.h"
 
@@ -33,6 +32,9 @@ using namespace std;
 using namespace lyx::support;
 
 namespace lyx {
+
+class Buffer;
+
 namespace frontend {
 
 /////////////////////////////////////////////////////////////////
diff --git a/src/insets/InsetCitation.cpp b/src/insets/InsetCitation.cpp
index 5cec6b7d73..0ecf2c4ca1 100644
--- a/src/insets/InsetCitation.cpp
+++ b/src/insets/InsetCitation.cpp
@@ -24,7 +24,6 @@
 #include "LyX.h"
 #include "LyXRC.h"
 #include "output_xhtml.h"
-#include "ParIterator.h"
 #include "Statistics.h"
 #include "texstream.h"
 #include "TocBackend.h"
@@ -43,6 +42,8 @@ using namespace lyx::support;
 
 namespace lyx {
 
+class ParIterator;
+
 InsetCitation::InsetCitation(Buffer * buf, InsetCommandParams const & p)
        : InsetCommand(buf, p)
 {
diff --git a/src/insets/InsetFootlike.cpp b/src/insets/InsetFootlike.cpp
index f1233a1af9..45f3e79d74 100644
--- a/src/insets/InsetFootlike.cpp
+++ b/src/insets/InsetFootlike.cpp
@@ -12,8 +12,6 @@
 
 #include "InsetFootlike.h"
 
-#include "Buffer.h"
-
 #include "support/lstrings.h"
 
 #include <iostream>
@@ -22,6 +20,8 @@ using namespace std;
 
 namespace lyx {
 
+class Buffer;
+
 using support::token;
 
 InsetFootlike::InsetFootlike(Buffer * buf)
diff --git a/src/insets/InsetIPAMacro.cpp b/src/insets/InsetIPAMacro.cpp
index 040dde5b5b..fbbb050107 100644
--- a/src/insets/InsetIPAMacro.cpp
+++ b/src/insets/InsetIPAMacro.cpp
@@ -12,7 +12,6 @@
 
 #include "InsetIPAMacro.h"
 
-#include "Buffer.h"
 #include "Dimension.h"
 #include "FontInfo.h"
 #include "FuncRequest.h"
@@ -36,6 +35,8 @@ using namespace std;
 
 namespace lyx {
 
+class Buffer;
+
 using support::Lexer;
 
 namespace {
diff --git a/src/insets/InsetLine.cpp b/src/insets/InsetLine.cpp
index 038d221c2f..a75a48f80a 100644
--- a/src/insets/InsetLine.cpp
+++ b/src/insets/InsetLine.cpp
@@ -14,7 +14,6 @@
 
 #include "InsetLine.h"
 
-#include "Buffer.h"
 #include "Cursor.h"
 #include "Dimension.h"
 #include "DispatchResult.h"
@@ -38,6 +37,8 @@ using namespace std;
 
 namespace lyx {
 
+class Buffer;
+
 using frontend::Painter;
 
 
diff --git a/src/mathed/InsetMathFrac.cpp b/src/mathed/InsetMathFrac.cpp
index 7a04d99a2c..692ae8e8a0 100644
--- a/src/mathed/InsetMathFrac.cpp
+++ b/src/mathed/InsetMathFrac.cpp
@@ -23,7 +23,6 @@
 #include "Dimension.h"
 #include "LaTeXFeatures.h"
 #include "MetricsInfo.h"
-#include "TextPainter.h"
 
 #include "frontends/FontMetrics.h"
 #include "frontends/Painter.h"
@@ -35,6 +34,8 @@ using namespace std;
 
 namespace lyx {
 
+class TextPainter;
+
 /////////////////////////////////////////////////////////////////////
 //
 // InsetMathFracBase
diff --git a/src/mathed/InsetMathSqrt.cpp b/src/mathed/InsetMathSqrt.cpp
index 3b9c71419a..20262ae5b3 100644
--- a/src/mathed/InsetMathSqrt.cpp
+++ b/src/mathed/InsetMathSqrt.cpp
@@ -19,11 +19,12 @@
 #include "Dimension.h"
 #include "LaTeXFeatures.h"
 #include "MetricsInfo.h"
-#include "TextPainter.h"
 
 
 namespace lyx {
 
+class TextPainter;
+
 InsetMathSqrt::InsetMathSqrt(Buffer * buf)
        : InsetMathNest(buf, 1)
 {}
-- 
lyx-cvs mailing list
lyx-cvs@lists.lyx.org
https://lists.lyx.org/mailman/listinfo/lyx-cvs

Reply via email to