[LyX/master] Move defaultRowHeight() to BufferView.h

Jean-Marc Lasgouttes <[email protected]> Thu, 30 Apr 2026 15:06:38 +0000
Newsgroups gmane.editors.lyx.cvs
Message-ID <[email protected]>
commit 696b3be80ece2f79a0370e6ca473a14b89a2ed17
Author: Jean-Marc Lasgouttes <[email protected]>
Date:   Thu Apr 30 17:05:33 2026 +0200

    Move defaultRowHeight() to BufferView.h
    
    It is a better place than TextMetrics.h.
---
 src/BufferView.cpp            | 6 ++++++
 src/BufferView.h              | 3 +++
 src/TextMetrics.cpp           | 5 -----
 src/TextMetrics.h             | 3 ---
 src/VSpace.cpp                | 1 -
 src/insets/InsetTextbreak.cpp | 2 +-
 6 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/src/BufferView.cpp b/src/BufferView.cpp
index d3a457ffd3..995ea8a85d 100644
--- a/src/BufferView.cpp
+++ b/src/BufferView.cpp
@@ -4189,4 +4189,10 @@ bool BufferView::stats_update_trigger()
 	return false;
 }
 
+
+int defaultRowHeight()
+{
+	return int(theFontMetrics(sane_font).maxHeight() *  1.2);
+}
+
 } // namespace lyx
diff --git a/src/BufferView.h b/src/BufferView.h
index 50f783f37e..9823fccea7 100644
--- a/src/BufferView.h
+++ b/src/BufferView.h
@@ -484,6 +484,9 @@ inline int nestMargin() { return 15; }
 /// margin for changebar
 inline int changebarMargin() { return 12; }
 
+/// return the default height of a row in pixels, considering font zoom
+int defaultRowHeight();
+
 } // namespace lyx
 
 #endif // BUFFERVIEW_H
diff --git a/src/TextMetrics.cpp b/src/TextMetrics.cpp
index eb34cdd664..04827030e5 100644
--- a/src/TextMetrics.cpp
+++ b/src/TextMetrics.cpp
@@ -2148,9 +2148,4 @@ void TextMetrics::completionPosAndDim(Cursor const & cur, int & x, int & y,
 	//lyxerr << " wordstart=" << wordStart << " bvcur=" << bvcur << " cur=" << cur << std::endl;
 }
 
-int defaultRowHeight()
-{
-	return int(theFontMetrics(sane_font).maxHeight() *  1.2);
-}
-
 } // namespace lyx
diff --git a/src/TextMetrics.h b/src/TextMetrics.h
index 6f283617d1..8933b303b9 100644
--- a/src/TextMetrics.h
+++ b/src/TextMetrics.h
@@ -286,9 +286,6 @@ public:
 	mutable Font font_;
 };
 
-/// return the default height of a row in pixels, considering font zoom
-int defaultRowHeight();
-
 } // namespace lyx
 
 #endif // TEXT_METRICS_H
diff --git a/src/VSpace.cpp b/src/VSpace.cpp
index 50fc2e50a7..bf2cdc60af 100644
--- a/src/VSpace.cpp
+++ b/src/VSpace.cpp
@@ -16,7 +16,6 @@
 #include "BufferParams.h"
 #include "BufferView.h"
 #include "support/gettext.h"
-#include "TextMetrics.h" // for defaultRowHeight()
 
 #include "support/convert.h"
 #include "support/Length.h"
diff --git a/src/insets/InsetTextbreak.cpp b/src/insets/InsetTextbreak.cpp
index 0e7fe184ff..9dd4c8d08d 100644
--- a/src/insets/InsetTextbreak.cpp
+++ b/src/insets/InsetTextbreak.cpp
@@ -14,6 +14,7 @@
 #include "InsetTextbreak.h"
 
 #include "Buffer.h"
+#include "BufferView.h"
 #include "Cursor.h"
 #include "FuncRequest.h"
 #include "FuncStatus.h"
@@ -22,7 +23,6 @@
 #include "Text.h"
 #include "xml.h"
 #include "texstream.h"
-#include "TextMetrics.h"
 
 #include "frontends/FontMetrics.h"
 #include "frontends/Painter.h"
-- 
lyx-cvs mailing list
[email protected]
https://lists.lyx.org/mailman/listinfo/lyx-cvs