]> git.lyx.org Git - lyx.git/log
lyx.git
6 years agoUpdate status
Juergen Spitzmueller [Sat, 17 Mar 2018 13:36:56 +0000 (14:36 +0100)]
Update status

6 years agotex2lyx: add beamer test file
Juergen Spitzmueller [Sat, 17 Mar 2018 12:20:48 +0000 (13:20 +0100)]
tex2lyx: add beamer test file

(cherry picked from commit 63b67fee8329840f0fbbd75b8ec9321ba1243555)

6 years agotex2lyx: do not eat empty paragraphs if keepempty is true
Juergen Spitzmueller [Sat, 17 Mar 2018 11:19:50 +0000 (12:19 +0100)]
tex2lyx: do not eat empty paragraphs if keepempty is true

Fixes: #11078
(cherry picked from commit 79728dcde975fc5968d0ef9e6b56df57023acd88)

6 years agotex2lyx: handle makebeamertitle
Juergen Spitzmueller [Sat, 17 Mar 2018 11:39:13 +0000 (12:39 +0100)]
tex2lyx: handle makebeamertitle

(cherry picked from commit d93076c1284de96b12cb583edfee2654de928a61)

6 years agotex2lyx: clear latexparam after use.
Juergen Spitzmueller [Sat, 17 Mar 2018 11:38:53 +0000 (12:38 +0100)]
tex2lyx: clear latexparam after use.

(cherry picked from commit 7e3a41bd15e993bf738134c6dc601f482d036894)

6 years agotex2lyx: add support for LaTeXParam
Juergen Spitzmueller [Fri, 16 Mar 2018 11:56:17 +0000 (12:56 +0100)]
tex2lyx: add support for LaTeXParam

Part of #11068

(cherry picked from commit 506ae2d2ea1e646461841c57edd3f79c97d671c2)

6 years agotex2lyx: support for beamer text styles with overlays
Juergen Spitzmueller [Wed, 14 Mar 2018 13:38:18 +0000 (14:38 +0100)]
tex2lyx: support for beamer text styles with overlays

E.g. things like \textbf<article>{foo} have to be imported as insets.

Part of #11068

(cherry picked from commit c74e3999812dfdff3cb6d20ef460dfca1f17c879)

6 years agotex2lyx: More work on beamer support
Juergen Spitzmueller [Wed, 14 Mar 2018 07:40:47 +0000 (08:40 +0100)]
tex2lyx: More work on beamer support

* Implement list item overlay support (\item<arg>)
* Implement itemcommand support (e.g., \overprint<arg>)
* Fix general list argument placement

Part of: #11068

(cherry picked from commit e51265b5f3c7765ad185303ac147792c7599386f)

6 years agotex2lyx: towards beamer overlay argument support.
Juergen Spitzmueller [Mon, 12 Mar 2018 13:50:19 +0000 (14:50 +0100)]
tex2lyx: towards beamer overlay argument support.

Implemented: Overlay and standard overlay arguments for commands
and environments.

Still missing:
* List item overlay
* itemcommand overlay (\overprint)
* overlay via LatexParam (e.g., Flex:ArticleMode)

Needs fixing:
* General list argument (\begin{itemize}[arg])
* nested content in a frame with no title (empty par)

(cherry picked from commit 949de66956309ea787b86d69a00b72d154b4d4db)

6 years agoPaint \dot & \ddot more like a dot
Pavel Sanda [Mon, 12 Mar 2018 12:40:52 +0000 (13:40 +0100)]
Paint \dot & \ddot more like a dot

https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg204183.html

6 years agoFix known_escaped_chars
Juergen Spitzmueller [Tue, 13 Mar 2018 16:39:40 +0000 (17:39 +0100)]
Fix known_escaped_chars

(this includes the amend)

6 years agoupdate tex2lyx tests
Juergen Spitzmueller [Mon, 12 Mar 2018 08:35:39 +0000 (09:35 +0100)]
update tex2lyx tests

6 years agotex2lyx: update quote handling
Juergen Spitzmueller [Sun, 11 Mar 2018 17:04:23 +0000 (18:04 +0100)]
tex2lyx: update quote handling

* Consider new quote styles
* Consider changed quote styles
* Try to be a bit smarter with ambiguous quotation marks

(cherry picked from commit 8184f08f4af6efea6d1499e3f8c8d3c20ebb1b97)

6 years agotex2lyx: support tipa \t*{} macro.
Juergen Spitzmueller [Sun, 11 Mar 2018 10:46:37 +0000 (11:46 +0100)]
tex2lyx: support tipa \t*{} macro.

(cherry picked from commit cc6f2dae8219b40cd8602f70110926296403a0f7)

