Commit Graph

498 Commits

Author SHA1 Message Date
Vincent van Ravesteijn
046a43fe5f Revert r33295. This seems to be a not so great idea. The assert already fires when copying something.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33301 a592a061-630c-0410-9148-cb99ea01b6c8
2010-01-31 20:51:15 +00:00
Vincent van Ravesteijn
9065f48ead Add an assert to check for a fully loaded Buffer before trying to save it.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33295 a592a061-630c-0410-9148-cb99ea01b6c8
2010-01-31 16:20:47 +00:00
Vincent van Ravesteijn
d49438e76c Return failure if the file ended unexpectedly.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33293 a592a061-630c-0410-9148-cb99ea01b6c8
2010-01-31 15:59:23 +00:00
Abdelrazak Younes
9eabfb51ac Buffer: Pimpl private methods and fix a few constness issue.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33227 a592a061-630c-0410-9148-cb99ea01b6c8
2010-01-25 18:39:08 +00:00
Abdelrazak Younes
a4e56ba613 Buffer: Pimpl gui_ and remove unused code. support/SignalSlot* should
probably go also as we agreed that if we need signal/slot in src/ we'll
directly use Qt's.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33224 a592a061-630c-0410-9148-cb99ea01b6c8
2010-01-25 14:32:39 +00:00
Abdelrazak Younes
d9f22c0233 Get rid of mostly unused methods.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33223 a592a061-630c-0410-9148-cb99ea01b6c8
2010-01-25 14:13:04 +00:00
Abdelrazak Younes
11474f6b89 Get rid of Buffer::setReadOnly() pseudo signal.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33222 a592a061-630c-0410-9148-cb99ea01b6c8
2010-01-25 13:31:07 +00:00
Richard Heck
bb044b16c9 Formatting.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33132 a592a061-630c-0410-9148-cb99ea01b6c8
2010-01-21 18:12:23 +00:00
Richard Heck
caa4e94bf0 Get rid of some magic booleans in updateLabels() and related routines.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33110 a592a061-630c-0410-9148-cb99ea01b6c8
2010-01-20 19:42:12 +00:00
Richard Heck
22dc345e8c Better XHTML output for InsetRef.
The idea here is to implement something like \refstepcounter for LyX. We
do this by tracking the "active" counter in Counters.cpp. We also have
to track when we go in and out of environments to which counters are
local, and so on and so forth.

This all gets done in updateLabels(), but only if we are producing
output, which is why I added the output boolean a while ago.

I expect there are bugs in here, though it seems to work pretty well
with the documents I've tested.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33108 a592a061-630c-0410-9148-cb99ea01b6c8
2010-01-20 19:03:17 +00:00
Richard Heck
37f4de4cd2 The BufferList does not know about cloned buffers, so the parent of a
cloned Buffer is always "unloaded" as far as the BufferList is
concerned.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33105 a592a061-630c-0410-9148-cb99ea01b6c8
2010-01-20 17:53:18 +00:00
Richard Heck
1832a388c5 Collect the title for XHTML output, and use it.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33097 a592a061-630c-0410-9148-cb99ea01b6c8
2010-01-19 19:43:15 +00:00
Richard Heck
c4d8a27585 Better error messages for failed conversion.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@33034 a592a061-630c-0410-9148-cb99ea01b6c8
2010-01-14 17:11:02 +00:00
Richard Heck
14f8faa01a A couple changes related to cloning:
(i) release the macro lock after we've cloned, so that...
(ii) we can regenerate the macro caches before doing XHTML output.
It may be worth doing the regeneration in the clone() routine itself,
but it appears that the export routines now all do it anyway.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32983 a592a061-630c-0410-9148-cb99ea01b6c8
2010-01-12 15:25:04 +00:00
Richard Heck
ce87e6767c Check the bibliography cache only when we really need to do so. This (a)
prevents weirdness that might happen if the .bib file were to change
during updateLabels(), (b) prevents even further weirdness that might
happen if it changed during the output routines, and (c) ought to avoid
slowness caused by the repeated calls to QFileInfo::refresh() needed to
check the cache status.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32972 a592a061-630c-0410-9148-cb99ea01b6c8
2010-01-11 16:29:26 +00:00
Jürgen Spitzmüller
7a7ab8f14b Add an option to assure that all aux files are maintained when using the includeonly feature, so that the
page numbering and the references of the master file are maintained in the included children (bug 1005).

