[LyX/master] Fix status of tabular function

Juergen Spitzmueller spitz at lyx.org
Sat Jan 23 07:09:38 UTC 2021


commit 7bd072e750774894bb26fa831b03ff15cf98ad9a
Author: Juergen Spitzmueller <spitz at lyx.org>
Date:   Sat Jan 23 08:10:55 2021 +0100

    Fix status of tabular function
---
 src/insets/InsetTabular.cpp |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp
index 961a5c8..bbc3575 100644
--- a/src/insets/InsetTabular.cpp
+++ b/src/insets/InsetTabular.cpp
@@ -5722,8 +5722,9 @@ bool InsetTabular::getFeatureStatus(Cursor & cur, string const & s,
 			flag = false;
 			// fall through
 		case Tabular::VALIGN_TOP:
-			status.setEnabled(!tabular.getPWidth(cur.idx()).zero()
-				&& !tabular.isMultiRow(cur.idx()));
+			status.setEnabled((!tabular.getPWidth(cur.idx()).zero()
+					   || tabular.getUsebox(cur.idx()) == Tabular::BOX_VARWIDTH)
+					  && !tabular.isMultiRow(cur.idx()));
 			status.setOnOff(
 				tabular.getVAlignment(cur.idx(), flag) == Tabular::LYX_VALIGN_TOP);
 			break;
@@ -5732,7 +5733,9 @@ bool InsetTabular::getFeatureStatus(Cursor & cur, string const & s,
 			flag = false;
 			// fall through
 		case Tabular::VALIGN_BOTTOM:
-			status.setEnabled(!tabular.isMultiRow(cur.idx()));
+			status.setEnabled((!tabular.getPWidth(cur.idx()).zero()
+					   || tabular.getUsebox(cur.idx()) == Tabular::BOX_VARWIDTH)
+					  && !tabular.isMultiRow(cur.idx()));
 			status.setOnOff(
 				tabular.getVAlignment(cur.idx(), flag) == Tabular::LYX_VALIGN_BOTTOM);
 			break;
@@ -5741,7 +5744,9 @@ bool InsetTabular::getFeatureStatus(Cursor & cur, string const & s,
 			flag = false;
 			// fall through
 		case Tabular::VALIGN_MIDDLE:
-			status.setEnabled(!tabular.isMultiRow(cur.idx()));
+			status.setEnabled((!tabular.getPWidth(cur.idx()).zero()
+					   || tabular.getUsebox(cur.idx()) == Tabular::BOX_VARWIDTH)
+					  && !tabular.isMultiRow(cur.idx()));
 			status.setOnOff(
 				tabular.getVAlignment(cur.idx(), flag) == Tabular::LYX_VALIGN_MIDDLE);
 			break;


More information about the lyx-cvs mailing list