6 years agoupdate tex2lyx tests once more.
Juergen Spitzmueller [Sun, 11 Mar 2018 18:56:04 +0000 (19:56 +0100)]
update tex2lyx tests once more.

6 years agoamend 11e4a24e6edbd1f
Juergen Spitzmueller [Sun, 11 Mar 2018 18:49:28 +0000 (19:49 +0100)]
amend 11e4a24e6edbd1f

(cherry picked from commit 386d9953e83a35dcc3b0f173faa92d9e9fc16f0f)

6 years agoupdate tex2lyx tests.
Juergen Spitzmueller [Sun, 11 Mar 2018 18:31:19 +0000 (19:31 +0100)]
update tex2lyx tests.

6 years agoStatus updates.
Juergen Spitzmueller [Sun, 11 Mar 2018 17:33:45 +0000 (18:33 +0100)]
Status updates.

6 years agotex2lyx: make nested CJK parsing slightly less dumb.
Juergen Spitzmueller [Sat, 10 Mar 2018 13:58:55 +0000 (14:58 +0100)]
tex2lyx: make nested CJK parsing slightly less dumb.

Fixes: #9562
(cherry picked from commit 0f4c9027056a6f4f771382e9ebfc7940274bf5c0)

6 years agotex2lyx: honor grouping in optional arguments.
Juergen Spitzmueller [Fri, 9 Mar 2018 12:14:13 +0000 (13:14 +0100)]
tex2lyx: honor grouping in optional arguments.

E.g., \cite[{a literal ] character}]{key}

(cherry picked from commit cba38881d6b9fa3ff5dd0ebe50239fc384309082)

6 years agoFix copy and paste error in 6659304f7f8b
Juergen Spitzmueller [Fri, 9 Mar 2018 11:29:07 +0000 (12:29 +0100)]
Fix copy and paste error in 6659304f7f8b

(cherry picked from commit 0513622fd0ce600cbf283f6afdbde9841d46a546)

6 years agotex2lyx: towards proper support of "literal"/"latexified" inset commands
Juergen Spitzmueller [Thu, 8 Mar 2018 14:00:33 +0000 (15:00 +0100)]
tex2lyx: towards proper support of "literal"/"latexified" inset commands

We now report whether the attempt to recode the macros to glyphs
succeeded. If yes, we set "literate" to false, if not to true.

Also, do not attempt to recode for non-latexifying fields.

Fixes: #9563
(cherry picked from commit 6659304f7f8b57f12a1bf453a11ea359c83a7d14)

6 years agotex2lyx: support for URW Classico, MinionPro and the new Libertine fonts.
Juergen Spitzmueller [Sun, 11 Mar 2018 10:12:42 +0000 (11:12 +0100)]
tex2lyx: support for URW Classico, MinionPro and the new Libertine fonts.

(cherry picked from commit a3836d990926dfd8e7e35b266274c372c72206ce)

6 years agotex2lyx: get rid of another large if-else if chain.
Juergen Spitzmueller [Sat, 10 Mar 2018 14:00:30 +0000 (15:00 +0100)]
tex2lyx: get rid of another large if-else if chain.

(cherry picked from commit 11e4a24e6edbd1f69b60a194b31ac2d7c4dd5034)

6 years agoAmend 15fd17d83fb2
Juergen Spitzmueller [Sat, 10 Mar 2018 13:22:51 +0000 (14:22 +0100)]
Amend 15fd17d83fb2

(cherry picked from commit b2ccdae22864ba72675b43d070022ae8fea18238)

6 years agotex2lyx: support for \includeonly
Juergen Spitzmueller [Fri, 9 Mar 2018 16:27:55 +0000 (17:27 +0100)]
tex2lyx: support for \includeonly

(cherry picked from commit 15fd17d83fb2b98d1ff226a79353e42f6e0247d4)

6 years agotex2lyx: chapterbib support
Juergen Spitzmueller [Fri, 9 Mar 2018 12:30:52 +0000 (13:30 +0100)]
tex2lyx: chapterbib support

(cherry picked from commit af6933c06f603beca3d8684f56217243cbff1f94)

6 years agostatus.23x: correct sorting
Uwe Stöhr [Tue, 6 Mar 2018 21:34:21 +0000 (22:34 +0100)]
status.23x: correct sorting

tex2lyx biblatex support is an improvement not a bugfix. At least in the past we sorted new tex2lyx features this way.

6 years agotex2lyx: support alignment pseudo-environments.
Juergen Spitzmueller [Tue, 6 Mar 2018 16:54:32 +0000 (17:54 +0100)]
tex2lyx: support alignment pseudo-environments.

Fixes: #7857
(cherry picked from commit 7a22ce7c09f54ca70f30dde05c3f77c478195e45)

6 years agoFix local polyglossia switch for Arabic
Juergen Spitzmueller [Tue, 6 Mar 2018 14:31:43 +0000 (15:31 +0100)]
Fix local polyglossia switch for Arabic

