]> git.lyx.org Git - lyx.git/blobdiff - src/ParagraphMetrics.cpp
cosmetics
[lyx.git] / src / ParagraphMetrics.cpp
index 0e23f52fce9c8a9436c804c1caf2c9d162b7d433..483620a8e7ace77332da7af2569db91297c57e4d 100644 (file)
 #include "gettext.h"
 #include "Language.h"
 #include "LaTeXFeatures.h"
+#include "Layout.h"
 #include "Font.h"
 #include "LyXRC.h"
 #include "Row.h"
 #include "OutputParams.h"
 #include "paragraph_funcs.h"
 #include "sgml.h"
+#include "TextClass.h"
 #include "TexRow.h"
 #include "VSpace.h"
 
@@ -214,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);