]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insettext.C
insetcharstyle drawing cosmetics
[lyx.git] / src / insets / insettext.C
index cd751325f5d0ad8ae8530fa540c0028d9bbdd017..ba6feb7617bebfc96a5168a871c7f8b84bf349dc 100644 (file)
@@ -69,7 +69,7 @@ using std::vector;
 
 
 InsetText::InsetText(BufferParams const & bp)
-       : autoBreakRows_(false), drawFrame_(NEVER),
+       : autoBreakRows_(false), drawFrame_(false),
          frame_color_(LColor::insetframe), text_(0)
 {
        paragraphs().push_back(Paragraph());
@@ -205,7 +205,7 @@ void InsetText::draw(PainterInfo & pi, int x, int y) const
 
        text_.draw(pi, x, y + bv->top_y());
 
-       if (drawFrame_ == ALWAYS || drawFrame_ == LOCKED)
+       if (drawFrame_)
                drawFrame(pi.pain, x, y);
 }
 
@@ -273,18 +273,6 @@ string const InsetText::editMessage() const
 }
 
 
-void InsetText::sanitizeEmptyText(BufferView & bv)
-{
-       if (paragraphs().size() == 1
-           && paragraphs().begin()->empty()
-           && bv.getParentLanguage(this) != text_.current_font.language()) {
-               LyXFont font(LyXFont::ALL_IGNORE);
-               font.setLanguage(bv.getParentLanguage(this));
-               text_.setFont(bv.cursor(), font, false);
-       }
-}
-
-
 void InsetText::edit(LCursor & cur, bool left)
 {
        //lyxerr << "InsetText: edit left/right" << endl;
@@ -295,7 +283,6 @@ void InsetText::edit(LCursor & cur, bool left)
        text_.setCursor(cur.top(), par, pos);
        cur.clearSelection();
        finishUndo();
-       sanitizeEmptyText(cur.bv());
 #ifdef WITH_WARNINGS
 #warning can someone check if/when this is needed?
 #endif
@@ -306,7 +293,6 @@ void InsetText::edit(LCursor & cur, bool left)
 
 InsetBase * InsetText::editXY(LCursor & cur, int x, int y) const
 {
-       lyxerr << "InsetText::edit xy" << endl;
        old_par = -1;
        return text_.editXY(cur, x, y);
        //sanitizeEmptyText(cur.bv());
@@ -322,16 +308,6 @@ void InsetText::priv_dispatch(LCursor & cur, FuncRequest & cmd)
        bool was_empty = paragraphs().begin()->empty() && paragraphs().size() == 1;
        text_.dispatch(cur, cmd);
 
-       // If the action has deleted all text in the inset, we need
-       // to change the language to the language of the surronding
-       // text.
-       // Why this cleverness? (Andre')
-       if (!was_empty && paragraphs().begin()->empty() &&
-           paragraphs().size() == 1) {
-               LyXFont font(LyXFont::ALL_IGNORE);
-               font.setLanguage(cur.bv().getParentLanguage(this));
-               text_.setFont(cur, font, false);
-       }
 }
 
 
@@ -376,7 +352,7 @@ int InsetText::linuxdoc(Buffer const & buf, ostream & os,
 int InsetText::docbook(Buffer const & buf, ostream & os,
                       OutputParams const & runparams) const
 {
-       docbookParagraphs(buf, paragraphs(), os, runparams);
+       docbookParagraphs(paragraphs(), buf, os, runparams);
        return 0;
 }
 
@@ -448,9 +424,9 @@ void InsetText::setAutoBreakRows(bool flag)
 }
 
 
-void InsetText::setDrawFrame(DrawFrame how)
+void InsetText::setDrawFrame(bool flag)
 {
-       drawFrame_ = how;
+       drawFrame_ = flag;
 }