[LyX features/biginset] In the no-draw phase, do not cache the positions of not visible insets
The branch, biginset, has been updated. - Log - commit 37e56c2c19d89e32d43969944960f09df3db01d2 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. diff --git a/src/BufferView.cpp b/src/BufferView.cpp index 2ddbcd9..13a0d6f 100644 --- a/src/BufferView.cpp +++ b/src/BufferView.cpp @@ -3064,7 +3064,7 @@ bool BufferView::singleParUpdate() // the height does not change but the ascent does. pm.setPosition(pm.position() - old_dim.ascent() + pm.ascent()); - tm.updatePosCache(pit); + tm.updatePosCache(pit, true); LYXERR(Debug::PAINTING, "\ny1: " << pm.position() - pm.ascent() << " y2: " << pm.position() + pm.descent() @@ -3563,7 +3563,7 @@ void BufferView::draw(frontend::Painter & pain, bool paint_caret) Text & text = buffer_.text(); TextMetrics const & tm = d->text_metrics_[]; int const y = tm.first().second->position(); - PainterInfo pi(this, pain); + PainterInfo pi(this, pain, true); // Check whether the row where the cursor lives needs to be scrolled. // Update the drawing strategy if needed. diff --git a/src/MetricsInfo.cpp b/src/MetricsInfo.cpp index 8fe03ba..1f9cfd2 100644 --- a/src/MetricsInfo.cpp +++ b/src/MetricsInfo.cpp @@ -134,10 +134,11 @@ MetricsInfo::MetricsInfo(BufferView * bv, FontInfo font, int textwidth, // / -PainterInfo::PainterInfo(BufferView * bv, lyx::frontend::Painter & painter) +PainterInfo::PainterInfo(BufferView * bv, lyx::frontend::Painter & painter, bool ov) : pain(painter), ltr_pos(false), change(), selected(false), selected_left(false), selected_right(false), - do_spellcheck(true), full_repaint(true), background_color(Color_background), + do_spellcheck(true), full_repaint(true), only_visible(ov), + background_color(Color_background), leftx(0), rightx(0) { base.bv = bv; diff --git a/src/MetricsInfo.h b/src/MetricsInfo.h index 09c5b63..6ecc859 100644 --- a/src/MetricsInfo.h +++ b/src/MetricsInfo.h @@ -117,7 +117,7 @@ public: class PainterInfo { public: /// - PainterInfo(BufferView * bv, frontend::Painter & pain); + PainterInfo(BufferView * bv, frontend::Painter & pain, bool only_visible); /// void draw(int x, int y, char_type c); /// @@ -149,6 +149,8 @@ public: bool do_spellcheck; /// True when it can be assumed that the screen has been cleared bool full_repaint; + /// When true, painting with nullPainter will be limited to screen + bool only_visible; /// Current background color ColorCode background_color; /// The left and right position of current line (inside margins). diff --git a/src/TextMetrics.cpp b/src/TextMetrics.cpp index 2e5fd56..bcf1248 100644 --- a/src/TextMetrics.cpp +++ b/src/TextMetrics.cpp @@ -193,7 +193,7 @@ void TextMetrics::newParMetricsDown() redoParagraph(pit); par_metrics_[pit].setPosition(last.second.position() + last.second.descent() + par_metrics_[pit].ascent()); - updatePosCache(pit); + updatePosCache(pit, false); } @@ -208,7 +208,7 @@ void TextMetrics::newParMetricsUp() redoParagraph(pit); par_metrics_[pit].setPosition(first.second.position() - first.second.ascent() - par_metrics_[pit].descent()); - updatePosCache(pit); + updatePosCache(pit, false); } @@ -261,10 +261,10 @@ bool TextMetrics::metrics(MetricsInfo const & mi, Dimension & dim, int min_width } -void TextMetrics::updatePosCache(pit_type pit) const +void TextMetrics::updatePosCache(pit_type pit, bool only_visible) const { frontend::NullPainter np; - PainterInfo pi(bv_, np); + PainterInfo pi(bv_, np, only_visible); drawParagraph(pi, pit, origin_.x_, par_metrics_[pit].position()); } @@ -1970,6 +1970,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() -
[LyX/master] de.po
commit c0c7a669fad1eab1efecca5d91460129448a3a73 Author: Juergen Spitzmueller Date: Mon Jul 24 16:59:32 2023 +0200 de.po --- po/de.po | 405 -- 1 files changed, 207 insertions(+), 198 deletions(-) diff --git a/po/de.po b/po/de.po index 138eda6..4fce3ac 100644 --- a/po/de.po +++ b/po/de.po @@ -94,8 +94,8 @@ msgid "" msgstr "" "Project-Id-Version: LyX 2.4git\n" "Report-Msgid-Bugs-To: lyx-de...@lists.lyx.org\n" -"POT-Creation-Date: 2023-07-20 16:46+0200\n" -"PO-Revision-Date: 2023-07-20 16:47+0200\n" +"POT-Creation-Date: 2023-07-24 16:55+0200\n" +"PO-Revision-Date: 2023-07-24 16:59+0200\n" "Last-Translator: Juergen Spitzmueller \n" "Language-Team: German \n" "Language: de\n" @@ -773,7 +773,7 @@ msgid "Remove the selected branch" msgstr "Den ausgewählten Zweig entfernen" #: src/frontends/qt/ui/BranchesUi.ui:74 src/frontends/qt/ui/IndicesUi.ui:165 -#: src/Buffer.cpp:4774 src/Buffer.cpp:4787 +#: src/Buffer.cpp:4817 src/Buffer.cpp:4830 msgid "" msgstr "" @@ -848,18 +848,18 @@ msgid "Add A" msgstr "A hinzufügen" #: src/frontends/qt/ui/BranchesUnknownUi.ui:58 src/Buffer.cpp:1483 -#: src/Buffer.cpp:4748 src/Buffer.cpp:4858 src/LyXVC.cpp:114 src/LyXVC.cpp:310 +#: src/Buffer.cpp:4791 src/Buffer.cpp:4901 src/LyXVC.cpp:114 src/LyXVC.cpp:310 #: src/buffer_funcs.cpp:56 src/frontends/qt/GuiBranches.cpp:226 #: src/frontends/qt/GuiClipboard.cpp:252 src/frontends/qt/GuiDocument.cpp:2962 -#: src/frontends/qt/GuiParagraph.cpp:177 src/frontends/qt/GuiPrefs.cpp:3424 -#: src/frontends/qt/GuiView.cpp:2901 src/frontends/qt/GuiView.cpp:3064 -#: src/frontends/qt/GuiView.cpp:3294 src/frontends/qt/GuiView.cpp:3318 -#: src/frontends/qt/GuiView.cpp:3332 src/frontends/qt/GuiView.cpp:3436 -#: src/frontends/qt/GuiView.cpp:3481 src/frontends/qt/GuiView.cpp:3536 -#: src/frontends/qt/GuiView.cpp:3770 src/frontends/qt/GuiView.cpp:3784 -#: src/frontends/qt/GuiView.cpp:3903 src/frontends/qt/GuiView.cpp:3928 -#: src/frontends/qt/GuiView.cpp:4634 src/frontends/qt/GuiView.cpp:4641 -#: src/insets/InsetBibtex.cpp:153 +#: src/frontends/qt/GuiParagraph.cpp:177 src/frontends/qt/GuiPrefs.cpp:3418 +#: src/frontends/qt/GuiPrefs.cpp:3441 src/frontends/qt/GuiView.cpp:2901 +#: src/frontends/qt/GuiView.cpp:3064 src/frontends/qt/GuiView.cpp:3294 +#: src/frontends/qt/GuiView.cpp:3318 src/frontends/qt/GuiView.cpp:3332 +#: src/frontends/qt/GuiView.cpp:3436 src/frontends/qt/GuiView.cpp:3481 +#: src/frontends/qt/GuiView.cpp:3536 src/frontends/qt/GuiView.cpp:3770 +#: src/frontends/qt/GuiView.cpp:3784 src/frontends/qt/GuiView.cpp:3903 +#: src/frontends/qt/GuiView.cpp:3928 src/frontends/qt/GuiView.cpp:4634 +#: src/frontends/qt/GuiView.cpp:4641 src/insets/InsetBibtex.cpp:153 msgid "" msgstr "" @@ -2393,8 +2393,8 @@ msgstr "Automatischen Zeilenumbruch nach dem Leerzeichen verhindern" #: lib/layouts/acmart.layout:694 lib/layouts/acmart.layout:712 #: lib/layouts/amsdefs.inc:190 lib/layouts/maa-monthly.layout:165 #: lib/layouts/maa-monthly.layout:169 lib/layouts/minimalistic.module:27 -#: lib/layouts/scrlttr2.layout:271 lib/layouts/stdinsets.inc:609 -#: lib/layouts/stdinsets.inc:612 +#: lib/layouts/scrlttr2.layout:271 lib/layouts/stdinsets.inc:616 +#: lib/layouts/stdinsets.inc:619 msgid "URL" msgstr "URL" @@ -2879,9 +2879,9 @@ msgid " Highlighting Package:" msgstr " zur Code-Hervorhebung:" #: src/frontends/qt/ui/ListingsUi.ui:14 lib/layouts/numreport.inc:37 -#: lib/layouts/stdcounters.inc:77 lib/layouts/stdinsets.inc:338 -#: lib/layouts/stdinsets.inc:344 lib/layouts/stdinsets.inc:393 -#: lib/layouts/stdinsets.inc:399 src/insets/InsetCaption.cpp:423 +#: lib/layouts/stdcounters.inc:77 lib/layouts/stdinsets.inc:342 +#: lib/layouts/stdinsets.inc:348 lib/layouts/stdinsets.inc:398 +#: lib/layouts/stdinsets.inc:404 src/insets/InsetCaption.cpp:423 #: src/insets/InsetListings.cpp:616 src/insets/InsetListings.cpp:617 msgid "Listing" msgstr "Listing" @@ -6572,7 +6572,7 @@ msgid "Footnote" msgstr "Fußnote" #: lib/citeengines/biblatex-natbib.citeengine:144 -#: lib/citeengines/biblatex.citeengine:134 lib/layouts/stdinsets.inc:51 +#: lib/citeengines/biblatex.citeengine:134 msgid "Foot" msgstr "Fußnote" @@ -7034,7 +7034,7 @@ msgstr "Abbildungsanmerkungen" #: lib/layouts/stdlayouts.inc:48 lib/layouts/stdlayouts.inc:70 #: lib/layouts/stdletter.inc:13 lib/layouts/svcommon.inc:27 #: lib/layouts/svcommon.inc:711 lib/layouts/svcommon.inc:722 -#: lib/layouts/tufte-book.layout:245 +#: lib/layouts/tufte-book.layout:241 msgid "MainText" msgstr "Haupttext" @@ -7642,7 +7642,7 @@ msgstr "IEEE Transactions" #: lib/layouts/scrlttr2.layout:19 lib/layouts/siamltex.layout:37 #: lib/layouts/sigplanconf.layout:41 lib/layouts/simplecv.layout:18 #: lib/layouts/slides.layout:61 lib/layouts/stdclass.inc:28 -#: lib/layouts/stdinsets.inc:719 lib/layouts/stdletter.inc:12 +#: lib/layouts/stdinsets.inc:726 lib/layouts/stdletter.inc:12 #: lib/layouts/svcommon.inc:26
[LyX features/biginset] Remove some redundant calls to updatePosCache
The branch, biginset, has been updated. - Log - commit 9ff6d09d1f42f5e30fa59b18c5b9e7975018618b 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 diff --git a/src/BufferView.cpp b/src/BufferView.cpp index 0ffedf4..2ddbcd9 100644 --- a/src/BufferView.cpp +++ b/src/BufferView.cpp @@ -3126,7 +3126,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_ @@ -3142,7 +3141,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(); } @@ -3156,7 +3154,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(); } commit 2cb980080ca9245a7684c002b03ca3adf89f7861 Author: Jean-Marc Lasgouttes Date: Mon Jul 24 15:11:20 2023 +0200 Add instrumentation for profiling diff --git a/src/BufferView.cpp b/src/BufferView.cpp index 80a6b80..0ffedf4 100644 --- a/src/BufferView.cpp +++ b/src/BufferView.cpp @@ -77,6 +77,8 @@ #include "support/Length.h" #include "support/lstrings.h" #include "support/lyxlib.h" +//#define DISABLE_PMPROF +#include "support/pmprof.h" #include "support/types.h" #include @@ -3081,6 +3083,7 @@ void BufferView::updateMetrics() void BufferView::updateMetrics(Update::flags & update_flags) { + PROFILE_THIS_BLOCK(updateMetrics); if (height_ == 0 || width_ == 0) return; --- Summary of changes: src/BufferView.cpp |6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) hooks/post-receive -- Repository for new features -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX/master] Update fr.po
commit b49193403d3a3f9de3aa14196565787bea21a563 Author: jpc Date: Mon Jul 24 11:54:06 2023 +0200 Update fr.po po/fr.gmo | Bin 648333 -> 650269 bytes po/fr.po | 1036 + 2 files changed, 568 insertions(+), 468 deletions(-) -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX/master] * RELEASE-NOTES
commit 04237beb4123d40de43ff2d3d075ebf4c7b4bb61 Author: Pavel Sanda Date: Mon Jul 24 11:39:44 2023 +0200 * RELEASE-NOTES --- lib/RELEASE-NOTES |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/lib/RELEASE-NOTES b/lib/RELEASE-NOTES index 9060410..f47805b 100644 --- a/lib/RELEASE-NOTES +++ b/lib/RELEASE-NOTES @@ -211,6 +211,9 @@ * info-insert buffer vcs-*: renamed to info-insert vcs * +* inset-edit recognizes optional argument "nogui" - no editor will be launched in + such case, only filename will be returned (for use in scripts). + * outline-in/out can now take argument "local", that restricts their action to the current paragraph. -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX/master] Display footnote labels as superscripts
commit 6a8c10f0d6178dc261f089fe8245de1000ef1941 Author: Jean-Marc Lasgouttes Date: Sat Jul 22 16:53:14 2023 +0200 Display footnote labels as superscripts A new counter type \superarabic is introduced, that transforms the counter into superscript Unicode numbers. This is used for the footnote counter. The Foot inset layout is modified to use an empty LabelString (in size Normal, since the numbers could be too small). We use this occasion to set footnote text in footnotesize, as it should. A couple of changes are done to the code to make the button label and tooltip look better. Fixes bug #12238. --- lib/layouts/numreport.inc|1 - lib/layouts/stdcounters.inc |1 + lib/layouts/stdinsets.inc|6 +++--- src/Counters.cpp |3 +++ src/insets/InsetFoot.cpp |6 -- src/support/counter_reps.cpp | 13 + src/support/counter_reps.h |1 + 7 files changed, 25 insertions(+), 6 deletions(-) diff --git a/lib/layouts/numreport.inc b/lib/layouts/numreport.inc index 44ee0fb..9788d8f 100644 --- a/lib/layouts/numreport.inc +++ b/lib/layouts/numreport.inc @@ -41,5 +41,4 @@ End Counter footnote GuiName Footnote Withinchapter - LabelString "\arabic{footnote}" End diff --git a/lib/layouts/stdcounters.inc b/lib/layouts/stdcounters.inc index 4ee63d0..dc730c7 100644 --- a/lib/layouts/stdcounters.inc +++ b/lib/layouts/stdcounters.inc @@ -84,6 +84,7 @@ End Counter footnote GuiName Footnote + LabelString "\superarabic{footnote}" PrettyFormat "Footnote ##" End diff --git a/lib/layouts/stdinsets.inc b/lib/layouts/stdinsets.inc index 8fafff8..68c3660 100644 --- a/lib/layouts/stdinsets.inc +++ b/lib/layouts/stdinsets.inc @@ -49,17 +49,17 @@ InsetLayout Marginal End InsetLayout Foot - LabelString Foot + LabelString "" LatexType Command LatexName footnote Counter footnote InheritFont false Font - SizeSmall + SizeFootnoteSize EndFont LabelFont Color footlabel - SizeSmall + SizeNormal EndFont MultiPar true RefPrefix fn diff --git a/src/Counters.cpp b/src/Counters.cpp index 0133f76..d7f8630 100644 --- a/src/Counters.cpp +++ b/src/Counters.cpp @@ -476,6 +476,9 @@ docstring Counters::labelItem(docstring const & ctr, if (numbertype == "fnsymbol") return fnsymbolCounter(val); + if (numbertype == "superarabic") + return superarabicCounter(val); + return convert(val); } diff --git a/src/insets/InsetFoot.cpp b/src/insets/InsetFoot.cpp index a0f3435..0f5c706 100644 --- a/src/insets/InsetFoot.cpp +++ b/src/insets/InsetFoot.cpp @@ -88,7 +88,9 @@ void InsetFoot::updateBuffer(ParIterator const & it, UpdateType utype, bool cons int val = cnts.value(count); if (cnts.hasCounter(count)) { cnts.step(count, utype); - custom_label_ += ' ' + cnts.theCounter(count, lang->code()); + if (!custom_label_.empty()) + custom_label_ += ' '; + custom_label_ += cnts.theCounter(count, lang->code()); if (deleted) // un-step after deleted counter cnts.set(count, val); @@ -107,7 +109,7 @@ docstring InsetFoot::toolTip(BufferView const & bv, int x, int y) const if (isOpen(bv)) // this will give us something useful if there is no button return InsetCollapsible::toolTip(bv, x, y); - return toolTipText(custom_label_+ ": "); + return toolTipText(custom_label_+ " "); } diff --git a/src/support/counter_reps.cpp b/src/support/counter_reps.cpp index 96cbe24..0d13c10 100644 --- a/src/support/counter_reps.cpp +++ b/src/support/counter_reps.cpp @@ -12,6 +12,8 @@ #include #include "support/counter_reps.h" + +#include "support/convert.h" #include "support/docstring.h" #include "support/lstrings.h" @@ -132,4 +134,15 @@ docstring const fnsymbolCounter(int const n) }; } + +docstring const superarabicCounter(int const n) +{ + docstring superarabic = convert(n); + static char_type map[] = {0x2070, 0x00b9, 0x00b2, 0x00b3, 0x2074, + 0x2075, 0x2076, 0x2077, 0x2078, 0x2079 }; + for (char_type & c : superarabic) + c = map[c - char_type('0')]; + return superarabic; +} + } // namespace lyx diff --git a/src/support/counter_reps.h b/src/support/counter_reps.h index e6a3f67..59305dc 100644 --- a/src/support/counter_reps.h +++ b/src/support/counter_reps.h @@ -27,6 +27,7 @@ char hebrewCounter(int const n); docstring
[LyX/master] Add accelerators
commit 6d167e94f40578837b7a93451592d96639d98dbd Author: Juergen Spitzmueller Date: Mon Jul 24 10:33:20 2023 +0200 Add accelerators --- src/frontends/qt/GuiWorkArea.cpp |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/frontends/qt/GuiWorkArea.cpp b/src/frontends/qt/GuiWorkArea.cpp index de3f70b..ef91e0b 100644 --- a/src/frontends/qt/GuiWorkArea.cpp +++ b/src/frontends/qt/GuiWorkArea.cpp @@ -2085,13 +2085,13 @@ void TabWorkArea::showContextMenu(const QPoint & pos) // show tab popup QMenu popup; popup.addAction(QIcon(getPixmap("images/", "hidetab", "svgz,png")), - qt_("Hide Tab"), this, SLOT(hideCurrentTab())); + qt_(" Tab"), this, SLOT(hideCurrentTab())); // we want to show the 'close' option only if this is not a child buffer. Buffer const & buf = wa->bufferView().buffer(); if (!buf.parent()) popup.addAction(QIcon(getPixmap("images/", "closetab", "svgz,png")), - qt_("Close Tab"), this, SLOT(closeCurrentBuffer())); + qt_(" Tab"), this, SLOT(closeCurrentBuffer())); popup.exec(tabBar()->mapToGlobal(pos)); clicked_tab_ = -1; -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs
[LyX/master] Fix casing
commit d212013bd76e0b5e85f20a007dd2a5911061014c Author: Juergen Spitzmueller Date: Mon Jul 24 10:26:57 2023 +0200 Fix casing --- src/frontends/qt/GuiWorkArea.cpp |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/frontends/qt/GuiWorkArea.cpp b/src/frontends/qt/GuiWorkArea.cpp index 3cd5f47..de3f70b 100644 --- a/src/frontends/qt/GuiWorkArea.cpp +++ b/src/frontends/qt/GuiWorkArea.cpp @@ -2085,13 +2085,13 @@ void TabWorkArea::showContextMenu(const QPoint & pos) // show tab popup QMenu popup; popup.addAction(QIcon(getPixmap("images/", "hidetab", "svgz,png")), - qt_("Hide tab"), this, SLOT(hideCurrentTab())); + qt_("Hide Tab"), this, SLOT(hideCurrentTab())); // we want to show the 'close' option only if this is not a child buffer. Buffer const & buf = wa->bufferView().buffer(); if (!buf.parent()) popup.addAction(QIcon(getPixmap("images/", "closetab", "svgz,png")), - qt_("Close tab"), this, SLOT(closeCurrentBuffer())); + qt_("Close Tab"), this, SLOT(closeCurrentBuffer())); popup.exec(tabBar()->mapToGlobal(pos)); clicked_tab_ = -1; -- lyx-cvs mailing list lyx-cvs@lists.lyx.org http://lists.lyx.org/mailman/listinfo/lyx-cvs