]> git.lyx.org Git - lyx.git/blobdiff - src/ParagraphMetrics.cpp
cosmetics
[lyx.git] / src / ParagraphMetrics.cpp
index 6b889083086f6414e4b80e1fdc9d805f4ed4248c..483620a8e7ace77332da7af2569db91297c57e4d 100644 (file)
@@ -35,6 +35,7 @@
 #include "OutputParams.h"
 #include "paragraph_funcs.h"
 #include "sgml.h"
+#include "TextClass.h"
 #include "TexRow.h"
 #include "VSpace.h"
 
@@ -215,12 +216,12 @@ int ParagraphMetrics::rightMargin(Buffer const & buffer) const
 
 int ParagraphMetrics::singleWidth(pos_type pos, Font const & font) const
 {
-       char_type c = par_->getChar(pos);
-
        // The most special cases are handled first.
-       if (c == Paragraph::META_INSET)
+       if (par_->isInset(pos))
                return insetDimension(par_->getInset(pos)).wid;
 
+       char_type c = par_->getChar(pos);
+
        if (!isPrintable(c))
                return theFontMetrics(font).width(c);