From: Jean-Marc Lasgouttes Date: Mon, 13 Jul 2009 15:47:40 +0000 (+0000) Subject: The most important change in this changeset is that InsetCollapsable::getLayout X-Git-Tag: 2.0.0~6041 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=d0cb2cc0b7820e500d5d136ccad492ec36984430;p=lyx.git 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 --- diff --git a/src/insets/Inset.h b/src/insets/Inset.h index 820102a257..b130f6d8d5 100644 --- a/src/insets/Inset.h +++ b/src/insets/Inset.h @@ -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; diff --git a/src/insets/InsetBranch.h b/src/insets/InsetBranch.h index 0c42e8fbe6..9acbb8de9b 100644 --- a/src/insets/InsetBranch.h +++ b/src/insets/InsetBranch.h @@ -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. diff --git a/src/insets/InsetCollapsable.cpp b/src/insets/InsetCollapsable.cpp index 930c171df7..e35ad10cba 100644 --- a/src/insets/InsetCollapsable.cpp +++ b/src/insets/InsetCollapsable.cpp @@ -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); diff --git a/src/insets/InsetCollapsable.h b/src/insets/InsetCollapsable.h index 3cb7aaad93..e69fa7b957 100644 --- a/src/insets/InsetCollapsable.h +++ b/src/insets/InsetCollapsable.h @@ -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? diff --git a/src/insets/InsetTabular.h b/src/insets/InsetTabular.h index 072349b9b5..4470d02dec 100644 --- a/src/insets/InsetTabular.h +++ b/src/insets/InsetTabular.h @@ -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 diff --git a/src/insets/InsetText.h b/src/insets/InsetText.h index 0853144c9b..d133d8fb0f 100644 --- a/src/insets/InsetText.h +++ b/src/insets/InsetText.h @@ -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 &);