[LyX/2.4.1-devel] * status.24x
commit 6dc68a632e48f1d9df9ca2ae2a2cfd35e8f13d41 Author: Pavel Sanda Date: Fri Apr 5 23:15:53 2024 +0200 * status.24x --- status.24x | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/status.24x b/status.24x index ef6f8fad0b..3e6573947a 100644 --- a/status.24x +++ b/status.24x @@ -32,7 +32,8 @@ What's new - In context menus, more items are now shown on top level. -- Allow relative statistics values in statusbar. +- Allow relative statistics values in statusbar, improve update times for + some UI and buffer operations. * DOCUMENTATION AND LOCALIZATION -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX/2.4.1-devel] Improve stats update times for buffer switches and toolbar toggles.
commit 7e2c1dca366156d41b3faacaaa96882fb3391f84 Author: Pavel Sanda Date: Fri Apr 5 22:59:07 2024 +0200 Improve stats update times for buffer switches and toolbar toggles. --- src/BufferView.cpp | 12 src/BufferView.h | 2 ++ src/frontends/qt/GuiView.cpp | 10 ++ 3 files changed, 24 insertions(+) diff --git a/src/BufferView.cpp b/src/BufferView.cpp index 7386c79a75..d5fa198678 100644 --- a/src/BufferView.cpp +++ b/src/BufferView.cpp @@ -303,6 +303,7 @@ struct BufferView::Private int stats_ref_value_w_ = 0; int stats_ref_value_c_ = 0; int stats_ref_value_nb_ = 0; + bool stats_update_trigger_ = false; }; @@ -2026,6 +2027,7 @@ void BufferView::dispatch(FuncRequest const & cmd, DispatchResult & dr) break; case LFUN_STATISTICS_REFERENCE_CLAMP: { + d->stats_update_trigger_ = true; if (cmd.argument() == "reset") { d->stats_ref_value_w_ = d->stats_ref_value_c_ = d->stats_ref_value_nb_ = 0; break; @@ -3921,4 +3923,14 @@ bool BufferView::clickableInset() const return d->clickable_inset_; } + +bool BufferView::stats_update_trigger() +{ + if (d->stats_update_trigger_) { + d->stats_update_trigger_ = false; + return true; + } + return false; +} + } // namespace lyx diff --git a/src/BufferView.h b/src/BufferView.h index eed48209bb..631d2a58bf 100644 --- a/src/BufferView.h +++ b/src/BufferView.h @@ -403,6 +403,8 @@ public: int stats_ref_value_w() const; int stats_ref_value_c() const; int stats_ref_value_nb() const; + //signals need for update in gui + bool stats_update_trigger(); private: /// noncopyable diff --git a/src/frontends/qt/GuiView.cpp b/src/frontends/qt/GuiView.cpp index ac0606e985..6f15d73626 100644 --- a/src/frontends/qt/GuiView.cpp +++ b/src/frontends/qt/GuiView.cpp @@ -555,6 +555,8 @@ public: bool already_in_selection_ = false; /// Maximum size of "short" selection for which we can update with faster timer_rate int const max_sel_chars = 5000; + /// equivalent time_to_update = 0; but better to see it the code + bool stats_update_trigger_ = false; }; @@ -1454,6 +1456,12 @@ void GuiView::showStats() return; } + // UI toggle, buffer change, etc + if (bv->stats_update_trigger() || d.stats_update_trigger_) { + d.stats_update_trigger_ = false; + d.time_to_update = 0; + } + Cursor const & cur = bv->cursor(); // we start new selection and need faster update @@ -1587,6 +1595,7 @@ void GuiView::onBufferViewChanged() && zoom_slider_->value() < zoom_slider_->maximum()); zoom_out_->setEnabled(currentBufferView() && zoom_slider_->value() > zoom_slider_->minimum()); + d.stats_update_trigger_ = true; } @@ -5162,6 +5171,7 @@ bool GuiView::lfunUiToggle(string const & ui_component) } else return false; stat_counts_->setVisible(statsEnabled()); + d.stats_update_trigger_ = true; return true; } -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX/master] Improve stats update times for buffer switches and toolbar toggles.
commit 77273303a5e22df45239d705e830baa5c0c3fcf1 Author: Pavel Sanda Date: Fri Apr 5 22:59:07 2024 +0200 Improve stats update times for buffer switches and toolbar toggles. --- src/BufferView.cpp | 12 src/BufferView.h | 2 ++ src/frontends/qt/GuiView.cpp | 10 ++ 3 files changed, 24 insertions(+) diff --git a/src/BufferView.cpp b/src/BufferView.cpp index 92f231c227..b5bf6d6ea1 100644 --- a/src/BufferView.cpp +++ b/src/BufferView.cpp @@ -303,6 +303,7 @@ struct BufferView::Private int stats_ref_value_w_ = 0; int stats_ref_value_c_ = 0; int stats_ref_value_nb_ = 0; + bool stats_update_trigger_ = false; }; @@ -2032,6 +2033,7 @@ void BufferView::dispatch(FuncRequest const & cmd, DispatchResult & dr) break; case LFUN_STATISTICS_REFERENCE_CLAMP: { + d->stats_update_trigger_ = true; if (cmd.argument() == "reset") { d->stats_ref_value_w_ = d->stats_ref_value_c_ = d->stats_ref_value_nb_ = 0; break; @@ -3936,4 +3938,14 @@ bool BufferView::clickableInset() const return d->clickable_inset_; } + +bool BufferView::stats_update_trigger() +{ + if (d->stats_update_trigger_) { + d->stats_update_trigger_ = false; + return true; + } + return false; +} + } // namespace lyx diff --git a/src/BufferView.h b/src/BufferView.h index 6821efeb20..bfd523aa57 100644 --- a/src/BufferView.h +++ b/src/BufferView.h @@ -406,6 +406,8 @@ public: int stats_ref_value_w() const; int stats_ref_value_c() const; int stats_ref_value_nb() const; + //signals need for update in gui + bool stats_update_trigger(); private: /// noncopyable diff --git a/src/frontends/qt/GuiView.cpp b/src/frontends/qt/GuiView.cpp index ac0606e985..6f15d73626 100644 --- a/src/frontends/qt/GuiView.cpp +++ b/src/frontends/qt/GuiView.cpp @@ -555,6 +555,8 @@ public: bool already_in_selection_ = false; /// Maximum size of "short" selection for which we can update with faster timer_rate int const max_sel_chars = 5000; + /// equivalent time_to_update = 0; but better to see it the code + bool stats_update_trigger_ = false; }; @@ -1454,6 +1456,12 @@ void GuiView::showStats() return; } + // UI toggle, buffer change, etc + if (bv->stats_update_trigger() || d.stats_update_trigger_) { + d.stats_update_trigger_ = false; + d.time_to_update = 0; + } + Cursor const & cur = bv->cursor(); // we start new selection and need faster update @@ -1587,6 +1595,7 @@ void GuiView::onBufferViewChanged() && zoom_slider_->value() < zoom_slider_->maximum()); zoom_out_->setEnabled(currentBufferView() && zoom_slider_->value() > zoom_slider_->minimum()); + d.stats_update_trigger_ = true; } @@ -5162,6 +5171,7 @@ bool GuiView::lfunUiToggle(string const & ui_component) } else return false; stat_counts_->setVisible(statsEnabled()); + d.stats_update_trigger_ = true; return true; } -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX/2.4.x] * quote-insert lfun description
commit 167534f6cffde63a60cffee58d5d932706c8c2ed Author: Pavel Sanda Date: Fri Apr 5 19:47:20 2024 +0200 * quote-insert lfun description --- src/LyXAction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/LyXAction.cpp b/src/LyXAction.cpp index 19f12038a8..e7abbc51c1 100644 --- a/src/LyXAction.cpp +++ b/src/LyXAction.cpp @@ -3466,7 +3466,7 @@ void LyXAction::init() * \var lyx::FuncCode lyx::LFUN_QUOTE_INSERT * \li Action: Inserts quotes according to the type and quote-language preference. * \li Notion: Currently 15 different quote styles are distinguished (see params). - * \li Syntax: quote-insert [] []
[LyX/2.4.x] * LFUNs.lyx - regenerate
commit cc4256e3bc8ad4c4b968324f54aee40c53a32640 Author: Pavel Sanda Date: Fri Apr 5 20:01:19 2024 +0200 * LFUNs.lyx - regenerate lib/doc/LFUNs.lyx | 2446 +++-- 1 file changed, 1792 insertions(+), 654 deletions(-) -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX/master] * quote-insert lfun description
commit 6f8b944d39e3bdf16d666185733d2cff9a9e25e1 Author: Pavel Sanda Date: Fri Apr 5 19:47:20 2024 +0200 * quote-insert lfun description --- src/LyXAction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/LyXAction.cpp b/src/LyXAction.cpp index f4030ec40d..3c524549b0 100644 --- a/src/LyXAction.cpp +++ b/src/LyXAction.cpp @@ -3466,7 +3466,7 @@ void LyXAction::init() * \var lyx::FuncCode lyx::LFUN_QUOTE_INSERT * \li Action: Inserts quotes according to the type and quote-language preference. * \li Notion: Currently 15 different quote styles are distinguished (see params). - * \li Syntax: quote-insert [] []
[LyX/2.4.1-devel] * status.24x
commit a11a4db8b270f4d271b5c639e8cf9085e3555f83 Author: Pavel Sanda Date: Fri Apr 5 19:45:09 2024 +0200 * status.24x --- status.24x | 2 ++ 1 file changed, 2 insertions(+) diff --git a/status.24x b/status.24x index 90d1af4b9c..ef6f8fad0b 100644 --- a/status.24x +++ b/status.24x @@ -32,6 +32,8 @@ What's new - In context menus, more items are now shown on top level. +- Allow relative statistics values in statusbar. + * DOCUMENTATION AND LOCALIZATION -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX/2.4.1-devel] Allow relative statistics values in statusbar.
commit ae07763abf25b897f6f17de57fadb210b87a81be Author: Pavel Sanda Date: Fri Apr 5 19:34:29 2024 +0200 Allow relative statistics values in statusbar. https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg221311.html --- lib/ui/stdcontext.inc| 2 ++ src/BufferView.cpp | 53 src/BufferView.h | 6 + src/FuncCode.h | 1 + src/LyXAction.cpp| 10 + src/frontends/qt/GuiView.cpp | 9 6 files changed, 77 insertions(+), 4 deletions(-) diff --git a/lib/ui/stdcontext.inc b/lib/ui/stdcontext.inc index dc49f44c77..679cc9e603 100644 --- a/lib/ui/stdcontext.inc +++ b/lib/ui/stdcontext.inc @@ -774,6 +774,8 @@ Menuset Item "Word Count|W" "ui-toggle statistics-w" Item "Character Count|C" "ui-toggle statistics-cb" Item "Character Count (No Blanks)|h" "ui-toggle statistics-c" + Item "Start Statistics Relative to Current Count|R" "statistics-reference-clamp" + OptItem "Reset to Absolute Statistics Count|A" "statistics-reference-clamp reset" End End diff --git a/src/BufferView.cpp b/src/BufferView.cpp index 39fffed68e..7386c79a75 100644 --- a/src/BufferView.cpp +++ b/src/BufferView.cpp @@ -298,6 +298,12 @@ struct BufferView::Private frontend::CaretGeometry caret_geometry_; /// bool mouse_selecting_ = false; + /// Reference value for statistics (essentially subtract this from the actual value to see relative counts) + /// (words/chars/chars no blanks) + int stats_ref_value_w_ = 0; + int stats_ref_value_c_ = 0; + int stats_ref_value_nb_ = 0; + }; @@ -1337,6 +1343,17 @@ bool BufferView::getStatus(FuncRequest const & cmd, FuncStatus & flag) flag.setEnabled(cur.selection()); break; + case LFUN_STATISTICS_REFERENCE_CLAMP: { + // disable optitem reset if clamp not used + if (cmd.argument() == "reset" && d->stats_ref_value_c_ == 0) { + flag.setEnabled(false); + break; + } + flag.setEnabled(true); + break; + + } + default: return false; } @@ -2008,6 +2025,24 @@ void BufferView::dispatch(FuncRequest const & cmd, DispatchResult & dr) } break; + case LFUN_STATISTICS_REFERENCE_CLAMP: { + if (cmd.argument() == "reset") { + d->stats_ref_value_w_ = d->stats_ref_value_c_ = d->stats_ref_value_nb_ = 0; + break; + } + + DocIterator from, to; + from = doc_iterator_begin(_); + to = doc_iterator_end(_); + buffer_.updateStatistics(from, to); + + d->stats_ref_value_w_ = buffer_.wordCount(); + d->stats_ref_value_c_ = buffer_.charCount(true); + d->stats_ref_value_nb_ = buffer_.charCount(false); + break; + } + + case LFUN_SCREEN_UP: case LFUN_SCREEN_DOWN: { Point p = getPos(cur); @@ -2615,6 +2650,24 @@ bool BufferView::mouseSelecting() const } +int BufferView::stats_ref_value_w() const +{ + return d->stats_ref_value_w_; +} + + +int BufferView::stats_ref_value_c() const +{ + return d->stats_ref_value_c_; +} + + +int BufferView::stats_ref_value_nb() const +{ + return d->stats_ref_value_nb_; +} + + void BufferView::mouseEventDispatch(FuncRequest const & cmd0) { //lyxerr << "[ cmd0 " << cmd0 << "]" << endl; diff --git a/src/BufferView.h b/src/BufferView.h index b46ade3df5..eed48209bb 100644 --- a/src/BufferView.h +++ b/src/BufferView.h @@ -398,6 +398,12 @@ public: /// Are we currently performing a selection with the mouse? bool mouseSelecting() const; + /// Reference value for statistics (essentially subtract this from the actual value to see relative counts) + /// (words/chars/chars no blanks) + int stats_ref_value_w() const; + int stats_ref_value_c() const; + int stats_ref_value_nb() const; + private: /// noncopyable BufferView(BufferView const &); diff --git a/src/FuncCode.h b/src/FuncCode.h index 19f41295b1..a5f638d6d7 100644 --- a/src/FuncCode.h +++ b/src/FuncCode.h @@ -508,6 +508,7 @@ enum FuncCode LFUN_TAB_GROUP_NEXT,// daniel 20220130 LFUN_TAB_GROUP_PREVIOUS,// daniel 20220130 LFUN_BIBTEX_DATABASE_LIST, // bpiwowar, 20221218 + LFUN_STATISTICS_REFERENCE_CLAMP,// sanda, 20240324 LFUN_LASTACTION // end of the table }; diff --git a/src/LyXAction.cpp b/src/LyXAction.cpp index 19f12038a8..c20d647132 100644 --- a/src/LyXAction.cpp +++ b/src/LyXAction.cpp @@ -3923,6 +3923,16 @@ void LyXAction::init() * \endvar */
[LyX/master] Allow relative statistics values in statusbar.
commit 7976cc2dac4ec69e35441b64f5e6b37f9a7f51b9 Author: Pavel Sanda Date: Fri Apr 5 19:34:29 2024 +0200 Allow relative statistics values in statusbar. https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg221311.html --- lib/ui/stdcontext.inc| 2 ++ src/BufferView.cpp | 53 src/BufferView.h | 6 + src/FuncCode.h | 1 + src/LyXAction.cpp| 10 + src/frontends/qt/GuiView.cpp | 9 6 files changed, 77 insertions(+), 4 deletions(-) diff --git a/lib/ui/stdcontext.inc b/lib/ui/stdcontext.inc index 32d76e603e..98d23bf177 100644 --- a/lib/ui/stdcontext.inc +++ b/lib/ui/stdcontext.inc @@ -774,6 +774,8 @@ Menuset Item "Word Count|W" "ui-toggle statistics-w" Item "Character Count|C" "ui-toggle statistics-cb" Item "Character Count (No Blanks)|h" "ui-toggle statistics-c" + Item "Start Statistics Relative to Current Count|R" "statistics-reference-clamp" + OptItem "Reset to Absolute Statistics Count|A" "statistics-reference-clamp reset" End End diff --git a/src/BufferView.cpp b/src/BufferView.cpp index c03f928c4d..92f231c227 100644 --- a/src/BufferView.cpp +++ b/src/BufferView.cpp @@ -298,6 +298,12 @@ struct BufferView::Private frontend::CaretGeometry caret_geometry_; /// bool mouse_selecting_ = false; + /// Reference value for statistics (essentially subtract this from the actual value to see relative counts) + /// (words/chars/chars no blanks) + int stats_ref_value_w_ = 0; + int stats_ref_value_c_ = 0; + int stats_ref_value_nb_ = 0; + }; @@ -1343,6 +1349,17 @@ bool BufferView::getStatus(FuncRequest const & cmd, FuncStatus & flag) flag.setEnabled(cur.selection()); break; + case LFUN_STATISTICS_REFERENCE_CLAMP: { + // disable optitem reset if clamp not used + if (cmd.argument() == "reset" && d->stats_ref_value_c_ == 0) { + flag.setEnabled(false); + break; + } + flag.setEnabled(true); + break; + + } + default: return false; } @@ -2014,6 +2031,24 @@ void BufferView::dispatch(FuncRequest const & cmd, DispatchResult & dr) } break; + case LFUN_STATISTICS_REFERENCE_CLAMP: { + if (cmd.argument() == "reset") { + d->stats_ref_value_w_ = d->stats_ref_value_c_ = d->stats_ref_value_nb_ = 0; + break; + } + + DocIterator from, to; + from = doc_iterator_begin(_); + to = doc_iterator_end(_); + buffer_.updateStatistics(from, to); + + d->stats_ref_value_w_ = buffer_.wordCount(); + d->stats_ref_value_c_ = buffer_.charCount(true); + d->stats_ref_value_nb_ = buffer_.charCount(false); + break; + } + + case LFUN_SCREEN_UP: case LFUN_SCREEN_DOWN: { Point p = getPos(cur); @@ -2623,6 +2658,24 @@ bool BufferView::mouseSelecting() const } +int BufferView::stats_ref_value_w() const +{ + return d->stats_ref_value_w_; +} + + +int BufferView::stats_ref_value_c() const +{ + return d->stats_ref_value_c_; +} + + +int BufferView::stats_ref_value_nb() const +{ + return d->stats_ref_value_nb_; +} + + void BufferView::mouseEventDispatch(FuncRequest const & cmd0) { //lyxerr << "[ cmd0 " << cmd0 << "]" << endl; diff --git a/src/BufferView.h b/src/BufferView.h index 327536a916..6821efeb20 100644 --- a/src/BufferView.h +++ b/src/BufferView.h @@ -401,6 +401,12 @@ public: /// Are we currently performing a selection with the mouse? bool mouseSelecting() const; + /// Reference value for statistics (essentially subtract this from the actual value to see relative counts) + /// (words/chars/chars no blanks) + int stats_ref_value_w() const; + int stats_ref_value_c() const; + int stats_ref_value_nb() const; + private: /// noncopyable BufferView(BufferView const &); diff --git a/src/FuncCode.h b/src/FuncCode.h index 19f41295b1..a5f638d6d7 100644 --- a/src/FuncCode.h +++ b/src/FuncCode.h @@ -508,6 +508,7 @@ enum FuncCode LFUN_TAB_GROUP_NEXT,// daniel 20220130 LFUN_TAB_GROUP_PREVIOUS,// daniel 20220130 LFUN_BIBTEX_DATABASE_LIST, // bpiwowar, 20221218 + LFUN_STATISTICS_REFERENCE_CLAMP,// sanda, 20240324 LFUN_LASTACTION // end of the table }; diff --git a/src/LyXAction.cpp b/src/LyXAction.cpp index 0b3d0a25ad..f4030ec40d 100644 --- a/src/LyXAction.cpp +++ b/src/LyXAction.cpp @@ -3925,6 +3925,16 @@ void LyXAction::init() * \endvar */
[LyX/2.4.x] Revert "Update sk.po"
commit 4690de2bca0cf9750fe3b145d785613becfea58e Author: jpc Date: Fri Apr 5 17:48:43 2024 +0200 Revert "Update sk.po" This reverts commit 148001f6fe5575cb3752f11a76360d0372d74ade. --- po/sk.po | 15 --- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/po/sk.po b/po/sk.po index b848decde2..e4fac1562a 100644 --- a/po/sk.po +++ b/po/sk.po @@ -8,8 +8,8 @@ msgid "" msgstr "" "Project-Id-Version: LyX-2.4\n" "Report-Msgid-Bugs-To: lyx-de...@lists.lyx.org\n" -"POT-Creation-Date: 2024-04-02 09:51+0200\n" -"PO-Revision-Date: 2024-04-02 09:29+\n" +"POT-Creation-Date: 2024-03-07 11:49+0100\n" +"PO-Revision-Date: 2024-03-07 10:52+\n" "Last-Translator: Kornel Benko \n" "Language-Team: Slovak \n" "Language: sk\n" @@ -21742,12 +21742,8 @@ msgid "End of Sentence|E" msgstr "Koniec vety|K" #: lib/ui/stdmenus.inc:418 -msgid "Plain Double Quotation Mark|Q" -msgstr "Prostá dvojitá úvodzovka|P" - -#: lib/ui/stdmenus.inc:419 -msgid "Plain Single Quotation Mark|S" -msgstr "Jednoduchá úvodzovka|J" +msgid "Plain Quotation Mark|Q" +msgstr "Prosté úvodzovky|P" #: lib/ui/stdmenus.inc:419 msgid "Inner Quotation Mark|n" @@ -44193,6 +44189,3 @@ msgstr "Neznámy používateľ" #~ msgid "No, Changes" #~ msgstr "Nie, zmeny ť" - -#~ msgid "Plain Quotation Mark|Q" -#~ msgstr "Prosté úvodzovky|P" -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX/master] Indicate that, by default, mouse LFUN do not require a metrics update
commit 9fd397ac1cb8c97d9b3058a669a045db0cceee1c Author: Jean-Marc Lasgouttes Date: Mon Nov 27 17:50:40 2023 +0100 Indicate that, by default, mouse LFUN do not require a metrics update This is done easily in LyXAction.cpp. Remember that, by default, each function is supposed to request a full metrics computation. Part of bug #12297. --- src/LyXAction.cpp | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/LyXAction.cpp b/src/LyXAction.cpp index ece248e61c..0b3d0a25ad 100644 --- a/src/LyXAction.cpp +++ b/src/LyXAction.cpp @@ -3121,7 +3121,7 @@ void LyXAction::init() * \li Origin: Andre, 9 Aug 2002 * \endvar */ - { LFUN_MOUSE_DOUBLE, "", ReadOnly, Hidden }, + { LFUN_MOUSE_DOUBLE, "", ReadOnly | NoUpdate, Hidden }, /*! * \var lyx::FuncCode lyx::LFUN_MOUSE_MOTION @@ -3131,7 +3131,7 @@ void LyXAction::init() * \li Origin: Andre, 9 Aug 2002 * \endvar */ - { LFUN_MOUSE_MOTION, "", ReadOnly | SingleParUpdate, Hidden }, + { LFUN_MOUSE_MOTION, "", ReadOnly | NoUpdate, Hidden }, /*! * \var lyx::FuncCode lyx::LFUN_MOUSE_PRESS @@ -3141,7 +3141,7 @@ void LyXAction::init() * \li Origin: Andre, 9 Aug 2002 * \endvar */ - { LFUN_MOUSE_PRESS, "", ReadOnly, Hidden }, + { LFUN_MOUSE_PRESS, "", ReadOnly | NoUpdate, Hidden }, /*! * \var lyx::FuncCode lyx::LFUN_MOUSE_RELEASE @@ -3151,7 +3151,7 @@ void LyXAction::init() * \li Origin: Andre, 9 Aug 2002 * \endvar */ - { LFUN_MOUSE_RELEASE, "", ReadOnly, Hidden }, + { LFUN_MOUSE_RELEASE, "", ReadOnly | NoUpdate, Hidden }, /*! @@ -3162,7 +3162,7 @@ void LyXAction::init() * \li Origin: Andre, 9 Aug 2002 * \endvar */ - { LFUN_MOUSE_TRIPLE, "", ReadOnly, Hidden }, + { LFUN_MOUSE_TRIPLE, "", ReadOnly | NoUpdate, Hidden }, /*! * \var lyx::FuncCode lyx::LFUN_NEWLINE_INSERT -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX/master] Avoid metrics computation on resize when width did not change
commit f7218cec188cad2dbf68de47ad4345fcddf1bdb8 Author: Jean-Marc Lasgouttes Date: Mon Nov 27 11:46:52 2023 +0100 Avoid metrics computation on resize when width did not change Entering a math inset triggers a work area reize because the math toobars appear automatically. However, by default these toolbars are at the bottom of the screen and their presence does not change the typesetting of paragraphs. Therefore it is useful to avoid a call to updateMetrics() in the case where the width of the work area did not change. Part of bug #12297. --- src/BufferView.cpp | 16 ++-- 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/BufferView.cpp b/src/BufferView.cpp index 34be860691..c03f928c4d 100644 --- a/src/BufferView.cpp +++ b/src/BufferView.cpp @@ -2484,14 +2484,16 @@ void BufferView::clearSelection() void BufferView::resize(int width, int height) { - // Update from work area - width_ = width; height_ = height; + // Update metrics only if width has changed + if (width != width_) { + width_ = width; - // Clear the paragraph height cache. - d->par_height_.clear(); - // Redo the metrics. - updateMetrics(); + // Clear the paragraph height cache. + d->par_height_.clear(); + // Redo the metrics. + updateMetrics(); + } } @@ -3131,6 +3133,8 @@ void BufferView::updateMetrics(bool force) if (!ready()) return; + //LYXERR0("updateMetrics " << _v_(force)); + Text & buftext = buffer_.text(); pit_type const lastpit = int(buftext.paragraphs().size()) - 1; -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX/master] Avoid full metrics computation when entering/leaving inset
commit 73678dcde977802d5ff3ae07f0226484041fff48 Author: Jean-Marc Lasgouttes Date: Mon Nov 27 15:57:09 2023 +0100 Avoid full metrics computation when entering/leaving inset Annotate function LFUN_FINISHED_xxx to indicate that they do not require a full metrics computation. Remove an "optimization" that meant that when the cursor changed inset, a full metrics computation was requested. Part of bug #12297 --- src/LyXAction.cpp | 8 src/Text.cpp | 33 + 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/src/LyXAction.cpp b/src/LyXAction.cpp index b6bb52152c..ece248e61c 100644 --- a/src/LyXAction.cpp +++ b/src/LyXAction.cpp @@ -1655,7 +1655,7 @@ void LyXAction::init() * \li Notion: See also #LFUN_FINISHED_FORWARD. * \endvar */ - { LFUN_FINISHED_BACKWARD, "", ReadOnly, Hidden }, + { LFUN_FINISHED_BACKWARD, "", ReadOnly | NoUpdate, Hidden }, /*! * \var lyx::FuncCode lyx::LFUN_FINISHED_FORWARD @@ -1668,7 +1668,7 @@ void LyXAction::init() back into the surrounding text. * \endvar */ - { LFUN_FINISHED_FORWARD, "", ReadOnly, Hidden }, + { LFUN_FINISHED_FORWARD, "", ReadOnly | NoUpdate, Hidden }, /*! * \var lyx::FuncCode lyx::LFUN_FINISHED_LEFT @@ -1676,7 +1676,7 @@ void LyXAction::init() * \li Notion: See also #LFUN_FINISHED_FORWARD. * \endvar */ - { LFUN_FINISHED_LEFT, "", ReadOnly, Hidden }, + { LFUN_FINISHED_LEFT, "", ReadOnly | NoUpdate, Hidden }, /*! @@ -1685,7 +1685,7 @@ void LyXAction::init() * \li Notion: See also #LFUN_FINISHED_FORWARD * \endvar */ - { LFUN_FINISHED_RIGHT, "", ReadOnly, Hidden }, + { LFUN_FINISHED_RIGHT, "", ReadOnly | NoUpdate, Hidden }, /*! * \var lyx::FuncCode lyx::LFUN_FLEX_INSERT diff --git a/src/Text.cpp b/src/Text.cpp index 2684309dec..4749f36d2c 100644 --- a/src/Text.cpp +++ b/src/Text.cpp @@ -6393,23 +6393,24 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd) cur.screenUpdateFlags(Update::SinglePar | Update::FitCursor); return; } - if (!needsUpdate - && () == () - && oldTopSlice.idx() == cur.idx() - && !oldSelection // oldSelection is a backup of cur.selection() at the beginning of the function. - && !cur.selection()) - // FIXME: it would be better if we could just do this - // - //if (cur.result().update() != Update::FitCursor) - // cur.noScreenUpdate(); - // - // But some LFUNs do not set Update::FitCursor when needed, so we - // do it for all. This is not very harmfull as FitCursor will provoke - // a full redraw only if needed but still, a proper review of all LFUN - // should be done and this needsUpdate boolean can then be removed. - cur.screenUpdateFlags(Update::FitCursor); - else + if (needsUpdate) cur.screenUpdateFlags(Update::Force | Update::FitCursor); + else { + // oldSelection is a backup of cur.selection() at the beginning of the function. + if (!oldSelection && !cur.selection()) + // FIXME: it would be better if we could just do this + // + //if (cur.result().update() != Update::FitCursor) + // cur.noScreenUpdate(); + // + // But some LFUNs do not set Update::FitCursor when needed, so we + // do it for all. This is not very harmfull as FitCursor will provoke + // a full redraw only if needed but still, a proper review of all LFUN + // should be done and this needsUpdate boolean can then be removed. + cur.screenUpdateFlags(Update::FitCursor); + else + cur.screenUpdateFlags(Update::ForceDraw | Update::FitCursor); + } } -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX/master] Avoid some full metrics computations related to math previews
commit 5e8578837fea0321998eac04222102986261666d Author: Jean-Marc Lasgouttes Date: Mon Nov 27 15:13:56 2023 +0100 Avoid some full metrics computations related to math previews When entering/leaving a math hull inset, a Update::Force flag was set, in case the metrics of the inset would change because of a switch between normal and preview representation. When entering the inset, this code is now used only when the inset was in preview mode. In both cases, Update::Force is replaced with Update::SinglePar. This requites in Text::dispatch to honor Update::SinglePar when it has been set by some lfun, even when singleparupdate is false. Part of bug #12297. --- src/Text.cpp | 2 +- src/mathed/InsetMathHull.cpp | 13 - 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/Text.cpp b/src/Text.cpp index d5a1069fa1..2684309dec 100644 --- a/src/Text.cpp +++ b/src/Text.cpp @@ -6386,7 +6386,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd) // FIXME: the following code should go in favor of fine grained // update flag treatment. - if (singleParUpdate) { + if (singleParUpdate || cur.result().screenUpdate() & Update::SinglePar) { // Inserting characters does not change par height in general. So, try // to update _only_ this paragraph. BufferView will detect if a full // metrics update is needed anyway. diff --git a/src/mathed/InsetMathHull.cpp b/src/mathed/InsetMathHull.cpp index 94d293870d..34c319ea5c 100644 --- a/src/mathed/InsetMathHull.cpp +++ b/src/mathed/InsetMathHull.cpp @@ -902,7 +902,7 @@ bool InsetMathHull::notifyCursorLeaves(Cursor const & old, Cursor & cur) { if (RenderPreview::previewMath()) { reloadPreview(old); - cur.screenUpdateFlags(Update::Force); + cur.screenUpdateFlags(Update::SinglePar); } return false; } @@ -2273,14 +2273,17 @@ void InsetMathHull::handleFont2(Cursor & cur, docstring const & arg) void InsetMathHull::edit(Cursor & cur, bool front, EntryDirection entry_from) { + bool const has_preview = previewState(()); cur.push(*this); bool enter_front = (entry_from == Inset::ENTRY_DIRECTION_LEFT || (entry_from == Inset::ENTRY_DIRECTION_IGNORE && front)); enter_front ? idxFirst(cur) : idxLast(cur); - // The inset formula dimension is not necessarily the same as the - // one of the instant preview image, so we have to indicate to the - // BufferView that a metrics update is needed. - cur.screenUpdateFlags(Update::Force); + if (has_preview) { + // The inset formula dimension is in general different from the + // one of the instant preview image, so we have to indicate to the + // BufferView that a metrics update is needed. + cur.screenUpdateFlags(Update::SinglePar); + } } -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX/master] Update PAINTING_ANALYSIS
commit a23522073c8bb2cd06ddc7cc564e9c78f868a86d Author: Jean-Marc Lasgouttes Date: Mon Nov 20 17:24:09 2023 +0100 Update PAINTING_ANALYSIS --- development/PAINTING_ANALYSIS | 62 +-- 1 file changed, 42 insertions(+), 20 deletions(-) diff --git a/development/PAINTING_ANALYSIS b/development/PAINTING_ANALYSIS index a506371965..438d7ca9c3 100644 --- a/development/PAINTING_ANALYSIS +++ b/development/PAINTING_ANALYSIS @@ -3,7 +3,7 @@ Understanding the painting process This file tries to describe the state of the metrics/painting mechanism, and identify the improvements that could be made. The first -section can be read alone, although the context for them is really +sections can be read alone, although the context for them is really given in the following ones. Please keep this file up to date as the code evolves!!! @@ -20,9 +20,10 @@ following section. Some actions are proposed. ** SinglePar update -This flag only has an effect in the current BufferView and at -top-level, but I think it is useful in other views too. Doing this -will require some work on the update pipeline, though. +This flag only has an effect in the current BufferView, but I think it +is useful in other views too. Doing this will require some work on the +update pipeline, though. + ** Buffer::change issues @@ -53,17 +54,16 @@ The global idea would be to extend FitCursor to cover also horizontal cursor. -* Clean-up of drawing code +* TODO Clean-up of drawing code ** Set Row::changed() in a finer way *** singleParUpdate When the height of the current paragraph changes, there is no need for -a full screen update. Only the rows after the current one need to have -their position recomputed. +a full screen update (at top level, at least). Only the rows after the +current one need to have their position recomputed. -This is also true when scrolling (how to do that?) *** redoParagraph @@ -71,13 +71,16 @@ It should be possible to check whether the new row is the same as the old one and keep its changed() status in this case. This would reduce a lot the amount of stuff to redraw. + ** Put labels and friends in the Row as elements It should not be necessary to access the Paragraph object to draw. Adding the static elements to Row is a lot of work, but worth it IMO. + ** When a paragraph ends with a newline, compute correctly the height of the extra row. + ** Merging bv::updateMetrics and tm::metrics While the full metrics computation tries hard to limit the number of @@ -89,6 +92,12 @@ insets. We should re-use the bv::updateMetrics logic: The difficulty for a tall table cell for example, is that it may be necessary to break the whole contents to know the width of the cell. +Also, the anchor is relative to the outer paragraph, which means that +for a very long inset it is necessary to rebreak until the contents +that needs to be shown (to compute the heights). + +All in all, this is difficult to get right. This is less important now +that SinglePar updates work in nested insets. * Description of current drawing mechanism @@ -99,10 +108,12 @@ There are three parts to drawing the work area: + the metrics phase computes the size of insets and breaks the paragraphs into rows. It stores the dimension of insets (both - normal and math) in bv::coordCache. + normal and math) in bv::coordCache and the vertical position of the + top-level paragraphs. + the nodraw drawing phase paints the screen (see below) with a null - painter. The only useful effect is to store the inset positions. + painter. The only useful effect is to store the positions of + visible insets. + an update() signal is sent. This in turn will trigger a paint event, and the actual screen painting will happen then. @@ -115,18 +126,18 @@ whether this is correct. Depending on the Update::flags passed to the method, it sets an update strategy in (NoScreenUpdate, SingleParUpdate, FullScreenUpdate, -DecorationUpdate). It triggers a recomputation of the metrics when either: +DecorationUpdate). It triggers a call to updateMetrics when either: + Update::Force has been specified + Update::FitCursor has been specified and there is a need to scroll the display. + Update::SinglePar has been specified and the current paragraph has - not changed height. + changed height. If a computation of metrics has taken place, Force is removed from the flags and ForceDraw is added instead. -It is OK to call processUpateFlags several times before an update. In +It is OK to call processUpdateFlags several times before an update. In this case, the effects are cumulative. processUpdateFlags executes the metrics-related actions, but defers the actual drawing to the next paint event. @@ -137,21 +148,32 @@ update flag is Update::None. ** Metrics computation (and nodraw drawing phase) -This is triggered by bv::updateMetrics, which calls
[LyX/master] Reduce metrics updates from 4 to 1 when loading file
commit 1d1f95d2ed0bf02e8a9cd9685ed4ba3365b9b493 Author: Jean-Marc Lasgouttes Date: Wed Nov 22 12:07:51 2023 +0100 Reduce metrics updates from 4 to 1 when loading file The number of metrics updates when loading file and showing it in a new work area is unreasonable. The first avoided call to updateMetrics() was an explicit resize in BufferView::init(). Instead, an assertion is suppressed by exiting early BufferView::processUpdateFlags() when BufferView::ready() returns false. This is a new method introduced to factor in some existing tests. Two other metrics computations are avoided by setting the enclosing View object busy() while creating the new tab. To make this work properly, GuiWorkArea::scheduleRedraw has to return early in this case. When saving an unnamed document or invoking "Save as...", call setBusy(false) earlier so that repainting occurs correctly. Fixes bug #12976. --- src/Buffer.cpp | 2 +- src/BufferView.cpp | 11 +++ src/BufferView.h | 2 ++ src/frontends/qt/GuiWorkArea.cpp | 8 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/Buffer.cpp b/src/Buffer.cpp index de7f4d217c..bbe4d80589 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -5562,6 +5562,7 @@ Buffer::ReadStatus Buffer::reload() Buffer const * oldparent = d->parent(); d->setParent(nullptr); ReadStatus const status = loadLyXFile(); + setBusy(false); if (status == ReadSuccess) { updateBuffer(); changed(true); @@ -5578,7 +5579,6 @@ Buffer::ReadStatus Buffer::reload() } else { message(bformat(_("Could not reload document %1$s."), disp_fn)); } - setBusy(false); removePreviews(); updatePreviews(); errors("Parse"); diff --git a/src/BufferView.cpp b/src/BufferView.cpp index f0e3704064..34be860691 100644 --- a/src/BufferView.cpp +++ b/src/BufferView.cpp @@ -532,7 +532,7 @@ void BufferView::processUpdateFlags(Update::flags flags) << flagsAsString(flags) << ") buffer: " << _); // Case when no explicit update is requested. - if (flags == Update::None) + if (flags == Update::None || !ready()) return; /* FIXME We would like to avoid doing this here, since it is very @@ -611,7 +611,7 @@ void BufferView::processUpdateFlags(Update::flags flags) void BufferView::updateScrollbarParameters() { - if (height_ == 0 && width_ == 0) + if (!ready()) return; // We prefer fixed size line scrolling. @@ -2625,6 +2625,9 @@ void BufferView::mouseEventDispatch(FuncRequest const & cmd0) { //lyxerr << "[ cmd0 " << cmd0 << "]" << endl; + if (!ready()) + return; + // This is only called for mouse related events including // LFUN_FILE_OPEN generated by drag-and-drop. FuncRequest cmd = cmd0; @@ -3125,7 +3128,7 @@ void BufferView::updateMetrics() void BufferView::updateMetrics(bool force) { - if (height_ == 0 || width_ == 0) + if (!ready()) return; Text & buftext = buffer_.text(); @@ -3586,7 +3589,7 @@ bool BufferView::busy() const void BufferView::draw(frontend::Painter & pain, bool paint_caret) { - if (height_ == 0 || width_ == 0) + if (!ready()) return; LYXERR(Debug::PAINTING, (pain.isNull() ? "\t\t--- START NODRAW ---" : "\t\t*** START DRAWING ***")); diff --git a/src/BufferView.h b/src/BufferView.h index cc92e215fb..327536a916 100644 --- a/src/BufferView.h +++ b/src/BufferView.h @@ -348,6 +348,8 @@ public: /// the shape of the caret frontend::CaretGeometry const & caretGeometry() const; + /// Returns true when metrics have been computed at least once + bool ready() const { return width_ > 0 && height_ > 0; } /// Returns true when the BufferView is not ready for drawing bool busy() const; /// diff --git a/src/frontends/qt/GuiWorkArea.cpp b/src/frontends/qt/GuiWorkArea.cpp index 7999dceda9..de8241c21f 100644 --- a/src/frontends/qt/GuiWorkArea.cpp +++ b/src/frontends/qt/GuiWorkArea.cpp @@ -199,9 +199,6 @@ void GuiWorkArea::init() }); d->resetScreen(); - // A mouse event will happen before the first paint event, - // so make sure that the buffer view has an up to date metrics. - d->buffer_view_->resize(viewport()->width(), viewport()->height()); setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); setAcceptDrops(true); @@ -345,7 +342,7 @@ void GuiWorkArea::toggleCaret() void GuiWorkArea::scheduleRedraw(bool update_metrics) { - if (!isVisible()) + if (!isVisible() || view().busy()) // No need to redraw in this case. return; @@
[LyX/master] Implement quick scroll
commit 08010c6a5e425b3f2d0d625536e3a571c90a0482 Author: Jean-Marc Lasgouttes Date: Mon Jul 24 23:23:40 2023 +0200 Implement quick scroll Replace flag parameter for updateMetrics() by a `force' boolean. When it is false, the method keeps the metrics of paragraphs that are still visible in WorkArea instead of computing everything afresh. All it has to do is update their positions. Add code to updateMetrics() to update the value of the anchor pit/ypos (similar to the one in draw()). Update processUpdateFlags() to use this when update flag is ForceDraw. Modify scrollDocView() to just change the anchor paragraph position when the scrolling operation would re-use some of the existing paragraphs. The time needed to update the metrics when scrolling with mouse in the branch-test.lyx document is now divided by 20! Part of bug #12297. --- src/BufferView.cpp | 102 ++-- src/BufferView.h| 14 ++-- src/TextMetrics.cpp | 6 src/TextMetrics.h | 2 ++ 4 files changed, 86 insertions(+), 38 deletions(-) diff --git a/src/BufferView.cpp b/src/BufferView.cpp index dd312739b5..ca3939aabf 100644 --- a/src/BufferView.cpp +++ b/src/BufferView.cpp @@ -545,10 +545,13 @@ void BufferView::processUpdateFlags(Update::flags flags) // First check whether the metrics and inset positions should be updated if (flags & Update::Force) { - // This will update the CoordCache items and replace Force - // with ForceDraw in flags. - updateMetrics(flags); - } + // This will compute all metrics and positions. + updateMetrics(true); + // metrics is done, full drawing is necessary now + flags = (flags & ~Update::Force) | Update::ForceDraw; + } else if (flags & Update::ForceDraw) + // This will compute only the needed metrics and update positions. + updateMetrics(false); // Detect whether we can only repaint a single paragraph (if we // are not already redrawing all). @@ -557,7 +560,7 @@ void BufferView::processUpdateFlags(Update::flags flags) if (!(flags & Update::ForceDraw) && (flags & Update::SinglePar) && !singleParUpdate()) - updateMetrics(flags); + updateMetrics(true); // Then make sure that the screen contains the cursor if needed if (flags & Update::FitCursor) { @@ -566,13 +569,13 @@ void BufferView::processUpdateFlags(Update::flags flags) // (which is just the cursor when there is no selection) scrollToCursor(d->cursor_.selectionBegin(), SCROLL_VISIBLE); // Metrics have to be recomputed (maybe again) - updateMetrics(); + updateMetrics(true); // Is the cursor visible? (only useful if cursor is at end of selection) if (needsFitCursor()) { // then try to make cursor visible instead scrollToCursor(d->cursor_, SCROLL_VISIBLE); // Metrics have to be recomputed (maybe again) - updateMetrics(flags); + updateMetrics(true); } } flags = flags & ~Update::FitCursor; @@ -754,10 +757,13 @@ void BufferView::scrollDocView(int const pixels, bool update) if (pixels == 0) return; - // If the offset is less than 2 screen height, prefer to scroll instead. - if (abs(pixels) <= 2 * height_) { + // If part of the existing paragraphs will remain visible, prefer to + // scroll + TextMetrics const & tm = textMetrics(_.text()); + if (tm.first().second->top() - pixels <= height_ +&& tm.last().second->bottom() - pixels >= 0) { d->anchor_ypos_ -= pixels; - processUpdateFlags(Update::Force); + processUpdateFlags(Update::ForceDraw); return; } @@ -3110,12 +3116,14 @@ bool BufferView::singleParUpdate() void BufferView::updateMetrics() { - updateMetrics(d->update_flags_); + updateMetrics(true); + // metrics is done, full drawing is necessary now + d->update_flags_ = (d->update_flags_ & ~Update::Force) | Update::ForceDraw; d->update_strategy_ = FullScreenUpdate; } -void BufferView::updateMetrics(Update::flags & update_flags) +void BufferView::updateMetrics(bool force) { if (height_ == 0 || width_ == 0) return; @@ -3123,14 +3131,16 @@ void BufferView::updateMetrics(Update::flags & update_flags) Text & buftext = buffer_.text(); pit_type const npit =
[LyX/master] Do not compute metrics at each preview when loading file
commit 244969330108a89f4be93d3b2eb9024bdb756204 Author: Jean-Marc Lasgouttes Date: Thu Dec 21 16:33:06 2023 +0100 Do not compute metrics at each preview when loading file With the branch-test.lyx file from #12297, loading takes forever when previews are activated. This is because each preview element causes a full screen metrics recomputation. This commit just skips these calls and only does one when all previews have been obtained. As a result, computing the previews takes 1 second instead of 25 seconds on branch-test.lyx. Part of bug #12297. --- src/graphics/PreviewLoader.cpp | 12 1 file changed, 12 insertions(+) diff --git a/src/graphics/PreviewLoader.cpp b/src/graphics/PreviewLoader.cpp index 4c37f7a8d0..004ced6d89 100644 --- a/src/graphics/PreviewLoader.cpp +++ b/src/graphics/PreviewLoader.cpp @@ -787,6 +787,16 @@ void PreviewLoader::Impl::finishedGenerating(pid_t pid, int retval) // Remove the item from the list of still-executing processes. in_progress_.erase(git); +#if 0 + /* FIXME : there is no need for all these calls, which recompute +* all metrics for each and every preview. The single call at the +* end of this method is sufficient. + +* It seems that this whole imageReady mechanism is actually not +* needed. If it is the case, the whole updateFrontend/updateInset +* bloat can go too. +*/ + // Tell the outside world list::const_reverse_iterator nit = newimages.rbegin(); @@ -795,6 +805,8 @@ void PreviewLoader::Impl::finishedGenerating(pid_t pid, int retval) for (; nit != nend; ++nit) { imageReady(*nit->get()); } +#endif + finished_generating_ = true; buffer_.scheduleRedrawWorkAreas(); } -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX/master] Remove some redundant calls to updatePosCache
commit d19ade9a611d3ecf6840c5eb43291cb268ad6f4f Author: Jean-Marc Lasgouttes Date: Mon Jul 24 15:35:16 2023 +0200 Remove some redundant calls to updatePosCache The setting of insets positions was done twice in updateMetrics. When one of the paragraph is a huge branch, this can be very expensive. This leads to a 17% improvement on updateMetrics time on a scrolling test. Part of bug #12297 --- src/BufferView.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/BufferView.cpp b/src/BufferView.cpp index fd61401dff..3612143019 100644 --- a/src/BufferView.cpp +++ b/src/BufferView.cpp @@ -3161,7 +3161,6 @@ void BufferView::updateMetrics(Update::flags & update_flags) } } anchor_pm.setPosition(d->anchor_ypos_); - tm.updatePosCache(d->anchor_pit_); LYXERR(Debug::PAINTING, "metrics: " << " anchor pit = " << d->anchor_pit_ @@ -3177,7 +3176,6 @@ void BufferView::updateMetrics(Update::flags & update_flags) y1 -= pm.descent(); // Save the paragraph position in the cache. pm.setPosition(y1); - tm.updatePosCache(pit1); y1 -= pm.ascent(); } @@ -3191,7 +3189,6 @@ void BufferView::updateMetrics(Update::flags & update_flags) y2 += pm.ascent(); // Save the paragraph position in the cache. pm.setPosition(y2); - tm.updatePosCache(pit2); y2 += pm.descent(); } -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX/master] Improve the code that limits scrolling at top/bottom
commit f15d2ebf3819913114ab93d1ff7e140cb26b03d5 Author: Jean-Marc Lasgouttes Date: Fri Nov 17 18:30:37 2023 +0100 Improve the code that limits scrolling at top/bottom The most visible part of this commit is the move of part of BufferView::updateMetrics to a new TextMetrics::updateMetrics. This new method makes sure that metrics are known for all visible paragraphs (starting from anchor), and that the positions of the paragraphs have been recorded. This method is called up to 3 times in BufferView::updateMetrics: * unconditionally, to update all visible metrics, * then, if the bottom of the document is visible and too high, after updating the anchor ypos, * and similarly if the top of the document is visible and too low. This fixes for example the case where one jumps to Section 5.3 at the end of Tutorial and 'scroll_below_document' is false. Some now redundant code is removed from BufferView::scrollToCursor. The anchor-setting code in BufferView::draw is not clearly useful, but left here just in case. It generates a debug warning, though. Part of bug #12297. --- src/BufferView.cpp | 99 ++--- src/TextMetrics.cpp | 50 +++ src/TextMetrics.h | 4 +++ 3 files changed, 88 insertions(+), 65 deletions(-) diff --git a/src/BufferView.cpp b/src/BufferView.cpp index ca3939aabf..f0e3704064 100644 --- a/src/BufferView.cpp +++ b/src/BufferView.cpp @@ -762,6 +762,7 @@ void BufferView::scrollDocView(int const pixels, bool update) TextMetrics const & tm = textMetrics(_.text()); if (tm.first().second->top() - pixels <= height_ && tm.last().second->bottom() - pixels >= 0) { + LYXERR(Debug::SCROLLING, "small skip"); d->anchor_ypos_ -= pixels; processUpdateFlags(Update::ForceDraw); return; @@ -784,6 +785,7 @@ void BufferView::scrollDocView(int const pixels, bool update) return; } + LYXERR(Debug::SCROLLING, "search paragraph"); // find paragraph at target position int par_pos = d->scrollbarParameters_.min; pit_type i = 0; @@ -1097,8 +1099,6 @@ bool BufferView::scrollToCursor(DocIterator const & dit, ScrollType how) d->anchor_ypos_ = - offset + row_dim.ascent(); if (how == SCROLL_CENTER) d->anchor_ypos_ += height_/2 - row_dim.height() / 2; - else if (!lyxrc.scroll_below_document && d->anchor_pit_ == max_pit) - d->anchor_ypos_ = height_ - offset - row_dim.descent(); else if (offset > height_) d->anchor_ypos_ = height_ - offset - defaultRowHeight(); else @@ -3129,7 +3129,7 @@ void BufferView::updateMetrics(bool force) return; Text & buftext = buffer_.text(); - pit_type const npit = int(buftext.paragraphs().size()); + pit_type const lastpit = int(buftext.paragraphs().size()) - 1; if (force) { // Clear out the position cache in case of full screen redraw, @@ -3148,62 +3148,35 @@ void BufferView::updateMetrics(bool force) if (d->inlineCompletionPos_.fixIfBroken()) d->inlineCompletionPos_ = DocIterator(); - if (d->anchor_pit_ >= npit) + if (d->anchor_pit_ > lastpit) // The anchor pit must have been deleted... - d->anchor_pit_ = npit - 1; + d->anchor_pit_ = lastpit; - if (!tm.contains(d->anchor_pit_)) - // Rebreak anchor paragraph. - tm.redoParagraph(d->anchor_pit_); - ParagraphMetrics & anchor_pm = tm.parMetrics(d->anchor_pit_); + // Update metrics around the anchor + tm.updateMetrics(d->anchor_pit_, d->anchor_ypos_, height_); - // make sure than first paragraph of document is not too low - if (d->anchor_pit_ == 0) { - int scrollRange = d->scrollbarParameters_.max - d->scrollbarParameters_.min; + // Check that the end of the document is not too high + int const min_visible = lyxrc.scroll_below_document ? minVisiblePart() : height_; + if (tm.last().first == lastpit && tm.last().second->bottom() < min_visible) { + d->anchor_ypos_ += min_visible - tm.last().second->bottom(); + LYXERR(Debug::SCROLLING, "Too high, adjusting anchor ypos to " << d->anchor_ypos_); + tm.updateMetrics(d->anchor_pit_, d->anchor_ypos_, height_); + } - // Complete buffer visible? Then it's easy. - if (scrollRange == 0) - d->anchor_ypos_ = anchor_pm.ascent(); - else { - // avoid empty space above the first row - d->anchor_ypos_ = min(d->anchor_ypos_, anchor_pm.ascent()); - } - } - anchor_pm.setPosition(d->anchor_ypos_); - -
[LyX/master] In the no-draw phase, do not cache the positions of not visible insets
commit 7f85024f80601b15634fb5e771bba51435ad429f Author: Jean-Marc Lasgouttes Date: Mon Jul 24 17:53:16 2023 +0200 In the no-draw phase, do not cache the positions of not visible insets This can make a big difference for a very large branch that contains lots of equations. This is complementary to the previous patch, since instead of reducing the number of calls to updatePosCache, we make it faster. In the same test of scrolling with mouse wheel through the branch-test.lyx document, one finds a 23% improvement for BufferView::updateMetrics(). Part of bug #12297. --- src/TextMetrics.cpp | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/TextMetrics.cpp b/src/TextMetrics.cpp index 6968279c23..06e00f4220 100644 --- a/src/TextMetrics.cpp +++ b/src/TextMetrics.cpp @@ -2000,6 +2000,7 @@ void TextMetrics::drawParagraph(PainterInfo & pi, pit_type const pit, int const if (pm.rows().empty()) return; size_t const nrows = pm.rows().size(); + int const wh = bv_->workHeight(); // Remember left and right margin for drawing math numbers Changer changeleft = changeVar(pi.leftx, x + leftMargin(pit)); Changer changeright = changeVar(pi.rightx, x + width() - rightMargin(pit)); @@ -2014,15 +2015,17 @@ void TextMetrics::drawParagraph(PainterInfo & pi, pit_type const pit, int const if (i) y += row.ascent(); - RowPainter rp(pi, *text_, row, row_x, y); - - rp.paintOnlyInsets(); + // It is not needed to draw on screen if we are not inside + bool const inside = (y + row.descent() >= 0 && y - row.ascent() < wh); + if (inside) { + RowPainter rp(pi, *text_, row, row_x, y); + rp.paintOnlyInsets(); + } y += row.descent(); } return; } - int const ww = bv_->workHeight(); Cursor const & cur = bv_->cursor(); DocIterator sel_beg = cur.selectionBegin(); DocIterator sel_end = cur.selectionEnd(); @@ -2065,7 +2068,7 @@ void TextMetrics::drawParagraph(PainterInfo & pi, pit_type const pit, int const // It is not needed to draw on screen if we are not inside. bool const inside = (y + row.descent() >= 0 - && y - row.ascent() < ww); + && y - row.ascent() < wh); if (!inside) { // Inset positions have already been set in nodraw stage. y += row.descent(); -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX/master] Introduce new helpers ParagraphMetrics::top/bottom
commit 0b6105b9245350e428c73deee88af2cd7c0d4732 Author: Jean-Marc Lasgouttes Date: Tue Jul 25 16:31:13 2023 +0200 Introduce new helpers ParagraphMetrics::top/bottom This avoids code with position/ascent/descent that is difficult to follow. No change in function intended. --- src/BufferView.cpp | 18 -- src/ParagraphMetrics.h | 6 +- src/TextMetrics.cpp | 20 ++-- src/frontends/qt/GuiWorkArea.cpp | 2 +- 4 files changed, 20 insertions(+), 26 deletions(-) diff --git a/src/BufferView.cpp b/src/BufferView.cpp index 3612143019..dd312739b5 100644 --- a/src/BufferView.cpp +++ b/src/BufferView.cpp @@ -641,8 +641,8 @@ void BufferView::updateScrollbarParameters() << d->par_height_[pit]); } - int top_pos = first.second->position() - first.second->ascent(); - int bottom_pos = last.second->position() + last.second->descent(); + int top_pos = first.second->top(); + int bottom_pos = last.second->bottom(); bool first_visible = first.first == 0 && top_pos >= 0; bool last_visible = last.first + 1 == int(parsize) && bottom_pos <= height_; if (first_visible && last_visible) { @@ -2726,7 +2726,7 @@ int BufferView::scrollDown(int pixels) int const ymax = height_ + pixels; while (true) { pair last = tm.last(); - int bottom_pos = last.second->position() + last.second->descent(); + int bottom_pos = last.second->bottom(); if (lyxrc.scroll_below_document) bottom_pos += height_ - minVisiblePart(); if (last.first + 1 == int(text->paragraphs().size())) { @@ -2751,7 +2751,7 @@ int BufferView::scrollUp(int pixels) int ymin = - pixels; while (true) { pair first = tm.first(); - int top_pos = first.second->position() - first.second->ascent(); + int top_pos = first.second->top(); if (first.first == 0) { if (top_pos >= 0) return 0; @@ -3102,10 +3102,8 @@ bool BufferView::singleParUpdate() tm.updatePosCache(pit); - LYXERR(Debug::PAINTING, "\ny1: " << pm.position() - pm.ascent() - << " y2: " << pm.position() + pm.descent() - << " pit: " << pit - << " singlepar: 1"); + LYXERR(Debug::PAINTING, "\ny1: " << pm.top() << " y2: " << pm.bottom() + << " pit: " << pit << " singlepar: 1"); return true; } @@ -3653,7 +3651,7 @@ void BufferView::draw(frontend::Painter & pain, bool paint_caret) // and possibly grey out below pair lastpm = tm.last(); - int const y2 = lastpm.second->position() + lastpm.second->descent(); + int const y2 = lastpm.second->bottom(); if (y2 < height_) { Color color = buffer().isInternal() @@ -3674,7 +3672,7 @@ void BufferView::draw(frontend::Painter & pain, bool paint_caret) pair lastpm = tm.last(); for (pit_type pit = firstpm.first; pit <= lastpm.first; ++pit) { ParagraphMetrics const & pm = tm.parMetrics(pit); - if (pm.position() + pm.descent() > 0) { + if (pm.bottom() > 0) { if (d->anchor_pit_ != pit || d->anchor_ypos_ != pm.position()) LYXERR(Debug::PAINTING, "Found new anchor pit = " << d->anchor_pit_ diff --git a/src/ParagraphMetrics.h b/src/ParagraphMetrics.h index 0d186f158b..805d056541 100644 --- a/src/ParagraphMetrics.h +++ b/src/ParagraphMetrics.h @@ -69,9 +69,13 @@ public: /// bool hfillExpansion(Row const & row, pos_type pos) const; - /// + /// The vertical position of the baseline of the first line of the paragraph int position() const { return position_; } void setPosition(int position); + /// The vertical position of the top of the paragraph + int top() const { return position_ - dim_.ascent(); } + /// The vertical position of the bottom of the paragraph + int bottom() const { return position_ + dim_.descent(); } /// int id() const { return id_; } diff --git a/src/TextMetrics.cpp b/src/TextMetrics.cpp index 06e00f4220..837ad5766f 100644 --- a/src/TextMetrics.cpp +++ b/src/TextMetrics.cpp @@ -191,8 +191,7 @@ void TextMetrics::newParMetricsDown() // do it and update its position. redoParagraph(pit); - par_metrics_[pit].setPosition(last.second.position() - + last.second.descent() + par_metrics_[pit].ascent()); + par_metrics_[pit].setPosition(last.second.bottom() + par_metrics_[pit].ascent()); updatePosCache(pit); } @@ -206,8 +205,7 @@ void TextMetrics::newParMetricsUp() pit_type const pit = first.first -
[LyX/master] Enable Update::SinglePar in nested insets too
commit 9a96726bcd06d565c3027011fea954656aa46668 Author: Jean-Marc Lasgouttes Date: Mon Jul 17 14:43:29 2023 +0200 Enable Update::SinglePar in nested insets too The idea of single par update is to try to re-break only the paragraph containing the cursor (if this paragraph contains insets etc., re-breaking will recursively descend). The existing single paragraph update mechanism was tailored to work only at top level. Indeed changing a paragraph nested into an inset may lead to larger changes. This commit tries a rather naive approach that seems to work well: we need a full redraw if either 1/ the height has changed or 2/ the width has changed and it was equal to the text metrics width; the goal is to catch the case of a one-row inset that grows with its contents, but optimize the case of typing in a short paragraph part of a larger inset. NOTE: if only the height has changed, then it should be possible to update all metrics at minimal cost. However, since this is risky, we do not try that right now. Part of bug #12297. --- src/BufferView.cpp | 42 +++--- 1 file changed, 27 insertions(+), 15 deletions(-) diff --git a/src/BufferView.cpp b/src/BufferView.cpp index 39fffed68e..fd61401dff 100644 --- a/src/BufferView.cpp +++ b/src/BufferView.cpp @@ -3063,24 +3063,36 @@ Cursor const & BufferView::cursor() const bool BufferView::singleParUpdate() { - Text & buftext = buffer_.text(); - pit_type const bottom_pit = d->cursor_.bottom().pit(); - TextMetrics & tm = textMetrics(); - Dimension const old_dim = tm.parMetrics(bottom_pit).dim(); + CursorSlice const & its = d->cursor_.innerTextSlice(); + pit_type const pit = its.pit(); + TextMetrics & tm = textMetrics(its.text()); + Dimension const old_dim = tm.parMetrics(pit).dim(); // make sure inline completion pointer is ok if (d->inlineCompletionPos_.fixIfBroken()) d->inlineCompletionPos_ = DocIterator(); - // In Single Paragraph mode, rebreak only - // the (main text, not inset!) paragraph containing the cursor. - // (if this paragraph contains insets etc., rebreaking will - // recursively descend) - tm.redoParagraph(bottom_pit); - ParagraphMetrics & pm = tm.parMetrics(bottom_pit); - if (pm.height() != old_dim.height()) { - // Paragraph height has changed so we cannot proceed to - // the singlePar optimisation. + /* Try to rebreak only the paragraph containing the cursor (if +* this paragraph contains insets etc., rebreaking will +* recursively descend). We need a full redraw if either +* 1/ the height has changed +* or +* 2/ the width has changed and it was equal to the textmetrics +*width; the goal is to catch the case of a one-row inset that +*grows with its contents, but optimize the case of typing at +*the end of a mmultiple-row paragraph. +* +* NOTE: if only the height has changed, then it should be +* possible to update all metrics at minimal cost. However, +* since this is risky, we do not try that right now. +*/ + tm.redoParagraph(pit); + ParagraphMetrics & pm = tm.parMetrics(pit); + if (pm.height() != old_dim.height() + || (pm.width() != old_dim.width() && old_dim.width() == tm.width())) { + // Paragraph height or width has changed so we cannot proceed + // to the singlePar optimisation. + LYXERR(Debug::PAINTING, "SinglePar optimization failed."); return false; } // Since position() points to the baseline of the first row, we @@ -3088,11 +3100,11 @@ bool BufferView::singleParUpdate() // the height does not change but the ascent does. pm.setPosition(pm.position() - old_dim.ascent() + pm.ascent()); - tm.updatePosCache(bottom_pit); + tm.updatePosCache(pit); LYXERR(Debug::PAINTING, "\ny1: " << pm.position() - pm.ascent() << " y2: " << pm.position() + pm.descent() - << " pit: " << bottom_pit + << " pit: " << pit << " singlepar: 1"); return true; } -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX features/biginset] Avoid full metrics computation when entering/leaving inset
commit 73678dcde977802d5ff3ae07f0226484041fff48 Author: Jean-Marc Lasgouttes Date: Mon Nov 27 15:57:09 2023 +0100 Avoid full metrics computation when entering/leaving inset Annotate function LFUN_FINISHED_xxx to indicate that they do not require a full metrics computation. Remove an "optimization" that meant that when the cursor changed inset, a full metrics computation was requested. Part of bug #12297 --- src/LyXAction.cpp | 8 src/Text.cpp | 33 + 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/src/LyXAction.cpp b/src/LyXAction.cpp index b6bb52152c..ece248e61c 100644 --- a/src/LyXAction.cpp +++ b/src/LyXAction.cpp @@ -1655,7 +1655,7 @@ void LyXAction::init() * \li Notion: See also #LFUN_FINISHED_FORWARD. * \endvar */ - { LFUN_FINISHED_BACKWARD, "", ReadOnly, Hidden }, + { LFUN_FINISHED_BACKWARD, "", ReadOnly | NoUpdate, Hidden }, /*! * \var lyx::FuncCode lyx::LFUN_FINISHED_FORWARD @@ -1668,7 +1668,7 @@ void LyXAction::init() back into the surrounding text. * \endvar */ - { LFUN_FINISHED_FORWARD, "", ReadOnly, Hidden }, + { LFUN_FINISHED_FORWARD, "", ReadOnly | NoUpdate, Hidden }, /*! * \var lyx::FuncCode lyx::LFUN_FINISHED_LEFT @@ -1676,7 +1676,7 @@ void LyXAction::init() * \li Notion: See also #LFUN_FINISHED_FORWARD. * \endvar */ - { LFUN_FINISHED_LEFT, "", ReadOnly, Hidden }, + { LFUN_FINISHED_LEFT, "", ReadOnly | NoUpdate, Hidden }, /*! @@ -1685,7 +1685,7 @@ void LyXAction::init() * \li Notion: See also #LFUN_FINISHED_FORWARD * \endvar */ - { LFUN_FINISHED_RIGHT, "", ReadOnly, Hidden }, + { LFUN_FINISHED_RIGHT, "", ReadOnly | NoUpdate, Hidden }, /*! * \var lyx::FuncCode lyx::LFUN_FLEX_INSERT diff --git a/src/Text.cpp b/src/Text.cpp index 2684309dec..4749f36d2c 100644 --- a/src/Text.cpp +++ b/src/Text.cpp @@ -6393,23 +6393,24 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd) cur.screenUpdateFlags(Update::SinglePar | Update::FitCursor); return; } - if (!needsUpdate - && () == () - && oldTopSlice.idx() == cur.idx() - && !oldSelection // oldSelection is a backup of cur.selection() at the beginning of the function. - && !cur.selection()) - // FIXME: it would be better if we could just do this - // - //if (cur.result().update() != Update::FitCursor) - // cur.noScreenUpdate(); - // - // But some LFUNs do not set Update::FitCursor when needed, so we - // do it for all. This is not very harmfull as FitCursor will provoke - // a full redraw only if needed but still, a proper review of all LFUN - // should be done and this needsUpdate boolean can then be removed. - cur.screenUpdateFlags(Update::FitCursor); - else + if (needsUpdate) cur.screenUpdateFlags(Update::Force | Update::FitCursor); + else { + // oldSelection is a backup of cur.selection() at the beginning of the function. + if (!oldSelection && !cur.selection()) + // FIXME: it would be better if we could just do this + // + //if (cur.result().update() != Update::FitCursor) + // cur.noScreenUpdate(); + // + // But some LFUNs do not set Update::FitCursor when needed, so we + // do it for all. This is not very harmfull as FitCursor will provoke + // a full redraw only if needed but still, a proper review of all LFUN + // should be done and this needsUpdate boolean can then be removed. + cur.screenUpdateFlags(Update::FitCursor); + else + cur.screenUpdateFlags(Update::ForceDraw | Update::FitCursor); + } } -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX features/biginset] Reduce metrics updates from 4 to 1 when loading file
commit 1d1f95d2ed0bf02e8a9cd9685ed4ba3365b9b493 Author: Jean-Marc Lasgouttes Date: Wed Nov 22 12:07:51 2023 +0100 Reduce metrics updates from 4 to 1 when loading file The number of metrics updates when loading file and showing it in a new work area is unreasonable. The first avoided call to updateMetrics() was an explicit resize in BufferView::init(). Instead, an assertion is suppressed by exiting early BufferView::processUpdateFlags() when BufferView::ready() returns false. This is a new method introduced to factor in some existing tests. Two other metrics computations are avoided by setting the enclosing View object busy() while creating the new tab. To make this work properly, GuiWorkArea::scheduleRedraw has to return early in this case. When saving an unnamed document or invoking "Save as...", call setBusy(false) earlier so that repainting occurs correctly. Fixes bug #12976. --- src/Buffer.cpp | 2 +- src/BufferView.cpp | 11 +++ src/BufferView.h | 2 ++ src/frontends/qt/GuiWorkArea.cpp | 8 4 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/Buffer.cpp b/src/Buffer.cpp index de7f4d217c..bbe4d80589 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -5562,6 +5562,7 @@ Buffer::ReadStatus Buffer::reload() Buffer const * oldparent = d->parent(); d->setParent(nullptr); ReadStatus const status = loadLyXFile(); + setBusy(false); if (status == ReadSuccess) { updateBuffer(); changed(true); @@ -5578,7 +5579,6 @@ Buffer::ReadStatus Buffer::reload() } else { message(bformat(_("Could not reload document %1$s."), disp_fn)); } - setBusy(false); removePreviews(); updatePreviews(); errors("Parse"); diff --git a/src/BufferView.cpp b/src/BufferView.cpp index f0e3704064..34be860691 100644 --- a/src/BufferView.cpp +++ b/src/BufferView.cpp @@ -532,7 +532,7 @@ void BufferView::processUpdateFlags(Update::flags flags) << flagsAsString(flags) << ") buffer: " << _); // Case when no explicit update is requested. - if (flags == Update::None) + if (flags == Update::None || !ready()) return; /* FIXME We would like to avoid doing this here, since it is very @@ -611,7 +611,7 @@ void BufferView::processUpdateFlags(Update::flags flags) void BufferView::updateScrollbarParameters() { - if (height_ == 0 && width_ == 0) + if (!ready()) return; // We prefer fixed size line scrolling. @@ -2625,6 +2625,9 @@ void BufferView::mouseEventDispatch(FuncRequest const & cmd0) { //lyxerr << "[ cmd0 " << cmd0 << "]" << endl; + if (!ready()) + return; + // This is only called for mouse related events including // LFUN_FILE_OPEN generated by drag-and-drop. FuncRequest cmd = cmd0; @@ -3125,7 +3128,7 @@ void BufferView::updateMetrics() void BufferView::updateMetrics(bool force) { - if (height_ == 0 || width_ == 0) + if (!ready()) return; Text & buftext = buffer_.text(); @@ -3586,7 +3589,7 @@ bool BufferView::busy() const void BufferView::draw(frontend::Painter & pain, bool paint_caret) { - if (height_ == 0 || width_ == 0) + if (!ready()) return; LYXERR(Debug::PAINTING, (pain.isNull() ? "\t\t--- START NODRAW ---" : "\t\t*** START DRAWING ***")); diff --git a/src/BufferView.h b/src/BufferView.h index cc92e215fb..327536a916 100644 --- a/src/BufferView.h +++ b/src/BufferView.h @@ -348,6 +348,8 @@ public: /// the shape of the caret frontend::CaretGeometry const & caretGeometry() const; + /// Returns true when metrics have been computed at least once + bool ready() const { return width_ > 0 && height_ > 0; } /// Returns true when the BufferView is not ready for drawing bool busy() const; /// diff --git a/src/frontends/qt/GuiWorkArea.cpp b/src/frontends/qt/GuiWorkArea.cpp index 7999dceda9..de8241c21f 100644 --- a/src/frontends/qt/GuiWorkArea.cpp +++ b/src/frontends/qt/GuiWorkArea.cpp @@ -199,9 +199,6 @@ void GuiWorkArea::init() }); d->resetScreen(); - // A mouse event will happen before the first paint event, - // so make sure that the buffer view has an up to date metrics. - d->buffer_view_->resize(viewport()->width(), viewport()->height()); setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); setAcceptDrops(true); @@ -345,7 +342,7 @@ void GuiWorkArea::toggleCaret() void GuiWorkArea::scheduleRedraw(bool update_metrics) { - if (!isVisible()) + if (!isVisible() || view().busy()) // No need to redraw in this case. return; @@
[LyX features/biginset] Update PAINTING_ANALYSIS
commit a23522073c8bb2cd06ddc7cc564e9c78f868a86d Author: Jean-Marc Lasgouttes Date: Mon Nov 20 17:24:09 2023 +0100 Update PAINTING_ANALYSIS --- development/PAINTING_ANALYSIS | 62 +-- 1 file changed, 42 insertions(+), 20 deletions(-) diff --git a/development/PAINTING_ANALYSIS b/development/PAINTING_ANALYSIS index a506371965..438d7ca9c3 100644 --- a/development/PAINTING_ANALYSIS +++ b/development/PAINTING_ANALYSIS @@ -3,7 +3,7 @@ Understanding the painting process This file tries to describe the state of the metrics/painting mechanism, and identify the improvements that could be made. The first -section can be read alone, although the context for them is really +sections can be read alone, although the context for them is really given in the following ones. Please keep this file up to date as the code evolves!!! @@ -20,9 +20,10 @@ following section. Some actions are proposed. ** SinglePar update -This flag only has an effect in the current BufferView and at -top-level, but I think it is useful in other views too. Doing this -will require some work on the update pipeline, though. +This flag only has an effect in the current BufferView, but I think it +is useful in other views too. Doing this will require some work on the +update pipeline, though. + ** Buffer::change issues @@ -53,17 +54,16 @@ The global idea would be to extend FitCursor to cover also horizontal cursor. -* Clean-up of drawing code +* TODO Clean-up of drawing code ** Set Row::changed() in a finer way *** singleParUpdate When the height of the current paragraph changes, there is no need for -a full screen update. Only the rows after the current one need to have -their position recomputed. +a full screen update (at top level, at least). Only the rows after the +current one need to have their position recomputed. -This is also true when scrolling (how to do that?) *** redoParagraph @@ -71,13 +71,16 @@ It should be possible to check whether the new row is the same as the old one and keep its changed() status in this case. This would reduce a lot the amount of stuff to redraw. + ** Put labels and friends in the Row as elements It should not be necessary to access the Paragraph object to draw. Adding the static elements to Row is a lot of work, but worth it IMO. + ** When a paragraph ends with a newline, compute correctly the height of the extra row. + ** Merging bv::updateMetrics and tm::metrics While the full metrics computation tries hard to limit the number of @@ -89,6 +92,12 @@ insets. We should re-use the bv::updateMetrics logic: The difficulty for a tall table cell for example, is that it may be necessary to break the whole contents to know the width of the cell. +Also, the anchor is relative to the outer paragraph, which means that +for a very long inset it is necessary to rebreak until the contents +that needs to be shown (to compute the heights). + +All in all, this is difficult to get right. This is less important now +that SinglePar updates work in nested insets. * Description of current drawing mechanism @@ -99,10 +108,12 @@ There are three parts to drawing the work area: + the metrics phase computes the size of insets and breaks the paragraphs into rows. It stores the dimension of insets (both - normal and math) in bv::coordCache. + normal and math) in bv::coordCache and the vertical position of the + top-level paragraphs. + the nodraw drawing phase paints the screen (see below) with a null - painter. The only useful effect is to store the inset positions. + painter. The only useful effect is to store the positions of + visible insets. + an update() signal is sent. This in turn will trigger a paint event, and the actual screen painting will happen then. @@ -115,18 +126,18 @@ whether this is correct. Depending on the Update::flags passed to the method, it sets an update strategy in (NoScreenUpdate, SingleParUpdate, FullScreenUpdate, -DecorationUpdate). It triggers a recomputation of the metrics when either: +DecorationUpdate). It triggers a call to updateMetrics when either: + Update::Force has been specified + Update::FitCursor has been specified and there is a need to scroll the display. + Update::SinglePar has been specified and the current paragraph has - not changed height. + changed height. If a computation of metrics has taken place, Force is removed from the flags and ForceDraw is added instead. -It is OK to call processUpateFlags several times before an update. In +It is OK to call processUpdateFlags several times before an update. In this case, the effects are cumulative. processUpdateFlags executes the metrics-related actions, but defers the actual drawing to the next paint event. @@ -137,21 +148,32 @@ update flag is Update::None. ** Metrics computation (and nodraw drawing phase) -This is triggered by bv::updateMetrics, which calls
[LyX features/biginset] Indicate that, by default, mouse LFUN do not require a metrics update
commit 9fd397ac1cb8c97d9b3058a669a045db0cceee1c Author: Jean-Marc Lasgouttes Date: Mon Nov 27 17:50:40 2023 +0100 Indicate that, by default, mouse LFUN do not require a metrics update This is done easily in LyXAction.cpp. Remember that, by default, each function is supposed to request a full metrics computation. Part of bug #12297. --- src/LyXAction.cpp | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/LyXAction.cpp b/src/LyXAction.cpp index ece248e61c..0b3d0a25ad 100644 --- a/src/LyXAction.cpp +++ b/src/LyXAction.cpp @@ -3121,7 +3121,7 @@ void LyXAction::init() * \li Origin: Andre, 9 Aug 2002 * \endvar */ - { LFUN_MOUSE_DOUBLE, "", ReadOnly, Hidden }, + { LFUN_MOUSE_DOUBLE, "", ReadOnly | NoUpdate, Hidden }, /*! * \var lyx::FuncCode lyx::LFUN_MOUSE_MOTION @@ -3131,7 +3131,7 @@ void LyXAction::init() * \li Origin: Andre, 9 Aug 2002 * \endvar */ - { LFUN_MOUSE_MOTION, "", ReadOnly | SingleParUpdate, Hidden }, + { LFUN_MOUSE_MOTION, "", ReadOnly | NoUpdate, Hidden }, /*! * \var lyx::FuncCode lyx::LFUN_MOUSE_PRESS @@ -3141,7 +3141,7 @@ void LyXAction::init() * \li Origin: Andre, 9 Aug 2002 * \endvar */ - { LFUN_MOUSE_PRESS, "", ReadOnly, Hidden }, + { LFUN_MOUSE_PRESS, "", ReadOnly | NoUpdate, Hidden }, /*! * \var lyx::FuncCode lyx::LFUN_MOUSE_RELEASE @@ -3151,7 +3151,7 @@ void LyXAction::init() * \li Origin: Andre, 9 Aug 2002 * \endvar */ - { LFUN_MOUSE_RELEASE, "", ReadOnly, Hidden }, + { LFUN_MOUSE_RELEASE, "", ReadOnly | NoUpdate, Hidden }, /*! @@ -3162,7 +3162,7 @@ void LyXAction::init() * \li Origin: Andre, 9 Aug 2002 * \endvar */ - { LFUN_MOUSE_TRIPLE, "", ReadOnly, Hidden }, + { LFUN_MOUSE_TRIPLE, "", ReadOnly | NoUpdate, Hidden }, /*! * \var lyx::FuncCode lyx::LFUN_NEWLINE_INSERT -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX features/biginset] Introduce new helpers ParagraphMetrics::top/bottom
commit 0b6105b9245350e428c73deee88af2cd7c0d4732 Author: Jean-Marc Lasgouttes Date: Tue Jul 25 16:31:13 2023 +0200 Introduce new helpers ParagraphMetrics::top/bottom This avoids code with position/ascent/descent that is difficult to follow. No change in function intended. --- src/BufferView.cpp | 18 -- src/ParagraphMetrics.h | 6 +- src/TextMetrics.cpp | 20 ++-- src/frontends/qt/GuiWorkArea.cpp | 2 +- 4 files changed, 20 insertions(+), 26 deletions(-) diff --git a/src/BufferView.cpp b/src/BufferView.cpp index 3612143019..dd312739b5 100644 --- a/src/BufferView.cpp +++ b/src/BufferView.cpp @@ -641,8 +641,8 @@ void BufferView::updateScrollbarParameters() << d->par_height_[pit]); } - int top_pos = first.second->position() - first.second->ascent(); - int bottom_pos = last.second->position() + last.second->descent(); + int top_pos = first.second->top(); + int bottom_pos = last.second->bottom(); bool first_visible = first.first == 0 && top_pos >= 0; bool last_visible = last.first + 1 == int(parsize) && bottom_pos <= height_; if (first_visible && last_visible) { @@ -2726,7 +2726,7 @@ int BufferView::scrollDown(int pixels) int const ymax = height_ + pixels; while (true) { pair last = tm.last(); - int bottom_pos = last.second->position() + last.second->descent(); + int bottom_pos = last.second->bottom(); if (lyxrc.scroll_below_document) bottom_pos += height_ - minVisiblePart(); if (last.first + 1 == int(text->paragraphs().size())) { @@ -2751,7 +2751,7 @@ int BufferView::scrollUp(int pixels) int ymin = - pixels; while (true) { pair first = tm.first(); - int top_pos = first.second->position() - first.second->ascent(); + int top_pos = first.second->top(); if (first.first == 0) { if (top_pos >= 0) return 0; @@ -3102,10 +3102,8 @@ bool BufferView::singleParUpdate() tm.updatePosCache(pit); - LYXERR(Debug::PAINTING, "\ny1: " << pm.position() - pm.ascent() - << " y2: " << pm.position() + pm.descent() - << " pit: " << pit - << " singlepar: 1"); + LYXERR(Debug::PAINTING, "\ny1: " << pm.top() << " y2: " << pm.bottom() + << " pit: " << pit << " singlepar: 1"); return true; } @@ -3653,7 +3651,7 @@ void BufferView::draw(frontend::Painter & pain, bool paint_caret) // and possibly grey out below pair lastpm = tm.last(); - int const y2 = lastpm.second->position() + lastpm.second->descent(); + int const y2 = lastpm.second->bottom(); if (y2 < height_) { Color color = buffer().isInternal() @@ -3674,7 +3672,7 @@ void BufferView::draw(frontend::Painter & pain, bool paint_caret) pair lastpm = tm.last(); for (pit_type pit = firstpm.first; pit <= lastpm.first; ++pit) { ParagraphMetrics const & pm = tm.parMetrics(pit); - if (pm.position() + pm.descent() > 0) { + if (pm.bottom() > 0) { if (d->anchor_pit_ != pit || d->anchor_ypos_ != pm.position()) LYXERR(Debug::PAINTING, "Found new anchor pit = " << d->anchor_pit_ diff --git a/src/ParagraphMetrics.h b/src/ParagraphMetrics.h index 0d186f158b..805d056541 100644 --- a/src/ParagraphMetrics.h +++ b/src/ParagraphMetrics.h @@ -69,9 +69,13 @@ public: /// bool hfillExpansion(Row const & row, pos_type pos) const; - /// + /// The vertical position of the baseline of the first line of the paragraph int position() const { return position_; } void setPosition(int position); + /// The vertical position of the top of the paragraph + int top() const { return position_ - dim_.ascent(); } + /// The vertical position of the bottom of the paragraph + int bottom() const { return position_ + dim_.descent(); } /// int id() const { return id_; } diff --git a/src/TextMetrics.cpp b/src/TextMetrics.cpp index 06e00f4220..837ad5766f 100644 --- a/src/TextMetrics.cpp +++ b/src/TextMetrics.cpp @@ -191,8 +191,7 @@ void TextMetrics::newParMetricsDown() // do it and update its position. redoParagraph(pit); - par_metrics_[pit].setPosition(last.second.position() - + last.second.descent() + par_metrics_[pit].ascent()); + par_metrics_[pit].setPosition(last.second.bottom() + par_metrics_[pit].ascent()); updatePosCache(pit); } @@ -206,8 +205,7 @@ void TextMetrics::newParMetricsUp() pit_type const pit = first.first -
[LyX features/biginset] Improve the code that limits scrolling at top/bottom
commit f15d2ebf3819913114ab93d1ff7e140cb26b03d5 Author: Jean-Marc Lasgouttes Date: Fri Nov 17 18:30:37 2023 +0100 Improve the code that limits scrolling at top/bottom The most visible part of this commit is the move of part of BufferView::updateMetrics to a new TextMetrics::updateMetrics. This new method makes sure that metrics are known for all visible paragraphs (starting from anchor), and that the positions of the paragraphs have been recorded. This method is called up to 3 times in BufferView::updateMetrics: * unconditionally, to update all visible metrics, * then, if the bottom of the document is visible and too high, after updating the anchor ypos, * and similarly if the top of the document is visible and too low. This fixes for example the case where one jumps to Section 5.3 at the end of Tutorial and 'scroll_below_document' is false. Some now redundant code is removed from BufferView::scrollToCursor. The anchor-setting code in BufferView::draw is not clearly useful, but left here just in case. It generates a debug warning, though. Part of bug #12297. --- src/BufferView.cpp | 99 ++--- src/TextMetrics.cpp | 50 +++ src/TextMetrics.h | 4 +++ 3 files changed, 88 insertions(+), 65 deletions(-) diff --git a/src/BufferView.cpp b/src/BufferView.cpp index ca3939aabf..f0e3704064 100644 --- a/src/BufferView.cpp +++ b/src/BufferView.cpp @@ -762,6 +762,7 @@ void BufferView::scrollDocView(int const pixels, bool update) TextMetrics const & tm = textMetrics(_.text()); if (tm.first().second->top() - pixels <= height_ && tm.last().second->bottom() - pixels >= 0) { + LYXERR(Debug::SCROLLING, "small skip"); d->anchor_ypos_ -= pixels; processUpdateFlags(Update::ForceDraw); return; @@ -784,6 +785,7 @@ void BufferView::scrollDocView(int const pixels, bool update) return; } + LYXERR(Debug::SCROLLING, "search paragraph"); // find paragraph at target position int par_pos = d->scrollbarParameters_.min; pit_type i = 0; @@ -1097,8 +1099,6 @@ bool BufferView::scrollToCursor(DocIterator const & dit, ScrollType how) d->anchor_ypos_ = - offset + row_dim.ascent(); if (how == SCROLL_CENTER) d->anchor_ypos_ += height_/2 - row_dim.height() / 2; - else if (!lyxrc.scroll_below_document && d->anchor_pit_ == max_pit) - d->anchor_ypos_ = height_ - offset - row_dim.descent(); else if (offset > height_) d->anchor_ypos_ = height_ - offset - defaultRowHeight(); else @@ -3129,7 +3129,7 @@ void BufferView::updateMetrics(bool force) return; Text & buftext = buffer_.text(); - pit_type const npit = int(buftext.paragraphs().size()); + pit_type const lastpit = int(buftext.paragraphs().size()) - 1; if (force) { // Clear out the position cache in case of full screen redraw, @@ -3148,62 +3148,35 @@ void BufferView::updateMetrics(bool force) if (d->inlineCompletionPos_.fixIfBroken()) d->inlineCompletionPos_ = DocIterator(); - if (d->anchor_pit_ >= npit) + if (d->anchor_pit_ > lastpit) // The anchor pit must have been deleted... - d->anchor_pit_ = npit - 1; + d->anchor_pit_ = lastpit; - if (!tm.contains(d->anchor_pit_)) - // Rebreak anchor paragraph. - tm.redoParagraph(d->anchor_pit_); - ParagraphMetrics & anchor_pm = tm.parMetrics(d->anchor_pit_); + // Update metrics around the anchor + tm.updateMetrics(d->anchor_pit_, d->anchor_ypos_, height_); - // make sure than first paragraph of document is not too low - if (d->anchor_pit_ == 0) { - int scrollRange = d->scrollbarParameters_.max - d->scrollbarParameters_.min; + // Check that the end of the document is not too high + int const min_visible = lyxrc.scroll_below_document ? minVisiblePart() : height_; + if (tm.last().first == lastpit && tm.last().second->bottom() < min_visible) { + d->anchor_ypos_ += min_visible - tm.last().second->bottom(); + LYXERR(Debug::SCROLLING, "Too high, adjusting anchor ypos to " << d->anchor_ypos_); + tm.updateMetrics(d->anchor_pit_, d->anchor_ypos_, height_); + } - // Complete buffer visible? Then it's easy. - if (scrollRange == 0) - d->anchor_ypos_ = anchor_pm.ascent(); - else { - // avoid empty space above the first row - d->anchor_ypos_ = min(d->anchor_ypos_, anchor_pm.ascent()); - } - } - anchor_pm.setPosition(d->anchor_ypos_); - -
[LyX features/biginset] Avoid some full metrics computations related to math previews
commit 5e8578837fea0321998eac04222102986261666d Author: Jean-Marc Lasgouttes Date: Mon Nov 27 15:13:56 2023 +0100 Avoid some full metrics computations related to math previews When entering/leaving a math hull inset, a Update::Force flag was set, in case the metrics of the inset would change because of a switch between normal and preview representation. When entering the inset, this code is now used only when the inset was in preview mode. In both cases, Update::Force is replaced with Update::SinglePar. This requites in Text::dispatch to honor Update::SinglePar when it has been set by some lfun, even when singleparupdate is false. Part of bug #12297. --- src/Text.cpp | 2 +- src/mathed/InsetMathHull.cpp | 13 - 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/Text.cpp b/src/Text.cpp index d5a1069fa1..2684309dec 100644 --- a/src/Text.cpp +++ b/src/Text.cpp @@ -6386,7 +6386,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd) // FIXME: the following code should go in favor of fine grained // update flag treatment. - if (singleParUpdate) { + if (singleParUpdate || cur.result().screenUpdate() & Update::SinglePar) { // Inserting characters does not change par height in general. So, try // to update _only_ this paragraph. BufferView will detect if a full // metrics update is needed anyway. diff --git a/src/mathed/InsetMathHull.cpp b/src/mathed/InsetMathHull.cpp index 94d293870d..34c319ea5c 100644 --- a/src/mathed/InsetMathHull.cpp +++ b/src/mathed/InsetMathHull.cpp @@ -902,7 +902,7 @@ bool InsetMathHull::notifyCursorLeaves(Cursor const & old, Cursor & cur) { if (RenderPreview::previewMath()) { reloadPreview(old); - cur.screenUpdateFlags(Update::Force); + cur.screenUpdateFlags(Update::SinglePar); } return false; } @@ -2273,14 +2273,17 @@ void InsetMathHull::handleFont2(Cursor & cur, docstring const & arg) void InsetMathHull::edit(Cursor & cur, bool front, EntryDirection entry_from) { + bool const has_preview = previewState(()); cur.push(*this); bool enter_front = (entry_from == Inset::ENTRY_DIRECTION_LEFT || (entry_from == Inset::ENTRY_DIRECTION_IGNORE && front)); enter_front ? idxFirst(cur) : idxLast(cur); - // The inset formula dimension is not necessarily the same as the - // one of the instant preview image, so we have to indicate to the - // BufferView that a metrics update is needed. - cur.screenUpdateFlags(Update::Force); + if (has_preview) { + // The inset formula dimension is in general different from the + // one of the instant preview image, so we have to indicate to the + // BufferView that a metrics update is needed. + cur.screenUpdateFlags(Update::SinglePar); + } } -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX features/biginset] Avoid metrics computation on resize when width did not change
commit f7218cec188cad2dbf68de47ad4345fcddf1bdb8 Author: Jean-Marc Lasgouttes Date: Mon Nov 27 11:46:52 2023 +0100 Avoid metrics computation on resize when width did not change Entering a math inset triggers a work area reize because the math toobars appear automatically. However, by default these toolbars are at the bottom of the screen and their presence does not change the typesetting of paragraphs. Therefore it is useful to avoid a call to updateMetrics() in the case where the width of the work area did not change. Part of bug #12297. --- src/BufferView.cpp | 16 ++-- 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/BufferView.cpp b/src/BufferView.cpp index 34be860691..c03f928c4d 100644 --- a/src/BufferView.cpp +++ b/src/BufferView.cpp @@ -2484,14 +2484,16 @@ void BufferView::clearSelection() void BufferView::resize(int width, int height) { - // Update from work area - width_ = width; height_ = height; + // Update metrics only if width has changed + if (width != width_) { + width_ = width; - // Clear the paragraph height cache. - d->par_height_.clear(); - // Redo the metrics. - updateMetrics(); + // Clear the paragraph height cache. + d->par_height_.clear(); + // Redo the metrics. + updateMetrics(); + } } @@ -3131,6 +3133,8 @@ void BufferView::updateMetrics(bool force) if (!ready()) return; + //LYXERR0("updateMetrics " << _v_(force)); + Text & buftext = buffer_.text(); pit_type const lastpit = int(buftext.paragraphs().size()) - 1; -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX features/biginset] Do not compute metrics at each preview when loading file
commit 244969330108a89f4be93d3b2eb9024bdb756204 Author: Jean-Marc Lasgouttes Date: Thu Dec 21 16:33:06 2023 +0100 Do not compute metrics at each preview when loading file With the branch-test.lyx file from #12297, loading takes forever when previews are activated. This is because each preview element causes a full screen metrics recomputation. This commit just skips these calls and only does one when all previews have been obtained. As a result, computing the previews takes 1 second instead of 25 seconds on branch-test.lyx. Part of bug #12297. --- src/graphics/PreviewLoader.cpp | 12 1 file changed, 12 insertions(+) diff --git a/src/graphics/PreviewLoader.cpp b/src/graphics/PreviewLoader.cpp index 4c37f7a8d0..004ced6d89 100644 --- a/src/graphics/PreviewLoader.cpp +++ b/src/graphics/PreviewLoader.cpp @@ -787,6 +787,16 @@ void PreviewLoader::Impl::finishedGenerating(pid_t pid, int retval) // Remove the item from the list of still-executing processes. in_progress_.erase(git); +#if 0 + /* FIXME : there is no need for all these calls, which recompute +* all metrics for each and every preview. The single call at the +* end of this method is sufficient. + +* It seems that this whole imageReady mechanism is actually not +* needed. If it is the case, the whole updateFrontend/updateInset +* bloat can go too. +*/ + // Tell the outside world list::const_reverse_iterator nit = newimages.rbegin(); @@ -795,6 +805,8 @@ void PreviewLoader::Impl::finishedGenerating(pid_t pid, int retval) for (; nit != nend; ++nit) { imageReady(*nit->get()); } +#endif + finished_generating_ = true; buffer_.scheduleRedrawWorkAreas(); } -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX features/biginset] Implement quick scroll
commit 08010c6a5e425b3f2d0d625536e3a571c90a0482 Author: Jean-Marc Lasgouttes Date: Mon Jul 24 23:23:40 2023 +0200 Implement quick scroll Replace flag parameter for updateMetrics() by a `force' boolean. When it is false, the method keeps the metrics of paragraphs that are still visible in WorkArea instead of computing everything afresh. All it has to do is update their positions. Add code to updateMetrics() to update the value of the anchor pit/ypos (similar to the one in draw()). Update processUpdateFlags() to use this when update flag is ForceDraw. Modify scrollDocView() to just change the anchor paragraph position when the scrolling operation would re-use some of the existing paragraphs. The time needed to update the metrics when scrolling with mouse in the branch-test.lyx document is now divided by 20! Part of bug #12297. --- src/BufferView.cpp | 102 ++-- src/BufferView.h| 14 ++-- src/TextMetrics.cpp | 6 src/TextMetrics.h | 2 ++ 4 files changed, 86 insertions(+), 38 deletions(-) diff --git a/src/BufferView.cpp b/src/BufferView.cpp index dd312739b5..ca3939aabf 100644 --- a/src/BufferView.cpp +++ b/src/BufferView.cpp @@ -545,10 +545,13 @@ void BufferView::processUpdateFlags(Update::flags flags) // First check whether the metrics and inset positions should be updated if (flags & Update::Force) { - // This will update the CoordCache items and replace Force - // with ForceDraw in flags. - updateMetrics(flags); - } + // This will compute all metrics and positions. + updateMetrics(true); + // metrics is done, full drawing is necessary now + flags = (flags & ~Update::Force) | Update::ForceDraw; + } else if (flags & Update::ForceDraw) + // This will compute only the needed metrics and update positions. + updateMetrics(false); // Detect whether we can only repaint a single paragraph (if we // are not already redrawing all). @@ -557,7 +560,7 @@ void BufferView::processUpdateFlags(Update::flags flags) if (!(flags & Update::ForceDraw) && (flags & Update::SinglePar) && !singleParUpdate()) - updateMetrics(flags); + updateMetrics(true); // Then make sure that the screen contains the cursor if needed if (flags & Update::FitCursor) { @@ -566,13 +569,13 @@ void BufferView::processUpdateFlags(Update::flags flags) // (which is just the cursor when there is no selection) scrollToCursor(d->cursor_.selectionBegin(), SCROLL_VISIBLE); // Metrics have to be recomputed (maybe again) - updateMetrics(); + updateMetrics(true); // Is the cursor visible? (only useful if cursor is at end of selection) if (needsFitCursor()) { // then try to make cursor visible instead scrollToCursor(d->cursor_, SCROLL_VISIBLE); // Metrics have to be recomputed (maybe again) - updateMetrics(flags); + updateMetrics(true); } } flags = flags & ~Update::FitCursor; @@ -754,10 +757,13 @@ void BufferView::scrollDocView(int const pixels, bool update) if (pixels == 0) return; - // If the offset is less than 2 screen height, prefer to scroll instead. - if (abs(pixels) <= 2 * height_) { + // If part of the existing paragraphs will remain visible, prefer to + // scroll + TextMetrics const & tm = textMetrics(_.text()); + if (tm.first().second->top() - pixels <= height_ +&& tm.last().second->bottom() - pixels >= 0) { d->anchor_ypos_ -= pixels; - processUpdateFlags(Update::Force); + processUpdateFlags(Update::ForceDraw); return; } @@ -3110,12 +3116,14 @@ bool BufferView::singleParUpdate() void BufferView::updateMetrics() { - updateMetrics(d->update_flags_); + updateMetrics(true); + // metrics is done, full drawing is necessary now + d->update_flags_ = (d->update_flags_ & ~Update::Force) | Update::ForceDraw; d->update_strategy_ = FullScreenUpdate; } -void BufferView::updateMetrics(Update::flags & update_flags) +void BufferView::updateMetrics(bool force) { if (height_ == 0 || width_ == 0) return; @@ -3123,14 +3131,16 @@ void BufferView::updateMetrics(Update::flags & update_flags) Text & buftext = buffer_.text(); pit_type const npit =
[LyX features/biginset] In the no-draw phase, do not cache the positions of not visible insets
commit 7f85024f80601b15634fb5e771bba51435ad429f Author: Jean-Marc Lasgouttes Date: Mon Jul 24 17:53:16 2023 +0200 In the no-draw phase, do not cache the positions of not visible insets This can make a big difference for a very large branch that contains lots of equations. This is complementary to the previous patch, since instead of reducing the number of calls to updatePosCache, we make it faster. In the same test of scrolling with mouse wheel through the branch-test.lyx document, one finds a 23% improvement for BufferView::updateMetrics(). Part of bug #12297. --- src/TextMetrics.cpp | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/TextMetrics.cpp b/src/TextMetrics.cpp index 6968279c23..06e00f4220 100644 --- a/src/TextMetrics.cpp +++ b/src/TextMetrics.cpp @@ -2000,6 +2000,7 @@ void TextMetrics::drawParagraph(PainterInfo & pi, pit_type const pit, int const if (pm.rows().empty()) return; size_t const nrows = pm.rows().size(); + int const wh = bv_->workHeight(); // Remember left and right margin for drawing math numbers Changer changeleft = changeVar(pi.leftx, x + leftMargin(pit)); Changer changeright = changeVar(pi.rightx, x + width() - rightMargin(pit)); @@ -2014,15 +2015,17 @@ void TextMetrics::drawParagraph(PainterInfo & pi, pit_type const pit, int const if (i) y += row.ascent(); - RowPainter rp(pi, *text_, row, row_x, y); - - rp.paintOnlyInsets(); + // It is not needed to draw on screen if we are not inside + bool const inside = (y + row.descent() >= 0 && y - row.ascent() < wh); + if (inside) { + RowPainter rp(pi, *text_, row, row_x, y); + rp.paintOnlyInsets(); + } y += row.descent(); } return; } - int const ww = bv_->workHeight(); Cursor const & cur = bv_->cursor(); DocIterator sel_beg = cur.selectionBegin(); DocIterator sel_end = cur.selectionEnd(); @@ -2065,7 +2068,7 @@ void TextMetrics::drawParagraph(PainterInfo & pi, pit_type const pit, int const // It is not needed to draw on screen if we are not inside. bool const inside = (y + row.descent() >= 0 - && y - row.ascent() < ww); + && y - row.ascent() < wh); if (!inside) { // Inset positions have already been set in nodraw stage. y += row.descent(); -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX features/biginset] Implement undo coalescing
commit f5bbadbad92d55d480ea8b20c1e29f9ffe4ca224 Author: Jean-Marc Lasgouttes Date: Thu Jul 14 01:02:28 2022 +0200 Implement undo coalescing if the undo element we want to add only changes stuff that was already modified by the previous one on undo stack (in the same group), then skip it. There is nothing to gain in adding it to the stack. The typical use case is when doing a search and replace in a large document that does many replacements in each paragraph. In this case, the same paragraph would be stored repeatedly. Fixes bug #12564. --- src/Undo.cpp | 21 +++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/src/Undo.cpp b/src/Undo.cpp index 4e970df5a0..ddc7025e1c 100644 --- a/src/Undo.cpp +++ b/src/Undo.cpp @@ -312,12 +312,29 @@ void Undo::Private::doRecordUndo(UndoKind kind, if (first_pit > last_pit) swap(first_pit, last_pit); + pit_type const from = first_pit; + pit_type const end = cell.lastpit() - last_pit; + + /* Undo coalescing: if the undo element we want to add only +* changes stuff that was already modified by the previous one on +* undo stack (in the same group), then skip it. There is nothing +* to gain in adding it to the stack. The code below works for +* both texted and mathed. + */ + if (!stack.empty() + && stack.top().group_id == group_id_ + && !stack.top().bparams + && samePar(stack.top().cell, cell) + //&& stack.top().kind == kind // needed? + && stack.top().from <= from + && stack.top().end >= end) { + LYXERR(Debug::UNDO, "Undo coalescing: skip entry"); + return; + } // Undo::ATOMIC are always recorded (no overlapping there). // As nobody wants all removed character appear one by one when undoing, // we want combine 'similar' non-ATOMIC undo recordings to one. - pit_type from = first_pit; - pit_type end = cell.lastpit() - last_pit; if (!undo_finished_ && kind != ATOMIC_UNDO && !stack.empty() -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX features/biginset] Update update-po.sh script
commit eb57c93aab05d586e8b06ef8a7277850f1591e24 Author: Richard Kimberly Heck Date: Thu Apr 4 17:09:16 2024 -0400 Update update-po.sh script (cherry picked from commit b360b9ebf7c2b1bbb0fe674790ed78065c3780c0) --- development/tools/update-po.sh | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/development/tools/update-po.sh b/development/tools/update-po.sh index 596c3fbbe9..25be194359 100755 --- a/development/tools/update-po.sh +++ b/development/tools/update-po.sh @@ -26,7 +26,7 @@ done if [ -z "$FARM" ]; then echo "You must set the FARM variable to run this script, e.g.:"; - echo "# FARM=/cvs/lyx-www/ bash check-po.sh"; + echo "# FARM=/cvs/lyx-www/ bash update-po.sh"; exit 1; fi @@ -93,7 +93,7 @@ fi if diff -w -q "$I18NFILE $FARM/$I18NFILE" >/dev/null 2>&1; then echo No string differences found. - git checkout ./*.po; + git checkout ./*.po ./*.gmo; exit 0; fi @@ -138,11 +138,13 @@ if ! cd "$FARM"; then fi echo Updating the www-user tree... -# note that we're assuming this one is svn. -svn up; +if ! git pull; then + echo "Problem updating www-user tree"; + exit 1; +fi echo Moving $I18NFILE...; mv "$LYXROOT/po/$I18NFILE" .; echo Committing...; -$DEBUG svn commit -m "* $I18NFILE: update stats" $I18NFILE; +$DEBUG git commit -m "* $I18NFILE: update stats" $I18NFILE; -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX features/biginset] Enable Update::SinglePar in nested insets too
commit 9a96726bcd06d565c3027011fea954656aa46668 Author: Jean-Marc Lasgouttes Date: Mon Jul 17 14:43:29 2023 +0200 Enable Update::SinglePar in nested insets too The idea of single par update is to try to re-break only the paragraph containing the cursor (if this paragraph contains insets etc., re-breaking will recursively descend). The existing single paragraph update mechanism was tailored to work only at top level. Indeed changing a paragraph nested into an inset may lead to larger changes. This commit tries a rather naive approach that seems to work well: we need a full redraw if either 1/ the height has changed or 2/ the width has changed and it was equal to the text metrics width; the goal is to catch the case of a one-row inset that grows with its contents, but optimize the case of typing in a short paragraph part of a larger inset. NOTE: if only the height has changed, then it should be possible to update all metrics at minimal cost. However, since this is risky, we do not try that right now. Part of bug #12297. --- src/BufferView.cpp | 42 +++--- 1 file changed, 27 insertions(+), 15 deletions(-) diff --git a/src/BufferView.cpp b/src/BufferView.cpp index 39fffed68e..fd61401dff 100644 --- a/src/BufferView.cpp +++ b/src/BufferView.cpp @@ -3063,24 +3063,36 @@ Cursor const & BufferView::cursor() const bool BufferView::singleParUpdate() { - Text & buftext = buffer_.text(); - pit_type const bottom_pit = d->cursor_.bottom().pit(); - TextMetrics & tm = textMetrics(); - Dimension const old_dim = tm.parMetrics(bottom_pit).dim(); + CursorSlice const & its = d->cursor_.innerTextSlice(); + pit_type const pit = its.pit(); + TextMetrics & tm = textMetrics(its.text()); + Dimension const old_dim = tm.parMetrics(pit).dim(); // make sure inline completion pointer is ok if (d->inlineCompletionPos_.fixIfBroken()) d->inlineCompletionPos_ = DocIterator(); - // In Single Paragraph mode, rebreak only - // the (main text, not inset!) paragraph containing the cursor. - // (if this paragraph contains insets etc., rebreaking will - // recursively descend) - tm.redoParagraph(bottom_pit); - ParagraphMetrics & pm = tm.parMetrics(bottom_pit); - if (pm.height() != old_dim.height()) { - // Paragraph height has changed so we cannot proceed to - // the singlePar optimisation. + /* Try to rebreak only the paragraph containing the cursor (if +* this paragraph contains insets etc., rebreaking will +* recursively descend). We need a full redraw if either +* 1/ the height has changed +* or +* 2/ the width has changed and it was equal to the textmetrics +*width; the goal is to catch the case of a one-row inset that +*grows with its contents, but optimize the case of typing at +*the end of a mmultiple-row paragraph. +* +* NOTE: if only the height has changed, then it should be +* possible to update all metrics at minimal cost. However, +* since this is risky, we do not try that right now. +*/ + tm.redoParagraph(pit); + ParagraphMetrics & pm = tm.parMetrics(pit); + if (pm.height() != old_dim.height() + || (pm.width() != old_dim.width() && old_dim.width() == tm.width())) { + // Paragraph height or width has changed so we cannot proceed + // to the singlePar optimisation. + LYXERR(Debug::PAINTING, "SinglePar optimization failed."); return false; } // Since position() points to the baseline of the first row, we @@ -3088,11 +3100,11 @@ bool BufferView::singleParUpdate() // the height does not change but the ascent does. pm.setPosition(pm.position() - old_dim.ascent() + pm.ascent()); - tm.updatePosCache(bottom_pit); + tm.updatePosCache(pit); LYXERR(Debug::PAINTING, "\ny1: " << pm.position() - pm.ascent() << " y2: " << pm.position() + pm.descent() - << " pit: " << bottom_pit + << " pit: " << pit << " singlepar: 1"); return true; } -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX features/biginset] Remove some redundant calls to updatePosCache
commit d19ade9a611d3ecf6840c5eb43291cb268ad6f4f Author: Jean-Marc Lasgouttes Date: Mon Jul 24 15:35:16 2023 +0200 Remove some redundant calls to updatePosCache The setting of insets positions was done twice in updateMetrics. When one of the paragraph is a huge branch, this can be very expensive. This leads to a 17% improvement on updateMetrics time on a scrolling test. Part of bug #12297 --- src/BufferView.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/BufferView.cpp b/src/BufferView.cpp index fd61401dff..3612143019 100644 --- a/src/BufferView.cpp +++ b/src/BufferView.cpp @@ -3161,7 +3161,6 @@ void BufferView::updateMetrics(Update::flags & update_flags) } } anchor_pm.setPosition(d->anchor_ypos_); - tm.updatePosCache(d->anchor_pit_); LYXERR(Debug::PAINTING, "metrics: " << " anchor pit = " << d->anchor_pit_ @@ -3177,7 +3176,6 @@ void BufferView::updateMetrics(Update::flags & update_flags) y1 -= pm.descent(); // Save the paragraph position in the cache. pm.setPosition(y1); - tm.updatePosCache(pit1); y1 -= pm.ascent(); } @@ -3191,7 +3189,6 @@ void BufferView::updateMetrics(Update::flags & update_flags) y2 += pm.ascent(); // Save the paragraph position in the cache. pm.setPosition(y2); - tm.updatePosCache(pit2); y2 += pm.descent(); } -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX features/biginset] #13049 add window activation for preferences to avoid it be hidden by main window on mac after alert prompts
commit 4c1db7cad866d99af2f2474d8467cc8581eb0eef Author: Stephan Witt Date: Fri Apr 5 10:47:49 2024 +0200 #13049 add window activation for preferences to avoid it be hidden by main window on mac after alert prompts --- src/frontends/qt/GuiPrefs.cpp | 29 +++-- 1 file changed, 23 insertions(+), 6 deletions(-) diff --git a/src/frontends/qt/GuiPrefs.cpp b/src/frontends/qt/GuiPrefs.cpp index d531dd4cde..230d377a2b 100644 --- a/src/frontends/qt/GuiPrefs.cpp +++ b/src/frontends/qt/GuiPrefs.cpp @@ -190,6 +190,16 @@ static void setComboxFont(QComboBox * cb, string const & family, } +static void activatePrefsWindow(GuiPreferences * form_) +{ + if (guiApp->platformName() == "cocoa") { + QWidget * dialog_ = form_->asQWidget(); + dialog_->raise(); + dialog_->activateWindow(); + } +} + + / // // PrefOutput @@ -1783,6 +1793,7 @@ void PrefConverters::on_needauthCB_toggled(bool checked) int ret = frontend::Alert::prompt( _("SECURITY WARNING!"), _("Unchecking this option has the effect that potentially harmful converters would be run without asking your permission first. This is UNSAFE and NOT recommended, unless you know what you are doing. Are you sure you would like to proceed? The recommended and safe answer is NO!"), 0, 0, _(""), _("")); + activatePrefsWindow(form_); if (ret == 1) changed(); else @@ -2148,6 +2159,7 @@ void PrefFileformats::on_formatED_editingFinished() _("You cannot change a format's short name " "if the format is used by a converter. " "Please remove the converter first.")); + activatePrefsWindow(form_); updateView(); return; } @@ -2303,6 +2315,7 @@ void PrefFileformats::on_formatRemovePB_clicked() Alert::error(_("Format in use"), _("Cannot remove a Format used by a Converter. " "Remove the converter first.")); + activatePrefsWindow(form_); return; } @@ -2551,12 +2564,14 @@ void PrefUserInterface::applyRC(LyXRC & rc) const uiStyleCO->currentIndex()).toString(); if (rc.ui_style != fromqstr(uistyle)) { rc.ui_style = fromqstr(uistyle); - if (rc.ui_style == "default") + if (rc.ui_style == "default") { // FIXME: This should work with frontend::GuiApplication::setStyle(QString()) //Qt bug https://bugreports.qt.io/browse/QTBUG-58268 frontend::Alert::warning(_("Restart needed"), _("Resetting the user interface style to 'Default'" " requires a restart of LyX.")); + activatePrefsWindow(form_); + } else frontend::GuiApplication::setStyle(uistyle); } @@ -3312,6 +3327,7 @@ bool PrefShortcuts::validateNewShortcut(FuncRequest const & func, if (func.action() == LFUN_UNKNOWN_ACTION) { Alert::error(_("Failed to create shortcut"), _("Unknown or invalid LyX function")); + activatePrefsWindow(form_); return false; } @@ -3321,12 +3337,14 @@ bool PrefShortcuts::validateNewShortcut(FuncRequest const & func, if (lyxaction.getActionType(func.action()) == LyXAction::Hidden) { Alert::error(_("Failed to create shortcut"), _("This LyX function is hidden and cannot be bound.")); + activatePrefsWindow(form_); return false; } if (k.length() == 0) { Alert::error(_("Failed to create shortcut"), _("Invalid or empty key sequence")); + activatePrefsWindow(form_); return false; } @@ -3343,6 +3361,7 @@ bool PrefShortcuts::validateNewShortcut(FuncRequest const & func, k.print(KeySequence::ForGui), new_action_string); int ret = Alert::prompt(_("Redefine shortcut?"), text, 0, 1, _(""), _("")); + activatePrefsWindow(form_); if (ret != 0) return false; QString const sequence_text = toqstr(k.print(KeySequence::ForGui)); @@ -3366,6 +3385,7 @@ bool PrefShortcuts::validateNewShortcut(FuncRequest const & func, new_action_string); int ret = Alert::prompt(_("Redefine shortcut?"),
[LyX features/biginset] Allow for multiple accelerator alternatives
commit aa7ff14933d4850f2b98bd3b78a9d2b3cee3ee82 Author: Juergen Spitzmueller Date: Thu Apr 4 17:12:48 2024 +0200 Allow for multiple accelerator alternatives This needs some testing before it could go to 2.4.x eventually --- README.localization| 10 lib/ui/stdcontext.inc | 2 +- src/frontends/qt/Menus.cpp | 124 ++--- 3 files changed, 106 insertions(+), 30 deletions(-) diff --git a/README.localization b/README.localization index 7e4d3d7cdb..2f1b3512df 100644 --- a/README.localization +++ b/README.localization @@ -64,6 +64,16 @@ These chars should be somehow used in your translations, however you'll have to invent your own working shortcuts for dialog and menu entries and resolve possible conflicts of the same shortcut chars in one menu... +You will be informed about conflicts in the terminal if you try to access the +menu. + +Note that, in the case of '|', if more than one character follows, this means +that LyX will try each of them in turn and use the first one that is not yet +used by another entry in the menu. That way, you can define alternative shortcuts +in the case one works in one context only, and another one only in another. You +can use this possibility also in translations, but please use it only if no +single shortcut that fits could be found. + Note also that there are already used global shortcuts (such as p k x c m s a) and you should avoid using these characters for first-level menu shortcuts. diff --git a/lib/ui/stdcontext.inc b/lib/ui/stdcontext.inc index dc49f44c77..32d76e603e 100644 --- a/lib/ui/stdcontext.inc +++ b/lib/ui/stdcontext.inc @@ -650,7 +650,7 @@ Menuset Menu "context-edit-index" OptItem "Insert Subentry|n" "indexmacro-insert subentry" OptItem "Insert Sortkey|k" "indexmacro-insert sortkey" - OptItem "Insert See Reference|c" "indexmacro-insert see" + OptItem "Insert See Reference|cf" "indexmacro-insert see" OptItem "Insert See also Reference|a" "indexmacro-insert seealso" End diff --git a/src/frontends/qt/Menus.cpp b/src/frontends/qt/Menus.cpp index 4a09a1b4a7..193e2478fa 100644 --- a/src/frontends/qt/Menus.cpp +++ b/src/frontends/qt/Menus.cpp @@ -233,10 +233,19 @@ public: } /// The keyboard shortcut (usually underlined in the entry) - QString shortcut() const + /// If \p first is true, return only the first character + /// if a multi-character string has been defined. + QString shortcut(bool first = false) const { int const index = label_.lastIndexOf('|'); - return index == -1 ? QString() : label_.mid(index + 1); + if (index == -1) + return QString(); + QString accelerators = label_.mid(index + 1); + if (accelerators.size() == 1) + return accelerators; + if (first) + return accelerators.left(1); + return accelerators; } /// The complete label, with label and shortcut separated by a '|' QString fulllabel() const { return label_; } @@ -349,8 +358,12 @@ public: /// Checks the associated FuncRequest status before adding the /// menu item. void addWithStatusCheck(MenuItem const &); - // Check whether the menu shortcuts are unique - void checkShortcuts() const; + /// Check whether the shortcut of \p mi are unique and valid, and report if not + void checkShortcutUnique(MenuItem const & mi) const; + /// Return true if a \p sc is a unique shortcut + bool checkShortcut(QString const sc) const; + /// Try to find a unique shortcut from a string of alternatives + QString getBestShortcut(MenuItem const & mi) const; /// void expandLastfiles(); void expandDocuments(); @@ -760,28 +773,84 @@ void MenuDefinition::cat(MenuDefinition const & other) } -void MenuDefinition::checkShortcuts() const +QString MenuDefinition::getBestShortcut(MenuItem const & mi) const { - // This is a quadratic algorithm, but we do not care because - // menus are short enough - for (const_iterator it1 = begin(); it1 != end(); ++it1) { - QString shortcut = it1->shortcut(); - if (shortcut.isEmpty()) - continue; - if (!it1->label().contains(shortcut)) + // This might be a string of accelerators, a single accelerator + // or empty + QString accelerators = mi.shortcut(); + QString const label = mi.label(); + if (accelerators.size() == 0) + return QString(); + if (accelerators.size() == 1) { + // check and report clashes + checkShortcutUnique(mi); + return accelerators; + } + for (int i = 0; i < accelerators.length(); i++)
[LyX features/biginset] Do not include in InsetInfo.h
commit 51562ff37732f4949441bd8c2b55692b0719093a Author: Jean-Marc Lasgouttes Date: Thu Apr 4 17:35:54 2024 +0200 Do not include in InsetInfo.h This is used by getDate/getTime, which actually should not be InsetInfoParams methods, but functions in anonymous namespace. --- src/frontends/qt/GuiInfo.cpp | 1 + src/insets/InsetInfo.cpp | 42 +- src/insets/InsetInfo.h | 5 - 3 files changed, 22 insertions(+), 26 deletions(-) diff --git a/src/frontends/qt/GuiInfo.cpp b/src/frontends/qt/GuiInfo.cpp index 5ba0b19b46..232697fa5c 100644 --- a/src/frontends/qt/GuiInfo.cpp +++ b/src/frontends/qt/GuiInfo.cpp @@ -31,6 +31,7 @@ #include "support/gettext.h" #include "support/lstrings.h" +#include using namespace std; using namespace lyx::support; diff --git a/src/insets/InsetInfo.cpp b/src/insets/InsetInfo.cpp index 3048456e84..df83f96b98 100644 --- a/src/insets/InsetInfo.cpp +++ b/src/insets/InsetInfo.cpp @@ -180,10 +180,9 @@ bool translateString(docstring const & in, docstring & out, string const & lcode out = translateIfPossible(in, lcode); return in != out; } -} // namespace anon -docstring InsetInfoParams::getDate(string const & iname, QDate const date) const +docstring getDate(string const & iname, QDate const date, Language const * lang) { QLocale loc; if (lang) @@ -208,7 +207,7 @@ docstring InsetInfoParams::getDate(string const & iname, QDate const date) const } -docstring InsetInfoParams::getTime(string const & iname, QTime const time) const +docstring getTime(string const & iname, QTime const time, Language const * lang) { QLocale loc; if (lang) @@ -222,6 +221,7 @@ docstring InsetInfoParams::getTime(string const & iname, QTime const time) const else return qstring_to_ucs4(loc.toString(time, toqstr(iname))); } +} // namespace anon vector> InsetInfoParams::getArguments(Buffer const * buf, @@ -313,17 +313,17 @@ vector> InsetInfoParams::getArguments(Buffer const * buf, date = (gdate.isValid()) ? gdate : QDate::currentDate(); } else date = QDate::currentDate(); - result.push_back(make_pair("long",getDate("long", date))); - result.push_back(make_pair("short", getDate("short", date))); - result.push_back(make_pair("loclong", getDate("loclong", date))); - result.push_back(make_pair("locmedium", getDate("locmedium", date))); - result.push_back(make_pair("locshort", getDate("locshort", date))); - result.push_back(make_pair("ISO", getDate("ISO", date))); - result.push_back(make_pair("", getDate("", date))); - result.push_back(make_pair("", getDate("", date))); - result.push_back(make_pair("MMM", getDate("MMM", date))); - result.push_back(make_pair("", getDate("", date))); - result.push_back(make_pair("ddd", getDate("ddd", date))); + result.push_back(make_pair("long",getDate("long", date, lang))); + result.push_back(make_pair("short", getDate("short", date, lang))); + result.push_back(make_pair("loclong", getDate("loclong", date, lang))); + result.push_back(make_pair("locmedium", getDate("locmedium", date, lang))); + result.push_back(make_pair("locshort", getDate("locshort", date, lang))); + result.push_back(make_pair("ISO", getDate("ISO", date, lang))); + result.push_back(make_pair("", getDate("", date, lang))); + result.push_back(make_pair("", getDate("", date, lang))); + result.push_back(make_pair("MMM", getDate("MMM", date, lang))); + result.push_back(make_pair("", getDate("", date, lang))); + result.push_back(make_pair("ddd", getDate("ddd", date, lang))); result.push_back(make_pair("custom", _("Custom"))); break; } @@ -344,9 +344,9 @@ vector> InsetInfoParams::getArguments(Buffer const * buf, time = (gtime.isValid()) ? gtime : QTime::currentTime(); } else time = QTime::currentTime(); - result.push_back(make_pair("long",getTime("long", time))); - result.push_back(make_pair("short", getTime("short", time))); - result.push_back(make_pair("ISO", getTime("ISO", time))); + result.push_back(make_pair("long",getTime("long", time, lang))); + result.push_back(make_pair("short", getTime("short", time, lang))); + result.push_back(make_pair("ISO", getTime("ISO", time, lang))); result.push_back(make_pair("custom", _("Custom"))); break; } @@ -1239,7 +1239,7 @@ void InsetInfo::build()
[LyX features/biginset] de.po
commit 16fb7ae52d751d582ee926cff93bf9fc6d8265f3 Author: Juergen Spitzmueller Date: Thu Apr 4 17:17:05 2024 +0200 de.po --- po/de.gmo | Bin 653622 -> 653743 bytes po/de.po | 160 +++--- 2 files changed, 80 insertions(+), 80 deletions(-) diff --git a/po/de.gmo b/po/de.gmo index 9fc86c4547..f00b3460ae 100644 Binary files a/po/de.gmo and b/po/de.gmo differ diff --git a/po/de.po b/po/de.po index 39ec99ea70..5438bf69e0 100644 --- a/po/de.po +++ b/po/de.po @@ -95,8 +95,8 @@ msgid "" msgstr "" "Project-Id-Version: LyX 2.4git\n" "Report-Msgid-Bugs-To: lyx-de...@lists.lyx.org\n" -"POT-Creation-Date: 2024-04-03 08:54+0200\n" -"PO-Revision-Date: 2024-04-03 09:10+0200\n" +"POT-Creation-Date: 2024-04-04 17:13+0200\n" +"PO-Revision-Date: 2024-04-04 17:15+0200\n" "Last-Translator: Juergen Spitzmueller \n" "Language-Team: German \n" "Language: de\n" @@ -1112,7 +1112,7 @@ msgstr "S:" #: lib/layouts/europasscv.layout:483 lib/layouts/europecv.layout:322 #: lib/layouts/europecv.layout:328 lib/layouts/moderncv.layout:581 #: src/frontends/qt/GuiDocument.cpp:1831 src/frontends/qt/GuiPrefs.cpp:2324 -#: src/frontends/qt/Menus.cpp:955 +#: src/frontends/qt/Menus.cpp:1024 msgid "Language" msgstr "Sprache" @@ -7617,8 +7617,8 @@ msgstr "Zusammenfassung" msgid "Summary ##" msgstr "Zusammenfassung ##" -#: lib/layouts/AEA.layout:356 src/frontends/qt/Menus.cpp:1823 -#: src/frontends/qt/Menus.cpp:1838 +#: lib/layouts/AEA.layout:356 src/frontends/qt/Menus.cpp:1892 +#: src/frontends/qt/Menus.cpp:1907 msgid "Caption" msgstr "Legende" @@ -21223,7 +21223,7 @@ msgid "Insert Sortkey|k" msgstr "Sortierschlüssel einfügen|r" #: lib/ui/stdcontext.inc:653 -msgid "Insert See Reference|c" +msgid "Insert See Reference|cf" msgstr "\"Siehe\"-Verweis einfügen|w" #: lib/ui/stdcontext.inc:654 @@ -35662,10 +35662,10 @@ msgstr "" "Schieber, Strg-+/- oder Umschalt-Mausrad." #: src/frontends/qt/GuiView.cpp:733 src/frontends/qt/GuiView.cpp:844 -#: src/frontends/qt/GuiView.cpp:1031 src/frontends/qt/Menus.cpp:1862 -#: src/frontends/qt/Menus.cpp:1866 src/frontends/qt/Menus.cpp:1870 -#: src/frontends/qt/Menus.cpp:1874 src/frontends/qt/Menus.cpp:1878 -#: src/frontends/qt/Menus.cpp:1882 +#: src/frontends/qt/GuiView.cpp:1031 src/frontends/qt/Menus.cpp:1931 +#: src/frontends/qt/Menus.cpp:1935 src/frontends/qt/Menus.cpp:1939 +#: src/frontends/qt/Menus.cpp:1943 src/frontends/qt/Menus.cpp:1947 +#: src/frontends/qt/Menus.cpp:1951 msgid "[[ZOOM]]%1$d%" msgstr "%1$d%" @@ -36335,27 +36335,27 @@ msgstr "Quelltext-Vorschau" msgid "%1[[preview format name]] Preview" msgstr "%1-Vorschau" -#: src/frontends/qt/GuiWorkArea.cpp:1582 +#: src/frontends/qt/GuiWorkArea.cpp:1584 msgid "Close File" msgstr "Datei schließen" -#: src/frontends/qt/GuiWorkArea.cpp:2120 +#: src/frontends/qt/GuiWorkArea.cpp:2122 msgid "%1 (read only)" msgstr "%1 (schreibgeschützt)" -#: src/frontends/qt/GuiWorkArea.cpp:2128 +#: src/frontends/qt/GuiWorkArea.cpp:2130 msgid "%1 (modified externally)" msgstr "%1 (extern bearbeitet)" -#: src/frontends/qt/GuiWorkArea.cpp:2151 +#: src/frontends/qt/GuiWorkArea.cpp:2153 msgid " Tab" msgstr "Unterfenster " -#: src/frontends/qt/GuiWorkArea.cpp:2157 +#: src/frontends/qt/GuiWorkArea.cpp:2159 msgid " Tab" msgstr "Unterfenster ßen" -#: src/frontends/qt/GuiWorkArea.cpp:2197 +#: src/frontends/qt/GuiWorkArea.cpp:2199 msgid "The file %1 changed on disk." msgstr "Die Datei %1 wurde auf der Festplatte verändert." @@ -36386,269 +36386,269 @@ msgstr "Geben Sie Zeichen zum Filtern der Absatzformatliste ein." msgid "%1$s (unknown)" msgstr "%1$s (unbekannt)" -#: src/frontends/qt/Menus.cpp:752 +#: src/frontends/qt/Menus.cpp:765 msgid "More...|M" msgstr "Mehr...|M" -#: src/frontends/qt/Menus.cpp:834 +#: src/frontends/qt/Menus.cpp:903 msgid "No Group" msgstr "Keine Gruppe" -#: src/frontends/qt/Menus.cpp:864 src/frontends/qt/Menus.cpp:865 +#: src/frontends/qt/Menus.cpp:933 src/frontends/qt/Menus.cpp:934 msgid "More Spelling Suggestions" msgstr "Weitere Rechtschreibvorschläge" -#: src/frontends/qt/Menus.cpp:889 +#: src/frontends/qt/Menus.cpp:958 msgid "Add to personal dictionary|r" msgstr "Zum persönlichen Wörterbuch hinzufügen|ö" -#: src/frontends/qt/Menus.cpp:891 +#: src/frontends/qt/Menus.cpp:960 msgid "Ignore this occurrence|o" msgstr "An dieser Stelle ignorieren|g" -#: src/frontends/qt/Menus.cpp:893 +#: src/frontends/qt/Menus.cpp:962 msgid "Ignore all for this session|t" msgstr "Während dieser Sitzung ignorieren|i" -#: src/frontends/qt/Menus.cpp:895 +#: src/frontends/qt/Menus.cpp:964 msgid "Ignore all in this document|u" msgstr "In diesem Dokument ignorieren|D" -#: src/frontends/qt/Menus.cpp:903 +#: src/frontends/qt/Menus.cpp:972 msgid "Remove from personal dictionary|r" msgstr "Entfernen aus persönlichem Wörterbuch|E" -#: src/frontends/qt/Menus.cpp:910 +#: src/frontends/qt/Menus.cpp:979 msgid "Remove from document
[LyX features/biginset] Update sk.po
commit f89e39e40302173067d0f9fc58a3ca4f8d2bfa63 Author: Kornel Benko Date: Wed Apr 3 12:24:28 2024 +0200 Update sk.po --- po/sk.po | 74 ++-- 1 file changed, 54 insertions(+), 20 deletions(-) diff --git a/po/sk.po b/po/sk.po index b848decde2..37e52dd414 100644 --- a/po/sk.po +++ b/po/sk.po @@ -8,8 +8,8 @@ msgid "" msgstr "" "Project-Id-Version: LyX-2.4\n" "Report-Msgid-Bugs-To: lyx-de...@lists.lyx.org\n" -"POT-Creation-Date: 2024-04-02 09:51+0200\n" -"PO-Revision-Date: 2024-04-02 09:29+\n" +"POT-Creation-Date: 2024-04-03 12:00+0200\n" +"PO-Revision-Date: 2024-04-03 10:21+\n" "Last-Translator: Kornel Benko \n" "Language-Team: Slovak \n" "Language: sk\n" @@ -20362,8 +20362,8 @@ msgstr "Zápis LyXu|y" msgid "Comment|m" msgstr "Komentár|m" -#: lib/ui/stdcontext.inc:237 lib/ui/stdmenus.inc:547 -msgid "Greyed Out|G" +#: lib/ui/stdcontext.inc:237 lib/ui/stdmenus.inc:548 +msgid "Greyed Out|y" msgstr "Zosivelé|s" #: lib/ui/stdcontext.inc:239 @@ -20621,7 +20621,7 @@ msgid "End Editing Externally" msgstr "Externú úpravu dokončiť" #: lib/ui/stdcontext.inc:381 -msgid "Split Inset|t" +msgid "Split Inset|i" msgstr "Rozdeliť vložku| " #: lib/ui/stdcontext.inc:383 @@ -20633,7 +20633,7 @@ msgid "Forward Search|F" msgstr "Dopredu hľadať|a" #: lib/ui/stdcontext.inc:386 lib/ui/stdmenus.inc:120 -msgid "Move Paragraph Up|o" +msgid "Move Paragraph Up|h" msgstr "Presunúť odstavec nahor|h" #: lib/ui/stdcontext.inc:387 lib/ui/stdmenus.inc:121 @@ -20654,7 +20654,7 @@ msgstr "Presunúť sekciu nadol|r" #: lib/ui/stdcontext.inc:394 lib/ui/stdcontext.inc:713 msgid "Move Section Up|U" -msgstr "Presunúť sekciu nahor|r" +msgstr "Presunúť sekciu nahor|P" #: lib/ui/stdcontext.inc:396 msgid "Insert Regular Expression" @@ -20672,6 +20672,10 @@ msgstr "Odmietnuť zmenu|m" msgid "Text Properties|x" msgstr "Vlastnosti textu|x" +#: lib/ui/stdcontext.inc:402 +msgid "Custom Text Styles|y" +msgstr "Vlastné štýly textu|š" + #: lib/ui/stdcontext.inc:402 lib/ui/stdmenus.inc:125 msgid "Custom Text Styles|S" msgstr "Vlastné štýly textu|š" @@ -20938,7 +20942,7 @@ msgid "Custom Page Formatting...|u" msgstr "Vlastné formátovanie Strán…|V" #: lib/ui/stdcontext.inc:651 -msgid "Insert Subentry|b" +msgid "Insert Subentry|n" msgstr "Vložiť pod-záznam|d" #: lib/ui/stdcontext.inc:652 @@ -20946,7 +20950,7 @@ msgid "Insert Sortkey|k" msgstr "Vložiť triediaci kľúč|k" #: lib/ui/stdcontext.inc:653 -msgid "Insert See Reference|e" +msgid "Insert See Reference|c" msgstr "Vložiť \"Viď\" referenciu|V" #: lib/ui/stdcontext.inc:654 @@ -35904,21 +35908,21 @@ msgstr "Žiadna skupina" msgid "More Spelling Suggestions" msgstr "Viacej pravopisných návrhov" -#: src/frontends/qt/Menus.cpp:870 -msgid "Add to personal dictionary|n" +#: src/frontends/qt/Menus.cpp:889 +msgid "Add to personal dictionary|r" msgstr "Pridať do osobného slovníka|b" -#: src/frontends/qt/Menus.cpp:872 -msgid "Ignore this occurrence|g" +#: src/frontends/qt/Menus.cpp:891 +msgid "Ignore this occurrence|o" msgstr "Ignorovať tento výskyt|g" -#: src/frontends/qt/Menus.cpp:874 -msgid "Ignore all for this session|I" +#: src/frontends/qt/Menus.cpp:893 +msgid "Ignore all for this session|t" msgstr "Ignorovať všetky počas tohto celého sedenia|I" -#: src/frontends/qt/Menus.cpp:876 -msgid "Ignore all in this document|d" -msgstr "Ignorovať všetky v tomto dokumente|d" +#: src/frontends/qt/Menus.cpp:895 +msgid "Ignore all in this document|u" +msgstr "Ignorovať všetko v tomto dokumente|d" #: src/frontends/qt/Menus.cpp:884 msgid "Remove from personal dictionary|r" @@ -35928,8 +35932,8 @@ msgstr "Vyhodiť z osobného slovníka|y" msgid "Remove from document dictionary|r" msgstr "Vyhodiť zo slovníka pre dokument|u" -#: src/frontends/qt/Menus.cpp:921 -msgid "Switch Language...|L" +#: src/frontends/qt/Menus.cpp:940 +msgid "Switch Language...|w" msgstr "Prepnúť jazyk…|ť" #: src/frontends/qt/Menus.cpp:935 @@ -44196,3 +44200,33 @@ msgstr "Neznámy používateľ" #~ msgid "Plain Quotation Mark|Q" #~ msgstr "Prosté úvodzovky|P" + +#~ msgid "Greyed Out|G" +#~ msgstr "Zosivelé|s" + +#~ msgid "Split Inset|t" +#~ msgstr "Rozdeliť vložku| " + +#~ msgid "Move Paragraph Up|o" +#~ msgstr "Presunúť odstavec nahor|h" + +#~ msgid "Insert Subentry|b" +#~ msgstr "Vložiť pod-záznam|d" + +#~ msgid "Insert See Reference|e" +#~ msgstr "Vložiť \"Viď\" referenciu|V" + +#~ msgid "Add to personal dictionary|n" +#~ msgstr "Pridať do osobného slovníka|b" + +#~ msgid "Ignore this occurrence|g" +#~ msgstr "Ignorovať tento výskyt|g" + +#~ msgid "Ignore all for this session|I" +#~ msgstr "Ignorovať všetky počas tohto celého sedenia|I" + +#~ msgid "Ignore all in this document|d" +#~ msgstr "Ignorovať všetky v tomto dokumente|d" + +#~ msgid "Switch Language...|L" +#~ msgstr "Prepnúť jazyk…|ť" -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX features/biginset] fix typo in fr/Intro.lyx
commit b28655e91ec64b7fb063d8bfea548f82d5d4cc5b Author: Jean-Marc Lasgouttes Date: Thu Apr 4 17:16:06 2024 +0200 fix typo in fr/Intro.lyx --- lib/doc/fr/Intro.lyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/doc/fr/Intro.lyx b/lib/doc/fr/Intro.lyx index 86bb5fabde..013f4fa0dd 100644 --- a/lib/doc/fr/Intro.lyx +++ b/lib/doc/fr/Intro.lyx @@ -288,7 +288,7 @@ Qu'est-ce que \SpecialChar LyX des articles dans des publications scientifiques, des scripts pour des pièces de théâtre ou des films, des propositions de contrats, - des )présentations\SpecialChar ldots + des présentations\SpecialChar ldots \end_layout -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX features/biginset] Compilation fix with Qt < 5.7
commit 6260689fd552a5e83d2970dcfd4d5ba7e09443e7 Author: Jean-Marc Lasgouttes Date: Wed Apr 3 12:39:09 2024 +0200 Compilation fix with Qt < 5.7 Qt::ImAnchorRectangle has only been introduced in Qt 5.7. Since it is used to answer a query from the IM machinery, there is no need for it with older Qt versions. --- src/frontends/qt/GuiWorkArea.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/frontends/qt/GuiWorkArea.cpp b/src/frontends/qt/GuiWorkArea.cpp index a4b874097c..341fddc3b8 100644 --- a/src/frontends/qt/GuiWorkArea.cpp +++ b/src/frontends/qt/GuiWorkArea.cpp @@ -1422,10 +1422,12 @@ QVariant GuiWorkArea::inputMethodQuery(Qt::InputMethodQuery query) const return QVariant(d->im_cursor_rect_); break; } +#if QT_VERSION >= QT_VERSION_CHECK(5, 7, 0) case Qt::ImAnchorRectangle: { return QVariant(d->im_anchor_rect_); break; } +#endif default: return QWidget::inputMethodQuery(query); } -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX features/biginset] de.po
commit c1078811c4b90e49f27f4883be8e56d7d5e0fd7c Author: Juergen Spitzmueller Date: Wed Apr 3 09:12:15 2024 +0200 de.po --- po/de.po | 34 +++--- 1 file changed, 19 insertions(+), 15 deletions(-) diff --git a/po/de.po b/po/de.po index 1bcd38fdd5..39ec99ea70 100644 --- a/po/de.po +++ b/po/de.po @@ -95,8 +95,8 @@ msgid "" msgstr "" "Project-Id-Version: LyX 2.4git\n" "Report-Msgid-Bugs-To: lyx-de...@lists.lyx.org\n" -"POT-Creation-Date: 2024-04-02 16:21+0200\n" -"PO-Revision-Date: 2024-04-02 16:25+0200\n" +"POT-Creation-Date: 2024-04-03 08:54+0200\n" +"PO-Revision-Date: 2024-04-03 09:10+0200\n" "Last-Translator: Juergen Spitzmueller \n" "Language-Team: German \n" "Language: de\n" @@ -20654,7 +20654,7 @@ msgid "Open All Notes|A" msgstr "Alle Notizen öffnen|f" #: lib/ui/stdcontext.inc:240 -msgid "Close All Notes|o" +msgid "Close All Notes|l" msgstr "Alle Notizen schließen|c" #: lib/ui/stdcontext.inc:248 lib/ui/stdmenus.inc:558 @@ -20898,8 +20898,8 @@ msgid "End Editing Externally" msgstr "Externe Bearbeitung beenden" #: lib/ui/stdcontext.inc:381 -msgid "Split Inset|t" -msgstr "Einfügung spalten|f" +msgid "Split Inset|i" +msgstr "Einfügung spalten|ü" #: lib/ui/stdcontext.inc:383 msgid "Jump Back to Saved Bookmark|B" @@ -20949,9 +20949,9 @@ msgstr "Änderung ablehnen|b" msgid "Text Properties|x" msgstr "Texteigenschaften|x" -#: lib/ui/stdcontext.inc:402 lib/ui/stdmenus.inc:125 -msgid "Custom Text Styles|S" -msgstr "Spezifische Textstile|T" +#: lib/ui/stdcontext.inc:402 +msgid "Custom Text Styles|y" +msgstr "Spezifische Textstile|f" #: lib/ui/stdcontext.inc:403 lib/ui/stdmenus.inc:123 msgid "Paragraph Settings...|P" @@ -21124,7 +21124,7 @@ msgstr "Mehrseitige Tabelle|t" #: lib/ui/stdcontext.inc:507 msgid "Formal Style|m" -msgstr "Formaler Stil|F" +msgstr "Formaler Stil|m" #: lib/ui/stdcontext.inc:509 msgid "Borders|d" @@ -21215,7 +21215,7 @@ msgid "Custom Page Formatting...|u" msgstr "Benutzerdefinierter Seitenverweis...|u" #: lib/ui/stdcontext.inc:651 -msgid "Insert Subentry|b" +msgid "Insert Subentry|n" msgstr "Untereintrag einfügen|n" #: lib/ui/stdcontext.inc:652 @@ -21223,8 +21223,8 @@ msgid "Insert Sortkey|k" msgstr "Sortierschlüssel einfügen|r" #: lib/ui/stdcontext.inc:653 -msgid "Insert See Reference|e" -msgstr "\"Siehe\"-Verweis einfügen|S" +msgid "Insert See Reference|c" +msgstr "\"Siehe\"-Verweis einfügen|w" #: lib/ui/stdcontext.inc:654 msgid "Insert See also Reference|a" @@ -21506,6 +21506,10 @@ msgstr "Suchen & Ersetzen (einfach)...|S" msgid "Find & Replace (Advanced)..." msgstr "Suchen & Ersetzen (erweitert)..." +#: lib/ui/stdmenus.inc:125 +msgid "Custom Text Styles|S" +msgstr "Spezifische Textstile|T" + #: lib/ui/stdmenus.inc:126 msgid "Manage Counter Values..." msgstr "Zählerwerte verwalten..." @@ -36396,14 +36400,14 @@ msgstr "Weitere Rechtschreibvorschläge" #: src/frontends/qt/Menus.cpp:889 msgid "Add to personal dictionary|r" -msgstr "Zum persönlichen Wörterbuch hinzufügen|Z" +msgstr "Zum persönlichen Wörterbuch hinzufügen|ö" #: src/frontends/qt/Menus.cpp:891 -msgid "Ignore this occurrence|g" +msgid "Ignore this occurrence|o" msgstr "An dieser Stelle ignorieren|g" #: src/frontends/qt/Menus.cpp:893 -msgid "Ignore all for this session|l" +msgid "Ignore all for this session|t" msgstr "Während dieser Sitzung ignorieren|i" #: src/frontends/qt/Menus.cpp:895 -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX features/biginset] Dissolve some shortcut conflicts in the wake of f3a4602c4c1ec
commit 728175f9acdd8b67249d5403d99319557201f80c Author: Juergen Spitzmueller Date: Wed Apr 3 08:28:00 2024 +0200 Dissolve some shortcut conflicts in the wake of f3a4602c4c1ec --- lib/ui/stdcontext.inc | 10 +- src/frontends/qt/Menus.cpp | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/ui/stdcontext.inc b/lib/ui/stdcontext.inc index 90a4cda1aa..dc49f44c77 100644 --- a/lib/ui/stdcontext.inc +++ b/lib/ui/stdcontext.inc @@ -237,7 +237,7 @@ Menuset Item "Greyed Out|y" "inset-modify note Note Greyedout" Separator Item "Open All Notes|A" "inset-forall Note inset-toggle open" - Item "Close All Notes|o" "inset-forall Note inset-toggle close" + Item "Close All Notes|l" "inset-forall Note inset-toggle close" End # @@ -378,7 +378,7 @@ Menuset Item "Paste" "paste" Submenu "Paste Recent|e" "edit_pasterecent" Separator - OptItem "Split Inset|t" "inset-split" + OptItem "Split Inset|i" "inset-split" Separator Item "Jump Back to Saved Bookmark|B" "bookmark-goto 0" OptItem "Forward Search|F" "forward-search" @@ -399,7 +399,7 @@ Menuset OptItem "Reject Change|j" "change-reject" Separator Submenu "Text Properties|x" "edit_textprops" - OptSubmenu "Custom Text Styles|S" "edit_textstyles" + OptSubmenu "Custom Text Styles|y" "edit_textstyles" Item "Paragraph Settings...|P" "layout-paragraph" OptItem "Unify Graphics Groups|U" "graphics-unify" LanguageSelector @@ -648,9 +648,9 @@ Menuset End Menu "context-edit-index" - OptItem "Insert Subentry|b" "indexmacro-insert subentry" + OptItem "Insert Subentry|n" "indexmacro-insert subentry" OptItem "Insert Sortkey|k" "indexmacro-insert sortkey" - OptItem "Insert See Reference|e" "indexmacro-insert see" + OptItem "Insert See Reference|c" "indexmacro-insert see" OptItem "Insert See also Reference|a" "indexmacro-insert seealso" End diff --git a/src/frontends/qt/Menus.cpp b/src/frontends/qt/Menus.cpp index 6c4b08cf48..4a09a1b4a7 100644 --- a/src/frontends/qt/Menus.cpp +++ b/src/frontends/qt/Menus.cpp @@ -888,9 +888,9 @@ void MenuDefinition::expandSpellingSuggestions(BufferView const * bv) docstring const arg = wl.word() + " " + from_ascii(wl.lang()->lang()); add(MenuItem(MenuItem::Command, qt_("Add to personal dictionary|r"), FuncRequest(LFUN_SPELLING_ADD, arg))); - add(MenuItem(MenuItem::Command, qt_("Ignore this occurrence|g"), + add(MenuItem(MenuItem::Command, qt_("Ignore this occurrence|o"), FuncRequest(LFUN_FONT_NO_SPELLCHECK, arg))); - add(MenuItem(MenuItem::Command, qt_("Ignore all for this session|l"), + add(MenuItem(MenuItem::Command, qt_("Ignore all for this session|t"), FuncRequest(LFUN_SPELLING_IGNORE, arg))); add(MenuItem(MenuItem::Command, qt_("Ignore all in this document|u"), FuncRequest(LFUN_SPELLING_ADD_LOCAL, arg))); -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX features/biginset] Update German User Guide
commit a55ede6a7462affbdf860caa6bc54777f6ad3aa5 Author: Juergen Spitzmueller Date: Wed Apr 3 07:35:59 2024 +0200 Update German User Guide --- lib/doc/de/UserGuide.lyx | 34 +- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/lib/doc/de/UserGuide.lyx b/lib/doc/de/UserGuide.lyx index 30366aa07f..368fae244e 100644 --- a/lib/doc/de/UserGuide.lyx +++ b/lib/doc/de/UserGuide.lyx @@ -1,4 +1,4 @@ -#LyX 2.4 created this file. For more info see https://www.lyx.org/ +#LyX 2.5 created this file. For more info see https://www.lyx.org/ \lyxformat 620 \begin_document \begin_header @@ -9302,10 +9302,12 @@ Unformatiert \end_layout \begin_layout Verbatim + Dies ist Unformatiert. \end_layout \begin_layout Verbatim + Die folgenden 2 Zeilen sind leer: \end_layout @@ -9318,6 +9320,7 @@ Die folgenden 2 Zeilen sind leer: \end_layout \begin_layout Verbatim + Fast alles ist in Unformatiert erlaubt:"%&$§#~'` \backslash }][{| @@ -9343,6 +9346,7 @@ Unformatiert \end_layout \begin_layout Verbatim* + Dies ist Unformatiert*. \end_layout @@ -43818,6 +43822,10 @@ Nicht-typographisches \begin_inset space ~ \end_inset +doppeltes +\begin_inset space ~ +\end_inset + Anführungszeichen Fügt dieses Anführungszeichen ein: ", unabhängig vom Anführungszeichen-Stil der im Dialog @@ -43829,6 +43837,30 @@ Sprache eingestellt ist. \end_layout +\begin_layout Description +Nicht-typographisches +\begin_inset space ~ +\end_inset + +einfaches +\begin_inset space ~ +\end_inset + +Anführungszeichen Fügt dieses Anführungszeichen ein: + +\begin_inset Quotes qls +\end_inset + +, + unabhängig vom Anführungszeichen-Stil der im Dialog +\family sans +Dokument\SpecialChar menuseparator +Einstellungen\SpecialChar menuseparator +Sprache +\family default + eingestellt ist. +\end_layout + \begin_layout Description Inneres \begin_inset space ~ -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX features/biginset] Ignore all build* directories
commit 34dbdad9573f09e6c1b47b9990b8700a7b832093 Author: Richard Kimberly Heck Date: Tue Apr 2 22:03:53 2024 -0400 Ignore all build* directories (cherry picked from commit 368f10571aab8b6796218a1ac70b98a940e45722) --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 5b86db561a..3667bd0a0a 100644 --- a/.gitignore +++ b/.gitignore @@ -17,7 +17,7 @@ stamp-h1 *.old *.bak *.patch -build/ +build*/ CMakeLists.txt.user .dirstamp /src/tex2lyx/test/*.lyx.tex -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX features/biginset] Merge branch 'master' of git.lyx.org:lyx
commit 77b680546d08e4cf5cefac2feca30155d52ad183 Merge: 655cdfbb7b 34dbdad957 Author: Juergen Spitzmueller Date: Wed Apr 3 07:26:11 2024 +0200 Merge branch 'master' of git.lyx.org:lyx .gitignore| 2 +- lib/doc/UserGuide.lyx | 87 -- po/fr.gmo | Bin 656494 -> 656498 bytes po/fr.po | 26 +++ src/LyXAction.cpp | 4 ++- 5 files changed, 101 insertions(+), 18 deletions(-) -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX features/biginset] Docs for menu change
commit b8a988fa135fe0e01a0ddaf2e527cf6dc17c7642 Author: Richard Kimberly Heck Date: Tue Apr 2 22:02:55 2024 -0400 Docs for menu change (cherry picked from commit c8534081c9d40b7331ac73513a758ffc51bc423e) --- lib/doc/UserGuide.lyx | 87 +-- 1 file changed, 84 insertions(+), 3 deletions(-) diff --git a/lib/doc/UserGuide.lyx b/lib/doc/UserGuide.lyx index d32f5960e3..1e6d3489fb 100644 --- a/lib/doc/UserGuide.lyx +++ b/lib/doc/UserGuide.lyx @@ -148,7 +148,7 @@ logicalmkup \papersides 2 \paperpagestyle default \tablestyle default -\tracking_changes false +\tracking_changes true \output_changes false \change_bars false \postpone_fragile_content false @@ -157,6 +157,7 @@ logicalmkup \html_be_strict true \docbook_table_output 0 \docbook_mathml_prefix 1 +\author -584632292 "Richard Kimberly Heck" \end_header \begin_body @@ -9642,12 +9643,14 @@ Verbatim \end_layout \begin_layout Verbatim + This is Verbatim. \end_layout \begin_layout Verbatim \noindent \align block + The following 2 lines are empty: \end_layout @@ -9660,6 +9663,7 @@ The following 2 lines are empty: \end_layout \begin_layout Verbatim + Almost everything is allowed in Verbatim:"%&$§#~'` \backslash }][{| @@ -9683,6 +9687,7 @@ Verbatim \end_layout \begin_layout Verbatim* + This is Verbatim*. \end_layout @@ -44599,11 +44604,35 @@ nolink "false" \end_layout \begin_layout Description + +\change_inserted -584632292 1712109674 +Plain +\begin_inset space ~ +\end_inset + +Double +\begin_inset space ~ +\end_inset + + +\change_deleted -584632292 1712109675 Ordinary \begin_inset space ~ \end_inset -Quote Inserts this quote: + +\change_unchanged +Quot +\change_inserted -584632292 1712109680 +ation +\begin_inset space ~ +\end_inset + +Mark +\change_deleted -584632292 1712109681 +e +\change_unchanged + Inserts this quote: ", no matter what quote style you selected in the \family sans @@ -44615,11 +44644,63 @@ Language \end_layout \begin_layout Description + +\change_inserted -584632292 1712109701 +Plain +\begin_inset space ~ +\end_inset + +Single +\begin_inset space ~ +\end_inset + +Quotation +\begin_inset space ~ +\end_inset + +Mark Inserts this quote: + +\begin_inset Quotes qls +\end_inset + +, + no matter what quote style you have selected. +\end_layout + +\begin_layout Description + +\change_deleted -584632292 1712109722 Single +\change_inserted -584632292 1712109720 +Inner +\change_unchanged + +\begin_inset space ~ +\end_inset + +Quot +\change_inserted -584632292 1712109726 +ation \begin_inset space ~ \end_inset -Quote Inserts a single quote in the quotation marks style selected in the +Mark +\change_deleted -584632292 1712109727 +e +\change_unchanged + Inserts a +\change_inserted -584632292 1712109731 +n inner +\change_unchanged + +\change_deleted -584632292 1712109733 +single +\change_unchanged +quote +\change_inserted -584632292 1712109738 +(usually a single quote) +\change_unchanged +in the quotation marks style selected in the \family sans Document\SpecialChar menuseparator Settings\SpecialChar menuseparator -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX features/biginset] de.po
commit 655cdfbb7b8d72efbc5eca64a24b31898bfe Author: Juergen Spitzmueller Date: Tue Apr 2 16:26:00 2024 +0200 de.po --- po/de.po | 214 +++ 1 file changed, 107 insertions(+), 107 deletions(-) diff --git a/po/de.po b/po/de.po index b2575ee8b9..1bcd38fdd5 100644 --- a/po/de.po +++ b/po/de.po @@ -95,8 +95,8 @@ msgid "" msgstr "" "Project-Id-Version: LyX 2.4git\n" "Report-Msgid-Bugs-To: lyx-de...@lists.lyx.org\n" -"POT-Creation-Date: 2024-04-02 08:21+0200\n" -"PO-Revision-Date: 2024-04-02 08:23+0200\n" +"POT-Creation-Date: 2024-04-02 16:21+0200\n" +"PO-Revision-Date: 2024-04-02 16:25+0200\n" "Last-Translator: Juergen Spitzmueller \n" "Language-Team: German \n" "Language: de\n" @@ -1112,7 +1112,7 @@ msgstr "S:" #: lib/layouts/europasscv.layout:483 lib/layouts/europecv.layout:322 #: lib/layouts/europecv.layout:328 lib/layouts/moderncv.layout:581 #: src/frontends/qt/GuiDocument.cpp:1831 src/frontends/qt/GuiPrefs.cpp:2324 -#: src/frontends/qt/Menus.cpp:936 +#: src/frontends/qt/Menus.cpp:955 msgid "Language" msgstr "Sprache" @@ -1741,25 +1741,25 @@ msgid "Case " msgstr "ß-/Kleinschreibung beachten" #: src/frontends/qt/ui/FindAndReplaceUi.ui:205 -#: src/frontends/qt/FindAndReplace.cpp:716 +#: src/frontends/qt/FindAndReplace.cpp:719 msgid "Find next occurrence (Enter, backwards: Shift+Enter)" msgstr "" "Suche nächsten Treffer (Eingabetaste; rückwärts: Umschalt+Eingabetaste)" #: src/frontends/qt/ui/FindAndReplaceUi.ui:208 -#: src/frontends/qt/ui/SearchUi.ui:190 src/frontends/qt/FindAndReplace.cpp:715 +#: src/frontends/qt/ui/SearchUi.ui:190 src/frontends/qt/FindAndReplace.cpp:718 msgid "Find &>" msgstr "Suchen &>" #: src/frontends/qt/ui/FindAndReplaceUi.ui:221 -#: src/frontends/qt/FindAndReplace.cpp:718 +#: src/frontends/qt/FindAndReplace.cpp:721 msgid "Replace and find next occurrence (Enter, backwards: Shift+Enter)" msgstr "" "Ersetze und suche nächsten Treffer (Eingabetaste; rückwärts: " "Umschalt+Eingabetaste)" #: src/frontends/qt/ui/FindAndReplaceUi.ui:224 -#: src/frontends/qt/FindAndReplace.cpp:717 +#: src/frontends/qt/FindAndReplace.cpp:720 msgid "Rep >" msgstr "Erse >" @@ -5568,7 +5568,7 @@ msgstr "Ohne Hyperlink " msgid "Find previous occurrence (Shift+Enter)" msgstr "Vorhergehender Treffer (Umschalt+Eingabe)" -#: src/frontends/qt/ui/SearchUi.ui:55 src/frontends/qt/FindAndReplace.cpp:710 +#: src/frontends/qt/ui/SearchUi.ui:55 src/frontends/qt/FindAndReplace.cpp:713 msgid "&< Find" msgstr "&< Suchen" @@ -7617,8 +7617,8 @@ msgstr "Zusammenfassung" msgid "Summary ##" msgstr "Zusammenfassung ##" -#: lib/layouts/AEA.layout:356 src/frontends/qt/Menus.cpp:1804 -#: src/frontends/qt/Menus.cpp:1819 +#: lib/layouts/AEA.layout:356 src/frontends/qt/Menus.cpp:1823 +#: src/frontends/qt/Menus.cpp:1838 msgid "Caption" msgstr "Legende" @@ -20646,7 +20646,7 @@ msgid "Comment|m" msgstr "Kommentar|K" #: lib/ui/stdcontext.inc:237 lib/ui/stdmenus.inc:548 -msgid "Greyed Out|G" +msgid "Greyed Out|y" msgstr "Grauschrift|G" #: lib/ui/stdcontext.inc:239 @@ -20654,7 +20654,7 @@ msgid "Open All Notes|A" msgstr "Alle Notizen öffnen|f" #: lib/ui/stdcontext.inc:240 -msgid "Close All Notes|l" +msgid "Close All Notes|o" msgstr "Alle Notizen schließen|c" #: lib/ui/stdcontext.inc:248 lib/ui/stdmenus.inc:558 @@ -20910,7 +20910,7 @@ msgid "Forward Search|F" msgstr "Vorwärtssuche|V" #: lib/ui/stdcontext.inc:386 lib/ui/stdmenus.inc:120 -msgid "Move Paragraph Up|o" +msgid "Move Paragraph Up|h" msgstr "Absatz nach oben verschieben|o" #: lib/ui/stdcontext.inc:387 lib/ui/stdmenus.inc:121 @@ -27892,10 +27892,6 @@ msgstr "Gnuplot" msgid "External Material" msgstr "Externes Material" -#: lib/examples/Articles:0 -msgid "XY-Figure" -msgstr "XY-Figure" - #: lib/examples/Articles:0 msgid "Feynman Diagrams" msgstr "Feynman-Diagramme" @@ -27904,6 +27900,10 @@ msgstr "Feynman-Diagramme" msgid "Instant Preview" msgstr "Eingebettete Vorschau" +#: lib/examples/Articles:0 +msgid "Itemize Bullets" +msgstr "Auflistungszeichen" + #: lib/examples/Articles:0 msgid "Minted File Listing" msgstr "Minted-Programmlistings (Dateien)" @@ -27913,8 +27913,8 @@ msgid "Minted Listings" msgstr "Minted-Programmlistings" #: lib/examples/Articles:0 -msgid "Itemize Bullets" -msgstr "Auflistungszeichen" +msgid "XY-Figure" +msgstr "XY-Figure" #: lib/examples/Articles:0 msgid "XY-Pic" @@ -27956,6 +27956,10 @@ msgstr "Serienbrief 2" msgid "Serial Letter 3" msgstr "Serienbrief 3" +#: lib/examples/Articles:0 +msgid "Noweb Listerrors" +msgstr "Noweb-Fehlerbericht" + #: lib/examples/Articles:0 msgid "Hazard and Precautionary Statements" msgstr "H- und P-Sätze" @@ -27972,14 +27976,14 @@ msgstr "Mehrsprachige Legenden" msgid "Noweb2LyX" msgstr "Noweb2LyX" -#: lib/examples/Articles:0 -msgid "Noweb Listerrors" -msgstr "Noweb-Fehlerbericht" - #: lib/examples/Articles:0 src/frontends/qt/GuiDocument.cpp:1825 msgid
[LyX features/biginset] Update fr.po
commit 3923c3abf4206c170876f509a08899b3b7c6c1f5 Author: jpc Date: Tue Apr 2 18:56:26 2024 +0200 Update fr.po --- po/fr.gmo | Bin 656494 -> 656498 bytes po/fr.po | 26 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/po/fr.gmo b/po/fr.gmo index 8f1fc37a82..0ac78123f6 100644 Binary files a/po/fr.gmo and b/po/fr.gmo differ diff --git a/po/fr.po b/po/fr.po index 74cce5f396..92ea86438a 100644 --- a/po/fr.po +++ b/po/fr.po @@ -363,7 +363,7 @@ msgstr "" "Project-Id-Version: LyX 2.4\n" "Report-Msgid-Bugs-To: lyx-de...@lists.lyx.org\n" "POT-Creation-Date: 2024-03-06 09:55+0100\n" -"PO-Revision-Date: 2024-03-06 10:25+0100\n" +"PO-Revision-Date: 2024-04-02 17:50+0200\n" "Last-Translator: Jean-Pierre Chrétien \n" "Language-Team: lyxfr\n" "Language: fr\n" @@ -3282,7 +3282,7 @@ msgstr "Langage" #: src/frontends/qt/ui/ListingsUi.ui:343 msgid "Lan[[Programming]]:" -msgstr "Lan" +msgstr "Lan :" #: src/frontends/qt/ui/ListingsUi.ui:353 msgid "Select the programming language" @@ -6930,7 +6930,7 @@ msgstr ", " #: lib/citeengines/biblatex.citeengine:147 #: lib/citeengines/natbib.citeengine:126 lib/layouts/stdciteformats.inc:30 msgid ", and [[separate name of last author in citation]]" -msgstr " et " +msgstr ", et " #: lib/citeengines/biblatex-natbib.citeengine:156 #: lib/citeengines/biblatex.citeengine:148 @@ -7465,7 +7465,7 @@ msgstr "Cas" #: lib/layouts/AEA.layout:206 lib/layouts/elsart.layout:546 #: lib/layouts/theorems-without-preamble.inc:458 msgid "Case ##" -msgstr "Cas ##." +msgstr "Cas ##" #: lib/layouts/AEA.layout:213 lib/layouts/theorems-without-preamble.inc:464 msgid "Case \\thecase." @@ -14813,7 +14813,7 @@ msgstr "Akigumi" #: lib/layouts/jlreq-common.inc:302 msgid "Akigumi (LuaLaTeX)" -msgstr "Akigumi(LuaLaTeX) " +msgstr "Akigumi (LuaLaTeX)" #: lib/layouts/jlreq-common.inc:304 msgid "Char Space" @@ -16921,7 +16921,7 @@ msgstr "Liste numérotée (niveau 2)" #: lib/layouts/powerdot.layout:621 msgid "(\\arabic{enumii})" -msgstr "(\\arabic{enumi})" +msgstr "(\\arabic{enumii})" #: lib/layouts/powerdot.layout:625 lib/layouts/stdcounters.inc:63 msgid "Numbered List (Level 3)" @@ -16929,7 +16929,7 @@ msgstr "Liste numérotée (niveau 3)" #: lib/layouts/powerdot.layout:627 msgid "(\\arabic{enumiii})" -msgstr "(\\arabic{enumi})" +msgstr "(\\arabic{enumiii})" #: lib/layouts/powerdot.layout:631 lib/layouts/stdcounters.inc:70 msgid "Numbered List (Level 4)" @@ -16937,7 +16937,7 @@ msgstr "Liste numérotée (niveau 4)" #: lib/layouts/powerdot.layout:633 msgid "(\\arabic{enumiv})" -msgstr "(\\arabic{enumi})" +msgstr "(\\arabic{enumiv})" #: lib/layouts/powerdot.layout:637 lib/layouts/stdcounters.inc:77 msgid "Bibliography Item" @@ -28295,7 +28295,7 @@ msgstr "Bienvenue" #: lib/examples/Articles:0 msgid "Writing Korean with CJK-ko" -msgstr "Écriture du coréen avec CJK-ko " +msgstr "Écriture du coréen avec CJK-ko" #: lib/examples/Articles:0 msgid "Hebrew Article (KOMA-Script)" @@ -29924,7 +29924,7 @@ msgstr "caractère spécial" #: src/Color.cpp:305 msgid "math text" -msgstr "Texte mathématique" +msgstr "texte mathématique" #: src/Color.cpp:306 msgid "math background" @@ -30722,7 +30722,7 @@ msgstr "Exécution du processeur d'index." #: src/LaTeX.cpp:460 msgid "Index Processor Error" -msgstr "Erreur du processeur d'index." +msgstr "Erreur du processeur d'index" #: src/LaTeX.cpp:461 msgid "" @@ -30851,7 +30851,7 @@ msgstr " LyX" #: src/LyX.cpp:597 msgid "No python is found" -msgstr "python introuvable" +msgstr "Python introuvable" #: src/LyX.cpp:598 msgid "" @@ -33058,7 +33058,7 @@ msgstr "%1$s (%2$s)" #: src/frontends/qt/GuiBranch.cpp:70 msgid "master" -msgstr "Document maître" +msgstr "document maître" #: src/frontends/qt/GuiBranch.h:35 msgid "Branch Settings" -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX features/biginset] Update doc info for quote-insert
commit f37486968782d4ada66ca85290a39fd3fd366dc8 Author: Richard Kimberly Heck Date: Tue Apr 2 12:46:36 2024 -0400 Update doc info for quote-insert --- src/LyXAction.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/LyXAction.cpp b/src/LyXAction.cpp index 19f12038a8..b6bb52152c 100644 --- a/src/LyXAction.cpp +++ b/src/LyXAction.cpp @@ -3470,7 +3470,9 @@ void LyXAction::init() * \li Params: : 'inner' for (i.e., secondary, usually single) quotes, otherwise * outer (i.e., primary, usually double) quotes will be used.\n * : 'opening' for opening quotes, 'closing' for closing quotes, - * otherwise the side will be guessed from the context.\n + * otherwise the side will be guessed from the context. Use 'auto' + * to force this default. (You will need to give this argument if + * you also want to give
[LyX features/biginset] Smarter menu length calculation
commit f3a4602c4c1eca9bc79e7ba0b58395b79eafe9db Author: Juergen Spitzmueller Date: Tue Apr 2 14:41:54 2024 +0200 Smarter menu length calculation It is possible I have missed some shortcut conflicts, so please report if you find any. --- lib/ui/stdcontext.inc | 6 +++--- lib/ui/stdmenus.inc| 4 ++-- src/frontends/qt/Menus.cpp | 43 +-- 3 files changed, 38 insertions(+), 15 deletions(-) diff --git a/lib/ui/stdcontext.inc b/lib/ui/stdcontext.inc index 6d4fc75703..90a4cda1aa 100644 --- a/lib/ui/stdcontext.inc +++ b/lib/ui/stdcontext.inc @@ -234,10 +234,10 @@ Menuset Menu "context-note" Item "LyX Note|N" "inset-modify note Note Note" Item "Comment|m" "inset-modify note Note Comment" - Item "Greyed Out|G" "inset-modify note Note Greyedout" + Item "Greyed Out|y" "inset-modify note Note Greyedout" Separator Item "Open All Notes|A" "inset-forall Note inset-toggle open" - Item "Close All Notes|l" "inset-forall Note inset-toggle close" + Item "Close All Notes|o" "inset-forall Note inset-toggle close" End # @@ -383,7 +383,7 @@ Menuset Item "Jump Back to Saved Bookmark|B" "bookmark-goto 0" OptItem "Forward Search|F" "forward-search" Separator - Item "Move Paragraph Up|o" "paragraph-move-up" + Item "Move Paragraph Up|h" "paragraph-move-up" Item "Move Paragraph Down|v" "paragraph-move-down" Separator EnvironmentSeparatorsContext diff --git a/lib/ui/stdmenus.inc b/lib/ui/stdmenus.inc index 7d7750cc03..14c927dc06 100644 --- a/lib/ui/stdmenus.inc +++ b/lib/ui/stdmenus.inc @@ -117,7 +117,7 @@ Menuset Item "Find & Replace (Quick)...|F" "dialog-show findreplace" Item "Find & Replace (Advanced)..." "dialog-show findreplaceadv" Separator - Item "Move Paragraph Up|o" "paragraph-move-up" + Item "Move Paragraph Up|h" "paragraph-move-up" Item "Move Paragraph Down|v" "paragraph-move-down" Separator Item "Paragraph Settings...|P" "layout-paragraph" @@ -545,7 +545,7 @@ Menuset Menu "insert_note" Item "LyX Note|N" "note-insert Note" Item "Comment|C" "note-insert Comment" - Item "Greyed Out|G" "note-insert Greyedout" + Item "Greyed Out|y" "note-insert Greyedout" End Menu "insert_branches" diff --git a/src/frontends/qt/Menus.cpp b/src/frontends/qt/Menus.cpp index a3fc5a7ce1..6c4b08cf48 100644 --- a/src/frontends/qt/Menus.cpp +++ b/src/frontends/qt/Menus.cpp @@ -342,6 +342,8 @@ public: const; /// bool hasFunc(FuncRequest const &) const; + /// The real size of the menu considering hidden entries + int realSize() const; /// Add the menu item unconditionally void add(MenuItem const & item) { items_.push_back(item); } /// Checks the associated FuncRequest status before adding the @@ -727,6 +729,23 @@ bool MenuDefinition::hasFunc(FuncRequest const & func) const } +int MenuDefinition::realSize() const +{ + int res = 0; + for (auto const & it : *this) { + if (it.kind() == MenuItem::Submenu) + ++res; + else if (it.kind() == MenuItem::Command) { + FuncStatus status = lyx::getStatus(*it.func()); + // count only items that are actually displayed + if (!status.unknown() && (status.enabled() || !it.optional())) + ++res; + } + } + return res; +} + + void MenuDefinition::catSub(docstring const & name) { add(MenuItem(MenuItem::Submenu, @@ -867,13 +886,13 @@ void MenuDefinition::expandSpellingSuggestions(BufferView const * bv) if (i > 0) add(MenuItem(MenuItem::Separator)); docstring const arg = wl.word() + " " + from_ascii(wl.lang()->lang()); - add(MenuItem(MenuItem::Command, qt_("Add to personal dictionary|n"), + add(MenuItem(MenuItem::Command, qt_("Add to personal dictionary|r"), FuncRequest(LFUN_SPELLING_ADD, arg))); add(MenuItem(MenuItem::Command, qt_("Ignore this occurrence|g"), FuncRequest(LFUN_FONT_NO_SPELLCHECK, arg))); - add(MenuItem(MenuItem::Command, qt_("Ignore all for this session|I"), + add(MenuItem(MenuItem::Command, qt_("Ignore all for this session|l"),
[LyX features/biginset] Translation of French Additional.lyx: chapter 3 completed
commit 8850b68792cf5c86dd5f73d39cff3e4e69886afd Author: jpc Date: Tue Apr 2 11:51:49 2024 +0200 Translation of French Additional.lyx: chapter 3 completed --- lib/doc/fr/Additional.lyx | 115 +- 1 file changed, 52 insertions(+), 63 deletions(-) diff --git a/lib/doc/fr/Additional.lyx b/lib/doc/fr/Additional.lyx index ba756a6839..fc6956d2ed 100644 --- a/lib/doc/fr/Additional.lyx +++ b/lib/doc/fr/Additional.lyx @@ -13029,36 +13029,35 @@ seminar Rapports \end_layout -\begin_layout Subsection - -\lang english -report -\end_layout - \begin_layout Standard - -\lang english -Report classes are sort of a hybrid between book and article classes: - like book classes, - they provide parts, - chapters and sections but does not provide frontmatter, - mainmatter, - and backmatter; - like article classes, - they provide abstract paragraph styles and are one-sided by default. - Also, - they do not start a new chapter on the right hand page (even in two-side mode). +Les classes +\family sans +Rapports +\family default + constituent en quelque sorte une hybridation entre les classes +\family sans +Livres +\family default + et les classes +\family sans +Articles +\family default +: + comme les livres, + elles proposent des parties, + des chapitres et des sections, + mais ne prévoient pas de préliminaires (frontmatter), + de corps principal (mainmatter) et de compléments (backmatter); + comme les articles, + elles proposent des styles pour le résumé et sont implicitement en recto seul. + En outre, + elles ne positionnent pas un nouveau chapitre en page impaire, + même en mode recto-verso. \end_layout \begin_layout Standard - -\lang english -All externally maintained -\family sans -report -\family default - document classes that are officially supported by \SpecialChar LyX - are described in the Collections (section +Toutes le classes Rapports en maintenance externe qui sont reconnues officiellement par \SpecialChar LyX + sont décrites dans les Collections (section \begin_inset space ~ \end_inset @@ -13074,19 +13073,14 @@ nolink "false" \end_layout \begin_layout Itemize - -\lang english -For -\family sans -Japanese Report (Standard Class, - vertical Writing) -\family default - and +pour \family sans -Japanese Report (Standard Class) +Rapport japonais (classe standard, + écriture verticale), + Rapport japonais (classe standard) \family default -, - see section + et les autres classes pour le japonais, + voir la section \begin_inset space ~ \end_inset @@ -13103,20 +13097,21 @@ nolink "false" \begin_layout Itemize -\lang english -For \family sans -KOMA-Script Report +pour Report KOMA-Script \family default , - see section + voir la section \begin_inset space ~ \end_inset \begin_inset CommandInset ref LatexCommand ref -reference "subsec:KOMA-Script" +reference "subsec:Koma-Script" +plural "false" +caps "false" +noprefix "false" nolink "false" \end_inset @@ -13125,14 +13120,12 @@ nolink "false" \end_layout \begin_layout Itemize - -\lang english -For +pour \family sans -Report (Standard Class with Extra Font Sizes) +Report (classe standard avec tailles de police supplémentaires) \family default , - see section + voir la section \begin_inset space ~ \end_inset @@ -13147,22 +13140,20 @@ nolink "false" . \end_layout -\begin_layout Subsection - -\lang english -For +\begin_layout Itemize +pour \family sans -Polish Report (MW Bundle) +Rapport polonais (paquet MW) \family default , - see section + voir la section \begin_inset space ~ \end_inset \begin_inset CommandInset ref LatexCommand ref -reference "subsec:Polish-M.W.collection" +reference "subsec:Collection-plonaise-M.W." plural "false" caps "false" noprefix "false" @@ -13178,18 +13169,16 @@ Scripts \end_layout \begin_layout Standard - -\lang english -In the +Dans la catégorie \family sans Scripts \family default - category, - we assemble document classes that help to write drama or movie scripts. - The category is also open for other scripts, - such as lecture scripts, - for which no classes are officially supported yet by \SpecialChar LyX - though. +, + nous rassemblons les classes de documents permettant d'écrire des pièces de théâtre ou des scénarios de films. + Cette catégorie est également ouverte pour d'autres scripts, + comme des scripts de cours, + pour lesquels aucune classe n'est encore reconnue par \SpecialChar LyX + cependant. \end_layout \begin_layout Subsection -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX features/biginset] Cmake build: Adapt for branch 2.4
commit b8b9e8ec1402341229aade4b4a975b54c3ef80c9 Author: Kornel Benko Date: Tue Apr 2 10:46:20 2024 +0200 Cmake build: Adapt for branch 2.4 --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 86226dc8e8..f473ee4bc5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -664,9 +664,9 @@ set(min_qt5_version "5.6") if(LYX_USE_QT MATCHES "AUTO") # try qt6 first find_package(Qt6Core CONFIG QUIET) - if (Qt6Core_Found) + if (Qt6Core_FOUND) set(LYX_USE_QT "QT6" CACHE STRING "Valid qt version" FORCE) - message(STATUS "Qt5Core_VERSION = ${Qt5Core_VERSION}") + message(STATUS "Qt6Core_VERSION = ${Qt6Core_VERSION}") else() find_package(Qt5Core CONFIG QUIET) if(Qt5Core_FOUND) -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX features/biginset] Update sk.po
commit 6ad572a3a2cb6937a2e4eef78eada2495523d2a4 Author: Kornel Benko Date: Tue Apr 2 11:35:56 2024 +0200 Update sk.po --- po/sk.po | 15 +++ 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/po/sk.po b/po/sk.po index e4fac1562a..b848decde2 100644 --- a/po/sk.po +++ b/po/sk.po @@ -8,8 +8,8 @@ msgid "" msgstr "" "Project-Id-Version: LyX-2.4\n" "Report-Msgid-Bugs-To: lyx-de...@lists.lyx.org\n" -"POT-Creation-Date: 2024-03-07 11:49+0100\n" -"PO-Revision-Date: 2024-03-07 10:52+\n" +"POT-Creation-Date: 2024-04-02 09:51+0200\n" +"PO-Revision-Date: 2024-04-02 09:29+\n" "Last-Translator: Kornel Benko \n" "Language-Team: Slovak \n" "Language: sk\n" @@ -21742,8 +21742,12 @@ msgid "End of Sentence|E" msgstr "Koniec vety|K" #: lib/ui/stdmenus.inc:418 -msgid "Plain Quotation Mark|Q" -msgstr "Prosté úvodzovky|P" +msgid "Plain Double Quotation Mark|Q" +msgstr "Prostá dvojitá úvodzovka|P" + +#: lib/ui/stdmenus.inc:419 +msgid "Plain Single Quotation Mark|S" +msgstr "Jednoduchá úvodzovka|J" #: lib/ui/stdmenus.inc:419 msgid "Inner Quotation Mark|n" @@ -44189,3 +44193,6 @@ msgstr "Neznámy používateľ" #~ msgid "No, Changes" #~ msgstr "Nie, zmeny ť" + +#~ msgid "Plain Quotation Mark|Q" +#~ msgstr "Prosté úvodzovky|P" -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX features/biginset] de/UserGuide: update
commit 0b8e8eb1740f6db4f81772fd39dff8f80243dd5d Author: Juergen Spitzmueller Date: Tue Apr 2 09:32:02 2024 +0200 de/UserGuide: update --- lib/doc/de/UserGuide.lyx | 13 +++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/doc/de/UserGuide.lyx b/lib/doc/de/UserGuide.lyx index d0d819de8c..30366aa07f 100644 --- a/lib/doc/de/UserGuide.lyx +++ b/lib/doc/de/UserGuide.lyx @@ -43830,11 +43830,11 @@ Sprache \end_layout \begin_layout Description -Einfaches +Inneres \begin_inset space ~ \end_inset -Anführungszeichen Fügt ein einfaches Anführungszeichen im Anführungszeichenstil ein, +Anführungszeichen Fügt ein inneres Anführungszeichen im Anführungszeichenstil ein, der im Dialog \family sans Dokument\SpecialChar menuseparator @@ -43842,6 +43842,15 @@ Einstellungen\SpecialChar menuseparator Sprache \family default eingestellt ist. + Meist sind dies +\begin_inset Quotes gls +\end_inset + +einfache +\begin_inset Quotes grs +\end_inset + + Anführungszeichen. \end_layout \begin_layout Description -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX features/biginset] cmake build with qt6 (macos) did not include "plugins"
commit 4d02fb7ad7a846bebfd8ba5fd37a5453482e768d Author: P. De Visschere Date: Sun Dec 31 15:30:12 2023 +0100 cmake build with qt6 (macos) did not include "plugins" --- development/cmake/post_install/CMakeLists.txt | 5 + 1 file changed, 5 insertions(+) diff --git a/development/cmake/post_install/CMakeLists.txt b/development/cmake/post_install/CMakeLists.txt index f39bb5a763..56c552e4d0 100644 --- a/development/cmake/post_install/CMakeLists.txt +++ b/development/cmake/post_install/CMakeLists.txt @@ -48,6 +48,11 @@ if(LYX_BUNDLE) install_qt_plugin("${QtScope}::QCocoaIntegrationPlugin") endif() +if (APPLE AND LYX_USE_QT MATCHES "QT6") + # With QT6, just copy all the plugins + file(GLOB QT_PLUGIN_DIRECTORIES "${QT_PLUGINS_DIR}/*") + install(DIRECTORY ${QT_PLUGIN_DIRECTORIES} DESTINATION "${qtplugin_dest_dir}/plugins/" COMPONENT Runtime) +endif() # Install code does the following: # - Creates the qt.conf file # - install the platform specific plugins (with Qt5) -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX features/biginset] Cmake build: Handle deprecated cmake versions
commit 8d79860ea76da4d9c0b87fce86526da15b686ab9 Author: Kornel Benko Date: Sun Dec 31 15:18:11 2023 +0100 Cmake build: Handle deprecated cmake versions The warning says: CMake Deprecation Warning at .../CMakeLists.txt:1 (cmake_minimum_required): Compatibility with CMake < 3.5 will be removed from a future version of CMake. Spotted by Scott Kostyshak --- 3rdparty/dtl/CMakeLists.txt| 2 +- 3rdparty/hunspell/CMakeLists.txt | 2 +- 3rdparty/libiconv/CMakeLists.txt | 2 +- 3rdparty/mythes/CMakeLists.txt | 2 +- 3rdparty/zlib/CMakeLists.txt | 2 +- CMakeLists.txt | 4 ++-- development/Win32/vld/cmake/CMakeLists.txt | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/3rdparty/dtl/CMakeLists.txt b/3rdparty/dtl/CMakeLists.txt index f757b26b17..20df178997 100644 --- a/3rdparty/dtl/CMakeLists.txt +++ b/3rdparty/dtl/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.5.0) set(LYX_IPO_SUPPORTED FALSE) if (POLICY CMP0069) diff --git a/3rdparty/hunspell/CMakeLists.txt b/3rdparty/hunspell/CMakeLists.txt index 389524b0d8..00b36491b1 100644 --- a/3rdparty/hunspell/CMakeLists.txt +++ b/3rdparty/hunspell/CMakeLists.txt @@ -1,5 +1,5 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.5.0) set(LYX_IPO_SUPPORTED FALSE) if (POLICY CMP0069) diff --git a/3rdparty/libiconv/CMakeLists.txt b/3rdparty/libiconv/CMakeLists.txt index 12d5446a12..cb921d071d 100644 --- a/3rdparty/libiconv/CMakeLists.txt +++ b/3rdparty/libiconv/CMakeLists.txt @@ -5,7 +5,7 @@ # Please note that the package source code is licensed under its own license. project ( libiconv C ) -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.5.0) set(LYX_IPO_SUPPORTED FALSE) if (POLICY CMP0069) diff --git a/3rdparty/mythes/CMakeLists.txt b/3rdparty/mythes/CMakeLists.txt index 869bee7c93..251d4ffc93 100644 --- a/3rdparty/mythes/CMakeLists.txt +++ b/3rdparty/mythes/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.5.0) set(LYX_IPO_SUPPORTED FALSE) if (POLICY CMP0069) diff --git a/3rdparty/zlib/CMakeLists.txt b/3rdparty/zlib/CMakeLists.txt index e81e43af1c..0b539a58b0 100644 --- a/3rdparty/zlib/CMakeLists.txt +++ b/3rdparty/zlib/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.1) +cmake_minimum_required(VERSION 3.5.0) set(LYX_IPO_SUPPORTED FALSE) if (POLICY CMP0069) diff --git a/CMakeLists.txt b/CMakeLists.txt index 38e11b8a0b..86226dc8e8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,9 +2,9 @@ # Licence details can be found in the file COPYING. # # Copyright (c) 2006-2011 Peter Kümmel, -# Copyright (c) 2008-2020 Kornel Benko, +# Copyright (c) 2008-2024 Kornel Benko, -cmake_minimum_required(VERSION 3.1.0) +cmake_minimum_required(VERSION 3.5.0) set(LYX_PROJECT LyX) # Instruct cmake to not use gnu extensions, diff --git a/development/Win32/vld/cmake/CMakeLists.txt b/development/Win32/vld/cmake/CMakeLists.txt index b197151895..5ccbe1572c 100644 --- a/development/Win32/vld/cmake/CMakeLists.txt +++ b/development/Win32/vld/cmake/CMakeLists.txt @@ -22,7 +22,7 @@ #// # -cmake_minimum_required(VERSION 2.6.4) +cmake_minimum_required(VERSION 3.5.0) project(vld) -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX features/biginset] FindAdv: no paragraph indentation for more space in the search string
commit 638c04dd6aab3e16063a03183e25491f83780b68 Author: Daniel Ramoeller Date: Sun Dec 31 14:36:01 2023 +0100 FindAdv: no paragraph indentation for more space in the search string See #11555 --- src/frontends/qt/FindAndReplace.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/frontends/qt/FindAndReplace.cpp b/src/frontends/qt/FindAndReplace.cpp index 8c8ad115bd..b53c520974 100644 --- a/src/frontends/qt/FindAndReplace.cpp +++ b/src/frontends/qt/FindAndReplace.cpp @@ -630,6 +630,9 @@ void FindAndReplaceWidget::showEvent(QShowEvent * /* ev */) copy_params(*bv, find_work_area_->bufferView()); copy_params(*bv, replace_work_area_->bufferView()); } + // no paragraph indentation for more space + find_work_area_->bufferView().buffer().params().setParIndent(Length(0, Length::IN)); + replace_work_area_->bufferView().buffer().params().setParIndent(Length(0, Length::IN)); find_work_area_->installEventFilter(this); replace_work_area_->installEventFilter(this); -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX features/biginset] FindAdv: Handle neg-spaces like normal space if searching without format
commit 07cacef398d6d748e30d70fa6f06821e82ac4e4e Author: Kornel Benko Date: Sun Dec 31 14:27:40 2023 +0100 FindAdv: Handle neg-spaces like normal space if searching without format --- src/insets/InsetSpace.cpp | 7 ++- src/insets/InsetSpace.h | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/insets/InsetSpace.cpp b/src/insets/InsetSpace.cpp index 53fda518da..8ad6f7f5e0 100644 --- a/src/insets/InsetSpace.cpp +++ b/src/insets/InsetSpace.cpp @@ -773,7 +773,12 @@ int InsetSpace::plaintext(odocstringstream & os, case InsetSpaceParams::NEGTHIN: case InsetSpaceParams::NEGMEDIUM: case InsetSpaceParams::NEGTHICK: - return 0; + if (rp.find_effective()) { + os << ' '; + return 1; + } + else + return 0; default: os << ' '; return 1; diff --git a/src/insets/InsetSpace.h b/src/insets/InsetSpace.h index 04edaed2c4..ceca1cfa06 100644 --- a/src/insets/InsetSpace.h +++ b/src/insets/InsetSpace.h @@ -136,7 +136,7 @@ public: /// void validate(LaTeXFeatures & features) const override; /// - bool findUsesToString() const override { return true; } + bool findUsesToString() const override { return false; } /// void toString(odocstream &) const override; /// -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX features/biginset] Rename hasToString() to findUsesToString()
commit 8de81e8dc1cf344a9a245868aaff2c31dd0c9ce4 Author: Kornel Benko Date: Sun Dec 31 14:09:17 2023 +0100 Rename hasToString() to findUsesToString() There are special cases where the toString() exist, but still plaintext() is not to be used by find. --- src/Paragraph.cpp | 2 +- src/insets/Inset.h| 2 +- src/insets/InsetBranch.h | 2 +- src/insets/InsetCitation.h| 2 +- src/insets/InsetCounter.h | 2 +- src/insets/InsetHyperlink.h | 2 +- src/insets/InsetIPAMacro.h| 2 +- src/insets/InsetQuotes.h | 2 +- src/insets/InsetRef.h | 2 +- src/insets/InsetSpace.h | 2 +- src/insets/InsetSpecialChar.h | 2 +- src/insets/InsetText.h| 2 +- 12 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp index 49713a8b9a..4282defa4a 100644 --- a/src/Paragraph.cpp +++ b/src/Paragraph.cpp @@ -4425,7 +4425,7 @@ docstring Paragraph::asString(pos_type beg, pos_type end, int options, const Out else if (c == META_INSET && (options & AS_STR_INSETS)) { if (c == META_INSET && (options & AS_STR_PLAINTEXT)) { LASSERT(runparams != nullptr, return docstring()); - if (runparams->find_effective() && getInset(i)->hasToString()) + if (runparams->find_effective() && getInset(i)->findUsesToString()) getInset(i)->toString(os); else getInset(i)->plaintext(os, *runparams); diff --git a/src/insets/Inset.h b/src/insets/Inset.h index d2b407675b..2fa3e26234 100644 --- a/src/insets/Inset.h +++ b/src/insets/Inset.h @@ -350,7 +350,7 @@ public: virtual docstring xhtml(XMLStream &, OutputParams const &) const; /// - virtual bool hasToString() const { return false; } + virtual bool findUsesToString() const { return false; } /// Writes a string representation of the inset to the odocstream. /// This one should be called when you want the whole contents of /// the inset. diff --git a/src/insets/InsetBranch.h b/src/insets/InsetBranch.h index e2b2958f18..5098e70afb 100644 --- a/src/insets/InsetBranch.h +++ b/src/insets/InsetBranch.h @@ -80,7 +80,7 @@ private: /// docstring xhtml(XMLStream &, OutputParams const &) const override; /// - bool hasToString() const override { return true; } + bool findUsesToString() const override { return true; } /// void toString(odocstream &) const override; /// diff --git a/src/insets/InsetCitation.h b/src/insets/InsetCitation.h index 56ad45a9b6..b1b27e0291 100644 --- a/src/insets/InsetCitation.h +++ b/src/insets/InsetCitation.h @@ -62,7 +62,7 @@ public: /// docstring xhtml(XMLStream &, OutputParams const &) const override; /// - bool hasToString() const override { return true; } + bool findUsesToString() const override { return true; } /// void toString(odocstream &) const override; /// diff --git a/src/insets/InsetCounter.h b/src/insets/InsetCounter.h index eb6338dde2..65a38ab325 100644 --- a/src/insets/InsetCounter.h +++ b/src/insets/InsetCounter.h @@ -43,7 +43,7 @@ public: /// docstring xhtml(XMLStream &, OutputParams const &) const override; /// - bool hasToString() const override { return true; } + bool findUsesToString() const override { return true; } /// void toString(odocstream &) const override; /// diff --git a/src/insets/InsetHyperlink.h b/src/insets/InsetHyperlink.h index 59615b0d5b..36bd249902 100644 --- a/src/insets/InsetHyperlink.h +++ b/src/insets/InsetHyperlink.h @@ -34,7 +34,7 @@ public: /// bool isInToc() const override { return true; } /// - bool hasToString() const override { return true; } + bool findUsesToString() const override { return true; } /// void toString(odocstream &) const override; /// diff --git a/src/insets/InsetIPAMacro.h b/src/insets/InsetIPAMacro.h index 5855da9e95..dc1977f977 100644 --- a/src/insets/InsetIPAMacro.h +++ b/src/insets/InsetIPAMacro.h @@ -154,7 +154,7 @@ public: /// docstring xhtml(XMLStream &, OutputParams const &) const override; /// - bool hasToString() const override { return true; } + bool findUsesToString() const override { return true; } /// void toString(odocstream &) const override; /// diff --git a/src/insets/InsetQuotes.h b/src/insets/InsetQuotes.h index 5e6cb3c4aa..2eeb5fa866 100644 --- a/src/insets/InsetQuotes.h +++ b/src/insets/InsetQuotes.h @@ -157,7 +157,7 @@ public: docstring xhtml(XMLStream &, OutputParams const &) const override; /// - bool hasToString() const override { return true; } + bool
[LyX features/biginset] Fix duplicate accelerator
commit 1198bbf01aa0f57db210cbe2e692d3aaf5b843bb Author: Richard Kimberly Heck Date: Mon Apr 1 21:54:44 2024 -0400 Fix duplicate accelerator --- lib/ui/stdmenus.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ui/stdmenus.inc b/lib/ui/stdmenus.inc index 6ef3357f72..7d7750cc03 100644 --- a/lib/ui/stdmenus.inc +++ b/lib/ui/stdmenus.inc @@ -416,7 +416,7 @@ Menuset Item "Ellipsis|i" "specialchar-insert dots" Item "End of Sentence|E" "specialchar-insert end-of-sentence" Item "Plain Double Quotation Mark|Q" "quote-insert outer auto plain" - Item "Plain Single Quotation Mark|Q" "quote-insert inner auto plain" + Item "Plain Single Quotation Mark|S" "quote-insert inner auto plain" Item "Inner Quotation Mark|n" "quote-insert inner" Item "Non-Breaking Hyphen|y" "specialchar-insert nobreakdash" Item "Breakable Slash|a" "specialchar-insert slash" -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX features/biginset] de.po
commit 645ab7fa730768995f7d1f55f0aa33182d07fdc4 Author: Juergen Spitzmueller Date: Tue Apr 2 08:23:42 2024 +0200 de.po po/de.po | 1054 +++--- 1 file changed, 529 insertions(+), 525 deletions(-) -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX features/biginset] Fix label escaping in InsetMathRef (#12980)
commit 98080ca0d548b754433a99f9f097054134117184 Author: Juergen Spitzmueller Date: Tue Apr 2 08:15:53 2024 +0200 Fix label escaping in InsetMathRef (#12980) This was completely broken: the IDs have been escaped in the LyX file (which they absolutely shouldn't) but not in all LaTeX output (which they should). --- src/insets/InsetCommandParams.cpp | 9 ++--- src/insets/InsetCommandParams.h | 2 +- src/mathed/InsetMathRef.cpp | 22 -- src/mathed/MathExtern.cpp | 15 ++- src/mathed/MathFactory.cpp| 2 +- 5 files changed, 30 insertions(+), 20 deletions(-) diff --git a/src/insets/InsetCommandParams.cpp b/src/insets/InsetCommandParams.cpp index 034f9d59c8..9c3552a4b7 100644 --- a/src/insets/InsetCommandParams.cpp +++ b/src/insets/InsetCommandParams.cpp @@ -569,7 +569,7 @@ docstring InsetCommandParams::prepareCommand(OutputParams const & runparams, } -docstring InsetCommandParams::getCommand(OutputParams const & runparams, bool starred) const +docstring InsetCommandParams::getCommand(OutputParams const & runparams, bool starred, bool unhandled) const { docstring s = '\\' + from_ascii(cmdName_); if (starred) @@ -579,20 +579,23 @@ docstring InsetCommandParams::getCommand(OutputParams const & runparams, bool st ParamInfo::const_iterator end = info_.end(); for (; it != end; ++it) { std::string const & name = it->name(); + ParamInfo::ParamHandling handling = unhandled ? + ParamInfo::HANDLING_NONE + : it->handling(); switch (it->type()) { case ParamInfo::LYX_INTERNAL: break; case ParamInfo::LATEX_REQUIRED: { docstring const data = - prepareCommand(runparams, (*this)[name], it->handling()); + prepareCommand(runparams, (*this)[name], handling); s += '{' + data + '}'; noparam = false; break; } case ParamInfo::LATEX_OPTIONAL: { docstring data = - prepareCommand(runparams, (*this)[name], it->handling()); + prepareCommand(runparams, (*this)[name], handling); if (!data.empty()) { s += '[' + protectArgument(data) + ']'; noparam = false; diff --git a/src/insets/InsetCommandParams.h b/src/insets/InsetCommandParams.h index 134b46a604..f05fb61ddc 100644 --- a/src/insets/InsetCommandParams.h +++ b/src/insets/InsetCommandParams.h @@ -136,7 +136,7 @@ public: /// void Write(std::ostream & os, Buffer const * buf) const; /// Build the complete LaTeX command - docstring getCommand(OutputParams const &, bool starred = false) const; + docstring getCommand(OutputParams const &, bool starred = false, bool unhandled = false) const; /// Return the command name std::string const & getCmdName() const { return cmdName_; } /// Set the name to \p n. This must be a known name. All parameters diff --git a/src/mathed/InsetMathRef.cpp b/src/mathed/InsetMathRef.cpp index ad2e499167..082a341cf4 100644 --- a/src/mathed/InsetMathRef.cpp +++ b/src/mathed/InsetMathRef.cpp @@ -76,7 +76,7 @@ void InsetMathRef::doDispatch(Cursor & cur, FuncRequest & cmd) switch (cmd.action()) { case LFUN_INSET_MODIFY: { string const arg0 = cmd.getArg(0); - string const arg1 = cmd.getArg(1); + string const arg1 = cmd.getArg(1); if (arg0 == "ref") { if (arg1 == "changetarget") { string const oldtarget = cmd.getArg(2); @@ -295,25 +295,27 @@ void InsetMathRef::write(TeXMathStream & os) const LYXERR0("Unassigned buffer_ in InsetMathRef::write!"); LYXERR0("LaTeX output may be wrong!"); } + // are we writing to the LyX file? + if (!os.latex()) { + // if so, then this is easy + InsetMathCommand::write(os); + return; + } bool const use_refstyle = buffer_ && buffer().params().use_refstyle; bool special_case = cmd == "formatted" || cmd == "labelonly" || (cmd == "eqref" && use_refstyle); - // are we writing to the LyX file or not in a special case? - if (!os.latex() || !special_case) { - // if so, then this is easy - InsetMathCommand::write(os); - return; - } // we need to translate 'formatted' to prettyref or refstyle-type // commands and just output the label with labelonly
[LyX features/biginset] Add shortcut for plain single quote.
commit e51cca2ef0467608f9d9e7a010080f1c1a04b946 Author: Richard Kimberly Heck Date: Mon Apr 1 17:26:29 2024 -0400 Add shortcut for plain single quote. (cherry picked from commit d3101e6d6f325c4597ec0945fecb03fee745c56e) --- lib/bind/cua.bind | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/bind/cua.bind b/lib/bind/cua.bind index 2cee7ed28f..c99a0c8da8 100644 --- a/lib/bind/cua.bind +++ b/lib/bind/cua.bind @@ -93,6 +93,7 @@ Format 5 \bind "C-S-E" "changes-track" # it's what MS Word uses \bind "~S-M-quotedbl" "quote-insert inner" \bind "~S-C-quotedbl" "quote-insert outer auto plain" +\bind "~S-C-apostrophe""quote-insert inner auto plain" \bind "M-minus""specialchar-insert hyphenation" \bind "C-S-underscore" "math-macro-fold" \bind "C-M-minus" "specialchar-insert nobreakdash" -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX features/biginset] Clarify quote-insert LFUN.
commit b0c4681cd8f4dedb975aac80dcb717c40aa8 Author: Richard Kimberly Heck Date: Mon Apr 1 17:26:01 2024 -0400 Clarify quote-insert LFUN. And add remark about multiple optional arguments. (cherry picked from commit 29be057a073fde4e36c9adbf31c6cd764f62bda2) lib/doc/LFUNs.lyx | 2472 +++-- 1 file changed, 1818 insertions(+), 654 deletions(-) -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX features/biginset] Fix bug #13025.
commit dff3a0c53fef56b94fb90a7dc9c9c6a2e6591e9e Author: Richard Kimberly Heck Date: Mon Apr 1 17:25:40 2024 -0400 Fix bug #13025. Add plain single quote to menu. (cherry picked from commit 9e5a98e8f92f773e11815631961997b8045d20b1) --- lib/ui/stdmenus.inc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ui/stdmenus.inc b/lib/ui/stdmenus.inc index 93db305124..6ef3357f72 100644 --- a/lib/ui/stdmenus.inc +++ b/lib/ui/stdmenus.inc @@ -415,7 +415,8 @@ Menuset Item "Symbols...|b" "dialog-show symbols" Item "Ellipsis|i" "specialchar-insert dots" Item "End of Sentence|E" "specialchar-insert end-of-sentence" - Item "Plain Quotation Mark|Q" "quote-insert outer auto plain" + Item "Plain Double Quotation Mark|Q" "quote-insert outer auto plain" + Item "Plain Single Quotation Mark|Q" "quote-insert inner auto plain" Item "Inner Quotation Mark|n" "quote-insert inner" Item "Non-Breaking Hyphen|y" "specialchar-insert nobreakdash" Item "Breakable Slash|a" "specialchar-insert slash" -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX features/biginset] Restore Chapter 11
commit 55330a784455e0baa6fca36f0bfd736f03b58601 Author: jpc Date: Sat Mar 30 17:38:18 2024 +0100 Restore Chapter 11 --- lib/doc/Additional.lyx | 6 +- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/doc/Additional.lyx b/lib/doc/Additional.lyx index 46abf3d7d3..1c4fb906d4 100644 --- a/lib/doc/Additional.lyx +++ b/lib/doc/Additional.lyx @@ -25944,7 +25944,11 @@ Forward search works both with DVI and PDF output. \end_inset e., - which format is already there in the temporary directory) and chooses the appropriate configuration for the respective format.\SpecialChar LyX + which format is already there in the temporary directory) and chooses the appropriate configuration for the respective format. +\end_layout + +\begin_layout Chapter +\SpecialChar LyX Features needing Extra Software \end_layout -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX features/biginset] Open for 2.5 development
commit 6b1c5eb51b5410998a8d0a132714e11220f5 Author: Richard Kimberly Heck Date: Mon Apr 1 16:19:22 2024 -0400 Open for 2.5 development --- configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 8c4f1bfbe1..442a8a05d9 100644 --- a/configure.ac +++ b/configure.ac @@ -1,9 +1,9 @@ dnl Process with autoconf to generate configure script -*- sh -*- -AC_INIT([LyX],[2.4.0~devel],[lyx-de...@lists.lyx.org],[lyx]) +AC_INIT([LyX],[2.5.0~devel],[lyx-de...@lists.lyx.org],[lyx]) AC_PRESERVE_HELP_ORDER # Use ISO format only. The frontend needs to parse this -AC_SUBST(LYX_DATE, ["2024-02-09"]) +AC_SUBST(LYX_DATE, ["2024-04-01"]) AC_PREREQ([2.65]) AC_CONFIG_SRCDIR(src/main.cpp) AC_CONFIG_HEADERS([config.h]) -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX features/biginset] Fix backslash LaTeXifying in InsetCommand
commit a020bbc4a8143cff34e80442caf71d3b2ff8ccd3 Author: Juergen Spitzmueller Date: Mon Apr 1 10:57:27 2024 +0200 Fix backslash LaTeXifying in InsetCommand \ was transformed very early to \textbackslash{}, but then the following routines escaped braces in the string, so we wrongly ended up in \textbackslash\{\} and "\{} in the output --- src/insets/InsetCommandParams.cpp | 18 +- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/insets/InsetCommandParams.cpp b/src/insets/InsetCommandParams.cpp index 94b9a2c8a2..034f9d59c8 100644 --- a/src/insets/InsetCommandParams.cpp +++ b/src/insets/InsetCommandParams.cpp @@ -455,7 +455,21 @@ docstring InsetCommandParams::prepareCommand(OutputParams const & runparams, // LATEXIFY, ESCAPE and NONE are mutually exclusive if (handling & ParamInfo::HANDLING_LATEXIFY) { // First handle backslash - result = subst(command, from_ascii("\\"), from_ascii("\\textbackslash{}")); + // we cannot replace yet with \textbackslash{} + // as the braces would be erroneously escaped + // in the following routines ("\textbackslash\{\}"). + // So create a unique placeholder which is replaced + // in the end. + docstring bs = from_ascii("@LyXBackslash@"); + // We are super-careful and assure the placeholder + // does not exist in the string + for (int i = 0; ; ++i) { + if (!contains(command, bs)) { + result = subst(command, from_ascii("\\"), bs); + break; + } + bs = from_ascii("@LyXBackslash") + i + '@'; + } // Then get LaTeX macros pair command_latexed = runparams.encoding->latexString(result, runparams.dryrun); @@ -493,6 +507,8 @@ docstring InsetCommandParams::prepareCommand(OutputParams const & runparams, result.replace(pos, 1, backslash + chars_escape[k] + term); } } + // set in real backslash now + result = subst(result, bs, from_ascii("\\textbackslash{}")); } else if (handling & ParamInfo::HANDLING_ESCAPE) result = escape(command); -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX features/biginset] Fix context menu of InsetMathRef
commit 31ec96e01ff0acca660cc91df1e3e6590d8aa649 Author: Juergen Spitzmueller Date: Mon Apr 1 17:59:56 2024 +0200 Fix context menu of InsetMathRef --- src/mathed/InsetMathRef.cpp | 4 1 file changed, 4 insertions(+) diff --git a/src/mathed/InsetMathRef.cpp b/src/mathed/InsetMathRef.cpp index b70b7eae5e..ad2e499167 100644 --- a/src/mathed/InsetMathRef.cpp +++ b/src/mathed/InsetMathRef.cpp @@ -164,6 +164,10 @@ bool InsetMathRef::getStatus(Cursor & cur, FuncRequest const & cmd, switch (cmd.action()) { // we handle these case LFUN_INSET_MODIFY: + if (cmd.getArg(0) == "changetype") + status.setOnOff(from_ascii(cmd.getArg(1)) == commandname()); + status.setEnabled(true); + return true; case LFUN_INSET_DIALOG_UPDATE: case LFUN_INSET_SETTINGS: case LFUN_MOUSE_RELEASE: -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX features/biginset] Further translations of the French Additional manual
commit 571babff5e20a94a4e5979da53783461ef520508 Author: jpc Date: Fri Mar 29 18:58:25 2024 +0100 Further translations of the French Additional manual --- lib/doc/fr/Additional.lyx | 658 -- 1 file changed, 163 insertions(+), 495 deletions(-) diff --git a/lib/doc/fr/Additional.lyx b/lib/doc/fr/Additional.lyx index 3b13a2e3ce..ba756a6839 100644 --- a/lib/doc/fr/Additional.lyx +++ b/lib/doc/fr/Additional.lyx @@ -18603,8 +18603,8 @@ Format du texte Document sur deux colonnes \family default . - Pour tous les aures cas, - utisez la fonctionnalité décrite ici. + Pour tous les autres cas, + utilisez la fonctionnalité décrite ici. \end_layout \begin_layout Standard @@ -21640,7 +21640,7 @@ indispensable Bib\SpecialChar TeX ne vous permet pas lui-même de faire cela. La bonne nouvelle : - Avec l'aide de quelques paquetages \SpecialChar LaTeX + avec l'aide de quelques paquetages \SpecialChar LaTeX , on peut étendre Bib\SpecialChar TeX pour satisfaire vos besoins historiques. @@ -21830,15 +21830,9 @@ Biblatex \family default , l'option -\begin_inset Flex Noun -status collapsed - -\begin_layout Plain Layout -Bbibliographie subdivisée -\end_layout - -\end_inset - +\family sans +Bibliographie subdivisée +\family default est désactivée si vous utilisez \family sans Biblatex @@ -21873,25 +21867,13 @@ keyword=monMotClé \end_inset au champ -\begin_inset Flex Noun -status collapsed - -\begin_layout Plain Layout +\family sans Options -\end_layout - -\end_inset - +\family default de la fenêtre de dialogue qui apparaît si vous faites un clic gauche sur le bouton -\begin_inset Flex Noun -status collapsed - -\begin_layout Plain Layout +\family sans Bibliographie Biblatex -\end_layout - -\end_inset - +\family default ); soit filtrer par type d'entrée (comme book ou article) en saisissant par exemple \begin_inset Flex Code @@ -21914,15 +21896,9 @@ nottype=collection \end_inset au champ -\begin_inset Flex Noun -status collapsed - -\begin_layout Plain Layout +\family sans Options -\end_layout - -\end_inset - +\family default mentionné ci-dessus; soit créer des \begin_inset Quotes cld @@ -21934,7 +21910,7 @@ catégories bibliographiques auxquelles vous pouvez affecter des entrées bibliographiques individuelles. Voyez le manuel Biblatex, - subsection + sous-section \emph on Subdivided Bibliographies \emph default @@ -21967,17 +21943,11 @@ Les bibliographies multiples, . Pour les activer, allez à -\begin_inset Flex Noun -status collapsed - -\begin_layout Plain Layout +\family sans Document\SpecialChar menuseparator Paramètres\SpecialChar menuseparator Bibliographie -\end_layout - -\end_inset - +\family default et sélectionnez le sectionnement requis (e.g. \begin_inset Quotes cld @@ -21988,15 +21958,9 @@ par section \end_inset ) dans le sous-menu -\begin_inset Flex Noun -status collapsed - -\begin_layout Plain Layout +\family sans Bibliographies multiples -\end_layout - -\end_inset - +\family default . Puis ajoutez une bibliographie Bib(la)\SpecialChar TeX à chaque élément (e. @@ -22050,15 +22014,13 @@ ne pas \emph default -\begin_inset Flex Noun -status collapsed - -\begin_layout Plain Layout -Bibliographie subdivisée -\end_layout - -\end_inset - +\family sans +Bibliographie +\family default + +\family sans +subdivisée +\family default . Dans tous les autres cas, c'est @@ -22455,16 +22417,14 @@ La fenêtre vous présente un tableau avec des formes de puces. \begin_layout Standard -\lang english -If you select \family sans -Custom bullet +Si vous sélectionnez Puce personnalisée \family default , - a text entry under the table will be activated in which you can enter a bullet shape's \SpecialChar LaTeX - equivalent. - If you do modify the text you will also need to specify any needed packages in the \SpecialChar LaTeX - preamble. + une zone de texte sera activée au-dessous du tableau dans laquelle vous pourrez saisir l'équivalent \SpecialChar LaTeX + d'une forme de puce. + Si vous modifiez le texte vous devrez également spécifier dans le préambule \SpecialChar LaTeX + les paquetages nécessaires. \end_layout \begin_layout Standard @@ -22734,7 +22694,7 @@ sharp \end_layout \begin_layout Itemize -Utilisez la commande \SpecialChar LaTeX +utiliser la commande \SpecialChar LaTeX \family typewriter @@ -22820,7 +22780,7 @@ star \end_inset - Agissez sur chaque entrée individuellement en écrivant le motif de la puce dans un insert + agir sur chaque entrée individuellement en écrivant le motif de la puce dans un insert \begin_inset Quotes cld \end_inset @@ -22986,7 +22946,7 @@ Les trois méthodes d'inclusion sont \family sans -inclus (include) +Inclus (include) \family default \begin_inset Quotes crd @@ -22999,7 +22959,7 @@ inclus (include) \family sans -incorporé (input) +Incorporé (input) \family default \begin_inset Quotes crd
[LyX features/biginset] Factor out shared method
commit 812e306dada7c5c0565c9428232f329ec4c705d3 Author: Juergen Spitzmueller Date: Sun Mar 31 12:40:27 2024 +0200 Factor out shared method Amends babb5b007bd --- src/BufferView.cpp | 19 +++ src/BufferView.h | 3 +++ src/frontends/qt/GuiSpellchecker.cpp | 29 ++--- src/lyxfind.cpp | 25 ++--- 4 files changed, 26 insertions(+), 50 deletions(-) diff --git a/src/BufferView.cpp b/src/BufferView.cpp index ad534eae28..39fffed68e 100644 --- a/src/BufferView.cpp +++ b/src/BufferView.cpp @@ -2993,6 +2993,25 @@ void BufferView::putSelectionAt(DocIterator const & cur, } +void BufferView::setSelection(DocIterator const & from, + DocIterator const & to) +{ + if (from.pit() != to.pit()) { + // there are multiple paragraphs in selection + cursor().setCursor(from); + cursor().clearSelection(); + cursor().selection(true); + cursor().setCursor(to); + cursor().selection(true); + } else { + // only single paragraph + int const size = to.pos() - from.pos(); + putSelectionAt(from, size, false); + } + processUpdateFlags(Update::Force | Update::FitCursor); +} + + bool BufferView::selectIfEmpty(DocIterator & cur) { if ((cur.inTexted() && !cur.paragraph().empty()) diff --git a/src/BufferView.h b/src/BufferView.h index d239fdd360..b46ade3df5 100644 --- a/src/BufferView.h +++ b/src/BufferView.h @@ -302,6 +302,9 @@ public: */ void putSelectionAt(DocIterator const & cur, int length, bool backwards); + /// set a selection between \p from and \p to + void setSelection(DocIterator const & from, +DocIterator const & to); /// selects the item at cursor if its paragraph is empty. bool selectIfEmpty(DocIterator & cur); diff --git a/src/frontends/qt/GuiSpellchecker.cpp b/src/frontends/qt/GuiSpellchecker.cpp index d58f435b10..66952eb7dc 100644 --- a/src/frontends/qt/GuiSpellchecker.cpp +++ b/src/frontends/qt/GuiSpellchecker.cpp @@ -72,8 +72,6 @@ struct SpellcheckerWidget::Private void check(); /// close the spell checker dialog void hide() const; - /// make/restore a selection between from and to - void setSelection(DocIterator const & from, DocIterator const & to) const; /// if no selection was checked: /// ask the user if the check should start over bool continueFromBeginning(); @@ -339,7 +337,7 @@ void SpellcheckerWidget::Private::hide() const if (isCurrentBuffer(bvcur)) { if (!begin_.empty() && !end_.empty()) { // restore previous selection - setSelection(begin_, end_); + bv->setSelection(begin_, end_); } else { // restore cursor position bvcur.setCursor(start_); @@ -349,29 +347,6 @@ void SpellcheckerWidget::Private::hide() const } } -void SpellcheckerWidget::Private::setSelection( - DocIterator const & from, DocIterator const & to) const -{ - BufferView * bv = gv_->documentBufferView(); - DocIterator end = to; - - if (from.pit() != end.pit()) { - // there are multiple paragraphs in selection - Cursor & bvcur = bv->cursor(); - bvcur.setCursor(from); - bvcur.clearSelection(); - bvcur.selection(true); - bvcur.setCursor(end); - bvcur.selection(true); - } else { - // FIXME LFUN - // If we used a LFUN, dispatch would do all of this for us - int const size = end.pos() - from.pos(); - bv->putSelectionAt(from, size, false); - } - bv->processUpdateFlags(Update::Force | Update::FitCursor); -} - void SpellcheckerWidget::Private::forward() { DocIterator const from = cursor(); @@ -632,7 +607,7 @@ void SpellcheckerWidget::Private::check() return; setLanguage(word_lang.lang()); // mark misspelled word - setSelection(from, to); + bv->setSelection(from, to); // enable relevant widgets updateView(); } diff --git a/src/lyxfind.cpp b/src/lyxfind.cpp index 6281b82abc..6e3b324bfa 100644 --- a/src/lyxfind.cpp +++ b/src/lyxfind.cpp @@ -281,27 +281,6 @@ bool searchAllowed(docstring const & str) return true; } -void setSelection(BufferView * bv, DocIterator const & from, DocIterator const & to) -{ - DocIterator end = to; - - if (from.pit() != end.pit()) { - // there are multiple paragraphs in selection - Cursor & bvcur = bv->cursor(); - bvcur.setCursor(from); - bvcur.clearSelection(); -
[LyX features/biginset] Fix crash with quick search starting with mathed selection
commit babb5b007bdb273c12255edf7c84a537327c0400 Author: Juergen Spitzmueller Date: Sat Mar 30 10:14:34 2024 +0100 Fix crash with quick search starting with mathed selection setCursorSelection does not work with math. Copy the method from spellchecker. --- src/lyxfind.cpp | 25 +++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/src/lyxfind.cpp b/src/lyxfind.cpp index edf21d4022..6281b82abc 100644 --- a/src/lyxfind.cpp +++ b/src/lyxfind.cpp @@ -281,6 +281,27 @@ bool searchAllowed(docstring const & str) return true; } +void setSelection(BufferView * bv, DocIterator const & from, DocIterator const & to) +{ + DocIterator end = to; + + if (from.pit() != end.pit()) { + // there are multiple paragraphs in selection + Cursor & bvcur = bv->cursor(); + bvcur.setCursor(from); + bvcur.clearSelection(); + bvcur.selection(true); + bvcur.setCursor(end); + bvcur.selection(true); + } else { + // FIXME LFUN + // If we used a LFUN, dispatch would do all of this for us + int const size = end.pos() - from.pos(); + bv->putSelectionAt(from, size, false); + } + bv->processUpdateFlags(Update::Force | Update::FitCursor); +} + } // namespace @@ -387,7 +408,7 @@ bool findOne(BufferView * bv, docstring const & searchstr, // restore original selection if (had_selection) { bv->cursor().resetAnchor(); - bv->setCursorSelectionTo(endcur); + setSelection(bv, startcur, endcur); } return false; } @@ -464,7 +485,7 @@ int replaceAll(BufferView * bv, if (had_selection) { endcur.fixIfBroken(); bv->cursor().resetAnchor(); - bv->setCursorSelectionTo(endcur); + setSelection(bv, startcur, endcur); } return num; -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX features/biginset] Further translations of French Additional manual + typo and ref. to Hebrew Letter in sec 3.5 of Additional.lyx
commit a9a328c85d17e211008ff2b9adae24bedc3f5e5b Author: jpc Date: Thu Mar 28 19:09:38 2024 +0100 Further translations of French Additional manual + typo and ref. to Hebrew Letter in sec 3.5 of Additional.lyx --- lib/doc/Additional.lyx| 33 ++- lib/doc/fr/Additional.lyx | 738 +- 2 files changed, 227 insertions(+), 544 deletions(-) diff --git a/lib/doc/Additional.lyx b/lib/doc/Additional.lyx index ac0060e99f..46abf3d7d3 100644 --- a/lib/doc/Additional.lyx +++ b/lib/doc/Additional.lyx @@ -3049,6 +3049,13 @@ Fonts \begin_layout Subsection Hebrew +\begin_inset CommandInset label +LatexCommand label +name "subsec:Hebrew" + +\end_inset + + \end_layout \begin_layout Standard @@ -8510,7 +8517,8 @@ nolink "false" \end_inset -) and +), + the \family sans Letter (Standard Class with Extra Font Sizes) \family default @@ -8526,6 +8534,25 @@ nolink "false" \end_inset +) and the +\family sans +Hebrew Letter +\family default + (section +\begin_inset space ~ +\end_inset + + +\begin_inset CommandInset ref +LatexCommand ref +reference "subsec:Hebrew" +plural "false" +caps "false" +noprefix "false" +nolink "false" + +\end_inset + ) document classes . \end_layout @@ -10874,7 +10901,7 @@ name "sec:slideQuirk" \end_layout \begin_layout Standard -All five of the new paragraph environments are somewhat quirky due to inherent limitiations in the current version of \SpecialChar LyX +All five of the new paragraph environments are somewhat quirky due to inherent limitations in the current version of \SpecialChar LyX . As I just mentioned, \SpecialChar LyX @@ -11672,7 +11699,7 @@ slides you'll need to use some inlined \SpecialChar LaTeX codes. \begin_inset Foot -status collapsed +status open \begin_layout Plain Layout The commands of interest are: diff --git a/lib/doc/fr/Additional.lyx b/lib/doc/fr/Additional.lyx index ef0d2ccef3..3b13a2e3ce 100644 --- a/lib/doc/fr/Additional.lyx +++ b/lib/doc/fr/Additional.lyx @@ -3420,6 +3420,13 @@ Polices \begin_layout Subsection Hébreu +\begin_inset CommandInset label +LatexCommand label +name "subsec:Hébreu" + +\end_inset + + \end_layout \begin_layout Standard @@ -9063,9 +9070,10 @@ nolink "false" \end_inset -) and +) \family sans -Letter (classe standard avec tailles de polices supplémentaires) +, + Letter (classe standard avec tailles de polices supplémentaires) \family default (section \begin_inset space ~ @@ -9079,7 +9087,26 @@ nolink "false" \end_inset -) . +) +\family sans + +\family default +et Lettre hébreu (section +\begin_inset space ~ +\end_inset + + +\begin_inset CommandInset ref +LatexCommand ref +reference "subsec:Hébreu" +plural "false" +caps "false" +noprefix "false" +nolink "false" + +\end_inset + +). \end_layout \begin_layout Subsection @@ -9246,7 +9273,7 @@ G-Brief (V. 2) \family default propose une aide à l'utilisation. - La documentation est disponible via + La documentation est disponible via \begin_inset CommandInset href LatexCommand href name "CTAN" @@ -9259,60 +9286,42 @@ literal "false" \end_layout \begin_layout Section - -\lang english Présentations \end_layout \begin_layout Subsection - -\lang english Beamer \end_layout \begin_layout Standard - -\lang english -The document class +La classe de documents \family sans Beamer \family default - uses the + utilise la classe \SpecialChar LaTeX + \family typewriter beamer.cls \family default - \SpecialChar LaTeX - class for creating presentations. - The file in the menu + pour créer des présentations. + \family sans -\bar under -F -\bar default -ile\SpecialChar menuseparator -New -\begin_inset space ~ -\end_inset +Fichier\SpecialChar menuseparator +Nouveau avec modèle\SpecialChar menuseparator +Présentations\SpecialChar menuseparator -fro \bar under -m -\bar default - -\begin_inset space ~ -\end_inset - -Template\SpecialChar menuseparator -Presentations\SpecialChar menuseparator Beamer \family default - or +\bar default + ou \family sans -Help\SpecialChar menuseparator -Specific Manuals\SpecialChar menuseparator -Beamer Presentations +Aide\SpecialChar menuseparator +Manuels spécifiques\SpecialChar menuseparator +Présentations Beamer Presentations \family default - offers guidance on its use. - The documentation is available from + proposent une aide à l'utilisation. + La documentation est disponible via \begin_inset CommandInset href LatexCommand href name "CTAN" @@ -9348,7 +9357,7 @@ Original par \noun on Allan Rae \noun default -: +; mis à jour par l'équipe \SpecialChar LyX . \end_layout @@ -9358,79 +9367,24 @@ Introduction \end_layout \begin_layout Standard -Cette section décrit comment utiliser \SpecialChar LyX - pour préparer des transparents pour rétroprojecteurs. - Il y a deux classes de document qui le permettent : - la classe par défaut -\family sans -slides -\family default - et la classe -\family sans -FoilTeX
[LyX features/biginset] Further translations of French Additional manual
commit 20c79dd472e2a0329d5c4aff1e6dd522b7eaed81 Author: jpc Date: Thu Mar 28 10:13:22 2024 +0100 Further translations of French Additional manual --- lib/doc/fr/Additional.lyx | 298 ++ 1 file changed, 117 insertions(+), 181 deletions(-) diff --git a/lib/doc/fr/Additional.lyx b/lib/doc/fr/Additional.lyx index 82ce02fc61..ef0d2ccef3 100644 --- a/lib/doc/fr/Additional.lyx +++ b/lib/doc/fr/Additional.lyx @@ -5025,6 +5025,13 @@ La nouvelle classe lettre : \family sans Letter KOMA-Script (v.2) +\begin_inset CommandInset label +LatexCommand label +name "subsec:La-nouvelle-classe" + +\end_inset + + \end_layout \begin_layout Standard @@ -8871,33 +8878,38 @@ Curricula vitae \end_layout \begin_layout Subsection - -\lang english Europass (2013) \end_layout \begin_layout Standard - -\lang english -The document class +La classe de documents \family sans Europass (2013) \family default - provides the + fournit l'accès à la classe de documents \SpecialChar LaTeX + \family typewriter europasscv.cls \family default - document class, - an unofficial implementation of the ‘Europass CV’ recommended by the European Commission in 2013. +, + une implantation officieuse du +\begin_inset Quotes cld +\end_inset + +CV Europass +\begin_inset Quotes crd +\end_inset + + recommandé par le Commission Européenne en 2013. \family sans -File\SpecialChar menuseparator -Open Example\SpecialChar menuseparator +Fichier\SpecialChar menuseparator +Ouvrir un exemple\SpecialChar menuseparator Curricula Vitae\SpecialChar menuseparator Europass (2013) \family default - offers guidance on its use. - Its documentation is available from + propose une aide à l'utilisation. + La documentation est disponible via \begin_inset CommandInset href LatexCommand href name "CTAN" @@ -8910,33 +8922,38 @@ literal "false" \end_layout \begin_layout Subsection - -\lang english Europe CV \end_layout \begin_layout Standard - -\lang english -The document class +La classe de documents \family sans Europe CV \family default - provides the + fournit l'accès à la classe de documents \SpecialChar LaTeX + \family typewriter europecv.cls \family default - document class, - an unofficial implementation of the “Europass CV” recommended by the European Commission in 2002. +, + une implantation officieuse du +\begin_inset Quotes cld +\end_inset + +CV Europass +\begin_inset Quotes crd +\end_inset + + recommandé par le Commission Européenne en 2002. \family sans -File\SpecialChar menuseparator -Open Example\SpecialChar menuseparator +Fichier\SpecialChar menuseparator +Ouvrir un exemple\SpecialChar menuseparator Curricula Vitae\SpecialChar menuseparator Europe CV \family default - offers guidance on its use. - Its documentation is available from + propose une aide à l'utilisation. + La documentation est disponible via \begin_inset CommandInset href LatexCommand href name "CTAN" @@ -8949,33 +8966,30 @@ literal "false" \end_layout \begin_layout Subsection - -\lang english Modern CV \end_layout \begin_layout Standard - -\lang english -The document class +La classe de documents \family sans Modern CV \family default - provides the + fournit l'accès à la classe de documents \SpecialChar LaTeX + \family typewriter moderncv.cls \family default - document class. - This allows the creation of customizable CVs. +. + Elle pêrmet la création de CV personnalisables. \family sans -File\SpecialChar menuseparator -Open Example\SpecialChar menuseparator +Fichier\SpecialChar menuseparator +Ouvrir un exemple\SpecialChar menuseparator Curricula Vitae\SpecialChar menuseparator Modern CV \family default - offers guidance on its use. - Its documentation is available from + propose une aide à l'utilisation. + La documentation est disponible via \begin_inset CommandInset href LatexCommand href name "CTAN" @@ -8988,34 +9002,31 @@ literal "false" \end_layout \begin_layout Subsection - -\lang english -Simple CV +CV simple \end_layout \begin_layout Standard - -\lang english -The document class +La classe de documents \family sans -Simple CV +CV simple \family default - provides the + fournit l'accès à la classe de documents \SpecialChar LaTeX + \family typewriter simplecv.cls \family default - document class, - originally developed for use with \SpecialChar LyX +, + développée à l'origine pour l'utilisation avec \SpecialChar LyX . \family sans -File\SpecialChar menuseparator -Open Example\SpecialChar menuseparator +Fichier\SpecialChar menuseparator +Ouvrir un exemple\SpecialChar menuseparator Curricula Vitae\SpecialChar menuseparator -Simple CV + CV simple \family default - offers guidance on its use. - Its documentation is available from + propose une aide à l'utilisation. + La documentation est disponible via \begin_inset CommandInset href LatexCommand href name "CTAN" @@ -9028,17 +9039,13 @@ literal "false"
[LyX features/biginset] Further translation of French Additional manual + typo in English version
commit cdb4cf5fa4d9a0785e1a318640ce6d374997b663 Author: jpc Date: Wed Mar 27 18:38:28 2024 +0100 Further translation of French Additional manual + typo in English version --- lib/doc/Additional.lyx| 12 +- lib/doc/fr/Additional.lyx | 795 -- 2 files changed, 556 insertions(+), 251 deletions(-) diff --git a/lib/doc/Additional.lyx b/lib/doc/Additional.lyx index a23f0b5d29..ac0060e99f 100644 --- a/lib/doc/Additional.lyx +++ b/lib/doc/Additional.lyx @@ -3054,19 +3054,11 @@ Hebrew \begin_layout Standard The document classes \family sans -article -\begin_inset space \thinspace{} -\end_inset - -(Hebrew) +Hebrew Article \family default and \family sans -letter -\begin_inset space \thinspace{} -\end_inset - -(Hebrew) +Hebrew Letter \family default use the \family typewriter diff --git a/lib/doc/fr/Additional.lyx b/lib/doc/fr/Additional.lyx index 460dfaa409..82ce02fc61 100644 --- a/lib/doc/fr/Additional.lyx +++ b/lib/doc/fr/Additional.lyx @@ -112,6 +112,211 @@ enumitem \shortcut idx \color #008000 \end_index +\spellchecker_ignore french usepackage +\spellchecker_ignore french indentfirst +\spellchecker_ignore french Overfull +\spellchecker_ignore french hbox +\spellchecker_ignore french American +\spellchecker_ignore french Mathematical +\spellchecker_ignore french Society +\spellchecker_ignore french amsproc +\spellchecker_ignore french l'AMS +\spellchecker_ignore french and +\spellchecker_ignore french Email +\spellchecker_ignore french Reviews +\spellchecker_ignore french CQFD +\spellchecker_ignore french AMS-LaTeX +\spellchecker_ignore french cls +\spellchecker_ignore french book +\spellchecker_ignore french letter +\spellchecker_ignore french pLaTeX +\spellchecker_ignore french upLaTeX +\spellchecker_ignore french LuaLaTeX +\spellchecker_ignore french LuaTeX +\spellchecker_ignore french latexja +\spellchecker_ignore french JS +\spellchecker_ignore french luatexja +\spellchecker_ignore french BX +\spellchecker_ignore french pdfLaTeX +\spellchecker_ignore french XeLaTeX +\spellchecker_ignore french JLReq +\spellchecker_ignore french jlreq +\spellchecker_ignore french Japanese +\spellchecker_ignore french Koma-Script +\spellchecker_ignore french Bernd +\spellchecker_ignore french Rellermeyer +\spellchecker_ignore french KOMA-Script +\spellchecker_ignore french Neukam +\spellchecker_ignore french Book +\spellchecker_ignore french Letter +\spellchecker_ignore french scrartcl +\spellchecker_ignore french scrreprt +\spellchecker_ignore french scrbook +\spellchecker_ignore french scrlettr +\spellchecker_ignore french ec +\spellchecker_ignore french cmsd +\spellchecker_ignore french BCOR +\spellchecker_ignore french scrguide +\spellchecker_ignore french Koma-script +\spellchecker_ignore french srcguien +\spellchecker_ignore french KOMA-Scripta +\spellchecker_ignore french layout +\spellchecker_ignore french Labeling +\spellchecker_ignore french AjoutPartie +\spellchecker_ignore french AddPart +\spellchecker_ignore french AjoutChap +\spellchecker_ignore french Addchap +\spellchecker_ignore french AjoutSec +\spellchecker_ignore french Addsec +\spellchecker_ignore french Chapter +\spellchecker_ignore french koma-script +\spellchecker_ignore french role +\spellchecker_ignore french addpart +\spellchecker_ignore french MiniSec +\spellchecker_ignore french Captionabove +\spellchecker_ignore french Captionbelow +\spellchecker_ignore french tablecaptionsabove +\spellchecker_ignore french Dictum +\spellchecker_ignore english Auteur +\spellchecker_ignore english du +\spellchecker_ignore french maketitle +\spellchecker_ignore french Subject +\spellchecker_ignore french Publishers +\spellchecker_ignore french Dedication +\spellchecker_ignore french Titlehead +\spellchecker_ignore french Uppertitleback +\spellchecker_ignore french Lowertitleback +\spellchecker_ignore french Extratitle +\spellchecker_ignore french draft +\spellchecker_ignore french true +\spellchecker_ignore french false +\spellchecker_ignore french headings +\spellchecker_ignore french numbers +\spellchecker_ignore french enddot +\spellchecker_ignore french noenddot +\spellchecker_ignore french leqno +\spellchecker_ignore french fleqn +\spellchecker_ignore french setkomafont +\spellchecker_ignore french captionlabel +\spellchecker_ignore french bfseries +\spellchecker_ignore french frontmatter +\spellchecker_ignore french LaTeXe +\spellchecker_ignore french backmatter +\spellchecker_ignore french scrmacros +\spellchecker_ignore french inc +\spellchecker_ignore french NextAddress +\spellchecker_ignore french lco +\spellchecker_ignore french KOMA +\spellchecker_ignore french DIN +\spellchecker_ignore french KOMAold +\spellchecker_ignore french Counter +\spellchecker_ignore french Tomasz +\spellchecker_ignore french Luczak +\spellchecker_ignore french mwart +\spellchecker_ignore french mwrep +\spellchecker_ignore french mwbk +\spellchecker_ignore french uheadings +\spellchecker_ignore
[LyX features/biginset] Cmake build wit qt(5|6)(macos) did not include "plugins"
commit 58aca890037e744a3bbe77c68946dcc9984304f1 Author: Patrick de Visschere Date: Sat Mar 23 11:25:27 2024 +0100 Cmake build wit qt(5|6)(macos) did not include "plugins" This makes things much simpler. But at least with the latest macos tools (Sonoma and XCode15) a bundle refuses to run if it 's not signed properly. Both issues are solved with the patch included and have now been tested with Qt5.15 and Qt6.7. For completeness: I've checked the font-emph shortcut issue and, as reported in the ticket mentioned, ^CmdE works with Qt5.15 but not with Qt6.7. However the sequence ^C E does work. I don't know whether this is intended as a workaround for this issue or was already implemented. --- development/cmake/post_install/CMakeLists.txt | 36 +++ 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/development/cmake/post_install/CMakeLists.txt b/development/cmake/post_install/CMakeLists.txt index 52a2f782af..f39bb5a763 100644 --- a/development/cmake/post_install/CMakeLists.txt +++ b/development/cmake/post_install/CMakeLists.txt @@ -27,15 +27,25 @@ if(LYX_BUNDLE) set(qt_conf_path "${LYX_BUNDLE_NAME}.app/Contents/Resources/qt.conf") endif() -if(Qt5Core_FOUND) - file(GLOB QT_PLUGIN_DIRECTORIES "${QT_PLUGINS_DIR}/imageformats") - install(DIRECTORY ${QT_PLUGIN_DIRECTORIES} DESTINATION "${qtplugin_dest_dir}/plugins/" COMPONENT Runtime REGEX "\\_debug\\.dylib$" EXCLUDE) - if(APPLE) - if(Qt5Core_VERSION VERSION_GREATER_EQUAL 5.10.0) - install_qt_plugin("Qt5::QMacStylePlugin") - endif() -install_qt_plugin("Qt5::QCocoaIntegrationPlugin") +if(${LYX_USE_QT} STREQUAL "QT5") +set(QtScope "Qt5") +elseif(${LYX_USE_QT} STREQUAL "QT6") +set(QtScope "Qt6") +endif() + +get_target_property( MyLoc "${QtScope}::QSvgPlugin" LOCATION) +get_filename_component(MyDir ${MyLoc} PATH) +set(QT_PLUGINS_DIR ${MyDir}/..) +set(QT_LIBRARY_DIRS ${QT_PLUGINS_DIR}/../lib) + +file(GLOB QT_PLUGIN_DIRECTORIES "${QT_PLUGINS_DIR}/imageformats") +install(DIRECTORY ${QT_PLUGIN_DIRECTORIES} DESTINATION "${qtplugin_dest_dir}/plugins/" COMPONENT Runtime REGEX "\\_debug\\.dylib$" EXCLUDE) + +if(APPLE) + if(Qt6Core_FOUND OR (Qt5Core_FOUND AND (Qt5Core_VERSION VERSION_GREATER_EQUAL 5.10.0))) + install_qt_plugin("${QtScope}::QMacStylePlugin") endif() + install_qt_plugin("${QtScope}::QCocoaIntegrationPlugin") endif() # Install code does the following: @@ -47,16 +57,22 @@ if(LYX_BUNDLE) file(GLOB_RECURSE QTPLUGINS \"\${CMAKE_INSTALL_PREFIX}/${qtplugin_dest_dir}/plugins/*/*${CMAKE_SHARED_LIBRARY_SUFFIX}\") message(STATUS \"QT plugins [\${CMAKE_INSTALL_PREFIX}/${qtplugin_dest_dir}/plugins/*/*${CMAKE_SHARED_LIBRARY_SUFFIX}]: \${QTPLUGINS}\") - fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/${installed_lyx_path}\" \"\${QTPLUGINS}\" \"${QT_LIBRARY_DIRS}\")" + fixup_bundle(\"\${CMAKE_INSTALL_PREFIX}/${installed_lyx_path}\" \"\${QTPLUGINS}\" \"${QT_LIBRARY_DIRS}\")" COMPONENT Runtime ) +if(APPLE) +# fixup_bundle invalidates the codesign, so the app must be signed again. +add_custom_target(sign_install WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX} + COMMAND /usr/bin/codesign --deep --force --sign "${CPACK_BUNDLE_APPLE_CERT_APP}" "LyX2.4.app" VERBATIM) +endif() + if (APPLE AND LYX_DMG) # Setup the disk image layout install(CODE " message(STATUS \"Creating the folder view options (.DS_Store)\") execute_process(COMMAND /bin/ln -sf /Applications \"\${CMAKE_INSTALL_PREFIX}\") -execute_process(COMMAND /bin/bash \"${CMAKE_CURRENT_SOURCE_DIR}/../../MacOSX/set_bundle_display_options.sh\" +execute_process(COMMAND /bin/bash \"${CMAKE_CURRENT_SOURCE_DIR}/../../MacOSX/set_bundle_display_options.sh\" \"${CMAKE_BINARY_DIR}/ds_store\" \"${_lyx}\" \"${TOP_CMAKE_PATH}/../MacOSX/dmg-background.png\" 560 364) ") endif() -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX features/biginset] Do not enter page break in heading (#13040)
commit 698f922d19eb28f3ca84cc9f6a1bb5aaf3ba0301 Author: Juergen Spitzmueller Date: Thu Mar 28 18:03:54 2024 +0100 Do not enter page break in heading (#13040) Rather than that, put it before or after, or disallow, depending on the position. --- src/Text.cpp | 23 --- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/src/Text.cpp b/src/Text.cpp index e1c8830dc3..d5a1069fa1 100644 --- a/src/Text.cpp +++ b/src/Text.cpp @@ -5720,12 +5720,27 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd) } case LFUN_NOMENCL_PRINT: - case LFUN_NEWPAGE_INSERT: // do nothing fancy doInsertInset(cur, this, cmd, false, false); cur.posForward(); break; + case LFUN_NEWPAGE_INSERT: { + // When we are in a heading, put the page break in a standard + // paragraph before the heading (if cur.pos() == 0) or after + // (if cur.pos() == cur.lastpos()) + if (cur.text()->getTocLevel(cur.pit()) != Layout::NOT_IN_TOC) { + lyx::dispatch(FuncRequest(LFUN_PARAGRAPH_BREAK)); + DocumentClass const & tc = bv->buffer().params().documentClass(); + lyx::dispatch(FuncRequest(LFUN_LAYOUT, from_ascii("\"") + tc.plainLayout().name() + + from_ascii("\" ignoreautonests"))); + } + // do nothing fancy + doInsertInset(cur, this, cmd, false, false); + cur.posForward(); + break; + } + case LFUN_SEPARATOR_INSERT: { doInsertInset(cur, this, cmd, false, false); cur.posForward(); @@ -6956,9 +6971,11 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & cmd, } case LFUN_NEWPAGE_INSERT: - // not allowed in description items + // not allowed in description items and in the midst of sections code = NEWPAGE_CODE; - enable = !inDescriptionItem(cur); + enable = !inDescriptionItem(cur) + && (cur.text()->getTocLevel(cur.pit()) == Layout::NOT_IN_TOC + || cur.pos() == 0 || cur.pos() == cur.lastpos()); break; case LFUN_LANGUAGE: -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX features/biginset] Typo in doc
commit 43b1234a98c645bee29e3c9bcca9e4c1bcc46d22 Author: Jean-Marc Lasgouttes Date: Mon Mar 25 22:32:17 2024 +0100 Typo in doc Thanks to Peter J. Puchyr for noticing it. --- lib/doc/LaTeXConfig.lyx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/doc/LaTeXConfig.lyx b/lib/doc/LaTeXConfig.lyx index 52d3ab0a14..0cc3257704 100644 --- a/lib/doc/LaTeXConfig.lyx +++ b/lib/doc/LaTeXConfig.lyx @@ -7834,7 +7834,7 @@ Notes: \family sans enumitem \family default - provides many possibilities to tweak the appaerance of lists (enumerate, + provides many possibilities to tweak the appearance of lists (enumerate, itemize, description). It is used by the Linguistics module to fine tune the appearance of numbered subexamples. -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX features/biginset] Fix alignment of screen font preview in prefs (remaining part of #13046)
commit 60cffcd9b7cc768d3a3cbfa97beebefb426350e1 Author: Juergen Spitzmueller Date: Sun Mar 24 09:00:41 2024 +0100 Fix alignment of screen font preview in prefs (remaining part of #13046) --- src/frontends/qt/GuiFontExample.cpp | 26 +- src/frontends/qt/GuiFontExample.h | 5 + src/frontends/qt/GuiPrefs.cpp | 13 + src/frontends/qt/GuiPrefs.h | 1 + 4 files changed, 40 insertions(+), 5 deletions(-) diff --git a/src/frontends/qt/GuiFontExample.cpp b/src/frontends/qt/GuiFontExample.cpp index 8a4ca13df8..ee7716d588 100644 --- a/src/frontends/qt/GuiFontExample.cpp +++ b/src/frontends/qt/GuiFontExample.cpp @@ -4,12 +4,15 @@ * Licence details can be found in the file COPYING. * * \author John Levon + * \author Jürgen Spitzmüller * * Full author contact details are available in file CREDITS. */ #include +#include "support/qstring_helpers.h" + #include "GuiFontExample.h" #include "GuiFontMetrics.h" @@ -23,28 +26,41 @@ void GuiFontExample::set(QFont const & font, QString const & text) { font_ = font; text_ = text; + lyx::frontend::GuiFontMetrics m(font_); + // store width, ascent and descent of the font name + string_width_ = m.width(text_); + for (auto const c : lyx::fromqstr(text)) { + string_ascent_ = std::max(string_ascent_, m.ascent(c)); + string_descent_ = std::max(string_ascent_, m.descent(c)); + } update(); } QSize GuiFontExample::sizeHint() const { - lyx::frontend::GuiFontMetrics m(font_); - return QSize(m.width(text_) + 10, m.maxHeight() + 6); + return QSize(string_width_ + 10, +string_ascent_ + string_descent_ + 6); } void GuiFontExample::paintEvent(QPaintEvent *) { QPainter p; - lyx::frontend::GuiFontMetrics m(font_); p.begin(this); p.setFont(font_); - p.drawRect(0, 0, width() - 1, height() - 1); - p.drawText(5, 3 + m.maxAscent(), text_); + int const h = height() - 1; + p.drawRect(0, 0, width() - 1, h); + p.drawText(5, (h / 2) + (string_descent_ / 2), text_); p.end(); } +int GuiFontExample::minWidth() const +{ + return string_width_; +} + + //} // namespace lyx diff --git a/src/frontends/qt/GuiFontExample.h b/src/frontends/qt/GuiFontExample.h index 57862e93ee..f9b36dff2f 100644 --- a/src/frontends/qt/GuiFontExample.h +++ b/src/frontends/qt/GuiFontExample.h @@ -28,6 +28,8 @@ public: void set(QFont const & font, QString const & text); QSize sizeHint() const override; + + int minWidth() const; protected: void paintEvent(QPaintEvent * p) override; @@ -35,6 +37,9 @@ protected: private: QFont font_; QString text_; + int string_ascent_ = 0; + int string_descent_ = 0; + int string_width_ = 0; }; diff --git a/src/frontends/qt/GuiPrefs.cpp b/src/frontends/qt/GuiPrefs.cpp index a0c28e413f..d531dd4cde 100644 --- a/src/frontends/qt/GuiPrefs.cpp +++ b/src/frontends/qt/GuiPrefs.cpp @@ -931,18 +931,31 @@ void PrefScreenFonts::updateScreenFontSizes(LyXRC const & rc) void PrefScreenFonts::selectRoman(const QString & name) { screenRomanFE->set(QFont(name), name); + screenFontsChanged(); } void PrefScreenFonts::selectSans(const QString & name) { screenSansFE->set(QFont(name), name); + screenFontsChanged(); } void PrefScreenFonts::selectTypewriter(const QString & name) { screenTypewriterFE->set(QFont(name), name); + screenFontsChanged(); +} + + +void PrefScreenFonts::screenFontsChanged() +{ + int w = max(screenRomanFE->minWidth(), screenSansFE->minWidth()); + w = max(screenTypewriterFE->minWidth(), w); + screenRomanFE->setFixedWidth(w); + screenSansFE->setFixedWidth(w); + screenTypewriterFE->setFixedWidth(w); } diff --git a/src/frontends/qt/GuiPrefs.h b/src/frontends/qt/GuiPrefs.h index 767b6a9c5f..21a9d43a4e 100644 --- a/src/frontends/qt/GuiPrefs.h +++ b/src/frontends/qt/GuiPrefs.h @@ -235,6 +235,7 @@ private Q_SLOTS: void selectRoman(const QString&); void selectSans(const QString&); void selectTypewriter(const QString&); + void screenFontsChanged(); public Q_SLOTS: void updateScreenFontSizes(LyXRC const & rc); -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX features/biginset] Fix display of a math hull inset in a tight inset
commit 4dfebbe9da27ff500b8245858322f1baeb00100b Author: Jean-Marc Lasgouttes Date: Fri Jul 14 02:13:18 2023 +0200 Fix display of a math hull inset in a tight inset This is a kind of hack. This allows InsetMathHull to state that it needs some elbow room beyond its width, in order to fit the numbering and/or the left margin (with left alignment), which are outside of the inset itself. To this end, InsetMathHull::metrics() sets a value in MetricsInfo::extrawidth and this value is added later to the width of the row that contains the inset (when this row is tight or shorter than the max allowed width). Fixes bug #12320. --- src/MetricsInfo.cpp | 3 ++- src/MetricsInfo.h| 2 ++ src/TextMetrics.cpp | 21 + src/mathed/InsetMathHull.cpp | 9 +++-- 4 files changed, 32 insertions(+), 3 deletions(-) diff --git a/src/MetricsInfo.cpp b/src/MetricsInfo.cpp index d663c9a77d..844c1c13f3 100644 --- a/src/MetricsInfo.cpp +++ b/src/MetricsInfo.cpp @@ -152,7 +152,8 @@ int MetricsBase::inPixels(Length const & len) const MetricsInfo::MetricsInfo(BufferView * bv, FontInfo font, int textwidth, MacroContext const & mc, bool vm, bool tight) - : base(bv, font, textwidth), macrocontext(mc), vmode(vm), tight_insets(tight) + : base(bv, font, textwidth), macrocontext(mc), vmode(vm), tight_insets(tight), + extrawidth(0) {} diff --git a/src/MetricsInfo.h b/src/MetricsInfo.h index 176eabfea8..6f1d404822 100644 --- a/src/MetricsInfo.h +++ b/src/MetricsInfo.h @@ -109,6 +109,8 @@ public: bool vmode; /// if true, do not expand insets to max width artificially bool tight_insets; + /// Extra width required by an inset, in addition to its dimension + int extrawidth; }; diff --git a/src/TextMetrics.cpp b/src/TextMetrics.cpp index 4692918e8e..6968279c23 100644 --- a/src/TextMetrics.cpp +++ b/src/TextMetrics.cpp @@ -485,6 +485,7 @@ bool TextMetrics::redoParagraph(pit_type const pit, bool const align_rows) par.setBeginOfBody(); Font const bufferfont = buffer.params().getFont(); CoordCache::Insets & insetCache = bv_->coordCache().insets(); + map extrawidths; for (auto const & e : par.insetList()) { // FIXME Doesn't this HAVE to be non-empty? // position already initialized? @@ -521,6 +522,20 @@ bool TextMetrics::redoParagraph(pit_type const pit, bool const align_rows) MetricsInfo mi(bv_, font.fontInfo(), w, mc, e.pos == 0, tight_); mi.base.outer_font = displayFont(pit, e.pos).fontInfo(); e.inset->metrics(mi, dim); + /* FIXME: This is a hack. This allows InsetMathHull to state +* that it needs some elbow room beyond its width, in order to +* fit the numbering and/or the left margin (with left +* alignment), which are outside of the inset itself. +* +* To this end, InsetMathHull::metrics() sets a value in +* MetricsInfo::extrawidth and this value is added later to +* the width of the row that contains the inset (when this row +* is tight or shorter than the max allowed width). +* +* See ticket #12320 for details. + */ + extrawidths[e.inset] = mi.extrawidth; + if (!insetCache.has(e.inset) || insetCache.dim(e.inset) != dim) { insetCache.add(e.inset, dim); changed = true; @@ -532,6 +547,12 @@ bool TextMetrics::redoParagraph(pit_type const pit, bool const align_rows) // Split the row in several rows fitting in available width pm.rows() = breakParagraph(bigrow); + // Add the needed extra width to the rows that contain the insets that request it + for (Row & row : pm.rows()) + for (Row::Element & e : row) + if (e.type == Row::INSET && (row.width() < max_width_ || tight_)) + row.dim().wid += extrawidths[e.inset]; + /* If there is more than one row, expand the text to the full * allowable width. This setting here is needed for the * setRowAlignment() below. We do nothing when tight insets are diff --git a/src/mathed/InsetMathHull.cpp b/src/mathed/InsetMathHull.cpp index 30ec93a14f..94d293870d 100644 --- a/src/mathed/InsetMathHull.cpp +++ b/src/mathed/InsetMathHull.cpp @@ -523,6 +523,9 @@ void InsetMathHull::metrics(MetricsInfo & mi, Dimension & dim) const if (mi.vmode) top_display_margin += theFontMetrics(mi.base.font).maxHeight() + 2; + int const ind = indent(*mi.base.bv); + mi.extrawidth = ind; + if (previewState(mi.base.bv)) { preview_->metrics(mi, dim); if
[LyX features/biginset] Revert "Fix display of a math hull inset in a tight inset"
commit 6d62d8009f3c41874cf84aa6577aae3293ebb5e6 Author: Jean-Marc Lasgouttes Date: Fri Mar 22 15:08:26 2024 +0100 Revert "Fix display of a math hull inset in a tight inset" This commit will be replaed by a better solution. Part of ticket #12320. This reverts commit 4bbd4a45e7494363903801540102150886fa2c6b. --- src/MetricsInfo.cpp | 3 +-- src/MetricsInfo.h| 2 -- src/Row.cpp | 5 ++--- src/RowPainter.cpp | 9 ++--- src/TextMetrics.cpp | 18 +- src/mathed/InsetMathHull.cpp | 9 ++--- 6 files changed, 8 insertions(+), 38 deletions(-) diff --git a/src/MetricsInfo.cpp b/src/MetricsInfo.cpp index 844c1c13f3..d663c9a77d 100644 --- a/src/MetricsInfo.cpp +++ b/src/MetricsInfo.cpp @@ -152,8 +152,7 @@ int MetricsBase::inPixels(Length const & len) const MetricsInfo::MetricsInfo(BufferView * bv, FontInfo font, int textwidth, MacroContext const & mc, bool vm, bool tight) - : base(bv, font, textwidth), macrocontext(mc), vmode(vm), tight_insets(tight), - extrawidth(0) + : base(bv, font, textwidth), macrocontext(mc), vmode(vm), tight_insets(tight) {} diff --git a/src/MetricsInfo.h b/src/MetricsInfo.h index 6f1d404822..176eabfea8 100644 --- a/src/MetricsInfo.h +++ b/src/MetricsInfo.h @@ -109,8 +109,6 @@ public: bool vmode; /// if true, do not expand insets to max width artificially bool tight_insets; - /// Extra width required by an inset, in addition to its dimension - int extrawidth; }; diff --git a/src/Row.cpp b/src/Row.cpp index 86b4e5014c..b85ef3d18b 100644 --- a/src/Row.cpp +++ b/src/Row.cpp @@ -510,15 +510,14 @@ void Row::addMarginSpace(pos_type const pos, int const width, void Row::push_back(Row::Element const & e) { - dim_.wid += e.dim.wid + ((e.type == INSET) ? e.extra : 0); + dim_.wid += e.dim.wid; elements_.push_back(e); } void Row::pop_back() { - Element const & e = elements_.back(); - dim_.wid -= e.dim.wid + ((e.type == INSET) ? e.extra : 0); + dim_.wid -= elements_.back().dim.wid; elements_.pop_back(); } diff --git a/src/RowPainter.cpp b/src/RowPainter.cpp index d893fd01eb..77e0ff67e6 100644 --- a/src/RowPainter.cpp +++ b/src/RowPainter.cpp @@ -100,7 +100,6 @@ void RowPainter::paintInset(Row::Element const & e) const bool const pi_full_repaint = pi_.full_repaint; bool const pi_do_spellcheck = pi_.do_spellcheck; Change const pi_change = pi_.change; - int const pi_textwidth = pi_.base.textwidth; pi_.base.font = e.inset->inheritFont() ? e.font.fontInfo() : pi_.base.bv->buffer().params().getFont().fontInfo(); @@ -108,7 +107,6 @@ void RowPainter::paintInset(Row::Element const & e) const pi_.ltr_pos = !e.font.isVisibleRightToLeft(); pi_.change = pi_.change.changed() ? pi_.change : e.change; pi_.do_spellcheck &= e.inset->allowSpellCheck(); - pi_.base.textwidth += e.extra; int const x1 = int(x_); pi_.base.bv->coordCache().insets().add(e.inset, x1, yo_); @@ -125,7 +123,6 @@ void RowPainter::paintInset(Row::Element const & e) const pi_.change = pi_change; pi_.do_spellcheck = pi_do_spellcheck; pi_.selected = pi_selected; - pi_.base.textwidth = pi_textwidth; #ifdef DEBUG_METRICS Dimension const & dim = pi_.base.bv->coordCache().insets().dim(e.inset); @@ -559,8 +556,7 @@ void RowPainter::paintOnlyInsets() paintChange(e); } - // extra is the extrawidth band-aid described in redoParagraphs - x_ += e.full_width() + ((e.type == Row::INSET) ? e.extra : 0); + x_ += e.full_width(); } } @@ -595,8 +591,7 @@ void RowPainter::paintText() if (e.type != Row::INSET || ! e.inset->canPaintChange(*pi_.base.bv)) paintChange(e); - // extra is the extrawidth band-aid described in redoParagraphs - x_ += e.full_width() + ((e.type == Row::INSET) ? e.extra : 0); + x_ += e.full_width(); } } diff --git a/src/TextMetrics.cpp b/src/TextMetrics.cpp index 32768970bb..4692918e8e 100644 --- a/src/TextMetrics.cpp +++ b/src/TextMetrics.cpp @@ -485,7 +485,6 @@ bool TextMetrics::redoParagraph(pit_type const pit, bool const align_rows) par.setBeginOfBody(); Font const bufferfont = buffer.params().getFont(); CoordCache::Insets & insetCache = bv_->coordCache().insets(); - map extrawidths; for (auto const & e : par.insetList()) { // FIXME Doesn't this HAVE to be non-empty? // position already initialized? @@ -522,17 +521,6 @@ bool TextMetrics::redoParagraph(pit_type const pit, bool const align_rows) MetricsInfo mi(bv_, font.fontInfo(), w, mc, e.pos == 0,
[LyX features/biginset] fix documentation of --enable-cxx-mode
commit 44c0b4e4cc1827d38dcc5284513a62cc62a54362 Author: Jean-Marc Lasgouttes Date: Thu Mar 21 22:50:38 2024 +0100 fix documentation of --enable-cxx-mode --- INSTALL | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/INSTALL b/INSTALL index 7a44ad8896..5c9c4d7489 100644 --- a/INSTALL +++ b/INSTALL @@ -208,8 +208,8 @@ precisely (see the description of --enable-build-type for the default values): o --enable-cxx-mode=VALUE can be used to select a C++ standard, for -example --enable-cxx-mode=11. The default is to try C++14, and then -C++11. +example --enable-cxx-mode=11. The default is to try C++17, C++14, and +C++11, in this order. o --enable-optimization=VALUE enables you to set optimization to a higher level than the default, for example --enable-optimization=-O3. -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX features/biginset] * cs.po
commit 210ea66d2d1113cddcc1b0f3547c1063b7dc4d47 Author: Pavel Sanda Date: Thu Mar 21 22:47:31 2024 +0100 * cs.po po/cs.po | 1244 -- 1 file changed, 634 insertions(+), 610 deletions(-) -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX features/biginset] Amend 16660d12.
commit fd378450755b698cc3ddb1a8d14e8b78d19c57a2 Author: Thibaut Cuvelier Date: Thu Mar 21 21:32:45 2024 +0100 Amend 16660d12. The previous commit introduced wrong behaviours for <>. The new code carefully escapes what needs to be escaped from LaTeX, using the now-standard XML tools (XMLStream). --- autotests/export/xhtml/math_output_latex.lyx | 2 +- autotests/export/xhtml/math_output_latex.xhtml | 2 +- src/insets/InsetLabel.cpp | 2 + src/mathed/InsetMathHull.cpp | 62 -- src/mathed/InsetMathHull.h | 4 +- 5 files changed, 45 insertions(+), 27 deletions(-) diff --git a/autotests/export/xhtml/math_output_latex.lyx b/autotests/export/xhtml/math_output_latex.lyx index 59d77d2f9b..7c49de59f6 100644 --- a/autotests/export/xhtml/math_output_latex.lyx +++ b/autotests/export/xhtml/math_output_latex.lyx @@ -100,7 +100,7 @@ The problem occurs when adding a label. \begin_layout Standard \begin_inset Formula \begin{equation} -x^{2}\label{eq:1} +x^{2}<\log x\label{eq:1} \end{equation} \end_inset diff --git a/autotests/export/xhtml/math_output_latex.xhtml b/autotests/export/xhtml/math_output_latex.xhtml index cec2d5ba0d..713def3459 100644 --- a/autotests/export/xhtml/math_output_latex.xhtml +++ b/autotests/export/xhtml/math_output_latex.xhtml @@ -22,7 +22,7 @@ div.standard { Math formula output as raw LaTeX The problem occurs when adding a label. https://www.lyx.org/trac/ticket/13048 -x^{2}(1) +x^{2}<\log x(1) diff --git a/src/insets/InsetLabel.cpp b/src/insets/InsetLabel.cpp index 1ca8ea08ae..ab5a5e1716 100644 --- a/src/insets/InsetLabel.cpp +++ b/src/insets/InsetLabel.cpp @@ -380,6 +380,8 @@ void InsetLabel::docbook(XMLStream & xs, OutputParams const & runparams) const docstring InsetLabel::xhtml(XMLStream & xs, OutputParams const &) const { + // Print the label as an HTML anchor, so that an external link can point to this equation. + // (URL: FILE.html#EQ-ID.) // FIXME XHTML // Unfortunately, the name attribute has been deprecated, so we have to use // id here to get the document to validate as XHTML 1.1. This will cause a diff --git a/src/mathed/InsetMathHull.cpp b/src/mathed/InsetMathHull.cpp index bb368b3b93..94d293870d 100644 --- a/src/mathed/InsetMathHull.cpp +++ b/src/mathed/InsetMathHull.cpp @@ -2574,35 +2574,56 @@ void InsetMathHull::mathmlize(MathMLStream & ms) const } -void InsetMathHull::mathAsLatex(TeXMathStream & os) const +docstring InsetMathHull::mathAsLatex() const { - MathEnsurer ensurer(os, false); bool const havenumbers = haveNumbers(); bool const havetable = havenumbers || nrows() > 1 || ncols() > 1; if (!havetable) { + odocstringstream ls; + otexrowstream ots(ls); + TeXMathStream os(ots, false, true, TeXMathStream::wsPreview); + ModeSpecifier specifier(os, MATH_MODE); + MathEnsurer ensurer(os, false); + os << cell(index(0, 0)); - return; + return ls.str(); } - os << ""; + odocstringstream ods; + XMLStream xs(ods); + + xs << xml::StartTag("table", "class='mathtable'"); for (row_type row = 0; row < nrows(); ++row) { - os << ""; + xs << xml::StartTag("tr"); for (col_type col = 0; col < ncols(); ++col) { - os << ""; - os << cell(index(row, col)); - os << ""; + xs << xml::StartTag("td", "class='math'"); + + odocstringstream ls; + otexrowstream ots(ls); + TeXMathStream os(ots, false, true, TeXMathStream::wsPreview); + ModeSpecifier specifier(os, MATH_MODE); + MathEnsurer ensurer(os, false); + + os << cell(index(0, 0)); + // ls.str() contains a raw LaTeX string, which might require some encoding before being valid XML. + xs << ls.str(); + + xs << xml::EndTag("td"); } if (havenumbers) { - os << ""; + xs << xml::StartTag("td"); docstring const & num = numbers_[row]; - if (!num.empty()) - os << '(' << num << ')'; - os << ""; + if (!num.empty()) { + xs << '(' << num << ')'; + } + xs << xml::EndTag("td"); } - os << ""; + xs << xml::EndTag("tr"); } - os << ""; + xs << xml::EndTag("table"); + + return ods.str(); } @@ -2703,7 +2724,7 @@ docstring InsetMathHull::xhtml(XMLStream & xs,
[LyX features/biginset] typo
commit b659d7e3bdb26ed9c862cdb6dcfeb6dcb8cfb89b Author: Jean-Marc Lasgouttes Date: Thu Mar 21 22:40:19 2024 +0100 typo --- INSTALL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/INSTALL b/INSTALL index 8f2836c742..7a44ad8896 100644 --- a/INSTALL +++ b/INSTALL @@ -60,7 +60,7 @@ This means that gcc users will have to install the relevant libstdc++ library to be able to compile this version of LyX. For full LyX usability we suggest to use Qt 5.6 and higher, or at the -very least Qt 5.4. It is also possible to compile against Qt 6.The +very least Qt 5.4. It is also possible to compile against Qt 6. The only special point to make is that you must ensure that both LyX and the Qt libraries are compiled with the same C++ compiler. -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX features/biginset] MathML in HTML: don't escape <> for a raw LaTeX output.
commit 16660d12b4333f6486259048dec2b0a2e48a64d9 Author: Thibaut Cuvelier Date: Thu Mar 21 00:29:23 2024 +0100 MathML in HTML: don't escape <> for a raw LaTeX output. In some cases (I only found numbered equations), the LaTeX output still has a bit of HTML. For numbered equations, using \tag{X} (as suggested in https://www.lyx.org/trac/ticket/13048) would require fiddling with the output. KaTeX doesn't support \label. This patch is probably the easiest and most reliable fix. Fixes https://www.lyx.org/trac/ticket/13048. --- autotests/export/xhtml/math_output_latex.lyx | 112 + autotests/export/xhtml/math_output_latex.xhtml | 28 +++ src/mathed/InsetMathHull.cpp | 3 +- 3 files changed, 142 insertions(+), 1 deletion(-) diff --git a/autotests/export/xhtml/math_output_latex.lyx b/autotests/export/xhtml/math_output_latex.lyx new file mode 100644 index 00..59d77d2f9b --- /dev/null +++ b/autotests/export/xhtml/math_output_latex.lyx @@ -0,0 +1,112 @@ +#LyX 2.4 created this file. For more info see https://www.lyx.org/ +\lyxformat 620 +\begin_document +\begin_header +\save_transient_properties true +\origin unavailable +\textclass article +\use_default_options true +\maintain_unincluded_children no +\language american +\language_package default +\inputencoding utf8 +\fontencoding auto +\font_roman "default" "default" +\font_sans "default" "default" +\font_typewriter "default" "default" +\font_math "auto" "auto" +\font_default_family default +\use_non_tex_fonts false +\font_sc false +\font_roman_osf false +\font_sans_osf false +\font_typewriter_osf false +\font_sf_scale 100 100 +\font_tt_scale 100 100 +\use_microtype false +\use_dash_ligatures true +\graphics default +\default_output_format default +\output_sync 0 +\bibtex_command default +\index_command default +\float_placement class +\float_alignment class +\paperfontsize default +\spacing single +\use_hyperref false +\papersize default +\use_geometry false +\use_package amsmath 1 +\use_package amssymb 1 +\use_package cancel 1 +\use_package esint 1 +\use_package mathdots 1 +\use_package mathtools 1 +\use_package mhchem 1 +\use_package stackrel 1 +\use_package stmaryrd 1 +\use_package undertilde 1 +\cite_engine basic +\cite_engine_type default +\biblio_style plain +\use_bibtopic false +\use_indices false +\paperorientation portrait +\suppress_date false +\justification true +\use_refstyle 1 +\use_formatted_ref 0 +\use_minted 0 +\use_lineno 0 +\index Index +\shortcut idx +\color #008000 +\end_index +\secnumdepth 3 +\tocdepth 3 +\paragraph_separation indent +\paragraph_indentation default +\is_math_indent 0 +\math_numbering_side default +\quotes_style english +\dynamic_quotes 0 +\papercolumns 1 +\papersides 1 +\paperpagestyle default +\tablestyle default +\tracking_changes false +\output_changes false +\change_bars false +\postpone_fragile_content true +\html_math_output 3 +\html_css_as_file 0 +\html_be_strict false +\docbook_table_output 0 +\docbook_mathml_prefix 1 +\end_header + +\begin_body + +\begin_layout Title +Math formula output as raw LaTeX +\end_layout + +\begin_layout Standard +The problem occurs when adding a label. + https://www.lyx.org/trac/ticket/13048 +\end_layout + +\begin_layout Standard +\begin_inset Formula +\begin{equation} +x^{2}\label{eq:1} +\end{equation} + +\end_inset + + +\end_layout + +\end_body +\end_document diff --git a/autotests/export/xhtml/math_output_latex.xhtml b/autotests/export/xhtml/math_output_latex.xhtml new file mode 100644 index 00..cec2d5ba0d --- /dev/null +++ b/autotests/export/xhtml/math_output_latex.xhtml @@ -0,0 +1,28 @@ + +http://www.w3.org/1999/xhtml; lang="en-US"> + + +Math formula output as raw LaTeX + +/* Layout-provided Styles */ +h1.title { +font-size: x-large; +margin-bottom: 1ex; +text-align: center; + +} +div.standard { + margin-bottom: 2ex; +} + + + + + +Math formula output as raw LaTeX +The problem occurs when adding a label. https://www.lyx.org/trac/ticket/13048 + +x^{2}(1) + + + diff --git a/src/mathed/InsetMathHull.cpp b/src/mathed/InsetMathHull.cpp index 2ba98b3d4d..bb368b3b93 100644 --- a/src/mathed/InsetMathHull.cpp +++ b/src/mathed/InsetMathHull.cpp @@ -2729,7 +2729,8 @@ docstring InsetMathHull::xhtml(XMLStream & xs, OutputParams const & op) const // probably should allow for some kind of customization here string const tag = (getType() == hullSimple) ? "span" : "div"; xs << xml::StartTag(tag, "class='math'") - << latex + << XMLStream::ESCAPE_AND << latex // Don't escape <> tags: latex might contain them + // (typically, when there is a label). << xml::EndTag(tag) << xml::CR(); } -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX features/biginset] TableUI - allow expading of TableAlignCO (part of #13046).
commit f7e6086e67a77d0764ab7d81621e06e4be32d7e9 Author: Pavel Sanda Date: Tue Mar 19 19:23:22 2024 +0100 TableUI - allow expading of TableAlignCO (part of #13046). --- po/cs.gmo| Bin 627047 -> 627180 bytes src/frontends/qt/ui/TabularUi.ui | 66 +++ 2 files changed, 25 insertions(+), 41 deletions(-) diff --git a/po/cs.gmo b/po/cs.gmo index 5660a60dd9..77e6cdb0b6 100644 Binary files a/po/cs.gmo and b/po/cs.gmo differ diff --git a/src/frontends/qt/ui/TabularUi.ui b/src/frontends/qt/ui/TabularUi.ui index fca7723562..06be1df4e0 100644 --- a/src/frontends/qt/ui/TabularUi.ui +++ b/src/frontends/qt/ui/TabularUi.ui @@ -200,47 +200,6 @@ - - - - Vertical alignment of the table - - - 1 - - - - Top - - - - - Middle - - - - - Bottom - - - - - - - - Qt::Horizontal - - - QSizePolicy::Expanding - - - - 153 - 20 - - - - @@ -293,6 +252,31 @@ + + + + Vertical alignment of the table + + + 1 + + + + Top + + + + + Middle + + + + + Bottom + + + + -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX features/biginset] Using the latest commit and building lyx with cmake on macos-sonoma with xcode fails with multiple error messages like this one:
commit 3f790725d9fdf6f6266534cb8bc98b54cc164129 Author: Patrick de Visschere Date: Wed Mar 20 11:44:22 2024 +0100 Using the latest commit and building lyx with cmake on macos-sonoma with xcode fails with multiple error messages like this one: -- CMake Error in po/CMakeLists.txt: The custom command generating /po/LyX2.4.cat.pot is attached to multiple targets: translations update-gmo but none of these is a common dependency of the other(s). This is not allowed by the Xcode "new build system". --- po/CMakeLists.txt | 2 ++ src/tex2lyx/test/CMakeLists.txt | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/po/CMakeLists.txt b/po/CMakeLists.txt index 065448e6e5..8b3cbf37ee 100755 --- a/po/CMakeLists.txt +++ b/po/CMakeLists.txt @@ -271,4 +271,6 @@ ADD_CUSTOM_TARGET(update-gmo DEPENDS ${LYX_UPDATED_GMO_FILES}) ADD_CUSTOM_TARGET(update-po DEPENDS ${LYX_UPDATED_PO_FILES} ${LYX_UPDATED_GMO_FILES}) set_target_properties(update-po update-gmo PROPERTIES FOLDER "i18n") add_dependencies(update-po translations) +add_dependencies(update-gmo translations) +add_dependencies(update-gmo update-po) diff --git a/src/tex2lyx/test/CMakeLists.txt b/src/tex2lyx/test/CMakeLists.txt index e620e067c4..61b4115e02 100644 --- a/src/tex2lyx/test/CMakeLists.txt +++ b/src/tex2lyx/test/CMakeLists.txt @@ -103,5 +103,5 @@ add_custom_command( DEPENDS Tex2lyxFilesUpdated ) -add_custom_target(cleanupdatetex2lyxtests DEPENDS UpdateFilesRemoved) +add_custom_target(cleanupdatetex2lyxtests DEPENDS UpdateFilesRemoved updatetex2lyxtests) set_target_properties(cleanupdatetex2lyxtests PROPERTIES FOLDER "tests/tex2lyx") -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX features/biginset] Add $$OrigAbsName placeholder to external
commit 0d3d91c0551cf3158fe89e765b4e076fcc613e73 Author: Jürgen Spitzmüller Date: Wed Mar 20 07:57:43 2024 +0100 Add $$OrigAbsName placeholder to external This produces the absolute path to the original file. Documentation will follow in die time (after documentation has been unfrozen) --- src/insets/ExternalSupport.cpp | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/insets/ExternalSupport.cpp b/src/insets/ExternalSupport.cpp index 33c14d38be..5893a5d454 100644 --- a/src/insets/ExternalSupport.cpp +++ b/src/insets/ExternalSupport.cpp @@ -106,8 +106,10 @@ string const doSubstitution(InsetExternalParams const & params, params.filename.mangledFileName() : params.filename.outputFileName(parentpath); string const basename = changeExtension( - onlyFileName(filename), string()); + onlyFileName(filename), string()); string const absname = makeAbsPath(filename, parentpath).absFileName(); + string const origabsname = makeAbsPath(params.filename.outputFileName(parentpath), + parentpath).absFileName(); if (what != ALL_BUT_PATHS) { string const filepath = onlyPath(filename); @@ -136,6 +138,10 @@ string const doSubstitution(InsetExternalParams const & params, use_latex_path, PROTECT_EXTENSION, ESCAPE_DOTS); + result = subst_path(result, "$$OrigAbsName", origabsname, + use_latex_path, + PROTECT_EXTENSION, + ESCAPE_DOTS); result = subst_path(result, "$$RelPathMaster", relToMasterPath, use_latex_path, PROTECT_EXTENSION, -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX features/biginset] Use docstring for preview snippet all the way down
commit b1e2986df8ad819ac732e8a86b6dff09333a95ca Author: Juergen Spitzmueller Date: Sat Mar 16 11:55:17 2024 +0100 Use docstring for preview snippet all the way down No need to convert back and forth --- src/graphics/PreviewImage.cpp | 10 - src/graphics/PreviewImage.h| 4 ++-- src/graphics/PreviewLoader.cpp | 49 +- src/graphics/PreviewLoader.h | 9 src/insets/InsetText.cpp | 4 ++-- src/insets/RenderPreview.cpp | 4 ++-- src/insets/RenderPreview.h | 2 +- 7 files changed, 42 insertions(+), 40 deletions(-) diff --git a/src/graphics/PreviewImage.cpp b/src/graphics/PreviewImage.cpp index b31af6fbd9..e94384c168 100644 --- a/src/graphics/PreviewImage.cpp +++ b/src/graphics/PreviewImage.cpp @@ -32,7 +32,7 @@ class PreviewImage::Impl { public: /// Impl(PreviewImage & p, PreviewLoader & l, -string const & s, FileName const & f, double af); +docstring const & s, FileName const & f, double af); /// ~Impl(); /// @@ -47,14 +47,14 @@ public: /// Loader iloader_; /// - string const snippet_; + docstring const snippet_; /// double const ascent_frac_; }; PreviewImage::PreviewImage(PreviewLoader & l, - string const & s, + docstring const & s, FileName const & f, double af) : pimpl_(new Impl(*this, l, s, f, af)) @@ -67,7 +67,7 @@ PreviewImage::~PreviewImage() } -string const & PreviewImage::snippet() const +docstring const & PreviewImage::snippet() const { return pimpl_->snippet_; } @@ -105,7 +105,7 @@ PreviewLoader & PreviewImage::previewLoader() const } -PreviewImage::Impl::Impl(PreviewImage & p, PreviewLoader & l, string const & s, +PreviewImage::Impl::Impl(PreviewImage & p, PreviewLoader & l, docstring const & s, FileName const & bf, double af) : parent_(p), ploader_(l), iloader_(l.buffer().fileName(), bf), snippet_(s), ascent_frac_(af) diff --git a/src/graphics/PreviewImage.h b/src/graphics/PreviewImage.h index bea2553eeb..6d26748092 100644 --- a/src/graphics/PreviewImage.h +++ b/src/graphics/PreviewImage.h @@ -31,14 +31,14 @@ public: * descent = height * (1 - ascent_frac) */ PreviewImage(PreviewLoader & parent, -std::string const & latex_snippet, +docstring const & latex_snippet, support::FileName const & bitmap_file, double ascent_frac); /// ~PreviewImage(); /// - std::string const & snippet() const; + docstring const & snippet() const; /// Dimension dim() const; diff --git a/src/graphics/PreviewLoader.cpp b/src/graphics/PreviewLoader.cpp index d39a6a8513..4c37f7a8d0 100644 --- a/src/graphics/PreviewLoader.cpp +++ b/src/graphics/PreviewLoader.cpp @@ -47,16 +47,17 @@ #include using namespace std; +using namespace lyx; using namespace lyx::support; namespace { -typedef pair SnippetPair; +typedef pair SnippetPair; // A list of all snippets to be converted to previews -typedef list PendingSnippets; +typedef list PendingSnippets; // Each item in the vector is a pair. typedef vector BitmapFile; @@ -121,7 +122,7 @@ void setAscentFractions(vector & ascent_fractions, } -std::function FindFirst(string const & comp) +std::function FindFirst(docstring const & comp) { return [](SnippetPair const & sp) { return sp.first == comp; }; } @@ -166,13 +167,13 @@ public: /// Stop any InProgress items still executing. ~Impl(); /// - PreviewImage const * preview(string const & latex_snippet) const; + PreviewImage const * preview(docstring const & latex_snippet) const; /// - PreviewLoader::Status status(string const & latex_snippet) const; + PreviewLoader::Status status(docstring const & latex_snippet) const; /// - void add(string const & latex_snippet); + void add(docstring const & latex_snippet); /// - void remove(string const & latex_snippet); + void remove(docstring const & latex_snippet); /// \p wait whether to wait for the process to complete or, instead, /// to do it in the background. void startLoading(bool wait = false); @@ -199,7 +200,7 @@ private: */ typedef std::shared_ptr PreviewImagePtr; /// - typedef map Cache; + typedef map Cache; /// Cache cache_; @@ -246,25 +247,25 @@ PreviewLoader::PreviewLoader(Buffer const & b) {} -PreviewImage const * PreviewLoader::preview(string const & latex_snippet) const +PreviewImage const * PreviewLoader::preview(docstring const & latex_snippet) const { return pimpl_->preview(latex_snippet); }
[LyX features/biginset] Simplify b3fe9cb7049da
commit f9c60d477d18a73c85fd277d75aeafb8edc1fbec Author: Juergen Spitzmueller Date: Sat Mar 16 05:01:53 2024 +0100 Simplify b3fe9cb7049da --- src/graphics/PreviewLoader.cpp | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/graphics/PreviewLoader.cpp b/src/graphics/PreviewLoader.cpp index dc944b1929..d39a6a8513 100644 --- a/src/graphics/PreviewLoader.cpp +++ b/src/graphics/PreviewLoader.cpp @@ -852,7 +852,6 @@ void PreviewLoader::Impl::dumpData(odocstream & os, Encoding const & enc = buffer_.params().encoding(); for (; it != end; ++it) { - docstring res; bool uncodable_content = false; // check whether the content is encodable // FIXME: the preview loader should be able @@ -864,14 +863,13 @@ void PreviewLoader::Impl::dumpData(odocstream & os, << docstring(1, n) << "' in preview snippet!"); uncodable_content = true; - } else - res += n; + } } // FIXME UNICODE os << "\\begin{preview}\n"; // do not show incomplete preview if (!uncodable_content) - os << res; + os << from_utf8(it->first); os << "\n\\end{preview}\n\n"; } } -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX features/biginset] Merge branch 'master' of git.lyx.org:lyx
commit 5f82a7a515bffd3527c9e557ebfb1e39d1705a97 Merge: 1f4238c9fb b3fe9cb704 Author: Juergen Spitzmueller Date: Sat Mar 16 04:59:08 2024 +0100 Merge branch 'master' of git.lyx.org:lyx src/graphics/PreviewLoader.cpp | 25 ++--- 1 file changed, 22 insertions(+), 3 deletions(-) -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX features/biginset] Merge branch 'master' of git.lyx.org:lyx
commit 1fca6842a57f0cf9ccefbb4be178a227895f407a Merge: 5f82a7a515 f9c60d477d Author: Juergen Spitzmueller Date: Sat Mar 16 05:03:16 2024 +0100 Merge branch 'master' of git.lyx.org:lyx src/graphics/PreviewLoader.cpp | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX features/biginset] Prevent iconv exception in previews (#13042)
commit b3fe9cb7049daaacbcf357ba5e4ece479f7b1be4 Author: Juergen Spitzmueller Date: Sat Mar 16 04:52:51 2024 +0100 Prevent iconv exception in previews (#13042) The preview loader assumes all content is in the main document encoding. As soon as content was not encodable, LyX crashed. We now check for that and if non-encodable glyphs are found, we do not produce a preview snippet and warn. Ideally, the preview loader should be made aware of encoding changes, or we should generally use utf8 for previews. --- src/graphics/PreviewLoader.cpp | 25 ++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/src/graphics/PreviewLoader.cpp b/src/graphics/PreviewLoader.cpp index a350a4939b..dc944b1929 100644 --- a/src/graphics/PreviewLoader.cpp +++ b/src/graphics/PreviewLoader.cpp @@ -849,11 +849,30 @@ void PreviewLoader::Impl::dumpData(odocstream & os, BitmapFile::const_iterator it = vec.begin(); BitmapFile::const_iterator end = vec.end(); + Encoding const & enc = buffer_.params().encoding(); + for (; it != end; ++it) { + docstring res; + bool uncodable_content = false; + // check whether the content is encodable + // FIXME: the preview loader should be able + //to handle multiple encodings + //or we should generally use utf8 + for (char_type n : from_utf8(it->first)) { + if (!enc.encodable(n)) { + LYXERR0("Uncodable character '" + << docstring(1, n) + << "' in preview snippet!"); + uncodable_content = true; + } else + res += n; + } // FIXME UNICODE - os << "\\begin{preview}\n" - << from_utf8(it->first) - << "\n\\end{preview}\n\n"; + os << "\\begin{preview}\n"; + // do not show incomplete preview + if (!uncodable_content) + os << res; + os << "\n\\end{preview}\n\n"; } } -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX features/biginset] Add Idan Pazi to contributors list
commit 1f4238c9fb03993822c0178e9bf7056a87f44c79 Author: Juergen Spitzmueller Date: Tue Mar 12 12:53:34 2024 +0100 Add Idan Pazi to contributors list --- lib/generate_contributions.py | 8 1 file changed, 8 insertions(+) diff --git a/lib/generate_contributions.py b/lib/generate_contributions.py index bb0627fe58..3d0db11273 100755 --- a/lib/generate_contributions.py +++ b/lib/generate_contributions.py @@ -1564,6 +1564,14 @@ contributors = [ "17 November 2016", u"Module updates"), + contributor(u'Idan Pazi', + "idan.kp () gmail ! com", + "GPL", + "Re: windows preview bug fix", + "m=171024249203393", + "12 March 2024", + u"Windows-specific fixes"), + contributor(u'Bo Peng', "ben.bob () gmail ! com", "GPL", -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs