Commit Graph

233 Commits

Author SHA1 Message Date
Bo Peng
932998494b Embedding: add option \extra_embedded_files to buffer params. This increase
LyX file format to 318. The Embedded files panel of document settings has
been simplied, with working add and remove buttons. Note that bease BufferParams
lacks buffer path information, extraEmbeddedFiles are vector<string>, instead
of EmbeddedFileList (as previously planned).


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23606 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-09 23:04:14 +00:00
Bo Peng
6dc7cbe1e7 Continue working on the embedding feature. An additional parameter updateFile is passed to
EmbeddedFile::enable() and EmbeddedFiles::enable() to differentiate different usages.
A member variable bibfiles_ is added to InsetBibtex because it is not efficient to obtain
EmbeddedFileList each time from params()['bibfiles'] and params()['embed'].


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23576 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-09 06:05:22 +00:00
Abdelrazak Younes
49c45006ae cosmetics
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23543 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-07 20:51:56 +00:00
Abdelrazak Younes
095fc3a2a1 Buffer::getLabelList(): Bug fix; only level 0 items are labels.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23542 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-07 19:52:44 +00:00
Abdelrazak Younes
5da55588f2 * Buffer::getLabelList(): Speed up and simplify by using the tocBackend.
* Inset and derived class: get rid of getLabelList()
* BufferView::gotoLabel(): Speed up and simplify by using the tocBackend.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23541 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-07 19:46:04 +00:00
Abdelrazak Younes
01d218fd0f * Buffer::changeRefsIfUnique(): Only used for CITE_CODE now.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23538 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-07 13:45:48 +00:00
Richard Heck
6edb3984bf BaseClassList --> LayoutFileList
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23532 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-07 03:53:21 +00:00
Richard Heck
a01cb111a0 Change the interface to a paragraph's layout. We still store a LayoutPtr, but now privately, and make a Layout const & available to clients.
The need for a LayoutPtr arises from the fact that (a) we do not want to give our clients a Layout &, since we do not want them to be able to change our Layout; but (b) we also need to be able to change which layout is ours. So we cannot store a Layout const &. Or so it seems to the compiler.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23522 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-06 21:31:27 +00:00
Abdelrazak Younes
258cca4b3b Delete child buffer at InsetInclude destruction.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23521 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-06 20:58:59 +00:00
Abdelrazak Younes
af6e88250a Load child documents unconditionally at updateLabels() time.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23513 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-06 18:13:04 +00:00
André Pönitz
a694476ac6 try to pass a Buffer & to inset construction if some buffer(param)
access is needed


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23465 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-04 22:28:18 +00:00
Abdelrazak Younes
d7ccaedfe0 Invert loadChildDocuments() and updateLabels() calls. This is necessary to avoid potential recursive calls of updateLabels().
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23457 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-04 17:45:23 +00:00
Abdelrazak Younes
ed5350bae7 Found a cleaner solution for the buffer reference problem in mathed.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23445 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-04 14:18:34 +00:00
Abdelrazak Younes
7f8d9a6f87 set the buffer reference for all insets when the file is loaded.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23433 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-04 12:18:52 +00:00
Uwe Stöhr
3db3b9930a fileformat incremented to 317:
support for floating placement settings for wrap floats

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23394 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-02 17:12:22 +00:00
Abdelrazak Younes
8e9dc9bd2a Introduce a labels&references cache at buffer level. This cache uses the already existing updateLabels() mechanism and thus speedups labels&references toc generation. As a bonus, duplicates labels and broken references are detected and tagged with "DUPLICATE:" and "BROKEN:" in the outliner (or the navigator).
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23389 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-02 15:27:35 +00:00
Jürgen Spitzmüller
ac1977018b ** subfig support **
* src/Buffer.cpp:
* development/FORMAT:
	- bump format to 316.

* src/insets/InsetFloat.{cpp, h}:
	- let nested floats be subfloats
	  NOTE: docbook support is missing.
* src/insets/InsetCaption.{cpp, h}:
	- handle subfigure captions
* src/insets/InsetGraphics.cpp:
* src/insets/InsetGraphicsParams.{cpp, h}:
	- remove old subfigure support

