]> git.lyx.org Git - features.git/blobdiff - src/insets/InsetCaption.h
DocBook, InsetFloat: avoid a potential nullptr dereference when detecting the type...
[features.git] / src / insets / InsetCaption.h
index cd99455b2e5fb86c000ff3317a9d7a983f28eea9..c1bcd17b6b44e5111f14e0c4adb27ec06b9ec64b 100644 (file)
@@ -25,78 +25,86 @@ public:
        ///
        std::string const & floattype() const { return floattype_; }
        ///
-       docstring layoutName() const;
+       docstring layoutName() const override;
        /// return the mandatory argument (LaTeX format) only
        void getArgument(otexstream & os, OutputParams const &) const;
        /// return the caption text
        int getCaptionAsPlaintext(odocstream & os, OutputParams const &) const;
+       /// write the caption text as DocBook in os
+       void getCaptionAsDocBook(XMLStream & os, OutputParams const &) const;
        /// return the caption text as HTML
-       docstring getCaptionAsHTML(XHTMLStream & os, OutputParams const &) const;
+       docstring getCaptionAsHTML(XMLStream & os, OutputParams const &) const;
        ///
-       std::string contextMenuName() const;
+       std::string contextMenuName() const override;
 private:
        ///
-       void write(std::ostream & os) const;
+       void write(std::ostream & os) const override;
        ///
-       DisplayType display() const { return AlignCenter; }
+       int rowFlags() const override { return Display; }
        ///
-       bool neverIndent() const { return true; }
+       bool neverIndent() const override { return true; }
        ///
-       InsetCode lyxCode() const { return CAPTION_CODE; }
+       bool forceLocalFontSwitch() const override { return true; }
+       ///
+       InsetCode lyxCode() const override { return CAPTION_CODE; }
        ///
        void cursorPos(BufferView const & bv,
-               CursorSlice const & sl, bool boundary, int & x, int & y) const;
+               CursorSlice const & sl, bool boundary, int & x, int & y) const override;
+       ///
+       bool descendable(BufferView const &) const override { return true; }
        ///
-       bool descendable(BufferView const &) const { return true; }
+       void metrics(MetricsInfo & mi, Dimension & dim) const override;
        ///
-       void metrics(MetricsInfo & mi, Dimension & dim) const;
-       ///     
-       void drawBackground(PainterInfo & pi, int x, int y) const;
+       void drawBackground(PainterInfo & pi, int x, int y) const override;
        ///
-       void draw(PainterInfo & pi, int x, int y) const;
+       void draw(PainterInfo & pi, int x, int y) const override;
+       /// Strike out the inset when deleted.
+       bool canPaintChange(BufferView const &) const override { return true; }
        ///
-       void edit(Cursor & cur, bool front, EntryDirection entry_from);
+       void edit(Cursor & cur, bool front, EntryDirection entry_from) override;
        ///
-       Inset * editXY(Cursor & cur, int x, int y);
+       Inset * editXY(Cursor & cur, int x, int y) override;
        ///
-       bool insetAllowed(InsetCode code) const;
+       bool insetAllowed(InsetCode code) const override;
        ///
-       void doDispatch(Cursor & cur, FuncRequest & cmd);
+       void doDispatch(Cursor & cur, FuncRequest & cmd) override;
        ///
-       bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const;
+       bool getStatus(Cursor & cur, FuncRequest const & cmd, FuncStatus &) const override;
        // Update the counters of this inset and of its contents
-       void updateBuffer(ParIterator const &, UpdateType);
+       void updateBuffer(ParIterator const &, UpdateType, bool const deleted) override;
        ///
-       void latex(otexstream & os, OutputParams const &) const;
+       void latex(otexstream & os, OutputParams const &) const override;
        ///
        int plaintext(odocstringstream & ods, OutputParams const & op,
-                     size_t max_length = INT_MAX) const;
-       ///
-       int docbook(odocstream & os, OutputParams const & runparams) const;
-       /// 
-       docstring xhtml(XHTMLStream & os, OutputParams const & runparams) const;
-       ///
-       void setCustomLabel(docstring const & label);
-       /// \param output_active : is the toc being generated for use by the
-       /// output routines?
-       void addToToc(DocIterator const & di, bool output_active) const;
-       /// 
-       virtual bool forcePlainLayout(idx_type = 0) const { return true; }
+                     size_t max_length = INT_MAX) const override;
+       ///
+       void docbook(XMLStream &, OutputParams const &) const override;
+       ///
+       docstring xhtml(XMLStream & os, OutputParams const & runparams) const override;
+       ///
+       void addToToc(DocIterator const & di, bool output_active, UpdateType utype,
+                     TocBackend & backend) const override;
+       ///
+       bool forcePlainLayout(idx_type = 0) const override { return true; }
        /// Captions don't accept alignment, spacing, etc.
-       virtual bool allowParagraphCustomization(idx_type = 0) const { return false; }
+       bool allowParagraphCustomization(idx_type = 0) const override { return false; }
        ///
-       Inset * clone() const { return new InsetCaption(*this); }
+       Inset * clone() const override { return new InsetCaption(*this); }
 
        ///
        mutable docstring full_label_;
        ///
-       mutable int labelwidth_;
+       mutable int labelwidth_ = 0;
+       ///
+       mutable bool rtl_ = false;
        ///
        std::string floattype_;
        ///
-       std::string type_;
+       bool is_subfloat_ = false;
        ///
-       docstring custom_label_;
+       bool is_deleted_ = false;
+       ///
+       std::string type_;
 };