Commit Graph

116 Commits

Author SHA1 Message Date
Vincent van Ravesteijn
cdd802421a Fix bug #5435.
Revert the previous fix and fix the DEPM regression.

This reverts r28910.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29248 a592a061-630c-0410-9148-cb99ea01b6c8
2009-04-15 20:20:42 +00:00
Vincent van Ravesteijn
326a035a5b Fix bug #2213 (part 5): GuiChanges lacks "Previous Change" button.
Make sure we jump to the next or previous change when we switch search direction. Without this patch, the same Change will be found and only the cursor is moved from the end (or begin) to the begin (or end) of the selection.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29115 a592a061-630c-0410-9148-cb99ea01b6c8
2009-04-05 20:16:32 +00:00
Vincent van Ravesteijn
9d1f4a3d98 Fix bug 5435: DEPM doesn't function when leaving an inset
http://bugzilla.lyx.org/show_bug.cgi?id=5435

The code for this was already present, but was never reached.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@28910 a592a061-630c-0410-9148-cb99ea01b6c8
2009-03-25 21:21:00 +00:00
Vincent van Ravesteijn
7580efc7f3 * Cursor.cpp: cosmetics.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@28630 a592a061-630c-0410-9148-cb99ea01b6c8
2009-02-26 21:37:58 +00:00
Vincent van Ravesteijn
f03d2fb6ef Fix bug 5765: http://bugzilla.lyx.org/show_bug.cgi?id=5765.
[visual cursor] Crash when cutting a figure caption and moving the cursor.

Avoid negative positions.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@28629 a592a061-630c-0410-9148-cb99ea01b6c8
2009-02-26 21:29:19 +00:00
Vincent van Ravesteijn
4b775f5393 * Cursor.cpp: compile fix.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@28628 a592a061-630c-0410-9148-cb99ea01b6c8
2009-02-26 21:17:34 +00:00
Vincent van Ravesteijn
e990b98cfd * Cursor.cpp: cosmetics.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@28627 a592a061-630c-0410-9148-cb99ea01b6c8
2009-02-26 21:13:50 +00:00
Vincent van Ravesteijn
28cb308313 Fix bug 5762: http://bugzilla.lyx.org/show_bug.cgi?id=5762.
[visual cursor] Crash when moving left in table in an RTL document 

