Commit Graph

203 Commits

Author SHA1 Message Date
Tommaso Cucinotta
cf6bbe2147 findadv: amend [8c101829/lyxgit] check that opt.find_buf_name is found in theBuffers(). 2017-05-03 17:32:31 +02:00
Tommaso Cucinotta
3610cdf669 findadv: fix crash on wrong syntax/usage of word-findadv LFUN from mini-command. 2017-05-03 01:31:57 +02:00
Tommaso Cucinotta
4f75026176 lyxfind: cleanup regex_replace() and back to a sane amount of logging during findadv operations. 2017-04-17 00:41:29 +02:00
Tommaso Cucinotta
6d05a96546 findadv: match \textbackslash and \textasciicircum also without trailing {} (fixes autotest findadv-re-02-in.txt). 2017-04-17 00:38:31 +02:00
Tommaso Cucinotta
664798128a findadv: almost all test cases, including \regex[{}, back to working with std::regex. 2017-04-17 00:15:26 +02:00
Kornel Benko
28c320e1a0 findadv: fix compilation issue from [lyxgit/ecc36be6], when using boost instead of std regex. 2017-04-16 19:43:54 +02:00
Tommaso Cucinotta
ecc36be60b findadv: avoid crash when regexp-based search fails (mitigates #10625). 2017-04-16 11:27:34 +02:00
Jean-Marc Lasgouttes
cb888293d4 A better way to tell coverity that we do not care about result 2017-03-31 11:38:30 +02:00
Jean-Marc Lasgouttes
d7dfa27574 Try alternative syntax for signaling false positive 2017-03-24 15:54:16 +01:00
Richard Heck
ed0e4064d2 Don't need the else, since all codepaths return. 2016-12-30 11:05:01 -05:00
Richard Heck
410b0fa581 Invert logic. 2016-12-30 11:05:01 -05:00
Richard Heck
ee251c626c Re-organize, whitespace. 2016-12-30 11:05:01 -05:00
Richard Heck
b8216513d6 Remove useless for loop. 2016-12-30 11:05:01 -05:00
Tommaso Cucinotta
9740c36e80 Remove assert on advanced find with knitr module (#10444). 2016-10-27 09:38:35 +02:00
Juergen Spitzmueller
f089f60f4e Implement wrapping in next-change (#10388). 2016-10-15 16:34:16 +02:00
Jean-Marc Lasgouttes
84050268ee Remove useless #include
Including MathData.h in InsetMath.h is expensive and not required.
2016-10-14 11:08:04 +02:00
Guillaume Munch
3fd2398a28 Remove option to disable texrow
I suspect that the gain was negligible, yet it made debugging and maintainance
harder.
2016-09-23 23:39:48 +02:00
Juergen Spitzmueller
c0a425a319 Move wrap check for simple search/replace to lyxfind
This gets rid of some dirty dispatch tricks and fixes wrap-around
on replace and in the spellchecker

Fixes: #10378
2016-09-14 10:23:39 +02:00
Guillaume Munch
670efa8f64 Rationalise includes
Modifying TexRow.h or texstream.h no longer triggers the recompilation of the
complete source tree.
2016-07-04 02:42:17 +02:00
Richard Heck
355395174b Mark a number of coverity false positives.
Fixes coverity #23284, 23285, 23286, 23287, 23289.
2016-06-11 23:09:30 -04:00
Scott Kostyshak
62190855bf Revert "Now math previews are correctly updated when replacing math contents inside"
Updating all previews (even if only one has changed) is more costly
than I thought. Thanks to Guillaume for tracking down this
performance issue.

This reversion is related to the reversions at 358745d0 and
a7a14395. See also #7242 and #9855.

This reverts commit 29948eec26.
2015-11-13 00:54:15 -05:00
Scott Kostyshak
a7a143950a Revert "Update previews after doing a find/replace (#7242)"
Updating all previews (even if only one has changed) is more costly
than I thought. Thanks to Guillaume for tracking down this
performance issue.

This reversion is related to the reversion at 358745d0.
See also #7242 and #9855.

This reverts commit 66f527e417.
2015-11-13 00:50:39 -05:00
Guillaume Munch
460a764b7f Adding TexRow information on math latex output (#4725)
WriteStream is now built from an otexstream instead of an odocstream, and
therefore counts lines in a TexRow. Calls to TexRow are added in relevant places
in math insets.

This finishes adding line tracking for math in the source panel and for forward
search.
2015-10-19 06:55:17 +01:00
Georg Baum
d3b5260f45 Remove unused variables
Found by cppcheck: (style) Unused variable: x
2015-10-10 21:28:28 +02:00
Georg Baum
60e594a0f7 Fix duplicated pointer check
Found by cppcheck: (style) Same expression on both sides of '&&'.
2015-10-10 21:23:52 +02:00
Stephan Witt
d5f7ed38fc Add missing adjustment of end_pos if given length exceeds last pos 2015-10-09 08:16:23 +02:00
Stephan Witt
77cc2c7c8c Fix "dead store" warnings of Xcode analyze tool 2015-10-09 08:16:23 +02:00
Guillaume Munch
afed7d06fa Improvements to cursor highlighting in the source panel
* TexRow now computes rows from a DocIterator. In practice, the cursor
  highlighting is now correct inside insets, it is no longer restricted to the
  topmost level. It certainly also makes forward-search more precise.

* Added the option to disable a texrow when not needed, for perf.

* Fixed a bug where the last paragraph was not properly highlighted.

Limitations:

* TexRow still does not handle: math (e.g. multi-cell), sub-captions, inset
  arguments.
2015-10-01 21:51:08 +01:00
Georg Baum
b6aed54c45 Fix cppcheck variable scope warnings
These were all flagged by "(style) The scope of the variable 'x' can be reduced."
Narowing the scope improves readability, and if it is in a loop then the
compiler will be clever enough to produce efficient code, we do not need
manual optimization for POD types.
2015-09-20 10:42:35 +02:00
Georg Baum
84cca2dd94 Fix indentation 2015-05-17 17:27:27 +02:00
Georg Baum
b596330093 Fix compilation with boost 1.58
Newer boost versions use complicated type traits for boost::next and
boost::prior, which do not work with the RandomAccessList iterators.
The long term solution is to use std::next and std::prev, for now supply
simple replacements for compilers that do not support C++11 yet.
2015-05-16 00:05:23 +02:00
Scott Kostyshak
66f527e417 Update previews after doing a find/replace (#7242)
This commit addresses #7242 for normal Find/Replace. That issue was
fixed for Advanced Find at 29948eec.
2015-04-18 21:47:21 -04:00
Alfredo Braunstein
8f821dba70 Rewrite of change-related helpers
lyxfind.cpp(findNextChange, findPreviousChange, findChange, selectChange): factor the change-selection part out of the change-finding part
Text.cpp (acceptOrRejectChanges): call only selectChange
2014-10-14 17:40:44 +02:00
Jean-Marc Lasgouttes
7c3d1d7423 Fix crash when accepting change
The problem is the use of cursor movement methods to update cursor.
Cursor::forwardPos() steps into insets, which is not always what we
want. The problem here is that there is a math inset just after the
accepted change, and that the cursor steps into it for some reason.

This code is a nightmare anyway.

Fixes: bug #9145
2014-06-05 12:23:19 +02:00
Tommaso Cucinotta
cb79658e54 Workaround for #7987: deleted text in change-tracking mode is not found in Advanced F&R any more. 2014-04-21 11:51:59 -04:00
Tommaso Cucinotta
13cb7da11d Merged Paragraph::stringify into asString(). 2014-04-21 11:51:59 -04:00
Juergen Spitzmueller
ad6f96bf48 Do not substract cursors pos from two different cells (fix assertion while doing adv search)
Fixes: #7944.
2014-04-21 11:51:59 -04:00
Richard Heck
0a6ff99f28 Typos and style. 2014-04-21 11:51:59 -04:00
Vincent van Ravesteijn
53b60462ac Revert "Fixing #7987: deleted text in change-tracking mode is not found in Advanced F&R any more."
This reverts commit cb351665f4.
2014-03-29 22:21:40 +01:00
Tommaso Cucinotta
cb351665f4 Fixing #7987: deleted text in change-tracking mode is not found in Advanced F&R any more.
Merged Paragraph::stringify into asString().
Added ignore of deleted text to Advanced F&R.
2014-03-27 23:36:15 +00:00
Jean-Marc Lasgouttes
c98ce56a03 Fix bug #8884: Crash when "navigate to next change"
The two fixes here a obviously right, although it is not clear why they are sufficient to fix the bug. Anyway I cannot reproduce any crash with it.

 * the first part just conditions a whole if/else to change_next_pos.changed(). Originally, only the if branch was concerned.

 * the second part is to avoid calling CursorSlice::backwardPos() when position is 0. Doing this leads to an assertion.
2014-03-03 11:16:56 +01:00
Scott Kostyshak
f52eb9d823 Comment a minor bug not worth fixing (#8986) 2014-02-19 16:21:46 -05:00
Tommaso Cucinotta
b93f2c20d3 Added restrict-search-to-maths-only checkbox to advanced pane of Advanced F&R. 2013-10-13 00:59:46 +01:00
Tommaso Cucinotta
7081fed380 Fixed a number of bugs in "preserve first case" feature of Advanced F&R (addressing #8383). 2013-07-22 10:39:11 +01:00
Pavel Sanda
4c0ef38200 Header cleanup cont. 2013-05-19 18:07:53 -07:00
Jean-Marc Lasgouttes
249d96ed94 Small clanup (just move functions around) 2013-05-06 22:50:26 +02:00
Jean-Marc Lasgouttes
68202fdf44 Fix bug 6055: change-next does not work in tables
The problem was just the faulty use of CursorSlice::at_begin/end(), which does not look for end of cell, but end of inset.
2013-05-06 12:29:27 +02:00
Richard Heck
d79225ae98 Remove all messages to user related to assertions. We'll just use
a basic message which is defined in lassert.cpp now.
2013-04-27 17:52:55 -04:00
Richard Heck
1b1f8dd235 Audit all the LASSERT calls, and try to do something sensible at
each failure.

There are several places I was not sure what to do. These are marked
by comments beginning "LASSERT:" so they can be found easily. At the
moment, they are at:

Author.cpp:105: // LASSERT: What should we do here?
Author.cpp:121: // LASSERT: What should we do here?
Buffer.cpp:4525:        // LASSERT: Is it safe to continue here, or should we just return?
Cursor.cpp:345:         // LASSERT: Is it safe to continue here, or should we return?
Cursor.cpp:403:         // LASSERT: Is it safe to continue here, or should we return?
Cursor.cpp:1143:                // LASSERT: There have been several bugs around this code, that seem
CursorSlice.cpp:83:     // LASSERT: This should only ever be called from an InsetMath.
CursorSlice.cpp:92:     // LASSERT: This should only ever be called from an InsetMath.
LayoutFile.cpp:303:                     // LASSERT: Why would this fail?
Text.cpp:995:           // LASSERT: Is it safe to continue here?
2013-04-25 17:27:10 -04:00
Jean-Marc Lasgouttes
77bf805155 Fix bug #3199: change-next may leave empty lines behind
Using Cursor::setCursor or even BufferView::setCursor is often a bad
idea since it does not run DEPM. In this case (and other cases in
f&replace code) it is better to use BufferView::mouseSetCursor (which
should maybe be renamed...).
2013-04-25 15:37:15 +02:00