mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-22 18:08:10 +00:00
patch against infinite depth from Martin
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@3593 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
d03f2aab75
commit
bf954a7bc3
@ -1,3 +1,8 @@
|
|||||||
|
2002-02-26 Martin Vermeer <martin.vermeer@hut.fi>
|
||||||
|
|
||||||
|
* text2.C (incDepth): make sure depth cannot be increased beyond
|
||||||
|
reasonable values.
|
||||||
|
|
||||||
2002-02-20 Angus Leeming <a.leeming@ic.ac.uk>
|
2002-02-20 Angus Leeming <a.leeming@ic.ac.uk>
|
||||||
|
|
||||||
* lyxfunc.C (dispatch): act on LFUN_FORKS_SHOW and LFUN_FORKS_KILL.
|
* lyxfunc.C (dispatch): act on LFUN_FORKS_SHOW and LFUN_FORKS_KILL.
|
||||||
|
26
src/text2.C
26
src/text2.C
@ -649,19 +649,25 @@ void LyXText::incDepth(BufferView * bview)
|
|||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
// NOTE: you can't change the depth of a bibliography entry
|
// NOTE: you can't change the depth of a bibliography entry
|
||||||
if (
|
if (textclasslist.Style(bview->buffer()->params.textclass,
|
||||||
textclasslist.Style(bview->buffer()->params.textclass,
|
cursor.par()->getLayout()).labeltype != LABEL_BIBLIO) {
|
||||||
cursor.par()->getLayout()
|
|
||||||
).labeltype != LABEL_BIBLIO) {
|
|
||||||
Paragraph * prev = cursor.par()->previous();
|
Paragraph * prev = cursor.par()->previous();
|
||||||
|
|
||||||
if (prev
|
if (prev) {
|
||||||
&& (prev->getDepth() - cursor.par()->getDepth() > 0
|
const int depth_diff
|
||||||
|| (prev->getDepth() == cursor.par()->getDepth()
|
= prev->getDepth() - cursor.par()->getDepth();
|
||||||
|
// go deeper only if
|
||||||
|
// (1) the previous para is already
|
||||||
|
// deeper (depth_diff > 0)
|
||||||
|
// (2) the previous para is a
|
||||||
|
// list-environment at the same
|
||||||
|
// depth as this para.
|
||||||
|
if (depth_diff > 0 || (depth_diff > -1
|
||||||
&& textclasslist.Style(bview->buffer()->params.textclass,
|
&& textclasslist.Style(bview->buffer()->params.textclass,
|
||||||
prev->getLayout()).isEnvironment()))) {
|
prev->getLayout()).isEnvironment())) {
|
||||||
cursor.par()->params().depth(cursor.par()->params().depth() + 1);
|
cursor.par()->params().depth(cursor.par()->params().depth() + 1);
|
||||||
anything_changed = true;
|
anything_changed = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (cursor.par() == selection.end.par())
|
if (cursor.par() == selection.end.par())
|
||||||
|
Loading…
Reference in New Issue
Block a user