summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Hung <marklh9@gmail.com>2015-08-08 00:18:20 +0800
committerCaolán McNamara <caolanm@redhat.com>2015-10-01 09:24:57 +0000
commitb63dcee30b7b7138f135fffd5abb6d9fa16d4f28 (patch)
treec9a106d61823e46185fad3d0a0e9ecd9f16b027d
parentc33af041298fc4897ee1215efda488654955ebf7 (diff)
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@libreoffice.org> Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/19031 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sw/source/core/layout/trvlfrm.cxx3
-rw-r--r--sw/source/core/text/itrcrsr.cxx2
-rw-r--r--sw/source/core/text/itrpaint.cxx2
3 files changed, 3 insertions, 4 deletions
diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx
index bbb4e16e0478..65aa24f69e72 100644
--- a/sw/source/core/layout/trvlfrm.cxx
+++ b/sw/source/core/layout/trvlfrm.cxx
@@ -2429,8 +2429,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 d8ea12b83da7..65e468939aed 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 4608248ebab4..fa9716e9b9f6 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 );
}