Introduce a distinction between being read-only and having the read-only flag. A
buffer is read-only if either it has been externally modified or if it has the
read-only flag.
For biblatex, we need the file name as it was entered in the inset
(abs path, rel path, only file name) in order to resolve it properly
for the export (as in the BibTeX inset intself).
Therefore, we now store a pair<docstring, FileName>.
A FileNamePairList has been added to FileNameList for this purpose.
Addressing #10481.
This patch adds the new 'needauth' option for converters launching
external programs that are capable of running arbitrary code on behalf
of the user. These converters won't be run unless the user gives explicit
authorization, which is asked on-demand when the converter is about to
be run (question is not asked if the file is cached and calling the
converter is not needed).
The user prompt has a 3rd button so that he/she's not prompted again
for (any converter over) the same document (identified through
buffer->absFileName()).
Two preference options are added:
lyxrc.use_converter_needauth_forbidden disables any converter with
the 'needauth' option, which is meant to force user to an explicit
action via the preferences pane, before being able to use advanced
converters that can potentially bring security threats;
lyxrc.use_converter_needauth enables prompting the user for 'needauth'
converters, or bypasses the check if not enabled, falling back to the
previous behavior.
So, the first option is for maximum security, the second is for
maximum usability.
This is a mechanical replacement. For now it seems that unique_ptrs are
essentially used for exception-safety. More could certainly be done to clarify
pointer ownership in general.
(#8738)
For efficiency, we add a new flag to the buffer indicating when changes are
present. This flag is updated at each buffer update, and also when explicitly
requested via a dispatch result flag.
The current behaviour of the \origin parameter replaces relative file names
with the absolute original names if a document has been moved even if the
files have been moved as well. This behaviour is annoying e.g. for editing the
LyX docs in a git checkout.
Now file names are only replaced if the referenced file sdo not exist.
LyX format, create a backup of the original file. We put it in the backup
directory, if one exists, otherwise in the directory the original file is
in. This is the same strategy as for normal backups. Basically, the only
diferences are: (i) what name we use and (ii) we do not over-write any
backups that may already exist.
Fix bugs #6501 and #7359.
* Selection highlighting has been broken since a conflict with
reverse-search was repaired (at 00a62b7c), is now fixed.
* The selection highlighting was not accurate, for LaTeX formats (in
full source view), and meaningless, for non LaTeX formats.
* fix regression at cc00b9aa: force_getcontent_ was always true
therefore the code to detect changes in the generated source was
dead. The consequence is that the source view would jump to the
beginning at each updateView() even if no change occurred. Cc00b9aa
was meant to fix#5600, which I cannot reproduce with the new
implementation.
* Various improvements:
* When the position-to-line conversion is unavailable (LyXHTML, LyX
source, etc.) we focus on the first difference instead.
* Get some space around the cursor
* Respect the scrollbars
* Highlight with QTextEdit::ExtraSelections instead of cursor
selection (the latter used to break syntax highlighting of the
TeX code... which was not so much of an issue before because the
wrong part was selected)
Known issues:
* The highlighting is off by one line in very last paragraph of a
document. This appears to be a bug in TexRow.cpp.
* The highlighting is off for any kind of inset. This could be
solved by adapting TexRow so that it accepts CursorSlices as
and argument for the conversion to line number. (this is bug
#4725)
It is now possible opening documents that where manually moved to a
different location after they were saved and still produce an output.
Indeed, (hopefully) all needed included files are now still found.
When the moved document is saved again, all paths are accordingly updated.
Of course, for this to work, a document has to be saved in Format 490,
at least.
As an example, after converting the user guide to the last format, it can
be copied anywhere and opened without the need of adapting the paths of
included files or moving them to a proper place.
There is one glitch I am aware of. When moving a child document (but not
the master) the path to the master is correctly updated but it won't be
recognized as such. This is because LyX checks that the parent actually
includes this document but, of course, being the parent document not
touched, it appears not including this child. Anyway, it will also occur
when saving the child to a different location and the user is warned
on the terminal about this fact when the moved child is loaded.
However, there is no problem when it is the master that has been moved.
The "save-as" part of the bug is fixed by extending the \textclass tag
such that, if a local layout file is used, its path relative to the
document directory is now stored together with the name. If a relative
path cannot be used, an absolute one is used but, in this case, the
document is not usable on a different platform.
The "copy" part is fixed by introducing a new \origin tag, which is
written when the file is saved. This tag stores the absolute path of
the document directory. If the document is manually copied to a
different location, the local layout file is retrivied by using
\origin (which is only updated on save).
This new tag may prove useful also for locating other files when the
document is manually moved to a different directory.
As in the original implementation the files needed for the layout
(for example, a latex class) had to be in the same directory as the
layout file, this directory has also to be added to TEXINPUTS.
As Enrico said, the user might have installed a package that was
missing (in which case the .tex file would not have changed).
Another reason is that changing some document settings did not
automatically lead to a fresh compile after an error (#9061).
Our old mechanism for detemining whether there was an error was to
check if the dependent file existed in the temporary directory. If
it did not exist, that meant it was removed, presumably because
there was an error during compilation. That mechanism cannot be used
anymore because we keep the files around even after error because of
the "Show Output Anyway" button (09700d5b). This commit implements a
more straightforward way of checking whether there was an error in
the previous preview by simply storing the success of last compile
in a buffer variable.
If LyX thinks the export was successful but no output file was
produced for preview, then something is wrong (most likely LyX
did not detect an error that occurred during export).
Also clean up some logic.
One declaration of doExport() was not used, and the other one was only used by
Buffer, so make it private since returning the exported file name is a bit
strange if it can also appear as input argument.
Add display_pixel_ratio to buffer params to use it for displays with high resolution.
It holds the highest ratio between physical pixels and device-independent pixels of the LyX application.
Preview snippets will be generated using this value to get high resolution preview.
As discussed on the list. No automatic contents detection is done, the user
needs to use the special paste menu instead. I used the new TempFile class
for safe temporary file handling.
The documentation would go into section 2.2 of UserGuide.lyx, but I am not
allowed to edit that document.
Both cvs and svn are able to retrieve non-existing files from repository,
but this was only implemented for rcs. This is a prerequisite for the
planned move and copy VCV operations. I also improved error schecking and
used extractFromVC() also for files specified on the command line if they
do not exist (in GUI mode, it was already the case in non-GUI mode).
The code does a reload on the buffer to avoid loose pointers if the
file changes directory. This commit adds a bool parameter to
Buffer::reload to allow for keeping the undo stack intact. This is of
couse only wanted in this case, not when reloading an earlier version
of the file.
We split Buffer::clone() into various routines that know whether
to clone the children.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40357 a592a061-630c-0410-9148-cb99ea01b6c8
The global list of cloned buffers was a bad idea. We don't have multiple
export threads, but we can have multiple autosave threads. So now we keep
more than one of these lists at the same time, and each cloned buffer has
a pointer to the relevant list. Note that this would make multiple export
possible, if we wanted to do that at some time.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40227 a592a061-630c-0410-9148-cb99ea01b6c8
- Let all doExport calls honor maintain_unincluded_children
- Also don't let the behaviour depend on supplying the result_file parameter
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40085 a592a061-630c-0410-9148-cb99ea01b6c8