I made this optional since some people use \includeonly to save compilation time, but a proper aux file update
needs a full compilation of the complete master prior to the compilation of the \includeonly master.

Hence, a new buffer param is introduced (file format change). 

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32936 a592a061-630c-0410-9148-cb99ea01b6c8
2010-01-10 13:25:41 +00:00
Abdelrazak Younes
e4e43f63d2 Buffer cloning: copy the different bib caches.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32920 a592a061-630c-0410-9148-cb99ea01b6c8
2010-01-09 18:16:07 +00:00
Abdelrazak Younes
fefd99e836 Fix memory leak.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32913 a592a061-630c-0410-9148-cb99ea01b6c8
2010-01-09 16:21:37 +00:00
Richard Heck
a397cc81c2 Style.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32912 a592a061-630c-0410-9148-cb99ea01b6c8
2010-01-09 16:15:46 +00:00
Abdelrazak Younes
cda980db51 Fix multipart document background compilation. I am not fully satisfied with this solution (see FIXME in Buffer::clone()). There might be some memory leaks...
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32910 a592a061-630c-0410-9148-cb99ea01b6c8
2010-01-09 14:47:47 +00:00
Vincent van Ravesteijn
e0a6a7a542 Move some code from Buffer::loadLyXFile to LyXVC::file_not_found_hook. Accoring to the description of the latter, this should already be the case.
Furthermore, make sure that the read-only flag is always set to both true and false, since now the buffer can be read-only during a reload.

Last, set the buffer clean after a successful reload.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32896 a592a061-630c-0410-9148-cb99ea01b6c8
2010-01-08 18:48:36 +00:00
Richard Heck
c90b4fcb87 Use calculated labels in XHTML output.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32892 a592a061-630c-0410-9148-cb99ea01b6c8
2010-01-08 18:19:37 +00:00
Richard Heck
295b84e8fb Fix a BibTeX caching bug. Because we only set the last modified time
when the cache was valid, we did not set it the first time through and
so always read the cache twice.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32890 a592a061-630c-0410-9148-cb99ea01b6c8
2010-01-08 18:18:05 +00:00
Richard Heck
012be55afd Move the collection of citations and sorting routines into BiblioInfo.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32887 a592a061-630c-0410-9148-cb99ea01b6c8
2010-01-08 16:40:41 +00:00
Abdelrazak Younes
cf3baab621 On the road to fix #6415. The texrow object contains the correspondance
table between tex rows and the lyx paragraph ids.
Not fixed yet it seems as the texrow object do not copy correctly.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32876 a592a061-630c-0410-9148-cb99ea01b6c8
2010-01-08 09:00:28 +00:00
Vincent van Ravesteijn
d95aaa0e5b Move reloadBuffer from GuiView to Buffer.
This fixes bug #6314: reloading master document makes emergencies of modified children.

