Commit Graph

366 Commits

Author SHA1 Message Date
Kornel Benko
62ab563c25 FindAdv: Use private variable for_search
Using the new inline statements
	find_effective(), find_with_non_output(), find_with_deleted(),
	find_set_feature(), find_add_feature() and find_clean_features()
makes the code a slightly better readable.
2022-05-09 22:11:38 +02:00
Kornel Benko
c2229d388b Find: Renamend for_searchAdv to for_serach in src/OutputParams.h
Since this variable is used by quick find too, the naming was misleading
2022-04-12 18:02:12 +02:00
Thibaut Cuvelier
997f0621c5 Rename LATEX debug level to OUTFILE and use it for DocBook, HTML, and XML messages. 2022-03-01 16:05:42 +01:00
Jean-Marc Lasgouttes
963a0aa466 Implement Row::Element::row_flags
Move the enum definition RowFlags in its own include file, to avoid
loading Inset.h. Document it more thoroughly.

Rename RowAfter to AlwaysBreakAfter.

Add CanBreakInside (rows that can be themselves broken). This allow to
differentiate elements before bodyPos() and allows to remove a
parameter to shortenIfNeeded().

Make the Inset::rowFlags() method return int instead of RowFlags, as
should be done for all the bitwise flags. Remove the hand-made bitwise
operators.

Set R::E::row_flags when creating elements.
* INSET elements use the inset's rowFLags();
* virtual element forbid breaking before them, and inherit the *After
  flags from the previous element of the row;
* STRING elements usr CanBreakInside, except before bodyPos.

More stuff may be added later.
2021-12-07 17:04:47 +01:00
Kornel Benko
961e393b95 FindAdv: Make search for text in deleted regions configurable.
The function call 'search-ignore deleted false'
makes findadv to search also deleted parts,
while 'search-ignore deleted true' will omit these parts.
2021-01-22 21:11:28 +01:00
Jean-Marc Lasgouttes
5908bb3ea6 Cleanup button handling in InsetInclude
The include inset has its own button_ object, that hides the button_
object of the InsetCommand parent. Remove that.

Remove the hand-made caching that uses the set_label_ boolean.

Let metrics() and draw() use the inherited methods. This requires to
use setBroken as needed and to implement inheritFont.

The use of InsetCommand::draw is what restores the hover effect.