We need to lowercase the language again (it's \begin{Arabic},
but \textarabic)

Fixes: #11057.
(cherry picked from commit 27584f5f7033f6abe127e66b4f5114663e043157)

6 years agotex2lyx: fix subfloat import
Juergen Spitzmueller [Tue, 6 Mar 2018 09:35:55 +0000 (10:35 +0100)]
tex2lyx: fix subfloat import

Fixes: #10385
(cherry picked from commit 1dcb2a09766335aecbe3c8599d09358e135d699c)

6 years agoRemove duplicate entries.
Juergen Spitzmueller [Tue, 6 Mar 2018 16:31:19 +0000 (17:31 +0100)]
Remove duplicate entries.

6 years agostatus.23x: mention the new biblatex support in tex2lyx
Uwe Stöhr [Tue, 6 Mar 2018 12:52:42 +0000 (13:52 +0100)]
status.23x: mention the new biblatex support in tex2lyx

6 years agotex2lyx/text.cpp: fix a typo
Uwe Stöhr [Mon, 5 Mar 2018 16:37:50 +0000 (17:37 +0100)]
tex2lyx/text.cpp: fix a typo

(cherry picked from commit a30972a39c10647ffcb7eab5382f250331db7a8b)

6 years agoSmall update of TODO
Juergen Spitzmueller [Mon, 5 Mar 2018 13:57:16 +0000 (14:57 +0100)]
Small update of TODO

(cherry picked from commit 4bc379ea67ea632ac13c12abd639f6b3f6b25a45)

6 years agoparse_text (tex2lyx): get rid of the monstrous if-then-else clause
Juergen Spitzmueller [Mon, 5 Mar 2018 08:08:14 +0000 (09:08 +0100)]
parse_text (tex2lyx): get rid of the monstrous if-then-else clause

Rather than that, continue in the loop if a condition is met.

This fixes tex2lyx for MINGW, which has a cluase-nesting threshold.

Fixes: #9552
(cherry picked from commit b94bb37e5310b9007ed812c58460a5292820c534)

6 years agotex2lyx: support qualified citation lists (biblatex)
Juergen Spitzmueller [Sun, 4 Mar 2018 19:12:27 +0000 (20:12 +0100)]
tex2lyx: support qualified citation lists (biblatex)

(cherry picked from commit 0915e814814ab26732b6dd13fc1740cfbf64b5b4)

6 years agotex2lyx: refsection and bibbysection support (biblatex)
Juergen Spitzmueller [Sun, 4 Mar 2018 16:29:59 +0000 (17:29 +0100)]
tex2lyx: refsection and bibbysection support (biblatex)

(cherry picked from commit 1a3dbbf07ad837a685af93bf3d1d1a784e0d27ae)

6 years agotex2lyx: support biblatex
Juergen Spitzmueller [Sun, 4 Mar 2018 15:46:31 +0000 (16:46 +0100)]
tex2lyx: support biblatex

(qualified citation lists and multibib not yet supported)

(cherry picked from commit f22213a04fe53dd128f11db9b228623b3fc3dda7)

6 years agotex2lyx: consider options passed via \PassOptionsToPackage
Juergen Spitzmueller [Sun, 4 Mar 2018 15:45:37 +0000 (16:45 +0100)]
tex2lyx: consider options passed via \PassOptionsToPackage

(cherry picked from commit 476401a76f8bdb3dd2c2a482b2088f00dbe501d9)

6 years agotex2lyx: import straight quotation marks as ERT
Juergen Spitzmueller [Sun, 4 Mar 2018 11:08:08 +0000 (12:08 +0100)]
tex2lyx: import straight quotation marks as ERT

This assures that they are output as straight quotations marks (e.g.,
babel shorthands).

Fixes: #75 [sic!]
(cherry picked from commit ccb9ae96709ea32cf983d6e5fb5d655b28a817e1)

6 years agoAllow reload if buffer is externally modified.
Pavel Sanda [Fri, 2 Mar 2018 19:48:08 +0000 (20:48 +0100)]
Allow reload if buffer is externally modified.

Follow-up of 2df82c4a44b7.

6 years agoFilter in citation dialog is not respected when reloading databaze.
Pavel Sanda [Thu, 1 Mar 2018 23:49:15 +0000 (00:49 +0100)]
Filter in citation dialog is not respected when reloading databaze.

6 years agoNo manual intervention needed for polyglossia (bidi) and RTL numbers.
Juergen Spitzmueller [Mon, 26 Feb 2018 16:06:31 +0000 (17:06 +0100)]
No manual intervention needed for polyglossia (bidi) and RTL numbers.

See https://tex.stackexchange.com/a/256837/19291

