These uses are inefficient (a loop really) and require that pit_type
is ptrdiff_t.
Instead, RandomAccesslist::constIterator is renamed to iterator_at and
a version adding a non-const iterator is added. Additionally, the
method retirns end() when position is equal to the size of the
container (see #11861).
lyx::next and lyx::prev are removed, and std::prev is used in the few
places where the code requires it (for no good reason IMO).
These uses are inefficient (a loop really) and require that pit_type
is ptrdiff_t.
Instead, RandomAccesslist::constIterator is renamed to iterator_at and
a version adding a non-const iterator is added.
lyx::next and lyx::prev are removed, and std::prev is used in the few
places where the code requires it (for no good reason IMO).
There is no need to change the cursor's position to the beginning of
the line.
This change does not affect the behavior of using the buttons in the
Outliner pane, but is useful for using the keyboard shortcuts.
Move cursor at beginning of selection after deletion. Else backspace
operation gets stuck in a loop (tries to remove the selection again
and again).
This also fixes backspace deletion of insets with confirmDeletion() == true.
Fixes#11630
1/ When inserting an inset over a selection, it makes sense if the
selection covers a complete or several paragraphs to reset the layout of
the paragraph that contains the inset to plain layout. In general the
inner inset will have the needed layout information and it does not
make sense to keep this information outside.
However, when the inset forces plain layout, it does not make sense to
do that and the outer layout is preserved.
Some code that duplicates what is done in pasteSelectionHelper is also
removed.
2/ Similarly, when dissolving an inset, do not reset the layout of the
first paragraph if the inset was alone in its own paragraph.
Note that this does not work as intended when change tracking is enabled.
Fixes bugs #10266 and #10369.
When a selection spans more than one line, we now check for whether
there is a change at one position after the last position of each
fully selected line.
This fixes#11629.
The idea is simple: we insert a pre-formatted table (with a given border
style currently, but other attributes are possible as well) via file-insert
and scale it then to the requested size.
We need three sizes (1x1, 1x2 and 1x3) to generate all sizes properly (due
to border specifications).
Currently, these styles can only be accessed via lfun tabular-style-insert
and the Tabular Create dialog.
My plan is to add a buffer param to set a default style (#9901) which then
also is respected by the toolbar button and probably a layout tag to let
classes specify a default style (#8360).
Several changes are needed to get things right:
* nested supersripts only work with inheritFonts=true.
* to get caret position right, it is necessary to remember the outside
font of the inset before computing metrics.
* to get the size right at insertion time, it is necessary to trigger
a metrics computation just after inset insertion.
This commit was wrong because a reference variable can never be
re-assigned (it would change the original variable). I learn C++
pitfalls every day.
Fixes bug #11512.
This reverts commit 10e2c65835.
The last 20 applications are saved now and accessible both via the lfun
(textstyle-apply n) and the toolbar (via button menu)
Fixes: #7133
This also changes the default icon and toolbar position of the action,
as requested in #11427
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.
When selecting text, in some cases a DocIterator could be forwarded
to a (non-existant) paragraph after the end. The critical part of
this fix is to break the loop at the correct place. The following
are additional improvements:
- increase readability by defining a bool named "in_last_par"
- use cur.selectionEnd().pit() instead of cur.selectionEnd().paragraph().id()
- use it.lastpos() instead of it.paragraph().size()
This commit fixes a regression introduced by 23de5e5e, and reported
at #11204.
Thanks to Jürgen and JMarc.
* 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
The part of code that removed space at start of paragraph have been
there forever, but its intent is unclear. For example, cutting text at
the end of a paragraph will lead to remove space at the start of this
same paragraph.
The removal of this functionality is offset by a rewrite of DEPM that
makes it more thorough.
Fixes bug #10503.
The goal of this patch is to make "self-insert <string>" act as a
sequence of individual self-insert calls. Once it is done, the
insertion of the commit string in GuiWorkArea can use that, which
fixes the issues described in bug 11183.
1/ in InsetMathNest, SELF_INSERT is rewritten to be a proper loop of
interpretChar, instead of inserting the string as characters. This
solves the issue of interpreting ^ properly.
2/ the text version does not need to be changed (the loop is rewritten
using a range, though).
3/ Then {{{GuiWorkArea::inputMethodEvent}}} is changed to invoke
directly self-insert. This removes the update issues.
Fixes bug 11183.
This is like `layout', except that the layout is reset to default if
it was already correct. In the case of a selection, the layout is set
normally if some layouts in the selection are not at the required
layout; it is reset only if all the layouts of the selection already
have the required layout.
Part of ticket #9864.
Factor out some code in helper functions. Improve getStatus so that
icon is selected only when the whole selection has the correct layout.
This work towards ticket #9864.