summaryrefslogtreecommitdiff
path: root/sw/source/core/layout/ssfrm.cxx
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2019-03-13 21:35:42 +0100
committerMiklos Vajna <vmiklos@collabora.com>2019-03-14 09:05:50 +0100
commit2f83055cdbd915d5036a7b4374b4ad10e6efc65f (patch)
treef8eb88d7030a771076345d6a2e9ad29d2d6520b9 /sw/source/core/layout/ssfrm.cxx
parent00f96e88a7c6feea98d446e82a2718c5aae6256c (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/core/layout/ssfrm.cxx')
-rw-r--r--sw/source/core/layout/ssfrm.cxx9
1 files changed, 5 insertions, 4 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;
}