(cherry picked from commit 00d4144352ffecfb229fcaaf104a2103002235bc)

6 years agoTake actual font height (ascent, descent) into account when drawing placeholder box...
Juergen Spitzmueller [Sun, 25 Feb 2018 16:19:42 +0000 (17:19 +0100)]
Take actual font height (ascent, descent) into account when drawing placeholder box for graphics

Fixes: #11048
(cherry picked from commit 5ddd377a0ae6c8c18f566463988e3e3f596e57bb)

6 years agoWe don't want external change to automatically marked the buffer dirty.
Pavel Sanda [Sun, 25 Feb 2018 13:49:21 +0000 (14:49 +0100)]
We don't want external change to automatically marked the buffer dirty.

https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg203995.html

6 years agoImprove documentation of inset-(begin|end)(|-select)
Jean-Marc Lasgouttes [Thu, 22 Feb 2018 16:00:54 +0000 (17:00 +0100)]
Improve documentation of inset-(begin|end)(|-select)

Make it clear that it can go at the beginning/end of the document.

(cherry picked from commit f4693ef8ab68c978c42bb987634eabcad92d592d)

6 years agoFix bug #10817.
Richard Heck [Thu, 22 Feb 2018 20:40:05 +0000 (15:40 -0500)]
Fix bug #10817.

Respect 'literal' setting when calculating longest bibitem.

(cherry picked from commit 224e56c935074729b39aa59994d3e42031f6db17)

6 years agoRespect "literal" setting when entering citation via LyX server.
Richard Heck [Thu, 22 Feb 2018 20:24:28 +0000 (15:24 -0500)]
Respect "literal" setting when entering citation via LyX server.

This requires moving the bool that tracks this somewhere that it
is visible from BufferView. It seemed to make sense to put it as
a static member of InsetCitation.

(cherry picked from commit f8e8877f839dcd0d133e6982d107b7d167c524c3)

6 years agoImplement IsTocCaption for normal layouts.
Juergen Spitzmueller [Wed, 21 Feb 2018 15:37:07 +0000 (16:37 +0100)]
Implement IsTocCaption for normal layouts.

But use default "true" to maintain current behavior if not explicitly
stated otherwise.

Fixes: #11045
(cherry picked from commit 8a703573ea9718a06c94522e40671d46f0b83522)

6 years agoAdd Alex Dunlap to our contributors
Jean-Marc Lasgouttes [Wed, 21 Feb 2018 11:05:40 +0000 (12:05 +0100)]
Add Alex Dunlap to our contributors

(cherry picked from commit 4447fb349cbbc18f0aaebd9010fb320700d58c79)
(cherry picked from commit 6d582e5e50e5ccc91bfb0565fef51ccff995481c)

6 years agosave session when we save a buffer
Alexander Dunlap [Thu, 15 Feb 2018 19:28:34 +0000 (11:28 -0800)]
save session when we save a buffer

Implements enhancement #10712.

(cherry picked from commit cca365f26c7d541cc13453fc42fc9b6de7736319)

6 years agoUse parMetrics to access the par_metrics_ map
Jean-Marc Lasgouttes [Mon, 12 Feb 2018 16:11:09 +0000 (17:11 +0100)]
Use parMetrics to access the par_metrics_ map

In cursorY, it is dangerous to access par_petrics_[0], since one does
not know whether metrics have been computed for this paragraph (which
may be off-screen).

It is safer to use parMetrics(0), that will compute the paragraph
metrics as needed.

Fixes bug #8120.

(cherry picked from commit a25b48f86cdde98bbd5f8ece06c6bf2f12ee84db)

6 years ago* layouttranslations reviewed by Inaki
Pavel Sanda [Sat, 17 Feb 2018 18:07:02 +0000 (19:07 +0100)]
* layouttranslations reviewed by Inaki

6 years ago* eu.po - update from Inaki.
Pavel Sanda [Sat, 17 Feb 2018 18:01:53 +0000 (19:01 +0100)]
* eu.po - update from Inaki.

6 years agoupdate status
Juergen Spitzmueller [Fri, 16 Feb 2018 17:19:05 +0000 (18:19 +0100)]
update status

6 years agoRevove unused variable
Juergen Spitzmueller [Fri, 16 Feb 2018 16:47:14 +0000 (17:47 +0100)]
Revove unused variable

6 years agoOpen intitle command explicitly also for passthru.
Juergen Spitzmueller [Wed, 27 Dec 2017 10:49:54 +0000 (11:49 +0100)]
Open intitle command explicitly also for passthru.

(cherry picked from commit 87960e3dd892cd7c60925efd44d40f593ac7883e)

6 years agoUse TeXOnePar for the inpreamble layouts
Juergen Spitzmueller [Tue, 26 Dec 2017 12:11:00 +0000 (13:11 +0100)]
Use TeXOnePar for the inpreamble layouts