Avoid negative positions.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@28626 a592a061-630c-0410-9148-cb99ea01b6c8
2009-02-26 21:01:35 +00:00
Vincent van Ravesteijn
0aca981637 Fix bug 5699 (crash when using outliner in child document while the master is not opened).
The problem was that, if the master is not opened, no respective guiDelegate exists, and the functions that update the toc do not trigger. The fix is to update the child's toc backend and toc items directly in such cases. 


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@28551 a592a061-630c-0410-9148-cb99ea01b6c8
2009-02-19 00:29:04 +00:00
Vincent van Ravesteijn
0730c9235a Fix bug 5764: http://bugzilla.lyx.org/show_bug.cgi?id=5764.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@28399 a592a061-630c-0410-9148-cb99ea01b6c8
2009-02-08 14:14:30 +00:00
André Pönitz
6192345f60 add Buffer * member to DocIterator
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27603 a592a061-630c-0410-9148-cb99ea01b6c8
2008-11-17 11:46:07 +00:00
Vincent van Ravesteijn
84a186ebf6 Make sure the selection painting is updated after LFUN_UP or LFUN_DOWN. See http://thread.gmane.org/gmane.editors.lyx.devel/113428
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27567 a592a061-630c-0410-9148-cb99ea01b6c8
2008-11-16 18:03:52 +00:00
Stefan Schimanski
481aff5aff * notifyCursorEnters called on insets when the cursor entered
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27465 a592a061-630c-0410-9148-cb99ea01b6c8
2008-11-15 17:11:01 +00:00
André Pönitz
f1cba8ff64 more latin1..utf8 schanges. all of src/* should be utf8 now
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27425 a592a061-630c-0410-9148-cb99ea01b6c8
2008-11-14 15:58:50 +00:00
Dov Feldstern
13cf13c690 fix a bug in visual cursor movement
The setting of boundary need to take the paragraph's direction (LTR/RTL) into
account.

This bug was discovered by Vincent, while trying to solve bug #5061.

While this fixes the original manifestation of bug #5061, it doesn't really
solve the underlying issue, which is that on a boundary, after typing
Ctrl-Enter, the cursor is painted on the same line as the newline symbol
rather than on the new line. See bugzilla for further discussion of this.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27225 a592a061-630c-0410-9148-cb99ea01b6c8
2008-11-01 17:00:58 +00:00
Enrico Forestieri
02ebfa000b Fix bug 3397
http://bugzilla.lyx.org/show_bug.cgi?id=3397


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26934 a592a061-630c-0410-9148-cb99ea01b6c8
2008-10-17 21:40:11 +00:00
Abdelrazak Younes
7bd33462a0 Avoid a complete Toc reset in case when only a toc item update is needed.
* Buffer: new updateTocItem() signal (with Delegates and GuiView associates).
* TocBackend: take care of the signal emission instead of the Cursor::checkBufferStructure()
* TocModel: new updateTocItem() method.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26636 a592a061-630c-0410-9148-cb99ea01b6c8
2008-09-30 09:50:54 +00:00
Abdelrazak Younes
5731e7faae Small cleanup in order to improve toc change detection within insets.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26574 a592a061-630c-0410-9148-cb99ea01b6c8
2008-09-26 10:37:24 +00:00
André Pönitz
4c7fdddd74 streamlining setter syntax. using mutable references seems a bit
outlandish compared to the rest of LyX


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26527 a592a061-630c-0410-9148-cb99ea01b6c8
2008-09-24 21:27:41 +00:00
Enrico Forestieri
1383629299 Fix bug 5246
http://bugzilla.lyx.org/show_bug.cgi?id=5246


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26403 a592a061-630c-0410-9148-cb99ea01b6c8
2008-09-14 17:51:46 +00:00
Pavel Sanda
1dadaa5890 When only selecting the end_margin between 'after i-1' and 'before i', the
anchor is incorrectly set to be equal to the cur. This is because comparing two
CursorSlices does not take into account the boundary property (because the
CursorSlice does not know this).

Patch by Vincent.

http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg143572.html



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26393 a592a061-630c-0410-9148-cb99ea01b6c8
2008-09-13 23:03:33 +00:00
Jean-Marc Lasgouttes
17dd645862 Bug 5173: Undo Grouping
http://bugzilla.lyx.org/show_bug.cgi?id=5173

	* Undo.cpp (beginUndoGroup, endUndoGroup): new methods.
	(UndoElement): add group_id member
	(UndoElementStack): when removing old undo entries, make sure to
	remove whole groups.
	(Undo::Private): add group_id and group_level (for nesting) members.
	(doTextUndoOrRedo): new method. Apply _one_ UndoElement.
	(textUndoOrRedo): call doTextUndoOrRedo on each element of the current
	group.
	(recordUndoFullDocument): put inside an undo group

	* Cursor.cpp (beginUndoGroup, endUndoGroup): new methods.

	* LyXFunc.cpp (dispatch): add calls to (begin|end)UndoGroup.

	* lyxfind.cpp (replaceAll): use several recordUndo instead
	of one recordUndoFullDocument.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26178 a592a061-630c-0410-9148-cb99ea01b6c8
2008-08-15 19:24:56 +00:00
Richard Heck
6f7136fc7b whitespace.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26148 a592a061-630c-0410-9148-cb99ea01b6c8
2008-08-13 19:58:00 +00:00
Richard Heck
cf33f88943 We should at least also check the index. But probably more is needed.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26147 a592a061-630c-0410-9148-cb99ea01b6c8
2008-08-13 17:05:34 +00:00
Jean-Marc Lasgouttes
3589a75a11 clearSelection invokes resetAnchor
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26145 a592a061-630c-0410-9148-cb99ea01b6c8
2008-08-13 15:13:37 +00:00
Jean-Marc Lasgouttes
4d63bd347b constification without any code change. This is part of and effort to see whether BufferView::cursor() could be made const
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26141 a592a061-630c-0410-9148-cb99ea01b6c8
2008-08-13 13:46:19 +00:00
Richard Heck
939503ee85 Fix crash reported on the list involving multicell selections. We have to
be careful to check for that!


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26102 a592a061-630c-0410-9148-cb99ea01b6c8
2008-08-08 21:26:18 +00:00
Enrico Forestieri
a694de895e Fix bug 3938
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25028 a592a061-630c-0410-9148-cb99ea01b6c8
2008-05-31 20:54:50 +00:00
Abdelrazak Younes
eb28cb8755 Unify Paragraph::asString() methods.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24882 a592a061-630c-0410-9148-cb99ea01b6c8
2008-05-22 14:01:33 +00:00
Dov Feldstern
ffda0d89b4 refactoring visual cursor movement functions
Specifically, moved the functions which actually move left or right from Text
into Cursor, and changed the semantics so that they now return whether or not
the cursor has moved. The functions in Text now use the new functions in Cursor.

This change is being made in preparation of the Word-level visual movement.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24601 a592a061-630c-0410-9148-cb99ea01b6c8
2008-05-04 20:17:59 +00:00
Jean-Marc Lasgouttes
9b4a26a252 rename assert.h to lassert.h
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24559 a592a061-630c-0410-9148-cb99ea01b6c8
2008-04-30 08:26:40 +00:00
Dov Feldstern
5dfa0c0381 visual mode for bidi cursor movement --- in tables
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24235 a592a061-630c-0410-9148-cb99ea01b6c8
2008-04-11 12:02:10 +00:00
André Pönitz
7f461f4392 infrastructure for 'graceful asserts'
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24216 a592a061-630c-0410-9148-cb99ea01b6c8
2008-04-10 21:49:34 +00:00
André Pönitz
a98f82c292 s/kb_action/FuncCode/g
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23749 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-15 01:20:36 +00:00
Stefan Schimanski
e01f7e7105 * fix a serious data loss problem: undo did not save the whole
selection in mathed if more than one cell was selected.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23675 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-12 00:59:29 +00:00
Richard Heck
a01cb111a0 Change the interface to a paragraph's layout. We still store a LayoutPtr, but now privately, and make a Layout const & available to clients.
The need for a LayoutPtr arises from the fact that (a) we do not want to give our clients a Layout &, since we do not want them to be able to change our Layout; but (b) we also need to be able to change which layout is ours. So we cannot store a Layout const &. Or so it seems to the compiler.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23522 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-06 21:31:27 +00:00
Abdelrazak Younes
a4d5b78430 Transfer and bug fix LFUN_BUFFER_BEGIN/END_SELECT to BufferView.cpp
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23512 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-06 15:39:30 +00:00
Stefan Schimanski
770b230704 * some more unused buffer parameters
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23454 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-04 15:05:16 +00:00
Stefan Schimanski
03a1c9192e * store the selection in the InsetMathUnknown and insert it into the
first argument after finalizing the macro. This also works with real
  math macros.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23449 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-04 14:49:24 +00:00
Abdelrazak Younes
017ba3c4c7 Sanitize a bit the way InsetRef and InsetCommand button are drawn.
* Inset::validate(): renamed to initView()

* InsetCommand:
- get rid of unneeded refresh() and updateButtonLabel_
- setParams(): call initView()

* InsetRef:
- implement initView()
- screenLabel(): transfer code to updateLabels()
- addToToc(): prefix name with BROKEN if the reference is broken.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23417 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-03 17:58:26 +00:00
Abdelrazak Younes
7cd9525197 rev 23399: the fix was not fully correct because labels are not editable.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23400 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-02 18:49:49 +00:00
Abdelrazak Younes
00d6906d04 Introduce Inset::validate() for Inset validation purpose upon interactive creation. In this commit this is used to validate a newly inserted label. As an added bonus, broken cross-references will be automatically fixed if the corresponding label is created.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23399 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-02 18:14:12 +00:00
Abdelrazak Younes
f600486a37 Cursor::insert(): Fix crash with math. Problem was that the inset pointer was released by MathAthom
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23363 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-29 20:55:56 +00:00
Stefan Schimanski
d1c74a4cd2 * boundary is false implicitely for all slices below the top slice
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23347 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-29 08:27:22 +00:00
Abdelrazak Younes
380ffa0c76 Cursor::insert(): no reason to exclude mathed. Non willing math insets (MathChar) should provide a stub method for setBuffer().
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23326 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-28 15:40:50 +00:00
Abdelrazak Younes
78d63575ca revert revision 23324 and implement a better more general fix in Cursor::insert().
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23325 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-28 15:36:48 +00:00
André Pönitz
1cca0a86bd API cosmetics
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23295 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-27 23:03:26 +00:00
André Pönitz
db8c16d554 progress on buffer-reference-in-insets. beware of instabilities...
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23289 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-27 20:43:16 +00:00
Stefan Schimanski
249e6b7ac0 * update the words of a paragraph when the cursor leaves.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23260 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-26 19:20:12 +00:00
Dov Feldstern
4056f0ddb1 fix a visual cursor edge-case:
Only when an LTR paragraph *ends with* an RTL chunk of text, movement was 
incorrect in two ways:

1. After moving into the pargraph from the end, and then trying to move towards
the beginning of the paragraph, the cursor would immediately jump to the 
previous pargraph.

2. If the cursor were placed inside the RTL text, and then we would move left
towards the beginning of the paragraph, upon reaching the end (beginning?) of
the RTL chunk, cursor would jump to the end of the paragraph, and then continue
as in (1).

(Same thing, of course, with the reverse situation, i.e., RTL paragraph ending
with LTR text).

We now deal with both of these cases correctly.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23173 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-24 01:45:51 +00:00