Commit Graph

834 Commits

Author SHA1 Message Date
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