This considers paragraph language and spacing (and simplifies the code)

(cherry picked from commit a2f886d52617815e8c80f12ef66198307d3432d6)

6 years agoFix inpreamble styles.
Juergen Spitzmueller [Tue, 26 Dec 2017 10:40:58 +0000 (11:40 +0100)]
Fix inpreamble styles.

(cherry picked from commit e55e9c842f25b4425db362cd5cb487187f34ba2b)

6 years agoFix switch of language and line spacing in InTitle commands.
Juergen Spitzmueller [Sat, 23 Dec 2017 12:25:13 +0000 (13:25 +0100)]
Fix switch of language and line spacing in InTitle commands.

Fixes: #9332, #10849
(cherry picked from commit 49e3f8e830a7c8a15f4d9f73e4dab78e93b24bf7)

6 years agoRecreate citation label after paste
Juergen Spitzmueller [Wed, 6 Dec 2017 08:11:18 +0000 (09:11 +0100)]
Recreate citation label after paste

Fixes: #10829
(cherry picked from commit 7e34e659431691fd723e408010f90973c0a25b39)

6 years ago* UserGuide - add sentence about graphic groups unification.
Pavel Sanda [Thu, 15 Feb 2018 21:41:43 +0000 (22:41 +0100)]
* UserGuide - add sentence about graphic groups unification.

6 years ago* status file
Pavel Sanda [Thu, 15 Feb 2018 20:48:47 +0000 (21:48 +0100)]
* status file

6 years agoOops, asInsetGrpahics is new to master.
Pavel Sanda [Thu, 15 Feb 2018 20:48:23 +0000 (21:48 +0100)]
Oops, asInsetGrpahics is new to master.

6 years agoCosmetics per JMarc's suggestions.
Pavel Sanda [Fri, 9 Feb 2018 22:46:14 +0000 (23:46 +0100)]
Cosmetics per JMarc's suggestions.

6 years agoUnify graphics-groups inside marked block functionality.
Pavel Sanda [Thu, 8 Feb 2018 20:33:37 +0000 (21:33 +0100)]
Unify graphics-groups inside marked block functionality.

Fixes #11026.

https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg203683.html

6 years agoMerge remote-tracking branch 'features/properpaint' into 2.3.2-staging
Jean-Marc Lasgouttes [Thu, 15 Feb 2018 13:08:16 +0000 (14:08 +0100)]
Merge remote-tracking branch 'features/properpaint' into 2.3.2-staging

This makes sure that painting actually happens at paint events, making
display more fluid.

6 years agoFix ghost caret
Jean-Marc Lasgouttes [Mon, 8 Jan 2018 10:49:40 +0000 (11:49 +0100)]
Fix ghost caret

This fixes a regression in e64ea357, where a test has been (badly)
tightened to avoid that two consecutive rows may be redrawn to get rid
of caret ghosts. The test prohibited empty rows from being redrawn.

Moreover, improve the test of cursor boundary to avoid the case where
cursor position is already 0.

Fixes bug #10952.

(cherry picked from commit 66c677b9463feb0687a8228603f86eddd4e859fd)

6 years agoFix compilation in monolithic mode
Jean-Marc Lasgouttes [Sat, 6 Jan 2018 19:46:06 +0000 (20:46 +0100)]
Fix compilation in monolithic mode

(cherry picked from commit 3aa10c8dbaf4813fb30d6e9487a5d50720c7affd)

6 years agoUse a backing store on macOS
Jean-Marc Lasgouttes [Sat, 25 Nov 2017 11:31:11 +0000 (12:31 +0100)]
Use a backing store on macOS

Qt on macOS does not respect the Qt::WA_OpaquePaintEvent attribute and
clears the widget backing store at each update. Therefore, we use our
own backing store in this case.

This restores a simplified version of the code that was removed at 06253dfe.

(cherry picked from commit 2316435f2fd2da28c70e1b251b852d3bf6d8011a)

6 years agoMake sure that rows are repainted when they get (un)selected
Jean-Marc Lasgouttes [Wed, 29 Nov 2017 10:16:09 +0000 (11:16 +0100)]
Make sure that rows are repainted when they get (un)selected

The bug is the following: when selecting several paragraphs quickly
enough, some rows do not get selected.This is a consequence of the
removal of row crc, which lead to not taking into account the
selection status of the row in the decision to repaint.

The solution chosen here is to add a Row::change() helper function to
modify row members. This will set the Row changed status whenever the
value of the member changes.

(cherry picked from commit ae60749f89fb4ee0fca05ac75979d434f6b0401d)

6 years agoFixup ac4bcb12
Jean-Marc Lasgouttes [Fri, 24 Nov 2017 22:36:28 +0000 (23:36 +0100)]
Fixup ac4bcb12

