Commit Graph

35 Commits

Author SHA1 Message Date
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
Pavel Sanda
922aa7b1e8 Add characters counting.
Introduce LFUN_STATISTICS.
see http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg134033.html .


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22433 a592a061-630c-0410-9148-cb99ea01b6c8
2008-01-08 15:18:00 +00:00
Abdelrazak Younes
acbb1c9b8c Split LyXFunc::menuNew() into LyXView::newDocument() and buffer_funcs::newUnnamedFile().
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22002 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-07 11:57:13 +00:00
André Pönitz
f4cc71b7dd remove unneded code
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21192 a592a061-630c-0410-9148-cb99ea01b6c8
2007-10-24 23:03:40 +00:00
André Pönitz
f934b86850 cosmetics
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21097 a592a061-630c-0410-9148-cb99ea01b6c8
2007-10-21 10:50:56 +00:00
André Pönitz
f762cbf3c6 mainly cosmetics
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21079 a592a061-630c-0410-9148-cb99ea01b6c8
2007-10-20 10:03:45 +00:00
André Pönitz
82309f0c2d Remove a few includes from Text.h
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20386 a592a061-630c-0410-9148-cb99ea01b6c8
2007-09-20 20:44:08 +00:00
Richard Heck
6e93e77f22 This is one of a series of patches that will merge the layout modules development in personal/branches/rgheck back into the tree.
Design goal: Allow the use of layout "modules", which are to LaTeX packages as layout files are to LaTeX document classes. Thus, one could have a module that defined certain character styles, environments, commands, or what have you, and include it in various documents, each of which uses a different document class, without having to modify the layout files themselves. For example, a theorems.module could be used with article.layout to provide support for theorem-type environments, without having to modify article.layout itself, and the same module could be used with book.layout, etc.

This first patch does some reworking of the infrastructrue. We need to distinguish between the TextClass that a particular document is using and the layout of that document, since modules, in particular, can modify the layout. The solution adopted here is to add a TextClass pointer to BufferParams, which will hold the layout. The layout itself is then constructed from the TextClass the document is using. At present, this is completely trivial, but that will change when modules are added.

The pointer in question is a boost::shared_ptr. This is needed because CutAndPaste saves a copy of the layout with each cut or copied selection. We cannot assume the selection vanishes when the document is closed, so there are two options: (i) keep a list of all the layouts that have ever been used by any document; (ii) used some kind of smart pointer. The latter seems preferable, as the former would waste memory. More importantly, the use of a smart pointer allows modules to be modified on disk and then reloaded while LyX is running, and it will eventually allow the same for layout files.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19756 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-23 16:41:13 +00:00
Abdelrazak Younes
8bb999b7ee * loadChildDocuments(): new function to load all child documents in a given buffer. This will be used for a new LFUN_LOAD_CHILD_DOCUMENTS and for pre-loading all child documents when certain action (latex export, bibtex parsing, label and reference).
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19515 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-13 18:11:43 +00:00
Jean-Marc Lasgouttes
601a8e0192 Rewrite the label numbering code.
* buffer_funcs.cpp (updateLabels): new function taking a buffer and
	a ParIterator as arguments. This one is used to update labels
	into an InsetText. Cleanup the code to reset depth. Call setLabel
	for each paragraph, and then updateLabel on each inset it contains.
	(setCaptionLabels, setCaptions): removed.
	(setLabel): use Counters::current_float to make caption paragraphs
	labels.

	* insets/Inset.h (updateLabels): new virtual method, empty by
	default; this numbers the inset itself (if relevant) and then all
	the paragraphs it may contain.

	* insets/InsetText.cpp (updateLabels): basically calls
	lyx::updateLabels from buffer_func.cpp.

	* insets/InsetCaption.cpp (addToToc): use the label constructed by
	updateLabels.
	(computeFullLabel): removed.
	(metrics, plaintext): don't use computeFullLabel.
	(updateLabels): new method; set the label from
	Counters::current_float.

	* insets/InsetWrap.cpp (updateLabels):
	* insets/InsetFloat.cpp (updateLabel): new method; sets
	Counters::current_float to the float type.

	* insets/InsetBranch.cpp (updateLabels): new method; the numbering
	is reset afterwards if the branch is inactive. (bug 2671)

	* insets/InsetNote.cpp (updateLabels): new method; the numbering
	is reset after the underlying InsetText has been numbered.
	(bug 2671)

	* insets/InsetTabular.cpp (updateLabels): new method (also handles
	longtable)

	* insets/InsetListings.cpp (updateLabels): new method; mimics what
	is done for Floats (although Listings are not floats technically)

	* insets/InsetInclude.cpp (getScreenLabel): in the listings case,
	use the computed label.
	(updateLabels): new method; that either renumbers the child
	document or number the current listing.

	* LyXFunc.cpp (menuNew): do not updateLabels on empty documents
	(why do we do that at all?)


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19482 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-12 21:43:58 +00:00
Richard Heck
47b9d13bb7 Deal with a UI bug discussed on the list.
The effect is this: If you try to open a file that is already open,
LyX (i) checks if the buffer is dirty, and just switches buffers if
it is not; (ii) if it is, you get this message:
 The document %1$s is already loaded and has unsaved changes. 
 Do you want to abandon your changes and reload the document?
    [Reload] [Keep Changes]