Now also the version control handling could be moved to Buffer as well, and the hack in ensureBufferClean is removed.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32875 a592a061-630c-0410-9148-cb99ea01b6c8
2010-01-08 02:15:56 +00:00
Vincent van Ravesteijn
570f96bc6e Add a boolean to GuiWorkArea::redraw to indicate whether the metrics must be updated. The current test "lyx_view_ != guiApp->currentView() || lyx_view_->currentWorkArea() != this" is not enough, especially not if the buffer is changed and buffer->changed() is called. Moreover, there are a lot of combinations of updateMetrics() followed by buffer->changed(), these can now be replaced by one call to buffer->changed(bool).
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32874 a592a061-630c-0410-9148-cb99ea01b6c8
2010-01-08 02:03:54 +00:00
Jürgen Spitzmüller
1ccfe14914 * Add native support for \includeonly (bug 5360).
File format change.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32826 a592a061-630c-0410-9148-cb99ea01b6c8
2010-01-07 10:01:26 +00:00
Abdelrazak Younes
50e673f041 Add a FIXME for asynchronous export and preview and child buffers.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32768 a592a061-630c-0410-9148-cb99ea01b6c8
2010-01-05 13:29:01 +00:00
Abdelrazak Younes
24f3ddef3f typos.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32767 a592a061-630c-0410-9148-cb99ea01b6c8
2010-01-05 13:20:57 +00:00
Abdelrazak Younes
744ee152fa Cleanup a bit the pargraph ids generation in order to (trying to) fix
#6415
Enrico please verify that reverse dvi is fixed.

* Text and InsetText: create two private constructors and transfer some
initialisation code from InsetText.

* Paragraph: id generation is transfered to Text. May be transfered to
Buffer in the future, we'll see.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32766 a592a061-630c-0410-9148-cb99ea01b6c8
2010-01-05 13:16:55 +00:00
Richard Heck
28e9474f7a Some BufferParams for XHTML output.
These are not actually implemented yet, but I wanted to make sure to get
them into the format now, so even if I can't implement them before the
1.7 release, I can do so during the release cycle, without a format
change. I don't expect that to happen, but you never know....


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32683 a592a061-630c-0410-9148-cb99ea01b6c8
2009-12-30 22:22:33 +00:00
Tommaso Cucinotta
5da4ccb931 Implemented the "Current Buffer" & "Current (Master) Document" scopes in the Advanced Find and Replace feature.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32678 a592a061-630c-0410-9148-cb99ea01b6c8
2009-12-30 18:40:18 +00:00
Richard Heck
97a4f77443 Restore the privacy of the parent_buffer. We want all access to go via
the accessors, so we can do appropriate checks.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32628 a592a061-630c-0410-9148-cb99ea01b6c8
2009-12-24 19:19:53 +00:00
Peter Kümmel
8049e3f510 move calls to Buffer::errors and Buffer::message to GUI thread
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32606 a592a061-630c-0410-9148-cb99ea01b6c8
2009-12-21 13:11:17 +00:00
Vincent van Ravesteijn
45b0c6be47 Fix the threaded preview and reenable it.
Buffer::Impl::inset was set in the ctor Buffer::Impl::Impl to be a clone. However, in the Buffer::Buffer ctor the inset was set again, now to a new and empty InsetText.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32589 a592a061-630c-0410-9148-cb99ea01b6c8
2009-12-19 15:46:45 +00:00
Abdelrazak Younes
bea0925f8c Converter: add a safe guard to Alerts because those cannot be called from another thread. The whole Alert system must be rethought I am afraid.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32585 a592a061-630c-0410-9148-cb99ea01b6c8
2009-12-18 22:59:59 +00:00
Abdelrazak Younes
4ed0169064 Detach Buffer preview and update preview in a new thread. Only for Qt4.4 users. This new feature can be disabled by setting EXPORT_in_THREAD to 0 in GuiView.cpp.
Two things are missing (but are fixable):
- the lack of feedback of the background latex compilation
- the error list is not shown in case of compilation error.

* Buffer:
- create a "cloned buffer" type.
- Transfer LFUN_MASTER_BUFFER_UPDATE, LFUN_MASTER_BUFFER_VIEW, LFUN_BUFFER_UPDATE and LFUN_BUFFER_VIEW to GuiView. This is good itself as these LFUN are GUI oriented.

