diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-08-18 16:32:18 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-08-19 06:53:09 +0200 |
commit | 4105174973aaabc25148e53571b7a4fc356098de (patch) | |
tree | 7a5b9797fab59a6a33782435f5b29be6f5dc166f | |
parent | 793246e1ae1266e8bd4261aa45dad40f5da16785 (diff) |
convert extended WinBits to scoped enum
Change-Id: If35f4fcda2415c858ba8f963e9f471c87169bc99
Reviewed-on: https://gerrit.libreoffice.org/41301
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | dbaccess/source/ui/misc/controllerframe.cxx | 2 | ||||
-rw-r--r-- | dbaccess/source/ui/misc/databaseobjectview.cxx | 2 | ||||
-rw-r--r-- | desktop/source/app/app.cxx | 4 | ||||
-rw-r--r-- | framework/source/helper/tagwindowasmodified.cxx | 4 | ||||
-rw-r--r-- | framework/source/services/taskcreatorsrv.cxx | 2 | ||||
-rw-r--r-- | include/tools/wintypes.hxx | 4 | ||||
-rw-r--r-- | include/vcl/window.hxx | 17 | ||||
-rw-r--r-- | vcl/inc/window.h | 2 | ||||
-rw-r--r-- | vcl/source/window/window.cxx | 8 | ||||
-rw-r--r-- | vcl/source/window/window2.cxx | 4 |
10 files changed, 28 insertions, 21 deletions
diff --git a/dbaccess/source/ui/misc/controllerframe.cxx b/dbaccess/source/ui/misc/controllerframe.cxx index 9c885ee40fb9..006f0ed9cee6 100644 --- a/dbaccess/source/ui/misc/controllerframe.cxx +++ b/dbaccess/source/ui/misc/controllerframe.cxx @@ -261,7 +261,7 @@ namespace dbaui const vcl::Window* pContainerWindow = VCLUnoHelper::GetWindow( xContainerWindow ); ENSURE_OR_THROW( pContainerWindow, "no Window implementation for the frame's container window!" ); - m_pData->m_bIsTopLevelDocumentWindow = ( pContainerWindow->GetExtendedStyle() & WB_EXT_DOCUMENT ) != 0; + m_pData->m_bIsTopLevelDocumentWindow = bool( pContainerWindow->GetExtendedStyle() & WindowExtendedStyle::Document ); } const Reference< XTopWindow > xFrameContainer( xContainerWindow, UNO_QUERY ); diff --git a/dbaccess/source/ui/misc/databaseobjectview.cxx b/dbaccess/source/ui/misc/databaseobjectview.cxx index 745d31adc9a5..e6215b72f967 100644 --- a/dbaccess/source/ui/misc/databaseobjectview.cxx +++ b/dbaccess/source/ui/misc/databaseobjectview.cxx @@ -133,7 +133,7 @@ namespace dbaui const Reference< XWindow > xFrameWindow( xFrame->getContainerWindow(), UNO_SET_THROW ); VclPtr<vcl::Window> pContainerWindow = VCLUnoHelper::GetWindow( xFrameWindow ); ENSURE_OR_THROW( pContainerWindow, "no implementation access to the frame's container window!" ); - pContainerWindow->SetExtendedStyle( pContainerWindow->GetExtendedStyle() | WB_EXT_DOCUMENT ); + pContainerWindow->SetExtendedStyle( pContainerWindow->GetExtendedStyle() | WindowExtendedStyle::Document ); } Reference< XComponentLoader > xFrameLoader( m_xFrameLoader, UNO_QUERY_THROW ); diff --git a/desktop/source/app/app.cxx b/desktop/source/app/app.cxx index 7557e78a414b..f71355c03b7a 100644 --- a/desktop/source/app/app.cxx +++ b/desktop/source/app/app.cxx @@ -2591,12 +2591,12 @@ void Desktop::ShowBackingComponent(Desktop * progress) xContainerWindow = xBackingFrame->getContainerWindow(); if (xContainerWindow.is()) { - // set the WB_EXT_DOCUMENT style. Normally, this is done by the TaskCreator service when a "_blank" + // set the WindowExtendedStyle::Document style. Normally, this is done by the TaskCreator service when a "_blank" // frame/window is created. Since we do not use the TaskCreator here, we need to mimic its behavior, // otherwise documents loaded into this frame will later on miss functionality depending on the style. VclPtr<vcl::Window> pContainerWindow = VCLUnoHelper::GetWindow( xContainerWindow ); SAL_WARN_IF( !pContainerWindow, "desktop.app", "Desktop::Main: no implementation access to the frame's container window!" ); - pContainerWindow->SetExtendedStyle( pContainerWindow->GetExtendedStyle() | WB_EXT_DOCUMENT ); + pContainerWindow->SetExtendedStyle( pContainerWindow->GetExtendedStyle() | WindowExtendedStyle::Document ); if (progress != nullptr) { progress->SetSplashScreenProgress(75); diff --git a/framework/source/helper/tagwindowasmodified.cxx b/framework/source/helper/tagwindowasmodified.cxx index b17dc129a242..bb2f3958cae8 100644 --- a/framework/source/helper/tagwindowasmodified.cxx +++ b/framework/source/helper/tagwindowasmodified.cxx @@ -95,9 +95,9 @@ void SAL_CALL TagWindowAsModified::modified(const css::lang::EventObject& aEvent return; if (bModified) - pWindow->SetExtendedStyle(WB_EXT_DOCMODIFIED); + pWindow->SetExtendedStyle(WindowExtendedStyle::DocModified); else - pWindow->SetExtendedStyle(0); + pWindow->SetExtendedStyle(WindowExtendedStyle::NONE); // <- SYNCHRONIZED } diff --git a/framework/source/services/taskcreatorsrv.cxx b/framework/source/services/taskcreatorsrv.cxx index 13c5a5679bba..b6f6a7ff1920 100644 --- a/framework/source/services/taskcreatorsrv.cxx +++ b/framework/source/services/taskcreatorsrv.cxx @@ -202,7 +202,7 @@ void TaskCreatorService::implts_applyDocStyleToWindow(const css::uno::Reference< SolarMutexGuard aSolarGuard; VclPtr<vcl::Window> pVCLWindow = VCLUnoHelper::GetWindow(xWindow); if (pVCLWindow) - pVCLWindow->SetExtendedStyle(WB_EXT_DOCUMENT); + pVCLWindow->SetExtendedStyle(WindowExtendedStyle::Document); // <- SYNCHRONIZED } diff --git a/include/tools/wintypes.hxx b/include/tools/wintypes.hxx index 7c0c29a87a82..def5ffd6bb09 100644 --- a/include/tools/wintypes.hxx +++ b/include/tools/wintypes.hxx @@ -271,10 +271,6 @@ WinBits const WB_SAVEAS = 0x00400000; // Window-Bits for TabControl WinBits const WB_SLIDERSET = 0x02000000; -// extended WinBits -WinBits const WB_EXT_DOCUMENT = 0x00000001; -WinBits const WB_EXT_DOCMODIFIED = 0x00000002; - // WindowAlign enum class WindowAlign { Left, Top, Right, Bottom }; diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx index 3b8a42ac5d0b..c4d3540df1d9 100644 --- a/include/vcl/window.hxx +++ b/include/vcl/window.hxx @@ -451,8 +451,9 @@ class ImplDockingWindowWrapper; class ImplPopupFloatWin; class MenuFloatingWindow; class LifecycleTest; - namespace svt { class PopupWindowControllerImpl; } + + enum class WindowHitTest { NONE = 0x0000, Inside = 0x0001, @@ -462,6 +463,16 @@ namespace o3tl { template<> struct typed_flags<WindowHitTest> : is_typed_flags<WindowHitTest, 0x0003> {}; }; + +enum class WindowExtendedStyle { + NONE = 0x0000, + Document = 0x0001, + DocModified = 0x0002, +}; +namespace o3tl { + template<> struct typed_flags<WindowExtendedStyle> : is_typed_flags<WindowExtendedStyle, 0x0003> {}; +}; + namespace vcl { class VCL_DLLPUBLIC RenderTools @@ -823,8 +834,8 @@ public: void SetStyle( WinBits nStyle ); WinBits GetStyle() const; WinBits GetPrevStyle() const; - void SetExtendedStyle( WinBits nExtendedStyle ); - WinBits GetExtendedStyle() const; + void SetExtendedStyle( WindowExtendedStyle nExtendedStyle ); + WindowExtendedStyle GetExtendedStyle() const; void SetType( WindowType nType ); WindowType GetType() const; bool IsSystemWindow() const; diff --git a/vcl/inc/window.h b/vcl/inc/window.h index d5c58195f7ae..f7b25824397e 100644 --- a/vcl/inc/window.h +++ b/vcl/inc/window.h @@ -268,7 +268,7 @@ public: vcl::Region* mpPaintRegion; //< only set during Paint() method call (window coordinates) WinBits mnStyle; WinBits mnPrevStyle; - WinBits mnExtendedStyle; + WindowExtendedStyle mnExtendedStyle; WindowType mnType; ControlPart mnNativeBackground; sal_uInt16 mnWaitCount; diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 83827450d5b4..283ee5712c09 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -637,7 +637,7 @@ WindowImpl::WindowImpl( WindowType nType ) mpPaintRegion = nullptr; // Paint-ClipRegion mnStyle = 0; // style (init in ImplInitWindow) mnPrevStyle = 0; // prevstyle (set in SetStyle) - mnExtendedStyle = 0; // extended style (init in ImplInitWindow) + mnExtendedStyle = WindowExtendedStyle::NONE; // extended style (init in ImplInitWindow) mnType = nType; // type mnGetFocusFlags = GetFocusFlags::NONE; // Flags for GetFocus()-Call mnWaitCount = 0; // Wait-Count (>1 == Warte-MousePointer) @@ -1972,7 +1972,7 @@ void Window::SetStyle( WinBits nStyle ) } } -void Window::SetExtendedStyle( WinBits nExtendedStyle ) +void Window::SetExtendedStyle( WindowExtendedStyle nExtendedStyle ) { if ( mpWindowImpl->mnExtendedStyle != nExtendedStyle ) @@ -1983,9 +1983,9 @@ void Window::SetExtendedStyle( WinBits nExtendedStyle ) if( pWindow->mpWindowImpl->mbFrame ) { SalExtStyle nExt = 0; - if( nExtendedStyle & WB_EXT_DOCUMENT ) + if( nExtendedStyle & WindowExtendedStyle::Document ) nExt |= SAL_FRAME_EXT_STYLE_DOCUMENT; - if( nExtendedStyle & WB_EXT_DOCMODIFIED ) + if( nExtendedStyle & WindowExtendedStyle::DocModified ) nExt |= SAL_FRAME_EXT_STYLE_DOCMODIFIED; pWindow->ImplGetFrame()->SetExtendedFrameStyle( nExt ); diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx index de44129ab447..c58b2d61d1e0 100644 --- a/vcl/source/window/window2.cxx +++ b/vcl/source/window/window2.cxx @@ -1012,9 +1012,9 @@ WinBits Window::GetPrevStyle() const return mpWindowImpl ? mpWindowImpl->mnPrevStyle : 0; } -WinBits Window::GetExtendedStyle() const +WindowExtendedStyle Window::GetExtendedStyle() const { - return mpWindowImpl ? mpWindowImpl->mnExtendedStyle : 0; + return mpWindowImpl ? mpWindowImpl->mnExtendedStyle : WindowExtendedStyle::NONE; } void Window::SetType( WindowType nType ) |