The most important change in this changeset is that InsetCollapsable::getLayout

is commented out, so that the documentclass is queried every time instead of
using the layout_ cache. For now I have kept the setLayout calls, but they are 
inoperant. 

Other changes:
 * remove non-const usePlainLayout methods
 * move InsetCollapsable::allowSpellCheck and allowMultiPar to InsetText
 * move InsetCollapsable::isFreespacing and forceLTR to Inset

Freespacing support could be moved to insettext, but I have to check who 
uses it. 


git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30549 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Jean-Marc Lasgouttes 2009-07-13 15:47:40 +00:00
parent e6f922009f
commit d0cb2cc0b7
6 changed files with 10 additions and 28 deletions

View File

@ -205,12 +205,12 @@ public:
virtual void cursorPos(BufferView const & bv,
CursorSlice const & sl, bool boundary, int & x, int & y) const;
///
virtual bool isFreeSpacing() const { return false; }
///
virtual bool allowEmpty() const { return false; }
/// Allow multiple blanks
virtual bool isFreeSpacing() const { return getLayout().isFreeSpacing(); }
/// Don't eliminate empty paragraphs
virtual bool allowEmpty() const { return getLayout().isKeepEmpty(); }
/// Force inset into LTR environment if surroundings are RTL?
virtual bool forceLTR() const { return false; }
virtual bool forceLTR() const { return getLayout().isForceLtr(); }
/// Where should we go when we press the up or down cursor key?
virtual bool idxUpDown(Cursor & cur, bool up) const;

View File

@ -91,8 +91,6 @@ private:
InsetBranchParams const & params() const { return params_; }
///
void setParams(InsetBranchParams const & params) { params_ = params; }
///
virtual bool usePlainLayout() { return false; }
/** \returns true if params_.branch is listed as 'selected' in
\c buffer. This handles the case of child documents.

View File

@ -694,12 +694,6 @@ void InsetCollapsable::doDispatch(Cursor & cur, FuncRequest & cmd)
}
bool InsetCollapsable::allowMultiPar() const
{
return getLayout().isMultiPar();
}
void InsetCollapsable::resetParagraphsFont()
{
Font font(inherit_font, buffer().params().language);

View File

@ -44,16 +44,16 @@ public:
docstring toolTip(BufferView const & bv, int x, int y) const;
///
docstring name() const { return from_ascii("Collapsable"); }
#if 0
///
InsetLayout const & getLayout() const { return *layout_; }
#endif
///
void setLayout();
/// (Re-)set the character style parameters from \p tc according
/// to name()
void setLayout(DocumentClass const * const tc);
///
virtual bool usePlainLayout() { return true; }
///
void read(Lexer &);
///
void write(std::ostream &) const;
@ -125,8 +125,6 @@ public:
Geometry geometry(BufferView const & bv) const;
/// Returns the geometry disregarding auto_open_
Geometry geometry() const;
/// Allow spellchecking, except for insets with latex_language
bool allowSpellCheck() const { return !forceLTR(); }
///
bool allowMultiPar() const;
///
@ -152,12 +150,6 @@ public:
///
InsetCode lyxCode() const { return COLLAPSABLE_CODE; }
/// Allow multiple blanks
virtual bool isFreeSpacing() const { return getLayout().isFreeSpacing(); }
/// Don't eliminate empty paragraphs
virtual bool allowEmpty() const { return getLayout().isKeepEmpty(); }
/// Force inset into LTR environment if surroundings are RTL?
virtual bool forceLTR() const { return getLayout().isForceLtr(); }
///
virtual bool usePlainLayout() const { return true; }
/// Is this inset's layout defined in the document's textclass?

View File

@ -815,8 +815,6 @@ public:
///
virtual bool forcePlainLayout(idx_type cell = 0) const;
///
virtual bool usePlainLayout() { return true; }
///
void addPreview(graphics::PreviewLoader &) const;
/// lock cell with given index

View File

@ -135,12 +135,12 @@ public:
ParagraphList const & paragraphs() const;
///
bool insetAllowed(InsetCode) const { return true; }
///
bool allowSpellCheck() const { return true; }
/// Allow spellchecking, except for insets with latex_language
bool allowSpellCheck() const { return !forceLTR(); }
///
virtual bool isMacroScope() const { return false; }
///
virtual bool allowMultiPar() const { return true; }
virtual bool allowMultiPar() const { return getLayout().isMultiPar(); }
/// Update the counters of this inset and of its contents
virtual void updateLabels(ParIterator const &);