]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetcharstyle.C
* src/LyXAction.C: mark goto-clear-bookmark as working without buffer
[lyx.git] / src / insets / insetcharstyle.C
index 6d953726c8ed08ec2d0e3413b32808c11071b9aa..4c6472dcbc080d91bcda94b1c252854952d911ca 100644 (file)
@@ -139,7 +139,7 @@ void InsetCharStyle::read(Buffer const & buf, LyXLex & lex)
 }
 
 
-void InsetCharStyle::metrics(MetricsInfo & mi, Dimension & dim) const
+bool InsetCharStyle::metrics(MetricsInfo & mi, Dimension & dim) const
 {
        LyXFont tmpfont = mi.base.font;
        getDrawFont(mi.base.font);
@@ -168,9 +168,11 @@ void InsetCharStyle::metrics(MetricsInfo & mi, Dimension & dim) const
        dim.des += TEXT_TO_INSET_OFFSET;
        dim.wid += 2 * TEXT_TO_INSET_OFFSET;
        mi.base.textwidth += 2 * TEXT_TO_INSET_OFFSET;
-       dim_ = dim;
        if (params_.show_label)
-               dim_.des += ascent();
+               dim.des += ascent();
+       bool const changed = dim_ != dim;
+       dim_ = dim;
+       return changed;
 }
 
 
@@ -330,10 +332,9 @@ int InsetCharStyle::plaintext(Buffer const & buf, odocstream & os,
 }
 
 
-int InsetCharStyle::textString(Buffer const & buf, odocstream & os,
-                      OutputParams const & op) const
+void InsetCharStyle::textString(Buffer const & buf, odocstream & os) const
 {
-       return plaintext(buf, os, op);
+       os << paragraphs().begin()->asString(buf, true);
 }