X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fbufferview_funcs.cpp;h=9130ec76e359408a8768401054f8322e00ef0134;hb=d35d25460b57c14e67a26c593881dfff31b35da5;hp=69c160855c34fbd9b7c5b2bd7213732d2f7d65a4;hpb=de15c267e3e5a3ec5e64c4afef50ab9b6fe64cb5;p=lyx.git diff --git a/src/bufferview_funcs.cpp b/src/bufferview_funcs.cpp index 69c160855c..9130ec76e3 100644 --- a/src/bufferview_funcs.cpp +++ b/src/bufferview_funcs.cpp @@ -16,7 +16,6 @@ #include "bufferview_funcs.h" -#include "Author.h" #include "Buffer.h" #include "BufferParams.h" #include "BufferView.h" @@ -26,10 +25,6 @@ #include "Language.h" #include "Color.h" #include "Lexer.h" -#include "Row.h" -#include "Paragraph.h" -#include "ParagraphParameters.h" -#include "ParIterator.h" #include "frontends/alert.h" @@ -40,11 +35,6 @@ #include - -namespace lyx { - -using support::bformat; - using std::istringstream; using std::ostringstream; using std::string; @@ -52,6 +42,10 @@ using std::vector; using std::find; +namespace lyx { + +using support::bformat; + namespace bv_funcs { // Set data using font and toggle @@ -181,7 +175,7 @@ Point coordOffset(BufferView const & bv, DocIterator const & dit, // of xx:yy if (sl.text()) { bool boundary_i = boundary && i + 1 == dit.depth(); - bool rtl = sl.text()->isRTL(*bv.buffer(), sl, boundary_i); + bool rtl = bv.textMetrics(sl.text()).isRTL(sl, boundary_i); if (rtl) x -= lastw; } @@ -195,7 +189,8 @@ Point coordOffset(BufferView const & bv, DocIterator const & dit, // Add contribution of initial rows of outermost paragraph CursorSlice const & sl = dit[0]; - ParagraphMetrics const & pm = bv.parMetrics(sl.text(), sl.pit()); + TextMetrics const & tm = bv.textMetrics(sl.text()); + ParagraphMetrics const & pm = tm.parMetrics(sl.pit()); BOOST_ASSERT(!pm.rows().empty()); y -= pm.rows()[0].ascent(); #if 1 @@ -216,14 +211,16 @@ Point coordOffset(BufferView const & bv, DocIterator const & dit, y += pm.rows()[rit].height(); y += pm.rows()[rend].ascent(); + TextMetrics const & bottom_tm = bv.textMetrics(dit.bottom().text()); + // Make relative position from the nested inset now bufferview absolute. - int xx = dit.bottom().text()->cursorX(bv, dit.bottom(), boundary && dit.depth() == 1); + int xx = bottom_tm.cursorX(dit.bottom(), boundary && dit.depth() == 1); x += xx; // In the RTL case place the nested inset at the left of the cursor in // the outer paragraph bool boundary_1 = boundary && 1 == dit.depth(); - bool rtl = dit.bottom().text()->isRTL(*bv.buffer(), dit.bottom(), boundary_1); + bool rtl = bottom_tm.isRTL(dit.bottom(), boundary_1); if (rtl) x -= lastw;