]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetWrap.cpp
Fix bug 3363: mark buffer dirty after middle button paste in plain text and table...
[lyx.git] / src / insets / InsetWrap.cpp
index d4ba9f018f94de40268f84ef4368e96d99aa800e..45a5d8ebdfc14b2998e0296005c73695677b36f5 100644 (file)
@@ -15,7 +15,7 @@
 #include "Buffer.h"
 #include "BufferParams.h"
 #include "BufferView.h"
-#include "LCursor.h"
+#include "Cursor.h"
 #include "debug.h"
 #include "DispatchResult.h"
 #include "Floating.h"
@@ -24,7 +24,7 @@
 #include "FuncStatus.h"
 #include "gettext.h"
 #include "LaTeXFeatures.h"
-#include "LColor.h"
+#include "Color.h"
 #include "Lexer.h"
 #include "OutputParams.h"
 #include "Paragraph.h"
@@ -44,17 +44,16 @@ using std::ostringstream;
 
 
 InsetWrap::InsetWrap(BufferParams const & bp, string const & type)
-       : InsetCollapsable(bp)
+       : InsetCollapsable(bp), name_(from_utf8(type))
 {
        setLabel(_("wrap: ") + floatName(type, bp));
-       LyXFont font(LyXFont::ALL_SANE);
+       Font font(Font::ALL_SANE);
        font.decSize();
        font.decSize();
-       font.setColor(LColor::collapsable);
+       font.setColor(Color::collapsable);
        setLabelFont(font);
        params_.type = type;
-       params_.width = LyXLength(50, LyXLength::PCW);
-       setInsetName(from_utf8(type));
+       params_.width = Length(50, Length::PCW);
 }
 
 
@@ -64,7 +63,7 @@ InsetWrap::~InsetWrap()
 }
 
 
-void InsetWrap::doDispatch(LCursor & cur, FuncRequest & cmd)
+void InsetWrap::doDispatch(Cursor & cur, FuncRequest & cmd)
 {
        switch (cmd.action) {
        case LFUN_INSET_MODIFY: {
@@ -95,7 +94,7 @@ void InsetWrap::doDispatch(LCursor & cur, FuncRequest & cmd)
 }
 
 
-bool InsetWrap::getStatus(LCursor & cur, FuncRequest const & cmd,
+bool InsetWrap::getStatus(Cursor & cur, FuncRequest const & cmd,
                FuncStatus & flag) const
 {
        switch (cmd.action) {
@@ -136,7 +135,7 @@ void InsetWrapParams::read(Lexer & lex)
        lex >> token;
        if (token == "width") {
                lex.next();
-               width = LyXLength(lex.getString());
+               width = Length(lex.getString());
        } else {
                lyxerr << "InsetWrap::Read:: Missing 'width'-tag!"
                        << endl;
@@ -167,9 +166,9 @@ void InsetWrap::validate(LaTeXFeatures & features) const
 }
 
 
-auto_ptr<InsetBase> InsetWrap::doClone() const
+auto_ptr<Inset> InsetWrap::doClone() const
 {
-       return auto_ptr<InsetBase>(new InsetWrap(*this));
+       return auto_ptr<Inset>(new InsetWrap(*this));
 }
 
 
@@ -180,7 +179,7 @@ docstring const InsetWrap::editMessage() const
 
 
 int InsetWrap::latex(Buffer const & buf, odocstream & os,
-                     OutputParams const & runparams) const
+                    OutputParams const & runparams) const
 {
        os << "\\begin{floating" << from_ascii(params_.type) << '}';
        if (!params_.placement.empty())
@@ -193,9 +192,9 @@ int InsetWrap::latex(Buffer const & buf, odocstream & os,
 
 
 int InsetWrap::plaintext(Buffer const & buf, odocstream & os,
-                         OutputParams const & runparams) const
+                        OutputParams const & runparams) const
 {
-       os << '[' << _("wrap") << ' ' << floatName(params_.type, buf.params()) << ":\n";
+       os << '[' << buf.B_("wrap") << ' ' << floatName(params_.type, buf.params()) << ":\n";
        InsetText::plaintext(buf, os, runparams);
        os << "\n]";
 
@@ -204,17 +203,17 @@ int InsetWrap::plaintext(Buffer const & buf, odocstream & os,
 
 
 int InsetWrap::docbook(Buffer const & buf, odocstream & os,
-                       OutputParams const & runparams) const
+                      OutputParams const & runparams) const
 {
-        // FIXME UNICODE
-        os << '<' << from_ascii(params_.type) << '>';
+       // FIXME UNICODE
+       os << '<' << from_ascii(params_.type) << '>';
        int const i = InsetText::docbook(buf, os, runparams);
        os << "</" << from_ascii(params_.type) << '>';
        return i;
 }
 
 
-bool InsetWrap::insetAllowed(InsetBase::Code code) const
+bool InsetWrap::insetAllowed(Inset::Code code) const
 {
        switch(code) {
        case FLOAT_CODE:
@@ -271,7 +270,7 @@ void InsetWrapMailer::string2params(string const & in, InsetWrapParams & params)
                return print_mailer_error("InsetWrapMailer", in, 1, name_);
 
        // This is part of the inset proper that is usually swallowed
-       // by LyXText::readInset
+       // by Text::readInset
        string id;
        lex >> id;
        if (!lex || id != "Wrap")