Commit Graph

154 Commits

Author SHA1 Message Date
Richard Heck
8a64579d9c More cache fixing. Similar fix as for InsetBibtex, and I've renamed the key routine.
Unfortunately, we can't do a one-short fix for InsetCommand, requiring that it take
a Buffer & in the constructor, due to problems in mathed, specifically, here:
void InsetMathHull::label(row_type row, docstring const & label)
{
...
label_[row] = new InsetLabel(p);
if (buffer_)
label_[row]->setBuffer(buffer());
}
If InsetLabel has to have a Buffer, then buffer_ has to be set, which means InsetMathHull needs a Buffer. But then truckloads of these are created in Parser, where we don't really seem to have access to a Buffer.



git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25137 a592a061-630c-0410-9148-cb99ea01b6c8
2008-06-05 06:55:34 +00:00
Enrico Forestieri
a694de895e Fix bug 3938
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@25028 a592a061-630c-0410-9148-cb99ea01b6c8
2008-05-31 20:54:50 +00:00
Abdelrazak Younes
0c6940f5ca Fix bug http://bugzilla.lyx.org/show_bug.cgi?id=4650
This bug dates back to my cleanup of the Paragraph class; amazing that nobody noticed it before.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24891 a592a061-630c-0410-9148-cb99ea01b6c8
2008-05-22 22:04:38 +00:00
Abdelrazak Younes
eb28cb8755 Unify Paragraph::asString() methods.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24882 a592a061-630c-0410-9148-cb99ea01b6c8
2008-05-22 14:01:33 +00:00
Abdelrazak Younes
5398dce8ae forward port rev 24877. Even if trunk is not affected by 4857, it is safer to only display printable characters in the toc items and not go inside insets.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24878 a592a061-630c-0410-9148-cb99ea01b6c8
2008-05-22 10:14:20 +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
André Pönitz
aac50f83e5 cosmetics, maily s/NULL/0/g as hinted by Joost
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24160 a592a061-630c-0410-9148-cb99ea01b6c8
2008-04-07 20:43:02 +00:00
André Pönitz
6b28f08ff2 cosmetics
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23891 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-21 21:47:37 +00:00
Richard Heck
b922cfd3b3 Another attempt at 2178. This is a "minimal" patch designed to fix the bug with the minimum amount of new code. A better fix, suggested by Andre, would merge InsetTableCell and CellData into one class, in which case InsetTableCell::cell_data_ can be removed. A definite plus. I'll do that later if this works. But let's get it right first.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23879 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-21 17:45:14 +00:00
Richard Heck
f2cd36e8ad Change the signature of forceEmptyLayout(), so that we can pass a cell index with it. We'll need this to get tables right.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23829 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-19 16:21:33 +00:00
Jürgen Spitzmüller
f2e8cd3cd9 *** File Format Change: UI and enhancement for InsetSpace ***
* src/insets/InsetSpace.{cpp,h}:
	- merge in HFill inset, add support for dotfill, hrulefill,
	  hspace and hspace*
* src/insets/InsetHFill.{cpp,h}:
	- remove

* src/frontends/qt4/GuiHSpace.{cpp,h}:
* src/frontends/qt4/ui/HSpaceUi.ui:
* src/frontends/qt4/GuiView:
	- new GUI for Space insets.

* src/insets/Inset.{cpp,h}:
* src/insets/InsetCode.h:
* src/insets/InsetCollapsable.cpp:
* src/insets/InsetCommandParams.cpp:
	- remove HFILL_CODE and LFUN_HFILL_INSERT, add SPACE_CODE where necessary,
	  new Inset member isStretchableSpace() to indicate HFill and friends.

* Buffer.cpp: 
	- increase format to 319
* lib/lyx2lyx/LyX.py:
* lib/lyx2lyx/lyx_1_6.py:
	- conversion/reversion routines
* development/FORMAT:
	- document file format change

* src/Makefile.am:
* src/frontends/qt4/Makefile.am:
* development/scons/scons_manifest.py:
	- deal with UI changes.

* src/LyXAction.cpp:
	- remove LFUN_HFILL_INSERT

* src/LyXFunc.cpp:
	- handle space dialog.

* src/factory.cpp:
* src/Paragraph.cpp (isHFill):
* src/Text.cpp:
* src/Text3.cpp:
* src/TextMetrics.cpp:
	- adapt to changes

* lib/ui/classic.ui:
* lib/ui/stdmenus.ui:
	- add HSpace dialog, remove HFill.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23787 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-17 09:23:43 +00:00
Richard Heck
0a5b3e9a36 More intelligible comment.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23757 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-15 03:21:17 +00:00
Richard Heck
fc1dc6082e Still trying to fix bug 2178. Will this do it? I do hope so. (Problem reported by Dov.)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23756 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-15 03:19:45 +00:00
Richard Heck
7a5576c13b Try again to fix bug 2178.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23662 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-11 15:16:58 +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
2222b3f367 Did not need to change this.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23529 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-07 01:21:03 +00:00
Richard Heck
5166d49d2d Abdel is right.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23525 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-06 22:06:24 +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
Richard Heck
f401ce5d29 Changes LayoutList from a vector<LayoutPtr> to a vector<Layout>.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23519 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-06 20:01:30 +00:00
Stefan Schimanski
cd63c1380b * remove some garbage from the "buffer in inset" change
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23453 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-04 14:58:10 +00:00
Richard Heck
77f2d2e7d2 Fix types.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23305 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-28 07:18:54 +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
Stefan Schimanski
249e6b7ac0 * update the words of a paragraph when the cursor leaves.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23260 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-26 19:20:12 +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
Richard Heck
c7afa2d658 More cleanup from Andre.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23194 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-24 15:44:11 +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
0fb8f3fba1 mostly s/Paragraph::layout(...)/Paragraph::setLayout(...)/
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23159 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-23 16:45:38 +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
Abdelrazak Younes
860547ef1c cosmetics
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23070 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-20 10:21:00 +00:00
Abdelrazak Younes
2bf1c09376 header cleanup
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23049 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-18 07:14:42 +00:00
Richard Heck
040f3431e7 Fix bug 4037 and related problems. The patch has been cleaned up a bit
from the one posted to the list.

