Commit Graph

82 Commits

Author SHA1 Message Date
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
Abdelrazak Younes
f7b1c86393 Move Inset::Code to InsetCode.h
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20936 a592a061-630c-0410-9148-cb99ea01b6c8
2007-10-13 09:04:52 +00:00
Abdelrazak Younes
9a458ec6e9 Move private part of BufferView to a private implementation.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20896 a592a061-630c-0410-9148-cb99ea01b6c8
2007-10-11 09:59:01 +00:00
André Pönitz
5aaf4dce20 move font related stuff from bufferview_funcs to Font
delete bufferview_funcs, since it's now empty


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20579 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-29 11:00:18 +00:00
André Pönitz
122f32ea29 cosmetics
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20578 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-29 09:22:17 +00:00
André Pönitz
f1687373b1 cosmetics
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20577 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-29 08:02:37 +00:00
Abdelrazak Younes
137158532b Put mathed on a diet: transfer dimension cache from inset to BufferView.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20457 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-23 22:39:49 +00:00
Lars Gullik Bjønnes
ed8520086b Comment out unused parameter
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20307 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-16 10:39:44 +00:00