]> git.lyx.org Git - features.git/commit
Fix bug 4037 and related problems. The patch has been cleaned up a bit
authorRichard Heck <rgheck@comcast.net>
Tue, 12 Feb 2008 17:31:07 +0000 (17:31 +0000)
committerRichard Heck <rgheck@comcast.net>
Tue, 12 Feb 2008 17:31:07 +0000 (17:31 +0000)
commit040f3431e7a2350806594319704ff97a0284e9c1
treefef469156537abc30221c50de05eed4005bcef78
parent969a998f8bbd3ba56a1d71aa1e40a0aaac6f3429
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
26 files changed:
src/BufferView.cpp
src/CutAndPaste.cpp
src/Paragraph.cpp
src/Paragraph.h
src/Text.cpp
src/Text3.cpp
src/TextClass.cpp
src/TextClass.h
src/TextMetrics.cpp
src/frontends/qt4/GuiToolbar.cpp
src/frontends/qt4/GuiToolbar.h
src/insets/Inset.h
src/insets/InsetBox.cpp
src/insets/InsetBox.h
src/insets/InsetCaption.cpp
src/insets/InsetCaption.h
src/insets/InsetCollapsable.cpp
src/insets/InsetCollapsable.h
src/insets/InsetERT.cpp
src/insets/InsetERT.h
src/insets/InsetFlex.h
src/insets/InsetTabular.cpp
src/insets/InsetTabular.h
src/insets/InsetText.cpp
src/output_latex.cpp
src/paragraph_funcs.cpp