[LyX/master] Cmake tests: Add test for possible wrong used constants in our ui-files

2024-11-07 Thread Kornel Benko
commit 695b2f485cf0372bef96d7cdfb53db89f747f23f
Author: Kornel Benko 
Date:   Thu Nov 7 14:16:03 2024 +0100

Cmake tests: Add test for possible wrong used constants in our ui-files
---
 development/autotests/CMakeLists.txt  |  6 +++
 development/autotests/checkQtConstants.pl | 64 +++
 2 files changed, 70 insertions(+)

diff --git a/development/autotests/CMakeLists.txt 
b/development/autotests/CMakeLists.txt
index 471922972f..7116d7a4ad 100644
--- a/development/autotests/CMakeLists.txt
+++ b/development/autotests/CMakeLists.txt
@@ -127,3 +127,9 @@ if (LYX_ENABLE_EXPORT_TESTS)
   message(STATUS "Number of ignored export tests now ${lyx_ignored_count}")
   set(LYX_ignored_count ${lyx_ignored_count} PARENT_SCOPE)
 endif()
+
+set(CHECK_QT_CONSTANTS_SCRIPT 
"${CMAKE_CURRENT_SOURCE_DIR}/checkQtConstants.pl")
+add_test(NAME "check_Qt_ui_Constants"
+  WORKING_DIRECTORY ${TOP_SRC_DIR}
+  COMMAND ${PERL_EXECUTABLE} ${CHECK_QT_CONSTANTS_SCRIPT}
+)
diff --git a/development/autotests/checkQtConstants.pl 
b/development/autotests/checkQtConstants.pl
new file mode 100644
index 00..95eca214c9
--- /dev/null
+++ b/development/autotests/checkQtConstants.pl
@@ -0,0 +1,64 @@
+#! /usr/bin/env perl
+# -*- mode: perl; -*-
+#
+use strict;
+use warnings;
+
+BEGIN {
+  use File::Spec;
+  my $p = File::Spec->rel2abs(__FILE__);
+  $p =~ s/[\/\\]?[^\/\\]+$//;
+  unshift(@INC, "$p");
+}
+
+my $no_founds = 0;
+sub checkConstants($);
+sub collectUiFiles($$);
+
+my @UIFiles = ();
+
+collectUiFiles('.', \@UIFiles);
+
+for my $ui (@UIFiles) {
+  checkConstants($ui);
+}
+exit($no_founds);
+
+###
+
+sub checkConstants($) {
+  my ($ui) = @_;
+  #print "Checking $ui\n";
+  if (open(my $FI, '<', $ui)) {
+my $lineno = 0;
+while (my $l = <$FI>) {
+  $lineno += 1;
+  if ($l =~ /\bQ[a-zA-Z]+\:\:[a-zA-Z]+\:\:/) {
+print "$ui:$lineno $l";
+$no_founds += 1;
+  }
+}
+close($FI);
+  }
+}
+
+# Recursive collect UI files
+sub collectUiFiles($$) {
+  my ($dir, $rFiles) = @_;
+  my @subdirs = ();
+  if (opendir(my $DI, $dir)) {
+while (my $f = readdir($DI)) {
+  if (-d "$dir/$f") {
+next if ($f =~ /^\.(\.)?$/);
+push(@subdirs, "$dir/$f");
+  }
+  elsif ($f =~ /\.ui$/) {
+push(@{$rFiles}, "$dir/$f");
+  }
+}
+closedir($DI);
+  }
+  for my $d (@subdirs) {
+collectUiFiles($d, $rFiles);
+  }
+}
-- 
lyx-cvs mailing list
lyx-cvs@lists.lyx.org
https://lists.lyx.org/mailman/listinfo/lyx-cvs


