[Libreoffice-commits] core.git: sw/source

Mark Hung marklh9 at gmail.com
Sat Aug 15 16:07:54 PDT 2015


 sw/source/core/layout/trvlfrm.cxx |    3 +--
 sw/source/core/text/itrcrsr.cxx   |    2 +-
 sw/source/core/text/itrpaint.cxx  |    2 +-
 3 files changed, 3 insertions(+), 4 deletions(-)

New commits:
commit 26d8d33f3adfcbfd49ef1ea809202deabcea4957
Author: Mark Hung <marklh9 at gmail.com>
Date:   Sat Aug 8 00:18:20 2015 +0800

    Fix tdf#82176 CJK: Cursor position, line selection and non-printing
    
    characters do not take account of hanging punctuation. Note that
    placing a cursor next to the hanging puncuation is still not possible,
    but the selection and the non-printing characters works fine now.
    
    Change-Id: I22c8c2c5044b46c325236caffec67d9f68c23eed
    Reviewed-on: https://gerrit.libreoffice.org/17591
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Norbert Thiebaud <nthiebaud at gmail.com>

diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx
index bf1b5f2..04f46ae 100644
--- a/sw/source/core/layout/trvlfrm.cxx
+++ b/sw/source/core/layout/trvlfrm.cxx
@@ -2428,8 +2428,7 @@ void SwRootFrm::CalcFrmRects(SwShellCrsr &rCrsr)
             {
                 lLeft = (pStartFrm->Frm().*fnRect->fnGetLeft)() +
                     (pStartFrm->Prt().*fnRect->fnGetLeft)();
-                lRight = (pStartFrm->Frm().*fnRect->fnGetLeft)() +
-                    (pStartFrm->Prt().*fnRect->fnGetRight)();
+                lRight = (aEndFrm.*fnRect->fnGetRight)();
             }
             if( lLeft < (aStFrm.*fnRect->fnGetLeft)() )
                 lLeft = (aStFrm.*fnRect->fnGetLeft)();
diff --git a/sw/source/core/text/itrcrsr.cxx b/sw/source/core/text/itrcrsr.cxx
index 2f73c22..65a279d 100644
--- a/sw/source/core/text/itrcrsr.cxx
+++ b/sw/source/core/text/itrcrsr.cxx
@@ -1265,7 +1265,7 @@ sal_Int32 SwTextCursor::GetCrsrOfst( SwPosition *pPos, const Point &rPoint,
     // x is the horizontal offset within the line.
     SwTwips x = rPoint.X();
     const SwTwips nLeftMargin  = GetLineStart();
-    SwTwips nRightMargin = GetLineEnd();
+    SwTwips nRightMargin = GetLineEnd() + GetCurr()->GetHangingMargin();
     if( nRightMargin == nLeftMargin )
         nRightMargin += 30;
 
diff --git a/sw/source/core/text/itrpaint.cxx b/sw/source/core/text/itrpaint.cxx
index e2e9b44..903301e 100644
--- a/sw/source/core/text/itrpaint.cxx
+++ b/sw/source/core/text/itrpaint.cxx
@@ -423,7 +423,7 @@ void SwTextPainter::DrawTextLine( const SwRect &rPaint, SwSaveClip &rClip,
             if ( bAdjustBaseLine )
                 GetInfo().Y( GetInfo().GetPos().Y()
                            + AdjustBaseLine( *pCurr, &aEnd ) );
-
+            GetInfo().X( GetInfo().X() + GetCurr()->GetHangingMargin() );
             aEnd.Paint( GetInfo() );
             GetInfo().Y( nOldY );
         }


More information about the Libreoffice-commits mailing list