In several range-based for loops, implicit copies are made. Remove
that when possible, and try to shut converity up otherwise.
Fixes issues found by coverity.
These are just annoying. Note that the language mark cannot currently
be specified in a layout file, but it is not clear that there is a
need for that. Therefore I used the simple and hackish way.
This is actually a generic InsetInfo issue:
1/ the contents of the inset is computed in updateBuffer, so that it
is available for drawing but also for latex output (think batch
export). When it is called, it deletes the existing inner paragraph
and replaces it by a new one
2/ metrics build a new Row object that represents to paragraph
3/ draw() relies on this information
Now, imagine that updateBuffer() is called after metrics(). This can
happen for many reasons, and does happen here (display a shortcut info
and change the shortcut file from cua to emacs).
This problem has been here forever, but is only visible now that the
(experimental) bookmark display code needs to read the underlying
paragraph id.
The solution is to compute the inset contents at metrics time. This
is done by moving the relevant code to a new standalone build() method
that is called in metrics() but also in latex().
It turns out that the resources were mostly not used anyway. Removing
them shrinks LyX binary by ~6MB.
Only autotools have been adapted. cmake will require the same
simplification.
Fixes: #11508
Now there is the opposite case which needs to be addressed:
If no translation is available for a shortcut in a non-latin-scripted
document, we need to switch the language to English.
This returns a localized version of a string (in the GUI language)
if available, removing trailing colons and accelerator marks.
This can be used to refer to dialog items in the docs in a portable way.
QKeySequence returns special characters for keys on the mac rather than
textual key names (as on other OSes).
Since these symbols are not included in many fonts, we re-translate them
to textual names
Fixes: #10641
When searching for and item in the menu, also try to consider those that
require a BufferView (such as View/Update formats).
Also, be explicit for the default format in order to find it.
Fixes: #9851
This is a low hanging fruit, since it's already available (although
quite hidden)
Generally, output "not set" i a pref is not set rather than an empty
string.
With this commit, info insets leave the dark backstage room of an opaque
and quite hidden dev-only feature and come frontstage.
In the UI, they present themselves as "Fields" since this is what people
know from word processors. Other user-related fields that could be
implemented next: time, user name (I plan to do that for 2.4).
Since this supersedes date-insert, I removed Insert > Date from
the menu and propose to ditch date-insert and the corresponding rc.
The lyx2lyx reversion routine has lots of room for improvement and
attractive tasks for pythons (file timestamp, switch of localization).
Please feel invited!
This is a file format change.
* use the context language of the info inset (rather than the buffer
language), and translate strings accordingly
* for menu and shortcuts, use the Gui language instead
* actually care that all translatable strings end in po
(this wasn't the case).
Fixes: #5348, rest of #10463
VCS InsetInfos were broken by the switch at 2e934fc5f8 to using
updateBuffer to handle them. But we do not really want to go through
that routine in a clone, not for those insets, whose contents we
want to be the same as in the original Buffer.
Also fixes some issues noted in discussion of this bug: Failure to
update after context menu switch; failure to re-calculate shortcuts,
which can change.
The current spelling is not strictly wrong, but flagged as unusual or
historical by some authorities. It is also found fault with many
spell checkers. Thus we decided to move to the more standard "-ible"
form once and for all.
See #10678 for discussion
This part covers the most tricky part: the internal naming.
Translations and layouts will follow.
This will all also all be backported to 2.3.x, for the sake of backwards
compatibility (cherry-picking).