[LyX/master] Fix inset context menu offset with keyboard (#12811)

2023-07-03 Thread Juergen Spitzmueller
commit d5a96997942a4d2040db848be6b22eae78675057
Author: Juergen Spitzmueller 
Date:   Mon Jul 3 16:28:38 2023 +0200

Fix inset context menu offset with keyboard (#12811)
---
 src/frontends/qt/GuiWorkArea.cpp |4 
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/frontends/qt/GuiWorkArea.cpp b/src/frontends/qt/GuiWorkArea.cpp
index 87181f9..7433c28 100644
--- a/src/frontends/qt/GuiWorkArea.cpp
+++ b/src/frontends/qt/GuiWorkArea.cpp
@@ -652,6 +652,10 @@ void GuiWorkArea::contextMenuEvent(QContextMenuEvent * e)
++pos.rx();
}
}
+   if (e->reason() == QContextMenuEvent::Keyboard)
+   // Subtract the top margin
+   pos.setY(pos.y() - d->buffer_view_->topMargin());
+
name = d->buffer_view_->contextMenu(pos.x(), pos.y());
}
 
-- 
lyx-cvs mailing list
lyx-cvs@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-cvs


[LyX/master] Add bug reference.

2023-07-03 Thread Pavel Sanda
commit 9d8bef017bbe4946ba0423d5b57a6bbeb21813d4
Author: Pavel Sanda 
Date:   Mon Jul 3 23:54:34 2023 +0200

Add bug reference.
---
 src/frontends/qt/GuiWorkArea.cpp |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/frontends/qt/GuiWorkArea.cpp b/src/frontends/qt/GuiWorkArea.cpp
index 7433c28..3cd5f47 100644
--- a/src/frontends/qt/GuiWorkArea.cpp
+++ b/src/frontends/qt/GuiWorkArea.cpp
@@ -653,7 +653,7 @@ void GuiWorkArea::contextMenuEvent(QContextMenuEvent * e)
}
}
if (e->reason() == QContextMenuEvent::Keyboard)
-   // Subtract the top margin
+   // Subtract the top margin, see #12811
pos.setY(pos.y() - d->buffer_view_->topMargin());
 
name = d->buffer_view_->contextMenu(pos.x(), pos.y());
-- 
lyx-cvs mailing list
lyx-cvs@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-cvs


[LyX/master] lyx2lyx: skip mathed in convert_hebrew_parentheses (#12824)

2023-07-03 Thread Juergen Spitzmueller
commit 86069c9e9af343d8b59c63b5e8b21f06103dce4e
Author: Juergen Spitzmueller 
Date:   Tue Jul 4 07:37:06 2023 +0200

lyx2lyx: skip mathed in convert_hebrew_parentheses (#12824)

Those have not been swapped in Hebrew.
---
 lib/lyx2lyx/lyx_2_4.py |9 -
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/lib/lyx2lyx/lyx_2_4.py b/lib/lyx2lyx/lyx_2_4.py
index a295e0a..8c0b9c3 100644
--- a/lib/lyx2lyx/lyx_2_4.py
+++ b/lib/lyx2lyx/lyx_2_4.py
@@ -1529,7 +1529,9 @@ def convert_hebrew_parentheses(document):
 """
 # print("convert hebrew parentheses")
 current_languages = [document.language]
-for i, line in enumerate(document.body):
+i = 0
+while i < len(document.body):
+line = document.body[i]
 if line.startswith('\\lang '):
 current_languages[-1] = line.lstrip('\\lang ')
 elif line.startswith('\\begin_layout'):
@@ -1537,8 +1539,13 @@ def convert_hebrew_parentheses(document):
 # print (line, current_languages[-1])
 elif line.startswith('\\end_layout'):
 current_languages.pop()
+elif line.startswith('\\begin_inset Formula'):
+# In math, parentheses must not be changed
+i = find_end_of_inset(document.body, i)
+continue
 elif current_languages[-1] == 'hebrew' and not line.startswith('\\'):
 document.body[i] = 
line.replace('(','\x00').replace(')','(').replace('\x00',')')
+i += 1
 
 
 def revert_hebrew_parentheses(document):
-- 
lyx-cvs mailing list
lyx-cvs@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-cvs