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
#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
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
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
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
* 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
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
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
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
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
The fileformat change is also needed because of our mistake that we load mhchem since LyX 1.6.4 automatically so that files created with LyX 1.6.4 won't compile under LyX 1.6.3. Now at least all files created or opened with LyX 1.7 can be reverted to the fileformat of LyX 1.6.x and can therefore be read by all LyX 1.6.x versions.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31941 a592a061-630c-0410-9148-cb99ea01b6c8
performance problems when loading documents with lots of macros.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31907 a592a061-630c-0410-9148-cb99ea01b6c8
Math manual loads and save correctly it seems but expect some instability period.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31898 a592a061-630c-0410-9148-cb99ea01b6c8
- Do we want to ask the user which of the parents he would like to be the document's parent ?
- Do we want to disable any functionality related to parents ? Like references, bibliography, document outline etc.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31809 a592a061-630c-0410-9148-cb99ea01b6c8
Furthermore:
- increase safety,
- improve error handling,
- minor cleanups,
- set documents to read-only while running the thread.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31736 a592a061-630c-0410-9148-cb99ea01b6c8
There is a FIXME in there that says that if some LFUN need to be dispatched even if the Buffer is internal then we should add some code. But I couldn't find any for now.
* Move LFUN_BUFFER_IMPORT status to GuiView where it belongs.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31398 a592a061-630c-0410-9148-cb99ea01b6c8
Replaced various replica of such check with the invocation of the new method.
TocBackend now does not call addToToc() for internal buffers.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31340 a592a061-630c-0410-9148-cb99ea01b6c8
This basically solves bug #6162 in trunk (this cannot be done in branch until we take measures to prevent dataloss when closing a master and dirty children).
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31149 a592a061-630c-0410-9148-cb99ea01b6c8
We don't want a master buffer to release all its children immediately because that would close dirty childs without saving and would make it impossible to store the childs in a proper way in the session file.
As, we close all children of a buffer together with the master itself, it is also no longer necessary to do it automatically.
I'll leave it commented out for a while in case someone objects to it.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31130 a592a061-630c-0410-9148-cb99ea01b6c8
The first thing that bformat does is to check whether the string contains "%1$s". Otherwise it asserts.
Why didn't we see this happen before ? This was revealed by the emergency saves that Richard introduced in the Buffer dtor.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31062 a592a061-630c-0410-9148-cb99ea01b6c8
This patch makes sure that there are minimal changes when loading and saving a file with change tracking.
- the authors are assigned a buffer_id, such that when the file is saved, they get the same id,
- the authorlist is sorted according to the buffer_id,
- the buffer_id is written to the file in the author list (file format change)
- the ids start with 1, because 0 is internally reserved for the current Author,
- when writing the file, the current author is assigned an id if he didn't already have it.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30756 a592a061-630c-0410-9148-cb99ea01b6c8
Fix the rest of the code, whih implies fixing a few potential bugs where the appendix status was not taken in account.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30524 a592a061-630c-0410-9148-cb99ea01b6c8
* Counters.cpp (flatLabelString): return a cache of the flattened strings for each used language
* Counters.cpp (theCounter, counterLabel, flattenLabelString): add a lang parameter; in theCounter, populate the cache as needed.
* insets/InsetCaption.cpp:
* insets/InsetFoot.cpp:
* insets/InsetBibitem.cpp:
* insets/InsetCollapsable.cpp:
* Paragraph.cpp:
* Buffer.cpp: pass a language argument to counter methods.
* Paragraph.cpp (translateIfPossible): use the function with same name in gettext.cpp.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30520 a592a061-630c-0410-9148-cb99ea01b6c8
- GUI support for table alignment
(all comments to the polished layout of the table dialog welcome)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30477 a592a061-630c-0410-9148-cb99ea01b6c8
- rewrite getUsedBranches() with an InsetIterator approach.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30465 a592a061-630c-0410-9148-cb99ea01b6c8
- rewrite LFUN_BRANCHES_RENAME with an InsetIterator approach.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30464 a592a061-630c-0410-9148-cb99ea01b6c8
* on paste, ask if unknown branches shall be added to the branch list
(entails new LFUN_BRANCH_ADD)
* add a list of undefined branches to the buffer and the GUI
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30419 a592a061-630c-0410-9148-cb99ea01b6c8
Navigating in such dialogs does not work yet, but at least the user is informed
at all that LaTeX wasn't succesful.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30209 a592a061-630c-0410-9148-cb99ea01b6c8
- make LaTeX logfile dialog work for child documents and master-buffer-[view|update]:
if there's only a master file log or if the master file log is newer, it is displayed.
* Buffer.h: typo.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30206 a592a061-630c-0410-9148-cb99ea01b6c8
This patch is from JMarc, except the docs, which are due to me.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29906 a592a061-630c-0410-9148-cb99ea01b6c8
only sweave is supported (for building documentation, not programs).
Layout files allow a new OutputFormat tag
Modules can be conditionned on a feature of the type from->to, indicating that
it should be possible to convert from format 'from' to format 'to'.
Layout format incremented to 15.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29874 a592a061-630c-0410-9148-cb99ea01b6c8
No automatic width calculation is done for old documents, because these might rely on settings in
nomencl.cfg.
A GUI to alter this is needed.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29775 a592a061-630c-0410-9148-cb99ea01b6c8
If the document is unnamed try to save in the backup dir, else in the default document path, and as a last try in the filePath, which will most often be the temporary directory.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29508 a592a061-630c-0410-9148-cb99ea01b6c8
- prevent crash if no formats are found (and return an empty string).
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29141 a592a061-630c-0410-9148-cb99ea01b6c8
This patch enhances the Buffer::dispatch() method to make it a full-fledged
member of the dispatch sequence. The most immediate payoff is that LFUNs that
are handled in Buffer::dispatch() can be used from the command line.
We make better use of the DispatchResult object and return error information
through it, rather than using return values. (This was JMarc's suggestion.) We
also introduce a corresponding Buffer::getStatus() method, and modify
BufferView::getStatus() to return a flag indicating whether a decision has been
made, as is already done in some other cases.
Finally, some LFUNs are moved to Buffer::dispatch(), including LFUN_BUFFER_PRINT.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29125 a592a061-630c-0410-9148-cb99ea01b6c8
This change makes it possible (at long last!) to go to the work area, do some edition and then come back to the SpellChecker. We probably need a [Continue] button.
* Buffer::nextWord(): go back a bit to return the current word.
* SpellChecker and Dialog: get rid of the complicated, useless exitEarly() handling.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29092 a592a061-630c-0410-9148-cb99ea01b6c8
* Buffer::spellCheck() new method constructed from mutiple bits of GuiSpellchecker.cpp.
* GuiSpellchecker: lots of simplifications.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29090 a592a061-630c-0410-9148-cb99ea01b6c8
filename in a different way, we need to make sure we always do it the same
way. Makes more sense to do this in Buffer anyway.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29073 a592a061-630c-0410-9148-cb99ea01b6c8
- re-assign a master's children if a child was reloaded (bug 5873)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29046 a592a061-630c-0410-9148-cb99ea01b6c8
this case, when the cursor is on a branch inset (using the AtPoint mechanism)
the branch to which the branch inset belongs will be (de)activated.
This functionality can now be used through the branch inset context menu
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@28987 a592a061-630c-0410-9148-cb99ea01b6c8
* Buffer::nextWord(): new method to search for next word.
* DocIterator.cpp: new function isLetter() moved from GuiSpellchecker.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@28963 a592a061-630c-0410-9148-cb99ea01b6c8
* use the UpdateScope, introduced recently, to prevent the 'strange' calls to setParent which also causes the update mechanism to run,
* remove the buffer parameter of loadIfNeeded and all function,
* remove doubled code from getChildBuffer.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@28919 a592a061-630c-0410-9148-cb99ea01b6c8
This patch encapsulates the needed call in Buffer::setBuffersForInsets(),
and calls it from Undo::Private::textUndoOrRedo(). As noted in the FIXME,
this is still a bit of a "hammer" and ought to be replaced with the sort of
more refined approach taken in r28709. But I don't at the moment see how to
do that. The place to do it, though, is in doTextUndoOrRed().
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@28757 a592a061-630c-0410-9148-cb99ea01b6c8
* Buffer.{cpp, h}:
- new method getChildren() that returns included (and sub-included) files
* GuiView.cpp (closeEvent):
- do not just close dirty child documents.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@28712 a592a061-630c-0410-9148-cb99ea01b6c8
The problem was that, if the master is not opened, no respective guiDelegate exists, and the functions that update the toc do not trigger. The fix is to update the child's toc backend and toc items directly in such cases.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@28551 a592a061-630c-0410-9148-cb99ea01b6c8
- avoid wrong console message while loading a child from a master
that lead me on the wrong track when debugging bug 5699.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@28491 a592a061-630c-0410-9148-cb99ea01b6c8