Commit Graph

102 Commits

Author SHA1 Message Date
Tommaso Cucinotta
df8e614237 Fix update of document buffer on last replace operation.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36405 a592a061-630c-0410-9148-cb99ea01b6c8
2010-11-20 11:04:40 +00:00
Tommaso Cucinotta
55641a1a74 Some more debugging stuff.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36404 a592a061-630c-0410-9148-cb99ea01b6c8
2010-11-20 11:03:24 +00:00
Pavel Sanda
058c815515 Fix order of return value
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36299 a592a061-630c-0410-9148-cb99ea01b6c8
2010-11-14 23:23:20 +00:00
Richard Heck
97b82d285d Fix up some of the find and replace code again. This solves a bug
involving the messages and will also help sort out some dispatch stuff.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35649 a592a061-630c-0410-9148-cb99ea01b6c8
2010-10-14 14:32:58 +00:00
Pavel Sanda
0978e91ecf This stuff is general enough for lstrings
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35646 a592a061-630c-0410-9148-cb99ea01b6c8
2010-10-14 11:01:15 +00:00
Richard Heck
3fe55bccc4 const
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35642 a592a061-630c-0410-9148-cb99ea01b6c8
2010-10-13 18:59:24 +00:00
Richard Heck
e9cf7aabcb Const.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35640 a592a061-630c-0410-9148-cb99ea01b6c8
2010-10-13 18:57:57 +00:00
Richard Heck
d3e4bfb124 Change how some of the updating stuff is handled in lyxfind. I had no
idea what a mess this was.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35639 a592a061-630c-0410-9148-cb99ea01b6c8
2010-10-13 18:53:41 +00:00
Richard Heck
3b00f19cc2 Anonymize some things.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35638 a592a061-630c-0410-9148-cb99ea01b6c8
2010-10-13 18:30:37 +00:00
Richard Heck
9511e345c1 Why have an argument in an anonymous method if you aren't going to use
it?


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35637 a592a061-630c-0410-9148-cb99ea01b6c8
2010-10-13 18:27:40 +00:00
Richard Heck
77a9dfcdba More find cleanup.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35636 a592a061-630c-0410-9148-cb99ea01b6c8
2010-10-13 18:24:53 +00:00
Richard Heck
b261a6d247 Begin some cleanup of the find code. I'm trying to sort out some odd
dispatch behavior, but can't understand this code as it is. Why isn't
there any documenation here?


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35635 a592a061-630c-0410-9148-cb99ea01b6c8
2010-10-13 18:19:21 +00:00
Richard Heck
5577e877bb Try to move all updateBuffer() calls to a central location. We now use
DispatchResult to store a flag that tells us whether we need a buffer
update or not. 

So: If you find a missing one, go to an appropriate place in the
dispatch and call cur.forceBufferUpdate() or, if you don't have a cursor
but do have a DispatchResult, call dr.forceBufferUpdate().

There is one remaining call I could not move, in
TextMetrics::redoParagraph. But this looks like an emergency call when
the macro context has not been set. There are also a couple calls that
are connected with buffer creation that I commented out, since the same
call is done again almost immediately. But I'm not positive about those.