* lib/chkconfig.ltx:
* lib/doc/LaTeXConfig.lyx:
	- check for subfig instead of subfigure.

* lib/lyx2lyx/LyX.py:
* lib/lyx2lyx/lyx_1_6.py:
	- conversion/reversion routines for subfig -> subfloats
	  NOTE: the reversion routine still has bugs.

* src/Counters.{cpp, h}: 
	- add identifiers for subfloats

* src/LaTeXFeatures.{cpp, h}:
	- support for subfig

* src/TextClass.cpp:
	- set up subfloat counter for all custom floats.

* src/frontends/qt4/GuiGraphics.cpp:
* src/frontends/qt4/ui/GrahicsUi.ui:
	- remove subfigure UI.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23381 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-02 11:30:50 +00:00
Richard Heck
2b3bd7b5f4 This is the last of the commits that hopes to enforce the distinction between "layout files" and "document classes" that was introduced by the modules code. For the most part, these changes just refactor code from TextClass between: (a) a TextClass base class; (b) a LayoutFile subclass, which represents the information in a .layout file; and (c) a DocumentClass subclass, which represents the layout information associated with a Buffer---a LayoutFile plus Modules. Methods from TextClass have been apportioned between the three classes depending upon what is needed where, and signatures have been changed where necessary so that the right kind of class is required.
At this point, there are no simple TextClass objects in the main LyX code, and it is impossible to create them, since the TextClass constructor is protected. Only LayoutFile and DocumentClass objects can be constructed, and for the most part these are constructed only by their respective containers: BaseClassList and DocumentClassBundle. There is an exception: LayoutFile does have a public default constructor, but if anyone knows how to make it go away, please do.

There will be one or two more commits along these lines, but these will be simple renamings. For example, BaseClassList should be LayoutFileList.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23343 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-29 02:45:33 +00:00
Richard Heck
a6fccccd56 Header.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23300 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-28 03:51:10 +00:00
Richard Heck
d8a6b5bfd0 Remove TextClassPtr without losing the type safety it provided.
See these threads:
http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg136112.html
http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg136062.html
http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg135997.html
for some background.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23299 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-28 01:42:02 +00:00
André Pönitz
9b39c142b6 remove Buffer & argument in functions realted to embedded files
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23292 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-27 21:51:29 +00:00
André Pönitz
db8c16d554 progress on buffer-reference-in-insets. beware of instabilities...
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23289 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-27 20:43:16 +00:00
Stefan Schimanski
cd5bad62e0 * paragraph support for the global word list. To make it buffer
dependent, we need the buffer pointer. In fact we already have a
  pointer to the text inset. So as soon as inset know their buffer we
  can easily switch to a buffer local word list.
* there might be missing some more places to update the words from a
  buffer, like for example after backspace or more important when the
  cursor leaves a paragraph.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23244 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-26 13:07:59 +00:00
Stefan Schimanski
f8d516c7af Revert "* compile fix"
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23234 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-25 22:02:48 +00:00
Stefan Schimanski
1669c17c0f * compile fix
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23233 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-25 21:53:16 +00:00
Stefan Schimanski
c3bdbe38d7 * implemention of the WordList with iterator caching for a std::set string list.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23210 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-25 01:55:50 +00:00
Richard Heck
4c6180d209 Try to make the distinction between base classes and text classes clearer in the code.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23198 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-24 16:59:49 +00:00
Richard Heck
0362c6aae7 Andre's s/getTextClass/textClass/ cleanup.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23190 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-24 15:06:35 +00:00
Richard Heck
2e7d1199df Revert 23154.
Sorry, Andre, but this broke not only the modules stuff but the general handling of TextClasses. I'm not opposed to doing this sort of thing, but it's going to be a little more complicated. I'll do it when I get a bit of time, or I can explain what the issue is here if you want to do it.

I'll separately re-commit some of the cleanup here.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23189 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-24 14:59:23 +00:00
Stefan Schimanski
323e3b0207 * Moved std::sets out of Buffer.h to reduce overall LyX compile time
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23163 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-23 18:11:35 +00:00
André Pönitz
b306e9a2e1 Replace the text class shared ptr by good old index-into-global-list.
Also a few cosmetical changes where I xould not resist.

