Commit Graph

199 Commits

Author SHA1 Message Date
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
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
cf06a12e00 Remove the unused default parameter of Buffer::doExport().
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40040 a592a061-630c-0410-9148-cb99ea01b6c8
2011-10-27 15:50:46 +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
Tommaso Cucinotta
eff76bd3ab Added -E option to specify export format and destination file-name (and export folder).
Addressing #4501.
See also http://comments.gmane.org/gmane.editors.lyx.devel/138329


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39678 a592a061-630c-0410-9148-cb99ea01b6c8
2011-09-15 01:07:49 +00:00
Enrico Forestieri
7c17e970b1 Fix bug #6170 (Latex Compiler error when lyx file is located in a path which contains a "#")
This removes \input@path handling.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39563 a592a061-630c-0410-9148-cb99ea01b6c8
2011-08-29 17:02:27 +00:00
Vincent van Ravesteijn
3bd87e5a64 Make the Buffer class non-copyable, otherwise LyX crashes when 'Impl * const d' is deleted while deleting a copy of the Buffer.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39515 a592a061-630c-0410-9148-cb99ea01b6c8
2011-08-24 19:10:40 +00:00
Abdelrazak Younes
c57dc64116 gcc compile fix.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39277 a592a061-630c-0410-9148-cb99ea01b6c8
2011-07-12 13:41:42 +00:00
Abdelrazak Younes
850e4d80c0 Graphics cleanup: get rid of Previews.{h,cpp}
The PreviewLoader is created directly by Buffer on demand. The PreviewLoader cache was complex and unneeded because there is one and only one PreviewLoader per Buffer.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39276 a592a061-630c-0410-9148-cb99ea01b6c8
2011-07-12 12:43:11 +00:00
Richard Heck
c53971b07e Remove unused optional variable.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39157 a592a061-630c-0410-9148-cb99ea01b6c8
2011-06-20 21:08:56 +00:00
Richard Heck
5c264ebdf3 Modify r38980 in response to Vincent's comments.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39021 a592a061-630c-0410-9148-cb99ea01b6c8
2011-06-12 18:03:32 +00:00
Richard Heck
6efabf807e Fix problem with static error list.
It's amazing we haven't seen problems with this before. The basic problem is that buf.errorList("whatever") would always return the same global, static error list, if it did not already exist. So, to a significant extent, there was only one global error list!

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38980 a592a061-630c-0410-9148-cb99ea01b6c8
2011-06-08 00:12:52 +00:00
Richard Heck
60b1a06ac8 Revert previous commit, which committed too much.
This reverts commit 4369e725b17fede013eb26bfd797e917eaf6f4ea.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38979 a592a061-630c-0410-9148-cb99ea01b6c8
2011-06-07 23:52:22 +00:00
Richard Heck
cd2e50a275 Fix problem with static error list.
It's amazing we haven't seen problems with this before. The basic problem is that buf.errorList("whatever") would always return the same global, static error list, if it did not already exist. So, to a significant extent, there was only one global error list!

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38978 a592a061-630c-0410-9148-cb99ea01b6c8
2011-06-07 23:45:33 +00:00
Richard Heck
2d6173d810 Fix problem first reported by Diego: If you try to view a child document,
the macros declared in the parent do not work. This is because we were
cloning only the child, which then didn't have a parent.