Cursor at end of paragraph should be treated as if boundary was on.

(cherry picked from commit d01dd54bf14167e880c1d0a6382b87e622c2c2ed)

6 years agoAvoid some caret ghosts
Jean-Marc Lasgouttes [Thu, 23 Nov 2017 14:38:17 +0000 (15:38 +0100)]
Avoid some caret ghosts

When the caret is at end of row, if may happen that it is drawn after
the end of the row. In this case caret blinking will not work
properly. This patch extends the row background on the left and right
by Inset::TEXT_TO_INSET_OFFSET. This is only a hack that will not work
if the caret has a ridiculous width like 6.

Additionally, introduce some (disabled) debug code that numbers the
rows on screen by painting order.

Finally, make the code that detects whether the caret was in a given
row more precise (take boundary into account).

Fixes (mostly, see above) bug #10797.

(cherry picked from commit e64ea3576c4534fc647a74d1c9f5e67db39ef783)

6 years agoRemove row crc computation
Jean-Marc Lasgouttes [Sat, 11 Nov 2017 11:40:39 +0000 (12:40 +0100)]
Remove row crc computation

This computation did not make sense anymore since we began to put the
contents in the Row object. The fact that it worked was a coincidence.

Instead, we set rows as changed() on creation and reset that once they
have been drawn. This will allow in the future for a finer definition
of what to redraw or not.

Also update the PAINTING_ANALYSIS document

(cherry picked from commit 9e2da4a3eac83f46ab184ea8d674f84643814017)

6 years agoStore change bar information in row element
Jean-Marc Lasgouttes [Sat, 11 Nov 2017 10:57:39 +0000 (11:57 +0100)]
Store change bar information in row element

It is wrong to compute this at paint time. In general, painting a row
should not require any access to a paragraph object, but we are far
from there now.

(cherry picked from commit 4858bb3bb68aac142815b530a017e3776d1c7c11)

6 years agoAllow multiple calls to processUpdateFlags before redraw
Jean-Marc Lasgouttes [Wed, 11 Oct 2017 16:00:48 +0000 (18:00 +0200)]
Allow multiple calls to processUpdateFlags before redraw

The goal of this commit is to ensure that a processUpdateFlags call
that requires no redraw will not override a previous one that did
require a redraw.

To this end, the semantics of the flag argument is now different: its
value is now OR'ed with a private update_flags_ variable. This
variable is only reset after the buffer view has actually been
redrawn.

A new Update::ForceRedraw flag has been added. It requires a full
redraw but no metrics computation. It is not used in the main code
(yet), but avoids to compute metrics repeatedly in consecutive
processUpdateFlags calls.

The process is now as follows:
- if flags is just None, return immediately, there is nothing to do.
- the Force flag is honored (full metrics computation) and replaced
  with ForceDraw.
- the FitCursor flag is honored and removed from the flags.
- the SinglePar update is added if ForceDraw is not in flags and only
  the current par has been modified.

The remaining flags are only then added to the BufferView update
flags, and the update strategy is computed for the next paint event.

Finally the dubious call to updateMacros in updateMetrics has been
removed for performance reasons.

(cherry picked from commit 8d8988de475bf2055f253823e53fd5627be5de78)

6 years agoCreate new method GuiWorkArea::Private:::updateCaretGeometry
Jean-Marc Lasgouttes [Mon, 2 Oct 2017 15:07:31 +0000 (17:07 +0200)]
Create new method GuiWorkArea::Private:::updateCaretGeometry

This replaces a showCaret/hideCaret pair and avoids an update.

Also remove an update() call in resizeBufferView: is is not necessary
since we are already in a pintEvent handler.

(cherry picked from commit add342d088c1b65343234576a35e567507fb2d49)

6 years agoImprove the logic of caret repainting
Jean-Marc Lasgouttes [Fri, 29 Sep 2017 08:29:39 +0000 (10:29 +0200)]
Improve the logic of caret repainting

For some reason the existing code only considered the bottom row that
contained the cursor. There is no need for that, and actually it
caused painting problems in nested insets.

Tweak the logic of repaint_caret_row_ a bit: there is no need for
repainting when there is currently no caret on screen.

(cherry picked from commit 764a153c69bb9b46a6e6872ce48e06f5f867cc53)

6 years agoFix bad refresh when changing zoom level
Jean-Marc Lasgouttes [Wed, 27 Sep 2017 15:52:06 +0000 (17:52 +0200)]
Fix bad refresh when changing zoom level

Replace the tricky code in LFUN_SCREEN_FONT_UPDATE and replace it with
proper use of DispatchResult flags.

LFUN_BUFFER_ZOOM* does not need to call LFUN_SCREEN_FONT_UPDATE, since
it already does everything that is required.

