]> git.lyx.org Git - features.git/commitdiff
Implement Row::Element::row_flags
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Sun, 11 Jul 2021 22:07:59 +0000 (00:07 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 23 Nov 2021 15:31:29 +0000 (16:31 +0100)
Move the enum definition RowFlags in its own include file, to avoid
loading Inset.h. Document it more thoroughly.

Rename RowAfter to AlwaysBreakAfter.

Add CanBreakInside (rows that can be themselves broken). This allow to
differentiate elements before bodyPos() and allows to remove a
parameter to shortenIfNeeded().

Make the Inset::rowFlags() method return int instead of RowFlags, as
should be done for all the bitwise flags. Remove the hand-made bitwise
operators.

Set R::E::row_flags when creating elements.
* INSET elements use the inset's rowFLags();
* virtual element forbid breaking before them, and inherit the *After
  flags from the previous element of the row;
* STRING elements usr CanBreakInside, except before bodyPos.

More stuff may be added later.

28 files changed:
src/Makefile.am
src/Row.cpp
src/Row.h
src/RowFlags.h [new file with mode: 0644]
src/TextMetrics.cpp
src/insets/Inset.h
src/insets/InsetBibtex.h
src/insets/InsetCaption.h
src/insets/InsetFloatList.h
src/insets/InsetInclude.cpp
src/insets/InsetInclude.h
src/insets/InsetIndex.h
src/insets/InsetListings.cpp
src/insets/InsetListings.h
src/insets/InsetNewline.h
src/insets/InsetNewpage.h
src/insets/InsetNomencl.h
src/insets/InsetSeparator.h
src/insets/InsetSpace.cpp
src/insets/InsetSpace.h
src/insets/InsetSpecialChar.cpp
src/insets/InsetSpecialChar.h
src/insets/InsetTOC.h
src/insets/InsetTabular.cpp
src/insets/InsetTabular.h
src/insets/InsetVSpace.h
src/mathed/InsetMathHull.cpp
src/mathed/InsetMathHull.h

index 31701f2fb154735a9f1b5fb3f19c269fc37b8468..99a0f98ceb16895bb81e23a84b78bf27198a7ddc 100644 (file)
@@ -273,6 +273,7 @@ HEADERFILESCORE = \
        ParIterator.h \
        PDFOptions.h \
        Row.h \
+       RowFlags.h \
        RowPainter.h \
        Server.h \
        ServerSocket.h \
index da2d885eb262970498ea83e3fb2b7daacfc97340..705a147389eec047f4516a0262e24e2936c3e55e 100644 (file)
@@ -135,7 +135,7 @@ pos_type Row::Element::x2pos(int &x) const
 
 Row::Element Row::Element::splitAt(int w, bool force)
 {
-       if (type != STRING)
+       if (type != STRING || !(row_flags & CanBreakInside))
                return Element();
 
        FontMetrics const & fm = theFontMetrics(font);
@@ -145,6 +145,7 @@ Row::Element Row::Element::splitAt(int w, bool force)
                Element ret(STRING, pos + i, font, change);
                ret.str = str.substr(i);
                ret.endpos = ret.pos + ret.str.length();
+               ret.row_flags = row_flags & (CanBreakInside | AfterFlags);
                str.erase(i);
                endpos = pos + i;
                //lyxerr << "breakAt(" << w << ")  Row element Broken at " << x << "(w(str)=" << fm.width(str) << "): e=" << *this << endl;
@@ -378,12 +379,13 @@ void Row::finalizeLast()
 
 
 void Row::add(pos_type const pos, Inset const * ins, Dimension const & dim,
-             Font const & f, Change const & ch)
+              Font const & f, Change const & ch)
 {
        finalizeLast();
        Element e(INSET, pos, f, ch);
        e.inset = ins;
        e.dim = dim;
+       e.row_flags = ins->rowFlags();
        elements_.push_back(e);
        dim_.wid += dim.wid;
        changebar_ |= ins->isChanged();
@@ -391,11 +393,12 @@ void Row::add(pos_type const pos, Inset const * ins, Dimension const & dim,
 
 
 void Row::add(pos_type const pos, char_type const c,
-             Font const & f, Change const & ch)
+              Font const & f, Change const & ch, bool can_break)
 {
        if (!sameString(f, ch)) {
                finalizeLast();
                Element e(STRING, pos, f, ch);
+               e.row_flags = can_break ? CanBreakInside : Inline;
                elements_.push_back(e);
        }
        if (back().str.length() % 30 == 0) {
@@ -420,6 +423,10 @@ void Row::addVirtual(pos_type const pos, docstring const & s,
        e.dim.wid = theFontMetrics(f).width(s);
        dim_.wid += e.dim.wid;
        e.endpos = pos;
+       // Copy after* flags from previous elements, forbid break before element
+       int const prev_row_flags = elements_.empty() ? Inline : elements_.back().row_flags;
+       int const can_inherit = AfterFlags & ~AlwaysBreakAfter;
+       e.row_flags = (prev_row_flags & can_inherit) | NoBreakBefore;
        elements_.push_back(e);
        finalizeLast();
 }
@@ -450,7 +457,7 @@ void Row::pop_back()
 }
 
 
-bool Row::shortenIfNeeded(pos_type const keep, int const w, int const next_width)
+bool Row::shortenIfNeeded(int const w, int const next_width)
 {
        if (empty() || width() <= w)
                return false;
@@ -482,11 +489,10 @@ bool Row::shortenIfNeeded(pos_type const keep, int const w, int const next_width
                // make a copy of the element to work on it.
                Element brk = *cit_brk;
                /* If the current element is an inset that allows breaking row
-                * after itself, and it the row is already short enough after
+                * after itself, and if the row is already short enough after
                 * this inset, then cut right after this element.
                 */
-               if (wid_brk <= w && brk.type == INSET
-                   && brk.inset->rowFlags() & Inset::CanBreakAfter) {
+               if (wid_brk <= w && brk.row_flags & CanBreakAfter) {
                        end_ = brk.endpos;
                        dim_.wid = wid_brk;
                        elements_.erase(cit_brk + 1, end);
@@ -504,10 +510,6 @@ bool Row::shortenIfNeeded(pos_type const keep, int const w, int const next_width
                 * not allowed at the beginning or end of line.
                */
                bool const word_wrap = brk.font.language()->wordWrap();
-               // When there is text before the body part (think description
-               // environment), do not try to break.
-               if (brk.pos < keep)
-                       continue;
                /* We have found a suitable separable element. This is the common case.
                 * Try to break it cleanly (at word boundary) at a length that is both
                 * - less than the available space on the row
index 3048cf1ccf78ef24274e34e562e466756c0fef1d..4fdcee408f05c4401e85c2a5c85f2810c3c34707 100644 (file)
--- a/src/Row.h
+++ b/src/Row.h
@@ -18,6 +18,7 @@
 #include "Changes.h"
 #include "Dimension.h"
 #include "Font.h"
+#include "RowFlags.h"
 
 #include "support/docstring.h"
 #include "support/types.h"
@@ -143,6 +144,8 @@ public:
                Change change;
                // is it possible to add contents to this element?
                bool final = false;
+               // properties with respect to row breaking (made of RowFlag enums)
+               int row_flags = Inline;
 
                friend std::ostream & operator<<(std::ostream & os, Element const & row);
        };
@@ -247,7 +250,7 @@ public:
                 Font const & f, Change const & ch);
        ///
        void add(pos_type pos, char_type const c,
-                Font const & f, Change const & ch);
+                Font const & f, Change const & ch, bool can_break);
        ///
        void addVirtual(pos_type pos, docstring const & s,
                        Font const & f, Change const & ch);
@@ -287,12 +290,11 @@ public:
         * if row width is too large, remove all elements after last
         * separator and update endpos if necessary. If all that
         * remains is a large word, cut it to \param width.
-        * \param body_pos minimum amount of text to keep.
         * \param width maximum width of the row.
         * \param available width on next row.
         * \return true if the row has been shortened.
         */
-       bool shortenIfNeeded(pos_type const body_pos, int const width, int const next_width);
+       bool shortenIfNeeded(int const width, int const next_width);
 
        /**
         * If last element of the row is a string, compute its width
diff --git a/src/RowFlags.h b/src/RowFlags.h
new file mode 100644 (file)
index 0000000..f94f0c6
--- /dev/null
@@ -0,0 +1,57 @@
+// -*- C++ -*-
+/**
+ * \file RowFlags.h
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author Jean-Marc Lasgouttes
+ *
+ * Full author contact details are available in file CREDITS.
+ */
+
+#ifndef ROWFLAGS_H
+#define ROWFLAGS_H
+
+// Do not include anything here
+
+namespace lyx {
+
+/* The list of possible flags, that can be combined.
+ * Some flags that should logically be here (e.g.,
+ * CanBreakBefore), do not exist. This is because the need has not
+ * been identitfied yet.
+ *
+ * Priorities when before/after disagree:
+ *      AlwaysBreak* > NoBreak* > Break* or CanBreak*.
+ */
+enum RowFlags {
+       // Do not break before or after this element, except if really
+       // needed (between NoBreak* and CanBreak*).
+       Inline = 0,
+       // break row before this element if the row is not empty
+       BreakBefore = 1 << 0,
+       // Avoid breaking row before this element
+       NoBreakBefore = 1 << 1,
+       // force new (maybe empty) row after this element
+       AlwaysBreakAfter = 1 << 2,
+       // break row after this element if there are more elements
+       BreakAfter = 1 << 3,
+       // break row whenever needed after this element
+       CanBreakAfter = 1 << 4,
+       // Avoid breaking row after this element
+       NoBreakAfter = 1 << 5,
+       // The contents of the row may be broken in two (e.g. string)
+       CanBreakInside = 1 << 6,
+       // specify an alignment (left, right) for a display element
+       // (default is center)
+       AlignLeft = 1 << 7,
+       AlignRight = 1 << 8,
+       // A display element breaks row at both ends
+       Display = BreakBefore | BreakAfter,
+       // Flags that concern breaking after element
+       AfterFlags = AlwaysBreakAfter | BreakAfter | CanBreakAfter | NoBreakAfter
+};
+
+} // namespace lyx
+
+#endif
index f14fe1fb2b0e403d8edfda06252f9015d80bec87..cc380cc1932ccb4d1c2ce7183dc3551bf408a2e4 100644 (file)
@@ -634,10 +634,10 @@ LyXAlignment TextMetrics::getAlign(Paragraph const & par, Row const & row) const
 
        // Display-style insets should always be on a centered row
        if (Inset const * inset = par.getInset(row.pos())) {
-               if (inset->rowFlags() & Inset::Display) {
-                       if (inset->rowFlags() & Inset::AlignLeft)
+               if (inset->rowFlags() & Display) {
+                       if (inset->rowFlags() & AlignLeft)
                                align = LYX_ALIGN_BLOCK;
-                       else if (inset->rowFlags() & Inset::AlignRight)
+                       else if (inset->rowFlags() & AlignRight)
                                align = LYX_ALIGN_RIGHT;
                        else
                                align = LYX_ALIGN_CENTER;
@@ -928,7 +928,7 @@ Row TextMetrics::tokenizeParagraph(pit_type const pit) const
                        row.addSpace(i, add, *fi, par.lookupChange(i));
                } else if (c == '\t')
                        row.addSpace(i, theFontMetrics(*fi).width(from_ascii("    ")),
-                                    *fi, par.lookupChange(i));
+                                    *fi, par.lookupChange(i));
                else if (c == 0x2028 || c == 0x2029) {
                        /**
                         * U+2028 LINE SEPARATOR
@@ -944,9 +944,10 @@ Row TextMetrics::tokenizeParagraph(pit_type const pit) const
                        // â¤¶ U+2936 ARROW POINTING DOWNWARDS THEN CURVING LEFTWARDS
                        // Â¶ U+00B6 PILCROW SIGN
                        char_type const screen_char = (c == 0x2028) ? 0x2936 : 0x00B6;
-                       row.add(i, screen_char, *fi, par.lookupChange(i));
+                       row.add(i, screen_char, *fi, par.lookupChange(i), i >= body_pos);
                } else
-                       row.add(i, c, *fi, par.lookupChange(i));
+                       // row elements before body are unbreakable
+                       row.add(i, c, *fi, par.lookupChange(i), i >= body_pos);
 
                // add inline completion width
                // draw logically behind the previous character
@@ -1080,9 +1081,9 @@ bool TextMetrics::breakRow(Row & row, int const right_margin) const
                        // â¤¶ U+2936 ARROW POINTING DOWNWARDS THEN CURVING LEFTWARDS
                        // Â¶ U+00B6 PILCROW SIGN
                        char_type const screen_char = (c == 0x2028) ? 0x2936 : 0x00B6;
-                       row.add(i, screen_char, *fi, par.lookupChange(i));
+                       row.add(i, screen_char, *fi, par.lookupChange(i), i >= body_pos);
                } else
-                       row.add(i, c, *fi, par.lookupChange(i));
+                       row.add(i, c, *fi, par.lookupChange(i), i >= body_pos);
 
                // add inline completion width
                // draw logically behind the previous character
@@ -1105,8 +1106,8 @@ bool TextMetrics::breakRow(Row & row, int const right_margin) const
                // - After an inset with BreakAfter
                Inset const * prevInset = !row.empty() ? row.back().inset : 0;
                Inset const * nextInset = (i + 1 < end) ? par.getInset(i + 1) : 0;
-               if ((nextInset && nextInset->rowFlags() & Inset::BreakBefore)
-                   || (prevInset && prevInset->rowFlags() & Inset::BreakAfter)) {
+               if ((nextInset && nextInset->rowFlags() & BreakBefore)
+                   || (prevInset && prevInset->rowFlags() & BreakAfter)) {
                        row.flushed(true);
                        // Force a row creation after this one if it is ended by
                        // an inset that either
@@ -1114,8 +1115,8 @@ bool TextMetrics::breakRow(Row & row, int const right_margin) const
                        // - or (1) did force the row breaking, (2) is at end of
                        //   paragraph and (3) the said paragraph has an end label.
                        need_new_row = prevInset &&
-                               (prevInset->rowFlags() & Inset::RowAfter
-                                || (prevInset->rowFlags() & Inset::BreakAfter && i + 1 == end
+                               (prevInset->rowFlags() & AlwaysBreakAfter
+                                || (prevInset->rowFlags() & BreakAfter && i + 1 == end
                                     && text_->getEndLabel(row.pit()) != END_LABEL_NO_LABEL));
                        ++i;
                        break;
@@ -1156,7 +1157,7 @@ bool TextMetrics::breakRow(Row & row, int const right_margin) const
        int const next_width = max_width_ - leftMargin(row.pit(), row.endpos())
                - rightMargin(row.pit());
 
-       if (row.shortenIfNeeded(body_pos, width, next_width))
+       if (row.shortenIfNeeded(width, next_width))
                row.flushed(false);
        row.right_boundary(!row.empty() && row.endpos() < end
                           && row.back().endpos == row.endpos());
@@ -1900,7 +1901,7 @@ int TextMetrics::leftMargin(pit_type const pit, pos_type const pos) const
            // display style insets do not need indentation
            && !(!par.empty()
                 && par.isInset(0)
-                && par.getInset(0)->rowFlags() & Inset::Display)
+                && par.getInset(0)->rowFlags() & Display)
            && (!(tclass.isDefaultLayout(par.layout())
                || tclass.isPlainLayout(par.layout()))
                || buffer.params().paragraph_separation
index af24423e4efd5c4e45234c73fbf4fdb33736d8b0..372b95a6dfb387099bd500100f310d4c2592ca53 100644 (file)
@@ -20,6 +20,7 @@
 #include "LayoutEnums.h"
 #include "OutputEnums.h"
 #include "OutputParams.h"
+#include "RowFlags.h"
 
 #include "support/docstring.h"
 #include "support/strfwd.h"
@@ -478,26 +479,8 @@ public:
 
        virtual CtObject getCtObject(OutputParams const &) const;
 
-       enum RowFlags {
-               Inline = 0,
-               // break row before this inset
-               BreakBefore = 1 << 0,
-               // break row after this inset
-               BreakAfter = 1 << 1,
-               // it is possible to break after this inset
-               CanBreakAfter = 1 << 2,
-               // force new (maybe empty) row after this inset
-               RowAfter = 1 << 3,
-               // specify an alignment (left, right) for a display inset
-               // (default is center)
-               AlignLeft = 1 << 4,
-               AlignRight = 1 << 5,
-               // A display inset breaks row at both ends
-               Display = BreakBefore | BreakAfter
-       };
-
-       /// How should this inset be displayed in its row?
-       virtual RowFlags rowFlags() const { return Inline; }
+       // properties with respect to row breaking (made of RowFLag enums)
+       virtual int rowFlags() const { return Inline; }
        /// indentation before this inset (only needed for displayed hull insets with fleqn option)
        virtual int indent(BufferView const &) const { return 0; }
        ///
@@ -655,20 +638,6 @@ protected:
 };
 
 
-inline Inset::RowFlags operator|(Inset::RowFlags const d1,
-                                    Inset::RowFlags const d2)
-{
-       return static_cast<Inset::RowFlags>(int(d1) | int(d2));
-}
-
-
-inline Inset::RowFlags operator&(Inset::RowFlags const d1,
-                                    Inset::RowFlags const d2)
-{
-       return static_cast<Inset::RowFlags>(int(d1) & int(d2));
-}
-
-
 } // namespace lyx
 
 #endif
index be7659f223cf9dbbf18fecfc0c9dfb68ea9daa11..55451f564186da57ba64ecd804f1b17f136c731a 100644 (file)
@@ -47,7 +47,7 @@ public:
        ///
        InsetCode lyxCode() const override { return BIBTEX_CODE; }
        ///
-       RowFlags rowFlags() const override { return Display; }
+       int rowFlags() const override { return Display; }
        ///
        void latex(otexstream &, OutputParams const &) const override;
        ///
index ed6dbbb50bfbffd01f75e485b7ef2d5ac7339cee..c1bcd17b6b44e5111f14e0c4adb27ec06b9ec64b 100644 (file)
@@ -40,7 +40,7 @@ private:
        ///
        void write(std::ostream & os) const override;
        ///
-       RowFlags rowFlags() const override { return Display; }
+       int rowFlags() const override { return Display; }
        ///
        bool neverIndent() const override { return true; }
        ///
index 489b0fea98b0e939355a0da8bc6accdf7de68f2d..ce6caa577097bd67c563e8eeb8975ab6a352704c 100644 (file)
@@ -32,7 +32,7 @@ public:
        ///
        InsetCode lyxCode() const override { return FLOAT_LIST_CODE; }
        ///
-       RowFlags rowFlags() const override { return Display; }
+       int rowFlags() const override { return Display; }
        ///
        void write(std::ostream &) const override;
        ///
index aeae2fb17d8cf1a1ddfe0998c34d6ba703975300..10ea52bfca4381cfba56c9890d4479959c220d4d 100644 (file)
@@ -1251,7 +1251,7 @@ string InsetInclude::contextMenuName() const
 }
 
 
-Inset::RowFlags InsetInclude::rowFlags() const
+int InsetInclude::rowFlags() const
 {
        return type(params()) == INPUT ? Inline : Display;
 }
index 8585222070ccfeaf2506249dbc1f732ce3100019..d62c751abe785bd57754cd89f2e69cf770f36ebf 100644 (file)
@@ -75,7 +75,7 @@ public:
        ///
        void draw(PainterInfo & pi, int x, int y) const override;
        ///
-       RowFlags rowFlags() const override;
+       int rowFlags() const override;
        ///
        InsetCode lyxCode() const override { return INCLUDE_CODE; }
        ///
index bddb8ba380edb96667fb95f3e3dd82133c7f2d73..b064cc700180a769ebfd1182794c8cd6399925e9 100644 (file)
@@ -119,7 +119,7 @@ public:
        ///
        bool hasSettings() const override;
        ///
-       RowFlags rowFlags() const override { return Display; }
+       int rowFlags() const override { return Display; }
        //@}
 
        /// \name Static public methods obligated for InsetCommand derived classes
index e8fe8b109378adf4169cc8b82b9557f47b823841..57df06e7360b06998644b497e99494f979389fb6 100644 (file)
@@ -64,7 +64,7 @@ InsetListings::~InsetListings()
 }
 
 
-Inset::RowFlags InsetListings::rowFlags() const
+int InsetListings::rowFlags() const
 {
        return params().isInline() || params().isFloat() ? Inline : Display | AlignLeft;
 }
index 41be4394ceb9a8c9431946c11b993395e6dbdebc..9d4eeb1d449029bbffdb28b6cac1324101479fdc 100644 (file)
@@ -46,7 +46,7 @@ private:
        ///
        InsetCode lyxCode() const override { return LISTINGS_CODE; }
        /// lstinline is inlined, normal listing is displayed
-       RowFlags rowFlags() const override;
+       int rowFlags() const override;
        ///
        docstring layoutName() const override;
        ///
index 3d540a8618467bccda3074d48d092b87d18bebe0..1ef0ae52fbd5c43ca26bf98f98fd07374aa37eea 100644 (file)
@@ -47,7 +47,7 @@ public:
        explicit InsetNewline(InsetNewlineParams par) : Inset(0)
        { params_.kind = par.kind; }
        ///
-       RowFlags rowFlags() const override { return BreakAfter | RowAfter; }
+       int rowFlags() const override { return AlwaysBreakAfter; }
        ///
        static void string2params(std::string const &, InsetNewlineParams &);
        ///
index f02048804d43c70f975d81f813b013defa761828..d086276df2d674e933b5f50752fb4848b0cccf8e 100644 (file)
@@ -76,7 +76,7 @@ private:
        ///
        void write(std::ostream & os) const override;
        ///
-       RowFlags rowFlags() const override { return (params_.kind == InsetNewpageParams::NOPAGEBREAK) ? Inline : Display; }
+       int rowFlags() const override { return (params_.kind == InsetNewpageParams::NOPAGEBREAK) ? Inline : Display; }
        ///
        docstring insetLabel() const;
        ///
index 1778e01dabbb0665196b503acac0f9c81a118836..362cd4699f6e69bc607444f7c93c055d6e550fd5 100644 (file)
@@ -94,7 +94,7 @@ public:
        ///
        bool hasSettings() const override { return true; }
        ///
-       RowFlags rowFlags() const override { return Display; }
+       int rowFlags() const override { return Display; }
        ///
        void latex(otexstream &, OutputParams const &) const override;
        ///
index f7e0ab90597676db964a52f80c57aad32bf1538b..9352bdf0dff57ad686dbdc756049fe97cebcaf26 100644 (file)
@@ -65,7 +65,7 @@ public:
                return docstring();
        }
        ///
-       RowFlags rowFlags() const override { return BreakAfter; }
+       int rowFlags() const override { return BreakAfter; }
 private:
        ///
        InsetCode lyxCode() const override { return SEPARATOR_CODE; }
index 95855961f9597d447c5b39d48fdaf55971788428..1a2eb096b775779f7e223368ff1898df5f2f4b10 100644 (file)
@@ -192,7 +192,7 @@ bool InsetSpace::getStatus(Cursor & cur, FuncRequest const & cmd,
 }
 
 
-Inset::RowFlags InsetSpace::rowFlags() const
+int InsetSpace::rowFlags() const
 {
        switch (params_.kind) {
                case InsetSpaceParams::PROTECTED:
index 5cf7aa7303d2458065d7a8e8eec03cc1a6e2ff1b..e401d6d9ae7586624cfbd1abe910d239a8aa519b 100644 (file)
@@ -115,7 +115,7 @@ public:
        ///
        docstring toolTip(BufferView const & bv, int x, int y) const override;
        /// unprotected spaces allow line breaking after them
-       RowFlags rowFlags() const override;
+       int rowFlags() const override;
        ///
        void metrics(MetricsInfo &, Dimension &) const override;
        ///
index 3ecdaf12e94315f2f4bbb438d0183e5e70154603..88af6538f68b6b44110ac5fdefb7c3f95098ba7c 100644 (file)
@@ -83,7 +83,7 @@ docstring InsetSpecialChar::toolTip(BufferView const &, int, int) const
 }
 
 
-Inset::RowFlags InsetSpecialChar::rowFlags() const
+int InsetSpecialChar::rowFlags() const
 {
        switch (kind_) {
        case ALLOWBREAK:
index 3056b105b45cc3a6fe4c924c41e8bb68d55c8ce8..0c8cc3630447081134991337fd590eb179d153a0 100644 (file)
@@ -63,7 +63,7 @@ public:
        ///
        docstring toolTip(BufferView const & bv, int x, int y) const override;
        /// some special chars allow line breaking after them
-       RowFlags rowFlags() const override;
+       int rowFlags() const override;
        ///
        void metrics(MetricsInfo &, Dimension &) const override;
        ///
index 045ae07e6d0f3c0729ab83c7384c2a453c3e0119..ca3f463c5ad610d8aa9c63ebde127296a034d561 100644 (file)
@@ -37,7 +37,7 @@ public:
        ///
        docstring layoutName() const override;
        ///
-       RowFlags rowFlags() const override { return Display; }
+       int rowFlags() const override { return Display; }
        ///
        void validate(LaTeXFeatures &) const override;
        ///
index fcf89e7499ce56035491ef7b9f727b69d58e3c96..24bde65c5c51012a322c22e5f33adcc2323d7ef8 100644 (file)
@@ -6144,21 +6144,21 @@ bool InsetTabular::getStatus(Cursor & cur, FuncRequest const & cmd,
 }
 
 
-Inset::RowFlags InsetTabular::rowFlags() const
-{
-               if (tabular.is_long_tabular) {
-                       switch (tabular.longtabular_alignment) {
-                       case Tabular::LYX_LONGTABULAR_ALIGN_LEFT:
-                               return Display | AlignLeft;
-                       case Tabular::LYX_LONGTABULAR_ALIGN_CENTER:
-                               return Display;
-                       case Tabular::LYX_LONGTABULAR_ALIGN_RIGHT:
-                               return Display | AlignRight;
-                       default:
-                               return Display;
-                       }
-               } else
-                       return Inline;
+int InsetTabular::rowFlags() const
+{
+       if (tabular.is_long_tabular) {
+               switch (tabular.longtabular_alignment) {
+               case Tabular::LYX_LONGTABULAR_ALIGN_LEFT:
+                       return Display | AlignLeft;
+               case Tabular::LYX_LONGTABULAR_ALIGN_CENTER:
+                       return Display;
+               case Tabular::LYX_LONGTABULAR_ALIGN_RIGHT:
+                       return Display | AlignRight;
+               default:
+                       return Display;
+               }
+       } else
+               return Inline;
 }
 
 
index 8d1be1b2a3d5ff921417ba0644c4d6d24c5da18b..0d4e7afee9d0e954e564e7f86f8fefec0e28bacd 100644 (file)
@@ -989,7 +989,7 @@ public:
        //
        bool isTable() const override { return true; }
        ///
-       RowFlags rowFlags() const override;
+       int rowFlags() const override;
        ///
        void latex(otexstream &, OutputParams const &) const override;
        ///
index 9b95f00ff066c2168c1abf780b6a592438060ec3..51c2b5b8857bbf12fcf39abfea19da38ba3680d8 100644 (file)
@@ -62,7 +62,7 @@ private:
        ///
        void write(std::ostream & os) const override;
        ///
-       RowFlags rowFlags() const override { return Display; }
+       int rowFlags() const override { return Display; }
        ///
        void doDispatch(Cursor & cur, FuncRequest & cmd) override;
        ///
index 97d95da03b3876372634d41e2f5113ef15e79b09..26ac40b9333f163ea09ba9f62f7e6a229e2da353 100644 (file)
@@ -988,7 +988,7 @@ bool InsetMathHull::outerDisplay() const
 }
 
 
-Inset::RowFlags InsetMathHull::rowFlags() const
+int InsetMathHull::rowFlags() const
 {
        switch (type_) {
        case hullUnknown:
index 0b865be878df452d5651e4e980f79432c3c56827..b0191886e4fb2241523f6cc9c45f3b250f0110e7 100644 (file)
@@ -288,7 +288,7 @@ public:
        ///
        Inset * editXY(Cursor & cur, int x, int y) override;
        ///
-       RowFlags rowFlags() const override;
+       int rowFlags() const override;
        /// helper function
        bool display() const { return rowFlags() & Display; }