diff --git a/include/vcl/floatwin.hxx b/include/vcl/floatwin.hxx index 5169303eb385..ba8cf93fdce3 100644 --- a/include/vcl/floatwin.hxx +++ b/include/vcl/floatwin.hxx @@ -32,25 +32,24 @@ enum class FloatWinPopupFlags { NONE = 0x000000, AllowTearOff = 0x000001, - NoAutoArrange = 0x000002, - NoAnimation = 0x000004, - Down = 0x000008, - Up = 0x000010, - Left = 0x000020, - Right = 0x000040, - NoKeyClose = 0x000080, - NoMouseClose = 0x000100, - NoMouseRectClose = 0x000200, - AllMouseButtonClose = 0x000400, - NoAppFocusClose = 0x000800, - NewLevel = 0x001000, - NoMouseUpClose = 0x002000, - GrabFocus = 0x004000, - NoHorzPlacement = 0x008000, + NoAnimation = 0x000002, + Down = 0x000004, + Up = 0x000008, + Left = 0x000010, + Right = 0x000020, + NoKeyClose = 0x000040, + NoMouseClose = 0x000080, + NoMouseRectClose = 0x000100, + AllMouseButtonClose = 0x000200, + NoAppFocusClose = 0x000400, + NewLevel = 0x000800, + NoMouseUpClose = 0x001000, + GrabFocus = 0x002000, + NoHorzPlacement = 0x004000, }; namespace o3tl { - template<> struct typed_flags : is_typed_flags {}; + template<> struct typed_flags : is_typed_flags {}; } enum class FloatWinPopupEndFlags diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx index 1ab4a8fce899..68d44be3dbf0 100644 --- a/vcl/source/window/floatwin.cxx +++ b/vcl/source/window/floatwin.cxx @@ -267,7 +267,6 @@ Point FloatingWindow::ImplCalcPos( vcl::Window* pWindow, Application::GetBestScreen( bRTL ? devRectRTL : devRect ) ); FloatWinPopupFlags nArrangeAry[5]; - sal_uInt16 nArrangeIndex; Point e1,e2; // the common edge between the item rect and the floating window if ( nFlags & FloatWinPopupFlags::Left ) @@ -302,10 +301,8 @@ Point FloatingWindow::ImplCalcPos( vcl::Window* pWindow, nArrangeAry[3] = FloatWinPopupFlags::Left; nArrangeAry[4] = FloatWinPopupFlags::Down; } - if ( nFlags & FloatWinPopupFlags::NoAutoArrange ) - nArrangeIndex = 4; - else - nArrangeIndex = 0; + + sal_uInt16 nArrangeIndex = 0; for ( ; nArrangeIndex < 5; nArrangeIndex++ ) { @@ -397,7 +394,7 @@ Point FloatingWindow::ImplCalcPos( vcl::Window* pWindow, } // adjust if necessary - if ( bBreak && !(nFlags & FloatWinPopupFlags::NoAutoArrange) ) + if (bBreak) { if ( (nArrangeAry[nArrangeIndex] == FloatWinPopupFlags::Left) || (nArrangeAry[nArrangeIndex] == FloatWinPopupFlags::Right) ) @@ -737,8 +734,7 @@ void FloatingWindow::StartPopupMode( ToolBox* pBox, FloatWinPopupFlags nFlags ) // set Flags for positioning if ( !(nFlags & (FloatWinPopupFlags::Down | FloatWinPopupFlags::Up | - FloatWinPopupFlags::Left | FloatWinPopupFlags::Right | - FloatWinPopupFlags::NoAutoArrange)) ) + FloatWinPopupFlags::Left | FloatWinPopupFlags::Right)) ) { if ( pBox->IsHorizontal() ) nFlags |= FloatWinPopupFlags::Down;