The branch, master, has been updated.

- Log -----------------------------------------------------------------

commit 6df750aa181ad13f260ded60f7b74e1bcf59183e
Author: Vincent van Ravesteijn <[email protected]>
Date:   Thu May 10 10:39:38 2012 +0200

    TextMetrics::leftMargin(): Explain why the disabled code is wrong

diff --git a/src/TextMetrics.cpp b/src/TextMetrics.cpp
index 96da42d..1000aff 100644
--- a/src/TextMetrics.cpp
+++ b/src/TextMetrics.cpp
@@ -1980,16 +1980,18 @@ int TextMetrics::leftMargin(int max_width,
 
        case MARGIN_RIGHT_ADDRESS_BOX: {
 #if 0
-               // ok, a terrible hack. The left margin depends on the widest
-               // row in this paragraph.
-               RowList::iterator rit = par.rows().begin();
-               RowList::iterator end = par.rows().end();
-               // FIXME: This is wrong.
+               // The left margin depends on the widest row in this paragraph.
+               // This code is wrong because it depends on the rows, but at the
+               // same time this function is used in redoParagraph to construct
+               // the rows. 
+               ParagraphMetrics const & pm = par_metrics_[pit];
+               RowList::const_iterator rit = pm.rows().begin();
+               RowList::const_iterator end = pm.rows().end();
                int minfill = max_width;
                for ( ; rit != end; ++rit)
                        if (rit->fill() < minfill)
                                minfill = rit->fill();
-               l_margin += 
theFontMetrics(params.getFont()).signedWidth(layout.leftmargin);
+               l_margin += 
theFontMetrics(buffer.params().getFont()).signedWidth(layout.leftmargin);
                l_margin += minfill;
 #endif
                // also wrong, but much shorter.

commit 92ac678715b07ff7c7adc4b32674382b5e224a44
Author: Vincent van Ravesteijn <[email protected]>
Date:   Wed May 9 21:46:37 2012 +0200

    Fix bug #8152: Uneditable long rows for 'Right addresses'
    
    As long as leftMargin() is not correctly implemented for
    MARGIN_RIGHT_ADDRESS_BOX, we should also not do this here. Otherwise, long
    rows will be painted off the screen and will not be editable.

diff --git a/src/TextMetrics.cpp b/src/TextMetrics.cpp
index a60d4de..96da42d 100644
--- a/src/TextMetrics.cpp
+++ b/src/TextMetrics.cpp
@@ -798,8 +798,13 @@ pos_type TextMetrics::rowBreakPoint(int width, pit_type 
const pit,
 
        Layout const & layout = par.layout();
 
+#if 0
+       //FIXME: As long as leftMargin() is not correctly implemented for 
+       // MARGIN_RIGHT_ADDRESS_BOX, we should also not do this here.
+       // Otherwise, long rows will be painted off the screen.
        if (layout.margintype == MARGIN_RIGHT_ADDRESS_BOX)
                return addressBreakPoint(pos, par);
+#endif
 
        pos_type const body_pos = par.beginOfBody();
 

-----------------------------------------------------------------------

Summary of changes:
 src/TextMetrics.cpp |   19 +++++++++++++------
 1 files changed, 13 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
The LyX Source Repository

Reply via email to