[LyX/master] Further improve status check of master-buffer-forall

Juergen Spitzmueller spitz at lyx.org
Thu Jan 2 12:54:16 UTC 2020


commit 3f7b8db1b151615f083f7b37d1c6cd3ae268bb64
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Thu Jan 2 14:09:01 2020 +0100

    Further improve status check of master-buffer-forall
---
 src/frontends/qt/GuiView.cpp |   16 +++++++++++++---
 1 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/src/frontends/qt/GuiView.cpp b/src/frontends/qt/GuiView.cpp
index 428d0ce..eec1b7a 100644
--- a/src/frontends/qt/GuiView.cpp
+++ b/src/frontends/qt/GuiView.cpp
@@ -1971,13 +1971,23 @@ bool GuiView::getStatus(FuncRequest const & cmd, FuncStatus & flag)
 		if (doc_buffer == 0) {
 			flag.message(from_utf8(N_("Command not allowed without a buffer open")));
 			enable = false;
+			break;
 		}
 		FuncRequest const cmdToPass = lyxaction.lookupFunc(cmd.getLongArg(0));
 		if (cmdToPass.action() == LFUN_UNKNOWN_ACTION) {
-			flag.message(from_utf8(N_("the <LFUN-COMMAND> argument of master-buffer-forall is not valid")));
+			flag.message(from_utf8(N_("Invalid argument of master-buffer-forall")));
 			enable = false;
-		} else {
-			enable = true;
+			break;
+		}
+		enable = false;
+		for (Buffer * buf : doc_buffer->allRelatives()) {
+			GuiWorkArea * wa = workArea(*buf);
+			if (!wa)
+				continue;
+			if (wa->bufferView().getStatus(cmdToPass, flag)) {
+				enable = flag.enabled();
+				break;
+			}
 		}
 		break;
 	}


More information about the lyx-cvs mailing list