Useful to cache copies of objects, including shared_ptrs. No risks of dangling
pointer, and avoid naked pointers in the source.
Fix memory leak when compiling with Qt5.
As part as the backport to stable, this code has been change to work
with C++98.
(cherry picked from commit 33b696c8ac)
(cherry picked from commit e04079aa52)
(cherry picked from commit 5211ca52ca)
(cherry picked from commit 8353a53cc3)
After a Theorem environment, LaTeX does by default indent the
following paragraph.
I checked various classes and no ModifyStyle was needed. The
hollywood and broadway classes are strange cases where there is an
indent after the Theorem environment, but it is much smaller than
the normal indent. The indent is the same as the opening indent of
normal text, which we currently ignore. Further, I don't expect it
is common to use theorems in these classes.
(cherry picked from commit f9ee47dfa2)
This empty inset caused problems with LuaTeX + system fonts (see
b863fb07). Although these problems seem to be resolved, this empty
inset is not supposed to be there.
The current version was wrong for non-English dialogs, and even for
the English one, due to the translator commands that were not removed
for calculation (as in "Formats[[output]]").
When using Qt stuff in breakAt, it may happen that the row is broken
after an hyphen (whereas the old code would only consider spaces).
The fact that we abuse the Row::right_boundary() property to detect when
a row should be flushed broke justification when a row is cut at an
hyphen.
Fix this by introducing a new Row::flushed() property and set it as needed.
(cherry picked from commit 8e7d0c2002)
The code that tries to decide whether it is worth splitting a given
text row element had a shortcoming: it did not take into account the
left margin of the new row that would be created.
The problem is that this left margin is not the same as the left
margin of the current row, because there can be for example
indentation effects.
To fix this problem, we pass the amount of available space on the
next row as a parameter of Row::shortenIfNeeded.
Note that there is no need to care about RtL row elements at this
point, since the bidi algorithm will be applied to the row
subsequently.
(cherry picked from commit 8491962c6b)
They are shown on screen by arrow or pilcrow symbol and cause a line break.
They are still not handled in LaTeX output, though.
(cherry picked from commit 6dfbab3124)
Whenever an argument delimiter is used inside the argument, the argument
needs to be grouped, that is
\cites({text (text) text})
or
\cite[{text [text] text}]
This fixes the original case reported in #2751 which is independent
from the general issue that the pre- and postnote field take literal
code.
It seems that QTextLayout does not handle properly a single character
with 0 width. This breaks drawing of things like \not.
No status line needed as this amends 24648404.
PLEASE work in branch for the doc files. There is no reason not to release improved manuals with the next bugfix release. Only new features of LyX 2.3 are only for master.
When cloning InsetExternal, the tempname_ member of InsetExternalParams
has yet to be initialized. So, trying to remove it causes the warning
"QFile::remove: Empty or null file name".
(cherry picked from commit 25e6b5da39)
The QTextLayout handling is terribly slow on Qt 4.8.7, but some
caching has been added in Qt5 that makes it much faster. For some
reason, it is not that slow with Qt 4.8.1.
Caches are introduced for the three following methods
* width(doctring), controlled by CACHE_METRICS_WIDTH. This cache already
existed, but the code has been cleaned up
* getTextLayout, controlled by CACHE_METRICS_QTEXTLAYOUT (disabled by
default on Qt5, which does its own caching). This is used for pos2x
and x2pos and now for drawing of text too. The previous code used a
trivial caching scheme of the last used QTextLayout, but now they
are properly kept in a QCache. Moreover, the cacheEnabled() property
is enabled for these QTextLayout object (not sure what this does).
* breakAt, controlled by CACHE_METRICS_BREAKAT. This is the only user
of QTextLayout which did not have some kind of caching already.
For some weird reasons related to Argument-dependent look-up, the
qHash(docstring) function has to be defined in std namespace, since
lyx::docstring is actually std::basic_string<wchar_t>.
(cherry picked from c5119c97fc)