Now the nice thing would be to do the same for updateMacros().


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34826 a592a061-630c-0410-9148-cb99ea01b6c8
2010-07-09 14:37:00 +00:00
Peter Kümmel
615d42d357 TR1: use std::tr1 regex with msvc10
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34725 a592a061-630c-0410-9148-cb99ea01b6c8
2010-06-29 17:09:40 +00:00
Vincent van Ravesteijn
d9fab1ecc6 * lyxfind: Remove unnecessary non-const reference as parameter.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34355 a592a061-630c-0410-9148-cb99ea01b6c8
2010-05-02 22:33:36 +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
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
Tommaso Cucinotta
4bac24026d Fixed #2674 (Find and replace should restore initial cursor position), occurring on replace all.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33818 a592a061-630c-0410-9148-cb99ea01b6c8
2010-03-21 10:36:59 +00:00
Tommaso Cucinotta
57aa866a1c Fixed issues in backward search in various corner cases (fixed #6482 and #6596).
Now, when scope includes multiple documents, the switch_buffer LFUN is only issues if buffer actually changes.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33812 a592a061-630c-0410-9148-cb99ea01b6c8
2010-03-20 13:59:46 +00:00
Tommaso Cucinotta
83104beee3 Limit the search for the word at current cursor position only to the case in which cursor is in texted.
Fixes crash in #6573.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33811 a592a061-630c-0410-9148-cb99ea01b6c8
2010-03-20 12:15:05 +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
Tommaso Cucinotta
a7f63005f0 Fixed #6555 (crash when trying to replace starting from multi-par selection with end pos < beg pos).
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33542 a592a061-630c-0410-9148-cb99ea01b6c8
2010-02-22 21:44:59 +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
Tommaso Cucinotta
c0c1e1fd2b Most common cases with regexps seem to work, at least with ignore-format on.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33355 a592a061-630c-0410-9148-cb99ea01b6c8
2010-02-07 21:44:31 +00:00
Tommaso Cucinotta
b8af0d1cfd Fixed crash on searching for empty list inside empty list with ignore-format off (bug #6500).
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33318 a592a061-630c-0410-9148-cb99ea01b6c8
2010-02-02 20:36:12 +00:00
Vincent van Ravesteijn
b7ff36304d Use Change::isSimilarTo to find a change when merging changes.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33284 a592a061-630c-0410-9148-cb99ea01b6c8
2010-01-31 00:21:52 +00:00
Tommaso Cucinotta
c0d42b97ee Made replace behaviour more standard: when pressing replace (next or previous) button:
-) if a selection exists, and it matches, then it is replaced;
-) next match is searched for and, if found, it is selected.
After a replace, next match is searched for only beyond the replaced text
(and not inside the replaced text).


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33267 a592a061-630c-0410-9148-cb99ea01b6c8
2010-01-30 10:11:24 +00:00
Tommaso Cucinotta
52c059e68a Make the fake sequence for braces highly unlikely (addressing #6478).
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33253 a592a061-630c-0410-9148-cb99ea01b6c8
2010-01-29 07:35:13 +00:00
Tommaso Cucinotta
c6784d708d Open or closed braces ({ or }) are now translated to non-braces fake constructs while searching (fixes #6478, avoiding assert).
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33248 a592a061-630c-0410-9148-cb99ea01b6c8
2010-01-28 17:26:18 +00:00
Tommaso Cucinotta
ddebdc4514 Now the local text language is kept while replacing text (addressing #6171).
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32961 a592a061-630c-0410-9148-cb99ea01b6c8
2010-01-11 02:20:51 +00:00
Vincent van Ravesteijn
43c8de8138 Cosmetics mainly: Rename math.h to cmath, reorder some includes, remove some includes and remove some superfluous "lyx::".
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32934 a592a061-630c-0410-9148-cb99ea01b6c8
2010-01-10 12:37:50 +00:00
Tommaso Cucinotta
fb4dfdf189 Implemented "whose words" option of the Advanced F&R feature.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32905 a592a061-630c-0410-9148-cb99ea01b6c8
2010-01-09 12:39:29 +00:00
Vincent van Ravesteijn
5079badb65 Fix bug #6428: Assertion when navigating to next change while in math mode.
We need to leave the math inset before trying to access cur.paragraph().

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32791 a592a061-630c-0410-9148-cb99ea01b6c8
2010-01-06 17:29:39 +00:00
Vincent van Ravesteijn
b0910eb6d4 Why was there a 1 ? We only have to make sure that pos - 1 >= 0.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32772 a592a061-630c-0410-9148-cb99ea01b6c8
2010-01-05 16:34:52 +00:00
Tommaso Cucinotta
5cc2d6d73c Advanced F&R rework:
- scopes now handled in FindAndReplaceWidget, while lyxfind.cpp only searches within single buffer
- cursor().result().dispatched() now encodes whether a match was found or not, after LFUN_WORD_FINDADV dispatch
- removed a few unneeded functions
- followed a few cosmetic advices


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32760 a592a061-630c-0410-9148-cb99ea01b6c8
2010-01-04 12:29:38 +00:00
Tommaso Cucinotta
9e5a12b905 No need for the new LyXView::selectDocumentBuffer() method, same thing may be done with LFUN_SWITCH_BUFFER (vfr advice).
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32739 a592a061-630c-0410-9148-cb99ea01b6c8
2010-01-01 11:14:01 +00:00
Tommaso Cucinotta
82e07a4185 Code cleanup.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32682 a592a061-630c-0410-9148-cb99ea01b6c8
2009-12-30 22:21:23 +00:00
Tommaso Cucinotta
24e2c495fe Implemented S_OPEN_BUFFERS scope in Advanced Find feature (keep searching and find all occurrences within all open buffers).
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32680 a592a061-630c-0410-9148-cb99ea01b6c8
2009-12-30 21:50:55 +00:00
Tommaso Cucinotta
605ac8e46a Cosmetics: removed unneeded std::
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32679 a592a061-630c-0410-9148-cb99ea01b6c8
2009-12-30 18:58:20 +00:00
Tommaso Cucinotta
5da4ccb931 Implemented the "Current Buffer" & "Current (Master) Document" scopes in the Advanced Find and Replace feature.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32678 a592a061-630c-0410-9148-cb99ea01b6c8
2009-12-30 18:40:18 +00:00
Tommaso Cucinotta
6675847986 Fixed bug: now, when searching backwards, after wrap-around question, if match is beyond the cursor position then it is correctly found.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32651 a592a061-630c-0410-9148-cb99ea01b6c8
2009-12-26 22:31:59 +00:00
Tommaso Cucinotta
569a0e4629 Fixed infinite loop on backwards search when matching in nested inset(s) at begin of document.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32650 a592a061-630c-0410-9148-cb99ea01b6c8
2009-12-26 22:10:14 +00:00
Tommaso Cucinotta
378d32bc06 indentation fix.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32559 a592a061-630c-0410-9148-cb99ea01b6c8
2009-12-17 07:57:50 +00:00
Tommaso Cucinotta
ad0060454d Fix of bug ##6334 - now if you search for something not in the doc, it wraps around only once.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32558 a592a061-630c-0410-9148-cb99ea01b6c8
2009-12-17 07:53:20 +00:00
Richard Heck
c47c34b1c8 Fix typo.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31277 a592a061-630c-0410-9148-cb99ea01b6c8
2009-09-04 13:52:49 +00:00
Jürgen Spitzmüller
56fcb589ae stylistics
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31274 a592a061-630c-0410-9148-cb99ea01b6c8
2009-09-04 13:08:09 +00:00
Jürgen Spitzmüller
2509ff8236 stylistics.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31273 a592a061-630c-0410-9148-cb99ea01b6c8
2009-09-04 13:06:43 +00:00
Tommaso Cucinotta
50c6ba17e5 Fix of issue when searching at paragraph boundaries when non-ignoring format.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31201 a592a061-630c-0410-9148-cb99ea01b6c8
2009-08-22 16:06:19 +00:00
Uwe Stöhr
91854df691 lyxfind.cpp: this was accidentally removed in r31163
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31164 a592a061-630c-0410-9148-cb99ea01b6c8
2009-08-20 00:36:52 +00:00