Commit Graph

189 Commits

Author SHA1 Message Date
Enrico Forestieri
9e423f23fa Spare a few cpu cycles on average.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32474 a592a061-630c-0410-9148-cb99ea01b6c8
2009-12-11 01:46:57 +00:00
Enrico Forestieri
c2befc2b1e Fix bug #6382: Wrong cursor placement when inserting math
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32473 a592a061-630c-0410-9148-cb99ea01b6c8
2009-12-11 01:30:33 +00:00
Enrico Forestieri
38a6848ecd Fix bug #6342: Pasting-bug in math-mode sub- and super-scripts
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32162 a592a061-630c-0410-9148-cb99ea01b6c8
2009-11-23 00:59:18 +00:00
Vincent van Ravesteijn
92c8561674 Some cosmetics after r32157.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32159 a592a061-630c-0410-9148-cb99ea01b6c8
2009-11-22 21:45:51 +00:00
Vincent van Ravesteijn
f4125a65c0 Fix bug #6320: LyX goes to infinite loop when selecting document parts.
Set the boundary member correctly when the cursor goes to an 'empty' row.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32034 a592a061-630c-0410-9148-cb99ea01b6c8
2009-11-15 22:01:12 +00:00
Enrico Forestieri
3f3bedd0d9 Fix another instance of missing buffer in math. This is needed when
pasting a macro inside another math inset (such as \text or \hat). In
this case the buffer would not be set and getMacro() cannot be called,
such that an "internal" macro would still shadow an user defined one.
This kind of fix is now easy after Abdel's overhaul.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31998 a592a061-630c-0410-9148-cb99ea01b6c8
2009-11-15 01:03:03 +00:00
Jean-Marc Lasgouttes
7bf3d5cad0 Rename getLocalStatus to Cursor::getStatus
Move the AtPoint handling into the Cursor dispatch machinery

Note that the call to Cursor::getStatus is in BufferView::getStatus, while
the call to Cursor::dispatch is still in LyXFunc::dispatch. This needs to be
fixed, but the code there is a bit fragile.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31969 a592a061-630c-0410-9148-cb99ea01b6c8
2009-11-13 14:32:51 +00:00
Abdelrazak Younes
ff4460603e Make Buffer argument mandatory in most of the InsetMath based class... boring work...
Math manual loads and save correctly it seems but expect some instability period.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31898 a592a061-630c-0410-9148-cb99ea01b6c8
2009-11-08 11:45:46 +00:00
Enrico Forestieri
a1a34443ef Fix bug #5530: LyX expansion in math-macro overwritten by default one.
This patch initializes the buffer_ member of a MathHull inset in most
(but not all) cases. The problems with buffer_ should be greatly
allievated now, but there still can be some corner case.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31873 a592a061-630c-0410-9148-cb99ea01b6c8
2009-11-06 15:18:48 +00:00
Edwin Leuven
c5b63235f0 reduce line noise
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31864 a592a061-630c-0410-9148-cb99ea01b6c8
2009-11-05 19:51:17 +00:00
Vincent van Ravesteijn
5ebc733ff3 Fix bug #6237: The boundary has to be set correctly when moving up with a selection. If not, the cursor will remain on the same row when there are two e.g. displayed equations after each other. This will cause an infinite loop when SCREEN_UP is executed.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31863 a592a061-630c-0410-9148-cb99ea01b6c8
2009-11-05 12:58:25 +00:00
Vincent van Ravesteijn
8fd507ccf2 Remove parameter from cur.reset(). All calls had buffer().inset() as parameter.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31795 a592a061-630c-0410-9148-cb99ea01b6c8
2009-10-29 22:46:04 +00:00
Enrico Forestieri
424e3da04c Better fix for bug #6270. The outer braces are swallowed only for user
defined macros, so better use a brace inset only when strictly needed.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31789 a592a061-630c-0410-9148-cb99ea01b6c8
2009-10-29 13:24:02 +00:00
Enrico Forestieri
3cce787c6c Fix bug #6270: Bug in parsing selection as math macro argument
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31582 a592a061-630c-0410-9148-cb99ea01b6c8
2009-10-10 19:11:23 +00:00
Abdelrazak Younes
d38ca04ff7 Move Undo::beginUndoGroup() and Undo::endUndoGroup() calls to where they are used and necessary, hopefully.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31492 a592a061-630c-0410-9148-cb99ea01b6c8
2009-10-03 19:12:21 +00:00
Abdelrazak Younes
8c053ea10c Move depthHook(), outerHook(), isFirstInSequence(), outerFont() to Text methods.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30957 a592a061-630c-0410-9148-cb99ea01b6c8
2009-08-09 18:35:39 +00:00
Abdelrazak Younes
2b9e44cb01 Move contents of paragraph_funcs.* to Text.h and Text.cpp.
The goal is to simplify the code afterwards.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30955 a592a061-630c-0410-9148-cb99ea01b6c8
2009-08-09 17:30:41 +00:00
Abdelrazak Younes
c49cbaa724 return early.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30936 a592a061-630c-0410-9148-cb99ea01b6c8
2009-08-09 14:38:54 +00:00
Abdelrazak Younes
34fde774f8 Get rid of Paragraph::ownerCode().
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30934 a592a061-630c-0410-9148-cb99ea01b6c8
2009-08-09 14:33:35 +00:00
Jürgen Spitzmüller
89e7f60e1d Catch encoding exception when performing instant preview on an uncodable char (bug 6116).
* MathStream{.cpp, h}:
	- replace bool dryrun() by enum output that also knows whether the stream is for instant preview