Fixes bug #10415.
2021-01-19 19:24:10 +01:00
Jean-Marc Lasgouttes
4062cbd278 Remove RenderButton::button_box_, which is unused. 2021-01-19 11:27:54 +01:00
Richard Kimberly Heck
2fcc764728 Fix problem with display of include insets with non-existent files. 2021-01-10 02:08:18 -05:00
Juergen Spitzmueller
6430931e27 Hint to deleted included file in ct output (#11809) 2021-01-07 12:08:59 +01:00
Yuriy Skalko
3971b1b35e Fix C++20 warning on implicit capture of this via [=] 2020-12-28 23:26:14 +02:00
Richard Kimberly Heck
41216228c0 Change name in source files 2020-12-05 17:17:02 -05:00
Yuriy Skalko
c0a5987181 Better naming for enums 2020-12-01 00:46:21 +02:00
Yuriy Skalko
ecf62a8f21 Refactor OutputParams
Now all Inset hierarchy uses OutputParams.h included in Inset.h.
Forward declare some enums to reduce header dependencies.
2020-11-30 13:05:03 +02:00
Yuriy Skalko
813eb0f9f7 Cleanup included headers 2020-11-29 00:25:14 +02:00
Scott Kostyshak
c81bb47e49 Catch exception if LaTeX fails for child preview
The exception is raised when an included file fails to export
because e.g. it is from a newer version of LyX or because an
intermediate command such as knitr fails.

The exception was introduced at 1a374a93 so that the export of a
document exits with error if an included document exports with
error.

This commit catches the exception when the LaTeX is asked for in
order to generate a preview of the included file.
2020-11-25 15:34:58 -05:00
Yuriy Skalko
7ca2f2b58d Use range-based loops 2020-11-21 20:32:16 +02:00
Thibaut Cuvelier
149e1ccc02 DocBook: add DocBookSection parameter for styles that define new sections and implement argument parameters; improve Springer support.
For elements that should behave like sections (for now, mostly prefaces).

A second paragraph of PartBacktext can only wreak havok: it should start a section, and nothing else (otherwise, it's a real nightmare to implement).
2020-10-30 01:59:34 +01:00
Thibaut Cuvelier
d1b9af3b1d DocBook: fix file inclusion.
Previously, nothing was output. Special care was needed for when new paragraphs should be open (this work is probably not finished yet).
2020-10-20 02:34:02 +02:00
Daniel Ramöller
35aaa1c528 Show child documents in outline with their paths. 2020-09-10 12:30:12 -04:00
Thibaut Cuvelier
ad08373ae2 DocBook: actually include files that are not properly understood (with automatic escaping), in comments. 2020-07-31 20:17:38 +02:00
Thibaut Cuvelier
3883b85f49 New DocBook support 2020-07-08 08:42:16 +02:00
Jean-Marc Lasgouttes
5d4e6dfb68 Run codespell on src/insets
Command was
codespell -w -i 3  -S Makefile.in -L mathed,afe,tthe,ue,fro,uint,larg,alph,te,thes,alle,Claus,pres,pass-thru  src/insets/
2020-06-25 23:46:16 +02:00
Jean-Marc Lasgouttes
ba738d0167 Use new rowFlags() values to remove some inset hardcoding.
The enum DisplayType is replaced with the flags RowFlags that can be
combined. Here is the correspondence between the old DisplayType and
the new Inset::RowFlags:

DisplayType   RowFLags             Meaning
 Inline        Inline               plain inline inset
  --           BreakBefore          row ends before this inset
  --           BreakAfter           the row ends after this inset
 AlignCenter   Display	            the inset is centered on its own row
 AlignLeft     Display | AlignLeft  the inset is left-aligned on its row
 AlignRight    Display | AlignRight the inset is right-aligned on its row
  --           RowAfter             an extra row is needed after this inset

Display is just a shortcut for BreakBefore | BreakAfter.

The flags for the newline inset will be BreakAfter | RowAfter,
while the separator inset will just use BreakAfter.

This groundwork does not introduce any new feature at this point. It
aims to remve the numerous isNewLine and isSeparator all over the
code, and to eventually optional break after some insets like spaces
(see #11621).

Most display() methods are renamed to rowFlags(). Some are removed
because they returned Inline.

Now display() is only a helper function for hull insets.
2020-06-22 23:11:40 +02:00
Thibaut Cuvelier
a6b07608d8 Rename XHTMLStream to XMLStream, move it to another file, and prepare for DocBook adoption.
xml.cpp/h also merges functionalities from sgml.cpp/h.
2020-06-15 13:01:56 +02:00
Richard Kimberly Heck
97bbcf2b9b Remove include no longer needed 2020-05-13 14:54:16 -04:00
Richard Kimberly Heck
7d36b9e4fa Remove method that is now unneeded. 2020-04-25 22:27:09 -04:00
Richard Kimberly Heck
e4da314522 Try to fix bug #6505.
Keep track of nested includes and just refuse to re-enter a file
we're already in the process of handling.

There's a question whether we should do this in updateBuffer and
validate, or whether we should do it separately. For now, this seems
to work.
2020-04-25 22:22:58 -04:00
Richard Kimberly Heck
aa794a8806 Return early from the short path. 2020-04-25 17:33:49 -04:00
Richard Kimberly Heck
f1d5926a5d Fix warnings. 2020-04-25 01:26:37 -04:00
Juergen Spitzmueller
9e71bdfd32 fix comment 2020-04-18 08:01:39 +02:00
Juergen Spitzmueller
d9b884341c Reset failedtoload_ bool when include inset params are changed (#11842) 2020-04-17 10:19:46 +02:00
Juergen Spitzmueller
2748e33be5 Fix indentation 2020-04-06 16:29:34 +02:00
Juergen Spitzmueller
4ddc9e2501 Color broken citations, xrefs, and includes
Fixes #11503
2020-03-14 14:17:30 +01:00
Juergen Spitzmueller
d94b708a0f Tell updateBuffer whether an inset is deleted.
Fixes #11747
2020-03-06 13:23:01 +01:00
Jean-Marc Lasgouttes
aeed6fb8fa Do not check again and again for non existing files
If the file of an InsetInclude does not exist, loadIfNeeded will try
again and again to look for it. This is very bad for files with many
include insets, especially on windows.

Fixes bug #11656.
2019-12-26 16:45:40 +01:00
Scott Kostyshak
989a49f377 Remove execute permission from two source files 2019-12-15 23:32:29 -05:00
Scott Kostyshak
c61472303e Fix crash due to encoding issues with child doc
This crash occurred starting with 553bebc3, and can be triggered
when preview is enabled both in preferences and in a child document
inset. For a minimal example, see the following ML thread:

  https://www.mail-archive.com/search?l=mid&q=20191209002609.6fao3dljtf3ohl25%40tallinn

This fix restores behavior to before that commit for the case when
oldEnc is 0.
2019-12-10 09:17:49 -05:00
Jean-Marc Lasgouttes
3aba81cf6a Many small code cleanups suggested by cppcheck 2019-09-16 00:45:20 +02:00
Richard Kimberly Heck
05a446b77c Fix bug #11636.
Directories are created when files are copied, so we do not need
to do it prospectively here.
2019-09-11 20:54:42 -04:00
Richard Kimberly Heck
a20f3a0d52 Revert last two commits, which we pushed accidentally. 2019-09-11 20:47:07 -04:00
Richard Kimberly Heck
1fb308cd02 Whoops, forgot this part 2019-09-11 20:30:31 -04:00
Richard Kimberly Heck
26813996e2 Constify, largely for debugging purposes 2019-09-11 20:29:58 -04:00
Richard Kimberly Heck
6960bab65c Fix bug #11612.
Register verbatim includes with the outliner.
2019-07-11 16:21:38 -04:00
Richard Kimberly Heck
83afe8aa19 Shorten labels. 2019-07-11 16:21:38 -04:00
Richard Kimberly Heck
c286228315 Make Ctrl-Mouse open an included file for editing.
It might be nice to do this also for other insets that allow editing.
To do that properly, we'd want to standardize how such insets call an
external (or internal) program, which I guess would mean a virtual
method corresponding to editIncluded. When it exists (i.e., isn't null),
then we could call it, and we'd only need one centralized method to do
that. But at the moment, we have editGraphics, etc.
2019-04-26 22:05:42 -04:00
Richard Kimberly Heck
276ffc262c Simplify a bit.
Also, I always worry that "file" will conflict with something....
2019-04-26 22:05:42 -04:00
Günter Milde
553bebc355 Fix #11520 Wrong inpute encoding when master and child use different setting. 2019-03-18 18:17:39 +01:00
Günter Milde
dae90c6161 Warn user, if input encodings of master and child document differ. 2019-03-18 18:17:39 +01:00
Juergen Spitzmueller
c41df5b671 Warn if included file does not exist
Patch by Jürgen Womser-Schütz
2019-03-12 09:00:59 +01:00
Kornel Benko
aaffcd0b39 FindAdv: Do not use data from included listing if in search mode
Fixes #11496 	"Find and replace (advanced)" is too slow
2019-02-27 10:17:56 +01:00