Using updateMacros() entails a performance hit when loading a document
with really a lot of macros. So, revert to the original strategy of
tracking macros at creation time. In order to also account for macros
defined in a child document, the child is now loaded by the include inset
at construction time instead of after the master has finished loading.
This strategy mimics what updateMacros() was accomplishing without
incurring in its drawbacks, such that loading time is practically
unchanged even with a thousand macros.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36968 a592a061-630c-0410-9148-cb99ea01b6c8
updateBuffer() traversal. The reason is simple: InsetCitation needs
access to the BibTeX info to calculate its label. But we won't have it
until we get to the bibliography.
I don't think there is any way around that.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36710 a592a061-630c-0410-9148-cb99ea01b6c8
to be passing the BiblioInfo structure around this way. (That's an old
holdover.) That lets us get rid of the non-const masterBibInfo() again.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36697 a592a061-630c-0410-9148-cb99ea01b6c8
bibliography information in updateBuffer(), rather than doing a wholly
separate traversal. We still do a separate traversal in two cases, as a
full updateBuffer() call just isn't needed there.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36696 a592a061-630c-0410-9148-cb99ea01b6c8
- With XeTeX/LuaTeX and tex fonts, we need to force the encoding to utf8-plain manually.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36558 a592a061-630c-0410-9148-cb99ea01b6c8
Change its parameter type to support::FileName for convenience.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36375 a592a061-630c-0410-9148-cb99ea01b6c8
In particular, it makes paragraph breaks generate single \n in latex output
when ParbreakIsNewline is true
This means that it is not necessary anymore to use newlines to break lines.
Plain paragraph breaks can be used instead, like is done now in ERT/Listings.
This is mainly aimed at sweave support.
lyx2lyx support courtesy of Richard Heck
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36163 a592a061-630c-0410-9148-cb99ea01b6c8
Computes a hash value for the authors when using change tracking.
Text.cpp, BufferParams.h, Author.h:
Change unsigned int to int because the hash values can be negative.
lyx2lyx:
Allow to convert negative author_ids.
See also: r30756.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36134 a592a061-630c-0410-9148-cb99ea01b6c8
Also move the saveCheckSum declaration to the section of functions involving reading/writing. And note that it should be made private.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35925 a592a061-630c-0410-9148-cb99ea01b6c8
argument from that function. We are always saving the checksum for the
Buffer's file. The argument is a left-over from a time when we did the
wrong thing and saved it for e.g. the emergency file.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35890 a592a061-630c-0410-9148-cb99ea01b6c8
A dynamic_cast is necessary when:
- the object to be casted is from an external library because we can't add Qxxx::asXxxx() to Qt e.g.:
* QAbstractListModel to GuiIdListModel,
* QValidator to PathValidator,
* QWidget to TabWorkArea,
* QWidget to GuiWorkArea;
- the object is to be casted from an interface to the implementing class, because the Interface does not know by whom it is implemented:
* ProgressInterface to GuiProgress,
* Application to GuiApplication.
A dynamic_cast can be replaced by:
- already existing as***Inset() functions, e.g.:
* asHullInset(),
* asInsetMath()->asMacro(),
* asInsetText();
- a static_cast when we are sure this can't go wrong, e.g.:
* we are sure that CellData::inset->clone() is an InsetTableCell,
* in cases where we explicitly check it->lyxCode().
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35855 a592a061-630c-0410-9148-cb99ea01b6c8
- rename readFromVC to extractFromVC because this function actually doesn't read anything as compared to readEmergency, readAutosave and so on.
- rename readEmergency and readAutosave to loadEmergency and loadAutosave just like loadLyXFile and loadThisLyXFile. Only in loadThisLyXFile we switch to the actually reading of a file.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35854 a592a061-630c-0410-9148-cb99ea01b6c8
It's strange to have a public interface which has a function loadLyXFile and a function readFile. A user of this class will be confused about the difference.
Therefore, loadThisLyXFile will be next to loadLyXFile to stress that loadThisLyXFile will not load another file ;). I don't know whether all of you like that this function just calls readFile, but it feels good this way. All public paths for loading a file will now go through loadThisLyXFile (i.e. the paths that come from loadLyXFile), while readFile is a pure private function. If this doesn't make sense, just shout.
I think this improves the readability of the class.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35852 a592a061-630c-0410-9148-cb99ea01b6c8
The only substantive change here is moving the markDirty() call into the
first case. If we don't load the file successfully, then there is no
need to mark dirty.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35834 a592a061-630c-0410-9148-cb99ea01b6c8
Extract convertLyXFormat function that runs LyX2LyX.
(and some compile fixes)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35831 a592a061-630c-0410-9148-cb99ea01b6c8
We need to save the checksum of the requested file. Not of the autosave file.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35830 a592a061-630c-0410-9148-cb99ea01b6c8
- Move the saveCheckSum to both autosave file as emergency file read function.
- Extract the function parseLyxFormat.
- Improve comment about the older LyX format numbers.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35829 a592a061-630c-0410-9148-cb99ea01b6c8
- Move some lines of code to more proper places.
- Let Buffer::readFile(FileName const &) return ReadStatus as well.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35827 a592a061-630c-0410-9148-cb99ea01b6c8
- make a new function readFromVC(),
if the file does not exist, try to extract it from the version control (RCS),
- make a new function readEmergency(),
try to read the emergency file that is associated to the file we are trying to read,
- make a new function readAutosave(),
try to read the autosave file that is associated to the file we are trying to read,
- merge loadLyXFile() and readFileHelper(),
this new function now determines which file to read.
- add more ReadStatus elements to describe failures.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35819 a592a061-630c-0410-9148-cb99ea01b6c8
exportAndDestroy was calling:
buffer->doExport(format, true, update_unincluded);
where "true" means: Leave it in the tempdir. We need false, which means
we need another parameter, if we're not doing it as cut and paste.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35715 a592a061-630c-0410-9148-cb99ea01b6c8
for formatted references. Fixes#2295, in so far as it makes it possible
to translate formatted references.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35623 a592a061-630c-0410-9148-cb99ea01b6c8
We should probably be checking for recursive includes here, and we want
to do that in one place.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35537 a592a061-630c-0410-9148-cb99ea01b6c8
allRelatives() "stable", in the sense that what it returns does not
depend upon which Buffer we start with.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35530 a592a061-630c-0410-9148-cb99ea01b6c8
it->fillWithBibKeys(d->bibinfo_, it);
This could be useful later, if we decide to try to do the work that
fillWithBibKeys did from updateLabels().
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35106 a592a061-630c-0410-9148-cb99ea01b6c8
* src/LyXAction.cpp: add ReadOnly flag to LFUN_UNDO and LFUN_REDO, since
we do not want the dispatch mechanism to mark buffer dirty after them.
* src/BufferView.cpp: handle "by hand" the activation of undo/redo
* src/Undo.cpp: add lyx_clean member to UndoElement and make sure to
maintain it with undo operations; add a new markDirty() member for UndoStack
* src/Buffer.cpp: when saving a document, mark the undo and redo stacks
elements as dirty.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35068 a592a061-630c-0410-9148-cb99ea01b6c8
Buffer whether we are exporting or not, rather than rely upon isClone(),
which could be adapted to other purposes. And, of course, someone might
choose locally to disable cloning....
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34999 a592a061-630c-0410-9148-cb99ea01b6c8
allow this as a fallback. E.g., if we're unable to export as MathML,
then we try to export as an image.
There are several ways, I am sure, in which this implementation is not
ideal.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34993 a592a061-630c-0410-9148-cb99ea01b6c8
DispatchResult to store a flag that tells us whether we need a buffer
update or not.
So: If you find a missing one, go to an appropriate place in the
dispatch and call cur.forceBufferUpdate() or, if you don't have a cursor
but do have a DispatchResult, call dr.forceBufferUpdate().
There is one remaining call I could not move, in
TextMetrics::redoParagraph. But this looks like an emergency call when
the macro context has not been set. There are also a couple calls that
are connected with buffer creation that I commented out, since the same
call is done again almost immediately. But I'm not positive about those.
Now the nice thing would be to do the same for updateMacros().
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34826 a592a061-630c-0410-9148-cb99ea01b6c8
format bump so we can convert old Beamer files, which are otherwise
broken by the new layout.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34615 a592a061-630c-0410-9148-cb99ea01b6c8
Solution: don't use boost::shared_ptr for msvc10 (could also be extended to several GCC versions)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34259 a592a061-630c-0410-9148-cb99ea01b6c8
Solution: don't use boost::bind for msvc10 (could also be extended to several GCC versions)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34257 a592a061-630c-0410-9148-cb99ea01b6c8
Using "-f all", or simply "-f", all files are silently overwritten.
Using "-f main", only the main file is overwritten.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34224 a592a061-630c-0410-9148-cb99ea01b6c8
- new buffer parameter \boxbgcolor
(I'm still working on the remaining issue #6626 as this affect not only this feature.)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34083 a592a061-630c-0410-9148-cb99ea01b6c8
(The default color is still internally white because we have to set a color but the color is only used when the user explicitly specified it.)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34058 a592a061-630c-0410-9148-cb99ea01b6c8
- new buffer parameter \fontcolor
- the default color is internally black because we have to set a color
- the font color is only used when the user explicitly specified a color
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34042 a592a061-630c-0410-9148-cb99ea01b6c8
I'm not happy about having what is basically the same enum in
BufferParams.h and OutputParams.h, but I don't see how to unify them
without either (a) including BufferParams.h in OutputParams.h, which is
ugly or (b) creating some new file just containing this enum, which
seems like overkill. Any other ideas?
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33967 a592a061-630c-0410-9148-cb99ea01b6c8
- support to change the greyed-out note font color (fixes#3865)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33962 a592a061-630c-0410-9148-cb99ea01b6c8