(cherry picked from commit 9df59aac63bbb56d9d5f5ddcccfaa3ebace2f03d)

6 years agoDo not presume what the defaults for a new QPainter are
Jean-Marc Lasgouttes [Mon, 18 Sep 2017 09:21:18 +0000 (11:21 +0200)]
Do not presume what the defaults for a new QPainter are

(cherry picked from commit 275d306c73e3e0f60e0742adbcb06cce98c48ee5)

6 years agoRemember correctly pixel ratio used for painting
Jean-Marc Lasgouttes [Mon, 18 Sep 2017 08:58:07 +0000 (10:58 +0200)]
Remember correctly pixel ratio used for painting

This avoids endless resize issues on HiDPI systems (e.g. Retina Mac).

Rename pixel_ratio_ to last_pixel_ratio_ to emphasize that this is a
cached value.

Inline needResize method to make the logic clearer in paintEvent.

(cherry picked from commit 6532e5104dfad5416817d89a5f91e53c30cdd523)

6 years agoCompute metrics when graphics is updated
Jean-Marc Lasgouttes [Thu, 14 Sep 2017 13:50:30 +0000 (15:50 +0200)]
Compute metrics when graphics is updated

Remove the old schedule_redraw_ mechanism that was only useful because
of our synchronous drawing code. Now that actual painting is
scheduled instead of forced, it becomes pointless.

Rename WorkArea::redraw(bool) to scheduleRedraw(bool), to show that
the drawing is not done right away.

In GuiView::updateInset, call scheduleRedraw(true), so that metrics
are correctly computed (this was the whole point of the exercise).

(cherry picked from commit a31d3dc67dce9655bee9f1b0a2bc2188d7d97453)

6 years agoUpdate insets position in cache in more cases
Jean-Marc Lasgouttes [Wed, 30 Aug 2017 16:05:16 +0000 (18:05 +0200)]
Update insets position in cache in more cases

This patch makes sure that, every time a ParagraphMetrics has its
position set, the inset positions for the insets held by this
paragraph are remembered too.

This is complementary to BufferView::updatePosCache, but I do not have
hard evidence that this is required other than to increase robustness.
It may help in some cases when scrolling the document (scrollbar,
cursor up/down, page up/down).

6 years agoRename more instances of "cursor" to "caret"
Jean-Marc Lasgouttes [Thu, 24 Aug 2017 15:37:56 +0000 (17:37 +0200)]
Rename more instances of "cursor" to "caret"

Thanks to Pavel for the hint.

6 years agoRemove workaround that is not necessary anymore.
Jean-Marc Lasgouttes [Sun, 23 Jul 2017 13:50:35 +0000 (15:50 +0200)]
Remove workaround that is not necessary anymore.

This code was necessary to handle cases where the insets positions
were not yet in cache. This cannot happen anymore thanks to the
nodraw stage.

6 years agoUpdate the painting process documentation
Jean-Marc Lasgouttes [Sun, 23 Jul 2017 10:39:26 +0000 (12:39 +0200)]
Update the painting process documentation

6 years agoMake input methods support great again
Jean-Marc Lasgouttes [Sat, 22 Jul 2017 22:56:27 +0000 (00:56 +0200)]
Make input methods support great again

This unbreaks input methods by splitting the part of the code that
does the actual drawing to a separate paintPreeditText() method which
is called from paintEvent().

The proper solution would have been to introduce the preedit string in
the Row object, like is done for completion, but this is too complex
to do at this point.

The only change in behavior is that now the commit string is inserted
in one fell swoop, intead of emulating a number of key events.

6 years agoCleanup and simplify WorkArea code
Jean-Marc Lasgouttes [Fri, 21 Jul 2017 23:19:45 +0000 (01:19 +0200)]
Cleanup and simplify WorkArea code

Rename cursor to caret to in order to avoid ambiguity. The caret is
now the blinking thing only.

Remove unused header contents, and some not so useful methods.

No intended change of behavior.

6 years agoFix caret painting
Jean-Marc Lasgouttes [Thu, 20 Jul 2017 21:31:05 +0000 (23:31 +0200)]
Fix caret painting

The trick is to remember in BufferView what has been done at the
previous draw, so that the row that contained the caret can be
repainted if needed.

To this end, add an argument paint_caret to BufferView, although
painting the caret is not the job of the BufferView (at this point).

BufferView::needRepaint will act as an interface with
TextMetrics::drawParagraph to know whether the painting of a given
row should be forced.

Currently everything is done at the top row level, so that, if the
caret is in a large table, the whole table will have to be repainted.
It is not clear yet that this is necessary.

6 years agoDo the actual drawing in the paint event
Jean-Marc Lasgouttes [Fri, 8 Sep 2017 14:55:11 +0000 (16:55 +0200)]
Do the actual drawing in the paint event

