diff options
author | László Németh <nemeth@numbertext.org> | 2024-05-30 01:22:59 +0200 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2024-05-31 09:47:59 +0200 |
commit | 2f7bb481c57458a38769ebd961f07cc45767f1f7 (patch) | |
tree | 9c2ebd82718cdb5a21a96ce0f8dc8b7ee6fea793 /sw/source/uibase/docvw | |
parent | ae92ffe8f058a86b35318517e6136701f1886d74 (diff) |
tdf#161332 sw: fix missing selection of floating table
A fixed-height cell can contain a bigger image, which is
cropped by cell boundaries. In this case, it was not
possible to select the floating table by clicking on its
right border.
Note: fix also tests of tdf#44773 and tdf#160836 related
to DPI-dependent platforms, see tdf#160992.
Follow-up to commit 30de13743f144aced83bc43d310592f82788c910
"tdf#160836 sw: resize rows at images cropped by row height"
and commit f3b899655018397e71300dbb32cdf4f82940a68b
"tdf#160842 sw: select cell content instead of cropped part of image".
Change-Id: I22c3e34f4c8147736c29b62722f7fc43c862ba48
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/168237
Reviewed-by: László Németh <nemeth@numbertext.org>
Tested-by: Jenkins
Diffstat (limited to 'sw/source/uibase/docvw')
-rw-r--r-- | sw/source/uibase/docvw/edtwin.cxx | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx index b0d7adcf36c3..3752d4a418f4 100644 --- a/sw/source/uibase/docvw/edtwin.cxx +++ b/sw/source/uibase/docvw/edtwin.cxx @@ -3361,7 +3361,8 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) !GetView().GetViewFrame().GetDispatcher()->IsLocked()) { // Test if there is a draw object at that position and if it should be selected. - bool bShould = rSh.ShouldObjectBeSelected(aDocPos); + bool bSelectFrameInsteadOfCroppedImage = false; + bool bShould = rSh.ShouldObjectBeSelected(aDocPos, &bSelectFrameInsteadOfCroppedImage); if(bShould) { @@ -3372,6 +3373,14 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) rSh.LockView( true ); bool bSelObj = rSh.SelectObj(aDocPos, aMEvt.IsMod1() ? SW_ENTER_GROUP : 0); + if ( bSelObj && bSelectFrameInsteadOfCroppedImage ) + { + bool bWrapped(false); + const SdrObject* pFly = rSh.GetBestObject(false, GotoObjFlags::FlyAny, true, nullptr, &bWrapped); + pSdrView->UnmarkAllObj(); + bSelObj = + rSh.SelectObj(aDocPos, aMEvt.IsMod1() ? SW_ENTER_GROUP : 0, const_cast<SdrObject*>(pFly)); + } if( bUnLockView ) rSh.LockView( false ); |