Commit Graph

90 Commits

Author SHA1 Message Date
Jean-Marc Lasgouttes
01b290e2dd Fix part of bug http://www.lyx.org/trac/ticket/2566
We use Inset::producesOutput to skip things like notes and inactive
branches.

	* buffer_funcs.cpp (countWords): align code style with countChars;
	skip insets for which producesOutput() is false.
	(countChars): honor Inset::producesOutput.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30242 a592a061-630c-0410-9148-cb99ea01b6c8
2009-06-23 09:46:48 +00:00
Abdelrazak Younes
5387379c24 Introduce Paragraph::isWordSeparator() and use it instead of Paragraph::isLetter(). Note here a change in behavior WRT to word selection: a deleted character is not considered a word separator. This new behavior will impact word finding and spellchecking.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30211 a592a061-630c-0410-9148-cb99ea01b6c8
2009-06-21 14:30:57 +00:00
Jürgen Spitzmüller
f4b8f4528f * src/buffer_funcs.{cpp,h}:
- add optional bool "acceptDirty" to checkAndLoadLyXFiles. 
	   If true, the method doesn't care for buffer dirtiness
* src/Buffer.cpp:
	- when checking for master buffer, do not care if it's dirty
	  (fix bug 5514)

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27774 a592a061-630c-0410-9148-cb99ea01b6c8
2008-12-05 15:49:07 +00:00
André Pönitz
32a53f8d6a move more stuff from buffer_func to Buffer
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27565 a592a061-630c-0410-9148-cb99ea01b6c8
2008-11-16 17:49:00 +00:00
André Pönitz
f8f5a7b28d move updateLables to buffer
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27562 a592a061-630c-0410-9148-cb99ea01b6c8
2008-11-16 16:43:49 +00:00
André Pönitz
f1cba8ff64 more latin1..utf8 schanges. all of src/* should be utf8 now
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@27425 a592a061-630c-0410-9148-cb99ea01b6c8
2008-11-14 15:58:50 +00:00
Stefan Schimanski
520b760891 * make sure that the reference cache, buffer_ pointers and macros are updated
in child documents.

  Fixes:
    http://bugzilla.lyx.org/show_bug.cgi?id=5153
    http://bugzilla.lyx.org/show_bug.cgi?id=5032
    http://bugzilla.lyx.org/show_bug.cgi?id=5159

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@26137 a592a061-630c-0410-9148-cb99ea01b6c8
2008-08-13 10:36:43 +00:00
Abdelrazak Younes
4065e2b2c4 this call to setBuffer() is now not necessary.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25979 a592a061-630c-0410-9148-cb99ea01b6c8
2008-07-29 13:33:50 +00:00
Abdelrazak Younes
ff80da000e Fix http://bugzilla.lyx.org/show_bug.cgi?id=5097 with a hammer. The correct fix would be to call setBuffer() inside pasteSelectionHelper() only for those inserted paragraphs.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25977 a592a061-630c-0410-9148-cb99ea01b6c8
2008-07-29 13:15:28 +00:00
Abdelrazak Younes
d7a30a2ea1 This code is not valid anymore.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25975 a592a061-630c-0410-9148-cb99ea01b6c8
2008-07-29 12:19:42 +00:00
Abdelrazak Younes
d56faa70c4 BufferList::getBuffer(): migrate to FileName.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25958 a592a061-630c-0410-9148-cb99ea01b6c8
2008-07-29 08:16:09 +00:00
Abdelrazak Younes
5ac9db6dfc First step toward fixing http://bugzilla.lyx.org/show_bug.cgi?id=3243
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25955 a592a061-630c-0410-9148-cb99ea01b6c8
2008-07-29 07:53:08 +00:00
Abdelrazak Younes
4bc7feaa96 * Inset: ensure that the Buffer pointer is not copied. This was the cause of very weird bugs with copy and paste within table.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25837 a592a061-630c-0410-9148-cb99ea01b6c8
2008-07-23 12:13:41 +00:00
Abdelrazak Younes
641ae02e37 Delay the Toc update of child documents until we update the master one.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24868 a592a061-630c-0410-9148-cb99ea01b6c8
2008-05-20 12:58:54 +00:00
Abdelrazak Younes
be310e33ca Fix label numbering of child documents.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24865 a592a061-630c-0410-9148-cb99ea01b6c8
2008-05-20 11:25:29 +00:00
Jean-Marc Lasgouttes
9b4a26a252 rename assert.h to lassert.h
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24559 a592a061-630c-0410-9148-cb99ea01b6c8
2008-04-30 08:26:40 +00:00
André Pönitz
7f461f4392 infrastructure for 'graceful asserts'
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24216 a592a061-630c-0410-9148-cb99ea01b6c8
2008-04-10 21:49:34 +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
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
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
81a42b82f4 header
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23434 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-04 12:19:09 +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
Richard Heck
3ab571a70e Header.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23301 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-28 03:53:22 +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
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
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
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
André Pönitz
225bf49cf9 some refactoring.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22890 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-09 10:41:49 +00:00
Richard Heck
6751c8a72f Handle the case where a file exists but is not readable by the current user.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22686 a592a061-630c-0410-9148-cb99ea01b6c8
2008-01-26 20:37:54 +00:00
Pavel Sanda
8b6415f308 Fix bug 4493 - countChars assert.
(No need to backport for 1.5, originated in 'polishing readability' in
http://www.lyx.org/trac/changeset/22519)



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22591 a592a061-630c-0410-9148-cb99ea01b6c8
2008-01-15 22:30:19 +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
André Pönitz
f925113312 cosmetics
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22525 a592a061-630c-0410-9148-cb99ea01b6c8
2008-01-12 16:34:02 +00:00
Pavel Sanda
eb0f59a816 Add temp vars to countChar.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22519 a592a061-630c-0410-9148-cb99ea01b6c8
2008-01-12 13:34:10 +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
Stefan Schimanski
36dbec4506 * Lazy MathData to avoid unneeded interpretation of macro definitions
* DocIterator as MacroPosition
* Iterative search for macro in scope until a visible one is found.
This include the ability to resolve macro inside nested text insets.
* Speed up macro lookups by factor 2: only getMacro(name) call, no
further hasMacro(name) call before
* Both way child/master support
* Correct macro scope for multi-paragraph environments
* Correct macro scope for multi-depth-paragraphs
* Buffer::updateMacros made const
* Update macros when loaded (of master and child)
* Do not remove too many braces when unfolding a macro. This could
lead to a data loss because the relationship between arguments of
macros can be mixed up if nested macros are unfold at once.
* Reduce dependencies to MetricsInfo in MathMacro   
* Update macros when needed. Normally it's done just before doing
metrics. But in cases without a brace around some constructs (like
\left(bla\right)) there is some help needed.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22241 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-21 20:42:46 +00:00
Abdelrazak Younes
1447a7bf98 Now that exceptions are allowed, handle gracefully the case where a Buffer temp directory could not be created. As a bonus, the user will get an informative message.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22196 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-17 18:37:13 +00:00
Abdelrazak Younes
e7bb71ff4e header cleanup.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22178 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-16 22:09:28 +00:00
Abdelrazak Younes
9abb7db468 getting rid of superfluous std:: statements.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22104 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-12 19:28:07 +00:00
Abdelrazak Younes
b89cc942eb 'using namespace lyx::support' instead of 'using support::xxx'
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22103 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-12 18:57:56 +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
Abdelrazak Younes
ac08e89095 Sanitize the way Buffers are saved, renamed and closed.
* LyXFunc: Transfer and simplify LFUN_BUFFER_WRITE, LFUN_BUFFER_WRITE_AS  and LFUN_BUFFER_WRITE_ALL to GuiView.

* BufferList: Transfer quitWriteAll() and close() to GuiView.

* Buffer: Transfer writeAs() and menuWrite() functionalities to GuiView.

* LyXView::closeBuffer(): new pure virtual method.




git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21960 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-04 22:21:25 +00:00
Abdelrazak Younes
f8b7c56580 * Buffer:
- tocBackend(), errorList(), texrow(), etc: now const.
- masterBuffer(): get rid of non const access.
- setParent(): set parent Buffer, replace setParentName()
- parent(), resetChildDocuments(): new.

* InsetInclude.{h,cpp}: new resetParentBuffer() method.





git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21879 a592a061-630c-0410-9148-cb99ea01b6c8
2007-11-30 17:41:27 +00:00
André Pönitz
9d0ea8aeff Move debug.{cpp,h}, Messages.{cpp,h} and gettext.{cpp,h} to support/.
Now support/* should have no dependencies on src/* anymore.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21851 a592a061-630c-0410-9148-cb99ea01b6c8
2007-11-29 07:04:28 +00:00
Abdelrazak Younes
f07105d0e5 * FileName:
- removeFile(): replace unlink
- copyTo(): add 'overwrite' parameter.

* getcwd.cpp: simplify.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21843 a592a061-630c-0410-9148-cb99ea01b6c8
2007-11-28 09:01:49 +00:00
André Pönitz
d95451ae5c s/isFileReadable/isReadableFile;
introduce isReadableDirectory
replace isReadable by either isReadableFile or isReadableDirectory
remove isReadable


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21769 a592a061-630c-0410-9148-cb99ea01b6c8
2007-11-25 11:18:16 +00:00
Enrico Forestieri
6820b61afa Fix some other thinkos in r21048
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21757 a592a061-630c-0410-9148-cb99ea01b6c8
2007-11-24 01:34:46 +00:00
André Pönitz
f625dd7ea0 cosmetics
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21593 a592a061-630c-0410-9148-cb99ea01b6c8
2007-11-13 23:50:28 +00:00
André Pönitz
cf7b238479 more use of support::FileName.
Would be nice if people tested read/write, and Bo perhaps the 'embedded'
feature?



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@21492 a592a061-630c-0410-9148-cb99ea01b6c8
2007-11-07 19:52:11 +00:00