Commit Graph

986 Commits

Author SHA1 Message Date
Stephan Witt
e93444e7e9 #9514 improved document iterator for correct check of speller disabled state 2015-05-08 11:13:51 +02:00
Stephan Witt
93b0f9c080 #9514 contents inside of LyX insets with spell check disabled should be ignored by spell checker.
The document iterator now skips math insets and insets like notes where spell check is disabled.
The continuous spell checking is part of the row painter drawing and the spell check disabled state
has to be passed down recursively while doing the inset painting.
2015-05-06 18:39:24 +02:00
Enrico Forestieri
d0146c8e82 Don't update paths of non-existing files 2015-05-05 22:30:10 +02:00
Scott Kostyshak
72c5385f83 Do a fresh compile for preview after error (#9061)
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.
2015-05-05 00:30:50 -04:00
Enrico Forestieri
8c351e32be Update paths of included files when saving to a different folder.
Fixes #9528 and #5115.
2015-05-03 23:55:19 +02:00
Scott Kostyshak
09700d5b71 Button for showing PDF if compilation error
Building on cd8be655, we still allow viewing a produced PDF even if
there were compilation errors. However, now the user must click the
"Show Output Anyway" button in the LaTeX Errors dialog. The reason
is that before, there was a chance that the user would not realize
there was an error (because the PDF would be shown over the error
dialog). The approach in this commit makes it more clear that there
is an error.

A new LFUN is introduced, LFUN_BUFFER_VIEW_CACHE. It is useful not
just for the implementation of the "Show Output Anyway" button, but
also to show the last compiled version of a document, which can save
time if a document takes a long time to compile (e.g. heavy use of
knitr).
2015-04-04 13:13:19 -04:00
Jean-Marc Lasgouttes
4dcc73ebf0 Get rid of autoBreakRow, which is obsoleted by allowMultiPar()
The only real user was Text::insertStringAsLine, but this got changed
in commit 2c7152ab.

While not other place did read the value, there is a side effect of
setAutobreakRow that merges exiting paragraphs. However, this is used
in two situations

* some constructors, where the inset is empty;

* InsetTabular::toggleFixedWidth, which actually contains itself some
  code to merge paragraphs.

Therefore the member and all associated code can be removed safely.
2015-03-31 17:02:00 +02:00
Scott Kostyshak
7416064033 Assert if successful export but no output file
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.
2015-03-20 02:21:35 -04:00
Scott Kostyshak
cd8be655f1 Export/view a PDF even if error
A PDF is often still produced after a LaTeX error.

If there was an error when exporting a PDF, we now give an error
and the PDF (if it exists), where before we gave the error and
not the PDF. The GUI and command line behaviors are consistent:
in the GUI an error is given and the PDF is viewed; on the
command line, a non-zero exit code is given and a PDF is created.

This also solves what was in my mind an inconsistency: if the user
"updated" a document and there was an error, the resulting
PDF would be shown; but if the user viewed a document and there
was an error, the document would not be shown.

Note that this applies to all output formats, not just PDF.

For discussion, see:
https://www.mail-archive.com/lyx-devel@lists.lyx.org/msg186454.html
2015-03-20 02:21:31 -04:00
Georg Baum
423a55acc6 whitespace 2015-03-18 21:33:10 +01:00
Georg Baum
73c3f3e2fd Improve code readability
Using a small helper struct instead of a std::pair makes things like
it->second.first a little less confusing: it->second.scope.
2015-03-15 13:57:45 +01:00
Jean-Marc Lasgouttes
0552563c99 Initialize Buffer::Impl members correctly
In practice the variables were initialized later as needed.

Fixes coverity issue 23497.
2015-03-04 17:57:29 +01:00
Jean-Marc Lasgouttes
b627b8701b Some performance stuff reported by cppcheck 2015-02-24 18:38:20 +01:00
Jean-Marc Lasgouttes
2694fde47d Initialize variable properly.
This fixes coverity issue 23503.
2015-02-20 16:47:27 +01:00
Jean-Marc Lasgouttes
01691cde49 Fix uninitialized variable
Fixes coverity issue 23446.
2015-02-20 15:53:19 +01:00
Scott Kostyshak
36c3495a3a Correct the spelling of "occured" to "occurred" 2015-02-09 18:44:02 -05:00
Juergen Spitzmueller
5563dc924a Fix output encoding information for non-TeX fonts XeTeX/LuaTeX on preview pane
Fixes: #8919
2015-01-24 15:53:28 +01:00
Jean-Marc Lasgouttes
7021f4c342 Implement new recordUndoBufferParams method.
Rename recordUndoFullDocument to recordUndoFullBuffer.

Separate the notion of recording changes to paragraphs and recording changes in buffer parameters.

Audit every user of recordUndoFullDocument and replace it with either recordUndoBufferParams or recordUndoFullBuffer. Add comments to identify remaining work.
2015-01-22 15:15:21 +01:00
Georg Baum
c86f299a50 Encapsulate Converter class
Now members are not directly accessible anymore.
2014-12-07 18:35:28 +01:00
Georg Baum
e066dd6bd9 A stringstream is overkill here 2014-11-30 12:37:43 +01:00
Georg Baum
f146bded7a Document Buffer::preview() 2014-11-17 22:07:38 +01:00
Georg Baum
2d338ee3e2 Fix for bug #9234, from Georg.
Our TempFile class uses QTemporaryFile internally, and, on Windows,
this keeps the file locked so that we cannot rename it. So we have
to release the lock.
2014-11-03 10:09:40 -05:00
Richard Heck
8ec3e3283a If we successfully save a file but fail to move it to its proper location,
then, if we made a backup and the original file was not a symlink, we moved
that file, so it will look to the user as if it was deleted. This is bug
2014-10-27 11:26:58 -04:00
Stephan Witt
f9bff2d9b1 #9130 Text in main work area isn't rendered with high resolution
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.
2014-10-18 15:39:58 +02:00
Richard Heck
a5c4ccfd26 Add a debugging message. 2014-08-25 11:14:27 -04:00
Jean-Marc
93a43742a5 Fix a bunch of small performance issues spotted by cppcheck
Most of these are about passing const strings parameters as references.
2014-07-05 19:13:10 +02:00
Georg Baum
4bfca60359 Make createBufferTmpDir() threadsafe
This must not use thread local storage, since the generated directories are
all in the same parent directory which is unique per running LyX instance.
2014-07-05 12:31:12 +02:00
Georg Baum
50467f3f55 Don't guess whether autosave succeeded
writeFile() tells whether it could save the file, so use the return value
instead of guessing.
2014-07-04 21:06:49 +02:00
Georg Baum
f792e70d0a Fix wrong "externally modified" message
This was a regression of 10364082c8.
2014-06-09 13:17:40 +02:00
Georg Baum
f09a9fe2e6 Remove unsafe method FileName::tempName()
FileName::tempName() created a new temp file name by using qt to create a
temporary file with a unique name, and then deleting that file and returning
the name. This was unsafe, since other processes or even other threads of the
running LyX could create files with the same name between deletion and then
using the temp name.
This is fixed by using the TempFile class instead. As a side effect, a few
cases where the temp files were not deleted after usage were fixed as well.
The only place that is still unsafe is createTmpDir().
2014-06-09 13:05:50 +02:00
Georg Baum
bf782ee02a Improve file saving strategy
- The TempFile class guarantees to generate a file name, we are not limited to
  100 tries of a predictable scheme anymore, which could break if LyX
  frequently crashes.
- The temp file name generation has no race condition against another LyX
  instance in the same directory anymore.
- Symlinks survive saving again (regression of 10364082c8).
2014-06-09 11:08:24 +02:00
Richard Heck
533a05e0b8 Use a different naming scheme, per Enrico's suggestion. 2014-06-04 12:46:42 -04:00
Richard Heck
10364082c8 Per a suggestion of JMarc's, first write the saved file to a
temporary name, then move it to its real location if we succeed.
This prevents our over-writing the existing file with a corrupt
one.
2014-06-03 10:42:07 -04:00
Jean-Marc Lasgouttes
5c32dc85d5 Fix various warnings issued by clang++.
* remove unused class TexStream.

* remove unused virtual method Inset::cellXOffset

* remove second argument of FileDialog constructor, which was actually
  not used

* remove some dead local code

* remove some unused private members of classes

* in InsetMathNest::updateBuffer, fix the logic of a test
2014-04-22 00:04:04 +02:00
Richard Heck
0a6ff99f28 Typos and style. 2014-04-21 11:51:59 -04:00
Richard Heck
fdbe775b9f This is the result of an audit of all static variables, looking
for possible thread conflicts, of the sort Georg resolved at
6a30211f. I have made static variables const where possible,
and marked cases that looked potentially problematic with the
comment:
	// FIXME THREAD
Many of these definitely are vulnerable to concurrent access, such
as the static variables declared at the start of output_latex.cpp.
Suppose, e.g., we were outputting latex and also displaying the
source of a different document.

I'd appreciate it if others could grep for "FIXME THREAD" and see
if some of these are harmless, or what.
2014-04-21 11:51:57 -04:00
Juergen Spitzmueller
7c1fc6ea75 Include child's own authors when using BufferParams from master. 2014-03-13 06:43:38 +01:00
Georg Baum
07afd76b7c Fix compilation with libc++
libc++ (http://libcxx.llvm.org/) is used on OS X with newer XCode.
The patch is from Benjamin Piwowarski <benjamin.piwowarski@lip6.fr>, I only
added more comments.
The changes regarding implicit conversion to bool of std::iostream work
because both the C++98 and C++11 standards guarantee that boolean evaluation
of streams returns !fail(). See e.g.
http://stackoverflow.com/questions/1334858/why-dont-iostream-objects-overload-operator-bool
for details.
2014-03-04 23:27:57 +01:00
Juergen Spitzmueller
fa6b388cb3 Do not issue module warnings when just cloning a buffer (#8864) 2014-02-09 11:16:20 +01:00
Richard Heck
3f62601a8f Fix bug discovered by Kornel. See
http://marc.info/?l=lyx-devel&m=138590578911716&w=2
If you look at Buffer.cpp, around line 4351, there was a comment about bug 5699. We are seeing the
same crash. The problem is that, although the master does have a GUI, that GUI is in a different window. So the structureChanged() call we do during updateBuffer() is for the TOC in that window, not the TOC in the window we are actually in. So our TocModel::toc_ has been reset and is invalid, though the widget itself has not been updated and looks fine.

This patch tests whether the master is in the same window as the buffer we are updating.

A problem remains, which is noted in a comment.
2014-01-29 11:23:03 -05:00
Jean-Marc Lasgouttes
2a99afee94 Handle undo in `branch-add' LFUN 2014-01-13 17:32:32 +01:00
Juergen Spitzmueller
cb699fbc1c Do not attempt to set default master if we already have a parent 2013-11-23 16:51:16 +01:00
Georg Baum
8eb8e49ebe Do not ignore literate programming errors 2013-11-14 21:04:37 +01:00
Georg Baum
2aa2544e1d Fix regression of e02df14 (bug #8900)
In e02df14 the return type of doExport was changed from bool to ExportStatus.
All calls except this one were adjusted. This one did now fail because the
numercial value of ExportSuccess is 0.
2013-11-14 20:56:50 +01:00
Georg Baum
be468136df Silence unwanted error popup on copying
The new HTML clipboard export could cause error message boxes on copying
data to the clipboard (bug #8866). These are now suppressed, like all other
errors which might occur for preparing the clipboard data.
2013-11-12 20:52:35 +01:00
Jean-Marc Lasgouttes
b89ef8a5b3 Revert "Do not kill the undo stack when doing a Save As..."
This commit was causing bug #8821.

This reverts commit 467422f9df.
2013-10-04 15:01:42 +02:00
Vincent van Ravesteijn
8164fea772 Encodings: Use BufferEncodings where needed 2013-09-29 15:26:22 +02:00
Josh Hieronymus
1dcd6ee5e7 Update system identifier in DOCTYPE of MathML-including exported XHTML.
From Josh Hieronymous.

(cherry picked from commit 4f0c81937537ca3bf92097e266d367290d6419a9)
2013-07-19 09:45:10 -04:00
Juergen Spitzmueller
49c89d838b Fix state of certain language packages (polyglossia, japanese) in children (#8779) 2013-07-18 09:26:56 +02:00
Georg Baum
822e171762 Fix inconsistent version in .lyx files (#7951)
LyX, lyx2lyx and tex2lyx produce now all the same version indicator consisting
only of the major and minor version. It is not decided yet whether future
development versions will add a -dev suffix, but for 2.1.0 this change fixes
the inconsistencies.
2013-07-13 16:02:26 +02:00
Julien Rioux
bfc731de45 Compute and output numbers for numerical citations. 2013-05-16 16:10:05 +02:00
Georg Baum
7bdc34a987 Implement forced local layouts
These should be used if any new style needs to be introduced in the stable
2.1 series: If the ForceLocal flag of the style is set, it will always be
written to the document header, so that even older 2.1 versions can read
and correctly output the document.
2013-05-15 07:19:49 +02:00
Jean-Marc Lasgouttes
21c5bbec71 Fix bug #8627: Command line switches to change branch do not appear to work
Move the handling of branch-(de)activate(master) to Buffer. This code was moved to Bufferview in [3a03e71c/lyxgit] because a cursor was necessary to call Undo::recordUndoFullDocument(). However, it turns out that the undo code is already prepared to handle an empty cursor (and do nothing in this case).

Therefore we do that and move the branch code to Buffer where it belongs.

Note that there was a bug in the previous code that broke undo support: recordUndo should always be called _before_ doing any change.
2013-04-29 17:24:28 +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
Richard Heck
6c983d6cd1 Simplify code a bit: If we only accept CITE_CODE, there is no need
to pass it.
2013-04-25 17:22:07 -04:00
Scott Kostyshak
4e6932e44f Fix ChkTeX error reporting (#8639)
ChkTeX errors from a previous run are now cleared from the
error list if ChkTeX exits with no error.
2013-04-22 15:51:36 -04:00
Georg Baum
85b3db19af Fix bug #8636
This was a simple logic error that crept in during refactoring:
If the format does not match, and the converted file has been read,
the string must not be read.
2013-04-21 21:34:10 +02:00
Richard Heck
db358a4315 Fix bug found by Scott concerning copying XHTML to clipboard. We
needed to updateMacros() before doing the export, which required a
bit of code massaging.
2013-04-20 21:07:07 -04:00
Georg Baum
c14b9e67bc Implement paste from LaTeX and HTML (bug #3096)
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.
2013-04-14 19:45:36 +02:00
Richard Heck
b447587aa9 Remove obsolete comment. 2013-04-11 21:07:57 -04:00
Georg Baum
0d7702e5e6 Delete temp file after usage 2013-04-01 12:24:24 +02:00
Richard Heck
d2e947d585 Fix bug #8603: We want unabbreviated TOC entries here. 2013-03-24 09:34:36 -04:00
Richard Heck
2c75ad0294 Allowing direct, read-write access to the references cache just seems
like a bad idea.
2013-03-18 19:32:30 -04:00
Richard Heck
096de4d82c We don't need to reset counters we aren't using. 2013-03-18 18:46:08 -04:00
Richard Heck
e2155d3d58 Create a new DocumentClass for any cloned Buffer.
Uwe says that this fixes #8425.
2013-03-11 10:01:32 -04:00
Richard Heck
86994bf753 Add a member to TocItem that tells us whether the item in question
is included in output.
2013-03-08 16:38:18 -05:00
Richard Heck
32b0e8cbdb Change LabelType Top_Environment to LabelType Above, and LabelType
Centered_Top_Environment to LabelType Centered.
2013-02-09 13:44:06 -05:00
Richard Heck
57d8b059e0 Remove references to Counter LabelType from source code. The
intention is to use Static in its place, and we now expand the
label for these, as well.
2013-02-09 13:44:05 -05:00
Julien Rioux
cc1ce04798 Generate the citation labels before exporting to plain text. 2013-02-06 17:37:58 +01:00
Jean-Marc Lasgouttes
14e01a92a4 Rename Path.h to PathChanger.h (actual name of the class) 2013-02-06 11:51:06 +01:00
Georg Baum
1a48d5a967 Dot not swallow log messages 2013-02-03 19:55:44 +01:00
Georg Baum
393e7924bd Add missing VCS updates after filename changes 2012-11-13 21:52:38 +01:00
Pavel Sanda
d7ed0ba7e4 Autosaving is now always threaded. 2012-11-04 16:51:18 +01:00
Lars Gullik Bjønnes
6b2232a29c src/*.cpp: reformatting to increase consistency 2012-10-28 17:42:07 +01:00
Lars Gullik Bjønnes
d52c9fda34 Use new T not new T() 2012-10-27 01:25:38 +02:00
Lars Gullik Bjønnes
b6a626d8d9 Buffer.cpp: drop unused <stack> 2012-10-27 01:25:38 +02:00
Juergen Spitzmueller
63612ca99b Restore buffer parenthood if we exit already after the preamble 2012-10-05 19:26:07 +02:00
Juergen Spitzmueller
b6ecb3213b Add master's perspective in children's source preview 2012-10-05 14:30:20 +02:00
Juergen Spitzmueller
2fa840b771 Do not let the children's buffer params leak into the master (#5941) 2012-10-05 09:59:44 +02:00
Juergen Spitzmueller
02c73cd721 Do not let the parent interfere when I child document is exported/view standalone (#8100, #8101) 2012-10-03 10:41:07 +02:00
Pavel Sanda
13dfbd1927 Simplify translation string. 2012-09-20 13:35:53 +02:00
Scott Kostyshak
51c380440b Constify some catches and others 2012-09-17 04:05:34 -04:00
Richard Heck
894569e601 Fix a long-standing FIXME by resetting only the counter for top-level
sectioning when we see an appendix. This fixes bug #8271, whose root
cause was the fact that we were resetting all the counters inside ERT.
2012-07-21 14:19:10 -04:00
Jean-Marc Lasgouttes
467422f9df Do not kill the undo stack when doing a Save As...
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.
2012-07-18 10:31:47 +02:00
Jean-Marc Lasgouttes
f6b1c24b99 Fix bug #5204: Undo removes text selection
This commit does a bit more than fix selection, since it saves the full cursor state
in the undo stack. This means that undo now restores:
* the selection
* the current font
* transient mark (shall we keep this one?), logical position...

In order to do that, it introduces an intermediate class between Cursor and DotIterator: CursorData.
The new inheritance diagram is thus
  DocIteraator -> CursorData -> Cursor

CursorData contains all the members of Cursor that define the current position, but not the stuff
related to current view of dispatch mechanism. It may make sense in the future to move members
between CursorData and Cursor and to move some member functions to CursorData.

Now UndoElement uses CursorData for cur_before and cur_after, but not for the cell. The undo API uses
also CursorData instead of DocIterator.
2012-07-15 18:16:09 +02:00
Richard Heck
5400ae0720 Fix bug #8160 by updating the dtd for MathML. 2012-07-10 18:07:07 -04:00
Jean-Marc Lasgouttes
bbbc2b6541 Fix to #8159: Undo doesn't restore environment depth correctly
The idea is to record undo at the place where the document is modified:

1/ in Buffer::updateBuffer, add a recordUndo, with the caveat that a
   const_cast has to be used (because updateBuffer is const but
   modifies the document, go figure).

2/ in GuiApplication::dispatch, add an extra undo group that
   encompasses the updateBuffer call. Some other undo groups may be
   redundant now, but it is not a problem since they do not cost
   anything.
2012-06-29 15:25:47 +02:00
Juergen Spitzmueller
6de47fa873 fix bug #8209: polyglossia commands ignored partial source preview 2012-06-28 18:15:43 +02:00
Juergen Spitzmueller
f84c8c56f5 Whitespace 2012-06-08 20:31:20 +02:00
Richard Heck
b7ac2d69e7 Allow LyX format to be written to View>Source window. 2012-06-05 10:24:15 -04:00
Richard Heck
cfc43d772d Move TexRow stuff near where it is used. 2012-06-05 10:24:15 -04:00
Jean-Marc Lasgouttes
9a3b6733c0 Revert "Second tentative fix to #8159: Undo doesn't restore environment depth correctly"
Did not mean to commit that.

This reverts commit 8f01556236.
2012-06-05 12:55:37 +02:00
Jean-Marc Lasgouttes
8f01556236 Second tentative fix to #8159: Undo doesn't restore environment depth correctly
In this version, the idea is to record undo at the place where the document is modified, which is definitely cleaner.

1/ in Buffer::updateBuffer, add a recordUndo, with the caveat that a
   const_cast has to be used

2/ in GuiApplication::dispatch, add an extra undo group that
   encompasses the updateBuffer call. Some other undo groups may be
   redundant now, but it is not a problem since they do not cost
   anything.
2012-06-05 11:32:56 +02:00
Jean-Marc Lasgouttes
a756403301 "Performance" fixes suggested by cppcheck
While cppcheck did not turn out any suspicious error messages, using
the "performance" flag highlighted several nitpicks in three categories
 * do not use it++ for iterators, ++it is better
 * do not use size() to test for emptyness, empty() is here
 * do not use "const T" as a function parameter, "const & T" is better

I doubt that any of these is a real performance problem, but the code is cleaner anyway.
2012-05-28 22:42:44 +02:00
Richard Heck
288c1e0faa Add "nice" flag for converters, addressing final problem with bug #4624. 2012-05-22 08:56:05 -04:00
Juergen Spitzmueller
ab1434dce3 If a file is saved as, reset its master if it has any, thus preventing a crash (bug 8161) 2012-05-19 10:16:28 +02:00
Enrico Forestieri
93ebb7a863 Fix bug #7982: LyX does not work if working directory a hard disk drive like D:\
In this case, the working dir has already a slash at the end.
Appending another one would result in a path ending with a double slash,
which has a special meaning when used in TEXINPUTS (all subdirs would
be recursively scanned). So, avoid doing that.
2012-05-14 13:08:30 +02:00
Vincent van Ravesteijn
5279d5a8a5 Properly mark a buffer as internal
Checking the extension of the temporary filename doesn't work anymore
since the naming of temporary files was corrected.
2012-05-06 20:12:17 +02:00
Richard Heck
631abb2da0 Allow viewing full file of plaintext source. 2012-04-27 21:17:08 -04:00
Richard Heck
db71ec4477 Re-organize logic of getSourceCode() routine, so we can see XHTML
for DocBook files.
2012-04-27 21:14:25 -04:00
Richard Heck
e56ee0b2e6 Don't output extra body tags with included files. 2012-04-23 13:55:13 -04:00
Enrico Forestieri
3285ce1d5c Use the right latex backend when a converter needs aux files.
If a converter specifies the needaux flag, latex (or xelatex) is
always run to produce the needed auxiliary files. This is wrong
because there are documents that can only be compiled with a specific
backend and thus the conversion may fail. On the other hand, even if
the document specifies the backend to be used, LyX ignores this info.

This commit rectifies this behavior by letting LyX run the same flavor
of the latex backend that shall be used for previewing the document
also for producing the auxiliary files.
2012-04-11 18:38:32 +02:00
Vincent van Ravesteijn
91bc04946f Fix a copy-paste error introduced in b754fb02 2012-04-08 21:47:40 +02:00
Richard Heck
33f34e8ffb Clear local layout before reading BufferParams. Otherwise, you can't
delete the local layout.
2012-04-03 15:53:56 -04:00
Georg Baum
1a6c599917 Extend the notermination flag to math as well.
Math commands need it as well as text commands. At the same time, this
further unifies the checking for termination and fixes cases of wrong
output (e.g. for 0x2005).
2012-03-25 15:57:38 +02:00
Vincent van Ravesteijn
1d5204315e Clear the error list from previous errors
We only copied the error list to the cloned buffer when makeLatexfile
failed. This means that a second try will never clear the error list and
the user will be presented the same list again.

Therefore, we unconditionally copy the error list such that we also clear
the list on success.
2012-03-17 19:00:25 +01:00
Richard Heck
fa0c2d9631 Show backends rather than formats in the View>Source combo box.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40900 a592a061-630c-0410-9148-cb99ea01b6c8
2012-03-09 22:24:20 +00:00
Georg Baum
26e5f1a8ec Use libmagic for file format detection if available.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40789 a592a061-630c-0410-9148-cb99ea01b6c8
2012-02-21 20:29:44 +00:00
Richard Heck
9283cbdbcb Fix crash reported on list when renaming a child buffer and
then trying to compile.

    There are really two problems here. One is that the renamed
    buffer needs to be reloaded. All kinds of files, etc, may not
    exist any more, if we've been saved to a new directory; our
    children e.g. may not be in the right place. And, in this case,
    we may no longer be a child of our old parent. Reloading will
    fix all of that.

    On reload, though, we need to clear our parent, since we may
    not have one any more. It will get reset if need be.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40609 a592a061-630c-0410-9148-cb99ea01b6c8
2012-01-13 03:31:01 +00:00
Stephan Witt
42dfd71197 #7789 unify and fix buffer statistics
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40602 a592a061-630c-0410-9148-cb99ea01b6c8
2012-01-12 07:03:24 +00:00
Richard Heck
c3f0e21968 Activate ability to write CSS to a separate file. There is no UI
for this yet, however.

Includes elements of a patch by Rob Oakes.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40409 a592a061-630c-0410-9148-cb99ea01b6c8
2011-12-06 22:17:22 +00:00
Richard Heck
986222a754 Collect CSS information in a string before writing it to the header.
This will make it easier to write it to a separate file.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40408 a592a061-630c-0410-9148-cb99ea01b6c8
2011-12-06 22:17:18 +00:00
Richard Heck
38b9a4530e New methods in LaTeXFeatures specifically for collection of CSS
information on XHTML output.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40407 a592a061-630c-0410-9148-cb99ea01b6c8
2011-12-06 22:17:13 +00:00
Richard Heck
e7877f6fee Math output flavor was not set when viewing source code.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40406 a592a061-630c-0410-9148-cb99ea01b6c8
2011-12-06 22:17:06 +00:00
Richard Heck
93146dc614 Need to save a pointer to this list, too.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40360 a592a061-630c-0410-9148-cb99ea01b6c8
2011-12-04 03:05:08 +00:00
Richard Heck
8e553c5671 We need to create the clone list here, even though the only thing
in it will be the one Buffer we are cloning.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40358 a592a061-630c-0410-9148-cb99ea01b6c8
2011-12-04 02:35:38 +00:00
Richard Heck
1ae948e136 Fix #7923: Don't clone all the children on autosave.
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
2011-12-03 23:20:18 +00:00
Julien Rioux
e93092e72b Remove the .aux and .bbl files when we switch the citation engine or style.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40355 a592a061-630c-0410-9148-cb99ea01b6c8
2011-12-03 22:58:38 +00:00
Julien Rioux
dfdcc56cba Remove extra whitespace.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40346 a592a061-630c-0410-9148-cb99ea01b6c8
2011-12-03 22:15:11 +00:00
Richard Heck
3a03e71c3e Deal with the part of #7872 involving changes of branch activation
from Document>Settings.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40333 a592a061-630c-0410-9148-cb99ea01b6c8
2011-12-02 21:21:30 +00:00
Richard Heck
74ee5c0e69 Add assertion to check for memory leaks and remove the list when
we are done.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40228 a592a061-630c-0410-9148-cb99ea01b6c8
2011-11-20 18:49:12 +00:00
Richard Heck
7e42cfd690 New attempt to fix Pavel's crash, this modifies r40205 and r40207.
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
2011-11-20 18:49:05 +00:00
Richard Heck
14c10e40a8 Fix bug #7872: Mark Buffer dirty after changing branch activation.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40211 a592a061-630c-0410-9148-cb99ea01b6c8
2011-11-18 20:48:54 +00:00
Richard Heck
eecb001e95 Make sure we aren't trying to reuse the global variable, and make
sure we aren't leaking any cloned buffers.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40208 a592a061-630c-0410-9148-cb99ea01b6c8
2011-11-17 18:26:42 +00:00
Richard Heck
a8d12fdd66 Fix crash reported by Pavel. Multiply included children would crash
the destructor since we could, in some cases, end up deleting them
multiple times. So we need to keep a list of the Buffers we need to
delete, kind of like the BufferList.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40205 a592a061-630c-0410-9148-cb99ea01b6c8
2011-11-17 17:58:22 +00:00
Richard Heck
6e15590764 Revert previous patch to get a decent log message.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40204 a592a061-630c-0410-9148-cb99ea01b6c8
2011-11-17 17:58:18 +00:00
Richard Heck
75dc38ca74 Merge branch 'PavelCrash2'
Conflicts:
	src/Buffer.cpp

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40203 a592a061-630c-0410-9148-cb99ea01b6c8
2011-11-17 17:54:20 +00:00
Richard Heck
de3148c7c3 Simplify code slightly.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40202 a592a061-630c-0410-9148-cb99ea01b6c8
2011-11-17 17:29:38 +00:00
Richard Heck
94f0968e92 Minor cleanup.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40201 a592a061-630c-0410-9148-cb99ea01b6c8
2011-11-17 17:24:11 +00:00
Richard Heck
d1802a5234 Fix bug reported on user list: <title> not escaped.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40131 a592a061-630c-0410-9148-cb99ea01b6c8
2011-11-02 18:42:10 +00:00
Vincent van Ravesteijn
5cdcc4f7ef Correctly message that the export is cancelled
Uptil now, it was said that the export was succesful.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40099 a592a061-630c-0410-9148-cb99ea01b6c8
2011-10-30 19:52:27 +00:00
Vincent van Ravesteijn
098184ba6a Buffer: Make setExportStatus a private member
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40088 a592a061-630c-0410-9148-cb99ea01b6c8
2011-10-30 11:43:45 +00:00
Vincent van Ravesteijn
f6246e974f Let all doExport calls have the same behaviour
- 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
2011-10-30 08:53:20 +00:00
Richard Heck
9eaa64b2cb Initial work for view source improvements.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40073 a592a061-630c-0410-9148-cb99ea01b6c8
2011-10-29 21:00:23 +00:00
Richard Heck
f25e7c340b Improve argument handling for the source generation routines.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40069 a592a061-630c-0410-9148-cb99ea01b6c8
2011-10-29 20:14:48 +00:00
Richard Heck
b66e3c6e0f Fix bug #7777. We need a loader when exporting no matter what.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40067 a592a061-630c-0410-9148-cb99ea01b6c8
2011-10-29 20:14:36 +00:00
Vincent van Ravesteijn
e02df14faa Return ExportStatus from Buffer to GuiView
Now GuiView composes the message string.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40045 a592a061-630c-0410-9148-cb99ea01b6c8
2011-10-27 20:00:11 +00:00
Vincent van Ravesteijn
e74468b4be Let Buffer::preview return an error value
TODO:
 - Also let the public function return an error value,
 - Move all user interaction (Alerts etc.) out of Buffer.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40044 a592a061-630c-0410-9148-cb99ea01b6c8
2011-10-27 20:00:08 +00:00
Vincent van Ravesteijn
bf3871933a Let Buffer::doExport return an error value
TODO:
 - Also let the public function return an error value,
 - Move all user interaction (Alerts etc.) out of Buffer.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40043 a592a061-630c-0410-9148-cb99ea01b6c8
2011-10-27 20:00:06 +00:00
Vincent van Ravesteijn
ade7e12192 Remove result_file from debug output because it is empty
The result_file parameter is an output variable.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40042 a592a061-630c-0410-9148-cb99ea01b6c8
2011-10-27 20:00:02 +00:00
Vincent van Ravesteijn
a7eb3c4c6e Simplify the public interface of Buffer::doExport
All calls to doExport from outside of Buffer have the same algorithm to
determine whether the included children parameter should be true. Moreover,
this decision is only based on information from the Buffer itself.

Now, Buffer only has 1 public function doExport and preview.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40041 a592a061-630c-0410-9148-cb99ea01b6c8
2011-10-27 15:50:50 +00:00
Vincent van Ravesteijn
61dda8035d Fix bug #7793: LyX leaves behind autosave files
The LyX buffer is cloned before autosaving, but the unnamed_ member was not
copied. This causes the autosave files to end up in the wrong location and
consequently they were never removed afterwards.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40008 a592a061-630c-0410-9148-cb99ea01b6c8
2011-10-26 13:15:42 +00:00
Georg Baum
b62d8f2c6a Tie file formats of LyX and tex2lyx, since there are implicit depencies anyway.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39936 a592a061-630c-0410-9148-cb99ea01b6c8
2011-10-23 10:29:21 +00:00
Enrico Forestieri
d703d90574 Fix bug #7835 (Relative paths are not supported by the TEXINPUTS prefix)
This restores \input@path handling, which turns out to be necessary, as
the TEXINPUTS mechanism is not used with relative paths. It turns out
that both methods must be used, because \input@path does not work in all
cases (most notably with tikz).


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39918 a592a061-630c-0410-9148-cb99ea01b6c8
2011-10-22 15:10:43 +00:00
Stephan Witt
d29f1f6930 avoid compiler warning regarding operator precedence
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39815 a592a061-630c-0410-9148-cb99ea01b6c8
2011-10-07 07:59:50 +00:00
Tommaso Cucinotta
da087e6fc1 Fixed bug when exporting to custom location under non-latex format, requiring intermediate latex step.
Keeping some debugging output about these filename mangling, in case additional debugging is needed.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39812 a592a061-630c-0410-9148-cb99ea01b6c8
2011-10-06 23:23:45 +00:00
Stephan Witt
bae12f7328 #2511 implementation of spell check of the current text selection
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39802 a592a061-630c-0410-9148-cb99ea01b6c8
2011-10-06 10:28:34 +00:00
Richard Heck
c239ac6590 Typo.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39681 a592a061-630c-0410-9148-cb99ea01b6c8
2011-09-15 21:48:23 +00:00
Richard Heck
3788b960f8 Get default font color and background color working for XHTML export.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39679 a592a061-630c-0410-9148-cb99ea01b6c8
2011-09-15 21:22:56 +00:00