The basic idea has two parts. First, we hard code an "empty layout"
(called PlainLayout, for want of a better name) in TextClass and read it
before doing anything else. It can therefore be customized by classes,
if they want---say, to make it left-aligned. Second, InsetText's are
divided into three types: (i) normal ones, that use the "default" layout
defined by the text class; (ii) highly restrictive ones, such as ERT and
(not quite an inset) table cells, which demand the empty layout; (iii)
middling ones, which default to an empty layout and use the empty layout
in place of the default. (This is so we don't get the same problem we
had with ERT in e.g. footnotes.) The type of inset is signaled by new
methods InsetText::forceEmptyLayout() and InsetText::useEmptyLayout().
(The latter might better be called: useEmptyLayoutInsteadOfDefault(),
but that's silly.) The old InsetText::forceDefaultParagraphs() has been
split into these, plus a new method InsetText::allowParagraphCustomization(). 
A lot of the changes just adapt to this change.

The other big change is in GuiToolbar: We want to show LyXDefault and
the "default" layout only when they're active.

There are a handful of places where I'm not entirely sure whether we
should be using forceEmptyLayout or !allowParagraphCustomization() or
both. The InsetCaption is one of these. These places, and some others,
are marked with FIXMEs, so I'd appreciate it if people would search
through the patch and let me know whether these need changing. If they
don't, the FIXMEs can be deleted.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22966 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-12 17:31:07 +00:00
Abdelrazak Younes
b546fff555 warning fix.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22939 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-11 08:31:14 +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
Jean-Marc Lasgouttes
11bea5a763 Use a set<string> instead of a vecctor<string> for list of features. This
allows to simplify the code to some extent.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22734 a592a061-630c-0410-9148-cb99ea01b6c8
2008-02-01 15:12:04 +00:00
Jean-Marc Lasgouttes
17e1b2b59d revert erroneous commit
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22696 a592a061-630c-0410-9148-cb99ea01b6c8
2008-01-28 11:42:54 +00:00
Jean-Marc Lasgouttes
21ff30cc38 * src/Text.cpp (changeCase): do not set the selection if it was not
already set.

	* src/Paragraph.cpp (changeCase): make sure to update the selection 
	as needed.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22695 a592a061-630c-0410-9148-cb99ea01b6c8
2008-01-28 10:50:24 +00:00
Abdelrazak Younes
12ce8e82cf simplify ucs4 to utf8 conversion.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22577 a592a061-630c-0410-9148-cb99ea01b6c8
2008-01-14 23:44:05 +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
96c21a6ca3 cosmetics
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22527 a592a061-630c-0410-9148-cb99ea01b6c8
2008-01-12 16:44:35 +00:00
Jürgen Spitzmüller
9e5eebc14c *** Requires tag for classes, layouts and custom insets ***
* src/TextClass{cpp,h}:
	- implement Requires tag for class and InsetLayout.
* src/Layout.{cpp,h}:
	- implement Requires tag for layouts.
	- increase layouts format to 6.
* src/Paragraph.cpp:
	- request required features for paragraph layouts.
* src/LaTeXFeatures.cpp:
	- add some packages needed by modules.
	- remove Preamble method for InsetLayout. This is now done
	  in InsetFlex::validate.
* src/BufferParams.cpp (validate):
	- request required features for the class.
* src/insets/InsetLayout.h:
	- new member "requires".
* src/insets/InsetFlex.{cpp,h}:
	- implement validate method and request required features and preamble snippets.

* lib/layouts/*.{layout,module,inc}:
	- increase layouts format to 6.
	- use Requires tags in some modules (more can be done later).

* lib/doc/Customization.lyx:
	- document Requires tag.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22414 a592a061-630c-0410-9148-cb99ea01b6c8
2008-01-07 16:59:10 +00:00
Enrico Forestieri
62d5000103 Use a less verbose form for warnings in the view source window
and correctly match strings in order to coalesce translations.


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22337 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-30 21:28:38 +00:00
Jürgen Spitzmüller
09f09e2121 * src/Buffer.cpp:
- better translatable error message for uncodable chars, now also
	  displaying the code point value.
* src/Paragraph.cpp:
	- do not throw in View Source mode, but mark up uncodable chars (fix bug 4437).
* src/frontends/qt4/LaTeXHighlighter.{cpp,h}:
	- highlight LyX warnings.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22294 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-24 13:55:01 +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
Bo Peng
837f7f2b6b Use ErrorList to handle encoding error
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22208 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-18 17:51:20 +00:00
Jürgen Spitzmüller
908a119973 * src/output_latex.{cpp,h}:
* src/Font.cpp:
* src/Paragraph.cpp:
	- simplify switchEncoding.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@22184 a592a061-630c-0410-9148-cb99ea01b6c8
2007-12-17 10:53:38 +00:00