]> git.lyx.org Git - lyx.git/blobdiff - src/ParagraphMetrics.cpp
After a hiatus, I'm returning to the rewrite of InsetCommandParams, the purpose of...
[lyx.git] / src / ParagraphMetrics.cpp
index 873cded4db4561e2978665d5bbc54f2a5a9a1b1a..fb6c77714d5998806e8ecd1e91085b38d7870655 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=(
@@ -195,13 +195,13 @@ void ParagraphMetrics::dump() const
        }
 }
 
-int ParagraphMetrics::rightMargin(Buffer const & buffer) const
+int ParagraphMetrics::rightMargin(BufferView const & bv) const
 {
-       BufferParams const & params = buffer.params();
-       TextClass const & tclass = params.getTextClass();
+       BufferParams const & params = bv.buffer().params();
+       TextClass const & tclass = params.textClass();
        frontend::FontMetrics const & fm = theFontMetrics(params.getFont());
        int const r_margin =
-               lyx::rightMargin()
+               bv.rightMargin()
                + fm.signedWidth(tclass.rightmargin())
                + fm.signedWidth(par_->layout()->rightmargin)
                * 4 / (par_->getDepth() + 4);