]> git.lyx.org Git - features.git/commitdiff
The most important change in this changeset is that InsetCollapsable::getLayout
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 13 Jul 2009 15:47:40 +0000 (15:47 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 13 Jul 2009 15:47:40 +0000 (15:47 +0000)
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

src/insets/Inset.h
src/insets/InsetBranch.h
src/insets/InsetCollapsable.cpp
src/insets/InsetCollapsable.h
src/insets/InsetTabular.h
src/insets/InsetText.h

index 820102a257d54ce9cd740d901b041b1ffb8761d3..b130f6d8d5f5681a8f442909ec8e943685b60811 100644 (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;
index 0c42e8fbe6934c99b1a7708fa4149301bcbb0cba..9acbb8de9bf979b4a72ad1ffcf5cb7d17c2688ea 100644 (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.
index 930c171df71e456f13e64577b1c957a17049d830..e35ad10cba607cfa6b7732c26e00f778432577f1 100644 (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);
index 3cb7aaad937d9db9b8275d92810d45581e5cfffe..e69fa7b95717c68bafe8f128ecaba7c15a0238d9 100644 (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?
index 072349b9b5266437e642f8391554539d2bfc6e05..4470d02dece2ac3fa3dfd65ef5c3581f91a3c144 100644 (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
index 0853144c9b1ff9534e147917a964da53f07cb748..d133d8fb0f4524721072a36ae62f008f84db58ef 100644 (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 &);