Would be nice if the 'modules people' could verify that their baby 
is strill alive... 



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23154 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-23 11:36:15 +00:00
Stefan Schimanski
1bf7b59d60 * completion infrastructure
* completion support for mathed
* experimental completion support for text


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23104 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-21 19:42:34 +00:00
Abdelrazak Younes
c99062a27d Buffer::resetChildDocuments() Check for Buffer emptiness before proceeding.
Abdel.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23063 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-19 07:31:02 +00:00
Richard Heck
4ab6f265e9 Add support for column separation in page margins. Fixes bug 3337.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23059 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-19 05:24:48 +00:00
Richard Heck
a97b6295c4 Clean up a bit.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23058 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-19 03:46:11 +00:00
Richard Heck
7dcffe09f4 It used to be that things like InsetFlex, InsetCaption, and the like used the default layout, whatever that is---usually Standard. That gave rise to bug 2178, the solution to which is to define a new empty layout, which insets like these use instead of the default. See r22966.
So, when we have an older LyX file, it will look like this:
\begin_inset ERT
status open

\begin_layout Standard

this that
\end_layout

\end_inset
which is now invalid, because ERT uses only PlainLayout. So I had put some code into Text::readParToken, where the layout for a paragraph gets set as it is read:
       if (par.forceEmptyLayout()) {
           // in this case only the empty layout is allowed
           layoutname = tclass.emptyLayoutName();
       } else if (par.useEmptyLayout()) {
           // in this case, default layout maps to empty layout
           if (layoutname == tclass.defaultLayoutName())
               layoutname = tclass.emptyLayoutName();
       } else {
           // otherwise, the empty layout maps to the default
           if (layoutname == tclass.emptyLayoutName())
               layoutname = tclass.defaultLayoutName();
       }
This turns out not to work, because par.forceEmptyLayout() and par.useEmptyLayout() always return false here, because par.inInset() always returns a null pointer, because the paragraph's inset hasn't yet been set when Text::readParagraph() gets called from Text::read() gets called from InsetText::read(). The solution is to set the paragraph's inset when it is created, which means passing a pointer to the various read() routines along the way.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23057 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-19 02:35:07 +00:00
André Pönitz
24fdfc7d5e start work on less-likely-to-misuse iterators.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22898 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-09 15:23:05 +00:00
Stefan Schimanski
3d9b98b3de * cosmetic
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22863 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-08 16:19:36 +00:00
Abdelrazak Younes
eac609495b header cleanup
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22827 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-07 09:00:49 +00:00
Stefan Schimanski
5627a35790 * cosmetic
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22815 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-06 21:32:31 +00:00
Uwe Stöhr
886db92f82 enable the scrlttr 2 class for serial letters:
- file format change
- new example files and an example address database
- remove ugly hack from scrlttr2.layout and fix bug 4529

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22764 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-03 11:56:44 +00:00
Jürgen Spitzmüller
cbf599b911 ** Fix language switch issue introduced by the CJK patch **
* src/output_latex.{cpp,h}:
	- (latexParagraphs, TeXEnvironment, TeXOnePar, TeXDeeper): pass Text element 
	   instead of ParagraphList. This is necessary to detect whether we are in the main text.
	- check if we are in the main text for language switches, if needed.
* src/Buffer.cpp:
* src/insets/InsetEnvironment.cpp:
* src/insets/InsetText.cpp:
* src/mathed/InsetMathMBox.cpp:
	- adapt to new latexParagraphs definition.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22666 a592a061-630c-0410-9148-cb99ea01b6c8
