diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2019-03-13 21:35:42 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2019-03-14 09:05:50 +0100 |
commit | 2f83055cdbd915d5036a7b4374b4ad10e6efc65f (patch) | |
tree | f8eb88d7030a771076345d6a2e9ad29d2d6520b9 /sw/source | |
parent | 00f96e88a7c6feea98d446e82a2718c5aae6256c (diff) |
sw btlr writing mode shell: fix cursor selection
All changes are about not assuming logical top is a lower y value than
logical bottom, by going via the SwRectFnSet abstraction, which already
does the right thing.
Change-Id: I94a9881b018ad14b02e97425f60af01aa3fd9269
Reviewed-on: https://gerrit.libreoffice.org/69226
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/core/layout/ssfrm.cxx | 9 | ||||
-rw-r--r-- | sw/source/core/layout/trvlfrm.cxx | 3 |
2 files changed, 7 insertions, 5 deletions
diff --git a/sw/source/core/layout/ssfrm.cxx b/sw/source/core/layout/ssfrm.cxx index 46cf019acbc4..e1c8ec770646 100644 --- a/sw/source/core/layout/ssfrm.cxx +++ b/sw/source/core/layout/ssfrm.cxx @@ -680,14 +680,15 @@ const SwRect SwFrame::UnionFrame( bool bBorder ) const long nWidth = (getFrameArea().*fnRect->fnGetWidth)(); long nPrtLeft = (getFramePrintArea().*fnRect->fnGetLeft)(); long nPrtWidth = (getFramePrintArea().*fnRect->fnGetWidth)(); - if( nPrtLeft + nPrtWidth > nWidth ) + SwRectFnSet aRectFnSet(this); + if (aRectFnSet.XInc(nPrtLeft, nPrtWidth) > nWidth) nWidth = nPrtLeft + nPrtWidth; if( nPrtLeft < 0 ) { nLeft += nPrtLeft; nWidth -= nPrtLeft; } - SwTwips nRight = nLeft + nWidth; + SwTwips nRight = aRectFnSet.XInc(nLeft, nWidth); long nAdd = 0; if( bBorder ) { @@ -715,9 +716,9 @@ const SwRect SwFrame::UnionFrame( bool bBorder ) const if( nTmp > nAdd ) nAdd = nTmp; } - nWidth = nRight + nAdd - nLeft; + nWidth = aRectFnSet.XDiff(aRectFnSet.XInc(nRight, nAdd), nLeft); SwRect aRet( getFrameArea() ); - (aRet.*fnRect->fnSetPosX)( nLeft ); + (aRet.*fnRect->fnSetLeft)(nLeft); (aRet.*fnRect->fnSetWidth)( nWidth ); return aRet; } diff --git a/sw/source/core/layout/trvlfrm.cxx b/sw/source/core/layout/trvlfrm.cxx index 912cbafbb43e..45d22ab72a29 100644 --- a/sw/source/core/layout/trvlfrm.cxx +++ b/sw/source/core/layout/trvlfrm.cxx @@ -2138,6 +2138,7 @@ void SwRootFrame::CalcFrameRects(SwShellCursor &rCursor) SwRectFnSet aRectFnSet(pStartFrame); const bool bR2L = pStartFrame->IsRightToLeft(); const bool bEndR2L = pEndFrame->IsRightToLeft(); + const bool bB2T = pStartFrame->IsVertLRBT(); // If there's no doubleline portion involved or start and end are both // in the same doubleline portion, all works fine, but otherwise @@ -2370,7 +2371,7 @@ void SwRootFrame::CalcFrameRects(SwShellCursor &rCursor) { Point aTmpSt( aStRect.Pos() ); Point aTmpEnd( aEndRect.Right(), aEndRect.Bottom() ); - if( bSameRotatedOrBidi || bR2L ) + if (bSameRotatedOrBidi || bR2L || bB2T) { if( aTmpSt.Y() > aTmpEnd.Y() ) { |