Kaydet (Commit) 41051749 authored tarafından Noel Grandin's avatar Noel Grandin

convert extended WinBits to scoped enum

Change-Id: If35f4fcda2415c858ba8f963e9f471c87169bc99
Reviewed-on: https://gerrit.libreoffice.org/41301Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
Tested-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 793246e1
......@@ -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 );
......
......@@ -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 );
......
......@@ -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);
......
......@@ -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
}
......
......@@ -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
}
......
......@@ -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 };
......
......@@ -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;
......
......@@ -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;
......
......@@ -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 );
......
......@@ -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 )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment