Commit Graph

156 Commits

Author SHA1 Message Date
Peter Kümmel
61b2bd5e7f Using "using namespace std" with msvc10 makes also std::tr1::bind visible and generates conflicts with boost::bind.
Solution: don't use boost::bind for msvc10 (could also be extended  to several GCC versions)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34257 a592a061-630c-0410-9148-cb99ea01b6c8
2010-04-22 11:16:58 +00:00
Vincent van Ravesteijn
63d24ca3c4 Remove boundary parameter from BufferView::getPos(). The first DocIterator parameter already contains this information.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34247 a592a061-630c-0410-9148-cb99ea01b6c8
2010-04-21 13:03:04 +00:00
Vincent van Ravesteijn
108a67ed43 Make Cursor::anchor_ private and make an access function Cursor::realAnchor() to stress the fact that this is thus not the normalAnchor().
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34146 a592a061-630c-0410-9148-cb99ea01b6c8
2010-04-15 18:16:07 +00:00
Vincent van Ravesteijn
d8db0e8515 Rename anchor() to normalAnchor() as the anchor() function was already returning a normalized anchor in stead of the real one.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34145 a592a061-630c-0410-9148-cb99ea01b6c8
2010-04-15 17:49:15 +00:00
Vincent van Ravesteijn
ebb830ba9b Do not change the object that is returned by result(), this will have no effect because result() returned a copy. From now, it just returns a const & to prevent this from happening again.
see r31969.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34143 a592a061-630c-0410-9148-cb99ea01b6c8
2010-04-15 17:14:59 +00:00
Richard Heck
b79d8e5e2d Make members of FuncRequest private, per the FIXME there. Again, this is
basically a massive renaming, with no real changes.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34106 a592a061-630c-0410-9148-cb99ea01b6c8
2010-04-09 19:00:42 +00:00
Richard Heck
4c7a5d0024 This is just a giant renaming of member variables in FuncRequest,
preparatory to making them private.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34105 a592a061-630c-0410-9148-cb99ea01b6c8
2010-04-09 18:15:17 +00:00
Richard Heck
d65020b293 s/updateLabels/updateBuffer/g, per a suggestion of Abdel's.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33613 a592a061-630c-0410-9148-cb99ea01b6c8
2010-03-03 22:13:45 +00:00
Richard Heck
a932148ce4 Remove unneeded include.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33392 a592a061-630c-0410-9148-cb99ea01b6c8
2010-02-09 16:31:09 +00:00
Abdelrazak Younes
377cdd5f6c Transfer LyXfunc code to GuiApplication::dispatch() and getStatus(). Now
a lot of simplification is possible. Except some instability period...


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33389 a592a061-630c-0410-9148-cb99ea01b6c8
2010-02-09 16:11:13 +00:00
Jean-Marc Lasgouttes
ead206efb0 remove last member variables from LyXFunc and move them to cursor. Now the class can be replaced by a namespace
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33386 a592a061-630c-0410-9148-cb99ea01b6c8
2010-02-09 14:29:27 +00:00
Jean-Marc Lasgouttes
a1e991a82e Get rid of the errorstat and dispatch_buffer members of LyXFunc.
This required to make Cursor::disp_ mutable.

Also, the server parts now pass a DispatchResult object to dispatch (which is
a good thing anyway).



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33259 a592a061-630c-0410-9148-cb99ea01b6c8
2010-01-29 11:22:33 +00:00
Jürgen Spitzmüller
7bbd67eb26 * Implement updateLabels in mathed and add the MathRef insets to the references cache.
This fixes bug #1560.

The diverse setBuffer / updateLabels calls need auditing. See FIXMEs.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33249 a592a061-630c-0410-9148-cb99ea01b6c8
2010-01-28 17:37:22 +00:00
Jean-Marc Lasgouttes
943a39b1e2 always close properly undo groups
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33129 a592a061-630c-0410-9148-cb99ea01b6c8
2010-01-21 16:59:39 +00:00
Vincent van Ravesteijn
b9d5184979 Fix bug #6448: Crash with invalid anchor.
If we check whether a cursor is valid, we should also check the anchor_.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33012 a592a061-630c-0410-9148-cb99ea01b6c8
2010-01-13 18:57:42 +00:00
Vincent van Ravesteijn
742ee134a4 Make setCursorToAnchor set the cursor to the normalized selection anchor in stead of the real anchor.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32790 a592a061-630c-0410-9148-cb99ea01b6c8
2010-01-06 16:59:12 +00:00
Vincent van Ravesteijn
b3128dc63b Fix second part of bug #6400: After selecting a word by double-clicking it, extending the selection by a single mouse-click should also select only whole words.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32580 a592a061-630c-0410-9148-cb99ea01b6c8
2009-12-18 14:18:10 +00:00
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