* InsetMathHull.cpp:
	- tell the stream whether we use it for instant preview.
* MathString.cpp (write):
	- gracefully catch encoding exception for instant preview.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30895 a592a061-630c-0410-9148-cb99ea01b6c8
2009-08-07 05:25:22 +00:00
Enrico Forestieri
0a90c42b86 Fix bugs #6047, #4043, and #5394.
6047: Lyx 1.6.3 unable to typeset the third chemical equation of the
      file mhchem.lyx (package mhchem)
4043: mhchem support
5394: support for the mhchems's \ce command
The \ce and \cf insets are text mode environments that allow entering
spaces and mathmode commands. LyX leaves them alone and doesn't try to
be smart, i.e., the behaviour is exactly the same we had in the old days
with text-in-math mode environments, before the introduction of the
\ensuremath and \lyxmathsym macros. This means that in those environments
one has to know what he is doing, as LyX will not offer any protection.
The hack of enclosing \ce and \cf in a \text{} environment in order to
be able to enter spaces is no longer necessary.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30338 a592a061-630c-0410-9148-cb99ea01b6c8
2009-07-03 00:05:58 +00:00
Jean-Marc Lasgouttes
042c5bf425 Fix bug http://www.lyx.org/trac/ticket/6026
LyX crashes when backward selecting during formula writing

The problem is basically that the anchor is not set (because there is no
selection going on) and BufferView::mouseSetCursor does not handle this.

 * Cursor.cpp (anchor): return immediately when there is no selection.

 * BufferView.cpp (mouseSetCursor): reset anchor before setting cursor



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30245 a592a061-630c-0410-9148-cb99ea01b6c8
2009-06-23 14:54:35 +00:00
Abdelrazak Younes
1b168bbc69 Paragraph::updateWord() and collectWords(): Remove unneeded CursorSlice argument.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29466 a592a061-630c-0410-9148-cb99ea01b6c8
2009-05-01 09:56:20 +00:00
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
Stefan Schimanski
8527a08903 * simplify notifyCursorLeaves logic: We now only call it from strategic
places, i.e.
  - BufferView::setMouseCursor,
  - BufferView::mouseEventDispatch
  - LyXFunc::dispatch
  Before it was called from several dispatch handlers in the middle of the
  dispatch process. Because the cursor might get invalidated, this is
  not a good idea. We had plenty of crashes and odd behaviours because
  of this as nobody really understood those cases.

  This fixes (at least) #2069 and #4163.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23140 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-22 20:45:18 +00:00
Stefan Schimanski
1bf7b59d60 * completion infrastructure
* completion support for mathed
* experimental completion support for text


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23104 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-21 19:42:34 +00:00
Dov Feldstern
11a6b3c4c7 visual mode for bidi cursor movement
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22929 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-10 19:52:45 +00:00
Stefan Schimanski
036f97a02e * slice numbers are of type size_t, but here we have to allow -1. idx_type
in any case does not make sense. It's not an index in the sense of DocIterator.
* cosmetics


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22908 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-09 22:05:24 +00:00
André Pönitz
24fdfc7d5e start work on less-likely-to-misuse iterators.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22898 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-09 15:23:05 +00:00
Abdelrazak Younes
1cbeb0b244 code simplification by using DocIterator::innerTextSlice().
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22847 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-07 17:07:27 +00:00
André Pönitz
e69b723bf9 There was a bit too much copying of dociterators gpoing on leading to an
avoidable ~5% overhead when loading the UserGuide. This is an attempt on
rectifying the situation.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22532 a592a061-630c-0410-9148-cb99ea01b6c8
2008-01-12 21:38:51 +00:00
Stefan Schimanski
b79bd1fa65 * make isInside const
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22257 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-22 14:38:20 +00:00
Abdelrazak Younes
66627576fb fix for cursor movement from text into mathed.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22253 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-22 09:25:59 +00:00
Jürgen Spitzmüller
b8513d13e5 Fix bug 2913: "mark-on" broken.
* src/Cursor.cpp (selHandle):
	- handle mark()
* src/Text.cpp (dissolveInset):
	- switch mark off before using selHandle, just in case.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22204 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-18 07:10:55 +00:00
