rhbz#1774688 backport bltr cell clicking fix

This commit is contained in:
Caolán McNamara 2019-11-21 11:21:24 +00:00
parent d7f5fb6258
commit 0d9c470bde
2 changed files with 99 additions and 1 deletions

View File

@ -0,0 +1,94 @@
From fe7deff845c39a351a92b8e01168a527fc237a9b Mon Sep 17 00:00:00 2001
From: Miklos Vajna <vmiklos@collabora.com>
Date: Tue, 29 Oct 2019 15:29:59 +0100
Subject: [PATCH] tdf#128399 sw btlr: fix clicking to lower rotated cell
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
In case a table has more than 1 btlr cells in multiple rows, the first
captured the mouse.
This was because SwFrame::GetPaintArea() assumed that left and right
edges can be compared directly, without going via the SwRectFnSet
abstraction. This works for hozizontal and plain vertical directions,
but not for btlr.
(cherry picked from commit 435ab51ec8920033b7865f27f4afee8a852a0b31)
Conflicts:
sw/qa/extras/layout/layout.cxx
Change-Id: Ia3bd7623a5d8d9ad3bdfabceb10adc0dbf105059
Reviewed-on: https://gerrit.libreoffice.org/81733
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
---
sw/qa/extras/layout/data/tdf128399.docx | Bin 0 -> 13132 bytes
sw/qa/extras/layout/layout.cxx | 27 ++++++++++++++++++++++++
sw/source/core/layout/ssfrm.cxx | 13 ++++++------
3 files changed, 34 insertions(+), 6 deletions(-)
create mode 100644 sw/qa/extras/layout/data/tdf128399.docx
diff --git a/sw/source/core/layout/ssfrm.cxx b/sw/source/core/layout/ssfrm.cxx
index 8ff47322e0c0..90b5e2958af2 100644
--- a/sw/source/core/layout/ssfrm.cxx
+++ b/sw/source/core/layout/ssfrm.cxx
@@ -623,6 +623,7 @@ const SwRect SwFrame::GetPaintArea() const
SwRect aRect = IsRowFrame() ? GetUpper()->getFrameArea() : getFrameArea();
const bool bVert = IsVertical();
SwRectFn fnRect = bVert ? ( IsVertLR() ? (IsVertLRBT() ? fnRectVertL2RB2T : fnRectVertL2R) : fnRectVert ) : fnRectHori;
+ SwRectFnSet aRectFnSet(this);
long nRight = (aRect.*fnRect->fnGetRight)();
long nLeft = (aRect.*fnRect->fnGetLeft)();
const SwFrame* pTmp = this;
@@ -651,9 +652,9 @@ const SwRect SwFrame::GetPaintArea() const
pTmp->IsCellFrame() || pTmp->IsRowFrame() || //nobody leaves a table!
pTmp->IsRootFrame() )
{
- if( bLeft || nLeft < nTmpLeft )
+ if( bLeft || aRectFnSet.XDiff(nTmpLeft, nLeft) > 0 )
nLeft = nTmpLeft;
- if( bRight || nTmpRight < nRight )
+ if( bRight || aRectFnSet.XDiff(nRight, nTmpRight) > 0 )
nRight = nTmpRight;
if( pTmp->IsPageFrame() || pTmp->IsFlyFrame() || pTmp->IsRootFrame() )
break;
@@ -666,14 +667,14 @@ const SwRect SwFrame::GetPaintArea() const
// the first column has _no_ influence to the left range
if( bR2L ? pTmp->GetNext() : pTmp->GetPrev() )
{
- if( bLeft || nLeft < nTmpLeft )
+ if( bLeft || aRectFnSet.XDiff(nTmpLeft, nLeft) > 0 )
nLeft = nTmpLeft;
bLeft = false;
}
// the last column has _no_ influence to the right range
if( bR2L ? pTmp->GetPrev() : pTmp->GetNext() )
{
- if( bRight || nTmpRight < nRight )
+ if( bRight || aRectFnSet.XDiff(nRight, nTmpRight) > 0 )
nRight = nTmpRight;
bRight = false;
}
@@ -686,14 +687,14 @@ const SwRect SwFrame::GetPaintArea() const
// the next frame of a body frame may be a footnotecontainer or
// a footer. The footnotecontainer has the same direction like
// the body frame.
- if( pTmp->GetPrev() && ( bLeft || nLeft < nTmpLeft ) )
+ if( pTmp->GetPrev() && ( bLeft || aRectFnSet.XDiff(nTmpLeft, nLeft) > 0 ) )
{
nLeft = nTmpLeft;
bLeft = false;
}
if( pTmp->GetNext() &&
( pTmp->GetNext()->IsFooterFrame() || pTmp->GetNext()->GetNext() )
- && ( bRight || nTmpRight < nRight ) )
+ && ( bRight || aRectFnSet.XDiff(nRight, nTmpRight) > 0 ) )
{
nRight = nTmpRight;
bRight = false;
--
2.23.0

View File

@ -54,7 +54,7 @@ Summary: Free Software Productivity Suite
Name: libreoffice
Epoch: 1
Version: %{libo_version}.2
Release: 3%{?libo_prerelease}%{?dist}
Release: 4%{?libo_prerelease}%{?dist}
License: (MPLv1.1 or LGPLv3+) and LGPLv3 and LGPLv2+ and BSD and (MPLv1.1 or GPLv2 or LGPLv2 or Netscape) and Public Domain and ASL 2.0 and MPLv2.0 and CC0
URL: http://www.libreoffice.org/
@ -244,6 +244,7 @@ Patch2: 0001-setting-has-default-true-on-an-element-in-a-GtkPopov.patch
Patch3: 0001-Resolves-rhbz-1766990-starmath-might-not-be-availabl.patch
Patch4: 0001-rhbz-1773525-reducing-the-amount-of-saved-search-rep.patch
Patch5: 0002-rhbz-1773525-wrong-elements-removed-from-saved-entri.patch
Patch6: 0001-tdf-128399-sw-btlr-fix-clicking-to-lower-rotated-cel.patch
%if 0%{?rhel}
# not upstreamed
@ -2136,6 +2137,9 @@ done
%{_includedir}/LibreOfficeKit
%changelog
* Thu Nov 21 2019 Caolán McNamara <caolanm@redhat.com> - 1:6.3.3.2-4
- rhbz#1774688 backport bltr cell clicking fix
* Mon Nov 18 2019 Caolán McNamara <caolanm@redhat.com> - 1:6.3.3.2-3
- rhbz#1773525 fix find&replace search save limit