2008-01-25 13:27:08 +00:00
Stefan Schimanski
76cbbc2fb4 * Fix latex output of child documents when rendered alone.
Problem: Before macro redefinitions in a child buffer did not see the
parent original definition because an Buffer::updateMacros() call had
updated the redefinition_ flag to "false" after the parent buffer had
temporarely been set to =0 for latex output of the child.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22656 a592a061-630c-0410-9148-cb99ea01b6c8
2008-01-23 00:26:48 +00:00
Richard Heck
1741c87a4e Fix bug 4463. The crash was due to a call to X from inside a child process.
The main change is to support/ForkedCalls.{h,cpp}. We introduce a static variable IAmAChild and a corresponding accessor. This is set to true in a new fork() method, in the branch taken by the child. (Note: fork() is safe cross-platform, as it just returns -1 if we don't have fork().) This ForkedProcess::iAmAChild() method is then used to protect GuiView::message().

As Abdel has pointed out, there may be other such calls to be protected, e.g., the emission of the Buffer::changed() signal. Those are not addressed here.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22587 a592a061-630c-0410-9148-cb99ea01b6c8
2008-01-15 18:26:53 +00:00
Stefan Schimanski
e0538043e4 * Nearly a proof that there are useful compiler warnings that a variable is not used,
though in this case the warning was "fixed" before it did its job.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22561 a592a061-630c-0410-9148-cb99ea01b6c8
2008-01-14 21:52:57 +00:00
Abdelrazak Younes
c15b2f6e1a * Buffer::doExport(): return early.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22550 a592a061-630c-0410-9148-cb99ea01b6c8
2008-01-14 14:09:20 +00:00
Abdelrazak Younes
c81f5add99 * AutoSaveBuffer::generateChild(): return early.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22546 a592a061-630c-0410-9148-cb99ea01b6c8
2008-01-14 09:04:14 +00:00
Abdelrazak Younes
2c1b8bc472 * AutoSaveBuffer::generateChild(): FileName::moveTo() already tries to remove the file if any so no need to do that again.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22545 a592a061-630c-0410-9148-cb99ea01b6c8
2008-01-14 09:00:32 +00:00
André Pönitz
e69b723bf9 There was a bit too much copying of dociterators gpoing on leading to an
avoidable ~5% overhead when loading the UserGuide. This is an attempt on
rectifying the situation.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22532 a592a061-630c-0410-9148-cb99ea01b6c8
2008-01-12 21:38:51 +00:00
Richard Heck
d5d665482e This commit changes the way individual LyXModule's are represented, both internally and in the .lyx files. The earlier version represented them by their `descriptive name', e.g., "Endnote" or "Theorems (AMS)", these being the same names used in the UI. This was a mistake, as becomes readily apparent when one starts to think about translating these strings. The modules ought to be represented by their filename, without the extension, just as TextClass's are.
The changes that accomplish this part are in ModuleList.{h,cpp}, configure.py, and the *.module files themselves. This is a format change, and the lyx2lyx is in those files.

By itself, that change would not be major, except for the fact that we do not want the module to be represented in the UI by its filename---e.g., theorems-std---but rather by a descriptive name, such as "Theorems". But that change turns out to be wholly non-trivial. The mechanism for choosing modules was the same as---indeed, was borrowed from---that in GuiCitation: You get a list of modules, and choosing them involves moving strings from one QListView to another. The models underlying these views are just QStringListModels, which means that, when you want to know what modules have been selected, you see what strings are in the "selected" QListView. But these are just the descriptive names, and we can't look up a module by its descriptive name if it's been translated. That, indeed, was the whole point of the change to the new representation.

So, we need a more complicated model underlying the QListView, one that will pair an identifying string---the filename minus the extension, in this case---with each item. This turns out not to be terribly difficult, though it took rather a while for me to understand why it's not difficult. There are two parts:
(i)  GuiSelectionManger gets re-written to use any QAbstractListModel, not just a QStringListModel. This actually seems to improve the code, independently.
(ii) We then subclass QAbstractListModel to get the associated ID string, using the Qt::UserRole slot associated with each item to store its ID. This would be almost completely trivial if QAbstractListItem::itemData() included the QVariant associated with this role, but it doesn't, so there are some additional hoops through which to jump.

The new model, a GuiIdListModel, is defined in the files by that name. The changes in GuiSelectionManger.{h,cpp} make it more abstract; the changes in GuiDocument.{h,cpp} adapt it to the new framework. 

I've also updated the module documenation to accord with this change.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22501 a592a061-630c-0410-9148-cb99ea01b6c8
2008-01-12 04:28:12 +00:00