Historically, because of two-stage drawing, LyX has been painting on a
Pixmap, and this pixmap is copied to screen at paint event time.

Now that we have three-stage drawing, it is possible to delay the
painting to actual paint event and avoid the intermediate Pixmap.

Known bug: the cursor is never erased.

6 years agothree-stage drawing: add a nodraw stage
Jean-Marc Lasgouttes [Sat, 15 Jul 2017 23:25:03 +0000 (01:25 +0200)]
three-stage drawing: add a nodraw stage

Normally the two stages of drawing are
1/ compute metrics of insets/rows/paragraphs/mathrow...
2/ draw the elements and cache their positions

Now the three stages are
1/ metrics
2/ nodraw: do not draw the elements, but cache their position
3/ draw the elements (and store again their position; it does not
   seems to hurt performance).

Revive the NullPainter: this replaces the setDrawingEnabled mechanism
with a painter that does nothing. The advantage is that updatePosCache
(renamed from setPosCache) does not need anymore to be invoked from
the frontend.

updatePosCache (the nodraw stage) is called at the end of
BufferView::updateMetrics.

6 years agoImplement buffer-anonymize more efficiently
Jean-Marc Lasgouttes [Thu, 15 Feb 2018 11:07:33 +0000 (12:07 +0100)]
Implement buffer-anonymize more efficiently

The work is done now in Paragraph::anonymize().

Move the handling of the lfun to Buffer class.

Document the new feature in release notes.

(cherry picked from commit 1dba36c7cec6aeec2576e7a99e2967e867076a01)

6 years ago* status.23x
Pavel Sanda [Thu, 15 Feb 2018 10:56:34 +0000 (11:56 +0100)]
* status.23x

6 years agoforgotten glitch
Pavel Sanda [Sat, 3 Feb 2018 21:43:00 +0000 (22:43 +0100)]
forgotten glitch

6 years agoLFUN_DOC_ANONYMIZE -> LFUN_BUFFER_ANONYMIZE per JMarc's suggestion.
Pavel Sanda [Sat, 3 Feb 2018 21:05:49 +0000 (22:05 +0100)]
LFUN_DOC_ANONYMIZE -> LFUN_BUFFER_ANONYMIZE per JMarc's suggestion.

6 years agoAdd LFUN_DOC_ANONYMIZE, quick fix for #7259.
Pavel Sanda [Fri, 2 Feb 2018 22:42:56 +0000 (23:42 +0100)]
Add LFUN_DOC_ANONYMIZE, quick fix for #7259.

Backport from master.

6 years agoImplement display of roots more faithfully
Jean-Marc Lasgouttes [Mon, 4 Dec 2017 09:44:49 +0000 (10:44 +0100)]
Implement display of roots more faithfully

This is a follow-up to 758de957.

- unify the metrics and drawing of \sqrt and \root using helper
  functions mathed_root_metrics and mathed_draw_root.

- compute the vertical spacing above the nucleus of the root following
  rule 11 of the TeXbook. In particular, it is different in inline and
  display style.

- draw the root glyph without hard-coded pixel values. Make the line
  width depend on the zoom.

more work is needed to implement properly rule 11:

- Ideally, we should use sqrt glyphs from the math fonts. Note that
  then we would get rule thickness from there.

- The positioning of the root MathData is arbitrary. It should
  follow the definition of \root...\of... in The Texbook in
  Apprendix B page 360.

Fixes bug #10814.

(cherry picked from commit 16af6e7c5067fff0873587af30833e0b8006c435)
(cherry picked from commit 6cb6f78ae9050140c75af089350cd7cccc0b58e1)

6 years agoImprove UndoGroupHelper and use it more
Jean-Marc Lasgouttes [Wed, 13 Dec 2017 10:10:49 +0000 (11:10 +0100)]
Improve UndoGroupHelper and use it more

Now the helper class contains logic that checks whether buffer are
known before closing them. This avoids potential crashes.

Use it in different places to siplify code. It is not clear at this
point whether it should be used everywhere.

Followup to bug #10847.

(cherry picked from commit cd9e42dc3529980257d2b0fe6fd623fd2b99a1e6)

6 years agoBetter handling of multiple buffers in UndoGroupHelper
Jean-Marc Lasgouttes [Wed, 29 Nov 2017 13:10:33 +0000 (14:10 +0100)]
Better handling of multiple buffers in UndoGroupHelper

It may happen that the buffers are visited in order buffer1,
buffer2, buffer1. In this case, we want to have only one undo group
in buffer1. The solution is to replace buffer_ with a set<Buffer*>.

A use case among others is InsetLabel::updateReferences.

(cherry picked from commit cc7364dfc50c399e99158fd9efe2f3eb0e6f4570)