[LyX/master] Clean-up uses of statsEnabled()

Jean-Marc Lasgouttes lasgouttes at lyx.org
Mon Oct 21 13:47:17 UTC 2024


commit 9bc7d641407405a19400de437800d86940f60997
Author: Jean-Marc Lasgouttes <lasgouttes at lyx.org>
Date:   Mon Oct 21 15:43:07 2024 +0200

    Clean-up uses of statsEnabled()
---
 src/frontends/qt/GuiView.cpp | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/src/frontends/qt/GuiView.cpp b/src/frontends/qt/GuiView.cpp
index 6969cb1832..3778b7e2d3 100644
--- a/src/frontends/qt/GuiView.cpp
+++ b/src/frontends/qt/GuiView.cpp
@@ -1062,7 +1062,7 @@ bool GuiView::restoreLayout()
 	word_count_enabled_ = settings.value("word_count_enabled", true).toBool();
 	char_count_enabled_ = settings.value("char_count_enabled", true).toBool();
 	char_nb_count_enabled_ = settings.value("char_nb_count_enabled", true).toBool();
-	stat_counts_->setVisible(word_count_enabled_ || char_count_enabled_ || char_nb_count_enabled_);
+	stat_counts_->setVisible(statsEnabled());
 
 	if (guiApp->platformName() == "xcb") {
 		QPoint pos = settings.value("pos", QPoint(50, 50)).toPoint();
@@ -5176,16 +5176,13 @@ bool GuiView::lfunUiToggle(string const & ui_component)
 		zoom_widget_->setVisible(!zoom_widget_->isVisible());
 	} else if (ui_component == "statistics-w") {
 		word_count_enabled_ = !word_count_enabled_;
-		if (statsEnabled())
-			showStats();
+		showStats();
 	} else if (ui_component == "statistics-cb") {
 		char_count_enabled_ = !char_count_enabled_;
-		if (statsEnabled())
-			showStats();
+		showStats();
 	} else if (ui_component == "statistics-c") {
 		char_nb_count_enabled_ = !char_nb_count_enabled_;
-		if (statsEnabled())
-			showStats();
+		showStats();
 	} else if (ui_component == "frame") {
 		int const l = contentsMargins().left();
 


More information about the lyx-cvs mailing list