If you hit the latter, you just get switched to the document.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19331 a592a061-630c-0410-9148-cb99ea01b6c8
2007-08-06 04:14:26 +00:00
Abdelrazak Younes
ba4214cbe9 Following commit 19040, those partial updateLabels() functions are not needed anymore.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@19041 a592a061-630c-0410-9148-cb99ea01b6c8
2007-07-11 13:30:56 +00:00
Abdelrazak Younes
144e721b65 Polish revision 18825 and fix some remaining issues with child documents. The diff is bigger than it should because of white space issues.
* buffer_funcs.{h,cpp}: new checkAndLoadLyXFile() transferred from BufferView::loadLyXFile().

* BufferView::loadLyXFile(): deleted.

* LyXView::loadLyXFile(): simplify logic and fix some issues:
  - buggy child document leads to crash due to error list dialog.
  - ensure that we switch to buffer if there's some errors.
  - use LyXView::setBuffer() instead of repeating code.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@18828 a592a061-630c-0410-9148-cb99ea01b6c8
2007-06-19 16:03:47 +00:00
Abdelrazak Younes
bf61ecc2de Support code for advanced Toc management and bug correction.
* buffer.h:
  - structureChanged(): new boost signal. I intend to use that also when a text is changed in a section or caption item.

* buffer_funcs.C:
  - updateLabels(): emit Buffer::structureChanged() after TocBackend is updated.
  - checkBufferStructure(): new method for updating the TocBackend if needed.

* LyXView:
  - updateToc(): new slot for Buffer::structureChanged() signal.

* text.C:
  - call checkBufferStructure() whenever text is added or erased.

* TocBackend.[Ch]:
  - updateItem(): new method to update a specific item (called from checkBufferStructure()).



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@17413 a592a061-630c-0410-9148-cb99ea01b6c8
2007-03-12 11:23:41 +00:00
Abdelrazak Younes
e68d69e473 Translate labels based on the paragraph language instead of the Buffer language.
* Buffer:
  - translateLabel(): deleted.

* Paragraph:
  - translateIfPossible(): new method.
  - expandLabel(): new method.

* buffer_funcs.[Ch]
  - expandLabel(): deleted.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16694 a592a061-630c-0410-9148-cb99ea01b6c8
