]> git.lyx.org Git - lyx.git/blobdiff - src/ParagraphMetrics.cpp
Allow using \binom without amsmath and add support for \brace and \brack
[lyx.git] / src / ParagraphMetrics.cpp
index a53605c794f411fcee6aacbfad27a6cdf4b6cf2a..fee38fb6e4b36890cb7e441a6ab33c3ee7c9d348 100644 (file)
@@ -24,8 +24,6 @@
 #include "BufferView.h"
 #include "Counters.h"
 #include "Encoding.h"
-#include "support/debug.h"
-#include "support/gettext.h"
 #include "Language.h"
 #include "LaTeXFeatures.h"
 #include "Layout.h"
 #include "insets/InsetBibitem.h"
 #include "insets/InsetOptArg.h"
 
+#include "support/convert.h"
+#include "support/debug.h"
+#include "support/gettext.h"
 #include "support/lstrings.h"
 #include "support/textutils.h"
-#include "support/convert.h"
 
 #include <boost/bind.hpp>
 #include <boost/crc.hpp>
@@ -62,9 +62,9 @@ using namespace lyx::support;
 namespace lyx {
 
 
-ParagraphMetrics::ParagraphMetrics(Paragraph const & par): position_(-1), par_(&par)
-{
-}
+ParagraphMetrics::ParagraphMetrics(Paragraph const & par) :
+       position_(-1), par_(&par)
+{}
 
 
 ParagraphMetrics & ParagraphMetrics::operator=(
@@ -198,12 +198,12 @@ void ParagraphMetrics::dump() const
 int ParagraphMetrics::rightMargin(BufferView const & bv) const
 {
        BufferParams const & params = bv.buffer().params();
-       TextClass const & tclass = params.getTextClass();
+       DocumentClass const & tclass = params.documentClass();
        frontend::FontMetrics const & fm = theFontMetrics(params.getFont());
        int const r_margin =
                bv.rightMargin()
                + fm.signedWidth(tclass.rightmargin())
-               + fm.signedWidth(par_->layout()->rightmargin)
+               + fm.signedWidth(par_->layout().rightmargin)
                * 4 / (par_->getDepth() + 4);
 
        return r_margin;
@@ -226,11 +226,11 @@ int ParagraphMetrics::singleWidth(pos_type pos, Font const & font) const
                if (language->lang() == "arabic_arabtex" ||
                        language->lang() == "arabic_arabi" ||
                        language->lang() == "farsi") {
-                               if (Encodings::isComposeChar_arabic(c))
+                               if (Encodings::isArabicComposeChar(c))
                                        return 0;
                                c = par_->transformChar(c, pos);
                } else if (language->lang() == "hebrew" &&
-                               Encodings::isComposeChar_hebrew(c)) {
+                               Encodings::isHebrewComposeChar(c)) {
                        return 0;       
                }
        }
@@ -260,7 +260,7 @@ bool ParagraphMetrics::hfillExpansion(Row const & row, pos_type pos) const
        }
 
        // do not expand in some labels
-       if (par_->layout()->margintype != MARGIN_MANUAL && pos < par_->beginOfBody())
+       if (par_->layout().margintype != MARGIN_MANUAL && pos < par_->beginOfBody())
                return false;
 
        // if there is anything between the first char of the row and