* GuiView: detach the above LFUNs to a new thread as was already done for autosave. 


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32584 a592a061-630c-0410-9148-cb99ea01b6c8
2009-12-18 22:51:06 +00:00
Abdelrazak Younes
622e3b1e4d For Qt4.4 and up: Detach Buffer autosave into a new thread.
* Buffer: new clone() method. When this new autosave method is used the old autoSave() is not of course.

* GuiView: clone the current document buffer and save it in a new thread.




git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32512 a592a061-630c-0410-9148-cb99ea01b6c8
2009-12-13 21:00:46 +00:00
Vincent van Ravesteijn
8c8675e2ca Fix a crash when spellchecking when a Math inset is the last inset in the document. Make sure that the words between a math inset and the next inset are spellchecked. Also fix the count of the number of words when there are math insets.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32489 a592a061-630c-0410-9148-cb99ea01b6c8
2009-12-12 02:56:06 +00:00
Richard Heck
69666056ca Cosmetic repairs to my updateLabels() changes, thanks to Andre's
comments. Added comments per Pavel's suggestion.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32453 a592a061-630c-0410-9148-cb99ea01b6c8
2009-12-10 13:25:31 +00:00
Jean-Marc Lasgouttes
52061b8313 Speedup updateMacroInstances. This has some effect on document loading time:
it was a significant part of this time


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32435 a592a061-630c-0410-9148-cb99ea01b6c8
2009-12-08 22:41:10 +00:00
Jürgen Spitzmüller
123a589bf8 * Fix bug #2144: Merge the two identical classes g-brief-de and g-brief-en into one class g-brief.
The German layouts are replaced by the English ones.
German localization is now done as it is supposed to be: via gettext.

A file format change was needed to do this.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32406 a592a061-630c-0410-9148-cb99ea01b6c8
2009-12-07 11:53:25 +00:00
Richard Heck
025138f30c Minor XHTML fix.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32378 a592a061-630c-0410-9148-cb99ea01b6c8
2009-12-06 22:53:47 +00:00
Richard Heck
996505c2ae This patch introduces an optional argument to Buffer::updateLabels(), so
as to allow us to call the routine when we are preparing for output and
so to do certain things we might not want to do every time. 

This is an abuse of updateLabels(), in a way, but updateLabels() long
ago became the general recurse-through-the-Buffer routine, and to
implement the sort of thing I want to do here in validate(), say, much
of the code in updateLabels()---in particular, the counter-update
code---would have to be duplicated. So I believe this is the best, and
easiest, way to go.

Actual use of the new argument will follow.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32318 a592a061-630c-0410-9148-cb99ea01b6c8
2009-12-04 03:03:38 +00:00
Richard Heck
82cb512ebb Typo.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32311 a592a061-630c-0410-9148-cb99ea01b6c8
2009-12-03 23:30:26 +00:00
Richard Heck
e70c04b350 CSS for InsetBibtex. We include this via the validate mechanism, and
borrow the LatexFeatures::addPremableSnippet() method to do it.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32301 a592a061-630c-0410-9148-cb99ea01b6c8
2009-12-03 21:06:41 +00:00
Jürgen Spitzmüller
df329341aa * Add support for per-document fontenc setting (bug 5730)
File format change.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32228 a592a061-630c-0410-9148-cb99ea01b6c8
2009-11-29 14:43:00 +00:00
Richard Heck
27ed87b8f9 I think it's sufficient to export once. Fixes 6307.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32131 a592a061-630c-0410-9148-cb99ea01b6c8
2009-11-21 22:24:47 +00:00
Richard Heck
7aebcc787f I am now going to proceed to break XHMTL output, and then reconstruct it
a piece at a time, using the new XHTMLStream.

This just gets the basic structures working, and fixes a bunch of iconv
errors in the process. 

I hate iconv errors.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@32085 a592a061-630c-0410-9148-cb99ea01b6c8
2009-11-19 17:51:06 +00:00