2007-01-15 16:58:14 +00:00
Georg Baum
ed99f752f9 more unicode filenames
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16133 a592a061-630c-0410-9148-cb99ea01b6c8
2006-12-02 16:07:15 +00:00
Georg Baum
2734cc1548 Extend the navigate menu to child docs
* src/buffer_funcs.h
	(updateLabels): Add bool childonly argument

	* src/insets/insetbase.h
	(addToToc): New virtual method

	* src/insets/insetinclude.[Ch]
	(addToToc): New virtual method
	(updateLabels): New method

	* src/TocBackend.h: reorganize classes so that we can forward
	declare TocList

	* src/insets/insetfloat.[Ch]
	* src/insets/insetwrap.[Ch]
	(addToToc): Adjust to type changes in TocBackend.h

	* src/frontends/qt4/TocModel.[Ch]: ditto

	* src/frontends/controllers/ControlToc.[Ch]: ditto

	* src/TocBackend.C: ditto
	(TocBackend::update) Remove test for float and wrap inset,
	call virtual method instead

	* src/BufferView.C
	(BufferView::dispatch): make LFUN_PARAGRAPH_GOTO work even if the
	target paragraph is in a different buffer

	* src/MenuBackend.C: Adjust to type changes in TocBackend.h
	(expandToc): Add an entry for the master doc in child docs

	* src/buffer_funcs.C
	(setLabel): Add text class parameter
	(updateLabels): handle included docs if requested by the caller


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15904 a592a061-630c-0410-9148-cb99ea01b6c8
2006-11-13 16:53:49 +00:00
André Pönitz
6c300f72a2 move everything into namespace lyx
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15422 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-21 00:16:43 +00:00
Lars Gullik Bjønnes
2b01ca42d8 Move counters toward unicode.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15418 a592a061-630c-0410-9148-cb99ea01b6c8
2006-10-20 20:30:00 +00:00
Abdelrazak Younes
c5a4f61f33 This commit creates a error_lists map member inside the Buffer class.
I had no choice but to use string for the map key. This is
because the only information that could be passed to the controller is a
string.

With this new architecture, persistent error lists are now possible.

* Buffer
  - errorList_, addError(),  : deleted
  - std::map<std::string, ErrorList> errorLists_ : new member
  - errorList(std::string const & type): associated accessors

* buffer_funcs.C
  - bufferErrors(Buffer const & buf, TeXErrors const & terr): now needs a third errorList argument
  - bufferErrors(Buffer const & buf, ErrorList const & el): deleted.

* Converter
  - convert(): now needs an ErrorList argument instead of filling the Buffer errorList member directly.
  - runLaTeX(): ditto
  - scanLog(): ditto

* CutAndPaste.C
  - pasteParagraphList(): ditto
  - pasteSelection(): ditto

* lyxtext.h/text.C
  - readParagraph(): ditto
  - LyXText::read(): ditto

* importer:
  - Importer::Import(): ditto

* BufferView_pimpl.C
  - loadLyXFile(): send the Buffer::errors() signal instead of calling LyXView::showErrorList() directly.

* exporter.C
  - Export(): send the Buffer::errors() signal instead of calling LyXView::showErrorList() directly in lyxfunc.C

* ControlErrorList.C
  - initialiseParams(): translation operation transfered here from LyXView::showErrorList().

* LyXView.C
  - LoadLyXFile(): add a showErrorList("Parse") call.
  - showErrorList(): simplified due to code transferred to the ControlErrorList.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14652 a592a061-630c-0410-9148-cb99ea01b6c8
2006-08-13 16:16:43 +00:00
Abdelrazak Younes
f6bcac7285 * src/buffer_funcs.[Ch]
- updateCounters renamed to updateLabels
 - void updateLabels(Buffer const & buf,
   ParIterator & it): new convenience function
 - void updateLabels(Buffer const & buf,
   ParIterator & from, ParIterator & to): new convenience function
 - setCounter renamed to setLabel
 - bool tryToUpdateCurrentLabel(Buffer const & buf,
   ParIterator & it): new method
 - needsUpdateCounters: deleted