The solution is to clone the whole structure, starting with the master
document. As a side effect, we only clone each child once.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38837 a592a061-630c-0410-9148-cb99ea01b6c8
2011-05-26 13:20:11 +00:00
Richard Heck
5db4b7eb16 Move a bunch of code from Buffer to BufferParams. The point of this
is contained in the next commit.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38742 a592a061-630c-0410-9148-cb99ea01b6c8
2011-05-13 19:39:56 +00:00
Richard Heck
33ee5c9ae8 Fix bug #7499. The problem here is that there was no way for the
inset to know that the BibTeX data had changed. So we introduce a
Buffer-wide variable that we can query for that information.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38619 a592a061-630c-0410-9148-cb99ea01b6c8
2011-05-07 23:02:53 +00:00
Richard Heck
5855043599 Initial work to fix bug involving embedded macros and
XHTML output.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@38613 a592a061-630c-0410-9148-cb99ea01b6c8
2011-05-07 11:57:08 +00:00
Enrico Forestieri
c6648aaeb9 Complete integration of texrow with otexstream and allow automatic line
counting also when outputting the latex preamble.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37641 a592a061-630c-0410-9148-cb99ea01b6c8
2011-02-13 21:41:44 +00:00
Jürgen Spitzmüller
0a34b1e047 fix some typos. Patch by Yuri Chornoivan.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37039 a592a061-630c-0410-9148-cb99ea01b6c8
2010-12-29 16:57:04 +00:00
Enrico Forestieri
89c1d25250 Avoid const casts by making mutable the usermacros member.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36984 a592a061-630c-0410-9148-cb99ea01b6c8
2010-12-21 14:52:18 +00:00
Enrico Forestieri
8b88c3edde Refine fix for bug #7183.
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
2010-12-20 18:15:39 +00:00
Enrico Forestieri
280f7a7ced Fix bug #7183 (User math macros defined in child documents are shadowed on loading)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36930 a592a061-630c-0410-9148-cb99ea01b6c8
2010-12-18 02:27:25 +00:00
Stephan Witt
c7e6a677c4 fix compiler warnings in pedantic mode: remove trailing comma after last enum member
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36923 a592a061-630c-0410-9148-cb99ea01b6c8
2010-12-17 19:56:51 +00:00
Jürgen Spitzmüller
1e98a4f240 Add the option to select the output format in Source View.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36806 a592a061-630c-0410-9148-cb99ea01b6c8
2010-12-10 10:34:24 +00:00
Jürgen Spitzmüller
f255f93b9e * Follow Vincent's advice to keep constness. Thanks Vincent.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36759 a592a061-630c-0410-9148-cb99ea01b6c8
2010-12-07 09:00:50 +00:00
Jürgen Spitzmüller
2653011613 * Use default output flavor for View Source.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36758 a592a061-630c-0410-9148-cb99ea01b6c8
2010-12-07 08:36:42 +00:00
Richard Heck
3fffe51506 Revert r36696: We can't collect BibTeX information during the
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
2010-12-04 03:15:53 +00:00
Richard Heck
840f2baf91 Simplify some of the bibliography update code. There is really no reason
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
2010-12-03 20:08:04 +00:00
Richard Heck
66be58b074 Proper fix now for bug #6846. The idea, due to JMarc, is to collect
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
2010-12-03 19:29:46 +00:00
Richard Heck
ab47822680 Towards a proper fix for bug #6846, this just disentangles a couple
things we will ultimately want to do separately.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36694 a592a061-630c-0410-9148-cb99ea01b6c8
2010-12-03 19:00:55 +00:00
Vincent van Ravesteijn
f27853ad41 Cosmetics, typos and comments.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36492 a592a061-630c-0410-9148-cb99ea01b6c8
2010-11-25 16:53:56 +00:00
Vincent van Ravesteijn
cc84d35ed4 Buffer::saveCheckSum() can be private.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36377 a592a061-630c-0410-9148-cb99ea01b6c8
2010-11-18 18:37:17 +00:00
Vincent van Ravesteijn
1f38406536 Buffer::setFileName() can now be private. The only way to change the filename of a buffer is to save it as a different file using Buffer::saveAs().
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
2010-11-18 17:50:33 +00:00
Vincent van Ravesteijn
c1a728d8f1 Buffer::moveAutosaveFile can be private.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36330 a592a061-630c-0410-9148-cb99ea01b6c8
2010-11-17 03:47:14 +00:00
Vincent van Ravesteijn
ce0304e6f4 Buffer::getAutosaveFileName() can now be private as it should.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36327 a592a061-630c-0410-9148-cb99ea01b6c8
2010-11-17 02:25:12 +00:00
Vincent van Ravesteijn
208acbc728 Generalize Buffer::autoSave() for both the threaded as the forked process call. Also move out the resetAutosaveTimers as this is the task of the frontend as the core shouldn't know about any timer.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36325 a592a061-630c-0410-9148-cb99ea01b6c8
2010-11-17 02:18:12 +00:00
Vincent van Ravesteijn
8e7d7e4295 Move the buffer related part from GuiView::renameBuffer to Buffer::saveAs.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36202 a592a061-630c-0410-9148-cb99ea01b6c8
2010-11-07 21:26:02 +00:00
Vincent van Ravesteijn
afa873dc5f Remove the FileName parameter of Buffer::loadLyXFile and friends. Now, getAutosaveFileNameFor and getEmergencyFileNamefor can be removed too. Last, the call to lyxvc.file_found_hook can now be centralized and can be given the correct parameter (d->filename instead of the name of the emergency/autosave file).
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36145 a592a061-630c-0410-9148-cb99ea01b6c8
2010-11-05 21:21:01 +00:00
Vincent van Ravesteijn
3bb31a04dd Remove saveCheckSum from Buffer::reload again. Now, the saveCheckSum call is already in Buffer::readFile, so it is not needed here anymore.
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
2010-10-29 23:51:13 +00:00
Vincent van Ravesteijn
eff06951a9 Centralize preview generation/deletion code to Buffer::updatePreviews and Buffer::removePreviews.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35922 a592a061-630c-0410-9148-cb99ea01b6c8
2010-10-29 20:00:51 +00:00
Vincent van Ravesteijn
c9a91c5474 Relay the ReadStatus all the way up to the GUI also for Buffer::reload().
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35908 a592a061-630c-0410-9148-cb99ea01b6c8
2010-10-29 16:26:32 +00:00
Richard Heck
e313d3a12b Move saveCheckSum() call to Buffer::readFile(). Also, remove the
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
2010-10-28 22:12:29 +00:00
Vincent van Ravesteijn
8d10d82392 Buffer: Rename function names:
- 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
2010-10-26 13:27:06 +00:00
Vincent van Ravesteijn
f311377671 Buffer: Make Buffer::readFile() private.
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
2010-10-26 13:17:10 +00:00
Vincent van Ravesteijn
9063402fca Buffer.h: Cleanup, Sorting, and Improvements:
- group the read and emergency/autosave functions,
- add comments to the functions,
- adjust visibility of functions,
- add FIXMEs to some functions which are still unneccesarily public.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35851 a592a061-630c-0410-9148-cb99ea01b6c8
2010-10-26 12:54:31 +00:00
Vincent van Ravesteijn
80a09f4ea6 Merge readFile and readFile; and readFile and readString.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35832 a592a061-630c-0410-9148-cb99ea01b6c8
2010-10-25 14:14:44 +00:00
Vincent van Ravesteijn
5a30a98346 Buffer.cpp:
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
2010-10-25 13:55:39 +00:00
Vincent van Ravesteijn
c1a1d16967 Centralize the generation of the emergency and autosave filenames.
Forgot this one in the previous commit.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35826 a592a061-630c-0410-9148-cb99ea01b6c8
2010-10-25 12:46:16 +00:00