Jürgen Spitzmüller
8672364e1e * fix bug 4055, overdue patch from Stefan Schimanski:
"The idea of the beforeDispX/Y_ variables in the Cursor is to hold the position
of the cursor on screen before the lyxfunc is dispatched. But to get this the
metrics must be valid. It's updated in Cursor::dispatch before the dispatch
loop.
After inserting/deleting stuff (like when deleting the selected text before
inserting the alpha) the metrics are invalid. But the handler for the alpha
calls Cursor::dispatch after the deletion and hence the crash with your second
patch.

Here is a patch fixing that:

The beforeDispatchXY variable do not belong into the Cursor::dispatch because
Cursor::dispatch is often called "manually" by many handlers to some followup
action. So this logic must go somewhere else where it is sure that is not
updated after the metrics got invalidated."

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22193 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-17 18:13:02 +00:00
Abdelrazak Younes
9abb7db468 getting rid of superfluous std:: statements.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22104 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-12 19:28:07 +00:00
Abdelrazak Younes
9383f4c3c6 'using namespace std' instead of 'using std::xxx'
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22097 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-12 10:16:00 +00:00
André Pönitz
2506e0d643 assimilate BOOST_CURRENT_FUNCTION
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21867 a592a061-630c-0410-9148-cb99ea01b6c8
2007-11-29 21:10:35 +00:00
André Pönitz
9d0ea8aeff Move debug.{cpp,h}, Messages.{cpp,h} and gettext.{cpp,h} to support/.
Now support/* should have no dependencies on src/* anymore.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21851 a592a061-630c-0410-9148-cb99ea01b6c8
2007-11-29 07:04:28 +00:00
André Pönitz
150cf11651 hand-crafted LyXErr
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21849 a592a061-630c-0410-9148-cb99ea01b6c8
2007-11-28 22:12:03 +00:00
André Pönitz
e1ce2f92db reduce line noise
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21631 a592a061-630c-0410-9148-cb99ea01b6c8
2007-11-15 20:04:51 +00:00
Stefan Schimanski
240e59ae0d * fixed bug #4357 when pasting a macro with script index
* fixed some other unreported bug when the cursor is not inside or near the macro during fold/unfold
 * fixed the bug that the cursor jumped into the first parameter when pasting a macro. This should only happen when the macro was entered interactively


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21611 a592a061-630c-0410-9148-cb99ea01b6c8
2007-11-14 17:33:49 +00:00
André Pönitz
9cca7a0c1a remove unneeded Cursor.h include;
use strfwd 


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21456 a592a061-630c-0410-9148-cb99ea01b6c8
2007-11-05 22:54:53 +00:00
Dov Feldstern
ddd82f7aa4 Getting rid of LTR bias --- part 3/4
This is a continuation of r21128, r21244


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21448 a592a061-630c-0410-9148-cb99ea01b6c8
2007-11-05 19:41:16 +00:00
Dov Feldstern
c4d8c85a09 rename asTextInset -> asInsetText (to conform with asInsetCollapsable, asInsetMath)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21406 a592a061-630c-0410-9148-cb99ea01b6c8
2007-11-03 18:07:41 +00:00
André Pönitz
a8cd9a4b8f cosmetics. mainly replace #include "dostring.h" by #include "strfwd.h"
in header files when possible. Adjust .cpp files.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21358 a592a061-630c-0410-9148-cb99ea01b6c8
2007-11-01 22:17:22 +00:00
Stefan Schimanski
b5a640d1cc * one coercion is enough
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21335 a592a061-630c-0410-9148-cb99ea01b6c8
2007-11-01 14:45:14 +00:00
Stefan Schimanski
6aa5467320 * added non-greedy init mode for macros. If you enter a macro with the cursor, you don't want that it eats the insets on the right.
* split up the MathData::updateMacro method into the optional and normal parameter part


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21334 a592a061-630c-0410-9148-cb99ea01b6c8
2007-11-01 14:40:15 +00:00
Abdelrazak Younes
5ddc612b73 Splitup Font in saner bits:
* Font::FontBits -> FontInfo
* Font::FONT_XXX -> all enums transfered to FontEnums.h and renamed to FontXxx

I've replaced Font uses with FontInfo were the language() member was not needed, basically all draw() and metrics methods. There's one problematic cases with InsetQuotes which I solved by taking the Buffer main language.




git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21240 a592a061-630c-0410-9148-cb99ea01b6c8
2007-10-28 18:51:54 +00:00
Abdelrazak Younes
2916b61086 Header cleanup
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21059 a592a061-630c-0410-9148-cb99ea01b6c8
2007-10-19 14:23:32 +00:00
Abdelrazak Younes
55beda376a Refactor Undo/Redo framework into an Undo class owned by a Buffer. This reduces header dependencies from Undo.h which was including lots of stuff previously. This also solves the bug where undo/redo were reset upon buffer switching. Now, each buffer has a truly independant undo/redo architecture.
In the future, when Cursor has been fixed to work correctly with multiple views of the same Buffer, we could transfer the Undo owner from Buffer to Cursor.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21031 a592a061-630c-0410-9148-cb99ea01b6c8
2007-10-18 11:51:17 +00:00