From 7c52d86f7b05fe7e0178f6d98a12a531b88a32ff Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 20 Sep 2017 09:06:34 +0200 Subject: rename mpFirstInstance->mpInstance Change-Id: I472df5821cb74a16d5ea00a1939b0e1bdf9072aa Reviewed-on: https://gerrit.libreoffice.org/42518 Tested-by: Jenkins Reviewed-by: Noel Grandin --- vcl/inc/win/saldata.hxx | 2 +- vcl/win/app/salinst.cxx | 30 +++++++++++++++--------------- vcl/win/app/saltimer.cxx | 10 +++++----- vcl/win/gdi/salprn.cxx | 4 ++-- vcl/win/window/salframe.cxx | 12 ++++++------ 5 files changed, 29 insertions(+), 29 deletions(-) (limited to 'vcl') diff --git a/vcl/inc/win/saldata.hxx b/vcl/inc/win/saldata.hxx index 245d986915b1..db6771c8095e 100644 --- a/vcl/inc/win/saldata.hxx +++ b/vcl/inc/win/saldata.hxx @@ -87,7 +87,7 @@ public: HHOOK mhSalObjMsgHook; // hook to get interesting msg for SalObject HWND mhWantLeaveMsg; // window handle, that want a MOUSELEAVE message AutoTimer* mpMouseLeaveTimer; // Timer for MouseLeave Test - WinSalInstance* mpFirstInstance; // pointer of first instance + WinSalInstance* mpInstance; WinSalFrame* mpFirstFrame; // pointer of first frame WinSalObject* mpFirstObject; // pointer of first object window WinSalVirtualDevice* mpFirstVD; // first VirDev diff --git a/vcl/win/app/salinst.cxx b/vcl/win/app/salinst.cxx index b77e84eac739..487cf7fb09d2 100644 --- a/vcl/win/app/salinst.cxx +++ b/vcl/win/app/salinst.cxx @@ -137,7 +137,7 @@ void SalYieldMutex::BeforeReleaseHandler() /// this function to avoid deadlock void SalYieldMutex::doAcquire( sal_uInt32 nLockCount ) { - WinSalInstance* pInst = GetSalData()->mpFirstInstance; + WinSalInstance* pInst = GetSalData()->mpInstance; if ( pInst && pInst->IsMainThread() ) { if ( pInst->mbNoYieldLock ) @@ -170,7 +170,7 @@ void SalYieldMutex::doAcquire( sal_uInt32 nLockCount ) sal_uInt32 SalYieldMutex::doRelease( const bool bUnlockAll ) { - WinSalInstance* pInst = GetSalData()->mpFirstInstance; + WinSalInstance* pInst = GetSalData()->mpInstance; if ( pInst && pInst->mbNoYieldLock && pInst->IsMainThread() ) return 1; @@ -183,7 +183,7 @@ sal_uInt32 SalYieldMutex::doRelease( const bool bUnlockAll ) bool SalYieldMutex::tryToAcquire() { - WinSalInstance* pInst = GetSalData()->mpFirstInstance; + WinSalInstance* pInst = GetSalData()->mpInstance; if ( pInst ) { if ( pInst->mbNoYieldLock && pInst->IsMainThread() ) @@ -197,20 +197,20 @@ bool SalYieldMutex::tryToAcquire() void ImplSalYieldMutexAcquireWithWait( sal_uInt32 nCount ) { - WinSalInstance* pInst = GetSalData()->mpFirstInstance; + WinSalInstance* pInst = GetSalData()->mpInstance; if ( pInst ) pInst->mpSalYieldMutex->acquire( nCount ); } bool ImplSalYieldMutexTryToAcquire() { - WinSalInstance* pInst = GetSalData()->mpFirstInstance; + WinSalInstance* pInst = GetSalData()->mpInstance; return pInst ? pInst->mpSalYieldMutex->tryToAcquire() : false; } void ImplSalYieldMutexRelease() { - WinSalInstance* pInst = GetSalData()->mpFirstInstance; + WinSalInstance* pInst = GetSalData()->mpInstance; if ( pInst ) { GdiFlush(); @@ -220,11 +220,11 @@ void ImplSalYieldMutexRelease() bool SalYieldMutex::IsCurrentThread() const { - if ( !GetSalData()->mpFirstInstance->mbNoYieldLock ) + if ( !GetSalData()->mpInstance->mbNoYieldLock ) // For the Windows backend, the LO identifier is the system thread ID return m_nThreadId == GetCurrentThreadId(); else - return GetSalData()->mpFirstInstance->IsMainThread(); + return GetSalData()->mpInstance->IsMainThread(); } void SalData::initKeyCodeMap() @@ -270,7 +270,7 @@ SalData::SalData() mhSalObjMsgHook = nullptr; // hook to get interesting msg for SalObject mhWantLeaveMsg = nullptr; // window handle, that want a MOUSELEAVE message mpMouseLeaveTimer = nullptr; // Timer for MouseLeave Test - mpFirstInstance = nullptr; // pointer of first instance + mpInstance = nullptr; // pointer of first instance mpFirstFrame = nullptr; // pointer of first frame mpFirstObject = nullptr; // pointer of first object window mpFirstVD = nullptr; // first VirDev @@ -436,7 +436,7 @@ SalInstance* CreateSalInstance() WinSalInstance* pInst = new WinSalInstance; // init instance (only one instance in this version !!!) - pSalData->mpFirstInstance = pInst; + pSalData->mpInstance = pInst; pInst->mhInst = pSalData->mhInst; pInst->mhComWnd = hComWnd; @@ -455,8 +455,8 @@ void DestroySalInstance( SalInstance* pInst ) ImplFreeSalGDI(); // reset instance - if ( pSalData->mpFirstInstance == pInst ) - pSalData->mpFirstInstance = nullptr; + if ( pSalData->mpInstance == pInst ) + pSalData->mpInstance = nullptr; delete pInst; } @@ -596,7 +596,7 @@ bool WinSalInstance::DoYield(bool bWait, bool bHandleAllCurrentEvents) LRESULT CALLBACK SalComWndProc( HWND, UINT nMsg, WPARAM wParam, LPARAM lParam, int& rDef ) { LRESULT nRet = 0; - WinSalInstance *pInst = GetSalData()->mpFirstInstance; + WinSalInstance *pInst = GetSalData()->mpInstance; switch ( nMsg ) { @@ -622,7 +622,7 @@ LRESULT CALLBACK SalComWndProc( HWND, UINT nMsg, WPARAM wParam, LPARAM lParam, i case SAL_MSG_CREATEFRAME: assert( !pInst->mbNoYieldLock ); pInst->mbNoYieldLock = true; - nRet = reinterpret_cast(ImplSalCreateFrame( GetSalData()->mpFirstInstance, reinterpret_cast(lParam), (SalFrameStyleFlags)wParam )); + nRet = reinterpret_cast(ImplSalCreateFrame( GetSalData()->mpInstance, reinterpret_cast(lParam), (SalFrameStyleFlags)wParam )); pInst->mbNoYieldLock = false; rDef = FALSE; break; @@ -662,7 +662,7 @@ LRESULT CALLBACK SalComWndProc( HWND, UINT nMsg, WPARAM wParam, LPARAM lParam, i case SAL_MSG_CREATEOBJECT: assert( !pInst->mbNoYieldLock ); pInst->mbNoYieldLock = true; - nRet = reinterpret_cast(ImplSalCreateObject( GetSalData()->mpFirstInstance, reinterpret_cast(lParam) )); + nRet = reinterpret_cast(ImplSalCreateObject( GetSalData()->mpInstance, reinterpret_cast(lParam) )); pInst->mbNoYieldLock = false; rDef = FALSE; break; diff --git a/vcl/win/app/saltimer.cxx b/vcl/win/app/saltimer.cxx index 1e11a9c4dba5..62fe620b5522 100644 --- a/vcl/win/app/saltimer.cxx +++ b/vcl/win/app/saltimer.cxx @@ -38,7 +38,7 @@ static void CALLBACK SalTimerProc(PVOID pParameter, BOOLEAN bTimerOrWaitFired); void WinSalTimer::ImplStop() { SalData *const pSalData = GetSalData(); - const WinSalInstance *pInst = pSalData->mpFirstInstance; + const WinSalInstance *pInst = pSalData->mpInstance; assert( !pInst || pSalData->mnAppThreadId == GetCurrentThreadId() ); const HANDLE hTimer = m_nTimerId; @@ -60,7 +60,7 @@ void WinSalTimer::ImplStop() void WinSalTimer::ImplStart( sal_uLong nMS ) { SalData* pSalData = GetSalData(); - assert( !pSalData->mpFirstInstance || pSalData->mnAppThreadId == GetCurrentThreadId() ); + assert( !pSalData->mpInstance || pSalData->mnAppThreadId == GetCurrentThreadId() ); // DueTime parameter is a DWORD, which is always an unsigned 32bit if (nMS > SAL_MAX_UINT32) @@ -95,7 +95,7 @@ WinSalTimer::~WinSalTimer() void WinSalTimer::Start( sal_uLong nMS ) { - WinSalInstance *pInst = GetSalData()->mpFirstInstance; + WinSalInstance *pInst = GetSalData()->mpInstance; if ( pInst && !pInst->IsMainThread() ) { BOOL const ret = PostMessageW(pInst->mhComWnd, @@ -108,7 +108,7 @@ void WinSalTimer::Start( sal_uLong nMS ) void WinSalTimer::Stop() { - WinSalInstance *pInst = GetSalData()->mpFirstInstance; + WinSalInstance *pInst = GetSalData()->mpInstance; if ( pInst && !pInst->IsMainThread() ) { BOOL const ret = PostMessageW(pInst->mhComWnd, @@ -131,7 +131,7 @@ static void CALLBACK SalTimerProc(PVOID data, BOOLEAN) // always post message when the timer fires, we will remove the ones // that happened during execution of the callback later directly from // the message queue - BOOL const ret = PostMessageW(GetSalData()->mpFirstInstance->mhComWnd, + BOOL const ret = PostMessageW(GetSalData()->mpInstance->mhComWnd, SAL_MSG_TIMER_CALLBACK, reinterpret_cast(data), 0); #if OSL_DEBUG_LEVEL > 0 diff --git a/vcl/win/gdi/salprn.cxx b/vcl/win/gdi/salprn.cxx index 4775e804f2f9..211a524705d2 100644 --- a/vcl/win/gdi/salprn.cxx +++ b/vcl/win/gdi/salprn.cxx @@ -397,7 +397,7 @@ static bool ImplUpdateSalJobSetup( WinSalInfoPrinter const * pPrinter, ImplJobSe // Release mutex, in the other case we don't get paints and so on sal_uInt32 nMutexCount = 0; - WinSalInstance* pInst = GetSalData()->mpFirstInstance; + WinSalInstance* pInst = GetSalData()->mpInstance; if ( pInst && pVisibleDlgParent ) nMutexCount = pInst->ReleaseYieldMutex( true ); @@ -1466,7 +1466,7 @@ bool WinSalPrinter::StartJob( const OUString* pFileName, // As the Telecom Balloon Fax driver tends to send messages repeatedly // we try to process first all, and then insert a dummy message while ( Application::Reschedule( true ) ); - BOOL const ret = PostMessageW(GetSalData()->mpFirstInstance->mhComWnd, SAL_MSG_DUMMY, 0, 0); + BOOL const ret = PostMessageW(GetSalData()->mpInstance->mhComWnd, SAL_MSG_DUMMY, 0, 0); SAL_WARN_IF(0 == ret, "vcl", "ERROR: PostMessage() failed!"); // bring up a file chooser if printing to file port but no file name given diff --git a/vcl/win/window/salframe.cxx b/vcl/win/window/salframe.cxx index 8a9c6066c461..3cdb402e0ad6 100644 --- a/vcl/win/window/salframe.cxx +++ b/vcl/win/window/salframe.cxx @@ -999,7 +999,7 @@ SalGraphics* WinSalFrame::AcquireGraphics() mpGraphics2->setHDC(nullptr); } - HDC hDC = reinterpret_cast((sal_IntPtr)SendMessageW( pSalData->mpFirstInstance->mhComWnd, + HDC hDC = reinterpret_cast((sal_IntPtr)SendMessageW( pSalData->mpInstance->mhComWnd, SAL_MSG_GETDC, reinterpret_cast(mhWnd), 0 )); if ( hDC ) @@ -1056,8 +1056,8 @@ void WinSalFrame::ReleaseGraphics( SalGraphics* pGraphics ) mpGraphics2->DeInitGraphics(); // we don't want to run the WinProc in the main thread directly // so we don't hit the mbNoYieldLock assert - if ( !pSalData->mpFirstInstance->IsMainThread() ) - SendMessageW( pSalData->mpFirstInstance->mhComWnd, + if ( !pSalData->mpInstance->IsMainThread() ) + SendMessageW( pSalData->mpInstance->mhComWnd, SAL_MSG_RELEASEDC, reinterpret_cast(mhWnd), reinterpret_cast(mpGraphics2->getHDC()) ); @@ -1519,7 +1519,7 @@ static void ImplSetParentFrame( WinSalFrame* pThis, HWND hNewParentWnd, bool bAs // create a new hwnd with the same styles HWND hWndParent = hNewParentWnd; // forward to main thread - HWND hWnd = reinterpret_cast((sal_IntPtr) SendMessageW( pSalData->mpFirstInstance->mhComWnd, + HWND hWnd = reinterpret_cast((sal_IntPtr) SendMessageW( pSalData->mpInstance->mhComWnd, bAsChild ? SAL_MSG_RECREATECHILDHWND : SAL_MSG_RECREATEHWND, reinterpret_cast(hWndParent), reinterpret_cast(pThis->mhWnd) )); @@ -1536,7 +1536,7 @@ static void ImplSetParentFrame( WinSalFrame* pThis, HWND hNewParentWnd, bool bAs if( bNeedCacheDC ) { // re-create cached DC - HDC hDC = reinterpret_cast((sal_IntPtr)SendMessageW( pSalData->mpFirstInstance->mhComWnd, + HDC hDC = reinterpret_cast((sal_IntPtr)SendMessageW( pSalData->mpInstance->mhComWnd, SAL_MSG_GETDC, reinterpret_cast(hWnd), 0 )); if ( hDC ) @@ -1592,7 +1592,7 @@ static void ImplSetParentFrame( WinSalFrame* pThis, HWND hNewParentWnd, bool bAs systemChildren.clear(); // Now destroy original HWND in the thread where it was created. - SendMessageW( GetSalData()->mpFirstInstance->mhComWnd, + SendMessageW( GetSalData()->mpInstance->mhComWnd, SAL_MSG_DESTROYHWND, (WPARAM) 0, reinterpret_cast(hWndOld)); } -- cgit