X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FInsetPreview.h;h=f0808d7246733fdc54352eb7b25ce6f51d3af46e;hb=58cf1c5345104cb3071bf6788f65e4fae07ac749;hp=15380ba543ea75613ee6f3a2e91ff99a48bfb4ef;hpb=7287a259c5436b8f3f384c0d0bd7641a2f2601e9;p=lyx.git diff --git a/src/insets/InsetPreview.h b/src/insets/InsetPreview.h index 15380ba543..f0808d7246 100644 --- a/src/insets/InsetPreview.h +++ b/src/insets/InsetPreview.h @@ -16,7 +16,8 @@ #include "Dimension.h" -#include +#include "support/unique_ptr.h" + namespace lyx { @@ -28,7 +29,7 @@ namespace graphics { /// An inset with an instant preview class InsetPreview : public InsetText { - + public: /// InsetPreview(Buffer *); @@ -36,17 +37,21 @@ public: ~InsetPreview(); /// InsetPreview(InsetPreview const & other); + /// + InsetPreview & operator=(InsetPreview const & other); /// \name Methods inherited from Inset class //@{ Inset * clone() const { return new InsetPreview(*this); } bool neverIndent() const { return true; } - + + bool inheritFont() const { return false; } + InsetCode lyxCode() const { return PREVIEW_CODE; } - + docstring layoutName() const { return from_ascii("Preview"); } - + bool descendable(BufferView const & /*bv*/) const { return true; } std::string contextMenuName() const @@ -66,8 +71,10 @@ public: void write(std::ostream & os) const; void edit(Cursor & cur, bool front, EntryDirection entry_from); + + bool canPaintChange(BufferView const &) const { return true; }; //@} - + protected: /// Retrieves the preview state. Returns true if preview /// is enabled and the preview image is availabled. @@ -78,13 +85,8 @@ protected: void preparePreview(DocIterator const & pos) const; /// - boost::scoped_ptr preview_; - /// - mutable bool use_preview_; + unique_ptr preview_; -private: - /// - mutable Dimension dim_; };