[Libreoffice-commits] core.git: vcl/source
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Wed Jun 17 08:01:01 UTC 2020
vcl/source/control/imp_listbox.cxx | 2 +-
vcl/source/window/floatwin.cxx | 26 ++++++++++++++++++++++----
2 files changed, 23 insertions(+), 5 deletions(-)
New commits:
commit c2d7c9d275a8564428f981e7d146c35f4394741c
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Jun 16 21:21:17 2020 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed Jun 17 10:00:27 2020 +0200
we already have a NoHorzPlacement flag so use that
to indicate we don't want left/right placement
Change-Id: Ibda0d4729b7adc997fd45308ea1cd32674ace92d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96480
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/vcl/source/control/imp_listbox.cxx b/vcl/source/control/imp_listbox.cxx
index c8b337ad0929..a1b704eec9b8 100644
--- a/vcl/source/control/imp_listbox.cxx
+++ b/vcl/source/control/imp_listbox.cxx
@@ -3078,7 +3078,7 @@ void ImplListBoxFloatingWindow::StartFloat( bool bStartTracking )
pGrandparentOutDev->ReMirror( aRect );
// mouse-button right: close the List-Box-Float-win and don't stop the handling fdo#84795
- StartPopupMode( aRect, FloatWinPopupFlags::Down | FloatWinPopupFlags::AllMouseButtonClose );
+ StartPopupMode( aRect, FloatWinPopupFlags::Down | FloatWinPopupFlags::NoHorzPlacement | FloatWinPopupFlags::AllMouseButtonClose );
if( nPos != LISTBOX_ENTRY_NOTFOUND )
mpImplLB->ShowProminentEntry( nPos );
diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx
index a9a3e7163bb2..95f39fba5955 100644
--- a/vcl/source/window/floatwin.cxx
+++ b/vcl/source/window/floatwin.cxx
@@ -288,15 +288,33 @@ Point FloatingWindow::ImplCalcPos(vcl::Window* pWindow,
{
nArrangeAry[0] = FloatWinPopupFlags::Up;
nArrangeAry[1] = FloatWinPopupFlags::Down;
- nArrangeAry[2] = FloatWinPopupFlags::Up;
- nArrangeAttempts = 3;
+ if (nFlags & FloatWinPopupFlags::NoHorzPlacement)
+ {
+ nArrangeAry[2] = FloatWinPopupFlags::Up;
+ nArrangeAttempts = 3;
+ }
+ else
+ {
+ nArrangeAry[2] = FloatWinPopupFlags::Right;
+ nArrangeAry[3] = FloatWinPopupFlags::Left;
+ nArrangeAry[4] = FloatWinPopupFlags::Up;
+ }
}
else
{
nArrangeAry[0] = FloatWinPopupFlags::Down;
nArrangeAry[1] = FloatWinPopupFlags::Up;
- nArrangeAry[2] = FloatWinPopupFlags::Down;
- nArrangeAttempts = 3;
+ if (nFlags & FloatWinPopupFlags::NoHorzPlacement)
+ {
+ nArrangeAry[2] = FloatWinPopupFlags::Down;
+ nArrangeAttempts = 3;
+ }
+ else
+ {
+ nArrangeAry[2] = FloatWinPopupFlags::Right;
+ nArrangeAry[3] = FloatWinPopupFlags::Left;
+ nArrangeAry[4] = FloatWinPopupFlags::Down;
+ }
}
sal_uInt16 nArrangeIndex = 0;
More information about the Libreoffice-commits
mailing list