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.
False positive rate of hints is quite high. Although the includes can be
technically removed (due to other includes) they logically belong to the
header.
no text classes for some reason (e.g., a corrupt textclass.lst). We
still give the user a chance to reconfigure (Bo's idea).
I wonder if we still really need to "restart LyX to make use of any
updated document class specifications". What would happen if we just
reloaded?
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34081 a592a061-630c-0410-9148-cb99ea01b6c8
completely unable to load a text class. At least not very long ago, if
we were unable even to load article, we would crash. Not now. We will
ALWAYS have at least a really basic class (nothing but Standard!)
available.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@34080 a592a061-630c-0410-9148-cb99ea01b6c8
* I transferred local function loadLayoutFile() in LyXFunc.cpp to a LayoutFileList::load().
Richard, as I am not into this layout thing, please check that these LFUNs still operate correctly (except from an embedded work area of course).
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31412 a592a061-630c-0410-9148-cb99ea01b6c8
theorems-ams module, which is what most users will want. A later commit will allow users also
to "exclude" this module, in case they wanted to do that.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25880 a592a061-630c-0410-9148-cb99ea01b6c8
* src/TextClass.h[.cpp]: add addLayoutIfNeeded() and createDefaultLayout()
* src/Layout.h[.cpp]: add unknown_ to mark if a layout is a default layout for an unknown one.
* src/LayoutFile.cpp: add addDefaultClass and change addLayoutFile to addLocalLayout.
* src/Text.cpp: add unknown layouts that are not recognizable by a new textclass.
* src/frontends/qt4/GuiToolbar.cpp: display (unknown) for unknown layouts.
* src/frontends/qt4/GuiDocument.cpp: restore 'browse layout' button.
* src/frontends/qt4/ui/LaTeXUi.ui: restore 'browse layout' button.
* src/CutAndPaste.cpp: do not convert unknown layouts from pasted text
* src/BufferParams.cpp: add a default textclass when a document with unknown textclass is loaded.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25555 a592a061-630c-0410-9148-cb99ea01b6c8
For the record, this developer is sorry that the problems with this code were not noticed much earlier. It's not fun to do so much work and then have it all reverted.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24373 a592a061-630c-0410-9148-cb99ea01b6c8
* src/EmbeddedFiles.h|cpp: add validate() function to validate loaded .lyx file.
* src/LayoutFile.h|cpp: add Layout_Type parameter to addLayoutFile to load an embedded layout.
* src/BufferParams.h|cpp: read layout from temp directory, then local directory.
* src/frontends/qt4/GuiDocument.cpp: handle embedded layout type
* src/LyXFunc.cpp: handle embedded layout when a layout is re-read.
* src/Buffer.cpp: validate after a buffer is read. handle exceptions properly.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23667 a592a061-630c-0410-9148-cb99ea01b6c8