summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAshod Nakashian <ashod.nakashian@collabora.co.uk>2019-05-29 23:33:25 -0400
committerMichael Meeks <michael.meeks@collabora.com>2020-05-27 21:58:29 +0100
commit81bd5d98b3e29d8c9872d90e170fd5812bf2d14d (patch)
tree71c5d6c7d70ad75085ddeaf9a5763180f3888ef4
parent9533249c5a905e123ee041f884ca2ea20e92474b (diff)
vcl: sfx2: LOK: Support per-view popup windows
While we do support multiple views, there is only one state for popup/floating windows, that also includes the dialogs open and related windows/data. This adds support to allow each view to have its own popups and state, thus allowing multiple users to interact with the dialogs independently of one another. (cherry picked from commit b50c341a53911f1d725947a4d8d3d2f782c94079) Change-Id: I3786a561ca6ca113ad12425bdb491e5a30bd1a28 Reviewed-on: https://gerrit.libreoffice.org/82440 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Ashod Nakashian <ashnakash@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/85221 Tested-by: Jenkins Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
-rw-r--r--include/sfx2/viewfrm.hxx1
-rw-r--r--include/vcl/svapp.hxx6
-rw-r--r--sfx2/source/view/viewfrm.cxx7
-rw-r--r--vcl/inc/svdata.hxx26
-rw-r--r--vcl/source/app/help.cxx8
-rw-r--r--vcl/source/app/salvtables.cxx2
-rw-r--r--vcl/source/app/stdtext.cxx10
-rw-r--r--vcl/source/app/svapp.cxx44
-rw-r--r--vcl/source/app/svdata.cxx62
-rw-r--r--vcl/source/app/svmain.cxx26
-rw-r--r--vcl/source/outdev/font.cxx4
-rw-r--r--vcl/source/outdev/map.cxx4
-rw-r--r--vcl/source/uitest/logger.cxx6
-rw-r--r--vcl/source/uitest/uitest.cxx6
-rw-r--r--vcl/source/window/brdwin.cxx2
-rw-r--r--vcl/source/window/cursor.cxx10
-rw-r--r--vcl/source/window/dialog.cxx38
-rw-r--r--vcl/source/window/event.cxx16
-rw-r--r--vcl/source/window/floatwin.cxx24
-rw-r--r--vcl/source/window/menu.cxx7
-rw-r--r--vcl/source/window/menubarwindow.cxx12
-rw-r--r--vcl/source/window/menufloatingwindow.cxx2
-rw-r--r--vcl/source/window/mouse.cxx36
-rw-r--r--vcl/source/window/msgbox.cxx82
-rw-r--r--vcl/source/window/scrwnd.cxx6
-rw-r--r--vcl/source/window/stacking.cxx2
-rw-r--r--vcl/source/window/syswin.cxx4
-rw-r--r--vcl/source/window/taskpanelist.cxx4
-rw-r--r--vcl/source/window/toolbox.cxx4
-rw-r--r--vcl/source/window/window.cxx85
-rw-r--r--vcl/source/window/window2.cxx60
-rw-r--r--vcl/source/window/winproc.cxx173
-rw-r--r--vcl/source/window/wrkwin.cxx11
-rw-r--r--vcl/unx/generic/window/salframe.cxx16
-rw-r--r--vcl/unx/gtk3/gtk3gtkframe.cxx6
35 files changed, 488 insertions, 324 deletions
diff --git a/include/sfx2/viewfrm.hxx b/include/sfx2/viewfrm.hxx
index 20bcc4904fcb..5335e0d000f2 100644
--- a/include/sfx2/viewfrm.hxx
+++ b/include/sfx2/viewfrm.hxx
@@ -50,6 +50,7 @@ class SFX2_DLLPUBLIC SfxViewFrame: public SfxShell, public SfxListener
std::unique_ptr<SfxDispatcher> m_pDispatcher;
SfxBindings* m_pBindings;
ImplSVHelpData* m_pHelpData;
+ ImplSVWinData* m_pWinData;
sal_uInt16 m_nAdjustPosPixelLock;
private:
diff --git a/include/vcl/svapp.hxx b/include/vcl/svapp.hxx
index 08efa5a95c0f..b3ed1feac501 100644
--- a/include/vcl/svapp.hxx
+++ b/include/vcl/svapp.hxx
@@ -1459,6 +1459,12 @@ VCL_DLLPUBLIC ImplSVHelpData* CreateSVHelpData();
VCL_DLLPUBLIC void DestroySVHelpData(ImplSVHelpData*);
VCL_DLLPUBLIC void SetSVHelpData(ImplSVHelpData*);
+/// The following are to manage per-view (frame) window data.
+struct ImplSVWinData;
+VCL_DLLPUBLIC ImplSVWinData* CreateSVWinData();
+VCL_DLLPUBLIC void DestroySVWinData(ImplSVWinData*);
+VCL_DLLPUBLIC void SetSVWinData(ImplSVWinData*);
+
inline void Application::EndYield()
{
PostUserEvent( Link<void*,void>() );
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 082c77aeba5a..1609afe72595 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -1571,6 +1571,7 @@ SfxViewFrame::SfxViewFrame
: m_pImpl( new SfxViewFrame_Impl( rFrame ) )
, m_pBindings( new SfxBindings )
, m_pHelpData(CreateSVHelpData())
+ , m_pWinData(CreateSVWinData())
, m_nAdjustPosPixelLock( 0 )
{
@@ -1616,6 +1617,9 @@ SfxViewFrame::~SfxViewFrame()
DestroySVHelpData(m_pHelpData);
m_pHelpData = nullptr;
+
+ DestroySVWinData(m_pWinData);
+ m_pWinData = nullptr;
}
// Remove and delete the Dispatcher.
@@ -3249,6 +3253,9 @@ void SfxViewFrame::SetViewFrame( SfxViewFrame* pFrame )
{
if(pFrame)
SetSVHelpData(pFrame->m_pHelpData);
+
+ SetSVWinData(pFrame ? pFrame->m_pWinData : nullptr);
+
SfxGetpApp()->SetViewFrame_Impl( pFrame );
}
diff --git a/vcl/inc/svdata.hxx b/vcl/inc/svdata.hxx
index 69fdcca77c46..51390f979c8a 100644
--- a/vcl/inc/svdata.hxx
+++ b/vcl/inc/svdata.hxx
@@ -230,13 +230,20 @@ struct ImplSVGDIData
o3tl::lru_map<OUString, gfx::DrawRoot> maThemeDrawCommandsCache = o3tl::lru_map<OUString, gfx::DrawRoot>(50);
};
-struct ImplSVWinData
+struct ImplSVFrameData
{
- ~ImplSVWinData();
+ ~ImplSVFrameData();
VclPtr<vcl::Window> mpFirstFrame; // First FrameWindow
+ VclPtr<vcl::Window> mpActiveApplicationFrame; // the last active application frame, can be used as DefModalDialogParent if no focuswin set
VclPtr<WorkWindow> mpAppWin; // Application-Window
+
+ std::unique_ptr<UITestLogger> m_pUITestLogger;
+};
+
+struct ImplSVWinData
+{
+ ~ImplSVWinData();
VclPtr<vcl::Window> mpFocusWin; // window, that has the focus
- VclPtr<vcl::Window> mpActiveApplicationFrame; // the last active application frame, can be used as DefModalDialogParent if no focuswin set
VclPtr<vcl::Window> mpCaptureWin; // window, that has the mouse capture
VclPtr<vcl::Window> mpLastDeacWin; // Window, that need a deactivate (FloatingWindow-Handling)
VclPtr<FloatingWindow> mpFirstFloat; // First FloatingWindow in PopupMode
@@ -253,8 +260,6 @@ struct ImplSVWinData
StartAutoScrollFlags mnAutoScrollFlags = StartAutoScrollFlags::NONE; // auto scroll flags
bool mbNoDeactivate = false; // true: do not execute Deactivate
bool mbNoSaveFocus = false; // true: menus must not save/restore focus
-
- std::unique_ptr<UITestLogger> m_pUITestLogger;
};
typedef std::vector< std::pair< OUString, FieldUnit > > FieldUnitStringList;
@@ -382,11 +387,12 @@ struct ImplSVData
bool mbFontUpdatesNewLists = false; // generate new font lists
bool mbResLocaleSet = false; // SV-Resource-Manager
std::locale maResLocale; // Resource locale
- ImplSchedulerContext maSchedCtx; // indepen data for class Scheduler
- ImplSVAppData maAppData; // indepen data for class Application
- ImplSVGDIData maGDIData; // indepen data for Output classes
- ImplSVWinData maWinData; // indepen data for Windows classes
- ImplSVCtrlData maCtrlData; // indepen data for Control classes
+ ImplSchedulerContext maSchedCtx; // Data for class Scheduler
+ ImplSVAppData maAppData; // Data for class Application
+ ImplSVGDIData maGDIData; // Data for Output classes
+ ImplSVFrameData maFrameData; // Data for Frame classes
+ ImplSVWinData* mpWinData = nullptr; // Data for per-view Windows classes
+ ImplSVCtrlData maCtrlData; // Data for Control classes
ImplSVHelpData* mpHelpData; // Data for Help classes
ImplSVNWFData maNWFData;
UnoWrapperBase* mpUnoWrapper = nullptr;
diff --git a/vcl/source/app/help.cxx b/vcl/source/app/help.cxx
index 5ad273cb2bbb..b5a7cb4cc057 100644
--- a/vcl/source/app/help.cxx
+++ b/vcl/source/app/help.cxx
@@ -114,8 +114,8 @@ bool Help::StartExtHelp()
aHelpData.mbExtHelpMode = true;
aHelpData.mbOldBalloonMode = aHelpData.mbBalloonHelp;
aHelpData.mbBalloonHelp = true;
- if ( pSVData->maWinData.mpAppWin )
- pSVData->maWinData.mpAppWin->ImplGenerateMouseMove();
+ if (pSVData->maFrameData.mpAppWin)
+ pSVData->maFrameData.mpAppWin->ImplGenerateMouseMove();
return true;
}
@@ -131,8 +131,8 @@ bool Help::EndExtHelp()
{
aHelpData.mbExtHelpMode = false;
aHelpData.mbBalloonHelp = aHelpData.mbOldBalloonMode;
- if ( pSVData->maWinData.mpAppWin )
- pSVData->maWinData.mpAppWin->ImplGenerateMouseMove();
+ if (pSVData->maFrameData.mpAppWin)
+ pSVData->maFrameData.mpAppWin->ImplGenerateMouseMove();
return true;
}
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index e4f576201514..9818f36f21dd 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -6134,7 +6134,7 @@ weld::Builder* Application::CreateInterimBuilder(weld::Widget* pParent, const OU
void SalInstanceWindow::help()
{
//show help for widget with keyboard focus
- vcl::Window* pWidget = ImplGetSVData()->maWinData.mpFocusWin;
+ vcl::Window* pWidget = ImplGetSVData()->mpWinData->mpFocusWin;
if (!pWidget)
pWidget = m_xWindow;
OString sHelpId = pWidget->GetHelpId();
diff --git a/vcl/source/app/stdtext.cxx b/vcl/source/app/stdtext.cxx
index 811c77e4f4b4..7d6bae82016c 100644
--- a/vcl/source/app/stdtext.cxx
+++ b/vcl/source/app/stdtext.cxx
@@ -36,7 +36,7 @@ void ShowServiceNotAvailableError(weld::Widget* pParent,
static void ImplInitMsgBoxImageList()
{
ImplSVData* pSVData = ImplGetSVData();
- std::vector<Image> &rImages = pSVData->maWinData.maMsgBoxImgList;
+ std::vector<Image> &rImages = pSVData->mpWinData->maMsgBoxImgList;
if (rImages.empty())
{
rImages.emplace_back(Image(StockImage::Yes, SV_RESID_BITMAP_ERRORBOX));
@@ -49,7 +49,7 @@ static void ImplInitMsgBoxImageList()
Image const & GetStandardInfoBoxImage()
{
ImplInitMsgBoxImageList();
- return ImplGetSVData()->maWinData.maMsgBoxImgList[3];
+ return ImplGetSVData()->mpWinData->maMsgBoxImgList[3];
}
OUString GetStandardInfoBoxText()
@@ -60,7 +60,7 @@ OUString GetStandardInfoBoxText()
Image const & GetStandardWarningBoxImage()
{
ImplInitMsgBoxImageList();
- return ImplGetSVData()->maWinData.maMsgBoxImgList[2];
+ return ImplGetSVData()->mpWinData->maMsgBoxImgList[2];
}
OUString GetStandardWarningBoxText()
@@ -71,7 +71,7 @@ OUString GetStandardWarningBoxText()
Image const & GetStandardErrorBoxImage()
{
ImplInitMsgBoxImageList();
- return ImplGetSVData()->maWinData.maMsgBoxImgList[0];
+ return ImplGetSVData()->mpWinData->maMsgBoxImgList[0];
}
OUString GetStandardErrorBoxText()
@@ -82,7 +82,7 @@ OUString GetStandardErrorBoxText()
Image const & GetStandardQueryBoxImage()
{
ImplInitMsgBoxImageList();
- return ImplGetSVData()->maWinData.maMsgBoxImgList[1];
+ return ImplGetSVData()->mpWinData->maMsgBoxImgList[1];
}
OUString GetStandardQueryBoxText()
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index 988fdb01aaaf..e2dbc7753e76 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -175,7 +175,7 @@ int Application::Main()
bool Application::QueryExit()
{
- WorkWindow* pAppWin = ImplGetSVData()->maWinData.mpAppWin;
+ WorkWindow* pAppWin = ImplGetSVData()->maFrameData.mpAppWin;
// call the close handler of the application window
if ( pAppWin )
@@ -289,8 +289,8 @@ const vcl::KeyCode* Application::GetReservedKeyCode( sal_uLong i )
IMPL_STATIC_LINK_NOARG( ImplSVAppData, ImplEndAllPopupsMsg, void*, void )
{
ImplSVData* pSVData = ImplGetSVData();
- while (pSVData->maWinData.mpFirstFloat)
- pSVData->maWinData.mpFirstFloat->EndPopupMode(FloatWinPopupEndFlags::Cancel);
+ while (pSVData->mpWinData->mpFirstFloat)
+ pSVData->mpWinData->mpFirstFloat->EndPopupMode(FloatWinPopupEndFlags::Cancel);
}
IMPL_STATIC_LINK_NOARG( ImplSVAppData, ImplEndAllDialogsMsg, void*, void )
@@ -473,7 +473,7 @@ void Scheduler::ProcessEventsToIdle()
// events were processed at some point, but our check can't prevent further
// processing in the main thread, which may add new events, so skip it.
const ImplSVData* pSVData = ImplGetSVData();
- if (!pSVData->mpDefInst->IsMainThread())
+ if ( !pSVData->mpDefInst->IsMainThread() )
return;
for (int nTaskPriority = 0; nTaskPriority < PRIO_COUNT; ++nTaskPriority)
{
@@ -580,8 +580,8 @@ bool Application::IsUICaptured()
// If mouse was captured, or if in tracking- or in select-mode of a floatingwindow (e.g. menus
// or pulldown toolboxes) another window should be created
// D&D active !!!
- return pSVData->maWinData.mpCaptureWin || pSVData->maWinData.mpTrackWin ||
- pSVData->maWinData.mpFirstFloat || nImplSysDialog;
+ return pSVData->mpWinData->mpCaptureWin || pSVData->mpWinData->mpTrackWin
+ || pSVData->mpWinData->mpFirstFloat || nImplSysDialog;
}
void Application::OverrideSystemSettings( AllSettings& /*rSettings*/ )
@@ -590,7 +590,7 @@ void Application::OverrideSystemSettings( AllSettings& /*rSettings*/ )
void Application::MergeSystemSettings( AllSettings& rSettings )
{
- vcl::Window* pWindow = ImplGetSVData()->maWinData.mpFirstFrame;
+ vcl::Window* pWindow = ImplGetSVData()->maFrameData.mpFirstFrame;
if( ! pWindow )
pWindow = ImplGetDefaultWindow();
if( pWindow )
@@ -635,7 +635,7 @@ void Application::SetSettings( const AllSettings& rSettings )
ImplCallEventListenersApplicationDataChanged( &aDCEvt);
// Update all windows
- vcl::Window* pFirstFrame = pSVData->maWinData.mpFirstFrame;
+ vcl::Window* pFirstFrame = pSVData->maFrameData.mpFirstFrame;
// Reset data that needs to be re-calculated
long nOldDPIX = 0;
long nOldDPIY = 0;
@@ -670,7 +670,7 @@ void Application::SetSettings( const AllSettings& rSettings )
// if DPI resolution for screen output was changed set the new resolution for all
// screen compatible VirDev's
- pFirstFrame = pSVData->maWinData.mpFirstFrame;
+ pFirstFrame = pSVData->maFrameData.mpFirstFrame;
if ( pFirstFrame )
{
if ( (pFirstFrame->GetDPIX() != nOldDPIX) ||
@@ -731,7 +731,7 @@ void InitSettings(ImplSVData* pSVData)
void Application::NotifyAllWindows( DataChangedEvent& rDCEvt )
{
ImplSVData* pSVData = ImplGetSVData();
- vcl::Window* pFrame = pSVData->maWinData.mpFirstFrame;
+ vcl::Window* pFrame = pSVData->maFrameData.mpFirstFrame;
while ( pFrame )
{
pFrame->NotifyAllChildren( rDCEvt );
@@ -1043,12 +1043,12 @@ void Application::LockFontUpdates(bool bLock)
WorkWindow* Application::GetAppWindow()
{
- return ImplGetSVData()->maWinData.mpAppWin;
+ return ImplGetSVData()->maFrameData.mpAppWin;
}
vcl::Window* Application::GetFocusWindow()
{
- return ImplGetSVData()->maWinData.mpFocusWin;
+ return ImplGetSVData()->mpWinData->mpFocusWin;
}
OutputDevice* Application::GetDefaultDevice()
@@ -1059,7 +1059,7 @@ OutputDevice* Application::GetDefaultDevice()
vcl::Window* Application::GetFirstTopLevelWindow()
{
ImplSVData* pSVData = ImplGetSVData();
- return pSVData->maWinData.mpFirstFrame;
+ return pSVData->maFrameData.mpFirstFrame;
}
vcl::Window* Application::GetNextTopLevelWindow( vcl::Window const * pWindow )
@@ -1071,7 +1071,7 @@ long Application::GetTopWindowCount()
{
long nRet = 0;
ImplSVData* pSVData = ImplGetSVData();
- vcl::Window *pWin = pSVData ? pSVData->maWinData.mpFirstFrame.get() : nullptr;
+ vcl::Window *pWin = pSVData ? pSVData->maFrameData.mpFirstFrame.get() : nullptr;
while( pWin )
{
if( pWin->ImplGetWindow()->IsTopWindow() )
@@ -1085,7 +1085,7 @@ vcl::Window* Application::GetTopWindow( long nIndex )
{
long nIdx = 0;
ImplSVData* pSVData = ImplGetSVData();
- vcl::Window *pWin = pSVData ? pSVData->maWinData.mpFirstFrame.get() : nullptr;
+ vcl::Window *pWin = pSVData ? pSVData->maFrameData.mpFirstFrame.get() : nullptr;
while( pWin )
{
if( pWin->ImplGetWindow()->IsTopWindow() )
@@ -1102,7 +1102,7 @@ vcl::Window* Application::GetTopWindow( long nIndex )
vcl::Window* Application::GetActiveTopWindow()
{
- vcl::Window *pWin = ImplGetSVData()->maWinData.mpFocusWin;
+ vcl::Window *pWin = ImplGetSVData()->mpWinData->mpFocusWin;
while( pWin )
{
if( pWin->IsTopWindow() )
@@ -1175,8 +1175,8 @@ OUString Application::GetDisplayName()
ImplSVData* pSVData = ImplGetSVData();
if ( pSVData->maAppData.mxDisplayName )
return *(pSVData->maAppData.mxDisplayName);
- else if ( pSVData->maWinData.mpAppWin )
- return pSVData->maWinData.mpAppWin->GetText();
+ else if (pSVData->maFrameData.mpAppWin)
+ return pSVData->maFrameData.mpAppWin->GetText();
else
return OUString();
}
@@ -1338,7 +1338,7 @@ vcl::Window* Application::GetDefDialogParent()
// as DefDialogParent
// current focus frame
- vcl::Window *pWin = pSVData->maWinData.mpFocusWin;
+ vcl::Window *pWin = pSVData->mpWinData->mpFocusWin;
if (pWin && !pWin->IsMenuFloatingWindow())
{
while (pWin->mpWindowImpl && pWin->mpWindowImpl->mpParent)
@@ -1348,7 +1348,7 @@ vcl::Window* Application::GetDefDialogParent()
if (!pWin->mpWindowImpl)
{
OSL_FAIL( "Window hierarchy corrupted!" );
- pSVData->maWinData.mpFocusWin = nullptr; // avoid further access
+ pSVData->mpWinData->mpFocusWin = nullptr; // avoid further access
return nullptr;
}
@@ -1359,14 +1359,14 @@ vcl::Window* Application::GetDefDialogParent()
}
// last active application frame
- pWin = pSVData->maWinData.mpActiveApplicationFrame;
+ pWin = pSVData->maFrameData.mpActiveApplicationFrame;
if (pWin)
{
return pWin->mpWindowImpl->mpFrameWindow->ImplGetWindow();
}
// first visible top window (may be totally wrong...)
- pWin = pSVData->maWinData.mpFirstFrame;
+ pWin = pSVData->maFrameData.mpFirstFrame;
while (pWin)
{
if( pWin->ImplGetWindow()->IsTopWindow() &&
diff --git a/vcl/source/app/svdata.cxx b/vcl/source/app/svdata.cxx
index a9377fa6732b..a9f58c8abd01 100644
--- a/vcl/source/app/svdata.cxx
+++ b/vcl/source/app/svdata.cxx
@@ -66,6 +66,10 @@ namespace
struct private_aImplSVHelpData :
public rtl::Static<ImplSVHelpData, private_aImplSVHelpData> {};
+ /// Default instance ensures that ImplSVData::mpWinData is never null.
+ struct private_aImplSVWinData :
+ public rtl::Static<ImplSVWinData, private_aImplSVWinData> {};
+
}
ImplSVData* ImplGetSVData() {
@@ -206,8 +210,8 @@ basegfx::SystemDependentDataManager& ImplGetSystemDependentDataManager()
vcl::Window* ImplGetDefaultWindow()
{
ImplSVData* pSVData = ImplGetSVData();
- if ( pSVData->maWinData.mpAppWin )
- return pSVData->maWinData.mpAppWin;
+ if (pSVData->maFrameData.mpAppWin)
+ return pSVData->maFrameData.mpAppWin;
else
return ImplGetDefaultContextWindow();
}
@@ -356,6 +360,54 @@ void LocaleConfigurationListener::ConfigurationChanged( utl::ConfigurationBroadc
AllSettings::LocaleSettingsChanged( nHint );
}
+ImplSVWinData* CreateSVWinData()
+{
+ if (!comphelper::LibreOfficeKit::isActive())
+ return nullptr;
+
+ ImplSVWinData* p = new ImplSVWinData;
+
+ ImplSVData* pSVData = ImplGetSVData();
+ assert(pSVData && pSVData->mpWinData);
+
+ p->mpFocusWin = pSVData->mpWinData->mpFocusWin;
+ return p;
+}
+
+void DestroySVWinData(ImplSVWinData* pData)
+{
+ delete pData;
+}
+
+void SetSVWinData(ImplSVWinData* pSVWinData)
+{
+ if (!comphelper::LibreOfficeKit::isActive())
+ return;
+
+ ImplSVData* pSVData = ImplGetSVData();
+ assert(pSVData != nullptr);
+
+ if (pSVData->mpWinData != pSVWinData)
+ {
+ // If current one is the static, clean it up to avoid having lingering references.
+ if (pSVData->mpWinData == &private_aImplSVWinData::get())
+ {
+ pSVData->mpWinData->mpFocusWin.reset();
+ }
+
+ pSVData->mpWinData = pSVWinData;
+ if (pSVData->mpWinData == nullptr)
+ {
+ pSVData->mpWinData = &private_aImplSVWinData::get(); // Never leave it null.
+ }
+ }
+}
+
+ImplSVData::ImplSVData()
+{
+ mpHelpData = &private_aImplSVHelpData::get();
+ mpWinData = &private_aImplSVWinData::get();
+}
ImplSVHelpData* CreateSVHelpData()
{
@@ -416,11 +468,6 @@ void SetSVHelpData(ImplSVHelpData* pSVHelpData)
}
}
-ImplSVData::ImplSVData()
-{
- mpHelpData = &private_aImplSVHelpData::get();
-}
-
ImplSVHelpData& ImplGetSVHelpData()
{
ImplSVData* pSVData = ImplGetSVData();
@@ -437,6 +484,7 @@ ImplSVHelpData& ImplGetSVHelpData()
ImplSVData::~ImplSVData() {}
ImplSVAppData::~ImplSVAppData() {}
ImplSVGDIData::~ImplSVGDIData() {}
+ImplSVFrameData::~ImplSVFrameData() {}
ImplSVWinData::~ImplSVWinData() {}
ImplSVHelpData::~ImplSVHelpData() {}
diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx
index 41a7126aa57f..87c4b44b1a1b 100644
--- a/vcl/source/app/svmain.cxx
+++ b/vcl/source/app/svmain.cxx
@@ -473,7 +473,7 @@ void DeInitVCL()
Scheduler::ImplDeInitScheduler();
- pSVData->maWinData.maMsgBoxImgList.clear();
+ pSVData->mpWinData->maMsgBoxImgList.clear();
pSVData->maCtrlData.maCheckImgList.clear();
pSVData->maCtrlData.maRadioImgList.clear();
pSVData->maCtrlData.mpDisclosurePlus.reset();
@@ -524,7 +524,7 @@ void DeInitVCL()
pSVData->maAppData.mpSettings.reset();
}
- if (pSVData->maAppData.mpAccelMgr)
+ if ( pSVData->maAppData.mpAccelMgr )
{
delete pSVData->maAppData.mpAccelMgr;
pSVData->maAppData.mpAccelMgr = nullptr;
@@ -553,17 +553,17 @@ void DeInitVCL()
pSVData->maGDIData.mpLastPrnGraphics = nullptr;
pSVData->maGDIData.mpFirstVirDev = nullptr;
pSVData->maGDIData.mpFirstPrinter = nullptr;
- pSVData->maWinData.mpFirstFrame = nullptr;
- pSVData->maWinData.mpAppWin = nullptr;
- pSVData->maWinData.mpActiveApplicationFrame = nullptr;
- pSVData->maWinData.mpCaptureWin = nullptr;
- pSVData->maWinData.mpLastDeacWin = nullptr;
- pSVData->maWinData.mpFirstFloat = nullptr;
- pSVData->maWinData.mpExecuteDialogs.clear();
- pSVData->maWinData.mpExtTextInputWin = nullptr;
- pSVData->maWinData.mpTrackWin = nullptr;
- pSVData->maWinData.mpAutoScrollWin = nullptr;
- pSVData->maWinData.mpLastWheelWindow = nullptr;
+ pSVData->maFrameData.mpFirstFrame = nullptr;
+ pSVData->maFrameData.mpAppWin = nullptr;
+ pSVData->maFrameData.mpActiveApplicationFrame = nullptr;
+ pSVData->mpWinData->mpCaptureWin = nullptr;
+ pSVData->mpWinData->mpLastDeacWin = nullptr;
+ pSVData->mpWinData->mpFirstFloat = nullptr;
+ pSVData->mpWinData->mpExecuteDialogs.clear();
+ pSVData->mpWinData->mpExtTextInputWin = nullptr;
+ pSVData->mpWinData->mpTrackWin = nullptr;
+ pSVData->mpWinData->mpAutoScrollWin = nullptr;
+ pSVData->mpWinData->mpLastWheelWindow = nullptr;
pSVData->maGDIData.mxScreenFontList.reset();
pSVData->maGDIData.mxScreenFontCache.reset();
diff --git a/vcl/source/outdev/font.cxx b/vcl/source/outdev/font.cxx
index 22c61063bd21..91c52398c7ec 100644
--- a/vcl/source/outdev/font.cxx
+++ b/vcl/source/outdev/font.cxx
@@ -544,7 +544,7 @@ void OutputDevice::ImplClearAllFontData(bool bNewFontLists)
if ( bNewFontLists )
{
pSVData->maGDIData.mxScreenFontList->Clear();
- vcl::Window * pFrame = pSVData->maWinData.mpFirstFrame;
+ vcl::Window * pFrame = pSVData->maFrameData.mpFirstFrame;
if ( pFrame )
{
if ( pFrame->AcquireGraphics() )
@@ -582,7 +582,7 @@ void OutputDevice::ImplUpdateFontDataForAllFrames( const FontUpdateHandler_t pHd
ImplSVData* const pSVData = ImplGetSVData();
// update all windows
- vcl::Window* pFrame = pSVData->maWinData.mpFirstFrame;
+ vcl::Window* pFrame = pSVData->maFrameData.mpFirstFrame;
while ( pFrame )
{
( pFrame->*pHdl )( bNewFontLists );
diff --git a/vcl/source/outdev/map.cxx b/vcl/source/outdev/map.cxx
index 6182541e19ff..7ac99f6b4a37 100644
--- a/vcl/source/outdev/map.cxx
+++ b/vcl/source/outdev/map.cxx
@@ -227,8 +227,8 @@ static void ImplCalcMapResolution( const MapMode& rMapMode,
ImplSVData* pSVData = ImplGetSVData();
if ( !pSVData->maGDIData.mnAppFontX )
{
- if( pSVData->maWinData.mpFirstFrame )
- vcl::Window::ImplInitAppFontData( pSVData->maWinData.mpFirstFrame );
+ if (pSVData->maFrameData.mpFirstFrame)
+ vcl::Window::ImplInitAppFontData(pSVData->maFrameData.mpFirstFrame);
else
{
ScopedVclPtrInstance<WorkWindow> pWin( nullptr, 0 );
diff --git a/vcl/source/uitest/logger.cxx b/vcl/source/uitest/logger.cxx
index d7fd1dcf7392..c4dfae7a85da 100644
--- a/vcl/source/uitest/logger.cxx
+++ b/vcl/source/uitest/logger.cxx
@@ -540,12 +540,12 @@ UITestLogger& UITestLogger::getInstance()
ImplSVData* const pSVData = ImplGetSVData();
assert(pSVData);
- if (!pSVData->maWinData.m_pUITestLogger)
+ if (!pSVData->maFrameData.m_pUITestLogger)
{
- pSVData->maWinData.m_pUITestLogger.reset(new UITestLogger);
+ pSVData->maFrameData.m_pUITestLogger.reset(new UITestLogger);
}
- return *pSVData->maWinData.m_pUITestLogger;
+ return *pSVData->maFrameData.m_pUITestLogger;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/uitest/uitest.cxx b/vcl/source/uitest/uitest.cxx
index 58c58ab3c468..0e2a9d93511a 100644
--- a/vcl/source/uitest/uitest.cxx
+++ b/vcl/source/uitest/uitest.cxx
@@ -54,20 +54,20 @@ bool UITest::executeDialog(const OUString& rCommand)
std::unique_ptr<UIObject> UITest::getFocusTopWindow()
{
ImplSVData* pSVData = ImplGetSVData();
- ImplSVWinData& rWinData = pSVData->maWinData;
+ ImplSVWinData& rWinData = *pSVData->mpWinData;
if (!rWinData.mpExecuteDialogs.empty())
{
return rWinData.mpExecuteDialogs.back()->GetUITestFactory()(rWinData.mpExecuteDialogs.back());
}
- return rWinData.mpFirstFrame->GetUITestFactory()(rWinData.mpFirstFrame);
+ return pSVData->maFrameData.mpFirstFrame->GetUITestFactory()(pSVData->maFrameData.mpFirstFrame);
}
std::unique_ptr<UIObject> UITest::getFloatWindow()
{
ImplSVData* pSVData = ImplGetSVData();
- ImplSVWinData& rWinData = pSVData->maWinData;
+ ImplSVWinData& rWinData = *pSVData->mpWinData;
VclPtr<vcl::Window> pFloatWin = rWinData.mpFirstFloat;
if (pFloatWin)
diff --git a/vcl/source/window/brdwin.cxx b/vcl/source/window/brdwin.cxx
index 1b436b544700..349102848bd1 100644
--- a/vcl/source/window/brdwin.cxx
+++ b/vcl/source/window/brdwin.cxx
@@ -1704,7 +1704,7 @@ void ImplBorderWindow::Deactivate()
{
// remove active windows from the ruler, also ignore the Deactivate
// if a menu becomes active
- if ( GetActivateMode() != ActivateModeFlags::NONE && !ImplGetSVData()->maWinData.mbNoDeactivate )
+ if (GetActivateMode() != ActivateModeFlags::NONE && !ImplGetSVData()->mpWinData->mbNoDeactivate)
SetDisplayActive( false );
Window::Deactivate();
}
diff --git a/vcl/source/window/cursor.cxx b/vcl/source/window/cursor.cxx
index ff0e5886a695..fbc2b2ec1d76 100644
--- a/vcl/source/window/cursor.cxx
+++ b/vcl/source/window/cursor.cxx
@@ -46,7 +46,12 @@ struct ImplCursorData
static tools::Rectangle ImplCursorInvert(vcl::RenderContext* pRenderContext, ImplCursorData const * pData)
{
tools::Rectangle aPaintRect;
- bool bMapMode = pRenderContext->IsMapModeEnabled();
+
+ vcl::Window* pWindow = pData ? pData->mpWindow.get() : nullptr;
+ if (!pWindow || pWindow->IsDisposed())
+ return aPaintRect;
+
+ bool bMapMode = pRenderContext->IsMapModeEnabled();
pRenderContext->EnableMapMode( false );
InvertFlags nInvertStyle;
if ( pData->mnStyle & CURSOR_SHADOW )
@@ -114,6 +119,9 @@ static tools::Rectangle ImplCursorInvert(vcl::RenderContext* pRenderContext, Imp
static void ImplCursorInvert(vcl::Window* pWindow, ImplCursorData const * pData)
{
+ if (!pWindow || pWindow->IsDisposed())
+ return;
+
std::unique_ptr<vcl::PaintBufferGuard> pGuard;
const bool bDoubleBuffering = pWindow->SupportsDoubleBuffering();
if (bDoubleBuffering)
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index 89f1580c34e8..a754182d3eeb 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -396,14 +396,14 @@ vcl::Window* Dialog::GetDefaultParent(WinBits nStyle)
{
vcl::Window* pParent = Application::GetDefDialogParent();
if (!pParent && !(nStyle & WB_SYSTEMWINDOW))
- pParent = ImplGetSVData()->maWinData.mpAppWin;
+ pParent = ImplGetSVData()->maFrameData.mpAppWin;
// If Parent is disabled, then we search for a modal dialog
// in this frame
if (pParent && (!pParent->IsInputEnabled() || pParent->IsInModalMode()))
{
ImplSVData* pSVData = ImplGetSVData();
- auto& rExecuteDialogs = pSVData->maWinData.mpExecuteDialogs;
+ auto& rExecuteDialogs = pSVData->mpWinData->mpExecuteDialogs;
auto it = std::find_if(rExecuteDialogs.rbegin(), rExecuteDialogs.rend(),
[&pParent](VclPtr<Dialog>& rDialogPtr) {
return pParent->ImplGetFirstOverlapWindow()->IsWindowOrChild(rDialogPtr, true) &&
@@ -910,8 +910,8 @@ bool Dialog::ImplStartExecute()
if (bModal && GetLOKNotifier())
{
// check if there's already some dialog being ::Execute()d
- const bool bDialogExecuting = std::any_of(pSVData->maWinData.mpExecuteDialogs.begin(),
- pSVData->maWinData.mpExecuteDialogs.end(),
+ const bool bDialogExecuting = std::any_of(pSVData->mpWinData->mpExecuteDialogs.begin(),
+ pSVData->mpWinData->mpExecuteDialogs.end(),
[](const Dialog* pDialog) {
return pDialog->IsInSyncExecute();
});
@@ -937,23 +937,22 @@ bool Dialog::ImplStartExecute()
{
pParent = pParent->ImplGetFirstOverlapWindow();
SAL_WARN_IF( !pParent->IsReallyVisible(), "vcl",
- "Dialog::StartExecuteModal() - Parent not visible" );
+ "Dialog::StartExecuteModal() - Parent not visible" );
SAL_WARN_IF( !pParent->IsInputEnabled(), "vcl",
- "Dialog::StartExecuteModal() - Parent input disabled, use another parent to ensure modality!" );
+ "Dialog::StartExecuteModal() - Parent input disabled, use another parent to ensure modality!" );
SAL_WARN_IF( pParent->IsInModalMode(), "vcl",
- "Dialog::StartExecuteModal() - Parent already modally disabled, use another parent to ensure modality!" );
-
+ "Dialog::StartExecuteModal() - Parent already modally disabled, use another parent to ensure modality!" );
}
#endif
// link all dialogs which are being executed
- pSVData->maWinData.mpExecuteDialogs.push_back(this);
+ pSVData->mpWinData->mpExecuteDialogs.push_back(this);
// stop capturing, in order to have control over the dialog
- if ( pSVData->maWinData.mpTrackWin )
- pSVData->maWinData.mpTrackWin->EndTracking( TrackingEventFlags::Cancel );
- if ( pSVData->maWinData.mpCaptureWin )
- pSVData->maWinData.mpCaptureWin->ReleaseMouse();
+ if (pSVData->mpWinData->mpTrackWin)
+ pSVData->mpWinData->mpTrackWin->EndTracking(TrackingEventFlags::Cancel);
+ if (pSVData->mpWinData->mpCaptureWin)
+ pSVData->mpWinData->mpCaptureWin->ReleaseMouse();
EnableInput();
}
@@ -1070,7 +1069,7 @@ bool Dialog::StartExecuteAsync( VclAbstractDialog::AsyncContext &rCtx )
void Dialog::RemoveFromDlgList()
{
ImplSVData* pSVData = ImplGetSVData();
- auto& rExecuteDialogs = pSVData->maWinData.mpExecuteDialogs;
+ auto& rExecuteDialogs = pSVData->mpWinData->mpExecuteDialogs;
// remove dialog from the list of dialogs which are being executed
rExecuteDialogs.erase(std::remove_if(rExecuteDialogs.begin(), rExecuteDialogs.end(), [this](VclPtr<Dialog>& dialog){ return dialog.get() == this; }), rExecuteDialogs.end());
@@ -1094,9 +1093,9 @@ void Dialog::EndDialog( long nResult )
// set focus to previous modal dialogue if it is modal for
// the same frame parent (or NULL)
ImplSVData* pSVData = ImplGetSVData();
- if (!pSVData->maWinData.mpExecuteDialogs.empty())
+ if (!pSVData->mpWinData->mpExecuteDialogs.empty())
{
- VclPtr<Dialog> pPrevious = pSVData->maWinData.mpExecuteDialogs.back();
+ VclPtr<Dialog> pPrevious = pSVData->mpWinData->mpExecuteDialogs.back();
vcl::Window* pFrameParent = ImplGetFrameWindow()->ImplGetParent();
vcl::Window* pPrevFrameParent = pPrevious->ImplGetFrameWindow()? pPrevious->ImplGetFrameWindow()->ImplGetParent(): nullptr;
@@ -1131,7 +1130,6 @@ void Dialog::EndDialog( long nResult )
mpDialogImpl->mbStartedModal = false;
mpDialogImpl->mnResult = -1;
}
-
mbInExecute = false;
if ( mpDialogImpl )
@@ -1148,7 +1146,7 @@ void Dialog::EndDialog( long nResult )
void Dialog::EndAllDialogs( vcl::Window const * pParent )
{
ImplSVData* pSVData = ImplGetSVData();
- auto& rExecuteDialogs = pSVData->maWinData.mpExecuteDialogs;
+ auto& rExecuteDialogs = pSVData->mpWinData->mpExecuteDialogs;
for (auto it = rExecuteDialogs.rbegin(); it != rExecuteDialogs.rend(); ++it)
{
@@ -1163,7 +1161,7 @@ void Dialog::EndAllDialogs( vcl::Window const * pParent )
VclPtr<Dialog> Dialog::GetMostRecentExecutingDialog()
{
ImplSVData* pSVData = ImplGetSVData();
- auto& rExecuteDialogs = pSVData->maWinData.mpExecuteDialogs;
+ auto& rExecuteDialogs = pSVData->mpWinData->mpExecuteDialogs;
if (!rExecuteDialogs.empty())
return rExecuteDialogs.back();
return nullptr;
@@ -1193,7 +1191,7 @@ void Dialog::ImplSetModalInputMode( bool bModal )
// previously Execute()'d dialog - the one below the top-most one
VclPtr<Dialog> pPrevious;
ImplSVData* pSVData = ImplGetSVData();
- auto& rExecuteDialogs = pSVData->maWinData.mpExecuteDialogs;
+ auto& rExecuteDialogs = pSVData->mpWinData->mpExecuteDialogs;
if (rExecuteDialogs.size() > 1)
pPrevious = rExecuteDialogs[rExecuteDialogs.size() - 2];
diff --git a/vcl/source/window/event.cxx b/vcl/source/window/event.cxx
index edfa7fd8c4d8..31733682c18f 100644
--- a/vcl/source/window/event.cxx
+++ b/vcl/source/window/event.cxx
@@ -596,29 +596,29 @@ void Window::ImplCallFocusChangeActivate( vcl::Window* pNewOverlapWindow,
if ( (pNewRealWindow->GetType() == WindowType::FLOATINGWINDOW) &&
pNewRealWindow->GetActivateMode() == ActivateModeFlags::NONE)
{
- pSVData->maWinData.mpLastDeacWin = pOldOverlapWindow;
+ pSVData->mpWinData->mpLastDeacWin = pOldOverlapWindow;
bCallDeactivate = false;
}
}
else if ( (pNewRealWindow->GetType() != WindowType::FLOATINGWINDOW) ||
pNewRealWindow->GetActivateMode() != ActivateModeFlags::NONE )
{
- if ( pSVData->maWinData.mpLastDeacWin )
+ if (pSVData->mpWinData->mpLastDeacWin)
{
- if ( pSVData->maWinData.mpLastDeacWin.get() == pNewOverlapWindow )
+ if (pSVData->mpWinData->mpLastDeacWin.get() == pNewOverlapWindow)
bCallActivate = false;
else
{
- vcl::Window* pLastRealWindow = pSVData->maWinData.mpLastDeacWin->ImplGetWindow();
- pSVData->maWinData.mpLastDeacWin->mpWindowImpl->mbActive = false;
- pSVData->maWinData.mpLastDeacWin->Deactivate();
- if ( pLastRealWindow != pSVData->maWinData.mpLastDeacWin.get() )
+ vcl::Window* pLastRealWindow = pSVData->mpWinData->mpLastDeacWin->ImplGetWindow();
+ pSVData->mpWinData->mpLastDeacWin->mpWindowImpl->mbActive = false;
+ pSVData->mpWinData->mpLastDeacWin->Deactivate();
+ if (pLastRealWindow != pSVData->mpWinData->mpLastDeacWin.get())
{
pLastRealWindow->mpWindowImpl->mbActive = true;
pLastRealWindow->Activate();
}
}
- pSVData->maWinData.mpLastDeacWin = nullptr;
+ pSVData->mpWinData->mpLastDeacWin = nullptr;
}
}
diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx
index 5078616a8aa3..5bfea6bfac9f 100644
--- a/vcl/source/window/floatwin.cxx
+++ b/vcl/source/window/floatwin.cxx
@@ -66,7 +66,7 @@ void FloatingWindow::ImplInitFloating( vcl::Window* pParent, WinBits nStyle )
SAL_WARN_IF(!pParent, "vcl", "FloatWindow::FloatingWindow(): - pParent == NULL!");
if (!pParent)
- pParent = ImplGetSVData()->maWinData.mpAppWin;
+ pParent = ImplGetSVData()->maFrameData.mpAppWin;
SAL_WARN_IF(!pParent, "vcl", "FloatWindow::FloatingWindow(): - pParent == NULL and no AppWindow exists");
@@ -392,7 +392,7 @@ Point FloatingWindow::ImplCalcPos(vcl::Window* pWindow,
default: break;
}
- // no further adjustment for LibreOfficeKit
+ // no further adjustement for LibreOfficeKit
if (bLOKActive)
break;
@@ -775,8 +775,8 @@ void FloatingWindow::StartPopupMode( const tools::Rectangle& rRect, FloatWinPopu
// add FloatingWindow to list of windows that are in popup mode
ImplSVData* pSVData = ImplGetSVData();
- mpNextFloat = pSVData->maWinData.mpFirstFloat;
- pSVData->maWinData.mpFirstFloat = this;
+ mpNextFloat = pSVData->mpWinData->mpFirstFloat;
+ pSVData->mpWinData->mpFirstFloat = this;
if (nFlags & FloatWinPopupFlags::GrabFocus)
{
// force key input even without focus (useful for menus)
@@ -833,11 +833,11 @@ void FloatingWindow::ImplEndPopupMode( FloatWinPopupEndFlags nFlags, const VclPt
mbInCleanUp = true; // prevent killing this window due to focus change while working with it
// stop the PopupMode also for all following PopupMode windows
- while ( pSVData->maWinData.mpFirstFloat && pSVData->maWinData.mpFirstFloat.get() != this )
- pSVData->maWinData.mpFirstFloat->EndPopupMode( FloatWinPopupEndFlags::Cancel );
+ while (pSVData->mpWinData->mpFirstFloat && pSVData->mpWinData->mpFirstFloat.get() != this)
+ pSVData->mpWinData->mpFirstFloat->EndPopupMode(FloatWinPopupEndFlags::Cancel);
// delete window from the list
- pSVData->maWinData.mpFirstFloat = mpNextFloat;
+ pSVData->mpWinData->mpFirstFloat = mpNextFloat;
mpNextFloat = nullptr;
FloatWinPopupFlags nPopupModeFlags = mnPopupModeFlags;
@@ -853,11 +853,11 @@ void FloatingWindow::ImplEndPopupMode( FloatWinPopupEndFlags nFlags, const VclPt
// restore focus to previous focus window if we still have the focus
Window::EndSaveFocus(xFocusId);
}
- else if ( pSVData->maWinData.mpFocusWin && pSVData->maWinData.mpFirstFloat &&
- ImplIsWindowOrChild( pSVData->maWinData.mpFocusWin ) )
+ else if ( pSVData->mpWinData->mpFocusWin && pSVData->mpWinData->mpFirstFloat &&
+ ImplIsWindowOrChild( pSVData->mpWinData->mpFocusWin ) )
{
// maybe pass focus on to a suitable FloatingWindow
- pSVData->maWinData.mpFirstFloat->GrabFocus();
+ pSVData->mpWinData->mpFirstFloat->GrabFocus();
}
mbPopupModeCanceled = bool(nFlags & FloatWinPopupEndFlags::Cancel);
@@ -885,9 +885,9 @@ void FloatingWindow::ImplEndPopupMode( FloatWinPopupEndFlags nFlags, const VclPt
{
if ( !(nPopupModeFlags & FloatWinPopupFlags::NewLevel) )
{
- if ( pSVData->maWinData.mpFirstFloat )
+ if (pSVData->mpWinData->mpFirstFloat)
{
- FloatingWindow* pLastLevelFloat = pSVData->maWinData.mpFirstFloat->ImplFindLastLevelFloat();
+ FloatingWindow* pLastLevelFloat = pSVData->mpWinData->mpFirstFloat->ImplFindLastLevelFloat();
pLastLevelFloat->EndPopupMode( FloatWinPopupEndFlags::Cancel | FloatWinPopupEndFlags::CloseAll );
}
}
diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx
index 1d25c089e976..3cc63eaf6c40 100644
--- a/vcl/source/window/menu.cxx
+++ b/vcl/source/window/menu.cxx
@@ -2833,15 +2833,16 @@ sal_uInt16 PopupMenu::ImplExecute( const VclPtr<vcl::Window>& pW, const tools::R
bool bRealExecute = false;
if ( !pStartedFrom )
{
- pSVData->maWinData.mbNoDeactivate = true;
+ pSVData->mpWinData->mbNoDeactivate = true;
xFocusId = Window::SaveFocus();
bRealExecute = true;
}
else
{
// assure that only one menu is open at a time
- if (pStartedFrom->IsMenuBar() && pSVData->maWinData.mpFirstFloat)
- pSVData->maWinData.mpFirstFloat->EndPopupMode( FloatWinPopupEndFlags::Cancel | FloatWinPopupEndFlags::CloseAll );
+ if (pStartedFrom->IsMenuBar() && pSVData->mpWinData->mpFirstFloat)
+ pSVData->mpWinData->mpFirstFloat->EndPopupMode(FloatWinPopupEndFlags::Cancel
+ | FloatWinPopupEndFlags::CloseAll);
}
SAL_WARN_IF( ImplGetWindow(), "vcl", "Win?!" );
diff --git a/vcl/source/window/menubarwindow.cxx b/vcl/source/window/menubarwindow.cxx
index c09eadaed322..41a51b79ce5b 100644
--- a/vcl/source/window/menubarwindow.cxx
+++ b/vcl/source/window/menubarwindow.cxx
@@ -478,13 +478,13 @@ void MenuBarWindow::ChangeHighlightItem( sal_uInt16 n, bool bSelectEntry, bool b
bool bJustActivated = false;
if ( ( m_nHighlightedItem == ITEMPOS_INVALID ) && ( n != ITEMPOS_INVALID ) )
{
- ImplGetSVData()->maWinData.mbNoDeactivate = true;
+ ImplGetSVData()->mpWinData->mbNoDeactivate = true;
// #105406# avoid saving the focus when we already have the focus
- bool bNoSaveFocus = (this == ImplGetSVData()->maWinData.mpFocusWin.get() );
+ bool bNoSaveFocus = (this == ImplGetSVData()->mpWinData->mpFocusWin.get());
if( m_xSaveFocusId != nullptr )
{
- if( !ImplGetSVData()->maWinData.mbNoSaveFocus )
+ if (!ImplGetSVData()->mpWinData->mbNoSaveFocus)
{
m_xSaveFocusId = nullptr;
if( !bNoSaveFocus )
@@ -509,8 +509,8 @@ void MenuBarWindow::ChangeHighlightItem( sal_uInt16 n, bool bSelectEntry, bool b
m_pMenu->bInCallback = true;
m_pMenu->Deactivate();
m_pMenu->bInCallback = false;
- ImplGetSVData()->maWinData.mbNoDeactivate = false;
- if( !ImplGetSVData()->maWinData.mbNoSaveFocus )
+ ImplGetSVData()->mpWinData->mbNoDeactivate = false;
+ if (!ImplGetSVData()->mpWinData->mbNoSaveFocus)
{
VclPtr<vcl::Window> xTempFocusId;
if (m_xSaveFocusId && !m_xSaveFocusId->isDisposed())
@@ -523,7 +523,7 @@ void MenuBarWindow::ChangeHighlightItem( sal_uInt16 n, bool bSelectEntry, bool b
// focus window, so we could avoid sending superfluous activate events
// to top window listeners.
if (xTempFocusId || bDefaultToDocument)
- ImplGetSVData()->maWinData.mpFocusWin = this;
+ ImplGetSVData()->mpWinData->mpFocusWin = this;
// #105406# restore focus to document if we could not save focus before
if (!xTempFocusId && bDefaultToDocument)
diff --git a/vcl/source/window/menufloatingwindow.cxx b/vcl/source/window/menufloatingwindow.cxx
index bfb8831e8d5a..753c3b7282ff 100644
--- a/vcl/source/window/menufloatingwindow.cxx
+++ b/vcl/source/window/menufloatingwindow.cxx
@@ -440,7 +440,7 @@ void MenuFloatingWindow::End()
xSaveFocusId = nullptr;
if (xFocusId != nullptr && MenuInHierarchyHasFocus())
{
- ImplGetSVData()->maWinData.mbNoDeactivate = false;
+ ImplGetSVData()->mpWinData->mbNoDeactivate = false;
Window::EndSaveFocus(xFocusId);
}
diff --git a/vcl/source/window/mouse.cxx b/vcl/source/window/mouse.cxx
index a3a06ecf1f31..0aea5205fbb5 100644
--- a/vcl/source/window/mouse.cxx
+++ b/vcl/source/window/mouse.cxx
@@ -146,7 +146,7 @@ void Window::ImplCallMouseMove( sal_uInt16 nMouseCode, bool bModChanged )
bLeave = ((nX < 0) || (nY < 0) ||
(nX >= mpWindowImpl->mpFrameWindow->mnOutWidth) ||
(nY >= mpWindowImpl->mpFrameWindow->mnOutHeight)) &&
- !ImplGetSVData()->maWinData.mpCaptureWin;
+ !ImplGetSVData()->mpWinData->mpCaptureWin;
nMode |= MouseEventModifiers::SYNTHETIC;
if ( bModChanged )
nMode |= MouseEventModifiers::MODIFIERCHANGED;
@@ -164,7 +164,7 @@ void Window::ImplGenerateMouseMove()
IMPL_LINK_NOARG(Window, ImplGenerateMouseMoveHdl, void*, void)
{
mpWindowImpl->mpFrameData->mnMouseMoveId = nullptr;
- vcl::Window* pCaptureWin = ImplGetSVData()->maWinData.mpCaptureWin;
+ vcl::Window* pCaptureWin = ImplGetSVData()->mpWinData->mpCaptureWin;
if( ! pCaptureWin ||
(pCaptureWin->mpWindowImpl && pCaptureWin->mpWindowImpl->mpFrame == mpWindowImpl->mpFrame)
)
@@ -251,7 +251,7 @@ void Window::ImplGrabFocus( GetFocusFlags nFlags )
ImplSVData* pSVData = ImplGetSVData();
bool bAsyncFocusWaiting = false;
- vcl::Window *pFrame = pSVData->maWinData.mpFirstFrame;
+ vcl::Window *pFrame = pSVData->maFrameData.mpFirstFrame;
while( pFrame )
{
if( pFrame != mpWindowImpl->mpFrameWindow.get() && pFrame->mpWindowImpl->mpFrameData->mnFocusId )
@@ -278,15 +278,15 @@ void Window::ImplGrabFocus( GetFocusFlags nFlags )
pParent = pParent->mpWindowImpl->mpParent;
}
- if ( !(( pSVData->maWinData.mpFocusWin.get() != this &&
+ if ( !(( pSVData->mpWinData->mpFocusWin.get() != this &&
!mpWindowImpl->mbInDispose ) ||
( bAsyncFocusWaiting && !bHasFocus && !bMustNotGrabFocus )) )
return;
// EndExtTextInput if it is not the same window
- if ( pSVData->maWinData.mpExtTextInputWin &&
- (pSVData->maWinData.mpExtTextInputWin.get() != this) )
- pSVData->maWinData.mpExtTextInputWin->EndExtTextInput();
+ if (pSVData->mpWinData->mpExtTextInputWin
+ && (pSVData->mpWinData->mpExtTextInputWin.get() != this))
+ pSVData->mpWinData->mpExtTextInputWin->EndExtTextInput();
// mark this windows as the last FocusWindow
vcl::Window* pOverlapWindow = ImplGetFirstOverlapWindow();
@@ -308,9 +308,9 @@ void Window::ImplGrabFocus( GetFocusFlags nFlags )
}
}
- VclPtr<vcl::Window> pOldFocusWindow = pSVData->maWinData.mpFocusWin;
+ VclPtr<vcl::Window> pOldFocusWindow = pSVData->mpWinData->mpFocusWin;
- pSVData->maWinData.mpFocusWin = this;
+ pSVData->mpWinData->mpFocusWin = this;
if ( pOldFocusWindow )
{
@@ -351,7 +351,7 @@ void Window::ImplGrabFocus( GetFocusFlags nFlags )
pOldFocusWindow->ImplCallDeactivateListeners( this );
}
- if ( pSVData->maWinData.mpFocusWin.get() == this )
+ if (pSVData->mpWinData->mpFocusWin.get() == this)
{
if ( mpWindowImpl->mpSysObj )
{
@@ -360,7 +360,7 @@ void Window::ImplGrabFocus( GetFocusFlags nFlags )
mpWindowImpl->mpSysObj->GrabFocus();
}
- if ( pSVData->maWinData.mpFocusWin.get() == this )
+ if (pSVData->mpWinData->mpFocusWin.get() == this)
{
if ( mpWindowImpl->mpCursor )
mpWindowImpl->mpCursor->ImplShow();
@@ -442,15 +442,15 @@ void Window::CaptureMouse()
ImplSVData* pSVData = ImplGetSVData();
// possibly stop tracking
- if ( pSVData->maWinData.mpTrackWin.get() != this )
+ if (pSVData->mpWinData->mpTrackWin.get() != this)
{
- if ( pSVData->maWinData.mpTrackWin )
- pSVData->maWinData.mpTrackWin->EndTracking( TrackingEventFlags::Cancel );
+ if (pSVData->mpWinData->mpTrackWin)
+ pSVData->mpWinData->mpTrackWin->EndTracking(TrackingEventFlags::Cancel);
}
- if ( pSVData->maWinData.mpCaptureWin.get() != this )
+ if (pSVData->mpWinData->mpCaptureWin.get() != this)
{
- pSVData->maWinData.mpCaptureWin = this;
+ pSVData->mpWinData->mpCaptureWin = this;
mpWindowImpl->mpFrame->CaptureMouse( true );
}
}
@@ -460,7 +460,7 @@ void Window::ReleaseMouse()
if (IsMouseCaptured())
{
ImplSVData* pSVData = ImplGetSVData();
- pSVData->maWinData.mpCaptureWin = nullptr;
+ pSVData->mpWinData->mpCaptureWin = nullptr;
mpWindowImpl->mpFrame->CaptureMouse( false );
ImplGenerateMouseMove();
}
@@ -468,7 +468,7 @@ void Window::ReleaseMouse()
bool Window::IsMouseCaptured() const
{
- return (this == ImplGetSVData()->maWinData.mpCaptureWin);
+ return (this == ImplGetSVData()->mpWinData->mpCaptureWin);
}
void Window::SetPointer( PointerStyle nPointer )
diff --git a/vcl/source/window/msgbox.cxx b/vcl/source/window/msgbox.cxx
new file mode 100644
index 000000000000..aaaf8bc3de79
--- /dev/null
+++ b/vcl/source/window/msgbox.cxx
@@ -0,0 +1,82 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#include <strings.hrc>
+#include <bitmaps.hlst>
+#include <svdata.hxx>
+#include <brdwin.hxx>
+#include <window.h>
+
+#include <vcl/textrectinfo.hxx>
+#include <vcl/metric.hxx>
+#include <vcl/svapp.hxx>
+#include <vcl/wrkwin.hxx>
+#include <vcl/fixed.hxx>
+#include <vcl/vclmedit.hxx>
+#include <vcl/msgbox.hxx>
+#include <vcl/button.hxx>
+#include <vcl/mnemonic.hxx>
+#include <vcl/settings.hxx>
+
+static void ImplInitMsgBoxImageList()
+{
+ ImplSVData* pSVData = ImplGetSVData();
+ std::vector<Image>& rImages = pSVData->mpWinData->maMsgBoxImgList;
+ if (rImages.empty())
+ {
+ rImages.emplace_back(Image(StockImage::Yes, SV_RESID_BITMAP_ERRORBOX));
+ rImages.emplace_back(Image(StockImage::Yes, SV_RESID_BITMAP_QUERYBOX));
+ rImages.emplace_back(Image(StockImage::Yes, SV_RESID_BITMAP_WARNINGBOX));
+ rImages.emplace_back(Image(StockImage::Yes, SV_RESID_BITMAP_INFOBOX));
+ }
+}
+
+Image const& GetStandardInfoBoxImage()
+{
+ ImplInitMsgBoxImageList();
+ return ImplGetSVData()->mpWinData->maMsgBoxImgList[3];
+}
+
+OUString GetStandardInfoBoxText() { return VclResId(SV_MSGBOX_INFO); }
+
+Image const& GetStandardWarningBoxImage()
+{
+ ImplInitMsgBoxImageList();
+ return ImplGetSVData()->mpWinData->maMsgBoxImgList[2];
+}
+
+OUString GetStandardWarningBoxText() { return VclResId(SV_MSGBOX_WARNING); }
+
+Image const& GetStandardErrorBoxImage()
+{
+ ImplInitMsgBoxImageList();
+ return ImplGetSVData()->mpWinData->maMsgBoxImgList[0];
+}
+
+OUString GetStandardErrorBoxText() { return VclResId(SV_MSGBOX_ERROR); }
+
+Image const& GetStandardQueryBoxImage()
+{
+ ImplInitMsgBoxImageList();
+ return ImplGetSVData()->mpWinData->maMsgBoxImgList[1];
+}
+
+OUString GetStandardQueryBoxText() { return VclResId(SV_MSGBOX_QUERY); }
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/window/scrwnd.cxx b/vcl/source/window/scrwnd.cxx
index 27d96f56bfaf..58345ef62037 100644
--- a/vcl/source/window/scrwnd.cxx
+++ b/vcl/source/window/scrwnd.cxx
@@ -53,7 +53,7 @@ ImplWheelWindow::ImplWheelWindow( vcl::Window* pParent ) :
SAL_WARN_IF( !pParent, "vcl", "ImplWheelWindow::ImplWheelWindow(): Parent not set!" );
const Size aSize( pParent->GetOutputSizePixel() );
- const StartAutoScrollFlags nFlags = ImplGetSVData()->maWinData.mnAutoScrollFlags;
+ const StartAutoScrollFlags nFlags = ImplGetSVData()->mpWinData->mnAutoScrollFlags;
const bool bHorz( nFlags & StartAutoScrollFlags::Horz );
const bool bVert( nFlags & StartAutoScrollFlags::Vert );
@@ -237,7 +237,7 @@ void ImplWheelWindow::ImplRecalcScrollValues()
PointerStyle ImplWheelWindow::ImplGetMousePointer( long nDistX, long nDistY )
{
PointerStyle eStyle;
- const StartAutoScrollFlags nFlags = ImplGetSVData()->maWinData.mnAutoScrollFlags;
+ const StartAutoScrollFlags nFlags = ImplGetSVData()->mpWinData->mnAutoScrollFlags;
const bool bHorz( nFlags & StartAutoScrollFlags::Horz );
const bool bVert( nFlags & StartAutoScrollFlags::Vert );
@@ -316,7 +316,7 @@ void ImplWheelWindow::MouseMove( const MouseEvent& rMEvt )
mnActDist = static_cast<sal_uLong>(hypot( static_cast<double>(nDistX), nDistY ));
const PointerStyle eActStyle = ImplGetMousePointer( nDistX, nDistY );
- const StartAutoScrollFlags nFlags = ImplGetSVData()->maWinData.mnAutoScrollFlags;
+ const StartAutoScrollFlags nFlags = ImplGetSVData()->mpWinData->mnAutoScrollFlags;
const bool bHorz( nFlags & StartAutoScrollFlags::Horz );
const bool bVert( nFlags & StartAutoScrollFlags::Vert );
const bool bOuter = mnActDist > WHEEL_RADIUS;
diff --git a/vcl/source/window/stacking.cxx b/vcl/source/window/stacking.cxx
index ef7feeab2ee0..718ce76dea66 100644
--- a/vcl/source/window/stacking.cxx
+++ b/vcl/source/window/stacking.cxx
@@ -1130,7 +1130,7 @@ bool Window::IsWindowOrChild( const vcl::Window* pWindow, bool bSystemWindow ) c
void Window::ImplSetFrameParent( const vcl::Window* pParent )
{
- vcl::Window* pFrameWindow = ImplGetSVData()->maWinData.mpFirstFrame;
+ vcl::Window* pFrameWindow = ImplGetSVData()->maFrameData.mpFirstFrame;
while( pFrameWindow )
{
// search all frames that are children of this window
diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx
index ce463c6b5551..9d2a0b671c66 100644
--- a/vcl/source/window/syswin.cxx
+++ b/vcl/source/window/syswin.cxx
@@ -694,7 +694,7 @@ void SystemWindow::SetWindowStateData( const WindowStateData& rData )
{
tools::Rectangle aDesktop = GetDesktopRectPixel();
ImplSVData *pSVData = ImplGetSVData();
- vcl::Window *pWin = pSVData->maWinData.mpFirstFrame;
+ vcl::Window *pWin = pSVData->maFrameData.mpFirstFrame;
bool bWrapped = false;
while( pWin )
{
@@ -724,7 +724,7 @@ void SystemWindow::SetWindowStateData( const WindowStateData& rData )
aState.mnX += displacement;
aState.mnY += displacement;
}
- pWin = pSVData->maWinData.mpFirstFrame; // check new pos again
+ pWin = pSVData->maFrameData.mpFirstFrame; // check new pos again
}
}
pWin = pWin->mpWindowImpl->mpFrameData->mpNextFrame;
diff --git a/vcl/source/window/taskpanelist.cxx b/vcl/source/window/taskpanelist.cxx
index 35828b7d1429..9a8efd578557 100644
--- a/vcl/source/window/taskpanelist.cxx
+++ b/vcl/source/window/taskpanelist.cxx
@@ -177,9 +177,9 @@ bool TaskPaneList::HandleKeyEvent(const KeyEvent& rKeyEvent)
if( pNextWin != pWin )
{
- ImplGetSVData()->maWinData.mbNoSaveFocus = true;
+ ImplGetSVData()->mpWinData->mbNoSaveFocus = true;
ImplTaskPaneListGrabFocus( pNextWin, bForward );
- ImplGetSVData()->maWinData.mbNoSaveFocus = false;
+ ImplGetSVData()->mpWinData->mbNoSaveFocus = false;
}
else
{
diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx
index 3b0d6b5a5f7e..9f4a33456a4e 100644
--- a/vcl/source/window/toolbox.cxx
+++ b/vcl/source/window/toolbox.cxx
@@ -4336,9 +4336,9 @@ static bool ImplCloseLastPopup( vcl::Window const *pParent )
// close last popup toolbox (see also:
// ImplHandleMouseFloatMode(...) in winproc.cxx )
- if( ImplGetSVData()->maWinData.mpFirstFloat )
+ if (ImplGetSVData()->mpWinData->mpFirstFloat)
{
- FloatingWindow* pLastLevelFloat = ImplGetSVData()->maWinData.mpFirstFloat->ImplFindLastLevelFloat();
+ FloatingWindow* pLastLevelFloat = ImplGetSVData()->mpWinData->mpFirstFloat->ImplFindLastLevelFloat();
// only close the floater if it is not our direct parent, which would kill ourself
if( pLastLevelFloat && pLastLevelFloat != pParent )
{
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 120087f21267..1c8fb778c2f1 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -237,13 +237,13 @@ void Window::dispose()
if ( ImplGetSVHelpData().mpHelpWin && (ImplGetSVHelpData().mpHelpWin->GetParent() == this) )
ImplDestroyHelpWindow( true );
- SAL_WARN_IF( pSVData->maWinData.mpTrackWin.get() == this, "vcl.window",
- "Window::~Window(): Window is in TrackingMode" );
+ SAL_WARN_IF(pSVData->mpWinData->mpTrackWin.get() == this, "vcl.window",
+ "Window::~Window(): Window is in TrackingMode");
SAL_WARN_IF(IsMouseCaptured(), "vcl.window",
"Window::~Window(): Window has the mouse captured");
// due to old compatibility
- if ( pSVData->maWinData.mpTrackWin == this )
+ if (pSVData->mpWinData->mpTrackWin == this)
EndTracking();
if (IsMouseCaptured())
ReleaseMouse();
@@ -297,7 +297,7 @@ void Window::dispose()
}
bError = false;
- pTempWin = pSVData->maWinData.mpFirstFrame;
+ pTempWin = pSVData->maFrameData.mpFirstFrame;
while ( pTempWin )
{
if ( ImplIsRealParentPath( pTempWin ) )
@@ -391,16 +391,16 @@ void Window::dispose()
Hide();
// EndExtTextInputMode
- if ( pSVData->maWinData.mpExtTextInputWin == this )
+ if (pSVData->mpWinData->mpExtTextInputWin == this)
{
EndExtTextInput();
- if ( pSVData->maWinData.mpExtTextInputWin == this )
- pSVData->maWinData.mpExtTextInputWin = nullptr;
+ if (pSVData->mpWinData->mpExtTextInputWin == this)
+ pSVData->mpWinData->mpExtTextInputWin = nullptr;
}
// check if the focus window is our child
bool bHasFocussedChild = false;
- if( pSVData->maWinData.mpFocusWin && ImplIsRealParentPath( pSVData->maWinData.mpFocusWin ) )
+ if (pSVData->mpWinData->mpFocusWin && ImplIsRealParentPath(pSVData->mpWinData->mpFocusWin))
{
// #122232#, this must not happen and is an application bug ! but we try some cleanup to hopefully avoid crashes, see below
bHasFocussedChild = true;
@@ -414,12 +414,12 @@ void Window::dispose()
// if we get focus pass focus to another window
vcl::Window* pOverlapWindow = ImplGetFirstOverlapWindow();
- if ( pSVData->maWinData.mpFocusWin == this
- || bHasFocussedChild ) // #122232#, see above, try some cleanup
+ if (pSVData->mpWinData->mpFocusWin == this
+ || bHasFocussedChild) // #122232#, see above, try some cleanup
{
if ( mpWindowImpl->mbFrame )
{
- pSVData->maWinData.mpFocusWin = nullptr;
+ pSVData->mpWinData->mpFocusWin = nullptr;
pOverlapWindow->mpWindowImpl->mpLastFocusWindow = nullptr;
}
else
@@ -442,9 +442,9 @@ void Window::dispose()
mpWindowImpl->mpFrameWindow->GrabFocus();
// If the focus was set back to 'this' set it to nothing
- if ( pSVData->maWinData.mpFocusWin == this )
+ if (pSVData->mpWinData->mpFocusWin == this)
{
- pSVData->maWinData.mpFocusWin = nullptr;
+ pSVData->mpWinData->mpFocusWin = nullptr;
pOverlapWindow->mpWindowImpl->mpLastFocusWindow = nullptr;
}
}
@@ -455,12 +455,12 @@ void Window::dispose()
pOverlapWindow->mpWindowImpl->mpLastFocusWindow = nullptr;
// reset hint for DefModalDialogParent
- if( pSVData->maWinData.mpActiveApplicationFrame == this )
- pSVData->maWinData.mpActiveApplicationFrame = nullptr;
+ if( pSVData->maFrameData.mpActiveApplicationFrame == this )
+ pSVData->maFrameData.mpActiveApplicationFrame = nullptr;
// reset hint of what was the last wheeled window
- if( pSVData->maWinData.mpLastWheelWindow == this )
- pSVData->maWinData.mpLastWheelWindow = nullptr;
+ if (pSVData->mpWinData->mpLastWheelWindow == this)
+ pSVData->mpWinData->mpLastWheelWindow = nullptr;
// reset marked windows
if ( mpWindowImpl->mpFrameData != nullptr )
@@ -474,8 +474,8 @@ void Window::dispose()
}
// reset Deactivate-Window
- if ( pSVData->maWinData.mpLastDeacWin == this )
- pSVData->maWinData.mpLastDeacWin = nullptr;
+ if (pSVData->mpWinData->mpLastDeacWin == this)
+ pSVData->mpWinData->mpLastDeacWin = nullptr;
if ( mpWindowImpl->mbFrame && mpWindowImpl->mpFrameData )
{
@@ -497,7 +497,8 @@ void Window::dispose()
// de-register as "top window child" at our parent, if necessary
if ( mpWindowImpl->mbFrame )
{
- bool bIsTopWindow = mpWindowImpl->mpWinData && ( mpWindowImpl->mpWinData->mnIsTopWindow == 1 );
+ bool bIsTopWindow
+ = mpWindowImpl->mpWinData && (mpWindowImpl->mpWinData->mnIsTopWindow == 1);
if ( mpWindowImpl->mpRealParent && bIsTopWindow )
{
ImplWinData* pParentWinData = mpWindowImpl->mpRealParent->ImplGetWinData();
@@ -517,12 +518,12 @@ void Window::dispose()
mpWindowImpl->mpBorderWindow.disposeAndClear();
if ( mpWindowImpl->mbFrame )
{
- if ( pSVData->maWinData.mpFirstFrame == this )
- pSVData->maWinData.mpFirstFrame = mpWindowImpl->mpFrameData->mpNextFrame;
+ if ( pSVData->maFrameData.mpFirstFrame == this )
+ pSVData->maFrameData.mpFirstFrame = mpWindowImpl->mpFrameData->mpNextFrame;
else
{
sal_Int32 nWindows = 0;
- vcl::Window* pSysWin = pSVData->maWinData.mpFirstFrame;
+ vcl::Window* pSysWin = pSVData->maFrameData.mpFirstFrame;
while ( pSysWin && pSysWin->mpWindowImpl->mpFrameData->mpNextFrame.get() != this )
{
pSysWin = pSysWin->mpWindowImpl->mpFrameData->mpNextFrame;
@@ -761,9 +762,9 @@ ImplWinData::~ImplWinData()
ImplFrameData::ImplFrameData( vcl::Window *pWindow )
{
ImplSVData* pSVData = ImplGetSVData();
- assert (pSVData->maWinData.mpFirstFrame.get() != pWindow);
- mpNextFrame = pSVData->maWinData.mpFirstFrame;
- pSVData->maWinData.mpFirstFrame = pWindow;
+ assert (pSVData->maFrameData.mpFirstFrame.get() != pWindow);
+ mpNextFrame = pSVData->maFrameData.mpFirstFrame;
+ pSVData->maFrameData.mpFirstFrame = pWindow;
mpFirstOverlap = nullptr;
mpFocusWin = nullptr;
mpMouseMoveWin = nullptr;
@@ -1205,7 +1206,7 @@ void Window::ImplInitAppFontData( vcl::Window const * pWindow )
ImplWinData* Window::ImplGetWinData() const
{
- if ( !mpWindowImpl->mpWinData )
+ if (!mpWindowImpl->mpWinData)
{
static const char* pNoNWF = getenv( "SAL_NO_NWF" );
@@ -1706,7 +1707,7 @@ void Window::ImplPosSizeWindow( long nX, long nY,
void Window::ImplNewInputContext()
{
ImplSVData* pSVData = ImplGetSVData();
- vcl::Window* pFocusWin = pSVData->maWinData.mpFocusWin;
+ vcl::Window* pFocusWin = pSVData->mpWinData->mpFocusWin;
if ( !pFocusWin )
return;
@@ -2208,7 +2209,7 @@ void Window::Show(bool bVisible, ShowFlags nFlags)
if ( !mpWindowImpl->mbFrame )
{
- if( mpWindowImpl->mpWinData && mpWindowImpl->mpWinData->mbEnableNativeWidget )
+ if (mpWindowImpl->mpWinData && mpWindowImpl->mpWinData->mbEnableNativeWidget)
{
/*
* #i48371# native theming: some themes draw outside the control
@@ -2424,11 +2425,9 @@ void Window::Enable( bool bEnable, bool bChild )
// #i56102# restore app focus win in case the
// window was disabled when the frame focus changed
ImplSVData* pSVData = ImplGetSVData();
- if( bEnable &&
- pSVData->maWinData.mpFocusWin == nullptr &&
- mpWindowImpl->mpFrameData->mbHasFocus &&
- mpWindowImpl->mpFrameData->mpFocusWin == this )
- pSVData->maWinData.mpFocusWin = this;
+ if (bEnable && pSVData->mpWinData->mpFocusWin == nullptr
+ && mpWindowImpl->mpFrameData->mbHasFocus && mpWindowImpl->mpFrameData->mpFocusWin == this)
+ pSVData->mpWinData->mpFocusWin = this;
if ( mpWindowImpl->mbDisabled != !bEnable )
{
@@ -2509,11 +2508,9 @@ void Window::EnableInput( bool bEnable, bool bChild )
// #i56102# restore app focus win in case the
// window was disabled when the frame focus changed
ImplSVData* pSVData = ImplGetSVData();
- if( bEnable &&
- pSVData->maWinData.mpFocusWin == nullptr &&
- mpWindowImpl->mpFrameData->mbHasFocus &&
- mpWindowImpl->mpFrameData->mpFocusWin == this )
- pSVData->maWinData.mpFocusWin = this;
+ if (bEnable && pSVData->mpWinData->mpFocusWin == nullptr
+ && mpWindowImpl->mpFrameData->mbHasFocus && mpWindowImpl->mpFrameData->mpFocusWin == this)
+ pSVData->mpWinData->mpFocusWin = this;
if ( bChild )
{
@@ -2562,7 +2559,7 @@ void Window::EnableInput( bool bEnable, const vcl::Window* pExcludeWindow )
}
// enable/disable floating system windows as well
- vcl::Window* pFrameWin = ImplGetSVData()->maWinData.mpFirstFrame;
+ vcl::Window* pFrameWin = ImplGetSVData()->maFrameData.mpFirstFrame;
while ( pFrameWin )
{
if( pFrameWin->ImplIsFloatingWindow() )
@@ -2988,7 +2985,7 @@ void Window::GrabFocus()
bool Window::HasFocus() const
{
- return (this == ImplGetSVData()->maWinData.mpFocusWin);
+ return (this == ImplGetSVData()->mpWinData->mpFocusWin);
}
void Window::GrabFocusToDocument()
@@ -3012,7 +3009,7 @@ void Window::SetFakeFocus( bool bFocus )
bool Window::HasChildPathFocus( bool bSystemWindow ) const
{
- vcl::Window* pFocusWin = ImplGetSVData()->maWinData.mpFocusWin;
+ vcl::Window* pFocusWin = ImplGetSVData()->mpWinData->mpFocusWin;
if ( pFocusWin )
return ImplIsWindowOrChild( pFocusWin, bSystemWindow );
return false;
@@ -3424,7 +3421,7 @@ void Window::ImplCallActivateListeners( vcl::Window *pOld )
else if( (mpWindowImpl->mnStyle & WB_INTROWIN) == 0 )
{
// top level frame reached: store hint for DefModalDialogParent
- ImplGetSVData()->maWinData.mpActiveApplicationFrame = mpWindowImpl->mpFrameWindow;
+ ImplGetSVData()->maFrameData.mpActiveApplicationFrame = mpWindowImpl->mpFrameWindow;
}
}
}
@@ -3644,7 +3641,7 @@ void Window::ImplNotifyIconifiedState( bool bIconified )
bool Window::HasActiveChildFrame() const
{
bool bRet = false;
- vcl::Window *pFrameWin = ImplGetSVData()->maWinData.mpFirstFrame;
+ vcl::Window *pFrameWin = ImplGetSVData()->maFrameData.mpFirstFrame;
while( pFrameWin )
{
if( pFrameWin != mpWindowImpl->mpFrameWindow )
diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx
index 2ad4bfcb4571..207e7708707a 100644
--- a/vcl/source/window/window2.cxx
+++ b/vcl/source/window/window2.cxx
@@ -222,7 +222,7 @@ IMPL_LINK( Window, ImplTrackTimerHdl, Timer*, pTimer, void )
ImplSVData* pSVData = ImplGetSVData();
// if Button-Repeat we have to change the timeout
- if ( pSVData->maWinData.mnTrackFlags & StartTrackingFlags::ButtonRepeat )
+ if ( pSVData->mpWinData->mnTrackFlags & StartTrackingFlags::ButtonRepeat )
pTimer->SetTimeout( GetSettings().GetMouseSettings().GetButtonRepeat() );
// create Tracking-Event
@@ -245,27 +245,27 @@ void Window::StartTracking( StartTrackingFlags nFlags )
{
ImplSVData* pSVData = ImplGetSVData();
- if ( pSVData->maWinData.mpTrackWin.get() != this )
+ if ( pSVData->mpWinData->mpTrackWin.get() != this )
{
- if ( pSVData->maWinData.mpTrackWin )
- pSVData->maWinData.mpTrackWin->EndTracking( TrackingEventFlags::Cancel );
+ if ( pSVData->mpWinData->mpTrackWin )
+ pSVData->mpWinData->mpTrackWin->EndTracking( TrackingEventFlags::Cancel );
}
if ( nFlags & (StartTrackingFlags::ScrollRepeat | StartTrackingFlags::ButtonRepeat) )
{
- pSVData->maWinData.mpTrackTimer = new AutoTimer;
+ pSVData->mpWinData->mpTrackTimer = new AutoTimer;
if ( nFlags & StartTrackingFlags::ScrollRepeat )
- pSVData->maWinData.mpTrackTimer->SetTimeout( MouseSettings::GetScrollRepeat() );
+ pSVData->mpWinData->mpTrackTimer->SetTimeout( MouseSettings::GetScrollRepeat() );
else
- pSVData->maWinData.mpTrackTimer->SetTimeout( MouseSettings::GetButtonStartRepeat() );
- pSVData->maWinData.mpTrackTimer->SetInvokeHandler( LINK( this, Window, ImplTrackTimerHdl ) );
- pSVData->maWinData.mpTrackTimer->SetDebugName( "vcl::Window pSVData->maWinData.mpTrackTimer" );
- pSVData->maWinData.mpTrackTimer->Start();
+ pSVData->mpWinData->mpTrackTimer->SetTimeout( MouseSettings::GetButtonStartRepeat() );
+ pSVData->mpWinData->mpTrackTimer->SetInvokeHandler( LINK( this, Window, ImplTrackTimerHdl ) );
+ pSVData->mpWinData->mpTrackTimer->SetDebugName( "vcl::Window pSVData->mpWinData->mpTrackTimer" );
+ pSVData->mpWinData->mpTrackTimer->Start();
}
- pSVData->maWinData.mpTrackWin = this;
- pSVData->maWinData.mnTrackFlags = nFlags;
+ pSVData->mpWinData->mpTrackWin = this;
+ pSVData->mpWinData->mnTrackFlags = nFlags;
CaptureMouse();
}
@@ -273,16 +273,16 @@ void Window::EndTracking( TrackingEventFlags nFlags )
{
ImplSVData* pSVData = ImplGetSVData();
- if ( pSVData->maWinData.mpTrackWin.get() == this )
+ if ( pSVData->mpWinData->mpTrackWin.get() == this )
{
- if ( pSVData->maWinData.mpTrackTimer )
+ if ( pSVData->mpWinData->mpTrackTimer )
{
- delete pSVData->maWinData.mpTrackTimer;
- pSVData->maWinData.mpTrackTimer = nullptr;
+ delete pSVData->mpWinData->mpTrackTimer;
+ pSVData->mpWinData->mpTrackTimer = nullptr;
}
- pSVData->maWinData.mpTrackWin = nullptr;
- pSVData->maWinData.mnTrackFlags = StartTrackingFlags::NONE;
+ pSVData->mpWinData->mpTrackWin = nullptr;
+ pSVData->mpWinData->mnTrackFlags = StartTrackingFlags::NONE;
ReleaseMouse();
// call EndTracking if required
@@ -311,21 +311,21 @@ void Window::EndTracking( TrackingEventFlags nFlags )
bool Window::IsTracking() const
{
- return (ImplGetSVData()->maWinData.mpTrackWin == this);
+ return (ImplGetSVData()->mpWinData->mpTrackWin == this);
}
void Window::StartAutoScroll( StartAutoScrollFlags nFlags )
{
ImplSVData* pSVData = ImplGetSVData();
- if ( pSVData->maWinData.mpAutoScrollWin.get() != this )
+ if ( pSVData->mpWinData->mpAutoScrollWin.get() != this )
{
- if ( pSVData->maWinData.mpAutoScrollWin )
- pSVData->maWinData.mpAutoScrollWin->EndAutoScroll();
+ if ( pSVData->mpWinData->mpAutoScrollWin )
+ pSVData->mpWinData->mpAutoScrollWin->EndAutoScroll();
}
- pSVData->maWinData.mpAutoScrollWin = this;
- pSVData->maWinData.mnAutoScrollFlags = nFlags;
+ pSVData->mpWinData->mpAutoScrollWin = this;
+ pSVData->mpWinData->mnAutoScrollFlags = nFlags;
pSVData->maAppData.mpWheelWindow = VclPtr<ImplWheelWindow>::Create( this );
}
@@ -333,10 +333,10 @@ void Window::EndAutoScroll()
{
ImplSVData* pSVData = ImplGetSVData();
- if ( pSVData->maWinData.mpAutoScrollWin.get() == this )
+ if ( pSVData->mpWinData->mpAutoScrollWin.get() == this )
{
- pSVData->maWinData.mpAutoScrollWin = nullptr;
- pSVData->maWinData.mnAutoScrollFlags = StartAutoScrollFlags::NONE;
+ pSVData->mpWinData->mpAutoScrollWin = nullptr;
+ pSVData->mpWinData->mnAutoScrollFlags = StartAutoScrollFlags::NONE;
pSVData->maAppData.mpWheelWindow->ImplStop();
pSVData->maAppData.mpWheelWindow->SetParentToDefaultWindow();
pSVData->maAppData.mpWheelWindow.disposeAndClear();
@@ -346,9 +346,9 @@ void Window::EndAutoScroll()
VclPtr<vcl::Window> Window::SaveFocus()
{
ImplSVData* pSVData = ImplGetSVData();
- if ( pSVData->maWinData.mpFocusWin )
+ if ( pSVData->mpWinData->mpFocusWin )
{
- return pSVData->maWinData.mpFocusWin;
+ return pSVData->mpWinData->mpFocusWin;
}
else
return nullptr;
@@ -814,7 +814,7 @@ void Window::EnableDocking( bool bEnable )
ImplGetDockingManager()->RemoveWindow( this );
}
-// retrieves the list of owner draw decorated windows for this window hierarchy
+// retrieves the list of owner draw decorated windows for this window hiearchy
::std::vector<VclPtr<vcl::Window> >& Window::ImplGetOwnerDrawList()
{
return ImplGetTopmostFrameWindow()->mpWindowImpl->mpFrameData->maOwnerDrawList;
diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx
index 16aec834ab5a..cd6e91b21f7e 100644
--- a/vcl/source/window/winproc.cxx
+++ b/vcl/source/window/winproc.cxx
@@ -66,15 +66,15 @@ static bool ImplHandleMouseFloatMode( vcl::Window* pChild, const Point& rMousePo
{
ImplSVData* pSVData = ImplGetSVData();
- if ( pSVData->maWinData.mpFirstFloat && !pSVData->maWinData.mpCaptureWin &&
- !pSVData->maWinData.mpFirstFloat->ImplIsFloatPopupModeWindow( pChild ) )
+ if (pSVData->mpWinData->mpFirstFloat && !pSVData->mpWinData->mpCaptureWin
+ && !pSVData->mpWinData->mpFirstFloat->ImplIsFloatPopupModeWindow(pChild))
{
/*
* #93895# since floats are system windows, coordinates have
* to be converted to float relative for the hittest
*/
bool bHitTestInsideRect = false;
- FloatingWindow* pFloat = pSVData->maWinData.mpFirstFloat->ImplFloatHitTest( pChild, rMousePos, bHitTestInsideRect );
+ FloatingWindow* pFloat = pSVData->mpWinData->mpFirstFloat->ImplFloatHitTest( pChild, rMousePos, bHitTestInsideRect );
FloatingWindow* pLastLevelFloat;
FloatWinPopupFlags nPopupFlags;
if ( nSVEvent == MouseNotifyEvent::MOUSEMOVE )
@@ -98,7 +98,7 @@ static bool ImplHandleMouseFloatMode( vcl::Window* pChild, const Point& rMousePo
{
if ( !pFloat )
{
- pLastLevelFloat = pSVData->maWinData.mpFirstFloat->ImplFindLastLevelFloat();
+ pLastLevelFloat = pSVData->mpWinData->mpFirstFloat->ImplFindLastLevelFloat();
pLastLevelFloat->EndPopupMode( FloatWinPopupEndFlags::Cancel | FloatWinPopupEndFlags::CloseAll );
return true;
}
@@ -121,7 +121,7 @@ static bool ImplHandleMouseFloatMode( vcl::Window* pChild, const Point& rMousePo
}
else
{
- pLastLevelFloat = pSVData->maWinData.mpFirstFloat->ImplFindLastLevelFloat();
+ pLastLevelFloat = pSVData->mpWinData->mpFirstFloat->ImplFindLastLevelFloat();
nPopupFlags = pLastLevelFloat->GetPopupModeFlags();
if ( !(nPopupFlags & FloatWinPopupFlags::NoMouseUpClose) )
{
@@ -135,7 +135,7 @@ static bool ImplHandleMouseFloatMode( vcl::Window* pChild, const Point& rMousePo
{
if ( !pFloat )
{
- pLastLevelFloat = pSVData->maWinData.mpFirstFloat->ImplFindLastLevelFloat();
+ pLastLevelFloat = pSVData->mpWinData->mpFirstFloat->ImplFindLastLevelFloat();
nPopupFlags = pLastLevelFloat->GetPopupModeFlags();
if ( nPopupFlags & FloatWinPopupFlags::AllMouseButtonClose )
{
@@ -314,21 +314,21 @@ bool ImplHandleMouseEvent( const VclPtr<vcl::Window>& xWindow, MouseNotifyEvent
else
pWinFrameData->mbMouseIn = true;
- DBG_ASSERT( !pSVData->maWinData.mpTrackWin ||
- (pSVData->maWinData.mpTrackWin == pSVData->maWinData.mpCaptureWin),
- "ImplHandleMouseEvent: TrackWin != CaptureWin" );
+ DBG_ASSERT(!pSVData->mpWinData->mpTrackWin
+ || (pSVData->mpWinData->mpTrackWin == pSVData->mpWinData->mpCaptureWin),
+ "ImplHandleMouseEvent: TrackWin != CaptureWin");
// AutoScrollMode
- if ( pSVData->maWinData.mpAutoScrollWin && (nSVEvent == MouseNotifyEvent::MOUSEBUTTONDOWN) )
+ if (pSVData->mpWinData->mpAutoScrollWin && (nSVEvent == MouseNotifyEvent::MOUSEBUTTONDOWN))
{
- pSVData->maWinData.mpAutoScrollWin->EndAutoScroll();
+ pSVData->mpWinData->mpAutoScrollWin->EndAutoScroll();
return true;
}
// find mouse window
- if ( pSVData->maWinData.mpCaptureWin )
+ if (pSVData->mpWinData->mpCaptureWin)
{
- pChild = pSVData->maWinData.mpCaptureWin;
+ pChild = pSVData->mpWinData->mpCaptureWin;
SAL_WARN_IF( xWindow != pChild->ImplGetFrameWindow(), "vcl",
"ImplHandleMouseEvent: mouse event is not sent to capture window" );
@@ -365,7 +365,8 @@ bool ImplHandleMouseEvent( const VclPtr<vcl::Window>& xWindow, MouseNotifyEvent
// no mouse messages to disabled windows
// #106845# if the window was disabled during capturing we have to pass the mouse events to release capturing
- if ( pSVData->maWinData.mpCaptureWin.get() != pChild && (!pChild->IsEnabled() || !pChild->IsInputEnabled() || pChild->IsInModalMode() ) )
+ if (pSVData->mpWinData->mpCaptureWin.get() != pChild
+ && (!pChild->IsEnabled() || !pChild->IsInputEnabled() || pChild->IsInModalMode()))
{
ImplHandleMouseFloatMode( pChild, aMousePos, nCode, nSVEvent, bMouseLeave );
if ( nSVEvent == MouseNotifyEvent::MOUSEMOVE )
@@ -399,10 +400,10 @@ bool ImplHandleMouseEvent( const VclPtr<vcl::Window>& xWindow, MouseNotifyEvent
}
// End ExtTextInput-Mode, if the user click in the same TopLevel Window
- if ( pSVData->maWinData.mpExtTextInputWin &&
- ((nSVEvent == MouseNotifyEvent::MOUSEBUTTONDOWN) ||
- (nSVEvent == MouseNotifyEvent::MOUSEBUTTONUP)) )
- pSVData->maWinData.mpExtTextInputWin->EndExtTextInput();
+ if (pSVData->mpWinData->mpExtTextInputWin
+ && ((nSVEvent == MouseNotifyEvent::MOUSEBUTTONDOWN)
+ || (nSVEvent == MouseNotifyEvent::MOUSEBUTTONUP)))
+ pSVData->mpWinData->mpExtTextInputWin->EndExtTextInput();
}
// determine mouse event data
@@ -602,11 +603,11 @@ bool ImplHandleMouseEvent( const VclPtr<vcl::Window>& xWindow, MouseNotifyEvent
// tracking window gets the mouse events
- if ( pSVData->maWinData.mpTrackWin )
- pChild = pSVData->maWinData.mpTrackWin;
+ if (pSVData->mpWinData->mpTrackWin)
+ pChild = pSVData->mpWinData->mpTrackWin;
// handle FloatingMode
- if ( !pSVData->maWinData.mpTrackWin && pSVData->maWinData.mpFirstFloat )
+ if (!pSVData->mpWinData->mpTrackWin && pSVData->mpWinData->mpFirstFloat)
{
if ( ImplHandleMouseFloatMode( pChild, aMousePos, nCode, nSVEvent, bMouseLeave ) )
{
@@ -632,8 +633,10 @@ bool ImplHandleMouseEvent( const VclPtr<vcl::Window>& xWindow, MouseNotifyEvent
// bring window into foreground on mouseclick
if ( nSVEvent == MouseNotifyEvent::MOUSEBUTTONDOWN )
{
- if( !pSVData->maWinData.mpFirstFloat && // totop for floating windows in popup would change the focus and would close them immediately
- !(pChild->ImplGetFrameWindow()->GetStyle() & WB_OWNERDRAWDECORATION) ) // ownerdrawdecorated windows must never grab focus
+ if (!pSVData->mpWinData->mpFirstFloat
+ && // totop for floating windows in popup would change the focus and would close them immediately
+ !(pChild->ImplGetFrameWindow()->GetStyle()
+ & WB_OWNERDRAWDECORATION)) // ownerdrawdecorated windows must never grab focus
pChild->ToTop();
if ( pChild->IsDisposed() )
return true;
@@ -646,16 +649,16 @@ bool ImplHandleMouseEvent( const VclPtr<vcl::Window>& xWindow, MouseNotifyEvent
bRet = false;
if ( nSVEvent == MouseNotifyEvent::MOUSEMOVE )
{
- if ( pSVData->maWinData.mpTrackWin )
+ if (pSVData->mpWinData->mpTrackWin)
{
TrackingEvent aTEvt( aMEvt );
pChild->Tracking( aTEvt );
if ( !pChild->IsDisposed() )
{
// When ScrollRepeat, we restart the timer
- if ( pSVData->maWinData.mpTrackTimer &&
- (pSVData->maWinData.mnTrackFlags & StartTrackingFlags::ScrollRepeat) )
- pSVData->maWinData.mpTrackTimer->Start();
+ if (pSVData->mpWinData->mpTrackTimer
+ && (pSVData->mpWinData->mnTrackFlags & StartTrackingFlags::ScrollRepeat))
+ pSVData->mpWinData->mpTrackTimer->Start();
}
bCallHelpRequest = false;
bRet = true;
@@ -663,8 +666,9 @@ bool ImplHandleMouseEvent( const VclPtr<vcl::Window>& xWindow, MouseNotifyEvent
else
{
// Auto-ToTop
- if ( !pSVData->maWinData.mpCaptureWin &&
- (pChild->GetSettings().GetMouseSettings().GetOptions() & MouseSettingsOptions::AutoFocus) )
+ if (!pSVData->mpWinData->mpCaptureWin
+ && (pChild->GetSettings().GetMouseSettings().GetOptions()
+ & MouseSettingsOptions::AutoFocus))
pChild->ToTop( ToTopFlags::NoGrabFocus );
if( pChild->IsDisposed() )
@@ -682,7 +686,7 @@ bool ImplHandleMouseEvent( const VclPtr<vcl::Window>& xWindow, MouseNotifyEvent
}
else if ( nSVEvent == MouseNotifyEvent::MOUSEBUTTONDOWN )
{
- if ( pSVData->maWinData.mpTrackWin )
+ if ( pSVData->mpWinData->mpTrackWin )
bRet = true;
else
{
@@ -692,7 +696,7 @@ bool ImplHandleMouseEvent( const VclPtr<vcl::Window>& xWindow, MouseNotifyEvent
}
else
{
- if ( pSVData->maWinData.mpTrackWin )
+ if (pSVData->mpWinData->mpTrackWin)
{
pChild->EndTracking();
bRet = true;
@@ -803,7 +807,7 @@ static vcl::Window* ImplGetKeyInputWindow( vcl::Window* pWindow )
// focus or the last time the focus.
// the first floating window always has the focus, try it, or any parent floating windows, first
- vcl::Window* pChild = pSVData->maWinData.mpFirstFloat;
+ vcl::Window* pChild = pSVData->mpWinData->mpFirstFloat;
while (pChild)
{
if (pChild->ImplGetWindowImpl()->mbFloatWin)
@@ -834,8 +838,8 @@ static vcl::Window* ImplGetKeyInputWindow( vcl::Window* pWindow )
// system this is often the case when a Lookup Choice Window has
// the focus - because this windows send the KeyInput directly to
// the window without resetting the focus
- SAL_WARN_IF( pChild != pSVData->maWinData.mpFocusWin, "vcl",
- "ImplHandleKey: Keyboard-Input is sent to a frame without focus" );
+ SAL_WARN_IF(pChild != pSVData->mpWinData->mpFocusWin, "vcl",
+ "ImplHandleKey: Keyboard-Input is sent to a frame without focus");
// no keyinput to disabled windows
if ( !pChild->IsEnabled() || !pChild->IsInputEnabled() || pChild->IsInModalMode() )
@@ -902,23 +906,23 @@ static bool ImplHandleKey( vcl::Window* pWindow, MouseNotifyEvent nSVEvent,
ImplDestroyHelpWindow( false );
// AutoScrollMode
- if ( pSVData->maWinData.mpAutoScrollWin )
+ if (pSVData->mpWinData->mpAutoScrollWin)
{
- pSVData->maWinData.mpAutoScrollWin->EndAutoScroll();
+ pSVData->mpWinData->mpAutoScrollWin->EndAutoScroll();
if ( nEvCode == KEY_ESCAPE )
return true;
}
- if ( pSVData->maWinData.mpTrackWin )
+ if (pSVData->mpWinData->mpTrackWin)
{
sal_uInt16 nOrigCode = aKeyCode.GetCode();
if ( nOrigCode == KEY_ESCAPE )
{
- pSVData->maWinData.mpTrackWin->EndTracking( TrackingEventFlags::Cancel | TrackingEventFlags::Key );
- if ( pSVData->maWinData.mpFirstFloat )
+ pSVData->mpWinData->mpTrackWin->EndTracking( TrackingEventFlags::Cancel | TrackingEventFlags::Key );
+ if (pSVData->mpWinData->mpFirstFloat)
{
- FloatingWindow* pLastLevelFloat = pSVData->maWinData.mpFirstFloat->ImplFindLastLevelFloat();
+ FloatingWindow* pLastLevelFloat = pSVData->mpWinData->mpFirstFloat->ImplFindLastLevelFloat();
if ( !(pLastLevelFloat->GetPopupModeFlags() & FloatWinPopupFlags::NoKeyClose) )
{
sal_uInt16 nEscCode = aKeyCode.GetCode();
@@ -931,7 +935,7 @@ static bool ImplHandleKey( vcl::Window* pWindow, MouseNotifyEvent nSVEvent,
}
else if ( nOrigCode == KEY_RETURN )
{
- pSVData->maWinData.mpTrackWin->EndTracking( TrackingEventFlags::Key );
+ pSVData->mpWinData->mpTrackWin->EndTracking( TrackingEventFlags::Key );
return true;
}
else
@@ -939,9 +943,9 @@ static bool ImplHandleKey( vcl::Window* pWindow, MouseNotifyEvent nSVEvent,
}
// handle FloatingMode
- if ( pSVData->maWinData.mpFirstFloat )
+ if (pSVData->mpWinData->mpFirstFloat)
{
- FloatingWindow* pLastLevelFloat = pSVData->maWinData.mpFirstFloat->ImplFindLastLevelFloat();
+ FloatingWindow* pLastLevelFloat = pSVData->mpWinData->mpFirstFloat->ImplFindLastLevelFloat();
if ( !(pLastLevelFloat->GetPopupModeFlags() & FloatWinPopupFlags::NoKeyClose) )
{
sal_uInt16 nCode = aKeyCode.GetCode();
@@ -1121,7 +1125,7 @@ static bool ImplHandleExtTextInput( vcl::Window* pWindow,
int nTries = 200;
while( nTries-- )
{
- pChild = pSVData->maWinData.mpExtTextInputWin;
+ pChild = pSVData->mpWinData->mpExtTextInputWin;
if ( !pChild )
{
pChild = ImplGetKeyInputWindow( pWindow );
@@ -1147,7 +1151,7 @@ static bool ImplHandleExtTextInput( vcl::Window* pWindow,
pChild->ImplGetWindowImpl()->mbExtTextInput = true;
pWinData->mpExtOldText = OUString();
pWinData->mpExtOldAttrAry.reset();
- pSVData->maWinData.mpExtTextInputWin = pChild;
+ pSVData->mpWinData->mpExtTextInputWin = pChild;
ImplCallCommand( pChild, CommandEventId::StartExtTextInput );
}
@@ -1204,13 +1208,13 @@ static bool ImplHandleExtTextInput( vcl::Window* pWindow,
static bool ImplHandleEndExtTextInput()
{
ImplSVData* pSVData = ImplGetSVData();
- vcl::Window* pChild = pSVData->maWinData.mpExtTextInputWin;
- bool bRet = false;
+ vcl::Window* pChild = pSVData->mpWinData->mpExtTextInputWin;
+ bool bRet = false;
if ( pChild )
{
pChild->ImplGetWindowImpl()->mbExtTextInput = false;
- pSVData->maWinData.mpExtTextInputWin = nullptr;
+ pSVData->mpWinData->mpExtTextInputWin = nullptr;
ImplWinData* pWinData = pChild->ImplGetWinData();
pWinData->mpExtOldText.reset();
pWinData->mpExtOldAttrAry.reset();
@@ -1225,7 +1229,7 @@ static void ImplHandleExtTextInputPos( vcl::Window* pWindow,
bool * pVertical )
{
ImplSVData* pSVData = ImplGetSVData();
- vcl::Window* pChild = pSVData->maWinData.mpExtTextInputWin;
+ vcl::Window* pChild = pSVData->mpWinData->mpExtTextInputWin;
if ( !pChild )
pChild = ImplGetKeyInputWindow( pWindow );
@@ -1334,8 +1338,8 @@ public:
bool HandleGestureEventBase::Setup()
{
- if (m_pSVData->maWinData.mpAutoScrollWin)
- m_pSVData->maWinData.mpAutoScrollWin->EndAutoScroll();
+ if (m_pSVData->mpWinData->mpAutoScrollWin)
+ m_pSVData->mpWinData->mpAutoScrollWin->EndAutoScroll();
if (ImplGetSVHelpData().mpHelpWin)
ImplDestroyHelpWindow( true );
return !m_pWindow->IsDisposed();
@@ -1346,13 +1350,13 @@ vcl::Window* HandleGestureEventBase::FindTarget()
// first check any floating window ( eg. drop down listboxes)
vcl::Window *pMouseWindow = nullptr;
- if (m_pSVData->maWinData.mpFirstFloat && !m_pSVData->maWinData.mpCaptureWin &&
- !m_pSVData->maWinData.mpFirstFloat->ImplIsFloatPopupModeWindow( m_pWindow ) )
+ if (m_pSVData->mpWinData->mpFirstFloat && !m_pSVData->mpWinData->mpCaptureWin &&
+ !m_pSVData->mpWinData->mpFirstFloat->ImplIsFloatPopupModeWindow( m_pWindow ) )
{
bool bHitTestInsideRect = false;
- pMouseWindow = m_pSVData->maWinData.mpFirstFloat->ImplFloatHitTest( m_pWindow, m_aMousePos, bHitTestInsideRect );
+ pMouseWindow = m_pSVData->mpWinData->mpFirstFloat->ImplFloatHitTest( m_pWindow, m_aMousePos, bHitTestInsideRect );
if (!pMouseWindow)
- pMouseWindow = m_pSVData->maWinData.mpFirstFloat;
+ pMouseWindow = m_pSVData->mpWinData->mpFirstFloat;
}
// then try the window directly beneath the mouse
if( !pMouseWindow )
@@ -1401,7 +1405,7 @@ vcl::Window *HandleGestureEventBase::Dispatch(vcl::Window* pMouseWindow)
{
vcl::Window* pFocusWindow = m_pWindow->ImplGetWindowImpl()->mpFrameData->mpFocusWin;
if ( pFocusWindow && (pFocusWindow != pMouseWindow) &&
- (pFocusWindow == m_pSVData->maWinData.mpFocusWin) )
+ (pFocusWindow == m_pSVData->mpWinData->mpFocusWin) )
{
// no wheel-messages to disabled windows
if ( pFocusWindow->IsEnabled() && pFocusWindow->IsInputEnabled() && ! pFocusWindow->IsInModalMode() )
@@ -1466,17 +1470,17 @@ bool HandleWheelEvent::HandleEvent(const SalWheelMouseEvent& rEvt)
// avoid the problem that scrolling via wheel to this point brings a widget
// under the mouse that also accepts wheel commands, so stick with the old
// widget if the time gap is very small
- if (shouldReusePreviousMouseWindow(pSVData->maWinData.maLastWheelEvent, rEvt) &&
- acceptableWheelScrollTarget(pSVData->maWinData.mpLastWheelWindow))
+ if (shouldReusePreviousMouseWindow(pSVData->mpWinData->maLastWheelEvent, rEvt) &&
+ acceptableWheelScrollTarget(pSVData->mpWinData->mpLastWheelWindow))
{
- xMouseWindow = pSVData->maWinData.mpLastWheelWindow;
+ xMouseWindow = pSVData->mpWinData->mpLastWheelWindow;
}
- pSVData->maWinData.maLastWheelEvent = rEvt;
+ pSVData->mpWinData->maLastWheelEvent = rEvt;
- pSVData->maWinData.mpLastWheelWindow = Dispatch(xMouseWindow);
+ pSVData->mpWinData->mpLastWheelWindow = Dispatch(xMouseWindow);
- return pSVData->maWinData.mpLastWheelWindow.get();
+ return pSVData->mpWinData->mpLastWheelWindow.get();
}
class HandleGestureEvent : public HandleGestureEventBase
@@ -1596,11 +1600,13 @@ static void KillOwnPopups( vcl::Window const * pWindow )
{
ImplSVData* pSVData = ImplGetSVData();
vcl::Window *pParent = pWindow->ImplGetWindowImpl()->mpFrameWindow;
- vcl::Window *pChild = pSVData->maWinData.mpFirstFloat;
+ vcl::Window *pChild = pSVData->mpWinData->mpFirstFloat;
if ( pChild && pParent->ImplIsWindowOrChild( pChild, true ) )
{
- if ( !(pSVData->maWinData.mpFirstFloat->GetPopupModeFlags() & FloatWinPopupFlags::NoAppFocusClose) )
- pSVData->maWinData.mpFirstFloat->EndPopupMode( FloatWinPopupEndFlags::Cancel | FloatWinPopupEndFlags::CloseAll );
+ if (!(pSVData->mpWinData->mpFirstFloat->GetPopupModeFlags()
+ & FloatWinPopupFlags::NoAppFocusClose))
+ pSVData->mpWinData->mpFirstFloat->EndPopupMode(FloatWinPopupEndFlags::Cancel
+ | FloatWinPopupEndFlags::CloseAll);
}
}
@@ -1766,8 +1772,9 @@ IMPL_LINK_NOARG(vcl::Window, ImplAsyncFocusHdl, void*, void)
ImplSVData* pSVData = ImplGetSVData();
vcl::Window* pTopLevelWindow = ImplGetWindowImpl()->mpFrameData->mpFocusWin->ImplGetFirstOverlapWindow();
- if ((!pTopLevelWindow->IsInputEnabled() || pTopLevelWindow->IsInModalMode()) && !pSVData->maWinData.mpExecuteDialogs.empty())
- pSVData->maWinData.mpExecuteDialogs.back()->ToTop(ToTopFlags::RestoreWhenMin | ToTopFlags::GrabFocusOnly);
+ if ((!pTopLevelWindow->IsInputEnabled() || pTopLevelWindow->IsInModalMode())
+ && !pSVData->mpWinData->mpExecuteDialogs.empty())
+ pSVData->mpWinData->mpExecuteDialogs.back()->ToTop(ToTopFlags::RestoreWhenMin | ToTopFlags::GrabFocusOnly);
else
pTopLevelWindow->GrabFocus();
}
@@ -1782,12 +1789,12 @@ IMPL_LINK_NOARG(vcl::Window, ImplAsyncFocusHdl, void*, void)
{
ImplSVData* pSVData = ImplGetSVData();
- if ( pSVData->maWinData.mpFocusWin == pFocusWin )
+ if (pSVData->mpWinData->mpFocusWin == pFocusWin)
{
// transfer the FocusWindow
vcl::Window* pOverlapWindow = pFocusWin->ImplGetFirstOverlapWindow();
pOverlapWindow->ImplGetWindowImpl()->mpLastFocusWindow = pFocusWin;
- pSVData->maWinData.mpFocusWin = nullptr;
+ pSVData->mpWinData->mpFocusWin = nullptr;
if ( pFocusWin->ImplGetWindowImpl()->mpCursor )
pFocusWin->ImplGetWindowImpl()->mpCursor->ImplHide();
@@ -1844,14 +1851,14 @@ static void ImplHandleLoseFocus( vcl::Window* pWindow )
ImplSVData* pSVData = ImplGetSVData();
// Abort the autoscroll if the frame loses focus
- if ( pSVData->maWinData.mpAutoScrollWin )
- pSVData->maWinData.mpAutoScrollWin->EndAutoScroll();
+ if (pSVData->mpWinData->mpAutoScrollWin)
+ pSVData->mpWinData->mpAutoScrollWin->EndAutoScroll();
// Abort tracking if the frame loses focus
- if ( pSVData->maWinData.mpTrackWin )
+ if (pSVData->mpWinData->mpTrackWin)
{
- if ( pSVData->maWinData.mpTrackWin->ImplGetWindowImpl()->mpFrameWindow == pWindow )
- pSVData->maWinData.mpTrackWin->EndTracking( TrackingEventFlags::Cancel );
+ if (pSVData->mpWinData->mpTrackWin->ImplGetWindowImpl()->mpFrameWindow == pWindow)
+ pSVData->mpWinData->mpTrackWin->EndTracking(TrackingEventFlags::Cancel);
}
pWindow->ImplGetWindowImpl()->mpFrameData->mbHasFocus = false;
@@ -1869,7 +1876,7 @@ static void ImplHandleLoseFocus( vcl::Window* pWindow )
pFocusWin->ImplGetWindowImpl()->mpCursor->ImplHide();
// Make sure that no menu is visible when a toplevel window loses focus.
- VclPtr<FloatingWindow> pFirstFloat = pSVData->maWinData.mpFirstFloat;
+ VclPtr<FloatingWindow> pFirstFloat = pSVData->mpWinData->mpFirstFloat;
if (pFirstFloat && !pWindow->GetParent())
pFirstFloat->EndPopupMode(FloatWinPopupEndFlags::Cancel | FloatWinPopupEndFlags::CloseAll);
}
@@ -1906,10 +1913,10 @@ static void ImplHandleClose( const vcl::Window* pWindow )
}
// on Close stop all floating modes and end popups
- if ( pSVData->maWinData.mpFirstFloat )
+ if (pSVData->mpWinData->mpFirstFloat)
{
FloatingWindow* pLastLevelFloat;
- pLastLevelFloat = pSVData->maWinData.mpFirstFloat->ImplFindLastLevelFloat();
+ pLastLevelFloat = pSVData->mpWinData->mpFirstFloat->ImplFindLastLevelFloat();
pLastLevelFloat->EndPopupMode( FloatWinPopupEndFlags::Cancel | FloatWinPopupEndFlags::CloseAll );
}
if ( ImplGetSVHelpData().mbExtHelpMode )
@@ -1917,11 +1924,11 @@ static void ImplHandleClose( const vcl::Window* pWindow )
if ( ImplGetSVHelpData().mpHelpWin )
ImplDestroyHelpWindow( false );
// AutoScrollMode
- if ( pSVData->maWinData.mpAutoScrollWin )
- pSVData->maWinData.mpAutoScrollWin->EndAutoScroll();
+ if (pSVData->mpWinData->mpAutoScrollWin)
+ pSVData->mpWinData->mpAutoScrollWin->EndAutoScroll();
- if ( pSVData->maWinData.mpTrackWin )
- pSVData->maWinData.mpTrackWin->EndTracking( TrackingEventFlags::Cancel | TrackingEventFlags::Key );
+ if (pSVData->mpWinData->mpTrackWin)
+ pSVData->mpWinData->mpTrackWin->EndTracking( TrackingEventFlags::Cancel | TrackingEventFlags::Key );
if (bWasPopup)
return;
@@ -2077,7 +2084,7 @@ static bool ImplHandleMenuEvent( vcl::Window const * pWindow, SalMenuEvent* pEve
static void ImplHandleSalKeyMod( vcl::Window* pWindow, SalKeyModEvent const * pEvent )
{
ImplSVData* pSVData = ImplGetSVData();
- vcl::Window* pTrackWin = pSVData->maWinData.mpTrackWin;
+ vcl::Window* pTrackWin = pSVData->mpWinData->mpTrackWin;
if ( pTrackWin )
pWindow = pTrackWin;
#ifdef MACOSX
@@ -2271,7 +2278,7 @@ static void ImplHandleSalQueryCharPosition( vcl::Window *pWindow,
pEvt->mnCursorBoundHeight = 0;
ImplSVData* pSVData = ImplGetSVData();
- vcl::Window* pChild = pSVData->maWinData.mpExtTextInputWin;
+ vcl::Window* pChild = pSVData->mpWinData->mpExtTextInputWin;
if ( !pChild )
pChild = ImplGetKeyInputWindow( pWindow );
diff --git a/vcl/source/window/wrkwin.cxx b/vcl/source/window/wrkwin.cxx
index 0fd563ecb587..58d476d158f5 100644
--- a/vcl/source/window/wrkwin.cxx
+++ b/vcl/source/window/wrkwin.cxx
@@ -61,8 +61,9 @@ void WorkWindow::ImplInit( vcl::Window* pParent, WinBits nStyle, SystemParentDat
if ( nStyle & WB_APP )
{
ImplSVData* pSVData = ImplGetSVData();
- SAL_WARN_IF( pSVData->maWinData.mpAppWin, "vcl", "WorkWindow::WorkWindow(): More than one window with style WB_APP" );
- pSVData->maWinData.mpAppWin = this;
+ SAL_WARN_IF(pSVData->maFrameData.mpAppWin, "vcl",
+ "WorkWindow::WorkWindow(): More than one window with style WB_APP");
+ pSVData->maFrameData.mpAppWin = this;
}
SetActivateMode( ActivateModeFlags::GrabFocus );
@@ -120,9 +121,9 @@ WorkWindow::~WorkWindow()
void WorkWindow::dispose()
{
ImplSVData* pSVData = ImplGetSVData();
- if ( pSVData->maWinData.mpAppWin == this )
+ if (pSVData->maFrameData.mpAppWin == this)
{
- pSVData->maWinData.mpAppWin = nullptr;
+ pSVData->maFrameData.mpAppWin = nullptr;
Application::Quit();
}
SystemWindow::dispose();
@@ -250,7 +251,7 @@ bool WorkWindow::Close()
bool bCanClose = SystemWindow::Close();
// if it's the application window then close the application
- if ( bCanClose && ( ImplGetSVData()->maWinData.mpAppWin == this ) )
+ if (bCanClose && (ImplGetSVData()->maFrameData.mpAppWin == this))
Application::Quit();
return bCanClose;
diff --git a/vcl/unx/generic/window/salframe.cxx b/vcl/unx/generic/window/salframe.cxx
index 95e1bf2f23b8..62f524fa72e4 100644
--- a/vcl/unx/generic/window/salframe.cxx
+++ b/vcl/unx/generic/window/salframe.cxx
@@ -2815,10 +2815,12 @@ bool X11SalFrame::HandleMouseEvent( XEvent *pEvent )
* applications do weird things.
*/
ImplSVData* pSVData = ImplGetSVData();
- if ( pSVData->maWinData.mpFirstFloat )
+ if (pSVData->mpWinData->mpFirstFloat)
{
- if (!(pSVData->maWinData.mpFirstFloat->GetPopupModeFlags() & FloatWinPopupFlags::NoAppFocusClose))
- pSVData->maWinData.mpFirstFloat->EndPopupMode( FloatWinPopupEndFlags::Cancel | FloatWinPopupEndFlags::CloseAll );
+ if (!(pSVData->mpWinData->mpFirstFloat->GetPopupModeFlags()
+ & FloatWinPopupFlags::NoAppFocusClose))
+ pSVData->mpWinData->mpFirstFloat->EndPopupMode(FloatWinPopupEndFlags::Cancel
+ | FloatWinPopupEndFlags::CloseAll);
}
}
@@ -3307,11 +3309,11 @@ bool X11SalFrame::HandleFocusEvent( XFocusChangeEvent const *pEvent )
bool nRet = CallCallback( SalEvent::GetFocus, nullptr );
if ((mpParent != nullptr && nStyle_ == SalFrameStyleFlags::NONE)
- && pSVData->maWinData.mpFirstFloat )
+ && pSVData->mpWinData->mpFirstFloat)
{
- FloatWinPopupFlags nMode = pSVData->maWinData.mpFirstFloat->GetPopupModeFlags();
- pSVData->maWinData.mpFirstFloat->SetPopupModeFlags(
- nMode & ~FloatWinPopupFlags::NoAppFocusClose);
+ FloatWinPopupFlags nMode = pSVData->mpWinData->mpFirstFloat->GetPopupModeFlags();
+ pSVData->mpWinData->mpFirstFloat->SetPopupModeFlags(
+ nMode & ~FloatWinPopupFlags::NoAppFocusClose);
}
return nRet;
}
diff --git a/vcl/unx/gtk3/gtk3gtkframe.cxx b/vcl/unx/gtk3/gtk3gtkframe.cxx
index 786aa40474d6..4651f81a0830 100644
--- a/vcl/unx/gtk3/gtk3gtkframe.cxx
+++ b/vcl/unx/gtk3/gtk3gtkframe.cxx
@@ -2452,11 +2452,11 @@ void GtkSalFrame::closePopup()
if (!m_nFloats)
return;
ImplSVData* pSVData = ImplGetSVData();
- if (!pSVData->maWinData.mpFirstFloat)
+ if (!pSVData->mpWinData->mpFirstFloat)
return;
- if (pSVData->maWinData.mpFirstFloat->ImplGetFrame() != this)
+ if (pSVData->mpWinData->mpFirstFloat->ImplGetFrame() != this)
return;
- pSVData->maWinData.mpFirstFloat->EndPopupMode(FloatWinPopupEndFlags::Cancel | FloatWinPopupEndFlags::CloseAll);
+ pSVData->mpWinData->mpFirstFloat->EndPopupMode(FloatWinPopupEndFlags::Cancel | FloatWinPopupEndFlags::CloseAll);
}
namespace