[LyX/2.4.x] Fix spacing problems in previews with math macros (#13120)

2024-11-07 Thread Juergen Spitzmueller
commit a8d90cde6f4521153c68214a791951df0cefee65
Author: Juergen Spitzmueller 
Date:   Wed Nov 6 18:26:14 2024 +0100

Fix spacing problems in previews with math macros (#13120)

This occurs on the legacy path when no cropping tools are available.

(cherry picked from commit 9ffacb341dd7f63e31782e8c8f81be2c2074dd08)
---
 src/mathed/InsetMathHull.cpp | 7 +--
 status.24x   | 3 +++
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/mathed/InsetMathHull.cpp b/src/mathed/InsetMathHull.cpp
index 1f6c456621..0864a21d4b 100644
--- a/src/mathed/InsetMathHull.cpp
+++ b/src/mathed/InsetMathHull.cpp
@@ -817,8 +817,11 @@ void InsetMathHull::usedMacros(MathData const & md, 
DocIterator const & pos,
if (data) {
odocstringstream macro_def;
data->write(macro_def, true);
-   macro_def << endl;
-   defs.insert(macro_def.str());
+   // Empty lines will generate full rows
+   // with legacy preview and tightpage (#13120).
+   // So remove all preceding and trailing line 
breaks
+   // and re-add one at the end of the snippet
+   defs.insert(trim(macro_def.str(), "\n") + "\n");
asArray(data->definition(), ar);
}
usedMacros(ar, pos, macros, defs);
diff --git a/status.24x b/status.24x
index 853ef361c2..2008eb8dec 100644
--- a/status.24x
+++ b/status.24x
@@ -72,6 +72,9 @@ What's new
 
 - Fix loading order of fancyhdr (bug 13118).
 
+- Fix spacing problems in previews with math macros under specific
+  circumstances (bug 13120).
+
 
 * USER INTERFACE
 
-- 
lyx-cvs mailing list
lyx-cvs@lists.lyx.org
https://lists.lyx.org/mailman/listinfo/lyx-cvs


[LyX/master] Update sk.po

2024-11-07 Thread Kornel Benko
commit f784f3fe6f8295bb28d0a200f54950902c0503ec
Author: Kornel Benko 
Date:   Thu Nov 7 14:18:12 2024 +0100

Update sk.po
---
 po/sk.po | 26 +-
 1 file changed, 21 insertions(+), 5 deletions(-)

diff --git a/po/sk.po b/po/sk.po
index 2fac2a983b..303eb3bdd1 100644
--- a/po/sk.po
+++ b/po/sk.po
@@ -8,8 +8,8 @@ msgid ""
 msgstr ""
 "Project-Id-Version: LyX-2.5\n"
 "Report-Msgid-Bugs-To: lyx-de...@lists.lyx.org\n"
-"POT-Creation-Date: 2024-10-24 11:49+0200\n"
-"PO-Revision-Date: 2024-10-24 10:00+\n"
+"POT-Creation-Date: 2024-11-01 18:23+0100\n"
+"PO-Revision-Date: 2024-11-01 17:45+\n"
 "Last-Translator: Kornel Benko \n"
 "Language-Team: Slovak \n"
 "Language: sk\n"
@@ -3449,9 +3449,9 @@ msgstr "Píš CSS do súboru"
 msgid "Format to use for math output."
 msgstr "Formát na použitie pre výstup matematiky."
 
-#: src/frontends/qt/ui/OutputUi.ui:204
-msgid "MathML"
-msgstr "MathML"
+#: src/frontends/qt/ui/OutputUi.ui:293
+msgid "MathML Core (default)"
+msgstr "Základné MathML (štandard)"
 
 #: src/frontends/qt/ui/OutputUi.ui:209 src/frontends/qt/ui/OutputUi.ui:401
 msgid "HTML"
@@ -3465,6 +3465,10 @@ msgstr "HTML|H"
 msgid "Images"
 msgstr "Obrázky"
 
+#: src/frontends/qt/ui/OutputUi.ui:313
+msgid "MathML 3"
+msgstr "MathML 3"
+
 #: src/frontends/qt/ui/OutputUi.ui:219 lib/layouts/aapaper.layout:63
 #: lib/layouts/egs.layout:720 lib/languages:147
 #: src/frontends/qt/GuiDocument.cpp:1661 src/frontends/qt/GuiErrorList.cpp:50
@@ -3516,6 +3520,18 @@ msgstr "Výstup pre tabu&ľku:"
 msgid "CALS"
 msgstr "CALS"
 
+#: src/frontends/qt/ui/OutputUi.ui:457
+msgid "MathML &version:"
+msgstr "Ver&zia MathML:"
+
+#: src/frontends/qt/ui/OutputUi.ui:484
+msgid "MathML 3 (default)"
+msgstr "MathML 3 (štandard)"
+
+#: src/frontends/qt/ui/OutputUi.ui:489
+msgid "MathML Core"
+msgstr "Základné MathML"
+
 #: src/frontends/qt/ui/OutputUi.ui:419
 msgid "&MathML namespace prefix:"
 msgstr "M&athML prefix pre oblasť mien:"
-- 
lyx-cvs mailing list
lyx-cvs@lists.lyx.org
https://lists.lyx.org/mailman/listinfo/lyx-cvs


[LyX/master] One more Qt enum fix

2024-11-07 Thread Juergen Spitzmueller
commit d75ab6d6f4c0c9b36f552b0a071dd93a6cc9
Author: Juergen Spitzmueller 
Date:   Thu Nov 7 12:38:19 2024 +0100

One more Qt enum fix
---
 src/frontends/qt/ui/AboutUi.ui | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/frontends/qt/ui/AboutUi.ui b/src/frontends/qt/ui/AboutUi.ui
index e4f1bb7be9..7eacce9f11 100644
--- a/src/frontends/qt/ui/AboutUi.ui
+++ b/src/frontends/qt/ui/AboutUi.ui
@@ -156,7 +156,7 @@
System directory goes here.
   
   
-   Qt::TextFormat::PlainText
+   Qt::PlainText
   
   
false
@@ -184,7 +184,7 @@
User directory goes here.
   
   
-   Qt::TextFormat::PlainText
+   Qt::PlainText
   
   
false
@@ -231,7 +231,7 @@
Temp directory goes here.
   
   
-   Qt::TextFormat::PlainText
+   Qt::PlainText
   
   
false
-- 
lyx-cvs mailing list
lyx-cvs@lists.lyx.org
https://lists.lyx.org/mailman/listinfo/lyx-cvs


[LyX/2.4.x] One more Qt enum fix

2024-11-07 Thread Juergen Spitzmueller
commit b86361ab5a41837df8b6714db4e84a301811037b
Author: Juergen Spitzmueller 
Date:   Thu Nov 7 12:39:12 2024 +0100

One more Qt enum fix
---
 src/frontends/qt/ui/AboutUi.ui | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/frontends/qt/ui/AboutUi.ui b/src/frontends/qt/ui/AboutUi.ui
index e4f1bb7be9..7eacce9f11 100644
--- a/src/frontends/qt/ui/AboutUi.ui
+++ b/src/frontends/qt/ui/AboutUi.ui
@@ -156,7 +156,7 @@
System directory goes here.
   
   
-   Qt::TextFormat::PlainText
+   Qt::PlainText
   
   
false
@@ -184,7 +184,7 @@
User directory goes here.
   
   
-   Qt::TextFormat::PlainText
+   Qt::PlainText
   
   
false
@@ -231,7 +231,7 @@
Temp directory goes here.
   
   
-   Qt::TextFormat::PlainText
+   Qt::PlainText
   
   
false
-- 
lyx-cvs mailing list
lyx-cvs@lists.lyx.org
https://lists.lyx.org/mailman/listinfo/lyx-cvs