* src/BufferView_pimpl.C
* src/CutAndPaste.C
* src/frontends/controllers/ControlDocument.C
* src/lyxfunc.C
* src/text.C
* src/text2.C
* src/text3.C
 - fixed the calls to updateLabels


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13689 a592a061-630c-0410-9148-cb99ea01b6c8
2006-04-16 14:19:25 +00:00
Lars Gullik Bjønnes
cf4293824f * Change several freestanding and class methods with first letter
capitalized to have first letter lowercased.
* Adjust all affected files.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13605 a592a061-630c-0410-9148-cb99ea01b6c8
2006-04-09 00:26:19 +00:00
Abdelrazak Younes
4b0a5549b1 * buffer_funcs.[Ch]: new needsUpdateCounters function
* text.C:
 - LyXText::breakParagraph(): test if needsUpdateCounters() is enough before a full updateCounter
 - LyXText::backspacePos0(): ditto

* text2.C:
 - LyXText::deleteEmptyParagraphMechanism(): ditto


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@13593 a592a061-630c-0410-9148-cb99ea01b6c8
2006-04-07 22:16:09 +00:00
Angus Leeming
70572847e2 Whitespace, only whitespace. s/ +$//
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@10024 a592a061-630c-0410-9148-cb99ea01b6c8
2005-06-09 09:58:08 +00:00
Jean-Marc Lasgouttes
971d9986b7 fix bug 1807: New on-screen translations do not work
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9960 a592a061-630c-0410-9148-cb99ea01b6c8
2005-05-20 09:13:42 +00:00
Jean-Marc Lasgouttes
1e7112db43 fix counters updating mechanism
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9682 a592a061-630c-0410-9148-cb99ea01b6c8
2005-02-25 11:55:36 +00:00
Jean-Marc Lasgouttes
a839021d22 implement Word counting (bug 728)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9402 a592a061-630c-0410-9148-cb99ea01b6c8
2004-12-27 16:30:27 +00:00
Lars Gullik Bjønnes
44cd0fc9a1 The std::string mammoth path.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7862 a592a061-630c-0410-9148-cb99ea01b6c8
2003-10-06 15:43:21 +00:00
Angus Leeming
ffdb0baea3 Get rid of trailing whitespace 'noise' in future patches for the
forseeable future.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7724 a592a061-630c-0410-9148-cb99ea01b6c8
2003-09-09 18:27:24 +00:00
Angus Leeming
236ea81bc5 Replace LString.h with support/std_string.h,
Lsstream.h with support/std_sstream.h,
support/LIstream.h with support/std_istream.h,
support/LOstream.h with support/std_ostream.h.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7685 a592a061-630c-0410-9148-cb99ea01b6c8
2003-09-05 17:23:11 +00:00
Angus Leeming
0be0fcfd59 If I ever see another licence blurb again, it'll be too soon...
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7598 a592a061-630c-0410-9148-cb99ea01b6c8
2003-08-23 00:17:00 +00:00
Alfredo Braunstein
dfbd44997a moved some converter/format functions to more appropriate places
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7300 a592a061-630c-0410-9148-cb99ea01b6c8
2003-07-17 08:23:33 +00:00
Alfredo Braunstein
e3fc822783 Added new signals to Buffer, connect/disconnect to them in BufferView, added BufferView::newFile
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7242 a592a061-630c-0410-9148-cb99ea01b6c8
2003-07-07 08:37:02 +00:00
Alfredo Braunstein
3508b30871 More errorlist adjustements.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7209 a592a061-630c-0410-9148-cb99ea01b6c8
2003-06-24 20:42:15 +00:00
Alfredo Braunstein
2d8eb4b9d4 take several functions out of BufferList, and split functionality
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7195 a592a061-630c-0410-9148-cb99ea01b6c8
2003-06-20 12:46:28 +00:00