summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/vcl/floatwin.hxx21
-rw-r--r--vcl/source/window/floatwin.cxx22
-rw-r--r--vcl/source/window/scrwnd.cxx2
-rw-r--r--vcl/source/window/window.cxx2
4 files changed, 25 insertions, 22 deletions
diff --git a/include/vcl/floatwin.hxx b/include/vcl/floatwin.hxx
index 2a35d6e6dc4f..16f52cb8fed4 100644
--- a/include/vcl/floatwin.hxx
+++ b/include/vcl/floatwin.hxx
@@ -71,11 +71,14 @@ namespace o3tl
template<> struct typed_flags<FloatWinPopupEndFlags> : is_typed_flags<FloatWinPopupEndFlags, 0x0f> {};
}
-#define FLOATWIN_TITLE_NORMAL ((sal_uInt16)0x0001)
-#define FLOATWIN_TITLE_TEAROFF ((sal_uInt16)0x0002)
-#define FLOATWIN_TITLE_POPUP ((sal_uInt16)0x0004)
-#define FLOATWIN_TITLE_NONE ((sal_uInt16)0x0008)
-
+enum class FloatWinTitleType
+{
+ Unknown = 0,
+ Normal = 1,
+ TearOff = 2,
+ Popup = 3,
+ NONE = 4,
+};
enum HitTest
{
@@ -96,8 +99,8 @@ private:
Rectangle maFloatRect;
ImplSVEvent * mnPostId;
FloatWinPopupFlags mnPopupModeFlags;
- sal_uInt16 mnTitle;
- sal_uInt16 mnOldTitle;
+ FloatWinTitleType mnTitle;
+ FloatWinTitleType mnOldTitle;
bool mbInPopupMode;
bool mbPopupMode;
bool mbPopupModeCanceled;
@@ -147,8 +150,8 @@ public:
virtual void PopupModeEnd();
- void SetTitleType( sal_uInt16 nTitle );
- sal_uInt16 GetTitleType() const { return mnTitle; }
+ void SetTitleType( FloatWinTitleType nTitle );
+ FloatWinTitleType GetTitleType() const { return mnTitle; }
void StartPopupMode( const Rectangle& rRect, FloatWinPopupFlags nFlags = FloatWinPopupFlags::NONE );
void StartPopupMode( ToolBox* pBox, FloatWinPopupFlags nFlags = FloatWinPopupFlags::NONE );
diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx
index 34d1023cc7c6..413aeef50ea8 100644
--- a/vcl/source/window/floatwin.cxx
+++ b/vcl/source/window/floatwin.cxx
@@ -121,7 +121,7 @@ void FloatingWindow::ImplInit( vcl::Window* pParent, WinBits nStyle )
mpNextFloat = NULL;
mpFirstPopupModeWin = NULL;
mnPostId = 0;
- mnTitle = (nStyle & (WB_MOVEABLE | WB_POPUP)) ? FLOATWIN_TITLE_NORMAL : FLOATWIN_TITLE_NONE;
+ mnTitle = (nStyle & (WB_MOVEABLE | WB_POPUP)) ? FloatWinTitleType::Normal : FloatWinTitleType::NONE;
mnOldTitle = mnTitle;
mnPopupModeFlags = FloatWinPopupFlags::NONE;
mbInPopupMode = false;
@@ -160,8 +160,8 @@ FloatingWindow::FloatingWindow(vcl::Window* pParent, const OString& rID, const O
, mpImplData(0)
, mnPostId(0)
, mnPopupModeFlags(FloatWinPopupFlags::NONE)
- , mnTitle(0)
- , mnOldTitle(0)
+ , mnTitle(FloatWinTitleType::Unknown)
+ , mnOldTitle(FloatWinTitleType::Unknown)
, mbInPopupMode(false)
, mbPopupMode(false)
, mbPopupModeCanceled(false)
@@ -599,20 +599,20 @@ void FloatingWindow::PopupModeEnd()
maPopupModeEndHdl.Call( this );
}
-void FloatingWindow::SetTitleType( sal_uInt16 nTitle )
+void FloatingWindow::SetTitleType( FloatWinTitleType nTitle )
{
if ( (mnTitle != nTitle) && mpWindowImpl->mpBorderWindow )
{
mnTitle = nTitle;
Size aOutSize = GetOutputSizePixel();
sal_uInt16 nTitleStyle;
- if ( nTitle == FLOATWIN_TITLE_NORMAL )
+ if ( nTitle == FloatWinTitleType::Normal )
nTitleStyle = BORDERWINDOW_TITLE_SMALL;
- else if ( nTitle == FLOATWIN_TITLE_TEAROFF )
+ else if ( nTitle == FloatWinTitleType::TearOff )
nTitleStyle = BORDERWINDOW_TITLE_TEAROFF;
- else if ( nTitle == FLOATWIN_TITLE_POPUP )
+ else if ( nTitle == FloatWinTitleType::Popup )
nTitleStyle = BORDERWINDOW_TITLE_POPUP;
- else // nTitle == FLOATWIN_TITLE_NONE
+ else // nTitle == FloatWinTitleType::NONE
nTitleStyle = BORDERWINDOW_TITLE_NONE;
static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->SetTitleType( nTitleStyle, aOutSize );
static_cast<ImplBorderWindow*>(mpWindowImpl->mpBorderWindow.get())->GetBorder( mpWindowImpl->mnLeftBorder, mpWindowImpl->mnTopBorder, mpWindowImpl->mnRightBorder, mpWindowImpl->mnBottomBorder );
@@ -631,11 +631,11 @@ void FloatingWindow::StartPopupMode( const Rectangle& rRect, FloatWinPopupFlags
// remove title
mnOldTitle = mnTitle;
if ( ( mpWindowImpl->mnStyle & WB_POPUP ) && !GetText().isEmpty() )
- SetTitleType( FLOATWIN_TITLE_POPUP );
+ SetTitleType( FloatWinTitleType::Popup );
else if ( nFlags & FloatWinPopupFlags::AllowTearOff )
- SetTitleType( FLOATWIN_TITLE_TEAROFF );
+ SetTitleType( FloatWinTitleType::TearOff );
else
- SetTitleType( FLOATWIN_TITLE_NONE );
+ SetTitleType( FloatWinTitleType::NONE );
// avoid close on focus change for decorated floating windows only
if( mpWindowImpl->mbFrame && (GetStyle() & WB_MOVEABLE) )
diff --git a/vcl/source/window/scrwnd.cxx b/vcl/source/window/scrwnd.cxx
index 6fe7049159e0..da613bd330ae 100644
--- a/vcl/source/window/scrwnd.cxx
+++ b/vcl/source/window/scrwnd.cxx
@@ -57,7 +57,7 @@ ImplWheelWindow::ImplWheelWindow( vcl::Window* pParent ) :
mnMaxWidth = (sal_uLong) ( 0.4 * hypot( (double) aSize.Width(), aSize.Height() ) );
// create wheel window
- SetTitleType( FLOATWIN_TITLE_NONE );
+ SetTitleType( FloatWinTitleType::NONE );
ImplCreateImageList();
ResMgr* pResMgr = ImplGetResMgr();
Bitmap aBmp;
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index b42d7246bd4d..1b95b9a98749 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -3689,7 +3689,7 @@ bool Window::HasActiveChildFrame()
// but FloatingWindows carry this information in their TitleType...
// TODO: avoid duplicate WinBits !!!
if( pChildFrame && pChildFrame->ImplIsFloatingWindow() )
- bDecorated = static_cast<FloatingWindow*>(pChildFrame)->GetTitleType() != FLOATWIN_TITLE_NONE;
+ bDecorated = static_cast<FloatingWindow*>(pChildFrame)->GetTitleType() != FloatWinTitleType::NONE;
if( bDecorated || (pFrameWin->mpWindowImpl->mnStyle & (WB_MOVEABLE | WB_SIZEABLE) ) )
if( pChildFrame && pChildFrame->IsVisible() && pChildFrame->IsActive() )
{